@sentry/browser 10.22.0 → 10.25.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/{client.js → dev/client.js} +16 -3
- package/build/npm/cjs/dev/client.js.map +1 -0
- package/build/npm/cjs/dev/debug-build.js.map +1 -0
- package/build/npm/cjs/dev/diagnose-sdk.js.map +1 -0
- package/build/npm/cjs/dev/eventbuilder.js.map +1 -0
- package/build/npm/cjs/dev/feedbackAsync.js.map +1 -0
- package/build/npm/cjs/dev/feedbackSync.js.map +1 -0
- package/build/npm/cjs/dev/helpers.js.map +1 -0
- package/build/npm/cjs/dev/integrations/breadcrumbs.js.map +1 -0
- package/build/npm/cjs/dev/integrations/browserapierrors.js.map +1 -0
- package/build/npm/cjs/dev/integrations/browsersession.js.map +1 -0
- package/build/npm/cjs/dev/integrations/contextlines.js.map +1 -0
- package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js.map +1 -0
- package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
- package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js.map +1 -0
- package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js.map +1 -0
- package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js.map +1 -0
- package/build/npm/cjs/{integrations → dev/integrations}/globalhandlers.js +6 -1
- package/build/npm/cjs/dev/integrations/globalhandlers.js.map +1 -0
- package/build/npm/cjs/dev/integrations/graphqlClient.js.map +1 -0
- package/build/npm/cjs/dev/integrations/httpclient.js.map +1 -0
- package/build/npm/cjs/dev/integrations/httpcontext.js.map +1 -0
- package/build/npm/cjs/dev/integrations/linkederrors.js.map +1 -0
- package/build/npm/cjs/dev/integrations/reportingobserver.js.map +1 -0
- package/build/npm/cjs/dev/integrations/spotlight.js.map +1 -0
- package/build/npm/cjs/{integrations → dev/integrations}/webWorker.js +119 -17
- package/build/npm/cjs/dev/integrations/webWorker.js.map +1 -0
- package/build/npm/cjs/dev/profiling/integration.js.map +1 -0
- package/build/npm/cjs/dev/profiling/lifecycleMode/traceLifecycleProfiler.js.map +1 -0
- package/build/npm/cjs/dev/profiling/startProfileForSpan.js.map +1 -0
- package/build/npm/cjs/dev/profiling/utils.js.map +1 -0
- package/build/npm/cjs/dev/report-dialog.js.map +1 -0
- package/build/npm/cjs/dev/sdk.js +133 -0
- package/build/npm/cjs/dev/sdk.js.map +1 -0
- package/build/npm/cjs/dev/stack-parsers.js.map +1 -0
- package/build/npm/cjs/dev/tracing/backgroundtab.js.map +1 -0
- package/build/npm/cjs/dev/tracing/browserTracingIntegration.js.map +1 -0
- package/build/npm/cjs/{tracing → dev/tracing}/linkedTraces.js +1 -0
- package/build/npm/cjs/dev/tracing/linkedTraces.js.map +1 -0
- package/build/npm/cjs/dev/tracing/reportPageLoaded.js.map +1 -0
- package/build/npm/cjs/dev/tracing/request.js.map +1 -0
- package/build/npm/cjs/dev/tracing/setActiveSpan.js.map +1 -0
- package/build/npm/cjs/dev/tracing/utils.js.map +1 -0
- package/build/npm/cjs/{transports → dev/transports}/fetch.js +7 -1
- package/build/npm/cjs/dev/transports/fetch.js.map +1 -0
- package/build/npm/cjs/dev/transports/offline.js.map +1 -0
- package/build/npm/cjs/dev/userfeedback.js.map +1 -0
- package/build/npm/cjs/dev/utils/detectBrowserExtension.js.map +1 -0
- package/build/npm/cjs/dev/utils/lazyLoadIntegration.js.map +1 -0
- package/build/npm/cjs/prod/client.js +125 -0
- package/build/npm/cjs/prod/client.js.map +1 -0
- package/build/npm/cjs/prod/debug-build.js +11 -0
- package/build/npm/cjs/prod/debug-build.js.map +1 -0
- package/build/npm/cjs/prod/diagnose-sdk.js +51 -0
- package/build/npm/cjs/prod/diagnose-sdk.js.map +1 -0
- package/build/npm/cjs/prod/eventbuilder.js +397 -0
- package/build/npm/cjs/prod/eventbuilder.js.map +1 -0
- package/build/npm/cjs/prod/feedbackAsync.js +15 -0
- package/build/npm/cjs/prod/feedbackAsync.js.map +1 -0
- package/build/npm/cjs/prod/feedbackSync.js +12 -0
- package/build/npm/cjs/prod/feedbackSync.js.map +1 -0
- package/build/npm/cjs/prod/helpers.js +185 -0
- package/build/npm/cjs/prod/helpers.js.map +1 -0
- package/build/npm/cjs/prod/index.js +179 -0
- package/build/npm/cjs/prod/index.js.map +1 -0
- package/build/npm/cjs/prod/integrations/breadcrumbs.js +341 -0
- package/build/npm/cjs/prod/integrations/breadcrumbs.js.map +1 -0
- package/build/npm/cjs/prod/integrations/browserapierrors.js +259 -0
- package/build/npm/cjs/prod/integrations/browserapierrors.js.map +1 -0
- package/build/npm/cjs/prod/integrations/browsersession.js +44 -0
- package/build/npm/cjs/prod/integrations/browsersession.js.map +1 -0
- package/build/npm/cjs/prod/integrations/contextlines.js +89 -0
- package/build/npm/cjs/prod/integrations/contextlines.js.map +1 -0
- package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js +29 -0
- package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js.map +1 -0
- package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js +55 -0
- package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
- package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js +38 -0
- package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js.map +1 -0
- package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js +48 -0
- package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js.map +1 -0
- package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js +74 -0
- package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js.map +1 -0
- package/build/npm/cjs/prod/integrations/globalhandlers.js +210 -0
- package/build/npm/cjs/prod/integrations/globalhandlers.js.map +1 -0
- package/build/npm/cjs/prod/integrations/graphqlClient.js +180 -0
- package/build/npm/cjs/prod/integrations/graphqlClient.js.map +1 -0
- package/build/npm/cjs/prod/integrations/httpclient.js +395 -0
- package/build/npm/cjs/prod/integrations/httpclient.js.map +1 -0
- package/build/npm/cjs/prod/integrations/httpcontext.js +35 -0
- package/build/npm/cjs/prod/integrations/httpcontext.js.map +1 -0
- package/build/npm/cjs/prod/integrations/linkederrors.js +39 -0
- package/build/npm/cjs/prod/integrations/linkederrors.js.map +1 -0
- package/build/npm/cjs/prod/integrations/reportingobserver.js +85 -0
- package/build/npm/cjs/prod/integrations/reportingobserver.js.map +1 -0
- package/build/npm/cjs/prod/integrations/spotlight.js +85 -0
- package/build/npm/cjs/prod/integrations/spotlight.js.map +1 -0
- package/build/npm/cjs/prod/integrations/webWorker.js +251 -0
- package/build/npm/cjs/prod/integrations/webWorker.js.map +1 -0
- package/build/npm/cjs/prod/profiling/integration.js +150 -0
- package/build/npm/cjs/prod/profiling/integration.js.map +1 -0
- package/build/npm/cjs/prod/profiling/lifecycleMode/traceLifecycleProfiler.js +343 -0
- package/build/npm/cjs/prod/profiling/lifecycleMode/traceLifecycleProfiler.js.map +1 -0
- package/build/npm/cjs/prod/profiling/startProfileForSpan.js +144 -0
- package/build/npm/cjs/prod/profiling/startProfileForSpan.js.map +1 -0
- package/build/npm/cjs/prod/profiling/utils.js +786 -0
- package/build/npm/cjs/prod/profiling/utils.js.map +1 -0
- package/build/npm/cjs/prod/report-dialog.js +68 -0
- package/build/npm/cjs/prod/report-dialog.js.map +1 -0
- package/build/npm/cjs/{sdk.js → prod/sdk.js} +5 -2
- package/build/npm/cjs/prod/sdk.js.map +1 -0
- package/build/npm/cjs/prod/stack-parsers.js +202 -0
- package/build/npm/cjs/prod/stack-parsers.js.map +1 -0
- package/build/npm/cjs/prod/tracing/backgroundtab.js +46 -0
- package/build/npm/cjs/prod/tracing/backgroundtab.js.map +1 -0
- package/build/npm/cjs/prod/tracing/browserTracingIntegration.js +577 -0
- package/build/npm/cjs/prod/tracing/browserTracingIntegration.js.map +1 -0
- package/build/npm/cjs/prod/tracing/linkedTraces.js +227 -0
- package/build/npm/cjs/prod/tracing/linkedTraces.js.map +1 -0
- package/build/npm/cjs/prod/tracing/reportPageLoaded.js +18 -0
- package/build/npm/cjs/prod/tracing/reportPageLoaded.js.map +1 -0
- package/build/npm/cjs/prod/tracing/request.js +342 -0
- package/build/npm/cjs/prod/tracing/request.js.map +1 -0
- package/build/npm/cjs/prod/tracing/setActiveSpan.js +68 -0
- package/build/npm/cjs/prod/tracing/setActiveSpan.js.map +1 -0
- package/build/npm/cjs/prod/tracing/utils.js +54 -0
- package/build/npm/cjs/prod/tracing/utils.js.map +1 -0
- package/build/npm/cjs/prod/transports/fetch.js +71 -0
- package/build/npm/cjs/prod/transports/fetch.js.map +1 -0
- package/build/npm/cjs/prod/transports/offline.js +168 -0
- package/build/npm/cjs/prod/transports/offline.js.map +1 -0
- package/build/npm/cjs/prod/userfeedback.js +42 -0
- package/build/npm/cjs/prod/userfeedback.js.map +1 -0
- package/build/npm/cjs/prod/utils/detectBrowserExtension.js +59 -0
- package/build/npm/cjs/prod/utils/detectBrowserExtension.js.map +1 -0
- package/build/npm/cjs/prod/utils/lazyLoadIntegration.js +106 -0
- package/build/npm/cjs/prod/utils/lazyLoadIntegration.js.map +1 -0
- package/build/npm/esm/{client.js → dev/client.js} +16 -3
- package/build/npm/esm/dev/client.js.map +1 -0
- package/build/npm/esm/dev/debug-build.js.map +1 -0
- package/build/npm/esm/dev/diagnose-sdk.js.map +1 -0
- package/build/npm/esm/dev/eventbuilder.js.map +1 -0
- package/build/npm/esm/dev/feedbackAsync.js.map +1 -0
- package/build/npm/esm/dev/feedbackSync.js.map +1 -0
- package/build/npm/esm/dev/helpers.js.map +1 -0
- package/build/npm/esm/dev/integrations/breadcrumbs.js.map +1 -0
- package/build/npm/esm/dev/integrations/browserapierrors.js.map +1 -0
- package/build/npm/esm/dev/integrations/browsersession.js.map +1 -0
- package/build/npm/esm/dev/integrations/contextlines.js.map +1 -0
- package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js.map +1 -0
- package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
- package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js.map +1 -0
- package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js.map +1 -0
- package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js.map +1 -0
- package/build/npm/esm/{integrations → dev/integrations}/globalhandlers.js +5 -2
- package/build/npm/esm/dev/integrations/globalhandlers.js.map +1 -0
- package/build/npm/esm/dev/integrations/graphqlClient.js.map +1 -0
- package/build/npm/esm/dev/integrations/httpclient.js.map +1 -0
- package/build/npm/esm/dev/integrations/httpcontext.js.map +1 -0
- package/build/npm/esm/dev/integrations/linkederrors.js.map +1 -0
- package/build/npm/esm/dev/integrations/reportingobserver.js.map +1 -0
- package/build/npm/esm/dev/integrations/spotlight.js.map +1 -0
- package/build/npm/esm/dev/integrations/webWorker.js +247 -0
- package/build/npm/esm/dev/integrations/webWorker.js.map +1 -0
- package/build/npm/esm/dev/package.json +1 -0
- package/build/npm/esm/dev/profiling/integration.js.map +1 -0
- package/build/npm/esm/dev/profiling/lifecycleMode/traceLifecycleProfiler.js.map +1 -0
- package/build/npm/esm/dev/profiling/startProfileForSpan.js.map +1 -0
- package/build/npm/esm/dev/profiling/utils.js.map +1 -0
- package/build/npm/esm/dev/report-dialog.js.map +1 -0
- package/build/npm/esm/dev/sdk.js +128 -0
- package/build/npm/esm/dev/sdk.js.map +1 -0
- package/build/npm/esm/dev/stack-parsers.js.map +1 -0
- package/build/npm/esm/dev/tracing/backgroundtab.js.map +1 -0
- package/build/npm/esm/dev/tracing/browserTracingIntegration.js.map +1 -0
- package/build/npm/esm/{tracing → dev/tracing}/linkedTraces.js +1 -0
- package/build/npm/esm/dev/tracing/linkedTraces.js.map +1 -0
- package/build/npm/esm/dev/tracing/reportPageLoaded.js.map +1 -0
- package/build/npm/esm/dev/tracing/request.js.map +1 -0
- package/build/npm/esm/dev/tracing/setActiveSpan.js.map +1 -0
- package/build/npm/esm/dev/tracing/utils.js.map +1 -0
- package/build/npm/esm/{transports → dev/transports}/fetch.js +8 -2
- package/build/npm/esm/dev/transports/fetch.js.map +1 -0
- package/build/npm/esm/dev/transports/offline.js.map +1 -0
- package/build/npm/esm/dev/userfeedback.js.map +1 -0
- package/build/npm/esm/dev/utils/detectBrowserExtension.js.map +1 -0
- package/build/npm/esm/dev/utils/lazyLoadIntegration.js.map +1 -0
- package/build/npm/esm/prod/client.js +122 -0
- package/build/npm/esm/prod/client.js.map +1 -0
- package/build/npm/esm/prod/debug-build.js +9 -0
- package/build/npm/esm/prod/debug-build.js.map +1 -0
- package/build/npm/esm/prod/diagnose-sdk.js +49 -0
- package/build/npm/esm/prod/diagnose-sdk.js.map +1 -0
- package/build/npm/esm/prod/eventbuilder.js +390 -0
- package/build/npm/esm/prod/eventbuilder.js.map +1 -0
- package/build/npm/esm/prod/feedbackAsync.js +13 -0
- package/build/npm/esm/prod/feedbackAsync.js.map +1 -0
- package/build/npm/esm/prod/feedbackSync.js +10 -0
- package/build/npm/esm/prod/feedbackSync.js.map +1 -0
- package/build/npm/esm/prod/helpers.js +179 -0
- package/build/npm/esm/prod/helpers.js.map +1 -0
- package/build/npm/esm/prod/index.js +40 -0
- package/build/npm/esm/prod/index.js.map +1 -0
- package/build/npm/esm/prod/integrations/breadcrumbs.js +339 -0
- package/build/npm/esm/prod/integrations/breadcrumbs.js.map +1 -0
- package/build/npm/esm/prod/integrations/browserapierrors.js +257 -0
- package/build/npm/esm/prod/integrations/browserapierrors.js.map +1 -0
- package/build/npm/esm/prod/integrations/browsersession.js +42 -0
- package/build/npm/esm/prod/integrations/browsersession.js.map +1 -0
- package/build/npm/esm/prod/integrations/contextlines.js +86 -0
- package/build/npm/esm/prod/integrations/contextlines.js.map +1 -0
- package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js +27 -0
- package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js.map +1 -0
- package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js +52 -0
- package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
- package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js +35 -0
- package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js.map +1 -0
- package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js +46 -0
- package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js.map +1 -0
- package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js +72 -0
- package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js.map +1 -0
- package/build/npm/esm/prod/integrations/globalhandlers.js +206 -0
- package/build/npm/esm/prod/integrations/globalhandlers.js.map +1 -0
- package/build/npm/esm/prod/integrations/graphqlClient.js +175 -0
- package/build/npm/esm/prod/integrations/graphqlClient.js.map +1 -0
- package/build/npm/esm/prod/integrations/httpclient.js +393 -0
- package/build/npm/esm/prod/integrations/httpclient.js.map +1 -0
- package/build/npm/esm/prod/integrations/httpcontext.js +33 -0
- package/build/npm/esm/prod/integrations/httpcontext.js.map +1 -0
- package/build/npm/esm/prod/integrations/linkederrors.js +37 -0
- package/build/npm/esm/prod/integrations/linkederrors.js.map +1 -0
- package/build/npm/esm/prod/integrations/reportingobserver.js +83 -0
- package/build/npm/esm/prod/integrations/reportingobserver.js.map +1 -0
- package/build/npm/esm/prod/integrations/spotlight.js +81 -0
- package/build/npm/esm/prod/integrations/spotlight.js.map +1 -0
- package/build/npm/esm/prod/integrations/webWorker.js +247 -0
- package/build/npm/esm/prod/integrations/webWorker.js.map +1 -0
- package/build/npm/esm/prod/package.json +1 -0
- package/build/npm/esm/prod/profiling/integration.js +148 -0
- package/build/npm/esm/prod/profiling/integration.js.map +1 -0
- package/build/npm/esm/prod/profiling/lifecycleMode/traceLifecycleProfiler.js +341 -0
- package/build/npm/esm/prod/profiling/lifecycleMode/traceLifecycleProfiler.js.map +1 -0
- package/build/npm/esm/prod/profiling/startProfileForSpan.js +142 -0
- package/build/npm/esm/prod/profiling/startProfileForSpan.js.map +1 -0
- package/build/npm/esm/prod/profiling/utils.js +763 -0
- package/build/npm/esm/prod/profiling/utils.js.map +1 -0
- package/build/npm/esm/prod/report-dialog.js +66 -0
- package/build/npm/esm/prod/report-dialog.js.map +1 -0
- package/build/npm/esm/{sdk.js → prod/sdk.js} +5 -2
- package/build/npm/esm/prod/sdk.js.map +1 -0
- package/build/npm/esm/prod/stack-parsers.js +194 -0
- package/build/npm/esm/prod/stack-parsers.js.map +1 -0
- package/build/npm/esm/prod/tracing/backgroundtab.js +44 -0
- package/build/npm/esm/prod/tracing/backgroundtab.js.map +1 -0
- package/build/npm/esm/prod/tracing/browserTracingIntegration.js +571 -0
- package/build/npm/esm/prod/tracing/browserTracingIntegration.js.map +1 -0
- package/build/npm/esm/prod/tracing/linkedTraces.js +218 -0
- package/build/npm/esm/prod/tracing/linkedTraces.js.map +1 -0
- package/build/npm/esm/prod/tracing/reportPageLoaded.js +16 -0
- package/build/npm/esm/prod/tracing/reportPageLoaded.js.map +1 -0
- package/build/npm/esm/prod/tracing/request.js +338 -0
- package/build/npm/esm/prod/tracing/request.js.map +1 -0
- package/build/npm/esm/prod/tracing/setActiveSpan.js +66 -0
- package/build/npm/esm/prod/tracing/setActiveSpan.js.map +1 -0
- package/build/npm/esm/prod/tracing/utils.js +49 -0
- package/build/npm/esm/prod/tracing/utils.js.map +1 -0
- package/build/npm/esm/prod/transports/fetch.js +69 -0
- package/build/npm/esm/prod/transports/fetch.js.map +1 -0
- package/build/npm/esm/prod/transports/offline.js +162 -0
- package/build/npm/esm/prod/transports/offline.js.map +1 -0
- package/build/npm/esm/prod/userfeedback.js +40 -0
- package/build/npm/esm/prod/userfeedback.js.map +1 -0
- package/build/npm/esm/prod/utils/detectBrowserExtension.js +57 -0
- package/build/npm/esm/prod/utils/detectBrowserExtension.js.map +1 -0
- package/build/npm/esm/prod/utils/lazyLoadIntegration.js +104 -0
- package/build/npm/esm/prod/utils/lazyLoadIntegration.js.map +1 -0
- package/build/npm/types/client.d.ts +11 -0
- package/build/npm/types/client.d.ts.map +1 -1
- package/build/npm/types/integrations/globalhandlers.d.ts +12 -0
- package/build/npm/types/integrations/globalhandlers.d.ts.map +1 -1
- package/build/npm/types/integrations/webWorker.d.ts +12 -0
- package/build/npm/types/integrations/webWorker.d.ts.map +1 -1
- package/build/npm/types/sdk.d.ts.map +1 -1
- package/build/npm/types/transports/fetch.d.ts.map +1 -1
- package/build/npm/types/transports/types.d.ts +0 -4
- package/build/npm/types/transports/types.d.ts.map +1 -1
- package/build/npm/types-ts3.8/client.d.ts +11 -0
- package/build/npm/types-ts3.8/integrations/globalhandlers.d.ts +12 -0
- package/build/npm/types-ts3.8/integrations/webWorker.d.ts +12 -0
- package/build/npm/types-ts3.8/transports/types.d.ts +0 -4
- package/package.json +22 -17
- package/build/npm/cjs/client.js.map +0 -1
- package/build/npm/cjs/debug-build.js.map +0 -1
- package/build/npm/cjs/diagnose-sdk.js.map +0 -1
- package/build/npm/cjs/eventbuilder.js.map +0 -1
- package/build/npm/cjs/feedbackAsync.js.map +0 -1
- package/build/npm/cjs/feedbackSync.js.map +0 -1
- package/build/npm/cjs/helpers.js.map +0 -1
- package/build/npm/cjs/integrations/breadcrumbs.js.map +0 -1
- package/build/npm/cjs/integrations/browserapierrors.js.map +0 -1
- package/build/npm/cjs/integrations/browsersession.js.map +0 -1
- package/build/npm/cjs/integrations/contextlines.js.map +0 -1
- package/build/npm/cjs/integrations/featureFlags/growthbook/integration.js.map +0 -1
- package/build/npm/cjs/integrations/featureFlags/launchdarkly/integration.js.map +0 -1
- package/build/npm/cjs/integrations/featureFlags/openfeature/integration.js.map +0 -1
- package/build/npm/cjs/integrations/featureFlags/statsig/integration.js.map +0 -1
- package/build/npm/cjs/integrations/featureFlags/unleash/integration.js.map +0 -1
- package/build/npm/cjs/integrations/globalhandlers.js.map +0 -1
- package/build/npm/cjs/integrations/graphqlClient.js.map +0 -1
- package/build/npm/cjs/integrations/httpclient.js.map +0 -1
- package/build/npm/cjs/integrations/httpcontext.js.map +0 -1
- package/build/npm/cjs/integrations/linkederrors.js.map +0 -1
- package/build/npm/cjs/integrations/reportingobserver.js.map +0 -1
- package/build/npm/cjs/integrations/spotlight.js.map +0 -1
- package/build/npm/cjs/integrations/webWorker.js.map +0 -1
- package/build/npm/cjs/profiling/integration.js.map +0 -1
- package/build/npm/cjs/profiling/lifecycleMode/traceLifecycleProfiler.js.map +0 -1
- package/build/npm/cjs/profiling/startProfileForSpan.js.map +0 -1
- package/build/npm/cjs/profiling/utils.js.map +0 -1
- package/build/npm/cjs/report-dialog.js.map +0 -1
- package/build/npm/cjs/sdk.js.map +0 -1
- package/build/npm/cjs/stack-parsers.js.map +0 -1
- package/build/npm/cjs/tracing/backgroundtab.js.map +0 -1
- package/build/npm/cjs/tracing/browserTracingIntegration.js.map +0 -1
- package/build/npm/cjs/tracing/linkedTraces.js.map +0 -1
- package/build/npm/cjs/tracing/reportPageLoaded.js.map +0 -1
- package/build/npm/cjs/tracing/request.js.map +0 -1
- package/build/npm/cjs/tracing/setActiveSpan.js.map +0 -1
- package/build/npm/cjs/tracing/utils.js.map +0 -1
- package/build/npm/cjs/transports/fetch.js.map +0 -1
- package/build/npm/cjs/transports/offline.js.map +0 -1
- package/build/npm/cjs/userfeedback.js.map +0 -1
- package/build/npm/cjs/utils/detectBrowserExtension.js.map +0 -1
- package/build/npm/cjs/utils/lazyLoadIntegration.js.map +0 -1
- package/build/npm/esm/client.js.map +0 -1
- package/build/npm/esm/debug-build.js.map +0 -1
- package/build/npm/esm/diagnose-sdk.js.map +0 -1
- package/build/npm/esm/eventbuilder.js.map +0 -1
- package/build/npm/esm/feedbackAsync.js.map +0 -1
- package/build/npm/esm/feedbackSync.js.map +0 -1
- package/build/npm/esm/helpers.js.map +0 -1
- package/build/npm/esm/integrations/breadcrumbs.js.map +0 -1
- package/build/npm/esm/integrations/browserapierrors.js.map +0 -1
- package/build/npm/esm/integrations/browsersession.js.map +0 -1
- package/build/npm/esm/integrations/contextlines.js.map +0 -1
- package/build/npm/esm/integrations/featureFlags/growthbook/integration.js.map +0 -1
- package/build/npm/esm/integrations/featureFlags/launchdarkly/integration.js.map +0 -1
- package/build/npm/esm/integrations/featureFlags/openfeature/integration.js.map +0 -1
- package/build/npm/esm/integrations/featureFlags/statsig/integration.js.map +0 -1
- package/build/npm/esm/integrations/featureFlags/unleash/integration.js.map +0 -1
- package/build/npm/esm/integrations/globalhandlers.js.map +0 -1
- package/build/npm/esm/integrations/graphqlClient.js.map +0 -1
- package/build/npm/esm/integrations/httpclient.js.map +0 -1
- package/build/npm/esm/integrations/httpcontext.js.map +0 -1
- package/build/npm/esm/integrations/linkederrors.js.map +0 -1
- package/build/npm/esm/integrations/reportingobserver.js.map +0 -1
- package/build/npm/esm/integrations/spotlight.js.map +0 -1
- package/build/npm/esm/integrations/webWorker.js +0 -145
- package/build/npm/esm/integrations/webWorker.js.map +0 -1
- package/build/npm/esm/package.json +0 -1
- package/build/npm/esm/profiling/integration.js.map +0 -1
- package/build/npm/esm/profiling/lifecycleMode/traceLifecycleProfiler.js.map +0 -1
- package/build/npm/esm/profiling/startProfileForSpan.js.map +0 -1
- package/build/npm/esm/profiling/utils.js.map +0 -1
- package/build/npm/esm/report-dialog.js.map +0 -1
- package/build/npm/esm/sdk.js.map +0 -1
- package/build/npm/esm/stack-parsers.js.map +0 -1
- package/build/npm/esm/tracing/backgroundtab.js.map +0 -1
- package/build/npm/esm/tracing/browserTracingIntegration.js.map +0 -1
- package/build/npm/esm/tracing/linkedTraces.js.map +0 -1
- package/build/npm/esm/tracing/reportPageLoaded.js.map +0 -1
- package/build/npm/esm/tracing/request.js.map +0 -1
- package/build/npm/esm/tracing/setActiveSpan.js.map +0 -1
- package/build/npm/esm/tracing/utils.js.map +0 -1
- package/build/npm/esm/transports/fetch.js.map +0 -1
- package/build/npm/esm/transports/offline.js.map +0 -1
- package/build/npm/esm/userfeedback.js.map +0 -1
- package/build/npm/esm/utils/detectBrowserExtension.js.map +0 -1
- package/build/npm/esm/utils/lazyLoadIntegration.js.map +0 -1
- /package/build/npm/cjs/{debug-build.js → dev/debug-build.js} +0 -0
- /package/build/npm/cjs/{diagnose-sdk.js → dev/diagnose-sdk.js} +0 -0
- /package/build/npm/cjs/{eventbuilder.js → dev/eventbuilder.js} +0 -0
- /package/build/npm/cjs/{feedbackAsync.js → dev/feedbackAsync.js} +0 -0
- /package/build/npm/cjs/{feedbackSync.js → dev/feedbackSync.js} +0 -0
- /package/build/npm/cjs/{helpers.js → dev/helpers.js} +0 -0
- /package/build/npm/cjs/{index.js → dev/index.js} +0 -0
- /package/build/npm/cjs/{index.js.map → dev/index.js.map} +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/breadcrumbs.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/browserapierrors.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/browsersession.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/contextlines.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/growthbook/integration.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/launchdarkly/integration.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/openfeature/integration.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/statsig/integration.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/unleash/integration.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/graphqlClient.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/httpclient.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/httpcontext.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/linkederrors.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/reportingobserver.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/spotlight.js +0 -0
- /package/build/npm/cjs/{profiling → dev/profiling}/integration.js +0 -0
- /package/build/npm/cjs/{profiling → dev/profiling}/lifecycleMode/traceLifecycleProfiler.js +0 -0
- /package/build/npm/cjs/{profiling → dev/profiling}/startProfileForSpan.js +0 -0
- /package/build/npm/cjs/{profiling → dev/profiling}/utils.js +0 -0
- /package/build/npm/cjs/{report-dialog.js → dev/report-dialog.js} +0 -0
- /package/build/npm/cjs/{stack-parsers.js → dev/stack-parsers.js} +0 -0
- /package/build/npm/cjs/{tracing → dev/tracing}/backgroundtab.js +0 -0
- /package/build/npm/cjs/{tracing → dev/tracing}/browserTracingIntegration.js +0 -0
- /package/build/npm/cjs/{tracing → dev/tracing}/reportPageLoaded.js +0 -0
- /package/build/npm/cjs/{tracing → dev/tracing}/request.js +0 -0
- /package/build/npm/cjs/{tracing → dev/tracing}/setActiveSpan.js +0 -0
- /package/build/npm/cjs/{tracing → dev/tracing}/utils.js +0 -0
- /package/build/npm/cjs/{transports → dev/transports}/offline.js +0 -0
- /package/build/npm/cjs/{userfeedback.js → dev/userfeedback.js} +0 -0
- /package/build/npm/cjs/{utils → dev/utils}/detectBrowserExtension.js +0 -0
- /package/build/npm/cjs/{utils → dev/utils}/lazyLoadIntegration.js +0 -0
- /package/build/npm/esm/{debug-build.js → dev/debug-build.js} +0 -0
- /package/build/npm/esm/{diagnose-sdk.js → dev/diagnose-sdk.js} +0 -0
- /package/build/npm/esm/{eventbuilder.js → dev/eventbuilder.js} +0 -0
- /package/build/npm/esm/{feedbackAsync.js → dev/feedbackAsync.js} +0 -0
- /package/build/npm/esm/{feedbackSync.js → dev/feedbackSync.js} +0 -0
- /package/build/npm/esm/{helpers.js → dev/helpers.js} +0 -0
- /package/build/npm/esm/{index.js → dev/index.js} +0 -0
- /package/build/npm/esm/{index.js.map → dev/index.js.map} +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/breadcrumbs.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/browserapierrors.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/browsersession.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/contextlines.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/growthbook/integration.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/launchdarkly/integration.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/openfeature/integration.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/statsig/integration.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/unleash/integration.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/graphqlClient.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/httpclient.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/httpcontext.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/linkederrors.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/reportingobserver.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/spotlight.js +0 -0
- /package/build/npm/esm/{profiling → dev/profiling}/integration.js +0 -0
- /package/build/npm/esm/{profiling → dev/profiling}/lifecycleMode/traceLifecycleProfiler.js +0 -0
- /package/build/npm/esm/{profiling → dev/profiling}/startProfileForSpan.js +0 -0
- /package/build/npm/esm/{profiling → dev/profiling}/utils.js +0 -0
- /package/build/npm/esm/{report-dialog.js → dev/report-dialog.js} +0 -0
- /package/build/npm/esm/{stack-parsers.js → dev/stack-parsers.js} +0 -0
- /package/build/npm/esm/{tracing → dev/tracing}/backgroundtab.js +0 -0
- /package/build/npm/esm/{tracing → dev/tracing}/browserTracingIntegration.js +0 -0
- /package/build/npm/esm/{tracing → dev/tracing}/reportPageLoaded.js +0 -0
- /package/build/npm/esm/{tracing → dev/tracing}/request.js +0 -0
- /package/build/npm/esm/{tracing → dev/tracing}/setActiveSpan.js +0 -0
- /package/build/npm/esm/{tracing → dev/tracing}/utils.js +0 -0
- /package/build/npm/esm/{transports → dev/transports}/offline.js +0 -0
- /package/build/npm/esm/{userfeedback.js → dev/userfeedback.js} +0 -0
- /package/build/npm/esm/{utils → dev/utils}/detectBrowserExtension.js +0 -0
- /package/build/npm/esm/{utils → dev/utils}/lazyLoadIntegration.js +0 -0
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const core = require('@sentry/core');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* This function creates an exception from a JavaScript Error
|
|
7
|
+
*/
|
|
8
|
+
function exceptionFromError(stackParser, ex) {
|
|
9
|
+
// Get the frames first since Opera can lose the stack if we touch anything else first
|
|
10
|
+
const frames = parseStackFrames(stackParser, ex);
|
|
11
|
+
|
|
12
|
+
const exception = {
|
|
13
|
+
type: extractType(ex),
|
|
14
|
+
value: extractMessage(ex),
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
if (frames.length) {
|
|
18
|
+
exception.stacktrace = { frames };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (exception.type === undefined && exception.value === '') {
|
|
22
|
+
exception.value = 'Unrecoverable error caught';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return exception;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function eventFromPlainObject(
|
|
29
|
+
stackParser,
|
|
30
|
+
exception,
|
|
31
|
+
syntheticException,
|
|
32
|
+
isUnhandledRejection,
|
|
33
|
+
) {
|
|
34
|
+
const client = core.getClient();
|
|
35
|
+
const normalizeDepth = client?.getOptions().normalizeDepth;
|
|
36
|
+
|
|
37
|
+
// If we can, we extract an exception from the object properties
|
|
38
|
+
const errorFromProp = getErrorPropertyFromObject(exception);
|
|
39
|
+
|
|
40
|
+
const extra = {
|
|
41
|
+
__serialized__: core.normalizeToSize(exception, normalizeDepth),
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
if (errorFromProp) {
|
|
45
|
+
return {
|
|
46
|
+
exception: {
|
|
47
|
+
values: [exceptionFromError(stackParser, errorFromProp)],
|
|
48
|
+
},
|
|
49
|
+
extra,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const event = {
|
|
54
|
+
exception: {
|
|
55
|
+
values: [
|
|
56
|
+
{
|
|
57
|
+
type: core.isEvent(exception) ? exception.constructor.name : isUnhandledRejection ? 'UnhandledRejection' : 'Error',
|
|
58
|
+
value: getNonErrorObjectExceptionValue(exception, { isUnhandledRejection }),
|
|
59
|
+
} ,
|
|
60
|
+
],
|
|
61
|
+
},
|
|
62
|
+
extra,
|
|
63
|
+
} ;
|
|
64
|
+
|
|
65
|
+
if (syntheticException) {
|
|
66
|
+
const frames = parseStackFrames(stackParser, syntheticException);
|
|
67
|
+
if (frames.length) {
|
|
68
|
+
// event.exception.values[0] has been set above
|
|
69
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
70
|
+
event.exception.values[0].stacktrace = { frames };
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return event;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function eventFromError(stackParser, ex) {
|
|
78
|
+
return {
|
|
79
|
+
exception: {
|
|
80
|
+
values: [exceptionFromError(stackParser, ex)],
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** Parses stack frames from an error */
|
|
86
|
+
function parseStackFrames(
|
|
87
|
+
stackParser,
|
|
88
|
+
ex,
|
|
89
|
+
) {
|
|
90
|
+
// Access and store the stacktrace property before doing ANYTHING
|
|
91
|
+
// else to it because Opera is not very good at providing it
|
|
92
|
+
// reliably in other circumstances.
|
|
93
|
+
const stacktrace = ex.stacktrace || ex.stack || '';
|
|
94
|
+
|
|
95
|
+
const skipLines = getSkipFirstStackStringLines(ex);
|
|
96
|
+
const framesToPop = getPopFirstTopFrames(ex);
|
|
97
|
+
|
|
98
|
+
try {
|
|
99
|
+
return stackParser(stacktrace, skipLines, framesToPop);
|
|
100
|
+
} catch {
|
|
101
|
+
// no-empty
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return [];
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108
|
|
108
|
+
const reactMinifiedRegexp = /Minified React error #\d+;/i;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Certain known React errors contain links that would be falsely
|
|
112
|
+
* parsed as frames. This function check for these errors and
|
|
113
|
+
* returns number of the stack string lines to skip.
|
|
114
|
+
*/
|
|
115
|
+
function getSkipFirstStackStringLines(ex) {
|
|
116
|
+
if (ex && reactMinifiedRegexp.test(ex.message)) {
|
|
117
|
+
return 1;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return 0;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* If error has `framesToPop` property, it means that the
|
|
125
|
+
* creator tells us the first x frames will be useless
|
|
126
|
+
* and should be discarded. Typically error from wrapper function
|
|
127
|
+
* which don't point to the actual location in the developer's code.
|
|
128
|
+
*
|
|
129
|
+
* Example: https://github.com/zertosh/invariant/blob/master/invariant.js#L46
|
|
130
|
+
*/
|
|
131
|
+
function getPopFirstTopFrames(ex) {
|
|
132
|
+
if (typeof ex.framesToPop === 'number') {
|
|
133
|
+
return ex.framesToPop;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return 0;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/Exception
|
|
140
|
+
// @ts-expect-error - WebAssembly.Exception is a valid class
|
|
141
|
+
function isWebAssemblyException(exception) {
|
|
142
|
+
// Check for support
|
|
143
|
+
// @ts-expect-error - WebAssembly.Exception is a valid class
|
|
144
|
+
if (typeof WebAssembly !== 'undefined' && typeof WebAssembly.Exception !== 'undefined') {
|
|
145
|
+
// @ts-expect-error - WebAssembly.Exception is a valid class
|
|
146
|
+
return exception instanceof WebAssembly.Exception;
|
|
147
|
+
} else {
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Extracts from errors what we use as the exception `type` in error events.
|
|
154
|
+
*
|
|
155
|
+
* Usually, this is the `name` property on Error objects but WASM errors need to be treated differently.
|
|
156
|
+
*/
|
|
157
|
+
function extractType(ex) {
|
|
158
|
+
const name = ex?.name;
|
|
159
|
+
|
|
160
|
+
// The name for WebAssembly.Exception Errors needs to be extracted differently.
|
|
161
|
+
// Context: https://github.com/getsentry/sentry-javascript/issues/13787
|
|
162
|
+
if (!name && isWebAssemblyException(ex)) {
|
|
163
|
+
// Emscripten sets array[type, message] to the "message" property on the WebAssembly.Exception object
|
|
164
|
+
const hasTypeInMessage = ex.message && Array.isArray(ex.message) && ex.message.length == 2;
|
|
165
|
+
return hasTypeInMessage ? ex.message[0] : 'WebAssembly.Exception';
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return name;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* There are cases where stacktrace.message is an Event object
|
|
173
|
+
* https://github.com/getsentry/sentry-javascript/issues/1949
|
|
174
|
+
* In this specific case we try to extract stacktrace.message.error.message
|
|
175
|
+
*/
|
|
176
|
+
function extractMessage(ex) {
|
|
177
|
+
const message = ex?.message;
|
|
178
|
+
|
|
179
|
+
if (isWebAssemblyException(ex)) {
|
|
180
|
+
// For Node 18, Emscripten sets array[type, message] to the "message" property on the WebAssembly.Exception object
|
|
181
|
+
if (Array.isArray(ex.message) && ex.message.length == 2) {
|
|
182
|
+
return ex.message[1];
|
|
183
|
+
}
|
|
184
|
+
return 'wasm exception';
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
if (!message) {
|
|
188
|
+
return 'No error message';
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if (message.error && typeof message.error.message === 'string') {
|
|
192
|
+
return message.error.message;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
return message;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`.
|
|
200
|
+
* @hidden
|
|
201
|
+
*/
|
|
202
|
+
function eventFromException(
|
|
203
|
+
stackParser,
|
|
204
|
+
exception,
|
|
205
|
+
hint,
|
|
206
|
+
attachStacktrace,
|
|
207
|
+
) {
|
|
208
|
+
const syntheticException = hint?.syntheticException || undefined;
|
|
209
|
+
const event = eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace);
|
|
210
|
+
core.addExceptionMechanism(event); // defaults to { type: 'generic', handled: true }
|
|
211
|
+
event.level = 'error';
|
|
212
|
+
if (hint?.event_id) {
|
|
213
|
+
event.event_id = hint.event_id;
|
|
214
|
+
}
|
|
215
|
+
return core.resolvedSyncPromise(event);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Builds and Event from a Message
|
|
220
|
+
* @hidden
|
|
221
|
+
*/
|
|
222
|
+
function eventFromMessage(
|
|
223
|
+
stackParser,
|
|
224
|
+
message,
|
|
225
|
+
level = 'info',
|
|
226
|
+
hint,
|
|
227
|
+
attachStacktrace,
|
|
228
|
+
) {
|
|
229
|
+
const syntheticException = hint?.syntheticException || undefined;
|
|
230
|
+
const event = eventFromString(stackParser, message, syntheticException, attachStacktrace);
|
|
231
|
+
event.level = level;
|
|
232
|
+
if (hint?.event_id) {
|
|
233
|
+
event.event_id = hint.event_id;
|
|
234
|
+
}
|
|
235
|
+
return core.resolvedSyncPromise(event);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* @hidden
|
|
240
|
+
*/
|
|
241
|
+
function eventFromUnknownInput(
|
|
242
|
+
stackParser,
|
|
243
|
+
exception,
|
|
244
|
+
syntheticException,
|
|
245
|
+
attachStacktrace,
|
|
246
|
+
isUnhandledRejection,
|
|
247
|
+
) {
|
|
248
|
+
let event;
|
|
249
|
+
|
|
250
|
+
if (core.isErrorEvent(exception ) && (exception ).error) {
|
|
251
|
+
// If it is an ErrorEvent with `error` property, extract it to get actual Error
|
|
252
|
+
const errorEvent = exception ;
|
|
253
|
+
return eventFromError(stackParser, errorEvent.error );
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// If it is a `DOMError` (which is a legacy API, but still supported in some browsers) then we just extract the name
|
|
257
|
+
// and message, as it doesn't provide anything else. According to the spec, all `DOMExceptions` should also be
|
|
258
|
+
// `Error`s, but that's not the case in IE11, so in that case we treat it the same as we do a `DOMError`.
|
|
259
|
+
//
|
|
260
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/DOMError
|
|
261
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/DOMException
|
|
262
|
+
// https://webidl.spec.whatwg.org/#es-DOMException-specialness
|
|
263
|
+
if (core.isDOMError(exception) || core.isDOMException(exception )) {
|
|
264
|
+
const domException = exception ;
|
|
265
|
+
|
|
266
|
+
if ('stack' in (exception )) {
|
|
267
|
+
event = eventFromError(stackParser, exception );
|
|
268
|
+
} else {
|
|
269
|
+
const name = domException.name || (core.isDOMError(domException) ? 'DOMError' : 'DOMException');
|
|
270
|
+
const message = domException.message ? `${name}: ${domException.message}` : name;
|
|
271
|
+
event = eventFromString(stackParser, message, syntheticException, attachStacktrace);
|
|
272
|
+
core.addExceptionTypeValue(event, message);
|
|
273
|
+
}
|
|
274
|
+
if ('code' in domException) {
|
|
275
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
276
|
+
event.tags = { ...event.tags, 'DOMException.code': `${domException.code}` };
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
return event;
|
|
280
|
+
}
|
|
281
|
+
if (core.isError(exception)) {
|
|
282
|
+
// we have a real Error object, do nothing
|
|
283
|
+
return eventFromError(stackParser, exception);
|
|
284
|
+
}
|
|
285
|
+
if (core.isPlainObject(exception) || core.isEvent(exception)) {
|
|
286
|
+
// If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize
|
|
287
|
+
// it manually. This will allow us to group events based on top-level keys which is much better than creating a new
|
|
288
|
+
// group on any key/value change.
|
|
289
|
+
const objectException = exception;
|
|
290
|
+
event = eventFromPlainObject(stackParser, objectException, syntheticException, isUnhandledRejection);
|
|
291
|
+
core.addExceptionMechanism(event, {
|
|
292
|
+
synthetic: true,
|
|
293
|
+
});
|
|
294
|
+
return event;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// If none of previous checks were valid, then it means that it's not:
|
|
298
|
+
// - an instance of DOMError
|
|
299
|
+
// - an instance of DOMException
|
|
300
|
+
// - an instance of Event
|
|
301
|
+
// - an instance of Error
|
|
302
|
+
// - a valid ErrorEvent (one with an error property)
|
|
303
|
+
// - a plain Object
|
|
304
|
+
//
|
|
305
|
+
// So bail out and capture it as a simple message:
|
|
306
|
+
event = eventFromString(stackParser, exception , syntheticException, attachStacktrace);
|
|
307
|
+
core.addExceptionTypeValue(event, `${exception}`, undefined);
|
|
308
|
+
core.addExceptionMechanism(event, {
|
|
309
|
+
synthetic: true,
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
return event;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
function eventFromString(
|
|
316
|
+
stackParser,
|
|
317
|
+
message,
|
|
318
|
+
syntheticException,
|
|
319
|
+
attachStacktrace,
|
|
320
|
+
) {
|
|
321
|
+
const event = {};
|
|
322
|
+
|
|
323
|
+
if (attachStacktrace && syntheticException) {
|
|
324
|
+
const frames = parseStackFrames(stackParser, syntheticException);
|
|
325
|
+
if (frames.length) {
|
|
326
|
+
event.exception = {
|
|
327
|
+
values: [{ value: message, stacktrace: { frames } }],
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
core.addExceptionMechanism(event, { synthetic: true });
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
if (core.isParameterizedString(message)) {
|
|
334
|
+
const { __sentry_template_string__, __sentry_template_values__ } = message;
|
|
335
|
+
|
|
336
|
+
event.logentry = {
|
|
337
|
+
message: __sentry_template_string__,
|
|
338
|
+
params: __sentry_template_values__,
|
|
339
|
+
};
|
|
340
|
+
return event;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
event.message = message;
|
|
344
|
+
return event;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
function getNonErrorObjectExceptionValue(
|
|
348
|
+
exception,
|
|
349
|
+
{ isUnhandledRejection },
|
|
350
|
+
) {
|
|
351
|
+
const keys = core.extractExceptionKeysForMessage(exception);
|
|
352
|
+
const captureType = isUnhandledRejection ? 'promise rejection' : 'exception';
|
|
353
|
+
|
|
354
|
+
// Some ErrorEvent instances do not have an `error` property, which is why they are not handled before
|
|
355
|
+
// We still want to try to get a decent message for these cases
|
|
356
|
+
if (core.isErrorEvent(exception)) {
|
|
357
|
+
return `Event \`ErrorEvent\` captured as ${captureType} with message \`${exception.message}\``;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
if (core.isEvent(exception)) {
|
|
361
|
+
const className = getObjectClassName(exception);
|
|
362
|
+
return `Event \`${className}\` (type=${exception.type}) captured as ${captureType}`;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
return `Object captured as ${captureType} with keys: ${keys}`;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
function getObjectClassName(obj) {
|
|
369
|
+
try {
|
|
370
|
+
const prototype = Object.getPrototypeOf(obj);
|
|
371
|
+
return prototype ? prototype.constructor.name : undefined;
|
|
372
|
+
} catch {
|
|
373
|
+
// ignore errors here
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/** If a plain object has a property that is an `Error`, return this error. */
|
|
378
|
+
function getErrorPropertyFromObject(obj) {
|
|
379
|
+
for (const prop in obj) {
|
|
380
|
+
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
|
|
381
|
+
const value = obj[prop];
|
|
382
|
+
if (value instanceof Error) {
|
|
383
|
+
return value;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
return undefined;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
exports.eventFromException = eventFromException;
|
|
392
|
+
exports.eventFromMessage = eventFromMessage;
|
|
393
|
+
exports.eventFromUnknownInput = eventFromUnknownInput;
|
|
394
|
+
exports.exceptionFromError = exceptionFromError;
|
|
395
|
+
exports.extractMessage = extractMessage;
|
|
396
|
+
exports.extractType = extractType;
|
|
397
|
+
//# sourceMappingURL=eventbuilder.js.map
|
|
@@ -0,0 +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 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 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 message.error.message;\n }\n\n return message;\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 for (const prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n const value = obj[prop];\n if (value instanceof Error) {\n return value;\n }\n }\n }\n\n return undefined;\n}\n"],"names":["getClient","normalizeToSize","isEvent","addExceptionMechanism","resolvedSyncPromise","isErrorEvent","isDOMError","isDOMException","addExceptionTypeValue","isError","isPlainObject","isParameterizedString","extractExceptionKeysForMessage"],"mappings":";;;;AA2BA;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,IA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OAAA,SAAA,GAAA,SAAA,CAAA,WAAA,CAAA,IAAA,GAAA,SAAA;AACA,EAAA,CAAA,CAAA,MAAA;AACA;AACA,EAAA;AACA;;AAEA;AACA,SAAA,0BAAA,CAAA,GAAA,EAAA;AACA,EAAA,KAAA,MAAA,IAAA,IAAA,GAAA,EAAA;AACA,IAAA,IAAA,MAAA,CAAA,SAAA,CAAA,cAAA,CAAA,IAAA,CAAA,GAAA,EAAA,IAAA,CAAA,EAAA;AACA,MAAA,MAAA,KAAA,GAAA,GAAA,CAAA,IAAA,CAAA;AACA,MAAA,IAAA,KAAA,YAAA,KAAA,EAAA;AACA,QAAA,OAAA,KAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;;AAEA,EAAA,OAAA,SAAA;AACA;;;;;;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const feedback = require('@sentry-internal/feedback');
|
|
4
|
+
const lazyLoadIntegration = require('./utils/lazyLoadIntegration.js');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* An integration to add user feedback to your application,
|
|
8
|
+
* while loading most of the code lazily only when it's needed.
|
|
9
|
+
*/
|
|
10
|
+
const feedbackAsyncIntegration = feedback.buildFeedbackIntegration({
|
|
11
|
+
lazyLoadIntegration: lazyLoadIntegration.lazyLoadIntegration,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
exports.feedbackAsyncIntegration = feedbackAsyncIntegration;
|
|
15
|
+
//# sourceMappingURL=feedbackAsync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedbackAsync.js","sources":["../../../../src/feedbackAsync.ts"],"sourcesContent":["import { buildFeedbackIntegration } from '@sentry-internal/feedback';\nimport { lazyLoadIntegration } from './utils/lazyLoadIntegration';\n\n/**\n * An integration to add user feedback to your application,\n * while loading most of the code lazily only when it's needed.\n */\nexport const feedbackAsyncIntegration = buildFeedbackIntegration({\n lazyLoadIntegration,\n});\n"],"names":["buildFeedbackIntegration","lazyLoadIntegration"],"mappings":";;;;;AAGA;AACA;AACA;AACA;AACO,MAAM,wBAAA,GAA2BA,iCAAwB,CAAC;AACjE,uBAAEC,uCAAmB;AACrB,CAAC;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const feedback = require('@sentry-internal/feedback');
|
|
4
|
+
|
|
5
|
+
/** Add a widget to capture user feedback to your application. */
|
|
6
|
+
const feedbackSyncIntegration = feedback.buildFeedbackIntegration({
|
|
7
|
+
getModalIntegration: () => feedback.feedbackModalIntegration,
|
|
8
|
+
getScreenshotIntegration: () => feedback.feedbackScreenshotIntegration,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
exports.feedbackSyncIntegration = feedbackSyncIntegration;
|
|
12
|
+
//# sourceMappingURL=feedbackSync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedbackSync.js","sources":["../../../../src/feedbackSync.ts"],"sourcesContent":["import {\n buildFeedbackIntegration,\n feedbackModalIntegration,\n feedbackScreenshotIntegration,\n} from '@sentry-internal/feedback';\n\n/** Add a widget to capture user feedback to your application. */\nexport const feedbackSyncIntegration = buildFeedbackIntegration({\n getModalIntegration: () => feedbackModalIntegration,\n getScreenshotIntegration: () => feedbackScreenshotIntegration,\n});\n"],"names":["buildFeedbackIntegration","feedbackModalIntegration","feedbackScreenshotIntegration"],"mappings":";;;;AAMA;AACO,MAAM,uBAAA,GAA0BA,iCAAwB,CAAC;AAChE,EAAE,mBAAmB,EAAE,MAAMC,iCAAwB;AACrD,EAAE,wBAAwB,EAAE,MAAMC,sCAA6B;AAC/D,CAAC;;;;"}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const core = require('@sentry/core');
|
|
4
|
+
|
|
5
|
+
const WINDOW = core.GLOBAL_OBJ ;
|
|
6
|
+
|
|
7
|
+
let ignoreOnError = 0;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
function shouldIgnoreOnError() {
|
|
13
|
+
return ignoreOnError > 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @hidden
|
|
18
|
+
*/
|
|
19
|
+
function ignoreNextOnError() {
|
|
20
|
+
// onerror should trigger before setTimeout
|
|
21
|
+
ignoreOnError++;
|
|
22
|
+
setTimeout(() => {
|
|
23
|
+
ignoreOnError--;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Instruments the given function and sends an event to Sentry every time the
|
|
31
|
+
* function throws an exception.
|
|
32
|
+
*
|
|
33
|
+
* @param fn A function to wrap. It is generally safe to pass an unbound function, because the returned wrapper always
|
|
34
|
+
* has a correct `this` context.
|
|
35
|
+
* @returns The wrapped function.
|
|
36
|
+
* @hidden
|
|
37
|
+
*/
|
|
38
|
+
function wrap(
|
|
39
|
+
fn,
|
|
40
|
+
options
|
|
41
|
+
|
|
42
|
+
= {},
|
|
43
|
+
) {
|
|
44
|
+
// for future readers what this does is wrap a function and then create
|
|
45
|
+
// a bi-directional wrapping between them.
|
|
46
|
+
//
|
|
47
|
+
// example: wrapped = wrap(original);
|
|
48
|
+
// original.__sentry_wrapped__ -> wrapped
|
|
49
|
+
// wrapped.__sentry_original__ -> original
|
|
50
|
+
|
|
51
|
+
function isFunction(fn) {
|
|
52
|
+
return typeof fn === 'function';
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (!isFunction(fn)) {
|
|
56
|
+
return fn;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
try {
|
|
60
|
+
// if we're dealing with a function that was previously wrapped, return
|
|
61
|
+
// the original wrapper.
|
|
62
|
+
const wrapper = (fn ).__sentry_wrapped__;
|
|
63
|
+
if (wrapper) {
|
|
64
|
+
if (typeof wrapper === 'function') {
|
|
65
|
+
return wrapper;
|
|
66
|
+
} else {
|
|
67
|
+
// If we find that the `__sentry_wrapped__` function is not a function at the time of accessing it, it means
|
|
68
|
+
// that something messed with it. In that case we want to return the originally passed function.
|
|
69
|
+
return fn;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// We don't wanna wrap it twice
|
|
74
|
+
if (core.getOriginalFunction(fn)) {
|
|
75
|
+
return fn;
|
|
76
|
+
}
|
|
77
|
+
} catch {
|
|
78
|
+
// Just accessing custom props in some Selenium environments
|
|
79
|
+
// can cause a "Permission denied" exception (see raven-js#495).
|
|
80
|
+
// Bail on wrapping and return the function as-is (defers to window.onerror).
|
|
81
|
+
return fn;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Wrap the function itself
|
|
85
|
+
// It is important that `sentryWrapped` is not an arrow function to preserve the context of `this`
|
|
86
|
+
const sentryWrapped = function ( ...args) {
|
|
87
|
+
try {
|
|
88
|
+
// Also wrap arguments that are themselves functions
|
|
89
|
+
const wrappedArguments = args.map(arg => wrap(arg, options));
|
|
90
|
+
|
|
91
|
+
// Attempt to invoke user-land function
|
|
92
|
+
// NOTE: If you are a Sentry user, and you are seeing this stack frame, it
|
|
93
|
+
// means the sentry.javascript SDK caught an error invoking your application code. This
|
|
94
|
+
// is expected behavior and NOT indicative of a bug with sentry.javascript.
|
|
95
|
+
return fn.apply(this, wrappedArguments);
|
|
96
|
+
} catch (ex) {
|
|
97
|
+
ignoreNextOnError();
|
|
98
|
+
|
|
99
|
+
core.withScope(scope => {
|
|
100
|
+
scope.addEventProcessor(event => {
|
|
101
|
+
if (options.mechanism) {
|
|
102
|
+
core.addExceptionTypeValue(event, undefined, undefined);
|
|
103
|
+
core.addExceptionMechanism(event, options.mechanism);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
event.extra = {
|
|
107
|
+
...event.extra,
|
|
108
|
+
arguments: args,
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
return event;
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
// no need to add a mechanism here, we already add it via an event processor above
|
|
115
|
+
core.captureException(ex);
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
throw ex;
|
|
119
|
+
}
|
|
120
|
+
} ;
|
|
121
|
+
|
|
122
|
+
// Wrap the wrapped function in a proxy, to ensure any other properties of the original function remain available
|
|
123
|
+
try {
|
|
124
|
+
for (const property in fn) {
|
|
125
|
+
if (Object.prototype.hasOwnProperty.call(fn, property)) {
|
|
126
|
+
sentryWrapped[property ] = fn[property ];
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
} catch {
|
|
130
|
+
// Accessing some objects may throw
|
|
131
|
+
// ref: https://github.com/getsentry/sentry-javascript/issues/1168
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Signal that this function has been wrapped/filled already
|
|
135
|
+
// for both debugging and to prevent it to being wrapped/filled twice
|
|
136
|
+
core.markFunctionWrapped(sentryWrapped, fn);
|
|
137
|
+
|
|
138
|
+
core.addNonEnumerableProperty(fn, '__sentry_wrapped__', sentryWrapped);
|
|
139
|
+
|
|
140
|
+
// Restore original function name (not all browsers allow that)
|
|
141
|
+
try {
|
|
142
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
143
|
+
const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name');
|
|
144
|
+
if (descriptor.configurable) {
|
|
145
|
+
Object.defineProperty(sentryWrapped, 'name', {
|
|
146
|
+
get() {
|
|
147
|
+
return fn.name;
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
} catch {
|
|
152
|
+
// This may throw if e.g. the descriptor does not exist, or a browser does not allow redefining `name`.
|
|
153
|
+
// to save some bytes we simply try-catch this
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return sentryWrapped;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Get HTTP request data from the current page.
|
|
161
|
+
*/
|
|
162
|
+
function getHttpRequestData() {
|
|
163
|
+
// grab as much info as exists and add it to the event
|
|
164
|
+
const url = core.getLocationHref();
|
|
165
|
+
const { referrer } = WINDOW.document || {};
|
|
166
|
+
const { userAgent } = WINDOW.navigator || {};
|
|
167
|
+
|
|
168
|
+
const headers = {
|
|
169
|
+
...(referrer && { Referer: referrer }),
|
|
170
|
+
...(userAgent && { 'User-Agent': userAgent }),
|
|
171
|
+
};
|
|
172
|
+
const request = {
|
|
173
|
+
url,
|
|
174
|
+
headers,
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
return request;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
exports.WINDOW = WINDOW;
|
|
181
|
+
exports.getHttpRequestData = getHttpRequestData;
|
|
182
|
+
exports.ignoreNextOnError = ignoreNextOnError;
|
|
183
|
+
exports.shouldIgnoreOnError = shouldIgnoreOnError;
|
|
184
|
+
exports.wrap = wrap;
|
|
185
|
+
//# sourceMappingURL=helpers.js.map
|