@sentry/node 9.35.0 → 9.36.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.js +38 -56
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/integrations/fs.js +2 -2
- package/build/cjs/integrations/fs.js.map +1 -1
- package/build/cjs/integrations/http/index.js +7 -11
- package/build/cjs/integrations/http/index.js.map +1 -1
- package/build/cjs/integrations/node-fetch/index.js +4 -5
- package/build/cjs/integrations/node-fetch/index.js.map +1 -1
- package/build/cjs/integrations/tracing/amqplib.js +4 -5
- package/build/cjs/integrations/tracing/amqplib.js.map +1 -1
- package/build/cjs/integrations/tracing/connect.js +3 -4
- package/build/cjs/integrations/tracing/connect.js.map +1 -1
- package/build/cjs/integrations/tracing/dataloader.js +3 -3
- package/build/cjs/integrations/tracing/dataloader.js.map +1 -1
- package/build/cjs/integrations/tracing/express.js +5 -7
- package/build/cjs/integrations/tracing/express.js.map +1 -1
- package/build/cjs/integrations/tracing/fastify/fastify-otel/index.js +3 -3
- package/build/cjs/integrations/tracing/fastify/fastify-otel/index.js.map +1 -1
- package/build/cjs/integrations/tracing/fastify/index.js +6 -6
- package/build/cjs/integrations/tracing/fastify/index.js.map +1 -1
- package/build/cjs/integrations/tracing/genericPool.js +3 -3
- package/build/cjs/integrations/tracing/genericPool.js.map +1 -1
- package/build/cjs/integrations/tracing/graphql.js +3 -4
- package/build/cjs/integrations/tracing/graphql.js.map +1 -1
- package/build/cjs/integrations/tracing/hapi/index.js +3 -4
- package/build/cjs/integrations/tracing/hapi/index.js.map +1 -1
- package/build/cjs/integrations/tracing/kafka.js +4 -5
- package/build/cjs/integrations/tracing/kafka.js.map +1 -1
- package/build/cjs/integrations/tracing/knex.js +3 -3
- package/build/cjs/integrations/tracing/knex.js.map +1 -1
- package/build/cjs/integrations/tracing/koa.js +4 -6
- package/build/cjs/integrations/tracing/koa.js.map +1 -1
- package/build/cjs/integrations/tracing/lrumemoizer.js +2 -2
- package/build/cjs/integrations/tracing/lrumemoizer.js.map +1 -1
- package/build/cjs/integrations/tracing/mongo.js +3 -4
- package/build/cjs/integrations/tracing/mongo.js.map +1 -1
- package/build/cjs/integrations/tracing/mongoose.js +3 -4
- package/build/cjs/integrations/tracing/mongoose.js.map +1 -1
- package/build/cjs/integrations/tracing/mysql.js +2 -2
- package/build/cjs/integrations/tracing/mysql.js.map +1 -1
- package/build/cjs/integrations/tracing/mysql2.js +3 -4
- package/build/cjs/integrations/tracing/mysql2.js.map +1 -1
- package/build/cjs/integrations/tracing/postgres.js +3 -4
- package/build/cjs/integrations/tracing/postgres.js.map +1 -1
- package/build/cjs/integrations/tracing/postgresjs.js +3 -4
- package/build/cjs/integrations/tracing/postgresjs.js.map +1 -1
- package/build/cjs/integrations/tracing/prisma.js +2 -2
- package/build/cjs/integrations/tracing/prisma.js.map +1 -1
- package/build/cjs/integrations/tracing/redis.js +3 -3
- package/build/cjs/integrations/tracing/redis.js.map +1 -1
- package/build/cjs/integrations/tracing/tedious.js +3 -3
- package/build/cjs/integrations/tracing/tedious.js.map +1 -1
- package/build/cjs/integrations/tracing/vercelai/index.js +2 -2
- package/build/cjs/integrations/tracing/vercelai/index.js.map +1 -1
- package/build/cjs/preload.js +2 -2
- package/build/cjs/preload.js.map +1 -1
- package/build/cjs/sdk/index.js +22 -203
- package/build/cjs/sdk/index.js.map +1 -1
- package/build/cjs/sdk/initOtel.js +4 -22
- package/build/cjs/sdk/initOtel.js.map +1 -1
- package/build/esm/index.js +2 -21
- package/build/esm/index.js.map +1 -1
- package/build/esm/integrations/fs.js +1 -1
- package/build/esm/integrations/fs.js.map +1 -1
- package/build/esm/integrations/http/index.js +1 -5
- package/build/esm/integrations/http/index.js.map +1 -1
- package/build/esm/integrations/node-fetch/index.js +2 -3
- package/build/esm/integrations/node-fetch/index.js.map +1 -1
- package/build/esm/integrations/tracing/amqplib.js +1 -2
- package/build/esm/integrations/tracing/amqplib.js.map +1 -1
- package/build/esm/integrations/tracing/connect.js +1 -2
- package/build/esm/integrations/tracing/connect.js.map +1 -1
- package/build/esm/integrations/tracing/dataloader.js +1 -1
- package/build/esm/integrations/tracing/dataloader.js.map +1 -1
- package/build/esm/integrations/tracing/express.js +2 -4
- package/build/esm/integrations/tracing/express.js.map +1 -1
- package/build/esm/integrations/tracing/fastify/fastify-otel/index.js +3 -3
- package/build/esm/integrations/tracing/fastify/fastify-otel/index.js.map +1 -1
- package/build/esm/integrations/tracing/fastify/index.js +5 -5
- package/build/esm/integrations/tracing/fastify/index.js.map +1 -1
- package/build/esm/integrations/tracing/genericPool.js +1 -1
- package/build/esm/integrations/tracing/genericPool.js.map +1 -1
- package/build/esm/integrations/tracing/graphql.js +2 -3
- package/build/esm/integrations/tracing/graphql.js.map +1 -1
- package/build/esm/integrations/tracing/hapi/index.js +1 -2
- package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
- package/build/esm/integrations/tracing/kafka.js +1 -2
- package/build/esm/integrations/tracing/kafka.js.map +1 -1
- package/build/esm/integrations/tracing/knex.js +1 -1
- package/build/esm/integrations/tracing/knex.js.map +1 -1
- package/build/esm/integrations/tracing/koa.js +2 -4
- package/build/esm/integrations/tracing/koa.js.map +1 -1
- package/build/esm/integrations/tracing/lrumemoizer.js +1 -1
- package/build/esm/integrations/tracing/lrumemoizer.js.map +1 -1
- package/build/esm/integrations/tracing/mongo.js +1 -2
- package/build/esm/integrations/tracing/mongo.js.map +1 -1
- package/build/esm/integrations/tracing/mongoose.js +1 -2
- package/build/esm/integrations/tracing/mongoose.js.map +1 -1
- package/build/esm/integrations/tracing/mysql.js +1 -1
- package/build/esm/integrations/tracing/mysql.js.map +1 -1
- package/build/esm/integrations/tracing/mysql2.js +1 -2
- package/build/esm/integrations/tracing/mysql2.js.map +1 -1
- package/build/esm/integrations/tracing/postgres.js +1 -2
- package/build/esm/integrations/tracing/postgres.js.map +1 -1
- package/build/esm/integrations/tracing/postgresjs.js +2 -3
- package/build/esm/integrations/tracing/postgresjs.js.map +1 -1
- package/build/esm/integrations/tracing/prisma.js +1 -1
- package/build/esm/integrations/tracing/prisma.js.map +1 -1
- package/build/esm/integrations/tracing/redis.js +1 -1
- package/build/esm/integrations/tracing/redis.js.map +1 -1
- package/build/esm/integrations/tracing/tedious.js +1 -1
- package/build/esm/integrations/tracing/tedious.js.map +1 -1
- package/build/esm/integrations/tracing/vercelai/index.js +1 -1
- package/build/esm/integrations/tracing/vercelai/index.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/preload.js +1 -1
- package/build/esm/preload.js.map +1 -1
- package/build/esm/sdk/index.js +22 -202
- package/build/esm/sdk/index.js.map +1 -1
- package/build/esm/sdk/initOtel.js +3 -21
- package/build/esm/sdk/initOtel.js.map +1 -1
- package/build/types/index.d.ts +2 -21
- package/build/types/index.d.ts.map +1 -1
- package/build/types/integrations/http/index.d.ts +1 -1
- package/build/types/integrations/http/index.d.ts.map +1 -1
- package/build/types/integrations/node-fetch/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/amqplib.d.ts.map +1 -1
- package/build/types/integrations/tracing/connect.d.ts.map +1 -1
- package/build/types/integrations/tracing/express.d.ts.map +1 -1
- package/build/types/integrations/tracing/graphql.d.ts.map +1 -1
- package/build/types/integrations/tracing/hapi/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/kafka.d.ts.map +1 -1
- package/build/types/integrations/tracing/koa.d.ts.map +1 -1
- package/build/types/integrations/tracing/mongo.d.ts.map +1 -1
- package/build/types/integrations/tracing/mongoose.d.ts.map +1 -1
- package/build/types/integrations/tracing/mysql2.d.ts.map +1 -1
- package/build/types/integrations/tracing/postgres.d.ts.map +1 -1
- package/build/types/integrations/tracing/postgresjs.d.ts.map +1 -1
- package/build/types/integrations/tracing/vercelai/index.d.ts.map +1 -1
- package/build/types/sdk/index.d.ts +2 -6
- package/build/types/sdk/index.d.ts.map +1 -1
- package/build/types/sdk/initOtel.d.ts +1 -1
- package/build/types/sdk/initOtel.d.ts.map +1 -1
- package/build/types/types.d.ts +1 -1
- package/build/types/types.d.ts.map +1 -1
- package/build/types-ts3.8/index.d.ts +2 -21
- package/build/types-ts3.8/integrations/http/index.d.ts +1 -1
- package/build/types-ts3.8/sdk/index.d.ts +2 -6
- package/build/types-ts3.8/sdk/initOtel.d.ts +1 -1
- package/build/types-ts3.8/types.d.ts +1 -1
- package/package.json +4 -3
- package/build/cjs/cron/common.js +0 -56
- package/build/cjs/cron/common.js.map +0 -1
- package/build/cjs/cron/cron.js +0 -112
- package/build/cjs/cron/cron.js.map +0 -1
- package/build/cjs/cron/index.js +0 -15
- package/build/cjs/cron/index.js.map +0 -1
- package/build/cjs/cron/node-cron.js +0 -71
- package/build/cjs/cron/node-cron.js.map +0 -1
- package/build/cjs/cron/node-schedule.js +0 -65
- package/build/cjs/cron/node-schedule.js.map +0 -1
- package/build/cjs/integrations/anr/index.js +0 -238
- package/build/cjs/integrations/anr/index.js.map +0 -1
- package/build/cjs/integrations/childProcess.js +0 -100
- package/build/cjs/integrations/childProcess.js.map +0 -1
- package/build/cjs/integrations/context.js +0 -457
- package/build/cjs/integrations/context.js.map +0 -1
- package/build/cjs/integrations/contextlines.js +0 -405
- package/build/cjs/integrations/contextlines.js.map +0 -1
- package/build/cjs/integrations/http/SentryHttpInstrumentation.js +0 -558
- package/build/cjs/integrations/http/SentryHttpInstrumentation.js.map +0 -1
- package/build/cjs/integrations/local-variables/common.js +0 -69
- package/build/cjs/integrations/local-variables/common.js.map +0 -1
- package/build/cjs/integrations/local-variables/index.js +0 -12
- package/build/cjs/integrations/local-variables/index.js.map +0 -1
- package/build/cjs/integrations/local-variables/local-variables-async.js +0 -143
- package/build/cjs/integrations/local-variables/local-variables-async.js.map +0 -1
- package/build/cjs/integrations/local-variables/local-variables-sync.js +0 -410
- package/build/cjs/integrations/local-variables/local-variables-sync.js.map +0 -1
- package/build/cjs/integrations/modules.js +0 -135
- package/build/cjs/integrations/modules.js.map +0 -1
- package/build/cjs/integrations/node-fetch/SentryNodeFetchInstrumentation.js +0 -291
- package/build/cjs/integrations/node-fetch/SentryNodeFetchInstrumentation.js.map +0 -1
- package/build/cjs/integrations/onuncaughtexception.js +0 -134
- package/build/cjs/integrations/onuncaughtexception.js.map +0 -1
- package/build/cjs/integrations/onunhandledrejection.js +0 -89
- package/build/cjs/integrations/onunhandledrejection.js.map +0 -1
- package/build/cjs/integrations/processSession.js +0 -36
- package/build/cjs/integrations/processSession.js.map +0 -1
- package/build/cjs/integrations/spotlight.js +0 -101
- package/build/cjs/integrations/spotlight.js.map +0 -1
- package/build/cjs/integrations/winston.js +0 -151
- package/build/cjs/integrations/winston.js.map +0 -1
- package/build/cjs/logs/capture.js +0 -29
- package/build/cjs/logs/capture.js.map +0 -1
- package/build/cjs/logs/exports.js +0 -178
- package/build/cjs/logs/exports.js.map +0 -1
- package/build/cjs/nodeVersion.js +0 -12
- package/build/cjs/nodeVersion.js.map +0 -1
- package/build/cjs/otel/contextManager.js +0 -16
- package/build/cjs/otel/contextManager.js.map +0 -1
- package/build/cjs/otel/instrument.js +0 -139
- package/build/cjs/otel/instrument.js.map +0 -1
- package/build/cjs/proxy/base.js +0 -122
- package/build/cjs/proxy/base.js.map +0 -1
- package/build/cjs/proxy/index.js +0 -173
- package/build/cjs/proxy/index.js.map +0 -1
- package/build/cjs/proxy/parse-proxy-response.js +0 -104
- package/build/cjs/proxy/parse-proxy-response.js.map +0 -1
- package/build/cjs/sdk/api.js +0 -117
- package/build/cjs/sdk/api.js.map +0 -1
- package/build/cjs/sdk/client.js +0 -156
- package/build/cjs/sdk/client.js.map +0 -1
- package/build/cjs/transports/http.js +0 -158
- package/build/cjs/transports/http.js.map +0 -1
- package/build/cjs/utils/addOriginToSpan.js +0 -11
- package/build/cjs/utils/addOriginToSpan.js.map +0 -1
- package/build/cjs/utils/baggage.js +0 -36
- package/build/cjs/utils/baggage.js.map +0 -1
- package/build/cjs/utils/commonjs.js +0 -13
- package/build/cjs/utils/commonjs.js.map +0 -1
- package/build/cjs/utils/createMissingInstrumentationContext.js +0 -11
- package/build/cjs/utils/createMissingInstrumentationContext.js.map +0 -1
- package/build/cjs/utils/debug.js +0 -23
- package/build/cjs/utils/debug.js.map +0 -1
- package/build/cjs/utils/ensureIsWrapped.js +0 -41
- package/build/cjs/utils/ensureIsWrapped.js.map +0 -1
- package/build/cjs/utils/envToBool.js +0 -32
- package/build/cjs/utils/envToBool.js.map +0 -1
- package/build/cjs/utils/errorhandling.js +0 -42
- package/build/cjs/utils/errorhandling.js.map +0 -1
- package/build/cjs/utils/getRequestUrl.js +0 -18
- package/build/cjs/utils/getRequestUrl.js.map +0 -1
- package/build/cjs/utils/module.js +0 -60
- package/build/cjs/utils/module.js.map +0 -1
- package/build/esm/cron/common.js +0 -54
- package/build/esm/cron/common.js.map +0 -1
- package/build/esm/cron/cron.js +0 -110
- package/build/esm/cron/cron.js.map +0 -1
- package/build/esm/cron/index.js +0 -13
- package/build/esm/cron/index.js.map +0 -1
- package/build/esm/cron/node-cron.js +0 -69
- package/build/esm/cron/node-cron.js.map +0 -1
- package/build/esm/cron/node-schedule.js +0 -63
- package/build/esm/cron/node-schedule.js.map +0 -1
- package/build/esm/integrations/anr/index.js +0 -234
- package/build/esm/integrations/anr/index.js.map +0 -1
- package/build/esm/integrations/anr/worker-script.js +0 -2
- package/build/esm/integrations/childProcess.js +0 -98
- package/build/esm/integrations/childProcess.js.map +0 -1
- package/build/esm/integrations/context.js +0 -451
- package/build/esm/integrations/context.js.map +0 -1
- package/build/esm/integrations/contextlines.js +0 -399
- package/build/esm/integrations/contextlines.js.map +0 -1
- package/build/esm/integrations/http/SentryHttpInstrumentation.js +0 -555
- package/build/esm/integrations/http/SentryHttpInstrumentation.js.map +0 -1
- package/build/esm/integrations/local-variables/common.js +0 -64
- package/build/esm/integrations/local-variables/common.js.map +0 -1
- package/build/esm/integrations/local-variables/index.js +0 -10
- package/build/esm/integrations/local-variables/index.js.map +0 -1
- package/build/esm/integrations/local-variables/local-variables-async.js +0 -140
- package/build/esm/integrations/local-variables/local-variables-async.js.map +0 -1
- package/build/esm/integrations/local-variables/local-variables-sync.js +0 -405
- package/build/esm/integrations/local-variables/local-variables-sync.js.map +0 -1
- package/build/esm/integrations/local-variables/worker-script.js +0 -2
- package/build/esm/integrations/modules.js +0 -133
- package/build/esm/integrations/modules.js.map +0 -1
- package/build/esm/integrations/node-fetch/SentryNodeFetchInstrumentation.js +0 -289
- package/build/esm/integrations/node-fetch/SentryNodeFetchInstrumentation.js.map +0 -1
- package/build/esm/integrations/onuncaughtexception.js +0 -131
- package/build/esm/integrations/onuncaughtexception.js.map +0 -1
- package/build/esm/integrations/onunhandledrejection.js +0 -86
- package/build/esm/integrations/onunhandledrejection.js.map +0 -1
- package/build/esm/integrations/processSession.js +0 -34
- package/build/esm/integrations/processSession.js.map +0 -1
- package/build/esm/integrations/spotlight.js +0 -98
- package/build/esm/integrations/spotlight.js.map +0 -1
- package/build/esm/integrations/winston.js +0 -149
- package/build/esm/integrations/winston.js.map +0 -1
- package/build/esm/logs/capture.js +0 -27
- package/build/esm/logs/capture.js.map +0 -1
- package/build/esm/logs/exports.js +0 -170
- package/build/esm/logs/exports.js.map +0 -1
- package/build/esm/nodeVersion.js +0 -8
- package/build/esm/nodeVersion.js.map +0 -1
- package/build/esm/otel/contextManager.js +0 -14
- package/build/esm/otel/contextManager.js.map +0 -1
- package/build/esm/otel/instrument.js +0 -135
- package/build/esm/otel/instrument.js.map +0 -1
- package/build/esm/proxy/base.js +0 -120
- package/build/esm/proxy/base.js.map +0 -1
- package/build/esm/proxy/index.js +0 -171
- package/build/esm/proxy/index.js.map +0 -1
- package/build/esm/proxy/parse-proxy-response.js +0 -102
- package/build/esm/proxy/parse-proxy-response.js.map +0 -1
- package/build/esm/sdk/api.js +0 -114
- package/build/esm/sdk/api.js.map +0 -1
- package/build/esm/sdk/client.js +0 -154
- package/build/esm/sdk/client.js.map +0 -1
- package/build/esm/transports/http.js +0 -156
- package/build/esm/transports/http.js.map +0 -1
- package/build/esm/utils/addOriginToSpan.js +0 -9
- package/build/esm/utils/addOriginToSpan.js.map +0 -1
- package/build/esm/utils/baggage.js +0 -34
- package/build/esm/utils/baggage.js.map +0 -1
- package/build/esm/utils/commonjs.js +0 -11
- package/build/esm/utils/commonjs.js.map +0 -1
- package/build/esm/utils/createMissingInstrumentationContext.js +0 -9
- package/build/esm/utils/createMissingInstrumentationContext.js.map +0 -1
- package/build/esm/utils/debug.js +0 -21
- package/build/esm/utils/debug.js.map +0 -1
- package/build/esm/utils/ensureIsWrapped.js +0 -39
- package/build/esm/utils/ensureIsWrapped.js.map +0 -1
- package/build/esm/utils/envToBool.js +0 -28
- package/build/esm/utils/envToBool.js.map +0 -1
- package/build/esm/utils/errorhandling.js +0 -40
- package/build/esm/utils/errorhandling.js.map +0 -1
- package/build/esm/utils/getRequestUrl.js +0 -16
- package/build/esm/utils/getRequestUrl.js.map +0 -1
- package/build/esm/utils/module.js +0 -58
- package/build/esm/utils/module.js.map +0 -1
- package/build/types/cron/common.d.ts +0 -5
- package/build/types/cron/common.d.ts.map +0 -1
- package/build/types/cron/cron.d.ts +0 -43
- package/build/types/cron/cron.d.ts.map +0 -1
- package/build/types/cron/index.d.ts +0 -10
- package/build/types/cron/index.d.ts.map +0 -1
- package/build/types/cron/node-cron.d.ts +0 -27
- package/build/types/cron/node-cron.d.ts.map +0 -1
- package/build/types/cron/node-schedule.d.ts +0 -19
- package/build/types/cron/node-schedule.d.ts.map +0 -1
- package/build/types/integrations/anr/common.d.ts +0 -52
- package/build/types/integrations/anr/common.d.ts.map +0 -1
- package/build/types/integrations/anr/index.d.ts +0 -13
- package/build/types/integrations/anr/index.d.ts.map +0 -1
- package/build/types/integrations/anr/worker.d.ts +0 -2
- package/build/types/integrations/anr/worker.d.ts.map +0 -1
- package/build/types/integrations/childProcess.d.ts +0 -20
- package/build/types/integrations/childProcess.d.ts.map +0 -1
- package/build/types/integrations/context.d.ts +0 -30
- package/build/types/integrations/context.d.ts.map +0 -1
- package/build/types/integrations/contextlines.d.ts +0 -31
- package/build/types/integrations/contextlines.d.ts.map +0 -1
- package/build/types/integrations/http/SentryHttpInstrumentation.d.ts +0 -131
- package/build/types/integrations/http/SentryHttpInstrumentation.d.ts.map +0 -1
- package/build/types/integrations/local-variables/common.d.ts +0 -66
- package/build/types/integrations/local-variables/common.d.ts.map +0 -1
- package/build/types/integrations/local-variables/index.d.ts +0 -4
- package/build/types/integrations/local-variables/index.d.ts.map +0 -1
- package/build/types/integrations/local-variables/local-variables-async.d.ts +0 -7
- package/build/types/integrations/local-variables/local-variables-async.d.ts.map +0 -1
- package/build/types/integrations/local-variables/local-variables-sync.d.ts +0 -34
- package/build/types/integrations/local-variables/local-variables-sync.d.ts.map +0 -1
- package/build/types/integrations/local-variables/worker.d.ts +0 -2
- package/build/types/integrations/local-variables/worker.d.ts.map +0 -1
- package/build/types/integrations/modules.d.ts +0 -17
- package/build/types/integrations/modules.d.ts.map +0 -1
- package/build/types/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts +0 -56
- package/build/types/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts.map +0 -1
- package/build/types/integrations/onuncaughtexception.d.ts +0 -31
- package/build/types/integrations/onuncaughtexception.d.ts.map +0 -1
- package/build/types/integrations/onunhandledrejection.d.ts +0 -23
- package/build/types/integrations/onunhandledrejection.d.ts.map +0 -1
- package/build/types/integrations/processSession.d.ts +0 -5
- package/build/types/integrations/processSession.d.ts.map +0 -1
- package/build/types/integrations/spotlight.d.ts +0 -18
- package/build/types/integrations/spotlight.d.ts.map +0 -1
- package/build/types/integrations/winston.d.ts +0 -44
- package/build/types/integrations/winston.d.ts.map +0 -1
- package/build/types/logs/capture.d.ts +0 -11
- package/build/types/logs/capture.d.ts.map +0 -1
- package/build/types/logs/exports.d.ts +0 -150
- package/build/types/logs/exports.d.ts.map +0 -1
- package/build/types/nodeVersion.d.ts +0 -8
- package/build/types/nodeVersion.d.ts.map +0 -1
- package/build/types/otel/contextManager.d.ts +0 -10
- package/build/types/otel/contextManager.d.ts.map +0 -1
- package/build/types/otel/instrument.d.ts +0 -23
- package/build/types/otel/instrument.d.ts.map +0 -1
- package/build/types/proxy/base.d.ts +0 -65
- package/build/types/proxy/base.d.ts.map +0 -1
- package/build/types/proxy/helpers.d.ts +0 -42
- package/build/types/proxy/helpers.d.ts.map +0 -1
- package/build/types/proxy/index.d.ts +0 -73
- package/build/types/proxy/index.d.ts.map +0 -1
- package/build/types/proxy/parse-proxy-response.d.ts +0 -43
- package/build/types/proxy/parse-proxy-response.d.ts.map +0 -1
- package/build/types/sdk/api.d.ts +0 -8
- package/build/types/sdk/api.d.ts.map +0 -1
- package/build/types/sdk/client.d.ts +0 -29
- package/build/types/sdk/client.d.ts.map +0 -1
- package/build/types/sdk/scope.d.ts +0 -7
- package/build/types/sdk/scope.d.ts.map +0 -1
- package/build/types/transports/http-module.d.ts +0 -31
- package/build/types/transports/http-module.d.ts.map +0 -1
- package/build/types/transports/http.d.ts +0 -21
- package/build/types/transports/http.d.ts.map +0 -1
- package/build/types/transports/index.d.ts +0 -3
- package/build/types/transports/index.d.ts.map +0 -1
- package/build/types/utils/addOriginToSpan.d.ts +0 -5
- package/build/types/utils/addOriginToSpan.d.ts.map +0 -1
- package/build/types/utils/baggage.d.ts +0 -6
- package/build/types/utils/baggage.d.ts.map +0 -1
- package/build/types/utils/commonjs.d.ts +0 -3
- package/build/types/utils/commonjs.d.ts.map +0 -1
- package/build/types/utils/createMissingInstrumentationContext.d.ts +0 -3
- package/build/types/utils/createMissingInstrumentationContext.d.ts.map +0 -1
- package/build/types/utils/debug.d.ts +0 -5
- package/build/types/utils/debug.d.ts.map +0 -1
- package/build/types/utils/ensureIsWrapped.d.ts +0 -5
- package/build/types/utils/ensureIsWrapped.d.ts.map +0 -1
- package/build/types/utils/entry-point.d.ts +0 -24
- package/build/types/utils/entry-point.d.ts.map +0 -1
- package/build/types/utils/envToBool.d.ts +0 -13
- package/build/types/utils/envToBool.d.ts.map +0 -1
- package/build/types/utils/errorhandling.d.ts +0 -5
- package/build/types/utils/errorhandling.d.ts.map +0 -1
- package/build/types/utils/getRequestUrl.d.ts +0 -5
- package/build/types/utils/getRequestUrl.d.ts.map +0 -1
- package/build/types/utils/module.d.ts +0 -3
- package/build/types/utils/module.d.ts.map +0 -1
- package/build/types/utils/prepareEvent.d.ts +0 -17
- package/build/types/utils/prepareEvent.d.ts.map +0 -1
- package/build/types-ts3.8/cron/common.d.ts +0 -5
- package/build/types-ts3.8/cron/cron.d.ts +0 -43
- package/build/types-ts3.8/cron/index.d.ts +0 -10
- package/build/types-ts3.8/cron/node-cron.d.ts +0 -27
- package/build/types-ts3.8/cron/node-schedule.d.ts +0 -19
- package/build/types-ts3.8/integrations/anr/common.d.ts +0 -52
- package/build/types-ts3.8/integrations/anr/index.d.ts +0 -13
- package/build/types-ts3.8/integrations/anr/worker.d.ts +0 -2
- package/build/types-ts3.8/integrations/childProcess.d.ts +0 -20
- package/build/types-ts3.8/integrations/context.d.ts +0 -30
- package/build/types-ts3.8/integrations/contextlines.d.ts +0 -31
- package/build/types-ts3.8/integrations/http/SentryHttpInstrumentation.d.ts +0 -133
- package/build/types-ts3.8/integrations/local-variables/common.d.ts +0 -66
- package/build/types-ts3.8/integrations/local-variables/index.d.ts +0 -4
- package/build/types-ts3.8/integrations/local-variables/local-variables-async.d.ts +0 -7
- package/build/types-ts3.8/integrations/local-variables/local-variables-sync.d.ts +0 -34
- package/build/types-ts3.8/integrations/local-variables/worker.d.ts +0 -2
- package/build/types-ts3.8/integrations/modules.d.ts +0 -17
- package/build/types-ts3.8/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts +0 -56
- package/build/types-ts3.8/integrations/onuncaughtexception.d.ts +0 -31
- package/build/types-ts3.8/integrations/onunhandledrejection.d.ts +0 -23
- package/build/types-ts3.8/integrations/processSession.d.ts +0 -5
- package/build/types-ts3.8/integrations/spotlight.d.ts +0 -18
- package/build/types-ts3.8/integrations/winston.d.ts +0 -44
- package/build/types-ts3.8/logs/capture.d.ts +0 -18
- package/build/types-ts3.8/logs/exports.d.ts +0 -150
- package/build/types-ts3.8/nodeVersion.d.ts +0 -8
- package/build/types-ts3.8/otel/contextManager.d.ts +0 -10
- package/build/types-ts3.8/otel/instrument.d.ts +0 -23
- package/build/types-ts3.8/proxy/base.d.ts +0 -60
- package/build/types-ts3.8/proxy/helpers.d.ts +0 -38
- package/build/types-ts3.8/proxy/index.d.ts +0 -74
- package/build/types-ts3.8/proxy/parse-proxy-response.d.ts +0 -40
- package/build/types-ts3.8/sdk/api.d.ts +0 -8
- package/build/types-ts3.8/sdk/client.d.ts +0 -32
- package/build/types-ts3.8/sdk/scope.d.ts +0 -7
- package/build/types-ts3.8/transports/http-module.d.ts +0 -28
- package/build/types-ts3.8/transports/http.d.ts +0 -20
- package/build/types-ts3.8/transports/index.d.ts +0 -3
- package/build/types-ts3.8/utils/addOriginToSpan.d.ts +0 -5
- package/build/types-ts3.8/utils/baggage.d.ts +0 -6
- package/build/types-ts3.8/utils/commonjs.d.ts +0 -3
- package/build/types-ts3.8/utils/createMissingInstrumentationContext.d.ts +0 -3
- package/build/types-ts3.8/utils/debug.d.ts +0 -5
- package/build/types-ts3.8/utils/ensureIsWrapped.d.ts +0 -5
- package/build/types-ts3.8/utils/entry-point.d.ts +0 -24
- package/build/types-ts3.8/utils/envToBool.d.ts +0 -13
- package/build/types-ts3.8/utils/errorhandling.d.ts +0 -5
- package/build/types-ts3.8/utils/getRequestUrl.d.ts +0 -5
- package/build/types-ts3.8/utils/module.d.ts +0 -3
- package/build/types-ts3.8/utils/prepareEvent.d.ts +0 -17
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
3
|
-
const capture = require('./capture.js');
|
|
4
|
-
const core = require('@sentry/core');
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @summary Capture a log with the `trace` level. Requires `_experiments.enableLogs` to be enabled.
|
|
8
|
-
*
|
|
9
|
-
* You can either pass a message and attributes or a message template, params and attributes.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
*
|
|
13
|
-
* ```
|
|
14
|
-
* Sentry.logger.trace('Starting database connection', {
|
|
15
|
-
* database: 'users',
|
|
16
|
-
* connectionId: 'conn_123'
|
|
17
|
-
* });
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* @example With template strings
|
|
21
|
-
*
|
|
22
|
-
* ```
|
|
23
|
-
* Sentry.logger.trace('Database connection %s established for %s',
|
|
24
|
-
* ['successful', 'users'],
|
|
25
|
-
* { connectionId: 'conn_123' }
|
|
26
|
-
* );
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
function trace(...args) {
|
|
30
|
-
capture.captureLog('trace', ...args);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* @summary Capture a log with the `debug` level. Requires `_experiments.enableLogs` to be enabled.
|
|
35
|
-
*
|
|
36
|
-
* You can either pass a message and attributes or a message template, params and attributes.
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
*
|
|
40
|
-
* ```
|
|
41
|
-
* Sentry.logger.debug('Cache miss for user profile', {
|
|
42
|
-
* userId: 'user_123',
|
|
43
|
-
* cacheKey: 'profile:user_123'
|
|
44
|
-
* });
|
|
45
|
-
* ```
|
|
46
|
-
*
|
|
47
|
-
* @example With template strings
|
|
48
|
-
*
|
|
49
|
-
* ```
|
|
50
|
-
* Sentry.logger.debug('Cache %s for %s: %s',
|
|
51
|
-
* ['miss', 'user profile', 'key not found'],
|
|
52
|
-
* { userId: 'user_123' }
|
|
53
|
-
* );
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
function debug(...args) {
|
|
57
|
-
capture.captureLog('debug', ...args);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* @summary Capture a log with the `info` level. Requires `_experiments.enableLogs` to be enabled.
|
|
62
|
-
*
|
|
63
|
-
* You can either pass a message and attributes or a message template, params and attributes.
|
|
64
|
-
*
|
|
65
|
-
* @example
|
|
66
|
-
*
|
|
67
|
-
* ```
|
|
68
|
-
* Sentry.logger.info('User profile updated', {
|
|
69
|
-
* userId: 'user_123',
|
|
70
|
-
* updatedFields: ['email', 'preferences']
|
|
71
|
-
* });
|
|
72
|
-
* ```
|
|
73
|
-
*
|
|
74
|
-
* @example With template strings
|
|
75
|
-
*
|
|
76
|
-
* ```
|
|
77
|
-
* Sentry.logger.info('User %s updated their %s',
|
|
78
|
-
* ['John Doe', 'profile settings'],
|
|
79
|
-
* { userId: 'user_123' }
|
|
80
|
-
* );
|
|
81
|
-
* ```
|
|
82
|
-
*/
|
|
83
|
-
function info(...args) {
|
|
84
|
-
capture.captureLog('info', ...args);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* @summary Capture a log with the `warn` level. Requires `_experiments.enableLogs` to be enabled.
|
|
89
|
-
*
|
|
90
|
-
* You can either pass a message and attributes or a message template, params and attributes.
|
|
91
|
-
*
|
|
92
|
-
* @example
|
|
93
|
-
*
|
|
94
|
-
* ```
|
|
95
|
-
* Sentry.logger.warn('Rate limit approaching', {
|
|
96
|
-
* endpoint: '/api/users',
|
|
97
|
-
* currentRate: '95/100',
|
|
98
|
-
* resetTime: '2024-03-20T10:00:00Z'
|
|
99
|
-
* });
|
|
100
|
-
* ```
|
|
101
|
-
*
|
|
102
|
-
* @example With template strings
|
|
103
|
-
*
|
|
104
|
-
* ```
|
|
105
|
-
* Sentry.logger.warn('Rate limit %s for %s: %s',
|
|
106
|
-
* ['approaching', '/api/users', '95/100 requests'],
|
|
107
|
-
* { resetTime: '2024-03-20T10:00:00Z' }
|
|
108
|
-
* );
|
|
109
|
-
* ```
|
|
110
|
-
*/
|
|
111
|
-
function warn(...args) {
|
|
112
|
-
capture.captureLog('warn', ...args);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* @summary Capture a log with the `error` level. Requires `_experiments.enableLogs` to be enabled.
|
|
117
|
-
*
|
|
118
|
-
* You can either pass a message and attributes or a message template, params and attributes.
|
|
119
|
-
*
|
|
120
|
-
* @example
|
|
121
|
-
*
|
|
122
|
-
* ```
|
|
123
|
-
* Sentry.logger.error('Failed to process payment', {
|
|
124
|
-
* orderId: 'order_123',
|
|
125
|
-
* errorCode: 'PAYMENT_FAILED',
|
|
126
|
-
* amount: 99.99
|
|
127
|
-
* });
|
|
128
|
-
* ```
|
|
129
|
-
*
|
|
130
|
-
* @example With template strings
|
|
131
|
-
*
|
|
132
|
-
* ```
|
|
133
|
-
* Sentry.logger.error('Payment processing failed for order %s: %s',
|
|
134
|
-
* ['order_123', 'insufficient funds'],
|
|
135
|
-
* { amount: 99.99 }
|
|
136
|
-
* );
|
|
137
|
-
* ```
|
|
138
|
-
*/
|
|
139
|
-
function error(...args) {
|
|
140
|
-
capture.captureLog('error', ...args);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* @summary Capture a log with the `fatal` level. Requires `_experiments.enableLogs` to be enabled.
|
|
145
|
-
*
|
|
146
|
-
* You can either pass a message and attributes or a message template, params and attributes.
|
|
147
|
-
*
|
|
148
|
-
* @example
|
|
149
|
-
*
|
|
150
|
-
* ```
|
|
151
|
-
* Sentry.logger.fatal('Database connection pool exhausted', {
|
|
152
|
-
* database: 'users',
|
|
153
|
-
* activeConnections: 100,
|
|
154
|
-
* maxConnections: 100
|
|
155
|
-
* });
|
|
156
|
-
* ```
|
|
157
|
-
*
|
|
158
|
-
* @example With template strings
|
|
159
|
-
*
|
|
160
|
-
* ```
|
|
161
|
-
* Sentry.logger.fatal('Database %s: %s connections active',
|
|
162
|
-
* ['connection pool exhausted', '100/100'],
|
|
163
|
-
* { database: 'users' }
|
|
164
|
-
* );
|
|
165
|
-
* ```
|
|
166
|
-
*/
|
|
167
|
-
function fatal(...args) {
|
|
168
|
-
capture.captureLog('fatal', ...args);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
exports.fmt = core.fmt;
|
|
172
|
-
exports.debug = debug;
|
|
173
|
-
exports.error = error;
|
|
174
|
-
exports.fatal = fatal;
|
|
175
|
-
exports.info = info;
|
|
176
|
-
exports.trace = trace;
|
|
177
|
-
exports.warn = warn;
|
|
178
|
-
//# sourceMappingURL=exports.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exports.js","sources":["../../../src/logs/exports.ts"],"sourcesContent":["import { type CaptureLogArgs, captureLog } from './capture';\n\n/**\n * @summary Capture a log with the `trace` level. Requires `_experiments.enableLogs` to be enabled.\n *\n * You can either pass a message and attributes or a message template, params and attributes.\n *\n * @example\n *\n * ```\n * Sentry.logger.trace('Starting database connection', {\n * database: 'users',\n * connectionId: 'conn_123'\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.trace('Database connection %s established for %s',\n * ['successful', 'users'],\n * { connectionId: 'conn_123' }\n * );\n * ```\n */\nexport function trace(...args: CaptureLogArgs): void {\n captureLog('trace', ...args);\n}\n\n/**\n * @summary Capture a log with the `debug` level. Requires `_experiments.enableLogs` to be enabled.\n *\n * You can either pass a message and attributes or a message template, params and attributes.\n *\n * @example\n *\n * ```\n * Sentry.logger.debug('Cache miss for user profile', {\n * userId: 'user_123',\n * cacheKey: 'profile:user_123'\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.debug('Cache %s for %s: %s',\n * ['miss', 'user profile', 'key not found'],\n * { userId: 'user_123' }\n * );\n * ```\n */\nexport function debug(...args: CaptureLogArgs): void {\n captureLog('debug', ...args);\n}\n\n/**\n * @summary Capture a log with the `info` level. Requires `_experiments.enableLogs` to be enabled.\n *\n * You can either pass a message and attributes or a message template, params and attributes.\n *\n * @example\n *\n * ```\n * Sentry.logger.info('User profile updated', {\n * userId: 'user_123',\n * updatedFields: ['email', 'preferences']\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.info('User %s updated their %s',\n * ['John Doe', 'profile settings'],\n * { userId: 'user_123' }\n * );\n * ```\n */\nexport function info(...args: CaptureLogArgs): void {\n captureLog('info', ...args);\n}\n\n/**\n * @summary Capture a log with the `warn` level. Requires `_experiments.enableLogs` to be enabled.\n *\n * You can either pass a message and attributes or a message template, params and attributes.\n *\n * @example\n *\n * ```\n * Sentry.logger.warn('Rate limit approaching', {\n * endpoint: '/api/users',\n * currentRate: '95/100',\n * resetTime: '2024-03-20T10:00:00Z'\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.warn('Rate limit %s for %s: %s',\n * ['approaching', '/api/users', '95/100 requests'],\n * { resetTime: '2024-03-20T10:00:00Z' }\n * );\n * ```\n */\nexport function warn(...args: CaptureLogArgs): void {\n captureLog('warn', ...args);\n}\n\n/**\n * @summary Capture a log with the `error` level. Requires `_experiments.enableLogs` to be enabled.\n *\n * You can either pass a message and attributes or a message template, params and attributes.\n *\n * @example\n *\n * ```\n * Sentry.logger.error('Failed to process payment', {\n * orderId: 'order_123',\n * errorCode: 'PAYMENT_FAILED',\n * amount: 99.99\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.error('Payment processing failed for order %s: %s',\n * ['order_123', 'insufficient funds'],\n * { amount: 99.99 }\n * );\n * ```\n */\nexport function error(...args: CaptureLogArgs): void {\n captureLog('error', ...args);\n}\n\n/**\n * @summary Capture a log with the `fatal` level. Requires `_experiments.enableLogs` to be enabled.\n *\n * You can either pass a message and attributes or a message template, params and attributes.\n *\n * @example\n *\n * ```\n * Sentry.logger.fatal('Database connection pool exhausted', {\n * database: 'users',\n * activeConnections: 100,\n * maxConnections: 100\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.fatal('Database %s: %s connections active',\n * ['connection pool exhausted', '100/100'],\n * { database: 'users' }\n * );\n * ```\n */\nexport function fatal(...args: CaptureLogArgs): void {\n captureLog('fatal', ...args);\n}\n\nexport { fmt } from '@sentry/core';\n"],"names":["captureLog"],"mappings":";;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,KAAK,CAAC,GAAG,IAAI,EAAwB;AACrD,EAAEA,kBAAU,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;AAC9B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,KAAK,CAAC,GAAG,IAAI,EAAwB;AACrD,EAAEA,kBAAU,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;AAC9B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,IAAI,CAAC,GAAG,IAAI,EAAwB;AACpD,EAAEA,kBAAU,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC;AAC7B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,IAAI,CAAC,GAAG,IAAI,EAAwB;AACpD,EAAEA,kBAAU,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC;AAC7B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,KAAK,CAAC,GAAG,IAAI,EAAwB;AACrD,EAAEA,kBAAU,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;AAC9B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,KAAK,CAAC,GAAG,IAAI,EAAwB;AACrD,EAAEA,kBAAU,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;AAC9B;;;;;;;;;;"}
|
package/build/cjs/nodeVersion.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
3
|
-
const core = require('@sentry/core');
|
|
4
|
-
|
|
5
|
-
const NODE_VERSION = core.parseSemver(process.versions.node) ;
|
|
6
|
-
const NODE_MAJOR = NODE_VERSION.major;
|
|
7
|
-
const NODE_MINOR = NODE_VERSION.minor;
|
|
8
|
-
|
|
9
|
-
exports.NODE_MAJOR = NODE_MAJOR;
|
|
10
|
-
exports.NODE_MINOR = NODE_MINOR;
|
|
11
|
-
exports.NODE_VERSION = NODE_VERSION;
|
|
12
|
-
//# sourceMappingURL=nodeVersion.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nodeVersion.js","sources":["../../src/nodeVersion.ts"],"sourcesContent":["import { parseSemver } from '@sentry/core';\n\nexport const NODE_VERSION = parseSemver(process.versions.node) as { major: number; minor: number; patch: number };\nexport const NODE_MAJOR = NODE_VERSION.major;\nexport const NODE_MINOR = NODE_VERSION.minor;\n"],"names":["parseSemver"],"mappings":";;;;AAEO,MAAM,YAAa,GAAEA,gBAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAE;AAClD,MAAA,UAAA,GAAa,YAAY,CAAC;AAC1B,MAAA,UAAA,GAAa,YAAY,CAAC;;;;;;"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
3
|
-
const contextAsyncHooks = require('@opentelemetry/context-async-hooks');
|
|
4
|
-
const opentelemetry = require('@sentry/opentelemetry');
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* This is a custom ContextManager for OpenTelemetry, which extends the default AsyncLocalStorageContextManager.
|
|
8
|
-
* It ensures that we create a new hub per context, so that the OTEL Context & the Sentry Scopes are always in sync.
|
|
9
|
-
*
|
|
10
|
-
* Note that we currently only support AsyncHooks with this,
|
|
11
|
-
* but since this should work for Node 14+ anyhow that should be good enough.
|
|
12
|
-
*/
|
|
13
|
-
const SentryContextManager = opentelemetry.wrapContextManagerClass(contextAsyncHooks.AsyncLocalStorageContextManager);
|
|
14
|
-
|
|
15
|
-
exports.SentryContextManager = SentryContextManager;
|
|
16
|
-
//# sourceMappingURL=contextManager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contextManager.js","sources":["../../../src/otel/contextManager.ts"],"sourcesContent":["import { AsyncLocalStorageContextManager } from '@opentelemetry/context-async-hooks';\nimport { wrapContextManagerClass } from '@sentry/opentelemetry';\n\n/**\n * This is a custom ContextManager for OpenTelemetry, which extends the default AsyncLocalStorageContextManager.\n * It ensures that we create a new hub per context, so that the OTEL Context & the Sentry Scopes are always in sync.\n *\n * Note that we currently only support AsyncHooks with this,\n * but since this should work for Node 14+ anyhow that should be good enough.\n */\nexport const SentryContextManager = wrapContextManagerClass(AsyncLocalStorageContextManager);\n"],"names":["wrapContextManagerClass","AsyncLocalStorageContextManager"],"mappings":";;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,oBAAqB,GAAEA,qCAAuB,CAACC,iDAA+B;;;;"}
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
3
|
-
const instrumentation = require('@opentelemetry/instrumentation');
|
|
4
|
-
|
|
5
|
-
/** Exported only for tests. */
|
|
6
|
-
const INSTRUMENTED = {};
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Instrument an OpenTelemetry instrumentation once.
|
|
10
|
-
* This will skip running instrumentation again if it was already instrumented.
|
|
11
|
-
*/
|
|
12
|
-
function generateInstrumentOnce(
|
|
13
|
-
name,
|
|
14
|
-
creatorOrClass,
|
|
15
|
-
optionsCallback,
|
|
16
|
-
) {
|
|
17
|
-
if (optionsCallback) {
|
|
18
|
-
return _generateInstrumentOnceWithOptions(
|
|
19
|
-
name,
|
|
20
|
-
creatorOrClass ,
|
|
21
|
-
optionsCallback,
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return _generateInstrumentOnce(name, creatorOrClass );
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// The plain version without handling of options
|
|
29
|
-
// Should not be used with custom options that are mutated in the creator!
|
|
30
|
-
function _generateInstrumentOnce(
|
|
31
|
-
name,
|
|
32
|
-
creator,
|
|
33
|
-
) {
|
|
34
|
-
return Object.assign(
|
|
35
|
-
(options) => {
|
|
36
|
-
const instrumented = INSTRUMENTED[name] ;
|
|
37
|
-
if (instrumented) {
|
|
38
|
-
// If options are provided, ensure we update them
|
|
39
|
-
if (options) {
|
|
40
|
-
instrumented.setConfig(options);
|
|
41
|
-
}
|
|
42
|
-
return instrumented;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const instrumentation$1 = creator(options);
|
|
46
|
-
INSTRUMENTED[name] = instrumentation$1;
|
|
47
|
-
|
|
48
|
-
instrumentation.registerInstrumentations({
|
|
49
|
-
instrumentations: [instrumentation$1],
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
return instrumentation$1;
|
|
53
|
-
},
|
|
54
|
-
{ id: name },
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// This version handles options properly
|
|
59
|
-
function _generateInstrumentOnceWithOptions
|
|
60
|
-
|
|
61
|
-
(
|
|
62
|
-
name,
|
|
63
|
-
instrumentationClass,
|
|
64
|
-
optionsCallback,
|
|
65
|
-
) {
|
|
66
|
-
return Object.assign(
|
|
67
|
-
(_options) => {
|
|
68
|
-
const options = optionsCallback(_options);
|
|
69
|
-
|
|
70
|
-
const instrumented = INSTRUMENTED[name] ;
|
|
71
|
-
if (instrumented) {
|
|
72
|
-
// Ensure we update options
|
|
73
|
-
instrumented.setConfig(options);
|
|
74
|
-
return instrumented;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const instrumentation$1 = new instrumentationClass(options) ;
|
|
78
|
-
INSTRUMENTED[name] = instrumentation$1;
|
|
79
|
-
|
|
80
|
-
instrumentation.registerInstrumentations({
|
|
81
|
-
instrumentations: [instrumentation$1],
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
return instrumentation$1;
|
|
85
|
-
},
|
|
86
|
-
{ id: name },
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Ensure a given callback is called when the instrumentation is actually wrapping something.
|
|
92
|
-
* This can be used to ensure some logic is only called when the instrumentation is actually active.
|
|
93
|
-
*
|
|
94
|
-
* This function returns a function that can be invoked with a callback.
|
|
95
|
-
* This callback will either be invoked immediately
|
|
96
|
-
* (e.g. if the instrumentation was already wrapped, or if _wrap could not be patched),
|
|
97
|
-
* or once the instrumentation is actually wrapping something.
|
|
98
|
-
*
|
|
99
|
-
* Make sure to call this function right after adding the instrumentation, otherwise it may be too late!
|
|
100
|
-
* The returned callback can be used any time, and also multiple times.
|
|
101
|
-
*/
|
|
102
|
-
function instrumentWhenWrapped(instrumentation) {
|
|
103
|
-
let isWrapped = false;
|
|
104
|
-
let callbacks = [];
|
|
105
|
-
|
|
106
|
-
if (!hasWrap(instrumentation)) {
|
|
107
|
-
isWrapped = true;
|
|
108
|
-
} else {
|
|
109
|
-
const originalWrap = instrumentation['_wrap'];
|
|
110
|
-
|
|
111
|
-
instrumentation['_wrap'] = (...args) => {
|
|
112
|
-
isWrapped = true;
|
|
113
|
-
callbacks.forEach(callback => callback());
|
|
114
|
-
callbacks = [];
|
|
115
|
-
return originalWrap(...args);
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
const registerCallback = (callback) => {
|
|
120
|
-
if (isWrapped) {
|
|
121
|
-
callback();
|
|
122
|
-
} else {
|
|
123
|
-
callbacks.push(callback);
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
return registerCallback;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
function hasWrap(
|
|
131
|
-
instrumentation,
|
|
132
|
-
) {
|
|
133
|
-
return typeof (instrumentation )['_wrap'] === 'function';
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
exports.INSTRUMENTED = INSTRUMENTED;
|
|
137
|
-
exports.generateInstrumentOnce = generateInstrumentOnce;
|
|
138
|
-
exports.instrumentWhenWrapped = instrumentWhenWrapped;
|
|
139
|
-
//# sourceMappingURL=instrument.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"instrument.js","sources":["../../../src/otel/instrument.ts"],"sourcesContent":["import { type Instrumentation, registerInstrumentations } from '@opentelemetry/instrumentation';\n\n/** Exported only for tests. */\nexport const INSTRUMENTED: Record<string, Instrumentation> = {};\n\nexport function generateInstrumentOnce<\n Options,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n InstrumentationClass extends new (...args: any[]) => Instrumentation,\n>(\n name: string,\n instrumentationClass: InstrumentationClass,\n optionsCallback: (options: Options) => ConstructorParameters<InstrumentationClass>[0],\n): ((options: Options) => InstanceType<InstrumentationClass>) & { id: string };\nexport function generateInstrumentOnce<\n Options = unknown,\n InstrumentationInstance extends Instrumentation = Instrumentation,\n>(\n name: string,\n creator: (options?: Options) => InstrumentationInstance,\n): ((options?: Options) => InstrumentationInstance) & { id: string };\n/**\n * Instrument an OpenTelemetry instrumentation once.\n * This will skip running instrumentation again if it was already instrumented.\n */\nexport function generateInstrumentOnce<Options>(\n name: string,\n creatorOrClass: (new (...args: any[]) => Instrumentation) | ((options?: Options) => Instrumentation),\n optionsCallback?: (options: Options) => unknown,\n): ((options: Options) => Instrumentation) & { id: string } {\n if (optionsCallback) {\n return _generateInstrumentOnceWithOptions(\n name,\n creatorOrClass as new (...args: unknown[]) => Instrumentation,\n optionsCallback,\n );\n }\n\n return _generateInstrumentOnce(name, creatorOrClass as (options?: Options) => Instrumentation);\n}\n\n// The plain version without handling of options\n// Should not be used with custom options that are mutated in the creator!\nfunction _generateInstrumentOnce<Options = unknown, InstrumentationInstance extends Instrumentation = Instrumentation>(\n name: string,\n creator: (options?: Options) => InstrumentationInstance,\n): ((options?: Options) => InstrumentationInstance) & { id: string } {\n return Object.assign(\n (options?: Options) => {\n const instrumented = INSTRUMENTED[name] as InstrumentationInstance | undefined;\n if (instrumented) {\n // If options are provided, ensure we update them\n if (options) {\n instrumented.setConfig(options);\n }\n return instrumented;\n }\n\n const instrumentation = creator(options);\n INSTRUMENTED[name] = instrumentation;\n\n registerInstrumentations({\n instrumentations: [instrumentation],\n });\n\n return instrumentation;\n },\n { id: name },\n );\n}\n\n// This version handles options properly\nfunction _generateInstrumentOnceWithOptions<\n Options,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n InstrumentationClass extends new (...args: any[]) => Instrumentation,\n>(\n name: string,\n instrumentationClass: InstrumentationClass,\n optionsCallback: (options: Options) => ConstructorParameters<InstrumentationClass>[0],\n): ((options: Options) => InstanceType<InstrumentationClass>) & { id: string } {\n return Object.assign(\n (_options: Options) => {\n const options = optionsCallback(_options);\n\n const instrumented = INSTRUMENTED[name] as InstanceType<InstrumentationClass> | undefined;\n if (instrumented) {\n // Ensure we update options\n instrumented.setConfig(options);\n return instrumented;\n }\n\n const instrumentation = new instrumentationClass(options) as InstanceType<InstrumentationClass>;\n INSTRUMENTED[name] = instrumentation;\n\n registerInstrumentations({\n instrumentations: [instrumentation],\n });\n\n return instrumentation;\n },\n { id: name },\n );\n}\n\n/**\n * Ensure a given callback is called when the instrumentation is actually wrapping something.\n * This can be used to ensure some logic is only called when the instrumentation is actually active.\n *\n * This function returns a function that can be invoked with a callback.\n * This callback will either be invoked immediately\n * (e.g. if the instrumentation was already wrapped, or if _wrap could not be patched),\n * or once the instrumentation is actually wrapping something.\n *\n * Make sure to call this function right after adding the instrumentation, otherwise it may be too late!\n * The returned callback can be used any time, and also multiple times.\n */\nexport function instrumentWhenWrapped<T extends Instrumentation>(instrumentation: T): (callback: () => void) => void {\n let isWrapped = false;\n let callbacks: (() => void)[] = [];\n\n if (!hasWrap(instrumentation)) {\n isWrapped = true;\n } else {\n const originalWrap = instrumentation['_wrap'];\n\n instrumentation['_wrap'] = (...args: Parameters<typeof originalWrap>) => {\n isWrapped = true;\n callbacks.forEach(callback => callback());\n callbacks = [];\n return originalWrap(...args);\n };\n }\n\n const registerCallback = (callback: () => void): void => {\n if (isWrapped) {\n callback();\n } else {\n callbacks.push(callback);\n }\n };\n\n return registerCallback;\n}\n\nfunction hasWrap<T extends Instrumentation>(\n instrumentation: T,\n): instrumentation is T & { _wrap: (...args: unknown[]) => unknown } {\n return typeof (instrumentation as T & { _wrap?: (...args: unknown[]) => unknown })['_wrap'] === 'function';\n}\n"],"names":["instrumentation","registerInstrumentations"],"mappings":"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"}
|
package/build/cjs/proxy/base.js
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
3
|
-
const http = require('node:http');
|
|
4
|
-
require('node:https');
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* This code was originally forked from https://github.com/TooTallNate/proxy-agents/tree/b133295fd16f6475578b6b15bd9b4e33ecb0d0b7
|
|
8
|
-
* With the following LICENSE:
|
|
9
|
-
*
|
|
10
|
-
* (The MIT License)
|
|
11
|
-
*
|
|
12
|
-
* Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>*
|
|
13
|
-
*
|
|
14
|
-
* Permission is hereby granted, free of charge, to any person obtaining
|
|
15
|
-
* a copy of this software and associated documentation files (the
|
|
16
|
-
* 'Software'), to deal in the Software without restriction, including
|
|
17
|
-
* without limitation the rights to use, copy, modify, merge, publish,
|
|
18
|
-
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
19
|
-
* permit persons to whom the Software is furnished to do so, subject to
|
|
20
|
-
* the following conditions:*
|
|
21
|
-
*
|
|
22
|
-
* The above copyright notice and this permission notice shall be
|
|
23
|
-
* included in all copies or substantial portions of the Software.*
|
|
24
|
-
*
|
|
25
|
-
* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
26
|
-
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
27
|
-
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
28
|
-
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
29
|
-
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
30
|
-
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
31
|
-
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const INTERNAL = Symbol('AgentBaseInternalState');
|
|
36
|
-
|
|
37
|
-
class Agent extends http.Agent {
|
|
38
|
-
|
|
39
|
-
// Set by `http.Agent` - missing from `@types/node`
|
|
40
|
-
|
|
41
|
-
constructor(opts) {
|
|
42
|
-
super(opts);
|
|
43
|
-
this[INTERNAL] = {};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Determine whether this is an `http` or `https` request.
|
|
48
|
-
*/
|
|
49
|
-
isSecureEndpoint(options) {
|
|
50
|
-
if (options) {
|
|
51
|
-
// First check the `secureEndpoint` property explicitly, since this
|
|
52
|
-
// means that a parent `Agent` is "passing through" to this instance.
|
|
53
|
-
if (typeof (options ).secureEndpoint === 'boolean') {
|
|
54
|
-
return options.secureEndpoint;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// If no explicit `secure` endpoint, check if `protocol` property is
|
|
58
|
-
// set. This will usually be the case since using a full string URL
|
|
59
|
-
// or `URL` instance should be the most common usage.
|
|
60
|
-
if (typeof options.protocol === 'string') {
|
|
61
|
-
return options.protocol === 'https:';
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// Finally, if no `protocol` property was set, then fall back to
|
|
66
|
-
// checking the stack trace of the current call stack, and try to
|
|
67
|
-
// detect the "https" module.
|
|
68
|
-
const { stack } = new Error();
|
|
69
|
-
if (typeof stack !== 'string') return false;
|
|
70
|
-
return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1 || l.indexOf('node:https:') !== -1);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
createSocket(req, options, cb) {
|
|
74
|
-
const connectOpts = {
|
|
75
|
-
...options,
|
|
76
|
-
secureEndpoint: this.isSecureEndpoint(options),
|
|
77
|
-
};
|
|
78
|
-
Promise.resolve()
|
|
79
|
-
.then(() => this.connect(req, connectOpts))
|
|
80
|
-
.then(socket => {
|
|
81
|
-
if (socket instanceof http.Agent) {
|
|
82
|
-
// @ts-expect-error `addRequest()` isn't defined in `@types/node`
|
|
83
|
-
return socket.addRequest(req, connectOpts);
|
|
84
|
-
}
|
|
85
|
-
this[INTERNAL].currentSocket = socket;
|
|
86
|
-
// @ts-expect-error `createSocket()` isn't defined in `@types/node`
|
|
87
|
-
super.createSocket(req, options, cb);
|
|
88
|
-
}, cb);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
createConnection() {
|
|
92
|
-
const socket = this[INTERNAL].currentSocket;
|
|
93
|
-
this[INTERNAL].currentSocket = undefined;
|
|
94
|
-
if (!socket) {
|
|
95
|
-
throw new Error('No socket was returned in the `connect()` function');
|
|
96
|
-
}
|
|
97
|
-
return socket;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
get defaultPort() {
|
|
101
|
-
return this[INTERNAL].defaultPort ?? (this.protocol === 'https:' ? 443 : 80);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
set defaultPort(v) {
|
|
105
|
-
if (this[INTERNAL]) {
|
|
106
|
-
this[INTERNAL].defaultPort = v;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
get protocol() {
|
|
111
|
-
return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? 'https:' : 'http:');
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
set protocol(v) {
|
|
115
|
-
if (this[INTERNAL]) {
|
|
116
|
-
this[INTERNAL].protocol = v;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
exports.Agent = Agent;
|
|
122
|
-
//# sourceMappingURL=base.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sources":["../../../src/proxy/base.ts"],"sourcesContent":["/**\n * This code was originally forked from https://github.com/TooTallNate/proxy-agents/tree/b133295fd16f6475578b6b15bd9b4e33ecb0d0b7\n * With the following LICENSE:\n *\n * (The MIT License)\n *\n * Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>*\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * 'Software'), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:*\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.*\n *\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n/* eslint-disable @typescript-eslint/explicit-member-accessibility */\n/* eslint-disable @typescript-eslint/member-ordering */\n/* eslint-disable jsdoc/require-jsdoc */\nimport * as http from 'node:http';\nimport type * as net from 'node:net';\nimport type { Duplex } from 'node:stream';\nimport type * as tls from 'node:tls';\n\nexport * from './helpers';\n\ninterface HttpConnectOpts extends net.TcpNetConnectOpts {\n secureEndpoint: false;\n protocol?: string;\n}\n\ninterface HttpsConnectOpts extends tls.ConnectionOptions {\n secureEndpoint: true;\n protocol?: string;\n port: number;\n}\n\nexport type AgentConnectOpts = HttpConnectOpts | HttpsConnectOpts;\n\nconst INTERNAL = Symbol('AgentBaseInternalState');\n\ninterface InternalState {\n defaultPort?: number;\n protocol?: string;\n currentSocket?: Duplex;\n}\n\nexport abstract class Agent extends http.Agent {\n private [INTERNAL]: InternalState;\n\n // Set by `http.Agent` - missing from `@types/node`\n options!: Partial<net.TcpNetConnectOpts & tls.ConnectionOptions>;\n keepAlive!: boolean;\n\n constructor(opts?: http.AgentOptions) {\n super(opts);\n this[INTERNAL] = {};\n }\n\n abstract connect(\n req: http.ClientRequest,\n options: AgentConnectOpts,\n ): Promise<Duplex | http.Agent> | Duplex | http.Agent;\n\n /**\n * Determine whether this is an `http` or `https` request.\n */\n isSecureEndpoint(options?: AgentConnectOpts): boolean {\n if (options) {\n // First check the `secureEndpoint` property explicitly, since this\n // means that a parent `Agent` is \"passing through\" to this instance.\n if (typeof (options as Partial<typeof options>).secureEndpoint === 'boolean') {\n return options.secureEndpoint;\n }\n\n // If no explicit `secure` endpoint, check if `protocol` property is\n // set. This will usually be the case since using a full string URL\n // or `URL` instance should be the most common usage.\n if (typeof options.protocol === 'string') {\n return options.protocol === 'https:';\n }\n }\n\n // Finally, if no `protocol` property was set, then fall back to\n // checking the stack trace of the current call stack, and try to\n // detect the \"https\" module.\n const { stack } = new Error();\n if (typeof stack !== 'string') return false;\n return stack.split('\\n').some(l => l.indexOf('(https.js:') !== -1 || l.indexOf('node:https:') !== -1);\n }\n\n createSocket(req: http.ClientRequest, options: AgentConnectOpts, cb: (err: Error | null, s?: Duplex) => void): void {\n const connectOpts = {\n ...options,\n secureEndpoint: this.isSecureEndpoint(options),\n };\n Promise.resolve()\n .then(() => this.connect(req, connectOpts))\n .then(socket => {\n if (socket instanceof http.Agent) {\n // @ts-expect-error `addRequest()` isn't defined in `@types/node`\n return socket.addRequest(req, connectOpts);\n }\n this[INTERNAL].currentSocket = socket;\n // @ts-expect-error `createSocket()` isn't defined in `@types/node`\n super.createSocket(req, options, cb);\n }, cb);\n }\n\n createConnection(): Duplex {\n const socket = this[INTERNAL].currentSocket;\n this[INTERNAL].currentSocket = undefined;\n if (!socket) {\n throw new Error('No socket was returned in the `connect()` function');\n }\n return socket;\n }\n\n get defaultPort(): number {\n return this[INTERNAL].defaultPort ?? (this.protocol === 'https:' ? 443 : 80);\n }\n\n set defaultPort(v: number) {\n if (this[INTERNAL]) {\n this[INTERNAL].defaultPort = v;\n }\n }\n\n get protocol(): string {\n return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? 'https:' : 'http:');\n }\n\n set protocol(v: string) {\n if (this[INTERNAL]) {\n this[INTERNAL].protocol = v;\n }\n }\n}\n"],"names":[],"mappings":"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"}
|