@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,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 helpers = require('../helpers.js');
|
|
5
5
|
const fetch = require('./fetch.js');
|
|
6
6
|
|
|
@@ -108,7 +108,7 @@ function createIndexedDbStore(options) {
|
|
|
108
108
|
return {
|
|
109
109
|
push: async (env) => {
|
|
110
110
|
try {
|
|
111
|
-
const serialized =
|
|
111
|
+
const serialized = browser.serializeEnvelope(env);
|
|
112
112
|
await push(getStore(), serialized, options.maxQueueSize || 30);
|
|
113
113
|
} catch {
|
|
114
114
|
//
|
|
@@ -116,7 +116,7 @@ function createIndexedDbStore(options) {
|
|
|
116
116
|
},
|
|
117
117
|
unshift: async (env) => {
|
|
118
118
|
try {
|
|
119
|
-
const serialized =
|
|
119
|
+
const serialized = browser.serializeEnvelope(env);
|
|
120
120
|
await unshift(getStore(), serialized, options.maxQueueSize || 30);
|
|
121
121
|
} catch {
|
|
122
122
|
//
|
|
@@ -126,7 +126,7 @@ function createIndexedDbStore(options) {
|
|
|
126
126
|
try {
|
|
127
127
|
const deserialized = await shift(getStore());
|
|
128
128
|
if (deserialized) {
|
|
129
|
-
return
|
|
129
|
+
return browser.parseEnvelope(deserialized);
|
|
130
130
|
}
|
|
131
131
|
} catch {
|
|
132
132
|
//
|
|
@@ -157,7 +157,7 @@ function makeIndexedDbOfflineTransport(
|
|
|
157
157
|
function makeBrowserOfflineTransport(
|
|
158
158
|
createTransport = fetch.makeFetchTransport,
|
|
159
159
|
) {
|
|
160
|
-
return makeIndexedDbOfflineTransport(
|
|
160
|
+
return makeIndexedDbOfflineTransport(browser.makeOfflineTransport(createTransport));
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
exports.createStore = createStore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"offline.js","sources":["../../../../../src/transports/offline.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"offline.js","sources":["../../../../../src/transports/offline.ts"],"sourcesContent":["import type {\n BaseTransportOptions,\n Envelope,\n OfflineStore,\n OfflineTransportOptions,\n Transport,\n} from '@sentry/core/browser';\nimport { makeOfflineTransport, parseEnvelope, serializeEnvelope } from '@sentry/core/browser';\nimport { WINDOW } from '../helpers';\nimport { makeFetchTransport } from './fetch';\n\n// 'Store', 'promisifyRequest' and 'createStore' were originally copied from the 'idb-keyval' package before being\n// modified and simplified: https://github.com/jakearchibald/idb-keyval\n//\n// At commit: 0420a704fd6cbb4225429c536b1f61112d012fca\n// Original license:\n\n// Copyright 2016, Jake Archibald\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\ntype Store = <T>(callback: (store: IDBObjectStore) => T | PromiseLike<T>) => Promise<T>;\n\nfunction promisifyRequest<T = undefined>(request: IDBRequest<T> | IDBTransaction): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n // @ts-expect-error - file size hacks\n request.oncomplete = request.onsuccess = () => resolve(request.result);\n // @ts-expect-error - file size hacks\n request.onabort = request.onerror = () => reject(request.error);\n });\n}\n\n/** Create or open an IndexedDb store */\nexport function createStore(dbName: string, storeName: string): Store {\n const request = indexedDB.open(dbName);\n request.onupgradeneeded = () => request.result.createObjectStore(storeName);\n const dbp = promisifyRequest(request);\n\n return callback => dbp.then(db => callback(db.transaction(storeName, 'readwrite').objectStore(storeName)));\n}\n\nfunction keys(store: IDBObjectStore): Promise<number[]> {\n return promisifyRequest(store.getAllKeys() as IDBRequest<number[]>);\n}\n\n/** Insert into the end of the store */\nexport function push(store: Store, value: Uint8Array | string, maxQueueSize: number): Promise<void> {\n return store(store => {\n return keys(store).then(keys => {\n if (keys.length >= maxQueueSize) {\n return;\n }\n\n // We insert with an incremented key so that the entries are popped in order\n store.put(value, Math.max(...keys, 0) + 1);\n return promisifyRequest(store.transaction);\n });\n });\n}\n\n/** Insert into the front of the store */\nexport function unshift(store: Store, value: Uint8Array | string, maxQueueSize: number): Promise<void> {\n return store(store => {\n return keys(store).then(keys => {\n if (keys.length >= maxQueueSize) {\n return;\n }\n\n // We insert with an decremented key so that the entries are popped in order\n store.put(value, Math.min(...keys, 0) - 1);\n return promisifyRequest(store.transaction);\n });\n });\n}\n\n/** Pop the oldest value from the store */\nexport function shift(store: Store): Promise<Uint8Array | string | undefined> {\n return store(store => {\n return keys(store).then(keys => {\n const firstKey = keys[0];\n if (firstKey == null) {\n return undefined;\n }\n\n return promisifyRequest(store.get(firstKey)).then(value => {\n store.delete(firstKey);\n return promisifyRequest(store.transaction).then(() => value);\n });\n });\n });\n}\n\nexport interface BrowserOfflineTransportOptions extends Omit<OfflineTransportOptions, 'createStore'> {\n /**\n * Name of indexedDb database to store envelopes in\n * Default: 'sentry-offline'\n */\n dbName?: string;\n /**\n * Name of indexedDb object store to store envelopes in\n * Default: 'queue'\n */\n storeName?: string;\n /**\n * Maximum number of envelopes to store\n * Default: 30\n */\n maxQueueSize?: number;\n}\n\nfunction createIndexedDbStore(options: BrowserOfflineTransportOptions): OfflineStore {\n let store: Store | undefined;\n\n // Lazily create the store only when it's needed\n function getStore(): Store {\n if (store == undefined) {\n store = createStore(options.dbName || 'sentry-offline', options.storeName || 'queue');\n }\n\n return store;\n }\n\n return {\n push: async (env: Envelope) => {\n try {\n const serialized = serializeEnvelope(env);\n await push(getStore(), serialized, options.maxQueueSize || 30);\n } catch {\n //\n }\n },\n unshift: async (env: Envelope) => {\n try {\n const serialized = serializeEnvelope(env);\n await unshift(getStore(), serialized, options.maxQueueSize || 30);\n } catch {\n //\n }\n },\n shift: async () => {\n try {\n const deserialized = await shift(getStore());\n if (deserialized) {\n return parseEnvelope(deserialized);\n }\n } catch {\n //\n }\n\n return undefined;\n },\n };\n}\n\nfunction makeIndexedDbOfflineTransport<T>(\n createTransport: (options: T) => Transport,\n): (options: T & BrowserOfflineTransportOptions) => Transport {\n return options => {\n const transport = createTransport({ ...options, createStore: createIndexedDbStore });\n\n WINDOW.addEventListener('online', async _ => {\n await transport.flush();\n });\n\n return transport;\n };\n}\n\n/**\n * Creates a transport that uses IndexedDb to store events when offline.\n */\nexport function makeBrowserOfflineTransport<T extends BaseTransportOptions>(\n createTransport: (options: T) => Transport = makeFetchTransport,\n): (options: T & BrowserOfflineTransportOptions) => Transport {\n return makeIndexedDbOfflineTransport<T>(makeOfflineTransport(createTransport));\n}\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AE;AAC1B,UAAU,OAAOC,qBAAa,CAAC,YAAY,CAAC;AAC5C,QAAQ;AACR,MAAM,EAAE,MAAM;AACd;AACA,MAAM;;AAEN,MAAM,OAAO,SAAS;AACtB,IAAI,CAAC;AACL,GAAG;AACH;;AAEA,SAAS,6BAA6B;AACtC,EAAE,eAAe;AACjB,EAA8D;AAC9D,EAAE,OAAO,WAAW;AACpB,IAAI,MAAM,SAAA,GAAY,eAAe,CAAC,EAAE,GAAG,OAAO,EAAE,WAAW,EAAE,oBAAA,EAAsB,CAAC;;AAExF,IAAIC,cAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,KAAK;AACjD,MAAM,MAAM,SAAS,CAAC,KAAK,EAAE;AAC7B,IAAI,CAAC,CAAC;;AAEN,IAAI,OAAO,SAAS;AACpB,EAAE,CAAC;AACH;;AAEA;AACA;AACA;AACO,SAAS,2BAA2B;AAC3C,EAAE,eAAe,GAA8BC,wBAAkB;AACjE,EAA8D;AAC9D,EAAE,OAAO,6BAA6B,CAAIC,4BAAoB,CAAC,eAAe,CAAC,CAAC;AAChF;;;;;;;;"}
|
|
@@ -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
|
|
|
5
5
|
/**
|
|
6
6
|
* Creates an envelope from a user feedback.
|
|
@@ -24,11 +24,11 @@ function createUserFeedbackEnvelope(
|
|
|
24
24
|
version: metadata.sdk.version,
|
|
25
25
|
},
|
|
26
26
|
}),
|
|
27
|
-
...(!!tunnel && !!dsn && { dsn:
|
|
27
|
+
...(!!tunnel && !!dsn && { dsn: browser.dsnToString(dsn) }),
|
|
28
28
|
};
|
|
29
29
|
const item = createUserFeedbackEnvelopeItem(feedback);
|
|
30
30
|
|
|
31
|
-
return
|
|
31
|
+
return browser.createEnvelope(headers, [item]);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
function createUserFeedbackEnvelopeItem(feedback) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userfeedback.js","sources":["../../../../src/userfeedback.ts"],"sourcesContent":["import type { DsnComponents, EventEnvelope, SdkMetadata, UserFeedback, UserFeedbackItem } from '@sentry/core';\nimport { createEnvelope, dsnToString } from '@sentry/core';\n\n/**\n * Creates an envelope from a user feedback.\n */\nexport function createUserFeedbackEnvelope(\n feedback: UserFeedback,\n {\n metadata,\n tunnel,\n dsn,\n }: {\n metadata: SdkMetadata | undefined;\n tunnel: string | undefined;\n dsn: DsnComponents | undefined;\n },\n): EventEnvelope {\n const headers: EventEnvelope[0] = {\n event_id: feedback.event_id,\n sent_at: new Date().toISOString(),\n ...(metadata?.sdk && {\n sdk: {\n name: metadata.sdk.name,\n version: metadata.sdk.version,\n },\n }),\n ...(!!tunnel && !!dsn && { dsn: dsnToString(dsn) }),\n };\n const item = createUserFeedbackEnvelopeItem(feedback);\n\n return createEnvelope(headers, [item]);\n}\n\nfunction createUserFeedbackEnvelopeItem(feedback: UserFeedback): UserFeedbackItem {\n const feedbackHeaders: UserFeedbackItem[0] = {\n type: 'user_report',\n };\n return [feedbackHeaders, feedback];\n}\n"],"names":["dsnToString","createEnvelope"],"mappings":";;;;AAGA;AACA;AACA;AACO,SAAS,0BAA0B;AAC1C,EAAE,QAAQ;AACV,EAAE;AACF,IAAI,QAAQ;AACZ,IAAI,MAAM;AACV,IAAI,GAAG;AACP;;AAIE;AACF,EAAiB;AACjB,EAAE,MAAM,OAAO,GAAqB;AACpC,IAAI,QAAQ,EAAE,QAAQ,CAAC,QAAQ;AAC/B,IAAI,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;AACrC,IAAI,IAAI,QAAQ,EAAE,OAAO;AACzB,MAAM,GAAG,EAAE;AACX,QAAQ,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,IAAI;AAC/B,QAAQ,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO;AACrC,OAAO;AACP,KAAK,CAAC;AACN,IAAI,IAAI,CAAC,CAAC,MAAA,IAAU,CAAC,CAAC,GAAA,IAAO,EAAE,GAAG,EAAEA,
|
|
1
|
+
{"version":3,"file":"userfeedback.js","sources":["../../../../src/userfeedback.ts"],"sourcesContent":["import type { DsnComponents, EventEnvelope, SdkMetadata, UserFeedback, UserFeedbackItem } from '@sentry/core/browser';\nimport { createEnvelope, dsnToString } from '@sentry/core/browser';\n\n/**\n * Creates an envelope from a user feedback.\n */\nexport function createUserFeedbackEnvelope(\n feedback: UserFeedback,\n {\n metadata,\n tunnel,\n dsn,\n }: {\n metadata: SdkMetadata | undefined;\n tunnel: string | undefined;\n dsn: DsnComponents | undefined;\n },\n): EventEnvelope {\n const headers: EventEnvelope[0] = {\n event_id: feedback.event_id,\n sent_at: new Date().toISOString(),\n ...(metadata?.sdk && {\n sdk: {\n name: metadata.sdk.name,\n version: metadata.sdk.version,\n },\n }),\n ...(!!tunnel && !!dsn && { dsn: dsnToString(dsn) }),\n };\n const item = createUserFeedbackEnvelopeItem(feedback);\n\n return createEnvelope(headers, [item]);\n}\n\nfunction createUserFeedbackEnvelopeItem(feedback: UserFeedback): UserFeedbackItem {\n const feedbackHeaders: UserFeedbackItem[0] = {\n type: 'user_report',\n };\n return [feedbackHeaders, feedback];\n}\n"],"names":["dsnToString","createEnvelope"],"mappings":";;;;AAGA;AACA;AACA;AACO,SAAS,0BAA0B;AAC1C,EAAE,QAAQ;AACV,EAAE;AACF,IAAI,QAAQ;AACZ,IAAI,MAAM;AACV,IAAI,GAAG;AACP;;AAIE;AACF,EAAiB;AACjB,EAAE,MAAM,OAAO,GAAqB;AACpC,IAAI,QAAQ,EAAE,QAAQ,CAAC,QAAQ;AAC/B,IAAI,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;AACrC,IAAI,IAAI,QAAQ,EAAE,OAAO;AACzB,MAAM,GAAG,EAAE;AACX,QAAQ,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,IAAI;AAC/B,QAAQ,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO;AACrC,OAAO;AACP,KAAK,CAAC;AACN,IAAI,IAAI,CAAC,CAAC,MAAA,IAAU,CAAC,CAAC,GAAA,IAAO,EAAE,GAAG,EAAEA,mBAAW,CAAC,GAAG,CAAA,EAAG,CAAC;AACvD,GAAG;AACH,EAAE,MAAM,IAAA,GAAO,8BAA8B,CAAC,QAAQ,CAAC;;AAEvD,EAAE,OAAOC,sBAAc,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC;AACxC;;AAEA,SAAS,8BAA8B,CAAC,QAAQ,EAAkC;AAClF,EAAE,MAAM,eAAe,GAAwB;AAC/C,IAAI,IAAI,EAAE,aAAa;AACvB,GAAG;AACH,EAAE,OAAO,CAAC,eAAe,EAAE,QAAQ,CAAC;AACpC;;;;"}
|
|
@@ -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 debugBuild = require('../debug-build.js');
|
|
5
5
|
const helpers = require('../helpers.js');
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@ const helpers = require('../helpers.js');
|
|
|
11
11
|
function checkAndWarnIfIsEmbeddedBrowserExtension() {
|
|
12
12
|
if (_isEmbeddedBrowserExtension()) {
|
|
13
13
|
if (debugBuild.DEBUG_BUILD) {
|
|
14
|
-
|
|
14
|
+
browser.consoleSandbox(() => {
|
|
15
15
|
// eslint-disable-next-line no-console
|
|
16
16
|
console.error(
|
|
17
17
|
'[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',
|
|
@@ -45,7 +45,7 @@ function _isEmbeddedBrowserExtension() {
|
|
|
45
45
|
return false;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
const href =
|
|
48
|
+
const href = browser.getLocationHref();
|
|
49
49
|
|
|
50
50
|
// Running the SDK in a dedicated extension page and calling Sentry.init is fine; no risk of data leakage
|
|
51
51
|
const isDedicatedExtensionPage =
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detectBrowserExtension.js","sources":["../../../../../src/utils/detectBrowserExtension.ts"],"sourcesContent":["import { consoleSandbox, getLocationHref } from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\n\ntype ExtensionRuntime = {\n runtime?: {\n id?: string;\n };\n};\ntype ExtensionProperties = {\n chrome?: ExtensionRuntime;\n browser?: ExtensionRuntime;\n nw?: unknown;\n};\n\n/**\n * Returns true if the SDK is running in an embedded browser extension.\n * Stand-alone browser extensions (which do not share the same data as the main browser page) are fine.\n */\nexport function checkAndWarnIfIsEmbeddedBrowserExtension(): boolean {\n if (_isEmbeddedBrowserExtension()) {\n if (DEBUG_BUILD) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.error(\n '[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',\n );\n });\n }\n\n return true;\n }\n\n return false;\n}\n\nfunction _isEmbeddedBrowserExtension(): boolean {\n if (typeof WINDOW.window === 'undefined') {\n // No need to show the error if we're not in a browser window environment (e.g. service workers)\n return false;\n }\n\n const _window = WINDOW as typeof WINDOW & ExtensionProperties;\n\n // Running the SDK in NW.js, which appears like a browser extension but isn't, is also fine\n // see: https://github.com/getsentry/sentry-javascript/issues/12668\n if (_window.nw) {\n return false;\n }\n\n const extensionObject = _window['chrome'] || _window['browser'];\n\n if (!extensionObject?.runtime?.id) {\n return false;\n }\n\n const href = getLocationHref();\n\n // Running the SDK in a dedicated extension page and calling Sentry.init is fine; no risk of data leakage\n const isDedicatedExtensionPage =\n WINDOW === WINDOW.top &&\n /^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\\/\\//.test(href);\n\n return !isDedicatedExtensionPage;\n}\n"],"names":["DEBUG_BUILD","consoleSandbox","WINDOW","getLocationHref"],"mappings":";;;;;;AAeA;AACA;AACA;AACA;AACO,SAAS,wCAAwC,GAAY;AACpE,EAAE,IAAI,2BAA2B,EAAE,EAAE;AACrC,IAAI,IAAIA,sBAAW,EAAE;AACrB,MAAMC,
|
|
1
|
+
{"version":3,"file":"detectBrowserExtension.js","sources":["../../../../../src/utils/detectBrowserExtension.ts"],"sourcesContent":["import { consoleSandbox, getLocationHref } from '@sentry/core/browser';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\n\ntype ExtensionRuntime = {\n runtime?: {\n id?: string;\n };\n};\ntype ExtensionProperties = {\n chrome?: ExtensionRuntime;\n browser?: ExtensionRuntime;\n nw?: unknown;\n};\n\n/**\n * Returns true if the SDK is running in an embedded browser extension.\n * Stand-alone browser extensions (which do not share the same data as the main browser page) are fine.\n */\nexport function checkAndWarnIfIsEmbeddedBrowserExtension(): boolean {\n if (_isEmbeddedBrowserExtension()) {\n if (DEBUG_BUILD) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.error(\n '[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',\n );\n });\n }\n\n return true;\n }\n\n return false;\n}\n\nfunction _isEmbeddedBrowserExtension(): boolean {\n if (typeof WINDOW.window === 'undefined') {\n // No need to show the error if we're not in a browser window environment (e.g. service workers)\n return false;\n }\n\n const _window = WINDOW as typeof WINDOW & ExtensionProperties;\n\n // Running the SDK in NW.js, which appears like a browser extension but isn't, is also fine\n // see: https://github.com/getsentry/sentry-javascript/issues/12668\n if (_window.nw) {\n return false;\n }\n\n const extensionObject = _window['chrome'] || _window['browser'];\n\n if (!extensionObject?.runtime?.id) {\n return false;\n }\n\n const href = getLocationHref();\n\n // Running the SDK in a dedicated extension page and calling Sentry.init is fine; no risk of data leakage\n const isDedicatedExtensionPage =\n WINDOW === WINDOW.top &&\n /^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\\/\\//.test(href);\n\n return !isDedicatedExtensionPage;\n}\n"],"names":["DEBUG_BUILD","consoleSandbox","WINDOW","getLocationHref"],"mappings":";;;;;;AAeA;AACA;AACA;AACA;AACO,SAAS,wCAAwC,GAAY;AACpE,EAAE,IAAI,2BAA2B,EAAE,EAAE;AACrC,IAAI,IAAIA,sBAAW,EAAE;AACrB,MAAMC,sBAAc,CAAC,MAAM;AAC3B;AACA,QAAQ,OAAO,CAAC,KAAK;AACrB,UAAU,mJAAmJ;AAC7J,SAAS;AACT,MAAM,CAAC,CAAC;AACR,IAAI;;AAEJ,IAAI,OAAO,IAAI;AACf,EAAE;;AAEF,EAAE,OAAO,KAAK;AACd;;AAEA,SAAS,2BAA2B,GAAY;AAChD,EAAE,IAAI,OAAOC,cAAM,CAAC,MAAA,KAAW,WAAW,EAAE;AAC5C;AACA,IAAI,OAAO,KAAK;AAChB,EAAE;;AAEF,EAAE,MAAM,OAAA,GAAUA,cAAA;;AAElB;AACA;AACA,EAAE,IAAI,OAAO,CAAC,EAAE,EAAE;AAClB,IAAI,OAAO,KAAK;AAChB,EAAE;;AAEF,EAAE,MAAM,eAAA,GAAkB,OAAO,CAAC,QAAQ,CAAA,IAAK,OAAO,CAAC,SAAS,CAAC;;AAEjE,EAAE,IAAI,CAAC,eAAe,EAAE,OAAO,EAAE,EAAE,EAAE;AACrC,IAAI,OAAO,KAAK;AAChB,EAAE;;AAEF,EAAE,MAAM,IAAA,GAAOC,uBAAe,EAAE;;AAEhC;AACA,EAAE,MAAM,wBAAA;AACR,IAAID,cAAA,KAAWA,cAAM,CAAC,GAAA;AACtB,IAAI,oFAAoF,CAAC,IAAI,CAAC,IAAI,CAAC;;AAEnG,EAAE,OAAO,CAAC,wBAAwB;AAClC;;;;"}
|
|
@@ -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 helpers = require('../helpers.js');
|
|
5
5
|
|
|
6
6
|
// Single source of truth: as const array provides both the runtime list and the type.
|
|
@@ -111,10 +111,10 @@ async function lazyLoadIntegration(
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
function getScriptURL(bundle) {
|
|
114
|
-
const client =
|
|
114
|
+
const client = browser.getClient();
|
|
115
115
|
const baseURL = client?.getOptions()?.cdnBaseUrl || 'https://browser.sentry-cdn.com';
|
|
116
116
|
|
|
117
|
-
return new URL(`/${
|
|
117
|
+
return new URL(`/${browser.SDK_VERSION}/${bundle}.min.js`, baseURL).toString();
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
exports.lazyLoadIntegration = lazyLoadIntegration;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazyLoadIntegration.js","sources":["../../../../../src/utils/lazyLoadIntegration.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core';\nimport { getClient, SDK_VERSION } from '@sentry/core';\nimport type { BrowserClient } from '../client';\nimport { WINDOW } from '../helpers';\n\n// Single source of truth: as const array provides both the runtime list and the type.\n// Bundle file names are derived: strip 'Integration' suffix, lowercase.\n// Exceptions (hyphenated bundle names) are listed in HYPHENATED_BUNDLES.\nconst LAZY_LOADABLE_NAMES = [\n 'replayIntegration',\n 'replayCanvasIntegration',\n 'feedbackIntegration',\n 'feedbackModalIntegration',\n 'feedbackScreenshotIntegration',\n 'captureConsoleIntegration',\n 'contextLinesIntegration',\n 'linkedErrorsIntegration',\n 'dedupeIntegration',\n 'extraErrorDataIntegration',\n 'graphqlClientIntegration',\n 'httpClientIntegration',\n 'reportingObserverIntegration',\n 'rewriteFramesIntegration',\n 'browserProfilingIntegration',\n 'moduleMetadataIntegration',\n 'instrumentAnthropicAiClient',\n 'instrumentOpenAiClient',\n 'instrumentGoogleGenAIClient',\n 'instrumentLangGraph',\n 'createLangChainCallbackHandler',\n 'instrumentLangChainEmbeddings',\n] as const;\n\ntype ElementOf<T extends readonly unknown[]> = T[number];\ntype LazyLoadableIntegrationName = ElementOf<typeof LAZY_LOADABLE_NAMES>;\n\nconst HYPHENATED_BUNDLES: Partial<Record<LazyLoadableIntegrationName, string>> = {\n replayCanvasIntegration: 'replay-canvas',\n feedbackModalIntegration: 'feedback-modal',\n feedbackScreenshotIntegration: 'feedback-screenshot',\n};\n\nfunction getBundleName(name: string): string {\n return HYPHENATED_BUNDLES[name as LazyLoadableIntegrationName] || name.replace('Integration', '').toLowerCase();\n}\n\nconst WindowWithMaybeIntegration = WINDOW as {\n Sentry?: Partial<Record<LazyLoadableIntegrationName, IntegrationFn>>;\n};\n\n/**\n * Lazy load an integration from the CDN.\n * Rejects if the integration cannot be loaded.\n */\nexport async function lazyLoadIntegration(\n name: LazyLoadableIntegrationName,\n scriptNonce?: string,\n): Promise<IntegrationFn> {\n const bundle = LAZY_LOADABLE_NAMES.includes(name) ? getBundleName(name) : undefined;\n\n // `window.Sentry` is only set when using a CDN bundle, but this method can also be used via the NPM package\n const sentryOnWindow = (WindowWithMaybeIntegration.Sentry = WindowWithMaybeIntegration.Sentry || {});\n\n if (!bundle) {\n throw new Error(`Cannot lazy load integration: ${name}`);\n }\n\n // Bail if the integration already exists\n const existing = sentryOnWindow[name];\n // The `feedbackIntegration` is loaded by default in the CDN bundles,\n // so we need to differentiate between the real integration and the shim.\n // if only the shim exists, we still want to lazy load the real integration.\n if (typeof existing === 'function' && !('_isShim' in existing)) {\n return existing;\n }\n\n const url = getScriptURL(bundle);\n const script = WINDOW.document.createElement('script');\n script.src = url;\n script.crossOrigin = 'anonymous';\n script.referrerPolicy = 'strict-origin';\n\n if (scriptNonce) {\n script.setAttribute('nonce', scriptNonce);\n }\n\n const waitForLoad = new Promise<void>((resolve, reject) => {\n script.addEventListener('load', () => resolve());\n script.addEventListener('error', reject);\n });\n\n const currentScript = WINDOW.document.currentScript;\n const parent = WINDOW.document.body || WINDOW.document.head || currentScript?.parentElement;\n\n if (parent) {\n parent.appendChild(script);\n } else {\n throw new Error(`Could not find parent element to insert lazy-loaded ${name} script`);\n }\n\n try {\n await waitForLoad;\n } catch {\n throw new Error(`Error when loading integration: ${name}`);\n }\n\n const integrationFn = sentryOnWindow[name];\n\n if (typeof integrationFn !== 'function') {\n throw new Error(`Could not load integration: ${name}`);\n }\n\n return integrationFn;\n}\n\nfunction getScriptURL(bundle: string): string {\n const client = getClient<BrowserClient>();\n const baseURL = client?.getOptions()?.cdnBaseUrl || 'https://browser.sentry-cdn.com';\n\n return new URL(`/${SDK_VERSION}/${bundle}.min.js`, baseURL).toString();\n}\n"],"names":["WINDOW","getClient","SDK_VERSION"],"mappings":";;;;;AAKA;AACA;AACA;AACA,MAAM,sBAAsB;AAC5B,EAAE,mBAAmB;AACrB,EAAE,yBAAyB;AAC3B,EAAE,qBAAqB;AACvB,EAAE,0BAA0B;AAC5B,EAAE,+BAA+B;AACjC,EAAE,2BAA2B;AAC7B,EAAE,yBAAyB;AAC3B,EAAE,yBAAyB;AAC3B,EAAE,mBAAmB;AACrB,EAAE,2BAA2B;AAC7B,EAAE,0BAA0B;AAC5B,EAAE,uBAAuB;AACzB,EAAE,8BAA8B;AAChC,EAAE,0BAA0B;AAC5B,EAAE,6BAA6B;AAC/B,EAAE,2BAA2B;AAC7B,EAAE,6BAA6B;AAC/B,EAAE,wBAAwB;AAC1B,EAAE,6BAA6B;AAC/B,EAAE,qBAAqB;AACvB,EAAE,gCAAgC;AAClC,EAAE,+BAA+B;AACjC,CAAA;;AAKA,MAAM,kBAAkB,GAAyD;AACjF,EAAE,uBAAuB,EAAE,eAAe;AAC1C,EAAE,wBAAwB,EAAE,gBAAgB;AAC5C,EAAE,6BAA6B,EAAE,qBAAqB;AACtD,CAAC;;AAED,SAAS,aAAa,CAAC,IAAI,EAAkB;AAC7C,EAAE,OAAO,kBAAkB,CAAC,IAAA,EAAK,IAAmC,IAAI,CAAC,OAAO,CAAC,aAAa,EAA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BAAA,CAAA,OAAA,EAAA,MAAA,CAAA;AACA,EAAA,CAAA,CAAA;;AAEA,EAAA,MAAA,aAAA,GAAAA,cAAA,CAAA,QAAA,CAAA,aAAA;AACA,EAAA,MAAA,MAAA,GAAAA,cAAA,CAAA,QAAA,CAAA,IAAA,IAAAA,cAAA,CAAA,QAAA,CAAA,IAAA,IAAA,aAAA,EAAA,aAAA;;AAEA,EAAA,IAAA,MAAA,EAAA;AACA,IAAA,MAAA,CAAA,WAAA,CAAA,MAAA,CAAA;AACA,EAAA,CAAA,MAAA;AACA,IAAA,MAAA,IAAA,KAAA,CAAA,CAAA,oDAAA,EAAA,IAAA,CAAA,OAAA,CAAA,CAAA;AACA,EAAA;;AAEA,EAAA,IAAA;AACA,IAAA,MAAA,WAAA;AACA,EAAA,CAAA,CAAA,MAAA;AACA,IAAA,MAAA,IAAA,KAAA,CAAA,CAAA,gCAAA,EAAA,IAAA,CAAA,CAAA,CAAA;AACA,EAAA;;AAEA,EAAA,MAAA,aAAA,GAAA,cAAA,CAAA,IAAA,CAAA;;AAEA,EAAA,IAAA,OAAA,aAAA,KAAA,UAAA,EAAA;AACA,IAAA,MAAA,IAAA,KAAA,CAAA,CAAA,4BAAA,EAAA,IAAA,CAAA,CAAA,CAAA;AACA,EAAA;;AAEA,EAAA,OAAA,aAAA;AACA;;AAEA,SAAA,YAAA,CAAA,MAAA,EAAA;AACA,EAAA,MAAA,MAAA,GAAAC,
|
|
1
|
+
{"version":3,"file":"lazyLoadIntegration.js","sources":["../../../../../src/utils/lazyLoadIntegration.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core/browser';\nimport { getClient, SDK_VERSION } from '@sentry/core/browser';\nimport type { BrowserClient } from '../client';\nimport { WINDOW } from '../helpers';\n\n// Single source of truth: as const array provides both the runtime list and the type.\n// Bundle file names are derived: strip 'Integration' suffix, lowercase.\n// Exceptions (hyphenated bundle names) are listed in HYPHENATED_BUNDLES.\nconst LAZY_LOADABLE_NAMES = [\n 'replayIntegration',\n 'replayCanvasIntegration',\n 'feedbackIntegration',\n 'feedbackModalIntegration',\n 'feedbackScreenshotIntegration',\n 'captureConsoleIntegration',\n 'contextLinesIntegration',\n 'linkedErrorsIntegration',\n 'dedupeIntegration',\n 'extraErrorDataIntegration',\n 'graphqlClientIntegration',\n 'httpClientIntegration',\n 'reportingObserverIntegration',\n 'rewriteFramesIntegration',\n 'browserProfilingIntegration',\n 'moduleMetadataIntegration',\n 'instrumentAnthropicAiClient',\n 'instrumentOpenAiClient',\n 'instrumentGoogleGenAIClient',\n 'instrumentLangGraph',\n 'createLangChainCallbackHandler',\n 'instrumentLangChainEmbeddings',\n] as const;\n\ntype ElementOf<T extends readonly unknown[]> = T[number];\ntype LazyLoadableIntegrationName = ElementOf<typeof LAZY_LOADABLE_NAMES>;\n\nconst HYPHENATED_BUNDLES: Partial<Record<LazyLoadableIntegrationName, string>> = {\n replayCanvasIntegration: 'replay-canvas',\n feedbackModalIntegration: 'feedback-modal',\n feedbackScreenshotIntegration: 'feedback-screenshot',\n};\n\nfunction getBundleName(name: string): string {\n return HYPHENATED_BUNDLES[name as LazyLoadableIntegrationName] || name.replace('Integration', '').toLowerCase();\n}\n\nconst WindowWithMaybeIntegration = WINDOW as {\n Sentry?: Partial<Record<LazyLoadableIntegrationName, IntegrationFn>>;\n};\n\n/**\n * Lazy load an integration from the CDN.\n * Rejects if the integration cannot be loaded.\n */\nexport async function lazyLoadIntegration(\n name: LazyLoadableIntegrationName,\n scriptNonce?: string,\n): Promise<IntegrationFn> {\n const bundle = LAZY_LOADABLE_NAMES.includes(name) ? getBundleName(name) : undefined;\n\n // `window.Sentry` is only set when using a CDN bundle, but this method can also be used via the NPM package\n const sentryOnWindow = (WindowWithMaybeIntegration.Sentry = WindowWithMaybeIntegration.Sentry || {});\n\n if (!bundle) {\n throw new Error(`Cannot lazy load integration: ${name}`);\n }\n\n // Bail if the integration already exists\n const existing = sentryOnWindow[name];\n // The `feedbackIntegration` is loaded by default in the CDN bundles,\n // so we need to differentiate between the real integration and the shim.\n // if only the shim exists, we still want to lazy load the real integration.\n if (typeof existing === 'function' && !('_isShim' in existing)) {\n return existing;\n }\n\n const url = getScriptURL(bundle);\n const script = WINDOW.document.createElement('script');\n script.src = url;\n script.crossOrigin = 'anonymous';\n script.referrerPolicy = 'strict-origin';\n\n if (scriptNonce) {\n script.setAttribute('nonce', scriptNonce);\n }\n\n const waitForLoad = new Promise<void>((resolve, reject) => {\n script.addEventListener('load', () => resolve());\n script.addEventListener('error', reject);\n });\n\n const currentScript = WINDOW.document.currentScript;\n const parent = WINDOW.document.body || WINDOW.document.head || currentScript?.parentElement;\n\n if (parent) {\n parent.appendChild(script);\n } else {\n throw new Error(`Could not find parent element to insert lazy-loaded ${name} script`);\n }\n\n try {\n await waitForLoad;\n } catch {\n throw new Error(`Error when loading integration: ${name}`);\n }\n\n const integrationFn = sentryOnWindow[name];\n\n if (typeof integrationFn !== 'function') {\n throw new Error(`Could not load integration: ${name}`);\n }\n\n return integrationFn;\n}\n\nfunction getScriptURL(bundle: string): string {\n const client = getClient<BrowserClient>();\n const baseURL = client?.getOptions()?.cdnBaseUrl || 'https://browser.sentry-cdn.com';\n\n return new URL(`/${SDK_VERSION}/${bundle}.min.js`, baseURL).toString();\n}\n"],"names":["WINDOW","getClient","SDK_VERSION"],"mappings":";;;;;AAKA;AACA;AACA;AACA,MAAM,sBAAsB;AAC5B,EAAE,mBAAmB;AACrB,EAAE,yBAAyB;AAC3B,EAAE,qBAAqB;AACvB,EAAE,0BAA0B;AAC5B,EAAE,+BAA+B;AACjC,EAAE,2BAA2B;AAC7B,EAAE,yBAAyB;AAC3B,EAAE,yBAAyB;AAC3B,EAAE,mBAAmB;AACrB,EAAE,2BAA2B;AAC7B,EAAE,0BAA0B;AAC5B,EAAE,uBAAuB;AACzB,EAAE,8BAA8B;AAChC,EAAE,0BAA0B;AAC5B,EAAE,6BAA6B;AAC/B,EAAE,2BAA2B;AAC7B,EAAE,6BAA6B;AAC/B,EA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EAAA;AACA,EAAA,MAAA,MAAA,GAAAC,iBAAA,EAAA;AACA,EAAA,MAAA,OAAA,GAAA,MAAA,EAAA,UAAA,EAAA,EAAA,UAAA,IAAA,gCAAA;;AAEA,EAAA,OAAA,IAAA,GAAA,CAAA,CAAA,CAAA,EAAAC,mBAAA,CAAA,CAAA,EAAA,MAAA,CAAA,OAAA,CAAA,EAAA,OAAA,CAAA,CAAA,QAAA,EAAA;AACA;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Client, getSDKSource, applySdkMetadata, _INTERNAL_flushLogsBuffer, _INTERNAL_flushMetricsBuffer, addAutoIpAddressToSession } from '@sentry/core';
|
|
1
|
+
import { Client, getSDKSource, applySdkMetadata, _INTERNAL_flushLogsBuffer, _INTERNAL_flushMetricsBuffer, addAutoIpAddressToSession } from '@sentry/core/browser';
|
|
2
2
|
import { eventFromException, eventFromMessage } from './eventbuilder.js';
|
|
3
3
|
import { WINDOW } from './helpers.js';
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sources":["../../../../src/client.ts"],"sourcesContent":["import type {\n BrowserClientProfilingOptions,\n BrowserClientReplayOptions,\n ClientOptions,\n Event,\n EventHint,\n Options as CoreOptions,\n ParameterizedString,\n Scope,\n SeverityLevel,\n} from '@sentry/core';\nimport {\n _INTERNAL_flushLogsBuffer,\n _INTERNAL_flushMetricsBuffer,\n addAutoIpAddressToSession,\n applySdkMetadata,\n Client,\n getSDKSource,\n} from '@sentry/core';\nimport { eventFromException, eventFromMessage } from './eventbuilder';\nimport { WINDOW } from './helpers';\nimport type { BrowserTransportOptions } from './transports/types';\n\n/**\n * A magic string that build tooling can leverage in order to inject a release value into the SDK.\n */\ndeclare const __SENTRY_RELEASE__: string | undefined;\n\ntype BrowserSpecificOptions = BrowserClientReplayOptions &\n BrowserClientProfilingOptions & {\n /** If configured, this URL will be used as base URL for lazy loading integration. */\n cdnBaseUrl?: string;\n\n /**\n * Important: Only set this option if you know what you are doing!\n *\n * By default, the SDK will check if `Sentry.init` is called in a browser extension.\n * In case it is, it will stop initialization and log a warning\n * because browser extensions require a different Sentry initialization process:\n * https://docs.sentry.io/platforms/javascript/best-practices/shared-environments/\n *\n * Setting up the SDK in a browser extension with global error monitoring is not recommended\n * and will likely flood you with errors from other web sites or extensions. This can heavily\n * impact your quota and cause interference with your and other Sentry SDKs in shared environments.\n *\n * If this check wrongfully flags your setup as a browser extension, you can set this\n * option to `true` to skip the check.\n *\n * @default false\n */\n skipBrowserExtensionCheck?: boolean;\n\n /**\n * If you use Spotlight by Sentry during development, use\n * this option to forward captured Sentry events to Spotlight.\n *\n * Either set it to true, or provide a specific Spotlight Sidecar URL.\n *\n * More details: https://spotlightjs.com/\n *\n * IMPORTANT: Only set this option to `true` while developing, not in production!\n */\n spotlight?: boolean | string;\n };\n/**\n * Configuration options for the Sentry Browser SDK.\n * @see @sentry/core Options for more information.\n */\nexport type BrowserOptions = CoreOptions<BrowserTransportOptions> & BrowserSpecificOptions;\n\n/**\n * Configuration options for the Sentry Browser SDK Client class\n * @see BrowserClient for more information.\n */\nexport type BrowserClientOptions = ClientOptions<BrowserTransportOptions> & BrowserSpecificOptions;\n\n/**\n * The Sentry Browser SDK Client.\n *\n * @see BrowserOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class BrowserClient extends Client<BrowserClientOptions> {\n /**\n * Creates a new Browser SDK instance.\n *\n * @param options Configuration options for this SDK.\n */\n public constructor(options: BrowserClientOptions) {\n const opts = applyDefaultOptions(options);\n const sdkSource = WINDOW.SENTRY_SDK_SOURCE || getSDKSource();\n applySdkMetadata(opts, 'browser', ['browser'], sdkSource);\n\n // Only allow IP inferral by Relay if sendDefaultPii is true\n if (opts._metadata?.sdk) {\n opts._metadata.sdk.settings = {\n infer_ip: opts.sendDefaultPii ? 'auto' : 'never',\n // purposefully allowing already passed settings to override the default\n ...opts._metadata.sdk.settings,\n };\n }\n\n super(opts);\n\n const {\n sendDefaultPii,\n sendClientReports,\n enableLogs,\n _experiments,\n enableMetrics: enableMetricsOption,\n } = this._options;\n\n // todo(v11): Remove the experimental flag\n // eslint-disable-next-line deprecation/deprecation\n const enableMetrics = enableMetricsOption ?? _experiments?.enableMetrics ?? true;\n\n // Flush logs and metrics when page becomes hidden (e.g., tab switch, navigation)\n // todo(v11): Remove the experimental flag\n if (WINDOW.document && (sendClientReports || enableLogs || enableMetrics)) {\n WINDOW.document.addEventListener('visibilitychange', () => {\n if (WINDOW.document.visibilityState === 'hidden') {\n if (sendClientReports) {\n this._flushOutcomes();\n }\n if (enableLogs) {\n _INTERNAL_flushLogsBuffer(this);\n }\n\n if (enableMetrics) {\n _INTERNAL_flushMetricsBuffer(this);\n }\n }\n });\n }\n\n if (sendDefaultPii) {\n this.on('beforeSendSession', addAutoIpAddressToSession);\n }\n }\n\n /**\n * @inheritDoc\n */\n public eventFromException(exception: unknown, hint?: EventHint): PromiseLike<Event> {\n return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n public eventFromMessage(\n message: ParameterizedString,\n level: SeverityLevel = 'info',\n hint?: EventHint,\n ): PromiseLike<Event> {\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n protected _prepareEvent(\n event: Event,\n hint: EventHint,\n currentScope: Scope,\n isolationScope: Scope,\n ): PromiseLike<Event | null> {\n event.platform = event.platform || 'javascript';\n\n return super._prepareEvent(event, hint, currentScope, isolationScope);\n }\n}\n\n/** Exported only for tests. */\nexport function applyDefaultOptions<T extends Partial<BrowserClientOptions>>(optionsArg: T): T {\n return {\n release:\n typeof __SENTRY_RELEASE__ === 'string' // This allows build tooling to find-and-replace __SENTRY_RELEASE__ to inject a release value\n ? __SENTRY_RELEASE__\n : WINDOW.SENTRY_RELEASE?.id, // This supports the variable that sentry-webpack-plugin injects\n sendClientReports: true,\n // We default this to true, as it is the safer scenario\n parentSpan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AAE,OAAO;AACT,IAAI,OAAO;AACX,MAAM,OAAO,uBAAuB,QAAA;AACpC,UAAU;AACV,UAAU,MAAM,CAAC,cAAc,EAAE,EAAE;AACnC,IAAI,iBAAiB,EAAE,IAAI;AAC3B;AACA,IAAI,0BAA0B,EAAE,IAAI;AACpC,IAAI,GAAG,UAAU;AACjB,GAAG;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"client.js","sources":["../../../../src/client.ts"],"sourcesContent":["import type {\n BrowserClientProfilingOptions,\n BrowserClientReplayOptions,\n ClientOptions,\n Event,\n EventHint,\n Options as CoreOptions,\n ParameterizedString,\n Scope,\n SeverityLevel,\n} from '@sentry/core/browser';\nimport {\n _INTERNAL_flushLogsBuffer,\n _INTERNAL_flushMetricsBuffer,\n addAutoIpAddressToSession,\n applySdkMetadata,\n Client,\n getSDKSource,\n} from '@sentry/core/browser';\nimport { eventFromException, eventFromMessage } from './eventbuilder';\nimport { WINDOW } from './helpers';\nimport type { BrowserTransportOptions } from './transports/types';\n\n/**\n * A magic string that build tooling can leverage in order to inject a release value into the SDK.\n */\ndeclare const __SENTRY_RELEASE__: string | undefined;\n\ntype BrowserSpecificOptions = BrowserClientReplayOptions &\n BrowserClientProfilingOptions & {\n /** If configured, this URL will be used as base URL for lazy loading integration. */\n cdnBaseUrl?: string;\n\n /**\n * Important: Only set this option if you know what you are doing!\n *\n * By default, the SDK will check if `Sentry.init` is called in a browser extension.\n * In case it is, it will stop initialization and log a warning\n * because browser extensions require a different Sentry initialization process:\n * https://docs.sentry.io/platforms/javascript/best-practices/shared-environments/\n *\n * Setting up the SDK in a browser extension with global error monitoring is not recommended\n * and will likely flood you with errors from other web sites or extensions. This can heavily\n * impact your quota and cause interference with your and other Sentry SDKs in shared environments.\n *\n * If this check wrongfully flags your setup as a browser extension, you can set this\n * option to `true` to skip the check.\n *\n * @default false\n */\n skipBrowserExtensionCheck?: boolean;\n\n /**\n * If you use Spotlight by Sentry during development, use\n * this option to forward captured Sentry events to Spotlight.\n *\n * Either set it to true, or provide a specific Spotlight Sidecar URL.\n *\n * More details: https://spotlightjs.com/\n *\n * IMPORTANT: Only set this option to `true` while developing, not in production!\n */\n spotlight?: boolean | string;\n };\n/**\n * Configuration options for the Sentry Browser SDK.\n * @see @sentry/core Options for more information.\n */\nexport type BrowserOptions = CoreOptions<BrowserTransportOptions> & BrowserSpecificOptions;\n\n/**\n * Configuration options for the Sentry Browser SDK Client class\n * @see BrowserClient for more information.\n */\nexport type BrowserClientOptions = ClientOptions<BrowserTransportOptions> & BrowserSpecificOptions;\n\n/**\n * The Sentry Browser SDK Client.\n *\n * @see BrowserOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class BrowserClient extends Client<BrowserClientOptions> {\n /**\n * Creates a new Browser SDK instance.\n *\n * @param options Configuration options for this SDK.\n */\n public constructor(options: BrowserClientOptions) {\n const opts = applyDefaultOptions(options);\n const sdkSource = WINDOW.SENTRY_SDK_SOURCE || getSDKSource();\n applySdkMetadata(opts, 'browser', ['browser'], sdkSource);\n\n // Only allow IP inferral by Relay if sendDefaultPii is true\n if (opts._metadata?.sdk) {\n opts._metadata.sdk.settings = {\n infer_ip: opts.sendDefaultPii ? 'auto' : 'never',\n // purposefully allowing already passed settings to override the default\n ...opts._metadata.sdk.settings,\n };\n }\n\n super(opts);\n\n const {\n sendDefaultPii,\n sendClientReports,\n enableLogs,\n _experiments,\n enableMetrics: enableMetricsOption,\n } = this._options;\n\n // todo(v11): Remove the experimental flag\n // eslint-disable-next-line deprecation/deprecation\n const enableMetrics = enableMetricsOption ?? _experiments?.enableMetrics ?? true;\n\n // Flush logs and metrics when page becomes hidden (e.g., tab switch, navigation)\n // todo(v11): Remove the experimental flag\n if (WINDOW.document && (sendClientReports || enableLogs || enableMetrics)) {\n WINDOW.document.addEventListener('visibilitychange', () => {\n if (WINDOW.document.visibilityState === 'hidden') {\n if (sendClientReports) {\n this._flushOutcomes();\n }\n if (enableLogs) {\n _INTERNAL_flushLogsBuffer(this);\n }\n\n if (enableMetrics) {\n _INTERNAL_flushMetricsBuffer(this);\n }\n }\n });\n }\n\n if (sendDefaultPii) {\n this.on('beforeSendSession', addAutoIpAddressToSession);\n }\n }\n\n /**\n * @inheritDoc\n */\n public eventFromException(exception: unknown, hint?: EventHint): PromiseLike<Event> {\n return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n public eventFromMessage(\n message: ParameterizedString,\n level: SeverityLevel = 'info',\n hint?: EventHint,\n ): PromiseLike<Event> {\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n protected _prepareEvent(\n event: Event,\n hint: EventHint,\n currentScope: Scope,\n isolationScope: Scope,\n ): PromiseLike<Event | null> {\n event.platform = event.platform || 'javascript';\n\n return super._prepareEvent(event, hint, currentScope, isolationScope);\n }\n}\n\n/** Exported only for tests. */\nexport function applyDefaultOptions<T extends Partial<BrowserClientOptions>>(optionsArg: T): T {\n return {\n release:\n typeof __SENTRY_RELEASE__ === 'string' // This allows build tooling to find-and-replace __SENTRY_RELEASE__ to inject a release value\n ? __SENTRY_RELEASE__\n : WINDOW.SENTRY_RELEASE?.id, // This supports the variable that sentry-webpack-plugin injects\n sendClientReports: true,\n // We default this to true, as it is the safer scenario\n parentSpanIsAlwaysRootSpan: true,\n ...optionsArg,\n };\n}\n"],"names":[],"mappings":";;;;AAuBA;AACA;AACA;;AAmDA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,aAAA,SAAsB,MAAM,CAAuB;AAChE;AACA;AACA;AACA;AACA;AACA,GAAS,WAAW,CAAC,OAAO,EAAwB;AACpD,IAAI,MAAM,IAAA,GAAO,mBAAmB,CAAC,OAAO,CAAC;AAC7C,IAAI,MAAM,YAAY,MAAM,CAAC,iBAAA,IAAqB,YAAY,EAAE;AAChE,IAAI,gBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,SAAS,CAAC,EAAE,SA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AACA;AACA;AACA,GAAS,kBAAkB,CAAC,SAAS,EAAW,IAAI,EAAkC;AACtF,IAAI,OAAO,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC;AACzG,EAAE;;AAEF;AACA;AACA;AACA,GAAS,gBAAgB;AACzB,IAAI,OAAO;AACX,IAAI,KAAK,GAAkB,MAAM;AACjC,IAAI,IAAI;AACR,IAAwB;AACxB,IAAI,OAAO,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC;AAC5G,EAAE;;AAEF;AACA;AACA;AACA,GAAY,aAAa;AACzB,IAAI,KAAK;AACT,IAAI,IAAI;AACR,IAAI,YAAY;AAChB,IAAI,cAAc;AAClB,IAA+B;AAC/B,IAAI,KAAK,CAAC,QAAA,GAAW,KAAK,CAAC,QAAA,IAAY,YAAY;;AAEnD,IAAI,OAAO,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,cAAc,CAAC;AACzE,EAAE;AACF;;AAEA;AACO,SAAS,mBAAmB,CAA0C,UAAU,EAAQ;AAC/F,EAAE,OAAO;AACT,IAAI,OAAO;AACX,MAAM,OAAO,uBAAuB,QAAA;AACpC,UAAU;AACV,UAAU,MAAM,CAAC,cAAc,EAAE,EAAE;AACnC,IAAI,iBAAiB,EAAE,IAAI;AAC3B;AACA,IAAI,0BAA0B,EAAE,IAAI;AACpC,IAAI,GAAG,UAAU;AACjB,GAAG;AACH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnose-sdk.js","sources":["../../../../src/diagnose-sdk.ts"],"sourcesContent":["import { getClient, suppressTracing } from '@sentry/core';\n\n/**\n * A function to diagnose why the SDK might not be successfully sending data.\n *\n * Possible return values wrapped in a Promise:\n * - `\"no-client-active\"` - There was no active client when the function was called. This possibly means that the SDK was not initialized yet.\n * - `\"sentry-unreachable\"` - The Sentry SaaS servers were not reachable. This likely means that there is an ad blocker active on the page or that there are other connection issues.\n *\n * If the function doesn't detect an issue it resolves to `undefined`.\n */\nexport async function diagnoseSdkConnectivity(): Promise<\n 'no-client-active' | 'sentry-unreachable' | 'no-dsn-configured' | void\n> {\n const client = getClient();\n\n if (!client) {\n return 'no-client-active';\n }\n\n if (!client.getDsn()) {\n return 'no-dsn-configured';\n }\n\n // Check if a tunnel is configured and use it if available\n const tunnel = client.getOptions().tunnel;\n\n // We are using the\n // - \"sentry-sdks\" org with id 447951 not to pollute any actual organizations.\n // - \"diagnose-sdk-connectivity\" project with id 4509632503087104\n // - the public key of said org/project, which is disabled in the project settings\n // => this DSN: https://c1dfb07d783ad5325c245c1fd3725390@o447951.ingest.us.sentry.io/4509632503087104 (i.e. disabled)\n const defaultUrl =\n 'https://o447951.ingest.sentry.io/api/4509632503087104/envelope/?sentry_version=7&sentry_key=c1dfb07d783ad5325c245c1fd3725390&sentry_client=sentry.javascript.browser%2F1.33.7';\n\n const url = tunnel || defaultUrl;\n\n try {\n await suppressTracing(() =>\n // If fetch throws, there is likely an ad blocker active or there are other connective issues.\n fetch(url, {\n body: '{}',\n method: 'POST',\n mode: 'cors',\n credentials: 'omit',\n }),\n );\n } catch {\n return 'sentry-unreachable';\n }\n}\n"],"names":[],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAe,uBAAuB;;AAE7C,CAAE;AACF,EAAE,MAAM,MAAA,GAAS,SAAS,EAAE;;AAE5B,EAAE,IAAI,CAAC,MAAM,EAAE;AACf,IAAI,OAAO,kBAAkB;AAC7B,EAAE;;AAEF,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE;AACxB,IAAI,OAAO,mBAAmB;AAC9B,EAAE;;AAEF;AACA,EAAE,MAAM,SAAS,MAAM,CAAC,UAAU,EAAE,CAAC,MAAM;;AAE3C;AACA;AACA;AACA;AACA;AACA,EAAE,MAAM,UAAA;AACR,IAAI,+KAA+K;;AAEnL,EAAE,MAAM,GAAA,GAAM,MAAA,IAAU,UAAU;;AAElC,EAAE,IAAI;AACN,IAAI,MAAM,eAAe,CAAC;AAC1B;AACA,MAAM,KAAK,CAAC,GAAG,EAAE;AACjB,QAAQ,IAAI,EAAE,IAAI;AAClB,QAAQ,MAAM,EAAE,MAAM;AACtB,QAAQ,IAAI,EAAE,MAAM;AACpB,QAAQ,WAAW,EAAE,MAAM;AAC3B,OAAO,CAAC;AACR,KAAK;AACL,EAAE,EAAE,MAAM;AACV,IAAI,OAAO,oBAAoB;AAC/B,EAAE;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"diagnose-sdk.js","sources":["../../../../src/diagnose-sdk.ts"],"sourcesContent":["import { getClient, suppressTracing } from '@sentry/core/browser';\n\n/**\n * A function to diagnose why the SDK might not be successfully sending data.\n *\n * Possible return values wrapped in a Promise:\n * - `\"no-client-active\"` - There was no active client when the function was called. This possibly means that the SDK was not initialized yet.\n * - `\"sentry-unreachable\"` - The Sentry SaaS servers were not reachable. This likely means that there is an ad blocker active on the page or that there are other connection issues.\n *\n * If the function doesn't detect an issue it resolves to `undefined`.\n */\nexport async function diagnoseSdkConnectivity(): Promise<\n 'no-client-active' | 'sentry-unreachable' | 'no-dsn-configured' | void\n> {\n const client = getClient();\n\n if (!client) {\n return 'no-client-active';\n }\n\n if (!client.getDsn()) {\n return 'no-dsn-configured';\n }\n\n // Check if a tunnel is configured and use it if available\n const tunnel = client.getOptions().tunnel;\n\n // We are using the\n // - \"sentry-sdks\" org with id 447951 not to pollute any actual organizations.\n // - \"diagnose-sdk-connectivity\" project with id 4509632503087104\n // - the public key of said org/project, which is disabled in the project settings\n // => this DSN: https://c1dfb07d783ad5325c245c1fd3725390@o447951.ingest.us.sentry.io/4509632503087104 (i.e. disabled)\n const defaultUrl =\n 'https://o447951.ingest.sentry.io/api/4509632503087104/envelope/?sentry_version=7&sentry_key=c1dfb07d783ad5325c245c1fd3725390&sentry_client=sentry.javascript.browser%2F1.33.7';\n\n const url = tunnel || defaultUrl;\n\n try {\n await suppressTracing(() =>\n // If fetch throws, there is likely an ad blocker active or there are other connective issues.\n fetch(url, {\n body: '{}',\n method: 'POST',\n mode: 'cors',\n credentials: 'omit',\n }),\n );\n } catch {\n return 'sentry-unreachable';\n }\n}\n"],"names":[],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAe,uBAAuB;;AAE7C,CAAE;AACF,EAAE,MAAM,MAAA,GAAS,SAAS,EAAE;;AAE5B,EAAE,IAAI,CAAC,MAAM,EAAE;AACf,IAAI,OAAO,kBAAkB;AAC7B,EAAE;;AAEF,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE;AACxB,IAAI,OAAO,mBAAmB;AAC9B,EAAE;;AAEF;AACA,EAAE,MAAM,SAAS,MAAM,CAAC,UAAU,EAAE,CAAC,MAAM;;AAE3C;AACA;AACA;AACA;AACA;AACA,EAAE,MAAM,UAAA;AACR,IAAI,+KAA+K;;AAEnL,EAAE,MAAM,GAAA,GAAM,MAAA,IAAU,UAAU;;AAElC,EAAE,IAAI;AACN,IAAI,MAAM,eAAe,CAAC;AAC1B;AACA,MAAM,KAAK,CAAC,GAAG,EAAE;AACjB,QAAQ,IAAI,EAAE,IAAI;AAClB,QAAQ,MAAM,EAAE,MAAM;AACtB,QAAQ,IAAI,EAAE,MAAM;AACpB,QAAQ,WAAW,EAAE,MAAM;AAC3B,OAAO,CAAC;AACR,KAAK;AACL,EAAE,EAAE,MAAM;AACV,IAAI,OAAO,oBAAoB;AAC/B,EAAE;AACF;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isErrorEvent, isDOMError, isDOMException, addExceptionTypeValue, isError, isPlainObject, isEvent, addExceptionMechanism, isParameterizedString, getClient, normalizeToSize, extractExceptionKeysForMessage, _INTERNAL_enhanceErrorWithSentryInfo, resolvedSyncPromise } from '@sentry/core';
|
|
1
|
+
import { isErrorEvent, isDOMError, isDOMException, addExceptionTypeValue, isError, isPlainObject, isEvent, addExceptionMechanism, isParameterizedString, getClient, normalizeToSize, extractExceptionKeysForMessage, _INTERNAL_enhanceErrorWithSentryInfo, resolvedSyncPromise } from '@sentry/core/browser';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* This function creates an exception from a JavaScript Error
|
|
@@ -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":[],"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,4BA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A,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":[],"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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,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":[],"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":[],"mappings":";;;AAGA;AACA;AACA;AACA;AACO,MAAM,wBAAwB,GAAgD,wBAAwB,CAAC;AAC9G,EAAE,mBAAmB;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":[],"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":[],"mappings":";;AAMA;AACO,MAAM,uBAAuB,GAAgD,wBAAwB,CAAC;AAC7G,EAAE,mBAAmB,EAAE,MAAM,wBAAwB;AACrD,EAAE,wBAAwB,EAAE,MAAM,6BAA6B;AAC/D,CAAC;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GLOBAL_OBJ, getOriginalFunction, markFunctionWrapped, addNonEnumerableProperty, withScope, addExceptionTypeValue, addExceptionMechanism, captureException, getLocationHref } from '@sentry/core';
|
|
1
|
+
import { GLOBAL_OBJ, getOriginalFunction, markFunctionWrapped, addNonEnumerableProperty, withScope, addExceptionTypeValue, addExceptionMechanism, captureException, getLocationHref } from '@sentry/core/browser';
|
|
2
2
|
|
|
3
3
|
const WINDOW = GLOBAL_OBJ ;
|
|
4
4
|
|
|
@@ -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":[],"mappings":";;AAaO,MAAM,MAAA,GAAS,UAAA;;AAEtB,IAAI,aA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AAC,aAAa,EAAE,MAAM,CAAC;AAC7E,IAAI,IAAI,UAAU,CAAC,YAAY,EAAE;AACjC,MAAM,MAAM,CAAC,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE;AACnD,QAAQ,GAAG,GAAW;AACtB,UAAU,OAAO,EAAE,CAAC,IAAI;AACxB,QAAQ,CAAC;AACT,OAAO,CAAC;AACR,IAAI;AACJ,EAAE,EAAE,MAAM;AACV;AACA;AACA,EAAE;;AAEF,EAAE,OAAO,aAAa;AACtB;;AAEA;AACA;AACA;AACO,SAAS,kBAAkB,GAAqD;AACvF;AACA,EAAE,MAAM,GAAA,GAAM,eAAe,EAAE;AAC/B,EAAE,MAAM,EAAE,QAAA,EAAS,GAAI,MAAM,CAAC,QAAA,IAAY,EAAE;AAC5C,EAAE,MAAM,EAAE,SAAA,EAAU,GAAI,MAAM,CAAC,SAAA,IAAa,EAAE;;AAE9C,EAAE,MAAM,UAAU;AAClB,IAAI,IAAI,QAAA,IAAY,EAAE,OAAO,EAAE,QAAA,EAAU,CAAC;AAC1C,IAAI,IAAI,SAAA,IAAa,EAAE,YAAY,EAAE,SAAA,EAAW,CAAC;AACjD,GAAG;AACH,EAAE,MAAM,UAAU;AAClB,IAAI,GAAG;AACP,IAAI,OAAO;AACX,GAAG;;AAEH,EAAE,OAAO,OAAO;AAChB;;;;"}
|
|
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":[],"mappings":";;AAaO,MAAM,MAAA,GAAS,UAAA;;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;AACzC,QAAQ,OAAO,OAAO;AACtB,MAAM,OAAO;AACb;AACA;AACA,QAAQ,OAAO,EAAE;AACjB,MAAM;AACN,IAAI;;AAEJ;AACA,IAAI,IAAI,mBAAmB,CAAC,EAAE,CAAC,EAAE;AACjC,MAAM,OAAO,EAAE;AACf,IAAI;AACJ,EAAE,EAAE,MAAM;AACV;AACA;AACA;AACA,IAAI,OAAO,EAAE;AACb,EAAE;;AAEF;AACA;AACA,EAAE,MAAM,gBAAgB,WAAyB,GAAG,I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,EAAE,wBAAwB,CAAC,EAAE,EAAE,oBAAoB,EAAE,aAAa,CAAC;;AAEnE;AACA,EAAE,IAAI;AACN;AACA,IAAI,MAAM,UAAA,GAAa,MAAM,CAAC,wBAAwB,CAAC,aAAa,EAAE,MAAM,CAAC;AAC7E,IAAI,IAAI,UAAU,CAAC,YAAY,EAAE;AACjC,MAAM,MAAM,CAAC,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE;AACnD,QAAQ,GAAG,GAAW;AACtB,UAAU,OAAO,EAAE,CAAC,IAAI;AACxB,QAAQ,CAAC;AACT,OAAO,CAAC;AACR,IAAI;AACJ,EAAE,EAAE,MAAM;AACV;AACA;AACA,EAAE;;AAEF,EAAE,OAAO,aAAa;AACtB;;AAEA;AACA;AACA;AACO,SAAS,kBAAkB,GAAqD;AACvF;AACA,EAAE,MAAM,GAAA,GAAM,eAAe,EAAE;AAC/B,EAAE,MAAM,EAAE,QAAA,EAAS,GAAI,MAAM,CAAC,QAAA,IAAY,EAAE;AAC5C,EAAE,MAAM,EAAE,SAAA,EAAU,GAAI,MAAM,CAAC,SAAA,IAAa,EAAE;;AAE9C,EAAE,MAAM,UAAU;AAClB,IAAI,IAAI,QAAA,IAAY,EAAE,OAAO,EAAE,QAAA,EAAU,CAAC;AAC1C,IAAI,IAAI,SAAA,IAAa,EAAE,YAAY,EAAE,SAAA,EAAW,CAAC;AACjD,GAAG;AACH,EAAE,MAAM,UAAU;AAClB,IAAI,GAAG;AACP,IAAI,OAAO;AACX,GAAG;;AAEH,EAAE,OAAO,OAAO;AAChB;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { feedbackAsyncIntegration } from './feedbackAsync.js';
|
|
2
2
|
export { feedbackSyncIntegration as feedbackIntegration, feedbackSyncIntegration } from './feedbackSync.js';
|
|
3
|
-
export { MULTIPLEXED_TRANSPORT_EXTRA_KEY, SDK_VERSION, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, Scope, addBreadcrumb, addEventProcessor, addIntegration, captureConsoleIntegration, captureEvent, captureException, captureFeedback, captureMessage, captureSession, close, consoleLoggingIntegration, continueTrace, createConsolaReporter, createLangChainCallbackHandler, createTransport, dedupeIntegration, endSession, eventFiltersIntegration, extraErrorDataIntegration, featureFlagsIntegration, flush, functionToStringIntegration, getActiveSpan, getClient, getCurrentScope, getGlobalScope, getIsolationScope, getRootSpan, getSpanDescendants, getSpanStatusFromHttpCode, getTraceData, inboundFiltersIntegration, instrumentAnthropicAiClient, instrumentCreateReactAgent, instrumentGoogleGenAIClient, instrumentLangChainEmbeddings, instrumentLangGraph, instrumentOpenAiClient, instrumentSupabaseClient, isEnabled, isInitialized, lastEventId, logger, makeMultiplexedTransport, metrics, moduleMetadataIntegration, parameterize, registerSpanErrorInstrumentation, rewriteFramesIntegration, setContext, setConversationId, setCurrentClient, setExtra, setExtras, setHttpStatus, setMeasurement, setTag, setTags, setUser, spanToBaggageHeader, spanToJSON, spanToTraceHeader, startInactiveSpan, startNewTrace, startSession, startSpan, startSpanManual, supabaseIntegration, suppressTracing, thirdPartyErrorFilterIntegration, updateSpanName, withActiveSpan, withIsolationScope, withScope, withStreamedSpan, zodErrorsIntegration } from '@sentry/core';
|
|
3
|
+
export { MULTIPLEXED_TRANSPORT_EXTRA_KEY, SDK_VERSION, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, Scope, addBreadcrumb, addEventProcessor, addIntegration, captureConsoleIntegration, captureEvent, captureException, captureFeedback, captureMessage, captureSession, close, consoleLoggingIntegration, continueTrace, createConsolaReporter, createLangChainCallbackHandler, createTransport, dedupeIntegration, endSession, eventFiltersIntegration, extraErrorDataIntegration, featureFlagsIntegration, flush, functionToStringIntegration, getActiveSpan, getClient, getCurrentScope, getGlobalScope, getIsolationScope, getRootSpan, getSpanDescendants, getSpanStatusFromHttpCode, getTraceData, inboundFiltersIntegration, instrumentAnthropicAiClient, instrumentCreateReactAgent, instrumentGoogleGenAIClient, instrumentLangChainEmbeddings, instrumentLangGraph, instrumentOpenAiClient, instrumentSupabaseClient, isEnabled, isInitialized, lastEventId, logger, makeMultiplexedTransport, metrics, moduleMetadataIntegration, parameterize, registerSpanErrorInstrumentation, rewriteFramesIntegration, setContext, setConversationId, setCurrentClient, setExtra, setExtras, setHttpStatus, setMeasurement, setTag, setTags, setUser, spanToBaggageHeader, spanToJSON, spanToTraceHeader, startInactiveSpan, startNewTrace, startSession, startSpan, startSpanManual, supabaseIntegration, suppressTracing, thirdPartyErrorFilterIntegration, updateSpanName, withActiveSpan, withIsolationScope, withScope, withStreamedSpan, zodErrorsIntegration } from '@sentry/core/browser';
|
|
4
4
|
export { WINDOW } from './helpers.js';
|
|
5
5
|
export { BrowserClient } from './client.js';
|
|
6
6
|
export { makeFetchTransport } from './transports/fetch.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineIntegration, addConsoleInstrumentationHandler, addFetchInstrumentationHandler, getClient, safeJoin, severityLevelFromString, addBreadcrumb, debug, htmlTreeAsString, getComponentName, getBreadcrumbLogLevelFromHttpStatusCode, parseUrl, getEventDescription } from '@sentry/core';
|
|
1
|
+
import { defineIntegration, addConsoleInstrumentationHandler, addFetchInstrumentationHandler, getClient, safeJoin, severityLevelFromString, addBreadcrumb, debug, htmlTreeAsString, getComponentName, getBreadcrumbLogLevelFromHttpStatusCode, parseUrl, getEventDescription } from '@sentry/core/browser';
|
|
2
2
|
import { addClickKeypressInstrumentationHandler, addXhrInstrumentationHandler, addHistoryInstrumentationHandler, SENTRY_XHR_DATA_KEY } from '@sentry-internal/browser-utils';
|
|
3
3
|
import { DEBUG_BUILD } from '../debug-build.js';
|
|
4
4
|
import { WINDOW } from '../helpers.js';
|