start-slicemachine 0.12.62-beta.5 → 0.12.62-beta.6
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/dist/StartSliceMachineProcess.cjs +1 -4
- package/dist/StartSliceMachineProcess.cjs.map +1 -1
- package/dist/StartSliceMachineProcess.js +1 -4
- package/dist/StartSliceMachineProcess.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/api.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/api.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/baseclient.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/baseclient.js +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/baseclient.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/checkin.cjs +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/checkin.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/checkin.js +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/checkin.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/envelope.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/envelope.js +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/envelope.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/eventProcessors.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/eventProcessors.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/exports.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/exports.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/hub.cjs +7 -13
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/hub.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/hub.js +8 -14
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/hub.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/integration.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/integration.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/integrations/functiontostring.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/integrations/functiontostring.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/integrations/inboundfilters.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/integrations/inboundfilters.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/integrations/linkederrors.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/integrations/linkederrors.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/integrations/requestdata.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/integrations/requestdata.js +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/integrations/requestdata.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/metrics/aggregator.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/metrics/aggregator.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/metrics/envelope.cjs +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/metrics/envelope.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/metrics/envelope.js +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/metrics/envelope.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/metrics/instance.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/metrics/instance.js +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/metrics/instance.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/metrics/metric-summary.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/metrics/metric-summary.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/metrics/utils.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/metrics/utils.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/scope.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/scope.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/sdk.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/sdk.js +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/sdk.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/server-runtime-client.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/server-runtime-client.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/session.cjs +1 -3
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/session.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/session.js +1 -3
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/session.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/sessionflusher.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/sessionflusher.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/errors.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/errors.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/hubextensions.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/hubextensions.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/sampling.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/sampling.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/span.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/span.js +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/span.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/spanstatus.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/spanstatus.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/trace.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/trace.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/transaction.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/transaction.js +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/transaction.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/utils.cjs +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/utils.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/utils.js +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/utils.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/transports/base.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/transports/base.js +2 -2
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/transports/base.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/hasTracingEnabled.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/hasTracingEnabled.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/isSentryRequestUrl.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/isSentryRequestUrl.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/prepareEvent.cjs +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/prepareEvent.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/prepareEvent.js +2 -2
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/prepareEvent.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/sdkMetadata.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/sdkMetadata.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/spanUtils.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/spanUtils.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/aggregate-errors.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/aggregate-errors.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/baggage.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/baggage.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/browser.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/browser.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/buildPolyfills/_optionalChain.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/buildPolyfills/_optionalChain.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/cookie.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/cookie.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/dsn.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/dsn.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/envelope.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/envelope.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/error.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/error.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/eventbuilder.cjs +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/eventbuilder.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/eventbuilder.js +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/eventbuilder.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/instrument/_handlers.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/instrument/_handlers.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/instrument/console.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/instrument/console.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/instrument/globalError.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/instrument/globalError.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/instrument/globalUnhandledRejection.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/instrument/globalUnhandledRejection.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/is.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/is.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/logger.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/logger.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/lru.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/lru.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/memo.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/memo.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/misc.cjs +3 -3
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/misc.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/misc.js +3 -3
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/misc.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/node-stack-trace.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/node-stack-trace.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/normalize.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/normalize.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/object.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/object.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/path.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/path.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/promisebuffer.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/promisebuffer.js +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/promisebuffer.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/ratelimit.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/ratelimit.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/requestdata.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/requestdata.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/stacktrace.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/stacktrace.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/string.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/string.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/syncpromise.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/syncpromise.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/time.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/time.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/tracing.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/tracing.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/url.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/url.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/worldwide.cjs +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/worldwide.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/worldwide.js +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/worldwide.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/async/domain.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/async/domain.js +1 -1
- package/dist/_node_modules/@sentry/node/esm/async/domain.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/async/hooks.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/async/hooks.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/async/index.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/async/index.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/client.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/client.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/console.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/console.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/context.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/context.js +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/context.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/contextlines.cjs +3 -5
- package/dist/_node_modules/@sentry/node/esm/integrations/contextlines.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/contextlines.js +3 -5
- package/dist/_node_modules/@sentry/node/esm/integrations/contextlines.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/http.cjs +3 -3
- package/dist/_node_modules/@sentry/node/esm/integrations/http.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/http.js +3 -3
- package/dist/_node_modules/@sentry/node/esm/integrations/http.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/local-variables/common.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/local-variables/common.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/local-variables/local-variables-sync.cjs +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/local-variables/local-variables-sync.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/local-variables/local-variables-sync.js +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/local-variables/local-variables-sync.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/modules.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/modules.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/onuncaughtexception.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/onuncaughtexception.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/onunhandledrejection.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/onunhandledrejection.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/spotlight.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/spotlight.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/undici/index.cjs +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/undici/index.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/undici/index.js +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/undici/index.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/utils/errorhandling.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/utils/errorhandling.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/utils/http.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/utils/http.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/module.cjs +4 -4
- package/dist/_node_modules/@sentry/node/esm/module.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/module.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/nodeVersion.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/proxy/base.cjs +1 -2
- package/dist/_node_modules/@sentry/node/esm/proxy/base.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/proxy/base.js +1 -2
- package/dist/_node_modules/@sentry/node/esm/proxy/base.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/proxy/index.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/proxy/index.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/proxy/parse-proxy-response.cjs +3 -6
- package/dist/_node_modules/@sentry/node/esm/proxy/parse-proxy-response.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/proxy/parse-proxy-response.js +3 -6
- package/dist/_node_modules/@sentry/node/esm/proxy/parse-proxy-response.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/sdk.cjs +16 -16
- package/dist/_node_modules/@sentry/node/esm/sdk.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/sdk.js +6 -6
- package/dist/_node_modules/@sentry/node/esm/sdk.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/transports/http.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/transports/http.js.map +1 -1
- package/dist/_node_modules/data-uri-to-buffer/dist/index.cjs.map +1 -1
- package/dist/_node_modules/data-uri-to-buffer/dist/index.js.map +1 -1
- package/dist/_node_modules/fetch-blob/file.cjs +9 -21
- package/dist/_node_modules/fetch-blob/file.cjs.map +1 -1
- package/dist/_node_modules/fetch-blob/file.js +8 -20
- package/dist/_node_modules/fetch-blob/file.js.map +1 -1
- package/dist/_node_modules/fetch-blob/from.cjs +9 -0
- package/dist/_node_modules/fetch-blob/from.cjs.map +1 -0
- package/dist/_node_modules/fetch-blob/from.js +9 -0
- package/dist/_node_modules/fetch-blob/from.js.map +1 -0
- package/dist/_node_modules/fetch-blob/index.cjs +8 -21
- package/dist/_node_modules/fetch-blob/index.cjs.map +1 -1
- package/dist/_node_modules/fetch-blob/index.js +8 -21
- package/dist/_node_modules/fetch-blob/index.js.map +1 -1
- package/dist/_node_modules/fetch-blob/streams.cjs.map +1 -1
- package/dist/_node_modules/fetch-blob/streams.js.map +1 -1
- package/dist/_node_modules/formdata-polyfill/esm.min.cjs +12 -29
- package/dist/_node_modules/formdata-polyfill/esm.min.cjs.map +1 -1
- package/dist/_node_modules/formdata-polyfill/esm.min.js +12 -29
- package/dist/_node_modules/formdata-polyfill/esm.min.js.map +1 -1
- package/dist/_node_modules/lru-cache/index.cjs +1 -2
- package/dist/_node_modules/lru-cache/index.cjs.map +1 -1
- package/dist/_node_modules/lru-cache/index.js +1 -2
- package/dist/_node_modules/lru-cache/index.js.map +1 -1
- package/dist/_node_modules/node-domexception/index.cjs.map +1 -1
- package/dist/_node_modules/node-domexception/index.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/body.cjs +4 -7
- package/dist/_node_modules/node-fetch/src/body.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/body.js +5 -8
- package/dist/_node_modules/node-fetch/src/body.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/errors/abort-error.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/errors/abort-error.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/errors/base.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/errors/base.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/errors/fetch-error.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/errors/fetch-error.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/headers.cjs +1 -2
- package/dist/_node_modules/node-fetch/src/headers.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/headers.js +1 -2
- package/dist/_node_modules/node-fetch/src/headers.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/index.cjs +2 -4
- package/dist/_node_modules/node-fetch/src/index.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/index.js +3 -5
- package/dist/_node_modules/node-fetch/src/index.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/request.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/request.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/response.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/response.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/utils/get-search.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/utils/get-search.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/utils/multipart-parser.cjs +2 -5
- package/dist/_node_modules/node-fetch/src/utils/multipart-parser.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/utils/multipart-parser.js +2 -5
- package/dist/_node_modules/node-fetch/src/utils/multipart-parser.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/utils/referrer.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/utils/referrer.js.map +1 -1
- package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.cjs +5 -10
- package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.cjs.map +1 -1
- package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.js +5 -10
- package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.js.map +1 -1
- package/dist/_node_modules/yallist/iterator.cjs +1 -2
- package/dist/_node_modules/yallist/iterator.cjs.map +1 -1
- package/dist/_node_modules/yallist/iterator.js +1 -2
- package/dist/_node_modules/yallist/iterator.js.map +1 -1
- package/dist/_node_modules/yallist/yallist.cjs.map +1 -1
- package/dist/_node_modules/yallist/yallist.js.map +1 -1
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.js +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/legacyMigrations/detectFramework.cjs.map +1 -1
- package/dist/legacyMigrations/detectFramework.js.map +1 -1
- package/dist/legacyMigrations/migrateAssets.cjs.map +1 -1
- package/dist/legacyMigrations/migrateAssets.js.map +1 -1
- package/dist/legacyMigrations/migrateSMJSON.cjs.map +1 -1
- package/dist/legacyMigrations/migrateSMJSON.js.map +1 -1
- package/dist/lib/castArray.cjs.map +1 -1
- package/dist/lib/castArray.js.map +1 -1
- package/dist/lib/createSliceMachineExpressApp.cjs +1 -2
- package/dist/lib/createSliceMachineExpressApp.cjs.map +1 -1
- package/dist/lib/createSliceMachineExpressApp.js +1 -2
- package/dist/lib/createSliceMachineExpressApp.js.map +1 -1
- package/dist/lib/locateFileUpward.cjs.map +1 -1
- package/dist/lib/locateFileUpward.js.map +1 -1
- package/dist/lib/safelyExecute.cjs.map +1 -1
- package/dist/lib/safelyExecute.js.map +1 -1
- package/dist/lib/sentryErrorHandlers.cjs +2 -4
- package/dist/lib/sentryErrorHandlers.cjs.map +1 -1
- package/dist/lib/sentryErrorHandlers.js +2 -4
- package/dist/lib/sentryErrorHandlers.js.map +1 -1
- package/dist/lib/sentryFrontendTunnel.cjs.map +1 -1
- package/dist/lib/sentryFrontendTunnel.js.map +1 -1
- package/dist/lib/setupSentry.cjs +0 -4
- package/dist/lib/setupSentry.cjs.map +1 -1
- package/dist/lib/setupSentry.js +0 -4
- package/dist/lib/setupSentry.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/classes/comparator.cjs +1 -2
- package/dist/packages/start-slicemachine/_node_modules/semver/classes/comparator.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/classes/comparator.js +1 -2
- package/dist/packages/start-slicemachine/_node_modules/semver/classes/comparator.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/classes/range.cjs +1 -2
- package/dist/packages/start-slicemachine/_node_modules/semver/classes/range.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/classes/range.js +1 -2
- package/dist/packages/start-slicemachine/_node_modules/semver/classes/range.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/classes/semver.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/classes/semver.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/clean.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/cmp.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/cmp.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/coerce.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/coerce.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/compare-build.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/compare-loose.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/compare.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/diff.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/diff.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/eq.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/gt.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/gte.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/inc.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/inc.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/lt.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/lte.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/major.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/minor.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/neq.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/parse.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/parse.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/patch.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/prerelease.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/rcompare.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/rsort.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/satisfies.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/satisfies.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/sort.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/valid.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/index.cjs +4 -4
- package/dist/packages/start-slicemachine/_node_modules/semver/index.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/index.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/internal/debug.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/internal/debug.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/internal/identifiers.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/internal/identifiers.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/internal/parse-options.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/internal/parse-options.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/internal/re.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/internal/re.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/gtr.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/intersects.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/intersects.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/ltr.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/max-satisfying.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/max-satisfying.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/min-satisfying.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/min-satisfying.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/min-version.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/min-version.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/outside.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/outside.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/simplify.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/simplify.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/subset.cjs +10 -11
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/subset.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/subset.js +10 -11
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/subset.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/to-comparators.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/to-comparators.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/valid.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/valid.js.map +1 -1
- package/dist/packages/start-slicemachine/package.json.cjs +1 -1
- package/dist/packages/start-slicemachine/package.json.js +1 -1
- package/package.json +3 -3
- package/dist/lib/checkIsSentryEnabled.cjs +0 -5
- package/dist/lib/checkIsSentryEnabled.cjs.map +0 -1
- package/dist/lib/checkIsSentryEnabled.js +0 -5
- package/dist/lib/checkIsSentryEnabled.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../../../../../../../../node_modules/@sentry/node/esm/integrations/context.js"],"sourcesContent":["import { _optionalChain } from '@sentry/utils';\nimport { execFile } from 'child_process';\nimport { readFile, readdir } from 'fs';\nimport * as os from 'os';\nimport { join } from 'path';\nimport { promisify } from 'util';\nimport { defineIntegration, convertIntegrationFnToClass } from '@sentry/core';\n\n/* eslint-disable max-lines */\n\n// TODO: Required until we drop support for Node v8\nconst readFileAsync = promisify(readFile);\nconst readDirAsync = promisify(readdir);\n\nconst INTEGRATION_NAME = 'Context';\n\nconst _nodeContextIntegration = ((options = {}) => {\n let cachedContext;\n\n const _options = {\n app: true,\n os: true,\n device: true,\n culture: true,\n cloudResource: true,\n ...options,\n };\n\n /** Add contexts to the event. Caches the context so we only look it up once. */\n async function addContext(event) {\n if (cachedContext === undefined) {\n cachedContext = _getContexts();\n }\n\n const updatedContext = _updateContext(await cachedContext);\n\n event.contexts = {\n ...event.contexts,\n app: { ...updatedContext.app, ..._optionalChain([event, 'access', _ => _.contexts, 'optionalAccess', _2 => _2.app]) },\n os: { ...updatedContext.os, ..._optionalChain([event, 'access', _3 => _3.contexts, 'optionalAccess', _4 => _4.os]) },\n device: { ...updatedContext.device, ..._optionalChain([event, 'access', _5 => _5.contexts, 'optionalAccess', _6 => _6.device]) },\n culture: { ...updatedContext.culture, ..._optionalChain([event, 'access', _7 => _7.contexts, 'optionalAccess', _8 => _8.culture]) },\n cloud_resource: { ...updatedContext.cloud_resource, ..._optionalChain([event, 'access', _9 => _9.contexts, 'optionalAccess', _10 => _10.cloud_resource]) },\n };\n\n return event;\n }\n\n /** Get the contexts from node. */\n async function _getContexts() {\n const contexts = {};\n\n if (_options.os) {\n contexts.os = await getOsContext();\n }\n\n if (_options.app) {\n contexts.app = getAppContext();\n }\n\n if (_options.device) {\n contexts.device = getDeviceContext(_options.device);\n }\n\n if (_options.culture) {\n const culture = getCultureContext();\n\n if (culture) {\n contexts.culture = culture;\n }\n }\n\n if (_options.cloudResource) {\n contexts.cloud_resource = getCloudResourceContext();\n }\n\n return contexts;\n }\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n processEvent(event) {\n return addContext(event);\n },\n };\n}) ;\n\nconst nodeContextIntegration = defineIntegration(_nodeContextIntegration);\n\n/**\n * Add node modules / packages to the event.\n * @deprecated Use `nodeContextIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst Context = convertIntegrationFnToClass(INTEGRATION_NAME, nodeContextIntegration)\n\n;\n\n// eslint-disable-next-line deprecation/deprecation\n\n/**\n * Updates the context with dynamic values that can change\n */\nfunction _updateContext(contexts) {\n // Only update properties if they exist\n if (_optionalChain([contexts, 'optionalAccess', _11 => _11.app, 'optionalAccess', _12 => _12.app_memory])) {\n contexts.app.app_memory = process.memoryUsage().rss;\n }\n\n if (_optionalChain([contexts, 'optionalAccess', _13 => _13.device, 'optionalAccess', _14 => _14.free_memory])) {\n contexts.device.free_memory = os.freemem();\n }\n\n return contexts;\n}\n\n/**\n * Returns the operating system context.\n *\n * Based on the current platform, this uses a different strategy to provide the\n * most accurate OS information. Since this might involve spawning subprocesses\n * or accessing the file system, this should only be executed lazily and cached.\n *\n * - On macOS (Darwin), this will execute the `sw_vers` utility. The context\n * has a `name`, `version`, `build` and `kernel_version` set.\n * - On Linux, this will try to load a distribution release from `/etc` and set\n * the `name`, `version` and `kernel_version` fields.\n * - On all other platforms, only a `name` and `version` will be returned. Note\n * that `version` might actually be the kernel version.\n */\nasync function getOsContext() {\n const platformId = os.platform();\n switch (platformId) {\n case 'darwin':\n return getDarwinInfo();\n case 'linux':\n return getLinuxInfo();\n default:\n return {\n name: PLATFORM_NAMES[platformId] || platformId,\n version: os.release(),\n };\n }\n}\n\nfunction getCultureContext() {\n try {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n if (typeof (process.versions ).icu !== 'string') {\n // Node was built without ICU support\n return;\n }\n\n // Check that node was built with full Intl support. Its possible it was built without support for non-English\n // locales which will make resolvedOptions inaccurate\n //\n // https://nodejs.org/api/intl.html#detecting-internationalization-support\n const january = new Date(9e8);\n const spanish = new Intl.DateTimeFormat('es', { month: 'long' });\n if (spanish.format(january) === 'enero') {\n const options = Intl.DateTimeFormat().resolvedOptions();\n\n return {\n locale: options.locale,\n timezone: options.timeZone,\n };\n }\n } catch (err) {\n //\n }\n\n return;\n}\n\nfunction getAppContext() {\n const app_memory = process.memoryUsage().rss;\n const app_start_time = new Date(Date.now() - process.uptime() * 1000).toISOString();\n\n return { app_start_time, app_memory };\n}\n\n/**\n * Gets device information from os\n */\nfunction getDeviceContext(deviceOpt) {\n const device = {};\n\n // Sometimes os.uptime() throws due to lacking permissions: https://github.com/getsentry/sentry-javascript/issues/8202\n let uptime;\n try {\n uptime = os.uptime && os.uptime();\n } catch (e) {\n // noop\n }\n\n // os.uptime or its return value seem to be undefined in certain environments (e.g. Azure functions).\n // Hence, we only set boot time, if we get a valid uptime value.\n // @see https://github.com/getsentry/sentry-javascript/issues/5856\n if (typeof uptime === 'number') {\n device.boot_time = new Date(Date.now() - uptime * 1000).toISOString();\n }\n\n device.arch = os.arch();\n\n if (deviceOpt === true || deviceOpt.memory) {\n device.memory_size = os.totalmem();\n device.free_memory = os.freemem();\n }\n\n if (deviceOpt === true || deviceOpt.cpu) {\n const cpuInfo = os.cpus();\n if (cpuInfo && cpuInfo.length) {\n const firstCpu = cpuInfo[0];\n\n device.processor_count = cpuInfo.length;\n device.cpu_description = firstCpu.model;\n device.processor_frequency = firstCpu.speed;\n }\n }\n\n return device;\n}\n\n/** Mapping of Node's platform names to actual OS names. */\nconst PLATFORM_NAMES = {\n aix: 'IBM AIX',\n freebsd: 'FreeBSD',\n openbsd: 'OpenBSD',\n sunos: 'SunOS',\n win32: 'Windows',\n};\n\n/** Linux version file to check for a distribution. */\n\n/** Mapping of linux release files located in /etc to distributions. */\nconst LINUX_DISTROS = [\n { name: 'fedora-release', distros: ['Fedora'] },\n { name: 'redhat-release', distros: ['Red Hat Linux', 'Centos'] },\n { name: 'redhat_version', distros: ['Red Hat Linux'] },\n { name: 'SuSE-release', distros: ['SUSE Linux'] },\n { name: 'lsb-release', distros: ['Ubuntu Linux', 'Arch Linux'] },\n { name: 'debian_version', distros: ['Debian'] },\n { name: 'debian_release', distros: ['Debian'] },\n { name: 'arch-release', distros: ['Arch Linux'] },\n { name: 'gentoo-release', distros: ['Gentoo Linux'] },\n { name: 'novell-release', distros: ['SUSE Linux'] },\n { name: 'alpine-release', distros: ['Alpine Linux'] },\n];\n\n/** Functions to extract the OS version from Linux release files. */\nconst LINUX_VERSIONS\n\n = {\n alpine: content => content,\n arch: content => matchFirst(/distrib_release=(.*)/, content),\n centos: content => matchFirst(/release ([^ ]+)/, content),\n debian: content => content,\n fedora: content => matchFirst(/release (..)/, content),\n mint: content => matchFirst(/distrib_release=(.*)/, content),\n red: content => matchFirst(/release ([^ ]+)/, content),\n suse: content => matchFirst(/VERSION = (.*)\\n/, content),\n ubuntu: content => matchFirst(/distrib_release=(.*)/, content),\n};\n\n/**\n * Executes a regular expression with one capture group.\n *\n * @param regex A regular expression to execute.\n * @param text Content to execute the RegEx on.\n * @returns The captured string if matched; otherwise undefined.\n */\nfunction matchFirst(regex, text) {\n const match = regex.exec(text);\n return match ? match[1] : undefined;\n}\n\n/** Loads the macOS operating system context. */\nasync function getDarwinInfo() {\n // Default values that will be used in case no operating system information\n // can be loaded. The default version is computed via heuristics from the\n // kernel version, but the build ID is missing.\n const darwinInfo = {\n kernel_version: os.release(),\n name: 'Mac OS X',\n version: `10.${Number(os.release().split('.')[0]) - 4}`,\n };\n\n try {\n // We try to load the actual macOS version by executing the `sw_vers` tool.\n // This tool should be available on every standard macOS installation. In\n // case this fails, we stick with the values computed above.\n\n const output = await new Promise((resolve, reject) => {\n execFile('/usr/bin/sw_vers', (error, stdout) => {\n if (error) {\n reject(error);\n return;\n }\n resolve(stdout);\n });\n });\n\n darwinInfo.name = matchFirst(/^ProductName:\\s+(.*)$/m, output);\n darwinInfo.version = matchFirst(/^ProductVersion:\\s+(.*)$/m, output);\n darwinInfo.build = matchFirst(/^BuildVersion:\\s+(.*)$/m, output);\n } catch (e) {\n // ignore\n }\n\n return darwinInfo;\n}\n\n/** Returns a distribution identifier to look up version callbacks. */\nfunction getLinuxDistroId(name) {\n return name.split(' ')[0].toLowerCase();\n}\n\n/** Loads the Linux operating system context. */\nasync function getLinuxInfo() {\n // By default, we cannot assume anything about the distribution or Linux\n // version. `os.release()` returns the kernel version and we assume a generic\n // \"Linux\" name, which will be replaced down below.\n const linuxInfo = {\n kernel_version: os.release(),\n name: 'Linux',\n };\n\n try {\n // We start guessing the distribution by listing files in the /etc\n // directory. This is were most Linux distributions (except Knoppix) store\n // release files with certain distribution-dependent meta data. We search\n // for exactly one known file defined in `LINUX_DISTROS` and exit if none\n // are found. In case there are more than one file, we just stick with the\n // first one.\n const etcFiles = await readDirAsync('/etc');\n const distroFile = LINUX_DISTROS.find(file => etcFiles.includes(file.name));\n if (!distroFile) {\n return linuxInfo;\n }\n\n // Once that file is known, load its contents. To make searching in those\n // files easier, we lowercase the file contents. Since these files are\n // usually quite small, this should not allocate too much memory and we only\n // hold on to it for a very short amount of time.\n const distroPath = join('/etc', distroFile.name);\n const contents = ((await readFileAsync(distroPath, { encoding: 'utf-8' })) ).toLowerCase();\n\n // Some Linux distributions store their release information in the same file\n // (e.g. RHEL and Centos). In those cases, we scan the file for an\n // identifier, that basically consists of the first word of the linux\n // distribution name (e.g. \"red\" for Red Hat). In case there is no match, we\n // just assume the first distribution in our list.\n const { distros } = distroFile;\n linuxInfo.name = distros.find(d => contents.indexOf(getLinuxDistroId(d)) >= 0) || distros[0];\n\n // Based on the found distribution, we can now compute the actual version\n // number. This is different for every distribution, so several strategies\n // are computed in `LINUX_VERSIONS`.\n const id = getLinuxDistroId(linuxInfo.name);\n linuxInfo.version = LINUX_VERSIONS[id](contents);\n } catch (e) {\n // ignore\n }\n\n return linuxInfo;\n}\n\n/**\n * Grabs some information about hosting provider based on best effort.\n */\nfunction getCloudResourceContext() {\n if (process.env.VERCEL) {\n // https://vercel.com/docs/concepts/projects/environment-variables/system-environment-variables#system-environment-variables\n return {\n 'cloud.provider': 'vercel',\n 'cloud.region': process.env.VERCEL_REGION,\n };\n } else if (process.env.AWS_REGION) {\n // https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html\n return {\n 'cloud.provider': 'aws',\n 'cloud.region': process.env.AWS_REGION,\n 'cloud.platform': process.env.AWS_EXECUTION_ENV,\n };\n } else if (process.env.GCP_PROJECT) {\n // https://cloud.google.com/composer/docs/how-to/managing/environment-variables#reserved_variables\n return {\n 'cloud.provider': 'gcp',\n };\n } else if (process.env.ALIYUN_REGION_ID) {\n // TODO: find where I found these environment variables - at least gc.github.com returns something\n return {\n 'cloud.provider': 'alibaba_cloud',\n 'cloud.region': process.env.ALIYUN_REGION_ID,\n };\n } else if (process.env.WEBSITE_SITE_NAME && process.env.REGION_NAME) {\n // https://learn.microsoft.com/en-us/azure/app-service/reference-app-settings?tabs=kudu%2Cdotnet#app-environment\n return {\n 'cloud.provider': 'azure',\n 'cloud.region': process.env.REGION_NAME,\n };\n } else if (process.env.IBM_CLOUD_REGION) {\n // TODO: find where I found these environment variables - at least gc.github.com returns something\n return {\n 'cloud.provider': 'ibm_cloud',\n 'cloud.region': process.env.IBM_CLOUD_REGION,\n };\n } else if (process.env.TENCENTCLOUD_REGION) {\n // https://www.tencentcloud.com/document/product/583/32748\n return {\n 'cloud.provider': 'tencent_cloud',\n 'cloud.region': process.env.TENCENTCLOUD_REGION,\n 'cloud.account.id': process.env.TENCENTCLOUD_APPID,\n 'cloud.availability_zone': process.env.TENCENTCLOUD_ZONE,\n };\n } else if (process.env.NETLIFY) {\n // https://docs.netlify.com/configure-builds/environment-variables/#read-only-variables\n return {\n 'cloud.provider': 'netlify',\n };\n } else if (process.env.FLY_REGION) {\n // https://fly.io/docs/reference/runtime-environment/\n return {\n 'cloud.provider': 'fly.io',\n 'cloud.region': process.env.FLY_REGION,\n };\n } else if (process.env.DYNO) {\n // https://devcenter.heroku.com/articles/dynos#local-environment-variables\n return {\n 'cloud.provider': 'heroku',\n };\n } else {\n return undefined;\n }\n}\n\nexport { Context, getDeviceContext, nodeContextIntegration, readDirAsync, readFileAsync };\n//# sourceMappingURL=context.js.map\n"],"names":[],"mappings":";;;;;;;AAWK,MAAC,gBAAgB,UAAU,QAAQ;AACnC,MAAC,eAAe,UAAU,OAAO;AAEtC,MAAM,mBAAmB;AAEzB,MAAM,0BAA2B,CAAC,UAAU,OAAO;AACjD,MAAI;AAEJ,QAAM,WAAW;AAAA,IACf,KAAK;AAAA,IACL,IAAI;AAAA,IACJ,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,eAAe;AAAA,IACf,GAAG;AAAA,EACP;AAGE,iBAAe,WAAW,OAAO;AAC/B,QAAI,kBAAkB,QAAW;AAC/B,sBAAgB,aAAY;AAAA,IAC7B;AAED,UAAM,iBAAiB,eAAe,MAAM,aAAa;AAEzD,UAAM,WAAW;AAAA,MACf,GAAG,MAAM;AAAA,MACT,KAAK,EAAE,GAAG,eAAe,KAAK,GAAG,eAAe,CAAC,OAAO,UAAU,OAAK,EAAE,UAAU,kBAAkB,QAAM,GAAG,GAAG,CAAC,EAAG;AAAA,MACrH,IAAI,EAAE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ACA,WAAa,QAAQ,IAAI,kBAAkB;AAEvC,WAAO;AAAA,MACL,kBAAkB;AAAA,MAClB,gBAAgB,QAAQ,IAAI;AAAA,IAClC;AAAA,EACA,WAAa,QAAQ,IAAI,qBAAqB;AAE1C,WAAO;AAAA,MACL,kBAAkB;AAAA,MAClB,gBAAgB,QAAQ,IAAI;AAAA,MAC5B,oBAAoB,QAAQ,IAAI;AAAA,MAChC,2BAA2B,QAAQ,IAAI;AAAA,IAC7C;AAAA,EACA,WAAa,QAAQ,IAAI,SAAS;AAE9B,WAAO;AAAA,MACL,kBAAkB;AAAA,IACxB;AAAA,EACA,WAAa,QAAQ,IAAI,YAAY;AAEjC,WAAO;AAAA,MACL,kBAAkB;AAAA,MAClB,gBAAgB,QAAQ,IAAI;AAAA,IAClC;AAAA,EACA,WAAa,QAAQ,IAAI,MAAM;AAE3B,WAAO;AAAA,MACL,kBAAkB;AAAA,IACxB;AAAA,EACA,OAAS;AACL,WAAO;AAAA,EACR;AACH;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"context.js","sources":["../../../../../../../../node_modules/@sentry/node/esm/integrations/context.js"],"sourcesContent":["import { _optionalChain } from '@sentry/utils';\nimport { execFile } from 'child_process';\nimport { readFile, readdir } from 'fs';\nimport * as os from 'os';\nimport { join } from 'path';\nimport { promisify } from 'util';\nimport { defineIntegration, convertIntegrationFnToClass } from '@sentry/core';\n\n/* eslint-disable max-lines */\n\n// TODO: Required until we drop support for Node v8\nconst readFileAsync = promisify(readFile);\nconst readDirAsync = promisify(readdir);\n\nconst INTEGRATION_NAME = 'Context';\n\nconst _nodeContextIntegration = ((options = {}) => {\n let cachedContext;\n\n const _options = {\n app: true,\n os: true,\n device: true,\n culture: true,\n cloudResource: true,\n ...options,\n };\n\n /** Add contexts to the event. Caches the context so we only look it up once. */\n async function addContext(event) {\n if (cachedContext === undefined) {\n cachedContext = _getContexts();\n }\n\n const updatedContext = _updateContext(await cachedContext);\n\n event.contexts = {\n ...event.contexts,\n app: { ...updatedContext.app, ..._optionalChain([event, 'access', _ => _.contexts, 'optionalAccess', _2 => _2.app]) },\n os: { ...updatedContext.os, ..._optionalChain([event, 'access', _3 => _3.contexts, 'optionalAccess', _4 => _4.os]) },\n device: { ...updatedContext.device, ..._optionalChain([event, 'access', _5 => _5.contexts, 'optionalAccess', _6 => _6.device]) },\n culture: { ...updatedContext.culture, ..._optionalChain([event, 'access', _7 => _7.contexts, 'optionalAccess', _8 => _8.culture]) },\n cloud_resource: { ...updatedContext.cloud_resource, ..._optionalChain([event, 'access', _9 => _9.contexts, 'optionalAccess', _10 => _10.cloud_resource]) },\n };\n\n return event;\n }\n\n /** Get the contexts from node. */\n async function _getContexts() {\n const contexts = {};\n\n if (_options.os) {\n contexts.os = await getOsContext();\n }\n\n if (_options.app) {\n contexts.app = getAppContext();\n }\n\n if (_options.device) {\n contexts.device = getDeviceContext(_options.device);\n }\n\n if (_options.culture) {\n const culture = getCultureContext();\n\n if (culture) {\n contexts.culture = culture;\n }\n }\n\n if (_options.cloudResource) {\n contexts.cloud_resource = getCloudResourceContext();\n }\n\n return contexts;\n }\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n processEvent(event) {\n return addContext(event);\n },\n };\n}) ;\n\nconst nodeContextIntegration = defineIntegration(_nodeContextIntegration);\n\n/**\n * Add node modules / packages to the event.\n * @deprecated Use `nodeContextIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst Context = convertIntegrationFnToClass(INTEGRATION_NAME, nodeContextIntegration)\n\n;\n\n// eslint-disable-next-line deprecation/deprecation\n\n/**\n * Updates the context with dynamic values that can change\n */\nfunction _updateContext(contexts) {\n // Only update properties if they exist\n if (_optionalChain([contexts, 'optionalAccess', _11 => _11.app, 'optionalAccess', _12 => _12.app_memory])) {\n contexts.app.app_memory = process.memoryUsage().rss;\n }\n\n if (_optionalChain([contexts, 'optionalAccess', _13 => _13.device, 'optionalAccess', _14 => _14.free_memory])) {\n contexts.device.free_memory = os.freemem();\n }\n\n return contexts;\n}\n\n/**\n * Returns the operating system context.\n *\n * Based on the current platform, this uses a different strategy to provide the\n * most accurate OS information. Since this might involve spawning subprocesses\n * or accessing the file system, this should only be executed lazily and cached.\n *\n * - On macOS (Darwin), this will execute the `sw_vers` utility. The context\n * has a `name`, `version`, `build` and `kernel_version` set.\n * - On Linux, this will try to load a distribution release from `/etc` and set\n * the `name`, `version` and `kernel_version` fields.\n * - On all other platforms, only a `name` and `version` will be returned. Note\n * that `version` might actually be the kernel version.\n */\nasync function getOsContext() {\n const platformId = os.platform();\n switch (platformId) {\n case 'darwin':\n return getDarwinInfo();\n case 'linux':\n return getLinuxInfo();\n default:\n return {\n name: PLATFORM_NAMES[platformId] || platformId,\n version: os.release(),\n };\n }\n}\n\nfunction getCultureContext() {\n try {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n if (typeof (process.versions ).icu !== 'string') {\n // Node was built without ICU support\n return;\n }\n\n // Check that node was built with full Intl support. Its possible it was built without support for non-English\n // locales which will make resolvedOptions inaccurate\n //\n // https://nodejs.org/api/intl.html#detecting-internationalization-support\n const january = new Date(9e8);\n const spanish = new Intl.DateTimeFormat('es', { month: 'long' });\n if (spanish.format(january) === 'enero') {\n const options = Intl.DateTimeFormat().resolvedOptions();\n\n return {\n locale: options.locale,\n timezone: options.timeZone,\n };\n }\n } catch (err) {\n //\n }\n\n return;\n}\n\nfunction getAppContext() {\n const app_memory = process.memoryUsage().rss;\n const app_start_time = new Date(Date.now() - process.uptime() * 1000).toISOString();\n\n return { app_start_time, app_memory };\n}\n\n/**\n * Gets device information from os\n */\nfunction getDeviceContext(deviceOpt) {\n const device = {};\n\n // Sometimes os.uptime() throws due to lacking permissions: https://github.com/getsentry/sentry-javascript/issues/8202\n let uptime;\n try {\n uptime = os.uptime && os.uptime();\n } catch (e) {\n // noop\n }\n\n // os.uptime or its return value seem to be undefined in certain environments (e.g. Azure functions).\n // Hence, we only set boot time, if we get a valid uptime value.\n // @see https://github.com/getsentry/sentry-javascript/issues/5856\n if (typeof uptime === 'number') {\n device.boot_time = new Date(Date.now() - uptime * 1000).toISOString();\n }\n\n device.arch = os.arch();\n\n if (deviceOpt === true || deviceOpt.memory) {\n device.memory_size = os.totalmem();\n device.free_memory = os.freemem();\n }\n\n if (deviceOpt === true || deviceOpt.cpu) {\n const cpuInfo = os.cpus();\n if (cpuInfo && cpuInfo.length) {\n const firstCpu = cpuInfo[0];\n\n device.processor_count = cpuInfo.length;\n device.cpu_description = firstCpu.model;\n device.processor_frequency = firstCpu.speed;\n }\n }\n\n return device;\n}\n\n/** Mapping of Node's platform names to actual OS names. */\nconst PLATFORM_NAMES = {\n aix: 'IBM AIX',\n freebsd: 'FreeBSD',\n openbsd: 'OpenBSD',\n sunos: 'SunOS',\n win32: 'Windows',\n};\n\n/** Linux version file to check for a distribution. */\n\n/** Mapping of linux release files located in /etc to distributions. */\nconst LINUX_DISTROS = [\n { name: 'fedora-release', distros: ['Fedora'] },\n { name: 'redhat-release', distros: ['Red Hat Linux', 'Centos'] },\n { name: 'redhat_version', distros: ['Red Hat Linux'] },\n { name: 'SuSE-release', distros: ['SUSE Linux'] },\n { name: 'lsb-release', distros: ['Ubuntu Linux', 'Arch Linux'] },\n { name: 'debian_version', distros: ['Debian'] },\n { name: 'debian_release', distros: ['Debian'] },\n { name: 'arch-release', distros: ['Arch Linux'] },\n { name: 'gentoo-release', distros: ['Gentoo Linux'] },\n { name: 'novell-release', distros: ['SUSE Linux'] },\n { name: 'alpine-release', distros: ['Alpine Linux'] },\n];\n\n/** Functions to extract the OS version from Linux release files. */\nconst LINUX_VERSIONS\n\n = {\n alpine: content => content,\n arch: content => matchFirst(/distrib_release=(.*)/, content),\n centos: content => matchFirst(/release ([^ ]+)/, content),\n debian: content => content,\n fedora: content => matchFirst(/release (..)/, content),\n mint: content => matchFirst(/distrib_release=(.*)/, content),\n red: content => matchFirst(/release ([^ ]+)/, content),\n suse: content => matchFirst(/VERSION = (.*)\\n/, content),\n ubuntu: content => matchFirst(/distrib_release=(.*)/, content),\n};\n\n/**\n * Executes a regular expression with one capture group.\n *\n * @param regex A regular expression to execute.\n * @param text Content to execute the RegEx on.\n * @returns The captured string if matched; otherwise undefined.\n */\nfunction matchFirst(regex, text) {\n const match = regex.exec(text);\n return match ? match[1] : undefined;\n}\n\n/** Loads the macOS operating system context. */\nasync function getDarwinInfo() {\n // Default values that will be used in case no operating system information\n // can be loaded. The default version is computed via heuristics from the\n // kernel version, but the build ID is missing.\n const darwinInfo = {\n kernel_version: os.release(),\n name: 'Mac OS X',\n version: `10.${Number(os.release().split('.')[0]) - 4}`,\n };\n\n try {\n // We try to load the actual macOS version by executing the `sw_vers` tool.\n // This tool should be available on every standard macOS installation. In\n // case this fails, we stick with the values computed above.\n\n const output = await new Promise((resolve, reject) => {\n execFile('/usr/bin/sw_vers', (error, stdout) => {\n if (error) {\n reject(error);\n return;\n }\n resolve(stdout);\n });\n });\n\n darwinInfo.name = matchFirst(/^ProductName:\\s+(.*)$/m, output);\n darwinInfo.version = matchFirst(/^ProductVersion:\\s+(.*)$/m, output);\n darwinInfo.build = matchFirst(/^BuildVersion:\\s+(.*)$/m, output);\n } catch (e) {\n // ignore\n }\n\n return darwinInfo;\n}\n\n/** Returns a distribution identifier to look up version callbacks. */\nfunction getLinuxDistroId(name) {\n return name.split(' ')[0].toLowerCase();\n}\n\n/** Loads the Linux operating system context. */\nasync function getLinuxInfo() {\n // By default, we cannot assume anything about the distribution or Linux\n // version. `os.release()` returns the kernel version and we assume a generic\n // \"Linux\" name, which will be replaced down below.\n const linuxInfo = {\n kernel_version: os.release(),\n name: 'Linux',\n };\n\n try {\n // We start guessing the distribution by listing files in the /etc\n // directory. This is were most Linux distributions (except Knoppix) store\n // release files with certain distribution-dependent meta data. We search\n // for exactly one known file defined in `LINUX_DISTROS` and exit if none\n // are found. In case there are more than one file, we just stick with the\n // first one.\n const etcFiles = await readDirAsync('/etc');\n const distroFile = LINUX_DISTROS.find(file => etcFiles.includes(file.name));\n if (!distroFile) {\n return linuxInfo;\n }\n\n // Once that file is known, load its contents. To make searching in those\n // files easier, we lowercase the file contents. Since these files are\n // usually quite small, this should not allocate too much memory and we only\n // hold on to it for a very short amount of time.\n const distroPath = join('/etc', distroFile.name);\n const contents = ((await readFileAsync(distroPath, { encoding: 'utf-8' })) ).toLowerCase();\n\n // Some Linux distributions store their release information in the same file\n // (e.g. RHEL and Centos). In those cases, we scan the file for an\n // identifier, that basically consists of the first word of the linux\n // distribution name (e.g. \"red\" for Red Hat). In case there is no match, we\n // just assume the first distribution in our list.\n const { distros } = distroFile;\n linuxInfo.name = distros.find(d => contents.indexOf(getLinuxDistroId(d)) >= 0) || distros[0];\n\n // Based on the found distribution, we can now compute the actual version\n // number. This is different for every distribution, so several strategies\n // are computed in `LINUX_VERSIONS`.\n const id = getLinuxDistroId(linuxInfo.name);\n linuxInfo.version = LINUX_VERSIONS[id](contents);\n } catch (e) {\n // ignore\n }\n\n return linuxInfo;\n}\n\n/**\n * Grabs some information about hosting provider based on best effort.\n */\nfunction getCloudResourceContext() {\n if (process.env.VERCEL) {\n // https://vercel.com/docs/concepts/projects/environment-variables/system-environment-variables#system-environment-variables\n return {\n 'cloud.provider': 'vercel',\n 'cloud.region': process.env.VERCEL_REGION,\n };\n } else if (process.env.AWS_REGION) {\n // https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html\n return {\n 'cloud.provider': 'aws',\n 'cloud.region': process.env.AWS_REGION,\n 'cloud.platform': process.env.AWS_EXECUTION_ENV,\n };\n } else if (process.env.GCP_PROJECT) {\n // https://cloud.google.com/composer/docs/how-to/managing/environment-variables#reserved_variables\n return {\n 'cloud.provider': 'gcp',\n };\n } else if (process.env.ALIYUN_REGION_ID) {\n // TODO: find where I found these environment variables - at least gc.github.com returns something\n return {\n 'cloud.provider': 'alibaba_cloud',\n 'cloud.region': process.env.ALIYUN_REGION_ID,\n };\n } else if (process.env.WEBSITE_SITE_NAME && process.env.REGION_NAME) {\n // https://learn.microsoft.com/en-us/azure/app-service/reference-app-settings?tabs=kudu%2Cdotnet#app-environment\n return {\n 'cloud.provider': 'azure',\n 'cloud.region': process.env.REGION_NAME,\n };\n } else if (process.env.IBM_CLOUD_REGION) {\n // TODO: find where I found these environment variables - at least gc.github.com returns something\n return {\n 'cloud.provider': 'ibm_cloud',\n 'cloud.region': process.env.IBM_CLOUD_REGION,\n };\n } else if (process.env.TENCENTCLOUD_REGION) {\n // https://www.tencentcloud.com/document/product/583/32748\n return {\n 'cloud.provider': 'tencent_cloud',\n 'cloud.region': process.env.TENCENTCLOUD_REGION,\n 'cloud.account.id': process.env.TENCENTCLOUD_APPID,\n 'cloud.availability_zone': process.env.TENCENTCLOUD_ZONE,\n };\n } else if (process.env.NETLIFY) {\n // https://docs.netlify.com/configure-builds/environment-variables/#read-only-variables\n return {\n 'cloud.provider': 'netlify',\n };\n } else if (process.env.FLY_REGION) {\n // https://fly.io/docs/reference/runtime-environment/\n return {\n 'cloud.provider': 'fly.io',\n 'cloud.region': process.env.FLY_REGION,\n };\n } else if (process.env.DYNO) {\n // https://devcenter.heroku.com/articles/dynos#local-environment-variables\n return {\n 'cloud.provider': 'heroku',\n };\n } else {\n return undefined;\n }\n}\n\nexport { Context, getDeviceContext, nodeContextIntegration, readDirAsync, readFileAsync };\n//# sourceMappingURL=context.js.map\n"],"names":[],"mappings":";;;;;;;AAWK,MAAC,gBAAgB,UAAU,QAAQ;AACnC,MAAC,eAAe,UAAU,OAAO;AAEtC,MAAM,mBAAmB;AAEzB,MAAM,0BAA2B,CAAC,UAAU,OAAO;AACjD,MAAI;AAEJ,QAAM,WAAW;AAAA,IACf,KAAK;AAAA,IACL,IAAI;AAAA,IACJ,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,eAAe;AAAA,IACf,GAAG;AAAA,EACP;AAGE,iBAAe,WAAW,OAAO;AAC/B,QAAI,kBAAkB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AAQ,IAAI;AAAA,MAC5B,kBAAkB,QAAQ,IAAI;AAAA,IACpC;AAAA,EACE,WAAW,QAAQ,IAAI,aAAa;AAElC,WAAO;AAAA,MACL,kBAAkB;AAAA,IACxB;AAAA,EACE,WAAW,QAAQ,IAAI,kBAAkB;AAEvC,WAAO;AAAA,MACL,kBAAkB;AAAA,MAClB,gBAAgB,QAAQ,IAAI;AAAA,IAClC;AAAA,EACE,WAAW,QAAQ,IAAI,qBAAqB,QAAQ,IAAI,aAAa;AAEnE,WAAO;AAAA,MACL,kBAAkB;AAAA,MAClB,gBAAgB,QAAQ,IAAI;AAAA,IAClC;AAAA,EACE,WAAW,QAAQ,IAAI,kBAAkB;AAEvC,WAAO;AAAA,MACL,kBAAkB;AAAA,MAClB,gBAAgB,QAAQ,IAAI;AAAA,IAClC;AAAA,EACE,WAAW,QAAQ,IAAI,qBAAqB;AAE1C,WAAO;AAAA,MACL,kBAAkB;AAAA,MAClB,gBAAgB,QAAQ,IAAI;AAAA,MAC5B,oBAAoB,QAAQ,IAAI;AAAA,MAChC,2BAA2B,QAAQ,IAAI;AAAA,IAC7C;AAAA,EACE,WAAW,QAAQ,IAAI,SAAS;AAE9B,WAAO;AAAA,MACL,kBAAkB;AAAA,IACxB;AAAA,EACE,WAAW,QAAQ,IAAI,YAAY;AAEjC,WAAO;AAAA,MACL,kBAAkB;AAAA,MAClB,gBAAgB,QAAQ,IAAI;AAAA,IAClC;AAAA,EACE,WAAW,QAAQ,IAAI,MAAM;AAE3B,WAAO;AAAA,MACL,kBAAkB;AAAA,IACxB;AAAA,EACE,OAAO;AACL,WAAO;AAAA,EACT;AACF;","x_google_ignoreList":[0]}
|
|
@@ -3,18 +3,16 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const fs = require("fs");
|
|
4
4
|
const integration = require('./../../_node_modules/@sentry/core/esm/integration.cjs');
|
|
5
5
|
const _optionalChain = require('./../../_node_modules/@sentry/utils/esm/buildPolyfills/_optionalChain.cjs');
|
|
6
|
-
const misc = require('./../../_node_modules/@sentry/utils/esm/misc.cjs');
|
|
7
6
|
const lru = require('./../../_node_modules/@sentry/utils/esm/lru.cjs');
|
|
7
|
+
const misc = require('./../../_node_modules/@sentry/utils/esm/misc.cjs');
|
|
8
8
|
const FILE_CONTENT_CACHE = new lru.LRUMap(100);
|
|
9
9
|
const DEFAULT_LINES_OF_CONTEXT = 7;
|
|
10
10
|
const INTEGRATION_NAME = "ContextLines";
|
|
11
11
|
function readTextFileAsync(path) {
|
|
12
12
|
return new Promise((resolve, reject) => {
|
|
13
13
|
fs.readFile(path, "utf8", (err, data) => {
|
|
14
|
-
if (err)
|
|
15
|
-
|
|
16
|
-
else
|
|
17
|
-
resolve(data);
|
|
14
|
+
if (err) reject(err);
|
|
15
|
+
else resolve(data);
|
|
18
16
|
});
|
|
19
17
|
});
|
|
20
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextlines.cjs","sources":["../../../../../../../../node_modules/@sentry/node/esm/integrations/contextlines.js"],"sourcesContent":["import { _optionalChain } from '@sentry/utils';\nimport { readFile } from 'fs';\nimport { defineIntegration, convertIntegrationFnToClass } from '@sentry/core';\nimport { LRUMap, addContextToFrame } from '@sentry/utils';\n\nconst FILE_CONTENT_CACHE = new LRUMap(100);\nconst DEFAULT_LINES_OF_CONTEXT = 7;\nconst INTEGRATION_NAME = 'ContextLines';\n\n// TODO: Replace with promisify when minimum supported node >= v8\nfunction readTextFileAsync(path) {\n return new Promise((resolve, reject) => {\n readFile(path, 'utf8', (err, data) => {\n if (err) reject(err);\n else resolve(data);\n });\n });\n}\n\nconst _contextLinesIntegration = ((options = {}) => {\n const contextLines = options.frameContextLines !== undefined ? options.frameContextLines : DEFAULT_LINES_OF_CONTEXT;\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n processEvent(event) {\n return addSourceContext(event, contextLines);\n },\n };\n}) ;\n\nconst contextLinesIntegration = defineIntegration(_contextLinesIntegration);\n\n/**\n * Add node modules / packages to the event.\n * @deprecated Use `contextLinesIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst ContextLines = convertIntegrationFnToClass(INTEGRATION_NAME, contextLinesIntegration)\n\n;\n\nasync function addSourceContext(event, contextLines) {\n // keep a lookup map of which files we've already enqueued to read,\n // so we don't enqueue the same file multiple times which would cause multiple i/o reads\n const enqueuedReadSourceFileTasks = {};\n const readSourceFileTasks = [];\n\n if (contextLines > 0 && _optionalChain([event, 'access', _2 => _2.exception, 'optionalAccess', _3 => _3.values])) {\n for (const exception of event.exception.values) {\n if (!_optionalChain([exception, 'access', _4 => _4.stacktrace, 'optionalAccess', _5 => _5.frames])) {\n continue;\n }\n\n // We want to iterate in reverse order as calling cache.get will bump the file in our LRU cache.\n // This ends up prioritizes source context for frames at the top of the stack instead of the bottom.\n for (let i = exception.stacktrace.frames.length - 1; i >= 0; i--) {\n const frame = exception.stacktrace.frames[i];\n // Call cache.get to bump the file to the top of the cache and ensure we have not already\n // enqueued a read operation for this filename\n if (frame.filename && !enqueuedReadSourceFileTasks[frame.filename] && !FILE_CONTENT_CACHE.get(frame.filename)) {\n readSourceFileTasks.push(_readSourceFile(frame.filename));\n enqueuedReadSourceFileTasks[frame.filename] = 1;\n }\n }\n }\n }\n\n // check if files to read > 0, if so, await all of them to be read before adding source contexts.\n // Normally, Promise.all here could be short circuited if one of the promises rejects, but we\n // are guarding from that by wrapping the i/o read operation in a try/catch.\n if (readSourceFileTasks.length > 0) {\n await Promise.all(readSourceFileTasks);\n }\n\n // Perform the same loop as above, but this time we can assume all files are in the cache\n // and attempt to add source context to frames.\n if (contextLines > 0 && _optionalChain([event, 'access', _6 => _6.exception, 'optionalAccess', _7 => _7.values])) {\n for (const exception of event.exception.values) {\n if (exception.stacktrace && exception.stacktrace.frames) {\n await addSourceContextToFrames(exception.stacktrace.frames, contextLines);\n }\n }\n }\n\n return event;\n}\n\n/** Adds context lines to frames */\nfunction addSourceContextToFrames(frames, contextLines) {\n for (const frame of frames) {\n // Only add context if we have a filename and it hasn't already been added\n if (frame.filename && frame.context_line === undefined) {\n const sourceFileLines = FILE_CONTENT_CACHE.get(frame.filename);\n\n if (sourceFileLines) {\n try {\n addContextToFrame(sourceFileLines, frame, contextLines);\n } catch (e) {\n // anomaly, being defensive in case\n // unlikely to ever happen in practice but can definitely happen in theory\n }\n }\n }\n }\n}\n\n// eslint-disable-next-line deprecation/deprecation\n\n/**\n * Reads file contents and caches them in a global LRU cache.\n * If reading fails, mark the file as null in the cache so we don't try again.\n *\n * @param filename filepath to read content from.\n */\nasync function _readSourceFile(filename) {\n const cachedFile = FILE_CONTENT_CACHE.get(filename);\n\n // We have already attempted to read this file and failed, do not try again\n if (cachedFile === null) {\n return null;\n }\n\n // We have a cache hit, return it\n if (cachedFile !== undefined) {\n return cachedFile;\n }\n\n // Guard from throwing if readFile fails, this enables us to use Promise.all and\n // not have it short circuiting if one of the promises rejects + since context lines are added\n // on a best effort basis, we want to throw here anyways.\n\n // If we made it to here, it means that our file is not cache nor marked as failed, so attempt to read it\n let content = null;\n try {\n const rawFileContents = await readTextFileAsync(filename);\n content = rawFileContents.split('\\n');\n } catch (_) {\n // if we fail, we will mark the file as null in the cache and short circuit next time we try to read it\n }\n\n FILE_CONTENT_CACHE.set(filename, content);\n return content;\n}\n\nexport { ContextLines, contextLinesIntegration };\n//# sourceMappingURL=contextlines.js.map\n"],"names":["LRUMap","readFile","defineIntegration","convertIntegrationFnToClass","_optionalChain","addContextToFrame"],"mappings":";;;;;;;AAKA,MAAM,qBAAqB,IAAIA,
|
|
1
|
+
{"version":3,"file":"contextlines.cjs","sources":["../../../../../../../../node_modules/@sentry/node/esm/integrations/contextlines.js"],"sourcesContent":["import { _optionalChain } from '@sentry/utils';\nimport { readFile } from 'fs';\nimport { defineIntegration, convertIntegrationFnToClass } from '@sentry/core';\nimport { LRUMap, addContextToFrame } from '@sentry/utils';\n\nconst FILE_CONTENT_CACHE = new LRUMap(100);\nconst DEFAULT_LINES_OF_CONTEXT = 7;\nconst INTEGRATION_NAME = 'ContextLines';\n\n// TODO: Replace with promisify when minimum supported node >= v8\nfunction readTextFileAsync(path) {\n return new Promise((resolve, reject) => {\n readFile(path, 'utf8', (err, data) => {\n if (err) reject(err);\n else resolve(data);\n });\n });\n}\n\nconst _contextLinesIntegration = ((options = {}) => {\n const contextLines = options.frameContextLines !== undefined ? options.frameContextLines : DEFAULT_LINES_OF_CONTEXT;\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n processEvent(event) {\n return addSourceContext(event, contextLines);\n },\n };\n}) ;\n\nconst contextLinesIntegration = defineIntegration(_contextLinesIntegration);\n\n/**\n * Add node modules / packages to the event.\n * @deprecated Use `contextLinesIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst ContextLines = convertIntegrationFnToClass(INTEGRATION_NAME, contextLinesIntegration)\n\n;\n\nasync function addSourceContext(event, contextLines) {\n // keep a lookup map of which files we've already enqueued to read,\n // so we don't enqueue the same file multiple times which would cause multiple i/o reads\n const enqueuedReadSourceFileTasks = {};\n const readSourceFileTasks = [];\n\n if (contextLines > 0 && _optionalChain([event, 'access', _2 => _2.exception, 'optionalAccess', _3 => _3.values])) {\n for (const exception of event.exception.values) {\n if (!_optionalChain([exception, 'access', _4 => _4.stacktrace, 'optionalAccess', _5 => _5.frames])) {\n continue;\n }\n\n // We want to iterate in reverse order as calling cache.get will bump the file in our LRU cache.\n // This ends up prioritizes source context for frames at the top of the stack instead of the bottom.\n for (let i = exception.stacktrace.frames.length - 1; i >= 0; i--) {\n const frame = exception.stacktrace.frames[i];\n // Call cache.get to bump the file to the top of the cache and ensure we have not already\n // enqueued a read operation for this filename\n if (frame.filename && !enqueuedReadSourceFileTasks[frame.filename] && !FILE_CONTENT_CACHE.get(frame.filename)) {\n readSourceFileTasks.push(_readSourceFile(frame.filename));\n enqueuedReadSourceFileTasks[frame.filename] = 1;\n }\n }\n }\n }\n\n // check if files to read > 0, if so, await all of them to be read before adding source contexts.\n // Normally, Promise.all here could be short circuited if one of the promises rejects, but we\n // are guarding from that by wrapping the i/o read operation in a try/catch.\n if (readSourceFileTasks.length > 0) {\n await Promise.all(readSourceFileTasks);\n }\n\n // Perform the same loop as above, but this time we can assume all files are in the cache\n // and attempt to add source context to frames.\n if (contextLines > 0 && _optionalChain([event, 'access', _6 => _6.exception, 'optionalAccess', _7 => _7.values])) {\n for (const exception of event.exception.values) {\n if (exception.stacktrace && exception.stacktrace.frames) {\n await addSourceContextToFrames(exception.stacktrace.frames, contextLines);\n }\n }\n }\n\n return event;\n}\n\n/** Adds context lines to frames */\nfunction addSourceContextToFrames(frames, contextLines) {\n for (const frame of frames) {\n // Only add context if we have a filename and it hasn't already been added\n if (frame.filename && frame.context_line === undefined) {\n const sourceFileLines = FILE_CONTENT_CACHE.get(frame.filename);\n\n if (sourceFileLines) {\n try {\n addContextToFrame(sourceFileLines, frame, contextLines);\n } catch (e) {\n // anomaly, being defensive in case\n // unlikely to ever happen in practice but can definitely happen in theory\n }\n }\n }\n }\n}\n\n// eslint-disable-next-line deprecation/deprecation\n\n/**\n * Reads file contents and caches them in a global LRU cache.\n * If reading fails, mark the file as null in the cache so we don't try again.\n *\n * @param filename filepath to read content from.\n */\nasync function _readSourceFile(filename) {\n const cachedFile = FILE_CONTENT_CACHE.get(filename);\n\n // We have already attempted to read this file and failed, do not try again\n if (cachedFile === null) {\n return null;\n }\n\n // We have a cache hit, return it\n if (cachedFile !== undefined) {\n return cachedFile;\n }\n\n // Guard from throwing if readFile fails, this enables us to use Promise.all and\n // not have it short circuiting if one of the promises rejects + since context lines are added\n // on a best effort basis, we want to throw here anyways.\n\n // If we made it to here, it means that our file is not cache nor marked as failed, so attempt to read it\n let content = null;\n try {\n const rawFileContents = await readTextFileAsync(filename);\n content = rawFileContents.split('\\n');\n } catch (_) {\n // if we fail, we will mark the file as null in the cache and short circuit next time we try to read it\n }\n\n FILE_CONTENT_CACHE.set(filename, content);\n return content;\n}\n\nexport { ContextLines, contextLinesIntegration };\n//# sourceMappingURL=contextlines.js.map\n"],"names":["LRUMap","readFile","defineIntegration","convertIntegrationFnToClass","_optionalChain","addContextToFrame"],"mappings":";;;;;;;AAKA,MAAM,qBAAqB,IAAIA,IAAAA,OAAO,GAAG;AACzC,MAAM,2BAA2B;AACjC,MAAM,mBAAmB;AAGzB,SAAS,kBAAkB,MAAM;AAC/B,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtCC,OAAAA,SAAS,MAAM,QAAQ,CAAC,KAAK,SAAS;AACpC,UAAI,IAAK,QAAO,GAAG;AAAA,UACd,SAAQ,IAAI;AAAA,IACnB,CAAC;AAAA,EACH,CAAC;AACH;AAEA,MAAM,2BAA4B,CAAC,UAAU,OAAO;AAClD,QAAM,eAAe,QAAQ,sBAAsB,SAAY,QAAQ,oBAAoB;AAE3F,SAAO;AAAA,IACL,MAAM;AAAA;AAAA,IAEN,YAAY;AAAA,IAAC;AAAA;AAAA,IACb,aAAa,OAAO;AAClB,aAAO,iBAAiB,OAAO,YAAY;AAAA,IAC7C;AAAA,EACJ;AACA;AAEK,MAAC,0BAA0BC,YAAAA,kBAAkB,wBAAwB;AAOrDC,YAAAA,4BAA4B,kBAAkB,uBAAuB;AAI1F,eAAe,iBAAiB,OAAO,cAAc;AAGnD,QAAM,8BAA8B,CAAA;AACpC,QAAM,sBAAsB,CAAA;AAE5B,MAAI,eAAe,KAAKC,eAAAA,eAAe,CAAC,OAAO,UAAU,QAAM,GAAG,WAAW,kBAAkB,QAAM,GAAG,MAAM,CAAC,GAAG;AAChH,eAAW,aAAa,MAAM,UAAU,QAAQ;AAC9C,UAAI,CAACA,eAAAA,eAAe,CAAC,WAAW,UAAU,QAAM,GAAG,YAAY,kBAAkB,QAAM,GAAG,MAAM,CAAC,GAAG;AAClG;AAAA,MACF;AAIA,e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,cAAU,gBAAgB,MAAM,IAAI;AAAA,EACtC,SAAS,GAAG;AAAA,EAEZ;AAEA,qBAAmB,IAAI,UAAU,OAAO;AACxC,SAAO;AACT;;","x_google_ignoreList":[0]}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import { readFile } from "fs";
|
|
2
2
|
import { defineIntegration, convertIntegrationFnToClass } from './../../_node_modules/@sentry/core/esm/integration.js';
|
|
3
3
|
import { _optionalChain } from './../../_node_modules/@sentry/utils/esm/buildPolyfills/_optionalChain.js';
|
|
4
|
-
import { addContextToFrame } from './../../_node_modules/@sentry/utils/esm/misc.js';
|
|
5
4
|
import { LRUMap } from './../../_node_modules/@sentry/utils/esm/lru.js';
|
|
5
|
+
import { addContextToFrame } from './../../_node_modules/@sentry/utils/esm/misc.js';
|
|
6
6
|
const FILE_CONTENT_CACHE = new LRUMap(100);
|
|
7
7
|
const DEFAULT_LINES_OF_CONTEXT = 7;
|
|
8
8
|
const INTEGRATION_NAME = "ContextLines";
|
|
9
9
|
function readTextFileAsync(path) {
|
|
10
10
|
return new Promise((resolve, reject) => {
|
|
11
11
|
readFile(path, "utf8", (err, data) => {
|
|
12
|
-
if (err)
|
|
13
|
-
|
|
14
|
-
else
|
|
15
|
-
resolve(data);
|
|
12
|
+
if (err) reject(err);
|
|
13
|
+
else resolve(data);
|
|
16
14
|
});
|
|
17
15
|
});
|
|
18
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextlines.js","sources":["../../../../../../../../node_modules/@sentry/node/esm/integrations/contextlines.js"],"sourcesContent":["import { _optionalChain } from '@sentry/utils';\nimport { readFile } from 'fs';\nimport { defineIntegration, convertIntegrationFnToClass } from '@sentry/core';\nimport { LRUMap, addContextToFrame } from '@sentry/utils';\n\nconst FILE_CONTENT_CACHE = new LRUMap(100);\nconst DEFAULT_LINES_OF_CONTEXT = 7;\nconst INTEGRATION_NAME = 'ContextLines';\n\n// TODO: Replace with promisify when minimum supported node >= v8\nfunction readTextFileAsync(path) {\n return new Promise((resolve, reject) => {\n readFile(path, 'utf8', (err, data) => {\n if (err) reject(err);\n else resolve(data);\n });\n });\n}\n\nconst _contextLinesIntegration = ((options = {}) => {\n const contextLines = options.frameContextLines !== undefined ? options.frameContextLines : DEFAULT_LINES_OF_CONTEXT;\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n processEvent(event) {\n return addSourceContext(event, contextLines);\n },\n };\n}) ;\n\nconst contextLinesIntegration = defineIntegration(_contextLinesIntegration);\n\n/**\n * Add node modules / packages to the event.\n * @deprecated Use `contextLinesIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst ContextLines = convertIntegrationFnToClass(INTEGRATION_NAME, contextLinesIntegration)\n\n;\n\nasync function addSourceContext(event, contextLines) {\n // keep a lookup map of which files we've already enqueued to read,\n // so we don't enqueue the same file multiple times which would cause multiple i/o reads\n const enqueuedReadSourceFileTasks = {};\n const readSourceFileTasks = [];\n\n if (contextLines > 0 && _optionalChain([event, 'access', _2 => _2.exception, 'optionalAccess', _3 => _3.values])) {\n for (const exception of event.exception.values) {\n if (!_optionalChain([exception, 'access', _4 => _4.stacktrace, 'optionalAccess', _5 => _5.frames])) {\n continue;\n }\n\n // We want to iterate in reverse order as calling cache.get will bump the file in our LRU cache.\n // This ends up prioritizes source context for frames at the top of the stack instead of the bottom.\n for (let i = exception.stacktrace.frames.length - 1; i >= 0; i--) {\n const frame = exception.stacktrace.frames[i];\n // Call cache.get to bump the file to the top of the cache and ensure we have not already\n // enqueued a read operation for this filename\n if (frame.filename && !enqueuedReadSourceFileTasks[frame.filename] && !FILE_CONTENT_CACHE.get(frame.filename)) {\n readSourceFileTasks.push(_readSourceFile(frame.filename));\n enqueuedReadSourceFileTasks[frame.filename] = 1;\n }\n }\n }\n }\n\n // check if files to read > 0, if so, await all of them to be read before adding source contexts.\n // Normally, Promise.all here could be short circuited if one of the promises rejects, but we\n // are guarding from that by wrapping the i/o read operation in a try/catch.\n if (readSourceFileTasks.length > 0) {\n await Promise.all(readSourceFileTasks);\n }\n\n // Perform the same loop as above, but this time we can assume all files are in the cache\n // and attempt to add source context to frames.\n if (contextLines > 0 && _optionalChain([event, 'access', _6 => _6.exception, 'optionalAccess', _7 => _7.values])) {\n for (const exception of event.exception.values) {\n if (exception.stacktrace && exception.stacktrace.frames) {\n await addSourceContextToFrames(exception.stacktrace.frames, contextLines);\n }\n }\n }\n\n return event;\n}\n\n/** Adds context lines to frames */\nfunction addSourceContextToFrames(frames, contextLines) {\n for (const frame of frames) {\n // Only add context if we have a filename and it hasn't already been added\n if (frame.filename && frame.context_line === undefined) {\n const sourceFileLines = FILE_CONTENT_CACHE.get(frame.filename);\n\n if (sourceFileLines) {\n try {\n addContextToFrame(sourceFileLines, frame, contextLines);\n } catch (e) {\n // anomaly, being defensive in case\n // unlikely to ever happen in practice but can definitely happen in theory\n }\n }\n }\n }\n}\n\n// eslint-disable-next-line deprecation/deprecation\n\n/**\n * Reads file contents and caches them in a global LRU cache.\n * If reading fails, mark the file as null in the cache so we don't try again.\n *\n * @param filename filepath to read content from.\n */\nasync function _readSourceFile(filename) {\n const cachedFile = FILE_CONTENT_CACHE.get(filename);\n\n // We have already attempted to read this file and failed, do not try again\n if (cachedFile === null) {\n return null;\n }\n\n // We have a cache hit, return it\n if (cachedFile !== undefined) {\n return cachedFile;\n }\n\n // Guard from throwing if readFile fails, this enables us to use Promise.all and\n // not have it short circuiting if one of the promises rejects + since context lines are added\n // on a best effort basis, we want to throw here anyways.\n\n // If we made it to here, it means that our file is not cache nor marked as failed, so attempt to read it\n let content = null;\n try {\n const rawFileContents = await readTextFileAsync(filename);\n content = rawFileContents.split('\\n');\n } catch (_) {\n // if we fail, we will mark the file as null in the cache and short circuit next time we try to read it\n }\n\n FILE_CONTENT_CACHE.set(filename, content);\n return content;\n}\n\nexport { ContextLines, contextLinesIntegration };\n//# sourceMappingURL=contextlines.js.map\n"],"names":[],"mappings":";;;;;AAKA,MAAM,qBAAqB,IAAI,OAAO,GAAG;AACzC,MAAM,2BAA2B;AACjC,MAAM,mBAAmB;AAGzB,SAAS,kBAAkB,MAAM;AAC/B,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,aAAS,MAAM,QAAQ,CAAC,KAAK,SAAS;AACpC,UAAI
|
|
1
|
+
{"version":3,"file":"contextlines.js","sources":["../../../../../../../../node_modules/@sentry/node/esm/integrations/contextlines.js"],"sourcesContent":["import { _optionalChain } from '@sentry/utils';\nimport { readFile } from 'fs';\nimport { defineIntegration, convertIntegrationFnToClass } from '@sentry/core';\nimport { LRUMap, addContextToFrame } from '@sentry/utils';\n\nconst FILE_CONTENT_CACHE = new LRUMap(100);\nconst DEFAULT_LINES_OF_CONTEXT = 7;\nconst INTEGRATION_NAME = 'ContextLines';\n\n// TODO: Replace with promisify when minimum supported node >= v8\nfunction readTextFileAsync(path) {\n return new Promise((resolve, reject) => {\n readFile(path, 'utf8', (err, data) => {\n if (err) reject(err);\n else resolve(data);\n });\n });\n}\n\nconst _contextLinesIntegration = ((options = {}) => {\n const contextLines = options.frameContextLines !== undefined ? options.frameContextLines : DEFAULT_LINES_OF_CONTEXT;\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n processEvent(event) {\n return addSourceContext(event, contextLines);\n },\n };\n}) ;\n\nconst contextLinesIntegration = defineIntegration(_contextLinesIntegration);\n\n/**\n * Add node modules / packages to the event.\n * @deprecated Use `contextLinesIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst ContextLines = convertIntegrationFnToClass(INTEGRATION_NAME, contextLinesIntegration)\n\n;\n\nasync function addSourceContext(event, contextLines) {\n // keep a lookup map of which files we've already enqueued to read,\n // so we don't enqueue the same file multiple times which would cause multiple i/o reads\n const enqueuedReadSourceFileTasks = {};\n const readSourceFileTasks = [];\n\n if (contextLines > 0 && _optionalChain([event, 'access', _2 => _2.exception, 'optionalAccess', _3 => _3.values])) {\n for (const exception of event.exception.values) {\n if (!_optionalChain([exception, 'access', _4 => _4.stacktrace, 'optionalAccess', _5 => _5.frames])) {\n continue;\n }\n\n // We want to iterate in reverse order as calling cache.get will bump the file in our LRU cache.\n // This ends up prioritizes source context for frames at the top of the stack instead of the bottom.\n for (let i = exception.stacktrace.frames.length - 1; i >= 0; i--) {\n const frame = exception.stacktrace.frames[i];\n // Call cache.get to bump the file to the top of the cache and ensure we have not already\n // enqueued a read operation for this filename\n if (frame.filename && !enqueuedReadSourceFileTasks[frame.filename] && !FILE_CONTENT_CACHE.get(frame.filename)) {\n readSourceFileTasks.push(_readSourceFile(frame.filename));\n enqueuedReadSourceFileTasks[frame.filename] = 1;\n }\n }\n }\n }\n\n // check if files to read > 0, if so, await all of them to be read before adding source contexts.\n // Normally, Promise.all here could be short circuited if one of the promises rejects, but we\n // are guarding from that by wrapping the i/o read operation in a try/catch.\n if (readSourceFileTasks.length > 0) {\n await Promise.all(readSourceFileTasks);\n }\n\n // Perform the same loop as above, but this time we can assume all files are in the cache\n // and attempt to add source context to frames.\n if (contextLines > 0 && _optionalChain([event, 'access', _6 => _6.exception, 'optionalAccess', _7 => _7.values])) {\n for (const exception of event.exception.values) {\n if (exception.stacktrace && exception.stacktrace.frames) {\n await addSourceContextToFrames(exception.stacktrace.frames, contextLines);\n }\n }\n }\n\n return event;\n}\n\n/** Adds context lines to frames */\nfunction addSourceContextToFrames(frames, contextLines) {\n for (const frame of frames) {\n // Only add context if we have a filename and it hasn't already been added\n if (frame.filename && frame.context_line === undefined) {\n const sourceFileLines = FILE_CONTENT_CACHE.get(frame.filename);\n\n if (sourceFileLines) {\n try {\n addContextToFrame(sourceFileLines, frame, contextLines);\n } catch (e) {\n // anomaly, being defensive in case\n // unlikely to ever happen in practice but can definitely happen in theory\n }\n }\n }\n }\n}\n\n// eslint-disable-next-line deprecation/deprecation\n\n/**\n * Reads file contents and caches them in a global LRU cache.\n * If reading fails, mark the file as null in the cache so we don't try again.\n *\n * @param filename filepath to read content from.\n */\nasync function _readSourceFile(filename) {\n const cachedFile = FILE_CONTENT_CACHE.get(filename);\n\n // We have already attempted to read this file and failed, do not try again\n if (cachedFile === null) {\n return null;\n }\n\n // We have a cache hit, return it\n if (cachedFile !== undefined) {\n return cachedFile;\n }\n\n // Guard from throwing if readFile fails, this enables us to use Promise.all and\n // not have it short circuiting if one of the promises rejects + since context lines are added\n // on a best effort basis, we want to throw here anyways.\n\n // If we made it to here, it means that our file is not cache nor marked as failed, so attempt to read it\n let content = null;\n try {\n const rawFileContents = await readTextFileAsync(filename);\n content = rawFileContents.split('\\n');\n } catch (_) {\n // if we fail, we will mark the file as null in the cache and short circuit next time we try to read it\n }\n\n FILE_CONTENT_CACHE.set(filename, content);\n return content;\n}\n\nexport { ContextLines, contextLinesIntegration };\n//# sourceMappingURL=contextlines.js.map\n"],"names":[],"mappings":";;;;;AAKA,MAAM,qBAAqB,IAAI,OAAO,GAAG;AACzC,MAAM,2BAA2B;AACjC,MAAM,mBAAmB;AAGzB,SAAS,kBAAkB,MAAM;AAC/B,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,aAAS,MAAM,QAAQ,CAAC,KAAK,SAAS;AACpC,UAAI,IAAK,QAAO,GAAG;AAAA,UACd,SAAQ,IAAI;AAAA,IACnB,CAAC;AAAA,EACH,CAAC;AACH;AAEA,MAAM,2BAA4B,CAAC,UAAU,OAAO;AAClD,QAAM,eAAe,QAAQ,sBAAsB,SAAY,QAAQ,oBAAoB;AAE3F,SAAO;AAAA,IACL,MAAM;AAAA;AAAA,IAEN,YAAY;AAAA,IAAC;AAAA;AAAA,IACb,aAAa,OAAO;AAClB,aAAO,iBAAiB,OAAO,YAAY;AAAA,IAC7C;AAAA,EACJ;AACA;AAEK,MAAC,0BAA0B,kBAAkB,wBAAwB;AAOrD,4BAA4B,kBAAkB,uBAAuB;AAI1F,eAAe,iBAAiB,OAAO,c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AAY;AAAA,QACxD,SAAS,GAAG;AAAA,QAGZ;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAUA,eAAe,gBAAgB,UAAU;AACvC,QAAM,aAAa,mBAAmB,IAAI,QAAQ;AAGlD,MAAI,eAAe,MAAM;AACvB,WAAO;AAAA,EACT;AAGA,MAAI,eAAe,QAAW;AAC5B,WAAO;AAAA,EACT;AAOA,MAAI,UAAU;AACd,MAAI;AACF,UAAM,kBAAkB,MAAM,kBAAkB,QAAQ;AACxD,cAAU,gBAAgB,MAAM,IAAI;AAAA,EACtC,SAAS,GAAG;AAAA,EAEZ;AAEA,qBAAmB,IAAI,UAAU,OAAO;AACxC,SAAO;AACT;","x_google_ignoreList":[0]}
|
|
@@ -4,9 +4,10 @@ const debugBuild = require("../debug-build.cjs");
|
|
|
4
4
|
const nodeVersion = require("../nodeVersion.cjs");
|
|
5
5
|
const http = require("./utils/http.cjs");
|
|
6
6
|
const integration = require('./../../_node_modules/@sentry/core/esm/integration.cjs');
|
|
7
|
+
const object = require('./../../_node_modules/@sentry/utils/esm/object.cjs');
|
|
7
8
|
const _optionalChain = require('./../../_node_modules/@sentry/utils/esm/buildPolyfills/_optionalChain.cjs');
|
|
8
9
|
const logger = require('./../../_node_modules/@sentry/utils/esm/logger.cjs');
|
|
9
|
-
const
|
|
10
|
+
const hasTracingEnabled = require('./../../_node_modules/@sentry/core/esm/utils/hasTracingEnabled.cjs');
|
|
10
11
|
const exports$1 = require('./../../_node_modules/@sentry/core/esm/exports.cjs');
|
|
11
12
|
const isSentryRequestUrl = require('./../../_node_modules/@sentry/core/esm/utils/isSentryRequestUrl.cjs');
|
|
12
13
|
const hub = require('./../../_node_modules/@sentry/core/esm/hub.cjs');
|
|
@@ -16,9 +17,8 @@ const tracing = require('./../../_node_modules/@sentry/utils/esm/tracing.cjs');
|
|
|
16
17
|
const baggage = require('./../../_node_modules/@sentry/utils/esm/baggage.cjs');
|
|
17
18
|
const dynamicSamplingContext = require('./../../_node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.cjs');
|
|
18
19
|
const spanstatus = require('./../../_node_modules/@sentry/core/esm/tracing/spanstatus.cjs');
|
|
19
|
-
const hasTracingEnabled = require('./../../_node_modules/@sentry/core/esm/utils/hasTracingEnabled.cjs');
|
|
20
|
-
const string = require('./../../_node_modules/@sentry/utils/esm/string.cjs');
|
|
21
20
|
const lru = require('./../../_node_modules/@sentry/utils/esm/lru.cjs');
|
|
21
|
+
const string = require('./../../_node_modules/@sentry/utils/esm/string.cjs');
|
|
22
22
|
const _httpIntegration = (options = {}) => {
|
|
23
23
|
const { breadcrumbs, tracing: tracing2, shouldCreateSpanForRequest } = options;
|
|
24
24
|
const convertedOptions = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.cjs","sources":["../../../../../../../../node_modules/@sentry/node/esm/integrations/http.js"],"sourcesContent":["import { _optionalChain } from '@sentry/utils';\nimport { defineIntegration, getClient, isSentryRequestUrl, getCurrentScope, getIsolationScope, getActiveSpan, spanToTraceHeader, getDynamicSamplingContextFromSpan, getDynamicSamplingContextFromClient, setHttpStatus, spanToJSON, hasTracingEnabled, getCurrentHub, addBreadcrumb } from '@sentry/core';\nimport { dropUndefinedKeys, logger, fill, LRUMap, generateSentryTraceHeader, dynamicSamplingContextToSentryBaggageHeader, stringMatchesSomePattern } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { NODE_VERSION } from '../nodeVersion.js';\nimport { normalizeRequestArgs, extractRawUrl, extractUrl, cleanSpanDescription } from './utils/http.js';\n\nconst _httpIntegration = ((options = {}) => {\n const { breadcrumbs, tracing, shouldCreateSpanForRequest } = options;\n\n const convertedOptions = {\n breadcrumbs,\n tracing:\n tracing === false\n ? false\n : dropUndefinedKeys({\n // If tracing is forced to `true`, we don't want to set `enableIfHasTracingEnabled`\n enableIfHasTracingEnabled: tracing === true ? undefined : true,\n shouldCreateSpanForRequest,\n }),\n };\n\n // eslint-disable-next-line deprecation/deprecation\n return new Http(convertedOptions) ;\n}) ;\n\n/**\n * The http module integration instruments Node's internal http module. It creates breadcrumbs, spans for outgoing\n * http requests, and attaches trace data when tracing is enabled via its `tracing` option.\n *\n * By default, this will always create breadcrumbs, and will create spans if tracing is enabled.\n */\nconst httpIntegration = defineIntegration(_httpIntegration);\n\n/**\n * The http module integration instruments Node's internal http module. It creates breadcrumbs, transactions for outgoing\n * http requests and attaches trace data when tracing is enabled via its `tracing` option.\n *\n * @deprecated Use `httpIntegration()` instead.\n */\nclass Http {\n /**\n * @inheritDoc\n */\n static __initStatic() {this.id = 'Http';}\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line deprecation/deprecation\n __init() {this.name = Http.id;}\n\n /**\n * @inheritDoc\n */\n constructor(options = {}) {Http.prototype.__init.call(this);\n this._breadcrumbs = typeof options.breadcrumbs === 'undefined' ? true : options.breadcrumbs;\n this._tracing = !options.tracing ? undefined : options.tracing === true ? {} : options.tracing;\n }\n\n /**\n * @inheritDoc\n */\n setupOnce(\n _addGlobalEventProcessor,\n // eslint-disable-next-line deprecation/deprecation\n setupOnceGetCurrentHub,\n ) {\n // eslint-disable-next-line deprecation/deprecation\n const clientOptions = _optionalChain([setupOnceGetCurrentHub, 'call', _ => _(), 'access', _2 => _2.getClient, 'call', _3 => _3(), 'optionalAccess', _4 => _4.getOptions, 'call', _5 => _5()]);\n\n // If `tracing` is not explicitly set, we default this based on whether or not tracing is enabled.\n // But for compatibility, we only do that if `enableIfHasTracingEnabled` is set.\n const shouldCreateSpans = _shouldCreateSpans(this._tracing, clientOptions);\n\n // No need to instrument if we don't want to track anything\n if (!this._breadcrumbs && !shouldCreateSpans) {\n return;\n }\n\n // Do not auto-instrument for other instrumenter\n if (clientOptions && clientOptions.instrumenter !== 'sentry') {\n DEBUG_BUILD && logger.log('HTTP Integration is skipped because of instrumenter configuration.');\n return;\n }\n\n const shouldCreateSpanForRequest = _getShouldCreateSpanForRequest(shouldCreateSpans, this._tracing, clientOptions);\n\n // eslint-disable-next-line deprecation/deprecation\n const tracePropagationTargets = _optionalChain([clientOptions, 'optionalAccess', _6 => _6.tracePropagationTargets]) || _optionalChain([this, 'access', _7 => _7._tracing, 'optionalAccess', _8 => _8.tracePropagationTargets]);\n\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const httpModule = require('http');\n const wrappedHttpHandlerMaker = _createWrappedRequestMethodFactory(\n httpModule,\n this._breadcrumbs,\n shouldCreateSpanForRequest,\n tracePropagationTargets,\n );\n fill(httpModule, 'get', wrappedHttpHandlerMaker);\n fill(httpModule, 'request', wrappedHttpHandlerMaker);\n\n // NOTE: Prior to Node 9, `https` used internals of `http` module, thus we don't patch it.\n // If we do, we'd get double breadcrumbs and double spans for `https` calls.\n // It has been changed in Node 9, so for all versions equal and above, we patch `https` separately.\n if (NODE_VERSION.major > 8) {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const httpsModule = require('https');\n const wrappedHttpsHandlerMaker = _createWrappedRequestMethodFactory(\n httpsModule,\n this._breadcrumbs,\n shouldCreateSpanForRequest,\n tracePropagationTargets,\n );\n fill(httpsModule, 'get', wrappedHttpsHandlerMaker);\n fill(httpsModule, 'request', wrappedHttpsHandlerMaker);\n }\n }\n}Http.__initStatic();\n\n// for ease of reading below\n\n/**\n * Function which creates a function which creates wrapped versions of internal `request` and `get` calls within `http`\n * and `https` modules. (NB: Not a typo - this is a creator^2!)\n *\n * @param breadcrumbsEnabled Whether or not to record outgoing requests as breadcrumbs\n * @param tracingEnabled Whether or not to record outgoing requests as tracing spans\n *\n * @returns A function which accepts the exiting handler and returns a wrapped handler\n */\nfunction _createWrappedRequestMethodFactory(\n httpModule,\n breadcrumbsEnabled,\n shouldCreateSpanForRequest,\n tracePropagationTargets,\n) {\n // We're caching results so we don't have to recompute regexp every time we create a request.\n const createSpanUrlMap = new LRUMap(100);\n const headersUrlMap = new LRUMap(100);\n\n const shouldCreateSpan = (url) => {\n if (shouldCreateSpanForRequest === undefined) {\n return true;\n }\n\n const cachedDecision = createSpanUrlMap.get(url);\n if (cachedDecision !== undefined) {\n return cachedDecision;\n }\n\n const decision = shouldCreateSpanForRequest(url);\n createSpanUrlMap.set(url, decision);\n return decision;\n };\n\n const shouldAttachTraceData = (url) => {\n if (tracePropagationTargets === undefined) {\n return true;\n }\n\n const cachedDecision = headersUrlMap.get(url);\n if (cachedDecision !== undefined) {\n return cachedDecision;\n }\n\n const decision = stringMatchesSomePattern(url, tracePropagationTargets);\n headersUrlMap.set(url, decision);\n return decision;\n };\n\n /**\n * Captures Breadcrumb based on provided request/response pair\n */\n function addRequestBreadcrumb(\n event,\n requestSpanData,\n req,\n res,\n ) {\n // eslint-disable-next-line deprecation/deprecation\n if (!getCurrentHub().getIntegration(Http)) {\n return;\n }\n\n addBreadcrumb(\n {\n category: 'http',\n data: {\n status_code: res && res.statusCode,\n ...requestSpanData,\n },\n type: 'http',\n },\n {\n event,\n request: req,\n response: res,\n },\n );\n }\n\n return function wrappedRequestMethodFactory(originalRequestMethod) {\n return function wrappedMethod( ...args) {\n const requestArgs = normalizeRequestArgs(httpModule, args);\n const requestOptions = requestArgs[0];\n // eslint-disable-next-line deprecation/deprecation\n const rawRequestUrl = extractRawUrl(requestOptions);\n const requestUrl = extractUrl(requestOptions);\n const client = getClient();\n\n // we don't want to record requests to Sentry as either breadcrumbs or spans, so just use the original method\n if (isSentryRequestUrl(requestUrl, client)) {\n return originalRequestMethod.apply(httpModule, requestArgs);\n }\n\n const scope = getCurrentScope();\n const isolationScope = getIsolationScope();\n const parentSpan = getActiveSpan();\n\n const data = getRequestSpanData(requestUrl, requestOptions);\n\n const requestSpan = shouldCreateSpan(rawRequestUrl)\n ? // eslint-disable-next-line deprecation/deprecation\n _optionalChain([parentSpan, 'optionalAccess', _9 => _9.startChild, 'call', _10 => _10({\n op: 'http.client',\n origin: 'auto.http.node.http',\n description: `${data['http.method']} ${data.url}`,\n data,\n })])\n : undefined;\n\n if (client && shouldAttachTraceData(rawRequestUrl)) {\n const { traceId, spanId, sampled, dsc } = {\n ...isolationScope.getPropagationContext(),\n ...scope.getPropagationContext(),\n };\n\n const sentryTraceHeader = requestSpan\n ? spanToTraceHeader(requestSpan)\n : generateSentryTraceHeader(traceId, spanId, sampled);\n\n const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(\n dsc ||\n (requestSpan\n ? getDynamicSamplingContextFromSpan(requestSpan)\n : getDynamicSamplingContextFromClient(traceId, client, scope)),\n );\n\n addHeadersToRequestOptions(requestOptions, requestUrl, sentryTraceHeader, sentryBaggageHeader);\n } else {\n DEBUG_BUILD &&\n logger.log(\n `[Tracing] Not adding sentry-trace header to outgoing request (${requestUrl}) due to mismatching tracePropagationTargets option.`,\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return originalRequestMethod\n .apply(httpModule, requestArgs)\n .once('response', function ( res) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const req = this;\n if (breadcrumbsEnabled) {\n addRequestBreadcrumb('response', data, req, res);\n }\n if (requestSpan) {\n if (res.statusCode) {\n setHttpStatus(requestSpan, res.statusCode);\n }\n requestSpan.updateName(\n cleanSpanDescription(spanToJSON(requestSpan).description || '', requestOptions, req) || '',\n );\n requestSpan.end();\n }\n })\n .once('error', function () {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const req = this;\n\n if (breadcrumbsEnabled) {\n addRequestBreadcrumb('error', data, req);\n }\n if (requestSpan) {\n setHttpStatus(requestSpan, 500);\n requestSpan.updateName(\n cleanSpanDescription(spanToJSON(requestSpan).description || '', requestOptions, req) || '',\n );\n requestSpan.end();\n }\n });\n };\n };\n}\n\nfunction addHeadersToRequestOptions(\n requestOptions,\n requestUrl,\n sentryTraceHeader,\n sentryBaggageHeader,\n) {\n // Don't overwrite sentry-trace and baggage header if it's already set.\n const headers = requestOptions.headers || {};\n if (headers['sentry-trace']) {\n return;\n }\n\n DEBUG_BUILD &&\n logger.log(`[Tracing] Adding sentry-trace header ${sentryTraceHeader} to outgoing request to \"${requestUrl}\": `);\n\n requestOptions.headers = {\n ...requestOptions.headers,\n 'sentry-trace': sentryTraceHeader,\n // Setting a header to `undefined` will crash in node so we only set the baggage header when it's defined\n ...(sentryBaggageHeader &&\n sentryBaggageHeader.length > 0 && { baggage: normalizeBaggageHeader(requestOptions, sentryBaggageHeader) }),\n };\n}\n\nfunction getRequestSpanData(requestUrl, requestOptions) {\n const method = requestOptions.method || 'GET';\n const data = {\n url: requestUrl,\n 'http.method': method,\n };\n if (requestOptions.hash) {\n // strip leading \"#\"\n data['http.fragment'] = requestOptions.hash.substring(1);\n }\n if (requestOptions.search) {\n // strip leading \"?\"\n data['http.query'] = requestOptions.search.substring(1);\n }\n return data;\n}\n\nfunction normalizeBaggageHeader(\n requestOptions,\n sentryBaggageHeader,\n) {\n if (!requestOptions.headers || !requestOptions.headers.baggage) {\n return sentryBaggageHeader;\n } else if (!sentryBaggageHeader) {\n return requestOptions.headers.baggage ;\n } else if (Array.isArray(requestOptions.headers.baggage)) {\n return [...requestOptions.headers.baggage, sentryBaggageHeader];\n }\n // Type-cast explanation:\n // Technically this the following could be of type `(number | string)[]` but for the sake of simplicity\n // we say this is undefined behaviour, since it would not be baggage spec conform if the user did this.\n return [requestOptions.headers.baggage, sentryBaggageHeader] ;\n}\n\n/** Exported for tests only. */\nfunction _shouldCreateSpans(\n tracingOptions,\n clientOptions,\n) {\n return tracingOptions === undefined\n ? false\n : tracingOptions.enableIfHasTracingEnabled\n ? hasTracingEnabled(clientOptions)\n : true;\n}\n\n/** Exported for tests only. */\nfunction _getShouldCreateSpanForRequest(\n shouldCreateSpans,\n tracingOptions,\n clientOptions,\n) {\n const handler = shouldCreateSpans\n ? // eslint-disable-next-line deprecation/deprecation\n _optionalChain([tracingOptions, 'optionalAccess', _11 => _11.shouldCreateSpanForRequest]) || _optionalChain([clientOptions, 'optionalAccess', _12 => _12.shouldCreateSpanForRequest])\n : () => false;\n\n return handler;\n}\n\nexport { Http, _getShouldCreateSpanForRequest, _shouldCreateSpans, httpIntegration };\n//# sourceMappingURL=http.js.map\n"],"names":["tracing","dropUndefinedKeys","defineIntegration","_optionalChain","DEBUG_BUILD","logger","fill","NODE_VERSION","LRUMap","stringMatchesSomePattern","getCurrentHub","addBreadcrumb","normalizeRequestArgs","extractRawUrl","extractUrl","getClient","isSentryRequestUrl","getCurrentScope","getIsolationScope","getActiveSpan","spanToTraceHeader","generateSentryTraceHeader","dynamicSamplingContextToSentryBaggageHeader","getDynamicSamplingContextFromSpan","getDynamicSamplingContextFromClient","setHttpStatus","cleanSpanDescription","spanToJSON","hasTracingEnabled"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOA,MAAM,mBAAoB,CAAC,UAAU,OAAO;AAC1C,QAAM,EAAE,aAAa,SAAAA,UAAS,2BAA0B,IAAK;AAE7D,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA,SACEA,aAAY,QACR,QACAC,yBAAkB;AAAA;AAAA,MAEhB,2BAA2BD,aAAY,OAAO,SAAY;AAAA,MAC1D;AAAA,IACZ,CAAW;AAAA,EACX;AAGE,SAAO,IAAI,KAAK,gBAAgB;AAClC;AAQK,MAAC,kBAAkBE,YAAiB,kBAAC,gBAAgB;AAQ1D,MAAM,KAAM;AAAA;AAAA;AAAA;AAAA,EAIT,OAAO,eAAe;AAAC,SAAK,KAAK;AAAA,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAMxC,SAAS;AAAC,SAAK,OAAO,KAAK;AAAA,EAAG;AAAA;AAAA;AAAA;AAAA,EAK9B,YAAY,UAAU,CAAA,GAAI;AAAC,SAAK,UAAU,OAAO,KAAK,IAAI;AACzD,SAAK,eAAe,OAAO,QAAQ,gBAAgB,cAAc,OAAO,QAAQ;AAChF,SAAK,WAAW,CAAC,QAAQ,UAAU,SAAY,QAAQ,YAAY,OAAO,KAAK,QAAQ;AAAA,EACxF;AAAA;AAAA;AAAA;AAAA,EAKA,UACC,0BAEA,wBACA;AAEA,UAAM,gBAAgBC,eAAAA,eAA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AQ,eAAe,QAAQ,OAAO,GAAG;AACxD,WAAO,CAAC,GAAG,eAAe,QAAQ,SAAS,mBAAmB;AAAA,EAC/D;AAID,SAAO,CAAC,eAAe,QAAQ,SAAS,mBAAmB;AAC7D;AAGA,SAAS,mBACP,gBACA,eACA;AACA,SAAO,mBAAmB,SACtB,QACA,eAAe,4BACbuB,kBAAAA,kBAAkB,aAAa,IAC/B;AACR;AAGA,SAAS,+BACP,mBACA,gBACA,eACA;AACA,QAAM,UAAU;AAAA;AAAA,IAEZzB,eAAc,eAAC,CAAC,gBAAgB,kBAAkB,SAAO,IAAI,0BAA0B,CAAC,KAAKA,eAAAA,eAAe,CAAC,eAAe,kBAAkB,SAAO,IAAI,0BAA0B,CAAC;AAAA,MACpL,MAAM;AAEV,SAAO;AACT;;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"http.cjs","sources":["../../../../../../../../node_modules/@sentry/node/esm/integrations/http.js"],"sourcesContent":["import { _optionalChain } from '@sentry/utils';\nimport { defineIntegration, getClient, isSentryRequestUrl, getCurrentScope, getIsolationScope, getActiveSpan, spanToTraceHeader, getDynamicSamplingContextFromSpan, getDynamicSamplingContextFromClient, setHttpStatus, spanToJSON, hasTracingEnabled, getCurrentHub, addBreadcrumb } from '@sentry/core';\nimport { dropUndefinedKeys, logger, fill, LRUMap, generateSentryTraceHeader, dynamicSamplingContextToSentryBaggageHeader, stringMatchesSomePattern } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { NODE_VERSION } from '../nodeVersion.js';\nimport { normalizeRequestArgs, extractRawUrl, extractUrl, cleanSpanDescription } from './utils/http.js';\n\nconst _httpIntegration = ((options = {}) => {\n const { breadcrumbs, tracing, shouldCreateSpanForRequest } = options;\n\n const convertedOptions = {\n breadcrumbs,\n tracing:\n tracing === false\n ? false\n : dropUndefinedKeys({\n // If tracing is forced to `true`, we don't want to set `enableIfHasTracingEnabled`\n enableIfHasTracingEnabled: tracing === true ? undefined : true,\n shouldCreateSpanForRequest,\n }),\n };\n\n // eslint-disable-next-line deprecation/deprecation\n return new Http(convertedOptions) ;\n}) ;\n\n/**\n * The http module integration instruments Node's internal http module. It creates breadcrumbs, spans for outgoing\n * http requests, and attaches trace data when tracing is enabled via its `tracing` option.\n *\n * By default, this will always create breadcrumbs, and will create spans if tracing is enabled.\n */\nconst httpIntegration = defineIntegration(_httpIntegration);\n\n/**\n * The http module integration instruments Node's internal http module. It creates breadcrumbs, transactions for outgoing\n * http requests and attaches trace data when tracing is enabled via its `tracing` option.\n *\n * @deprecated Use `httpIntegration()` instead.\n */\nclass Http {\n /**\n * @inheritDoc\n */\n static __initStatic() {this.id = 'Http';}\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line deprecation/deprecation\n __init() {this.name = Http.id;}\n\n /**\n * @inheritDoc\n */\n constructor(options = {}) {Http.prototype.__init.call(this);\n this._breadcrumbs = typeof options.breadcrumbs === 'undefined' ? true : options.breadcrumbs;\n this._tracing = !options.tracing ? undefined : options.tracing === true ? {} : options.tracing;\n }\n\n /**\n * @inheritDoc\n */\n setupOnce(\n _addGlobalEventProcessor,\n // eslint-disable-next-line deprecation/deprecation\n setupOnceGetCurrentHub,\n ) {\n // eslint-disable-next-line deprecation/deprecation\n const clientOptions = _optionalChain([setupOnceGetCurrentHub, 'call', _ => _(), 'access', _2 => _2.getClient, 'call', _3 => _3(), 'optionalAccess', _4 => _4.getOptions, 'call', _5 => _5()]);\n\n // If `tracing` is not explicitly set, we default this based on whether or not tracing is enabled.\n // But for compatibility, we only do that if `enableIfHasTracingEnabled` is set.\n const shouldCreateSpans = _shouldCreateSpans(this._tracing, clientOptions);\n\n // No need to instrument if we don't want to track anything\n if (!this._breadcrumbs && !shouldCreateSpans) {\n return;\n }\n\n // Do not auto-instrument for other instrumenter\n if (clientOptions && clientOptions.instrumenter !== 'sentry') {\n DEBUG_BUILD && logger.log('HTTP Integration is skipped because of instrumenter configuration.');\n return;\n }\n\n const shouldCreateSpanForRequest = _getShouldCreateSpanForRequest(shouldCreateSpans, this._tracing, clientOptions);\n\n // eslint-disable-next-line deprecation/deprecation\n const tracePropagationTargets = _optionalChain([clientOptions, 'optionalAccess', _6 => _6.tracePropagationTargets]) || _optionalChain([this, 'access', _7 => _7._tracing, 'optionalAccess', _8 => _8.tracePropagationTargets]);\n\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const httpModule = require('http');\n const wrappedHttpHandlerMaker = _createWrappedRequestMethodFactory(\n httpModule,\n this._breadcrumbs,\n shouldCreateSpanForRequest,\n tracePropagationTargets,\n );\n fill(httpModule, 'get', wrappedHttpHandlerMaker);\n fill(httpModule, 'request', wrappedHttpHandlerMaker);\n\n // NOTE: Prior to Node 9, `https` used internals of `http` module, thus we don't patch it.\n // If we do, we'd get double breadcrumbs and double spans for `https` calls.\n // It has been changed in Node 9, so for all versions equal and above, we patch `https` separately.\n if (NODE_VERSION.major > 8) {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const httpsModule = require('https');\n const wrappedHttpsHandlerMaker = _createWrappedRequestMethodFactory(\n httpsModule,\n this._breadcrumbs,\n shouldCreateSpanForRequest,\n tracePropagationTargets,\n );\n fill(httpsModule, 'get', wrappedHttpsHandlerMaker);\n fill(httpsModule, 'request', wrappedHttpsHandlerMaker);\n }\n }\n}Http.__initStatic();\n\n// for ease of reading below\n\n/**\n * Function which creates a function which creates wrapped versions of internal `request` and `get` calls within `http`\n * and `https` modules. (NB: Not a typo - this is a creator^2!)\n *\n * @param breadcrumbsEnabled Whether or not to record outgoing requests as breadcrumbs\n * @param tracingEnabled Whether or not to record outgoing requests as tracing spans\n *\n * @returns A function which accepts the exiting handler and returns a wrapped handler\n */\nfunction _createWrappedRequestMethodFactory(\n httpModule,\n breadcrumbsEnabled,\n shouldCreateSpanForRequest,\n tracePropagationTargets,\n) {\n // We're caching results so we don't have to recompute regexp every time we create a request.\n const createSpanUrlMap = new LRUMap(100);\n const headersUrlMap = new LRUMap(100);\n\n const shouldCreateSpan = (url) => {\n if (shouldCreateSpanForRequest === undefined) {\n return true;\n }\n\n const cachedDecision = createSpanUrlMap.get(url);\n if (cachedDecision !== undefined) {\n return cachedDecision;\n }\n\n const decision = shouldCreateSpanForRequest(url);\n createSpanUrlMap.set(url, decision);\n return decision;\n };\n\n const shouldAttachTraceData = (url) => {\n if (tracePropagationTargets === undefined) {\n return true;\n }\n\n const cachedDecision = headersUrlMap.get(url);\n if (cachedDecision !== undefined) {\n return cachedDecision;\n }\n\n const decision = stringMatchesSomePattern(url, tracePropagationTargets);\n headersUrlMap.set(url, decision);\n return decision;\n };\n\n /**\n * Captures Breadcrumb based on provided request/response pair\n */\n function addRequestBreadcrumb(\n event,\n requestSpanData,\n req,\n res,\n ) {\n // eslint-disable-next-line deprecation/deprecation\n if (!getCurrentHub().getIntegration(Http)) {\n return;\n }\n\n addBreadcrumb(\n {\n category: 'http',\n data: {\n status_code: res && res.statusCode,\n ...requestSpanData,\n },\n type: 'http',\n },\n {\n event,\n request: req,\n response: res,\n },\n );\n }\n\n return function wrappedRequestMethodFactory(originalRequestMethod) {\n return function wrappedMethod( ...args) {\n const requestArgs = normalizeRequestArgs(httpModule, args);\n const requestOptions = requestArgs[0];\n // eslint-disable-next-line deprecation/deprecation\n const rawRequestUrl = extractRawUrl(requestOptions);\n const requestUrl = extractUrl(requestOptions);\n const client = getClient();\n\n // we don't want to record requests to Sentry as either breadcrumbs or spans, so just use the original method\n if (isSentryRequestUrl(requestUrl, client)) {\n return originalRequestMethod.apply(httpModule, requestArgs);\n }\n\n const scope = getCurrentScope();\n const isolationScope = getIsolationScope();\n const parentSpan = getActiveSpan();\n\n const data = getRequestSpanData(requestUrl, requestOptions);\n\n const requestSpan = shouldCreateSpan(rawRequestUrl)\n ? // eslint-disable-next-line deprecation/deprecation\n _optionalChain([parentSpan, 'optionalAccess', _9 => _9.startChild, 'call', _10 => _10({\n op: 'http.client',\n origin: 'auto.http.node.http',\n description: `${data['http.method']} ${data.url}`,\n data,\n })])\n : undefined;\n\n if (client && shouldAttachTraceData(rawRequestUrl)) {\n const { traceId, spanId, sampled, dsc } = {\n ...isolationScope.getPropagationContext(),\n ...scope.getPropagationContext(),\n };\n\n const sentryTraceHeader = requestSpan\n ? spanToTraceHeader(requestSpan)\n : generateSentryTraceHeader(traceId, spanId, sampled);\n\n const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(\n dsc ||\n (requestSpan\n ? getDynamicSamplingContextFromSpan(requestSpan)\n : getDynamicSamplingContextFromClient(traceId, client, scope)),\n );\n\n addHeadersToRequestOptions(requestOptions, requestUrl, sentryTraceHeader, sentryBaggageHeader);\n } else {\n DEBUG_BUILD &&\n logger.log(\n `[Tracing] Not adding sentry-trace header to outgoing request (${requestUrl}) due to mismatching tracePropagationTargets option.`,\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return originalRequestMethod\n .apply(httpModule, requestArgs)\n .once('response', function ( res) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const req = this;\n if (breadcrumbsEnabled) {\n addRequestBreadcrumb('response', data, req, res);\n }\n if (requestSpan) {\n if (res.statusCode) {\n setHttpStatus(requestSpan, res.statusCode);\n }\n requestSpan.updateName(\n cleanSpanDescription(spanToJSON(requestSpan).description || '', requestOptions, req) || '',\n );\n requestSpan.end();\n }\n })\n .once('error', function () {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const req = this;\n\n if (breadcrumbsEnabled) {\n addRequestBreadcrumb('error', data, req);\n }\n if (requestSpan) {\n setHttpStatus(requestSpan, 500);\n requestSpan.updateName(\n cleanSpanDescription(spanToJSON(requestSpan).description || '', requestOptions, req) || '',\n );\n requestSpan.end();\n }\n });\n };\n };\n}\n\nfunction addHeadersToRequestOptions(\n requestOptions,\n requestUrl,\n sentryTraceHeader,\n sentryBaggageHeader,\n) {\n // Don't overwrite sentry-trace and baggage header if it's already set.\n const headers = requestOptions.headers || {};\n if (headers['sentry-trace']) {\n return;\n }\n\n DEBUG_BUILD &&\n logger.log(`[Tracing] Adding sentry-trace header ${sentryTraceHeader} to outgoing request to \"${requestUrl}\": `);\n\n requestOptions.headers = {\n ...requestOptions.headers,\n 'sentry-trace': sentryTraceHeader,\n // Setting a header to `undefined` will crash in node so we only set the baggage header when it's defined\n ...(sentryBaggageHeader &&\n sentryBaggageHeader.length > 0 && { baggage: normalizeBaggageHeader(requestOptions, sentryBaggageHeader) }),\n };\n}\n\nfunction getRequestSpanData(requestUrl, requestOptions) {\n const method = requestOptions.method || 'GET';\n const data = {\n url: requestUrl,\n 'http.method': method,\n };\n if (requestOptions.hash) {\n // strip leading \"#\"\n data['http.fragment'] = requestOptions.hash.substring(1);\n }\n if (requestOptions.search) {\n // strip leading \"?\"\n data['http.query'] = requestOptions.search.substring(1);\n }\n return data;\n}\n\nfunction normalizeBaggageHeader(\n requestOptions,\n sentryBaggageHeader,\n) {\n if (!requestOptions.headers || !requestOptions.headers.baggage) {\n return sentryBaggageHeader;\n } else if (!sentryBaggageHeader) {\n return requestOptions.headers.baggage ;\n } else if (Array.isArray(requestOptions.headers.baggage)) {\n return [...requestOptions.headers.baggage, sentryBaggageHeader];\n }\n // Type-cast explanation:\n // Technically this the following could be of type `(number | string)[]` but for the sake of simplicity\n // we say this is undefined behaviour, since it would not be baggage spec conform if the user did this.\n return [requestOptions.headers.baggage, sentryBaggageHeader] ;\n}\n\n/** Exported for tests only. */\nfunction _shouldCreateSpans(\n tracingOptions,\n clientOptions,\n) {\n return tracingOptions === undefined\n ? false\n : tracingOptions.enableIfHasTracingEnabled\n ? hasTracingEnabled(clientOptions)\n : true;\n}\n\n/** Exported for tests only. */\nfunction _getShouldCreateSpanForRequest(\n shouldCreateSpans,\n tracingOptions,\n clientOptions,\n) {\n const handler = shouldCreateSpans\n ? // eslint-disable-next-line deprecation/deprecation\n _optionalChain([tracingOptions, 'optionalAccess', _11 => _11.shouldCreateSpanForRequest]) || _optionalChain([clientOptions, 'optionalAccess', _12 => _12.shouldCreateSpanForRequest])\n : () => false;\n\n return handler;\n}\n\nexport { Http, _getShouldCreateSpanForRequest, _shouldCreateSpans, httpIntegration };\n//# sourceMappingURL=http.js.map\n"],"names":["tracing","dropUndefinedKeys","defineIntegration","_optionalChain","DEBUG_BUILD","logger","fill","NODE_VERSION","LRUMap","stringMatchesSomePattern","getCurrentHub","addBreadcrumb","normalizeRequestArgs","extractRawUrl","extractUrl","getClient","isSentryRequestUrl","getCurrentScope","getIsolationScope","getActiveSpan","spanToTraceHeader","generateSentryTraceHeader","dynamicSamplingContextToSentryBaggageHeader","getDynamicSamplingContextFromSpan","getDynamicSamplingContextFromClient","setHttpStatus","cleanSpanDescription","spanToJSON","hasTracingEnabled"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOA,MAAM,mBAAoB,CAAC,UAAU,OAAO;AAC1C,QAAM,EAAE,aAAa,SAAAA,UAAS,2BAA0B,IAAK;AAE7D,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA,SACEA,aAAY,QACR,QACAC,yBAAkB;AAAA;AAAA,MAEhB,2BAA2BD,aAAY,OAAO,SAAY;AAAA,MAC1D;AAAA,IACZ,CAAW;AAAA,EACX;AAGE,SAAO,IAAI,KAAK,gBAAgB;AAClC;AAQK,MAAC,kBAAkBE,YAAAA,kBAAkB,gBAAgB;AAQ1D,MAAM,KAAM;AAAA;AAAA;AAAA;AAAA,EAIT,OAAO,eAAe;AAAC,SAAK,KAAK;AAAA,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAMxC,SAAS;AAAC,SAAK,OAAO,KAAK;AAAA,EAAG;AAAA;AAAA;AAAA;AAAA,EAK9B,YAAY,UAAU,CAAA,GAAI;AAAC,SAAK,UAAU,OAAO,KAAK,IAAI;AACzD,SAAK,eAAe,OAAO,QAAQ,gBAAgB,cAAc,OAAO,QAAQ;AAChF,SAAK,WAAW,CAAC,QAAQ,UAAU,SAAY,QAAQ,YAAY,OAAO,CAAA,IAAK,QAAQ;AAAA,EACzF;AAAA;AAAA;AAAA;AA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eAAe,QAAQ,SAAS;AAC9D,WAAO;AAAA,EACT,WAAW,CAAC,qBAAqB;AAC/B,WAAO,eAAe,QAAQ;AAAA,EAChC,WAAW,MAAM,QAAQ,eAAe,QAAQ,OAAO,GAAG;AACxD,WAAO,CAAC,GAAG,eAAe,QAAQ,SAAS,mBAAmB;AAAA,EAChE;AAIA,SAAO,CAAC,eAAe,QAAQ,SAAS,mBAAmB;AAC7D;AAGA,SAAS,mBACP,gBACA,eACA;AACA,SAAO,mBAAmB,SACtB,QACA,eAAe,4BACbuB,kBAAAA,kBAAkB,aAAa,IAC/B;AACR;AAGA,SAAS,+BACP,mBACA,gBACA,eACA;AACA,QAAM,UAAU;AAAA;AAAA,IAEZzB,eAAAA,eAAe,CAAC,gBAAgB,kBAAkB,SAAO,IAAI,0BAA0B,CAAC,KAAKA,eAAAA,eAAe,CAAC,eAAe,kBAAkB,SAAO,IAAI,0BAA0B,CAAC;AAAA,MACpL,MAAM;AAEV,SAAO;AACT;;;;;","x_google_ignoreList":[0]}
|
|
@@ -2,9 +2,10 @@ import { DEBUG_BUILD } from "../debug-build.js";
|
|
|
2
2
|
import { NODE_VERSION } from "../nodeVersion.js";
|
|
3
3
|
import { normalizeRequestArgs, extractRawUrl, extractUrl, cleanSpanDescription } from "./utils/http.js";
|
|
4
4
|
import { defineIntegration } from './../../_node_modules/@sentry/core/esm/integration.js';
|
|
5
|
+
import { dropUndefinedKeys, fill } from './../../_node_modules/@sentry/utils/esm/object.js';
|
|
5
6
|
import { _optionalChain } from './../../_node_modules/@sentry/utils/esm/buildPolyfills/_optionalChain.js';
|
|
6
7
|
import { logger } from './../../_node_modules/@sentry/utils/esm/logger.js';
|
|
7
|
-
import {
|
|
8
|
+
import { hasTracingEnabled } from './../../_node_modules/@sentry/core/esm/utils/hasTracingEnabled.js';
|
|
8
9
|
import { getClient, getCurrentScope, addBreadcrumb } from './../../_node_modules/@sentry/core/esm/exports.js';
|
|
9
10
|
import { isSentryRequestUrl } from './../../_node_modules/@sentry/core/esm/utils/isSentryRequestUrl.js';
|
|
10
11
|
import { getIsolationScope, getCurrentHub } from './../../_node_modules/@sentry/core/esm/hub.js';
|
|
@@ -14,9 +15,8 @@ import { generateSentryTraceHeader } from './../../_node_modules/@sentry/utils/e
|
|
|
14
15
|
import { dynamicSamplingContextToSentryBaggageHeader } from './../../_node_modules/@sentry/utils/esm/baggage.js';
|
|
15
16
|
import { getDynamicSamplingContextFromSpan, getDynamicSamplingContextFromClient } from './../../_node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js';
|
|
16
17
|
import { setHttpStatus } from './../../_node_modules/@sentry/core/esm/tracing/spanstatus.js';
|
|
17
|
-
import { hasTracingEnabled } from './../../_node_modules/@sentry/core/esm/utils/hasTracingEnabled.js';
|
|
18
|
-
import { stringMatchesSomePattern } from './../../_node_modules/@sentry/utils/esm/string.js';
|
|
19
18
|
import { LRUMap } from './../../_node_modules/@sentry/utils/esm/lru.js';
|
|
19
|
+
import { stringMatchesSomePattern } from './../../_node_modules/@sentry/utils/esm/string.js';
|
|
20
20
|
const _httpIntegration = (options = {}) => {
|
|
21
21
|
const { breadcrumbs, tracing, shouldCreateSpanForRequest } = options;
|
|
22
22
|
const convertedOptions = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.js","sources":["../../../../../../../../node_modules/@sentry/node/esm/integrations/http.js"],"sourcesContent":["import { _optionalChain } from '@sentry/utils';\nimport { defineIntegration, getClient, isSentryRequestUrl, getCurrentScope, getIsolationScope, getActiveSpan, spanToTraceHeader, getDynamicSamplingContextFromSpan, getDynamicSamplingContextFromClient, setHttpStatus, spanToJSON, hasTracingEnabled, getCurrentHub, addBreadcrumb } from '@sentry/core';\nimport { dropUndefinedKeys, logger, fill, LRUMap, generateSentryTraceHeader, dynamicSamplingContextToSentryBaggageHeader, stringMatchesSomePattern } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { NODE_VERSION } from '../nodeVersion.js';\nimport { normalizeRequestArgs, extractRawUrl, extractUrl, cleanSpanDescription } from './utils/http.js';\n\nconst _httpIntegration = ((options = {}) => {\n const { breadcrumbs, tracing, shouldCreateSpanForRequest } = options;\n\n const convertedOptions = {\n breadcrumbs,\n tracing:\n tracing === false\n ? false\n : dropUndefinedKeys({\n // If tracing is forced to `true`, we don't want to set `enableIfHasTracingEnabled`\n enableIfHasTracingEnabled: tracing === true ? undefined : true,\n shouldCreateSpanForRequest,\n }),\n };\n\n // eslint-disable-next-line deprecation/deprecation\n return new Http(convertedOptions) ;\n}) ;\n\n/**\n * The http module integration instruments Node's internal http module. It creates breadcrumbs, spans for outgoing\n * http requests, and attaches trace data when tracing is enabled via its `tracing` option.\n *\n * By default, this will always create breadcrumbs, and will create spans if tracing is enabled.\n */\nconst httpIntegration = defineIntegration(_httpIntegration);\n\n/**\n * The http module integration instruments Node's internal http module. It creates breadcrumbs, transactions for outgoing\n * http requests and attaches trace data when tracing is enabled via its `tracing` option.\n *\n * @deprecated Use `httpIntegration()` instead.\n */\nclass Http {\n /**\n * @inheritDoc\n */\n static __initStatic() {this.id = 'Http';}\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line deprecation/deprecation\n __init() {this.name = Http.id;}\n\n /**\n * @inheritDoc\n */\n constructor(options = {}) {Http.prototype.__init.call(this);\n this._breadcrumbs = typeof options.breadcrumbs === 'undefined' ? true : options.breadcrumbs;\n this._tracing = !options.tracing ? undefined : options.tracing === true ? {} : options.tracing;\n }\n\n /**\n * @inheritDoc\n */\n setupOnce(\n _addGlobalEventProcessor,\n // eslint-disable-next-line deprecation/deprecation\n setupOnceGetCurrentHub,\n ) {\n // eslint-disable-next-line deprecation/deprecation\n const clientOptions = _optionalChain([setupOnceGetCurrentHub, 'call', _ => _(), 'access', _2 => _2.getClient, 'call', _3 => _3(), 'optionalAccess', _4 => _4.getOptions, 'call', _5 => _5()]);\n\n // If `tracing` is not explicitly set, we default this based on whether or not tracing is enabled.\n // But for compatibility, we only do that if `enableIfHasTracingEnabled` is set.\n const shouldCreateSpans = _shouldCreateSpans(this._tracing, clientOptions);\n\n // No need to instrument if we don't want to track anything\n if (!this._breadcrumbs && !shouldCreateSpans) {\n return;\n }\n\n // Do not auto-instrument for other instrumenter\n if (clientOptions && clientOptions.instrumenter !== 'sentry') {\n DEBUG_BUILD && logger.log('HTTP Integration is skipped because of instrumenter configuration.');\n return;\n }\n\n const shouldCreateSpanForRequest = _getShouldCreateSpanForRequest(shouldCreateSpans, this._tracing, clientOptions);\n\n // eslint-disable-next-line deprecation/deprecation\n const tracePropagationTargets = _optionalChain([clientOptions, 'optionalAccess', _6 => _6.tracePropagationTargets]) || _optionalChain([this, 'access', _7 => _7._tracing, 'optionalAccess', _8 => _8.tracePropagationTargets]);\n\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const httpModule = require('http');\n const wrappedHttpHandlerMaker = _createWrappedRequestMethodFactory(\n httpModule,\n this._breadcrumbs,\n shouldCreateSpanForRequest,\n tracePropagationTargets,\n );\n fill(httpModule, 'get', wrappedHttpHandlerMaker);\n fill(httpModule, 'request', wrappedHttpHandlerMaker);\n\n // NOTE: Prior to Node 9, `https` used internals of `http` module, thus we don't patch it.\n // If we do, we'd get double breadcrumbs and double spans for `https` calls.\n // It has been changed in Node 9, so for all versions equal and above, we patch `https` separately.\n if (NODE_VERSION.major > 8) {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const httpsModule = require('https');\n const wrappedHttpsHandlerMaker = _createWrappedRequestMethodFactory(\n httpsModule,\n this._breadcrumbs,\n shouldCreateSpanForRequest,\n tracePropagationTargets,\n );\n fill(httpsModule, 'get', wrappedHttpsHandlerMaker);\n fill(httpsModule, 'request', wrappedHttpsHandlerMaker);\n }\n }\n}Http.__initStatic();\n\n// for ease of reading below\n\n/**\n * Function which creates a function which creates wrapped versions of internal `request` and `get` calls within `http`\n * and `https` modules. (NB: Not a typo - this is a creator^2!)\n *\n * @param breadcrumbsEnabled Whether or not to record outgoing requests as breadcrumbs\n * @param tracingEnabled Whether or not to record outgoing requests as tracing spans\n *\n * @returns A function which accepts the exiting handler and returns a wrapped handler\n */\nfunction _createWrappedRequestMethodFactory(\n httpModule,\n breadcrumbsEnabled,\n shouldCreateSpanForRequest,\n tracePropagationTargets,\n) {\n // We're caching results so we don't have to recompute regexp every time we create a request.\n const createSpanUrlMap = new LRUMap(100);\n const headersUrlMap = new LRUMap(100);\n\n const shouldCreateSpan = (url) => {\n if (shouldCreateSpanForRequest === undefined) {\n return true;\n }\n\n const cachedDecision = createSpanUrlMap.get(url);\n if (cachedDecision !== undefined) {\n return cachedDecision;\n }\n\n const decision = shouldCreateSpanForRequest(url);\n createSpanUrlMap.set(url, decision);\n return decision;\n };\n\n const shouldAttachTraceData = (url) => {\n if (tracePropagationTargets === undefined) {\n return true;\n }\n\n const cachedDecision = headersUrlMap.get(url);\n if (cachedDecision !== undefined) {\n return cachedDecision;\n }\n\n const decision = stringMatchesSomePattern(url, tracePropagationTargets);\n headersUrlMap.set(url, decision);\n return decision;\n };\n\n /**\n * Captures Breadcrumb based on provided request/response pair\n */\n function addRequestBreadcrumb(\n event,\n requestSpanData,\n req,\n res,\n ) {\n // eslint-disable-next-line deprecation/deprecation\n if (!getCurrentHub().getIntegration(Http)) {\n return;\n }\n\n addBreadcrumb(\n {\n category: 'http',\n data: {\n status_code: res && res.statusCode,\n ...requestSpanData,\n },\n type: 'http',\n },\n {\n event,\n request: req,\n response: res,\n },\n );\n }\n\n return function wrappedRequestMethodFactory(originalRequestMethod) {\n return function wrappedMethod( ...args) {\n const requestArgs = normalizeRequestArgs(httpModule, args);\n const requestOptions = requestArgs[0];\n // eslint-disable-next-line deprecation/deprecation\n const rawRequestUrl = extractRawUrl(requestOptions);\n const requestUrl = extractUrl(requestOptions);\n const client = getClient();\n\n // we don't want to record requests to Sentry as either breadcrumbs or spans, so just use the original method\n if (isSentryRequestUrl(requestUrl, client)) {\n return originalRequestMethod.apply(httpModule, requestArgs);\n }\n\n const scope = getCurrentScope();\n const isolationScope = getIsolationScope();\n const parentSpan = getActiveSpan();\n\n const data = getRequestSpanData(requestUrl, requestOptions);\n\n const requestSpan = shouldCreateSpan(rawRequestUrl)\n ? // eslint-disable-next-line deprecation/deprecation\n _optionalChain([parentSpan, 'optionalAccess', _9 => _9.startChild, 'call', _10 => _10({\n op: 'http.client',\n origin: 'auto.http.node.http',\n description: `${data['http.method']} ${data.url}`,\n data,\n })])\n : undefined;\n\n if (client && shouldAttachTraceData(rawRequestUrl)) {\n const { traceId, spanId, sampled, dsc } = {\n ...isolationScope.getPropagationContext(),\n ...scope.getPropagationContext(),\n };\n\n const sentryTraceHeader = requestSpan\n ? spanToTraceHeader(requestSpan)\n : generateSentryTraceHeader(traceId, spanId, sampled);\n\n const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(\n dsc ||\n (requestSpan\n ? getDynamicSamplingContextFromSpan(requestSpan)\n : getDynamicSamplingContextFromClient(traceId, client, scope)),\n );\n\n addHeadersToRequestOptions(requestOptions, requestUrl, sentryTraceHeader, sentryBaggageHeader);\n } else {\n DEBUG_BUILD &&\n logger.log(\n `[Tracing] Not adding sentry-trace header to outgoing request (${requestUrl}) due to mismatching tracePropagationTargets option.`,\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return originalRequestMethod\n .apply(httpModule, requestArgs)\n .once('response', function ( res) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const req = this;\n if (breadcrumbsEnabled) {\n addRequestBreadcrumb('response', data, req, res);\n }\n if (requestSpan) {\n if (res.statusCode) {\n setHttpStatus(requestSpan, res.statusCode);\n }\n requestSpan.updateName(\n cleanSpanDescription(spanToJSON(requestSpan).description || '', requestOptions, req) || '',\n );\n requestSpan.end();\n }\n })\n .once('error', function () {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const req = this;\n\n if (breadcrumbsEnabled) {\n addRequestBreadcrumb('error', data, req);\n }\n if (requestSpan) {\n setHttpStatus(requestSpan, 500);\n requestSpan.updateName(\n cleanSpanDescription(spanToJSON(requestSpan).description || '', requestOptions, req) || '',\n );\n requestSpan.end();\n }\n });\n };\n };\n}\n\nfunction addHeadersToRequestOptions(\n requestOptions,\n requestUrl,\n sentryTraceHeader,\n sentryBaggageHeader,\n) {\n // Don't overwrite sentry-trace and baggage header if it's already set.\n const headers = requestOptions.headers || {};\n if (headers['sentry-trace']) {\n return;\n }\n\n DEBUG_BUILD &&\n logger.log(`[Tracing] Adding sentry-trace header ${sentryTraceHeader} to outgoing request to \"${requestUrl}\": `);\n\n requestOptions.headers = {\n ...requestOptions.headers,\n 'sentry-trace': sentryTraceHeader,\n // Setting a header to `undefined` will crash in node so we only set the baggage header when it's defined\n ...(sentryBaggageHeader &&\n sentryBaggageHeader.length > 0 && { baggage: normalizeBaggageHeader(requestOptions, sentryBaggageHeader) }),\n };\n}\n\nfunction getRequestSpanData(requestUrl, requestOptions) {\n const method = requestOptions.method || 'GET';\n const data = {\n url: requestUrl,\n 'http.method': method,\n };\n if (requestOptions.hash) {\n // strip leading \"#\"\n data['http.fragment'] = requestOptions.hash.substring(1);\n }\n if (requestOptions.search) {\n // strip leading \"?\"\n data['http.query'] = requestOptions.search.substring(1);\n }\n return data;\n}\n\nfunction normalizeBaggageHeader(\n requestOptions,\n sentryBaggageHeader,\n) {\n if (!requestOptions.headers || !requestOptions.headers.baggage) {\n return sentryBaggageHeader;\n } else if (!sentryBaggageHeader) {\n return requestOptions.headers.baggage ;\n } else if (Array.isArray(requestOptions.headers.baggage)) {\n return [...requestOptions.headers.baggage, sentryBaggageHeader];\n }\n // Type-cast explanation:\n // Technically this the following could be of type `(number | string)[]` but for the sake of simplicity\n // we say this is undefined behaviour, since it would not be baggage spec conform if the user did this.\n return [requestOptions.headers.baggage, sentryBaggageHeader] ;\n}\n\n/** Exported for tests only. */\nfunction _shouldCreateSpans(\n tracingOptions,\n clientOptions,\n) {\n return tracingOptions === undefined\n ? false\n : tracingOptions.enableIfHasTracingEnabled\n ? hasTracingEnabled(clientOptions)\n : true;\n}\n\n/** Exported for tests only. */\nfunction _getShouldCreateSpanForRequest(\n shouldCreateSpans,\n tracingOptions,\n clientOptions,\n) {\n const handler = shouldCreateSpans\n ? // eslint-disable-next-line deprecation/deprecation\n _optionalChain([tracingOptions, 'optionalAccess', _11 => _11.shouldCreateSpanForRequest]) || _optionalChain([clientOptions, 'optionalAccess', _12 => _12.shouldCreateSpanForRequest])\n : () => false;\n\n return handler;\n}\n\nexport { Http, _getShouldCreateSpanForRequest, _shouldCreateSpans, httpIntegration };\n//# sourceMappingURL=http.js.map\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAOA,MAAM,mBAAoB,CAAC,UAAU,OAAO;AAC1C,QAAM,EAAE,aAAa,SAAS,2BAA0B,IAAK;AAE7D,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA,SACE,YAAY,QACR,QACA,kBAAkB;AAAA;AAAA,MAEhB,2BAA2B,YAAY,OAAO,SAAY;AAAA,MAC1D;AAAA,IACZ,CAAW;AAAA,EACX;AAGE,SAAO,IAAI,KAAK,gBAAgB;AAClC;AAQK,MAAC,kBAAkB,kBAAkB,gBAAgB;AAQ1D,MAAM,KAAM;AAAA;AAAA;AAAA;AAAA,EAIT,OAAO,eAAe;AAAC,SAAK,KAAK;AAAA,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAMxC,SAAS;AAAC,SAAK,OAAO,KAAK;AAAA,EAAG;AAAA;AAAA;AAAA;AAAA,EAK9B,YAAY,UAAU,CAAA,GAAI;AAAC,SAAK,UAAU,OAAO,KAAK,IAAI;AACzD,SAAK,eAAe,OAAO,QAAQ,gBAAgB,cAAc,OAAO,QAAQ;AAChF,SAAK,WAAW,CAAC,QAAQ,UAAU,SAAY,QAAQ,YAAY,OAAO,KAAK,QAAQ;AAAA,EACxF;AAAA;AAAA;AAAA;AAAA,EAKA,UACC,0BAEA,wBACA;AAEA,UAAM,gBAAgB,eAAe,CAAC,wBAAwB,QAAQ,OAAK,KAAK,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AAM,UAAU;AAAA;AAAA,IAEZ,eAAe,CAAC,gBAAgB,kBAAkB,SAAO,IAAI,0BAA0B,CAAC,KAAK,eAAe,CAAC,eAAe,kBAAkB,SAAO,IAAI,0BAA0B,CAAC;AAAA,MACpL,MAAM;AAEV,SAAO;AACT;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"http.js","sources":["../../../../../../../../node_modules/@sentry/node/esm/integrations/http.js"],"sourcesContent":["import { _optionalChain } from '@sentry/utils';\nimport { defineIntegration, getClient, isSentryRequestUrl, getCurrentScope, getIsolationScope, getActiveSpan, spanToTraceHeader, getDynamicSamplingContextFromSpan, getDynamicSamplingContextFromClient, setHttpStatus, spanToJSON, hasTracingEnabled, getCurrentHub, addBreadcrumb } from '@sentry/core';\nimport { dropUndefinedKeys, logger, fill, LRUMap, generateSentryTraceHeader, dynamicSamplingContextToSentryBaggageHeader, stringMatchesSomePattern } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { NODE_VERSION } from '../nodeVersion.js';\nimport { normalizeRequestArgs, extractRawUrl, extractUrl, cleanSpanDescription } from './utils/http.js';\n\nconst _httpIntegration = ((options = {}) => {\n const { breadcrumbs, tracing, shouldCreateSpanForRequest } = options;\n\n const convertedOptions = {\n breadcrumbs,\n tracing:\n tracing === false\n ? false\n : dropUndefinedKeys({\n // If tracing is forced to `true`, we don't want to set `enableIfHasTracingEnabled`\n enableIfHasTracingEnabled: tracing === true ? undefined : true,\n shouldCreateSpanForRequest,\n }),\n };\n\n // eslint-disable-next-line deprecation/deprecation\n return new Http(convertedOptions) ;\n}) ;\n\n/**\n * The http module integration instruments Node's internal http module. It creates breadcrumbs, spans for outgoing\n * http requests, and attaches trace data when tracing is enabled via its `tracing` option.\n *\n * By default, this will always create breadcrumbs, and will create spans if tracing is enabled.\n */\nconst httpIntegration = defineIntegration(_httpIntegration);\n\n/**\n * The http module integration instruments Node's internal http module. It creates breadcrumbs, transactions for outgoing\n * http requests and attaches trace data when tracing is enabled via its `tracing` option.\n *\n * @deprecated Use `httpIntegration()` instead.\n */\nclass Http {\n /**\n * @inheritDoc\n */\n static __initStatic() {this.id = 'Http';}\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line deprecation/deprecation\n __init() {this.name = Http.id;}\n\n /**\n * @inheritDoc\n */\n constructor(options = {}) {Http.prototype.__init.call(this);\n this._breadcrumbs = typeof options.breadcrumbs === 'undefined' ? true : options.breadcrumbs;\n this._tracing = !options.tracing ? undefined : options.tracing === true ? {} : options.tracing;\n }\n\n /**\n * @inheritDoc\n */\n setupOnce(\n _addGlobalEventProcessor,\n // eslint-disable-next-line deprecation/deprecation\n setupOnceGetCurrentHub,\n ) {\n // eslint-disable-next-line deprecation/deprecation\n const clientOptions = _optionalChain([setupOnceGetCurrentHub, 'call', _ => _(), 'access', _2 => _2.getClient, 'call', _3 => _3(), 'optionalAccess', _4 => _4.getOptions, 'call', _5 => _5()]);\n\n // If `tracing` is not explicitly set, we default this based on whether or not tracing is enabled.\n // But for compatibility, we only do that if `enableIfHasTracingEnabled` is set.\n const shouldCreateSpans = _shouldCreateSpans(this._tracing, clientOptions);\n\n // No need to instrument if we don't want to track anything\n if (!this._breadcrumbs && !shouldCreateSpans) {\n return;\n }\n\n // Do not auto-instrument for other instrumenter\n if (clientOptions && clientOptions.instrumenter !== 'sentry') {\n DEBUG_BUILD && logger.log('HTTP Integration is skipped because of instrumenter configuration.');\n return;\n }\n\n const shouldCreateSpanForRequest = _getShouldCreateSpanForRequest(shouldCreateSpans, this._tracing, clientOptions);\n\n // eslint-disable-next-line deprecation/deprecation\n const tracePropagationTargets = _optionalChain([clientOptions, 'optionalAccess', _6 => _6.tracePropagationTargets]) || _optionalChain([this, 'access', _7 => _7._tracing, 'optionalAccess', _8 => _8.tracePropagationTargets]);\n\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const httpModule = require('http');\n const wrappedHttpHandlerMaker = _createWrappedRequestMethodFactory(\n httpModule,\n this._breadcrumbs,\n shouldCreateSpanForRequest,\n tracePropagationTargets,\n );\n fill(httpModule, 'get', wrappedHttpHandlerMaker);\n fill(httpModule, 'request', wrappedHttpHandlerMaker);\n\n // NOTE: Prior to Node 9, `https` used internals of `http` module, thus we don't patch it.\n // If we do, we'd get double breadcrumbs and double spans for `https` calls.\n // It has been changed in Node 9, so for all versions equal and above, we patch `https` separately.\n if (NODE_VERSION.major > 8) {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const httpsModule = require('https');\n const wrappedHttpsHandlerMaker = _createWrappedRequestMethodFactory(\n httpsModule,\n this._breadcrumbs,\n shouldCreateSpanForRequest,\n tracePropagationTargets,\n );\n fill(httpsModule, 'get', wrappedHttpsHandlerMaker);\n fill(httpsModule, 'request', wrappedHttpsHandlerMaker);\n }\n }\n}Http.__initStatic();\n\n// for ease of reading below\n\n/**\n * Function which creates a function which creates wrapped versions of internal `request` and `get` calls within `http`\n * and `https` modules. (NB: Not a typo - this is a creator^2!)\n *\n * @param breadcrumbsEnabled Whether or not to record outgoing requests as breadcrumbs\n * @param tracingEnabled Whether or not to record outgoing requests as tracing spans\n *\n * @returns A function which accepts the exiting handler and returns a wrapped handler\n */\nfunction _createWrappedRequestMethodFactory(\n httpModule,\n breadcrumbsEnabled,\n shouldCreateSpanForRequest,\n tracePropagationTargets,\n) {\n // We're caching results so we don't have to recompute regexp every time we create a request.\n const createSpanUrlMap = new LRUMap(100);\n const headersUrlMap = new LRUMap(100);\n\n const shouldCreateSpan = (url) => {\n if (shouldCreateSpanForRequest === undefined) {\n return true;\n }\n\n const cachedDecision = createSpanUrlMap.get(url);\n if (cachedDecision !== undefined) {\n return cachedDecision;\n }\n\n const decision = shouldCreateSpanForRequest(url);\n createSpanUrlMap.set(url, decision);\n return decision;\n };\n\n const shouldAttachTraceData = (url) => {\n if (tracePropagationTargets === undefined) {\n return true;\n }\n\n const cachedDecision = headersUrlMap.get(url);\n if (cachedDecision !== undefined) {\n return cachedDecision;\n }\n\n const decision = stringMatchesSomePattern(url, tracePropagationTargets);\n headersUrlMap.set(url, decision);\n return decision;\n };\n\n /**\n * Captures Breadcrumb based on provided request/response pair\n */\n function addRequestBreadcrumb(\n event,\n requestSpanData,\n req,\n res,\n ) {\n // eslint-disable-next-line deprecation/deprecation\n if (!getCurrentHub().getIntegration(Http)) {\n return;\n }\n\n addBreadcrumb(\n {\n category: 'http',\n data: {\n status_code: res && res.statusCode,\n ...requestSpanData,\n },\n type: 'http',\n },\n {\n event,\n request: req,\n response: res,\n },\n );\n }\n\n return function wrappedRequestMethodFactory(originalRequestMethod) {\n return function wrappedMethod( ...args) {\n const requestArgs = normalizeRequestArgs(httpModule, args);\n const requestOptions = requestArgs[0];\n // eslint-disable-next-line deprecation/deprecation\n const rawRequestUrl = extractRawUrl(requestOptions);\n const requestUrl = extractUrl(requestOptions);\n const client = getClient();\n\n // we don't want to record requests to Sentry as either breadcrumbs or spans, so just use the original method\n if (isSentryRequestUrl(requestUrl, client)) {\n return originalRequestMethod.apply(httpModule, requestArgs);\n }\n\n const scope = getCurrentScope();\n const isolationScope = getIsolationScope();\n const parentSpan = getActiveSpan();\n\n const data = getRequestSpanData(requestUrl, requestOptions);\n\n const requestSpan = shouldCreateSpan(rawRequestUrl)\n ? // eslint-disable-next-line deprecation/deprecation\n _optionalChain([parentSpan, 'optionalAccess', _9 => _9.startChild, 'call', _10 => _10({\n op: 'http.client',\n origin: 'auto.http.node.http',\n description: `${data['http.method']} ${data.url}`,\n data,\n })])\n : undefined;\n\n if (client && shouldAttachTraceData(rawRequestUrl)) {\n const { traceId, spanId, sampled, dsc } = {\n ...isolationScope.getPropagationContext(),\n ...scope.getPropagationContext(),\n };\n\n const sentryTraceHeader = requestSpan\n ? spanToTraceHeader(requestSpan)\n : generateSentryTraceHeader(traceId, spanId, sampled);\n\n const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(\n dsc ||\n (requestSpan\n ? getDynamicSamplingContextFromSpan(requestSpan)\n : getDynamicSamplingContextFromClient(traceId, client, scope)),\n );\n\n addHeadersToRequestOptions(requestOptions, requestUrl, sentryTraceHeader, sentryBaggageHeader);\n } else {\n DEBUG_BUILD &&\n logger.log(\n `[Tracing] Not adding sentry-trace header to outgoing request (${requestUrl}) due to mismatching tracePropagationTargets option.`,\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return originalRequestMethod\n .apply(httpModule, requestArgs)\n .once('response', function ( res) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const req = this;\n if (breadcrumbsEnabled) {\n addRequestBreadcrumb('response', data, req, res);\n }\n if (requestSpan) {\n if (res.statusCode) {\n setHttpStatus(requestSpan, res.statusCode);\n }\n requestSpan.updateName(\n cleanSpanDescription(spanToJSON(requestSpan).description || '', requestOptions, req) || '',\n );\n requestSpan.end();\n }\n })\n .once('error', function () {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const req = this;\n\n if (breadcrumbsEnabled) {\n addRequestBreadcrumb('error', data, req);\n }\n if (requestSpan) {\n setHttpStatus(requestSpan, 500);\n requestSpan.updateName(\n cleanSpanDescription(spanToJSON(requestSpan).description || '', requestOptions, req) || '',\n );\n requestSpan.end();\n }\n });\n };\n };\n}\n\nfunction addHeadersToRequestOptions(\n requestOptions,\n requestUrl,\n sentryTraceHeader,\n sentryBaggageHeader,\n) {\n // Don't overwrite sentry-trace and baggage header if it's already set.\n const headers = requestOptions.headers || {};\n if (headers['sentry-trace']) {\n return;\n }\n\n DEBUG_BUILD &&\n logger.log(`[Tracing] Adding sentry-trace header ${sentryTraceHeader} to outgoing request to \"${requestUrl}\": `);\n\n requestOptions.headers = {\n ...requestOptions.headers,\n 'sentry-trace': sentryTraceHeader,\n // Setting a header to `undefined` will crash in node so we only set the baggage header when it's defined\n ...(sentryBaggageHeader &&\n sentryBaggageHeader.length > 0 && { baggage: normalizeBaggageHeader(requestOptions, sentryBaggageHeader) }),\n };\n}\n\nfunction getRequestSpanData(requestUrl, requestOptions) {\n const method = requestOptions.method || 'GET';\n const data = {\n url: requestUrl,\n 'http.method': method,\n };\n if (requestOptions.hash) {\n // strip leading \"#\"\n data['http.fragment'] = requestOptions.hash.substring(1);\n }\n if (requestOptions.search) {\n // strip leading \"?\"\n data['http.query'] = requestOptions.search.substring(1);\n }\n return data;\n}\n\nfunction normalizeBaggageHeader(\n requestOptions,\n sentryBaggageHeader,\n) {\n if (!requestOptions.headers || !requestOptions.headers.baggage) {\n return sentryBaggageHeader;\n } else if (!sentryBaggageHeader) {\n return requestOptions.headers.baggage ;\n } else if (Array.isArray(requestOptions.headers.baggage)) {\n return [...requestOptions.headers.baggage, sentryBaggageHeader];\n }\n // Type-cast explanation:\n // Technically this the following could be of type `(number | string)[]` but for the sake of simplicity\n // we say this is undefined behaviour, since it would not be baggage spec conform if the user did this.\n return [requestOptions.headers.baggage, sentryBaggageHeader] ;\n}\n\n/** Exported for tests only. */\nfunction _shouldCreateSpans(\n tracingOptions,\n clientOptions,\n) {\n return tracingOptions === undefined\n ? false\n : tracingOptions.enableIfHasTracingEnabled\n ? hasTracingEnabled(clientOptions)\n : true;\n}\n\n/** Exported for tests only. */\nfunction _getShouldCreateSpanForRequest(\n shouldCreateSpans,\n tracingOptions,\n clientOptions,\n) {\n const handler = shouldCreateSpans\n ? // eslint-disable-next-line deprecation/deprecation\n _optionalChain([tracingOptions, 'optionalAccess', _11 => _11.shouldCreateSpanForRequest]) || _optionalChain([clientOptions, 'optionalAccess', _12 => _12.shouldCreateSpanForRequest])\n : () => false;\n\n return handler;\n}\n\nexport { Http, _getShouldCreateSpanForRequest, _shouldCreateSpans, httpIntegration };\n//# sourceMappingURL=http.js.map\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAOA,MAAM,mBAAoB,CAAC,UAAU,OAAO;AAC1C,QAAM,EAAE,aAAa,SAAS,2BAA0B,IAAK;AAE7D,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA,SACE,YAAY,QACR,QACA,kBAAkB;AAAA;AAAA,MAEhB,2BAA2B,Y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OAAO;AAAA,IACX,KAAK;AAAA,IACL,eAAe;AAAA,EACnB;AACE,MAAI,eAAe,MAAM;AAEvB,SAAK,eAAe,IAAI,eAAe,KAAK,UAAU,CAAC;AAAA,EACzD;AACA,MAAI,eAAe,QAAQ;AAEzB,SAAK,YAAY,IAAI,eAAe,OAAO,UAAU,CAAC;AAAA,EACxD;AACA,SAAO;AACT;AAEA,SAAS,uBACP,gBACA,qBACA;AACA,MAAI,CAAC,eAAe,WAAW,CAAC,eAAe,QAAQ,SAAS;AAC9D,WAAO;AAAA,EACT,WAAW,CAAC,qBAAqB;AAC/B,WAAO,eAAe,QAAQ;AAAA,EAChC,WAAW,MAAM,QAAQ,eAAe,QAAQ,OAAO,GAAG;AACxD,WAAO,CAAC,GAAG,eAAe,QAAQ,SAAS,mBAAmB;AAAA,EAChE;AAIA,SAAO,CAAC,eAAe,QAAQ,SAAS,mBAAmB;AAC7D;AAGA,SAAS,mBACP,gBACA,eACA;AACA,SAAO,mBAAmB,SACtB,QACA,eAAe,4BACb,kBAAkB,aAAa,IAC/B;AACR;AAGA,SAAS,+BACP,mBACA,gBACA,eACA;AACA,QAAM,UAAU;AAAA;AAAA,IAEZ,eAAe,CAAC,gBAAgB,kBAAkB,SAAO,IAAI,0BAA0B,CAAC,KAAK,eAAe,CAAC,eAAe,kBAAkB,SAAO,IAAI,0BAA0B,CAAC;AAAA,MACpL,MAAM;AAEV,SAAO;AACT;","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.cjs","sources":["../../../../../../../../../node_modules/@sentry/node/esm/integrations/local-variables/common.js"],"sourcesContent":["/**\n * Creates a rate limiter that will call the disable callback when the rate limit is reached and the enable callback\n * when a timeout has occurred.\n * @param maxPerSecond Maximum number of calls per second\n * @param enable Callback to enable capture\n * @param disable Callback to disable capture\n * @returns A function to call to increment the rate limiter count\n */\nfunction createRateLimiter(\n maxPerSecond,\n enable,\n disable,\n) {\n let count = 0;\n let retrySeconds = 5;\n let disabledTimeout = 0;\n\n setInterval(() => {\n if (disabledTimeout === 0) {\n if (count > maxPerSecond) {\n retrySeconds *= 2;\n disable(retrySeconds);\n\n // Cap at one day\n if (retrySeconds > 86400) {\n retrySeconds = 86400;\n }\n disabledTimeout = retrySeconds;\n }\n } else {\n disabledTimeout -= 1;\n\n if (disabledTimeout === 0) {\n enable();\n }\n }\n\n count = 0;\n }, 1000).unref();\n\n return () => {\n count += 1;\n };\n}\n\n// Add types for the exception event data\n\n/** Could this be an anonymous function? */\nfunction isAnonymous(name) {\n return name !== undefined && (name.length === 0 || name === '?' || name === '<anonymous>');\n}\n\n/** Do the function names appear to match? */\nfunction functionNamesMatch(a, b) {\n return a === b || (isAnonymous(a) && isAnonymous(b));\n}\n\n/** Creates a unique hash from stack frames */\nfunction hashFrames(frames) {\n if (frames === undefined) {\n return;\n }\n\n // Only hash the 10 most recent frames (ie. the last 10)\n return frames.slice(-10).reduce((acc, frame) => `${acc},${frame.function},${frame.lineno},${frame.colno}`, '');\n}\n\n/**\n * We use the stack parser to create a unique hash from the exception stack trace\n * This is used to lookup vars when the exception passes through the event processor\n */\nfunction hashFromStack(stackParser, stack) {\n if (stack === undefined) {\n return undefined;\n }\n\n return hashFrames(stackParser(stack, 1));\n}\n\nexport { createRateLimiter, functionNamesMatch, hashFrames, hashFromStack, isAnonymous };\n//# sourceMappingURL=common.js.map\n"],"names":[],"mappings":";;AAQA,SAAS,kBACP,cACA,QACA,SACA;AACA,MAAI,QAAQ;AACZ,MAAI,eAAe;AACnB,MAAI,kBAAkB;AAEtB,cAAY,MAAM;AAChB,QAAI,oBAAoB,GAAG;AACzB,UAAI,QAAQ,cAAc;AACxB,wBAAgB;AAChB,gBAAQ,YAAY;AAGpB,YAAI,eAAe,OAAO;AACxB,yBAAe;AAAA,
|
|
1
|
+
{"version":3,"file":"common.cjs","sources":["../../../../../../../../../node_modules/@sentry/node/esm/integrations/local-variables/common.js"],"sourcesContent":["/**\n * Creates a rate limiter that will call the disable callback when the rate limit is reached and the enable callback\n * when a timeout has occurred.\n * @param maxPerSecond Maximum number of calls per second\n * @param enable Callback to enable capture\n * @param disable Callback to disable capture\n * @returns A function to call to increment the rate limiter count\n */\nfunction createRateLimiter(\n maxPerSecond,\n enable,\n disable,\n) {\n let count = 0;\n let retrySeconds = 5;\n let disabledTimeout = 0;\n\n setInterval(() => {\n if (disabledTimeout === 0) {\n if (count > maxPerSecond) {\n retrySeconds *= 2;\n disable(retrySeconds);\n\n // Cap at one day\n if (retrySeconds > 86400) {\n retrySeconds = 86400;\n }\n disabledTimeout = retrySeconds;\n }\n } else {\n disabledTimeout -= 1;\n\n if (disabledTimeout === 0) {\n enable();\n }\n }\n\n count = 0;\n }, 1000).unref();\n\n return () => {\n count += 1;\n };\n}\n\n// Add types for the exception event data\n\n/** Could this be an anonymous function? */\nfunction isAnonymous(name) {\n return name !== undefined && (name.length === 0 || name === '?' || name === '<anonymous>');\n}\n\n/** Do the function names appear to match? */\nfunction functionNamesMatch(a, b) {\n return a === b || (isAnonymous(a) && isAnonymous(b));\n}\n\n/** Creates a unique hash from stack frames */\nfunction hashFrames(frames) {\n if (frames === undefined) {\n return;\n }\n\n // Only hash the 10 most recent frames (ie. the last 10)\n return frames.slice(-10).reduce((acc, frame) => `${acc},${frame.function},${frame.lineno},${frame.colno}`, '');\n}\n\n/**\n * We use the stack parser to create a unique hash from the exception stack trace\n * This is used to lookup vars when the exception passes through the event processor\n */\nfunction hashFromStack(stackParser, stack) {\n if (stack === undefined) {\n return undefined;\n }\n\n return hashFrames(stackParser(stack, 1));\n}\n\nexport { createRateLimiter, functionNamesMatch, hashFrames, hashFromStack, isAnonymous };\n//# sourceMappingURL=common.js.map\n"],"names":[],"mappings":";;AAQA,SAAS,kBACP,cACA,QACA,SACA;AACA,MAAI,QAAQ;AACZ,MAAI,eAAe;AACnB,MAAI,kBAAkB;AAEtB,cAAY,MAAM;AAChB,QAAI,oBAAoB,GAAG;AACzB,UAAI,QAAQ,cAAc;AACxB,wBAAgB;AAChB,gBAAQ,YAAY;AAGpB,YAAI,eAAe,OAAO;AACxB,yBAAe;AAAA,QACjB;AACA,0BAAkB;AAAA,MACpB;AAAA,IACF,OAAO;AACL,yBAAmB;AAEnB,UAAI,oBAAoB,GAAG;AACzB,eAAM;AAAA,MACR;AAAA,IACF;AAEA,YAAQ;AAAA,EACV,GAAG,GAAI,EAAE,MAAK;AAEd,SAAO,MAAM;AACX,aAAS;AAAA,EACX;AACF;AAKA,SAAS,YAAY,MAAM;AACzB,SAAO,SAAS,WAAc,KAAK,WAAW,KAAK,SAAS,OAAO,SAAS;AAC9E;AAGA,SAAS,mBAAmB,GAAG,GAAG;AAChC,SAAO,MAAM,KAAM,YAAY,CAAC,KAAK,YAAY,CAAC;AACpD;AAGA,SAAS,WAAW,QAAQ;AAC1B,MAAI,WAAW,QAAW;AACxB;AAAA,EACF;AAGA,SAAO,OAAO,MAAM,GAAG,EAAE,OAAO,CAAC,KAAK,UAAU,GAAG,GAAG,IAAI,MAAM,QAAQ,IAAI,MAAM,MAAM,IAAI,MAAM,KAAK,IAAI,EAAE;AAC/G;AAMA,SAAS,cAAc,aAAa,OAAO;AACzC,MAAI,UAAU,QAAW;AACvB,WAAO;AAAA,EACT;AAEA,SAAO,WAAW,YAAY,OAAO,CAAC,CAAC;AACzC;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sources":["../../../../../../../../../node_modules/@sentry/node/esm/integrations/local-variables/common.js"],"sourcesContent":["/**\n * Creates a rate limiter that will call the disable callback when the rate limit is reached and the enable callback\n * when a timeout has occurred.\n * @param maxPerSecond Maximum number of calls per second\n * @param enable Callback to enable capture\n * @param disable Callback to disable capture\n * @returns A function to call to increment the rate limiter count\n */\nfunction createRateLimiter(\n maxPerSecond,\n enable,\n disable,\n) {\n let count = 0;\n let retrySeconds = 5;\n let disabledTimeout = 0;\n\n setInterval(() => {\n if (disabledTimeout === 0) {\n if (count > maxPerSecond) {\n retrySeconds *= 2;\n disable(retrySeconds);\n\n // Cap at one day\n if (retrySeconds > 86400) {\n retrySeconds = 86400;\n }\n disabledTimeout = retrySeconds;\n }\n } else {\n disabledTimeout -= 1;\n\n if (disabledTimeout === 0) {\n enable();\n }\n }\n\n count = 0;\n }, 1000).unref();\n\n return () => {\n count += 1;\n };\n}\n\n// Add types for the exception event data\n\n/** Could this be an anonymous function? */\nfunction isAnonymous(name) {\n return name !== undefined && (name.length === 0 || name === '?' || name === '<anonymous>');\n}\n\n/** Do the function names appear to match? */\nfunction functionNamesMatch(a, b) {\n return a === b || (isAnonymous(a) && isAnonymous(b));\n}\n\n/** Creates a unique hash from stack frames */\nfunction hashFrames(frames) {\n if (frames === undefined) {\n return;\n }\n\n // Only hash the 10 most recent frames (ie. the last 10)\n return frames.slice(-10).reduce((acc, frame) => `${acc},${frame.function},${frame.lineno},${frame.colno}`, '');\n}\n\n/**\n * We use the stack parser to create a unique hash from the exception stack trace\n * This is used to lookup vars when the exception passes through the event processor\n */\nfunction hashFromStack(stackParser, stack) {\n if (stack === undefined) {\n return undefined;\n }\n\n return hashFrames(stackParser(stack, 1));\n}\n\nexport { createRateLimiter, functionNamesMatch, hashFrames, hashFromStack, isAnonymous };\n//# sourceMappingURL=common.js.map\n"],"names":[],"mappings":"AAQA,SAAS,kBACP,cACA,QACA,SACA;AACA,MAAI,QAAQ;AACZ,MAAI,eAAe;AACnB,MAAI,kBAAkB;AAEtB,cAAY,MAAM;AAChB,QAAI,oBAAoB,GAAG;AACzB,UAAI,QAAQ,cAAc;AACxB,wBAAgB;AAChB,gBAAQ,YAAY;AAGpB,YAAI,eAAe,OAAO;AACxB,yBAAe;AAAA,
|
|
1
|
+
{"version":3,"file":"common.js","sources":["../../../../../../../../../node_modules/@sentry/node/esm/integrations/local-variables/common.js"],"sourcesContent":["/**\n * Creates a rate limiter that will call the disable callback when the rate limit is reached and the enable callback\n * when a timeout has occurred.\n * @param maxPerSecond Maximum number of calls per second\n * @param enable Callback to enable capture\n * @param disable Callback to disable capture\n * @returns A function to call to increment the rate limiter count\n */\nfunction createRateLimiter(\n maxPerSecond,\n enable,\n disable,\n) {\n let count = 0;\n let retrySeconds = 5;\n let disabledTimeout = 0;\n\n setInterval(() => {\n if (disabledTimeout === 0) {\n if (count > maxPerSecond) {\n retrySeconds *= 2;\n disable(retrySeconds);\n\n // Cap at one day\n if (retrySeconds > 86400) {\n retrySeconds = 86400;\n }\n disabledTimeout = retrySeconds;\n }\n } else {\n disabledTimeout -= 1;\n\n if (disabledTimeout === 0) {\n enable();\n }\n }\n\n count = 0;\n }, 1000).unref();\n\n return () => {\n count += 1;\n };\n}\n\n// Add types for the exception event data\n\n/** Could this be an anonymous function? */\nfunction isAnonymous(name) {\n return name !== undefined && (name.length === 0 || name === '?' || name === '<anonymous>');\n}\n\n/** Do the function names appear to match? */\nfunction functionNamesMatch(a, b) {\n return a === b || (isAnonymous(a) && isAnonymous(b));\n}\n\n/** Creates a unique hash from stack frames */\nfunction hashFrames(frames) {\n if (frames === undefined) {\n return;\n }\n\n // Only hash the 10 most recent frames (ie. the last 10)\n return frames.slice(-10).reduce((acc, frame) => `${acc},${frame.function},${frame.lineno},${frame.colno}`, '');\n}\n\n/**\n * We use the stack parser to create a unique hash from the exception stack trace\n * This is used to lookup vars when the exception passes through the event processor\n */\nfunction hashFromStack(stackParser, stack) {\n if (stack === undefined) {\n return undefined;\n }\n\n return hashFrames(stackParser(stack, 1));\n}\n\nexport { createRateLimiter, functionNamesMatch, hashFrames, hashFromStack, isAnonymous };\n//# sourceMappingURL=common.js.map\n"],"names":[],"mappings":"AAQA,SAAS,kBACP,cACA,QACA,SACA;AACA,MAAI,QAAQ;AACZ,MAAI,eAAe;AACnB,MAAI,kBAAkB;AAEtB,cAAY,MAAM;AAChB,QAAI,oBAAoB,GAAG;AACzB,UAAI,QAAQ,cAAc;AACxB,wBAAgB;AAChB,gBAAQ,YAAY;AAGpB,YAAI,eAAe,OAAO;AACxB,yBAAe;AAAA,QACjB;AACA,0BAAkB;AAAA,MACpB;AAAA,IACF,OAAO;AACL,yBAAmB;AAEnB,UAAI,oBAAoB,GAAG;AACzB,eAAM;AAAA,MACR;AAAA,IACF;AAEA,YAAQ;AAAA,EACV,GAAG,GAAI,EAAE,MAAK;AAEd,SAAO,MAAM;AACX,aAAS;AAAA,EACX;AACF;AAKA,SAAS,YAAY,MAAM;AACzB,SAAO,SAAS,WAAc,KAAK,WAAW,KAAK,SAAS,OAAO,SAAS;AAC9E;AAGA,SAAS,mBAAmB,GAAG,GAAG;AAChC,SAAO,MAAM,KAAM,YAAY,CAAC,KAAK,YAAY,CAAC;AACpD;AAGA,SAAS,WAAW,QAAQ;AAC1B,MAAI,WAAW,QAAW;AACxB;AAAA,EACF;AAGA,SAAO,OAAO,MAAM,GAAG,EAAE,OAAO,CAAC,KAAK,UAAU,GAAG,GAAG,IAAI,MAAM,QAAQ,IAAI,MAAM,MAAM,IAAI,MAAM,KAAK,IAAI,EAAE;AAC/G;AAMA,SAAS,cAAc,aAAa,OAAO;AACzC,MAAI,UAAU,QAAW;AACvB,WAAO;AAAA,EACT;AAEA,SAAO,WAAW,YAAY,OAAO,CAAC,CAAC;AACzC;","x_google_ignoreList":[0]}
|
package/dist/_node_modules/@sentry/node/esm/integrations/local-variables/local-variables-sync.cjs
CHANGED
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const nodeVersion = require("../../nodeVersion.cjs");
|
|
4
4
|
const common = require("./common.cjs");
|
|
5
5
|
const integration = require('./../../../_node_modules/@sentry/core/esm/integration.cjs');
|
|
6
|
+
const lru = require('./../../../_node_modules/@sentry/utils/esm/lru.cjs');
|
|
6
7
|
const exports$1 = require('./../../../_node_modules/@sentry/core/esm/exports.cjs');
|
|
7
8
|
const _optionalChain = require('./../../../_node_modules/@sentry/utils/esm/buildPolyfills/_optionalChain.cjs');
|
|
8
9
|
const logger = require('./../../../_node_modules/@sentry/utils/esm/logger.cjs');
|
|
9
|
-
const lru = require('./../../../_node_modules/@sentry/utils/esm/lru.cjs');
|
|
10
10
|
function createCallbackList(complete) {
|
|
11
11
|
let callbacks = [];
|
|
12
12
|
let completedCalled = false;
|