@sentry/node 9.34.0 → 9.36.0-alpha.1

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.
Files changed (505) hide show
  1. package/build/cjs/index.js +48 -56
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/integrations/featureFlagShims/launchDarkly.js +43 -0
  4. package/build/cjs/integrations/featureFlagShims/launchDarkly.js.map +1 -0
  5. package/build/cjs/integrations/featureFlagShims/openFeature.js +55 -0
  6. package/build/cjs/integrations/featureFlagShims/openFeature.js.map +1 -0
  7. package/build/cjs/integrations/featureFlagShims/statsig.js +23 -0
  8. package/build/cjs/integrations/featureFlagShims/statsig.js.map +1 -0
  9. package/build/cjs/integrations/featureFlagShims/unleash.js +23 -0
  10. package/build/cjs/integrations/featureFlagShims/unleash.js.map +1 -0
  11. package/build/cjs/integrations/fs.js +2 -2
  12. package/build/cjs/integrations/fs.js.map +1 -1
  13. package/build/cjs/integrations/http/index.js +7 -11
  14. package/build/cjs/integrations/http/index.js.map +1 -1
  15. package/build/cjs/integrations/node-fetch/index.js +4 -5
  16. package/build/cjs/integrations/node-fetch/index.js.map +1 -1
  17. package/build/cjs/integrations/tracing/amqplib.js +4 -5
  18. package/build/cjs/integrations/tracing/amqplib.js.map +1 -1
  19. package/build/cjs/integrations/tracing/connect.js +3 -4
  20. package/build/cjs/integrations/tracing/connect.js.map +1 -1
  21. package/build/cjs/integrations/tracing/dataloader.js +3 -3
  22. package/build/cjs/integrations/tracing/dataloader.js.map +1 -1
  23. package/build/cjs/integrations/tracing/express.js +5 -7
  24. package/build/cjs/integrations/tracing/express.js.map +1 -1
  25. package/build/cjs/integrations/tracing/fastify/fastify-otel/index.js +5 -10
  26. package/build/cjs/integrations/tracing/fastify/fastify-otel/index.js.map +1 -1
  27. package/build/cjs/integrations/tracing/fastify/index.js +6 -6
  28. package/build/cjs/integrations/tracing/fastify/index.js.map +1 -1
  29. package/build/cjs/integrations/tracing/genericPool.js +3 -3
  30. package/build/cjs/integrations/tracing/genericPool.js.map +1 -1
  31. package/build/cjs/integrations/tracing/graphql.js +3 -4
  32. package/build/cjs/integrations/tracing/graphql.js.map +1 -1
  33. package/build/cjs/integrations/tracing/hapi/index.js +3 -4
  34. package/build/cjs/integrations/tracing/hapi/index.js.map +1 -1
  35. package/build/cjs/integrations/tracing/kafka.js +4 -5
  36. package/build/cjs/integrations/tracing/kafka.js.map +1 -1
  37. package/build/cjs/integrations/tracing/knex.js +3 -3
  38. package/build/cjs/integrations/tracing/knex.js.map +1 -1
  39. package/build/cjs/integrations/tracing/koa.js +4 -6
  40. package/build/cjs/integrations/tracing/koa.js.map +1 -1
  41. package/build/cjs/integrations/tracing/lrumemoizer.js +2 -2
  42. package/build/cjs/integrations/tracing/lrumemoizer.js.map +1 -1
  43. package/build/cjs/integrations/tracing/mongo.js +3 -4
  44. package/build/cjs/integrations/tracing/mongo.js.map +1 -1
  45. package/build/cjs/integrations/tracing/mongoose.js +3 -4
  46. package/build/cjs/integrations/tracing/mongoose.js.map +1 -1
  47. package/build/cjs/integrations/tracing/mysql.js +2 -2
  48. package/build/cjs/integrations/tracing/mysql.js.map +1 -1
  49. package/build/cjs/integrations/tracing/mysql2.js +3 -4
  50. package/build/cjs/integrations/tracing/mysql2.js.map +1 -1
  51. package/build/cjs/integrations/tracing/postgres.js +3 -4
  52. package/build/cjs/integrations/tracing/postgres.js.map +1 -1
  53. package/build/cjs/integrations/tracing/postgresjs.js +3 -4
  54. package/build/cjs/integrations/tracing/postgresjs.js.map +1 -1
  55. package/build/cjs/integrations/tracing/prisma.js +2 -2
  56. package/build/cjs/integrations/tracing/prisma.js.map +1 -1
  57. package/build/cjs/integrations/tracing/redis.js +3 -3
  58. package/build/cjs/integrations/tracing/redis.js.map +1 -1
  59. package/build/cjs/integrations/tracing/tedious.js +3 -3
  60. package/build/cjs/integrations/tracing/tedious.js.map +1 -1
  61. package/build/cjs/integrations/tracing/vercelai/index.js +2 -2
  62. package/build/cjs/integrations/tracing/vercelai/index.js.map +1 -1
  63. package/build/cjs/preload.js +2 -2
  64. package/build/cjs/preload.js.map +1 -1
  65. package/build/cjs/sdk/index.js +22 -203
  66. package/build/cjs/sdk/index.js.map +1 -1
  67. package/build/cjs/sdk/initOtel.js +4 -22
  68. package/build/cjs/sdk/initOtel.js.map +1 -1
  69. package/build/esm/index.js +6 -21
  70. package/build/esm/index.js.map +1 -1
  71. package/build/esm/integrations/featureFlagShims/launchDarkly.js +40 -0
  72. package/build/esm/integrations/featureFlagShims/launchDarkly.js.map +1 -0
  73. package/build/esm/integrations/featureFlagShims/openFeature.js +52 -0
  74. package/build/esm/integrations/featureFlagShims/openFeature.js.map +1 -0
  75. package/build/esm/integrations/featureFlagShims/statsig.js +21 -0
  76. package/build/esm/integrations/featureFlagShims/statsig.js.map +1 -0
  77. package/build/esm/integrations/featureFlagShims/unleash.js +21 -0
  78. package/build/esm/integrations/featureFlagShims/unleash.js.map +1 -0
  79. package/build/esm/integrations/fs.js +1 -1
  80. package/build/esm/integrations/fs.js.map +1 -1
  81. package/build/esm/integrations/http/index.js +1 -5
  82. package/build/esm/integrations/http/index.js.map +1 -1
  83. package/build/esm/integrations/node-fetch/index.js +2 -3
  84. package/build/esm/integrations/node-fetch/index.js.map +1 -1
  85. package/build/esm/integrations/tracing/amqplib.js +1 -2
  86. package/build/esm/integrations/tracing/amqplib.js.map +1 -1
  87. package/build/esm/integrations/tracing/connect.js +1 -2
  88. package/build/esm/integrations/tracing/connect.js.map +1 -1
  89. package/build/esm/integrations/tracing/dataloader.js +1 -1
  90. package/build/esm/integrations/tracing/dataloader.js.map +1 -1
  91. package/build/esm/integrations/tracing/express.js +2 -4
  92. package/build/esm/integrations/tracing/express.js.map +1 -1
  93. package/build/esm/integrations/tracing/fastify/fastify-otel/index.js +5 -10
  94. package/build/esm/integrations/tracing/fastify/fastify-otel/index.js.map +1 -1
  95. package/build/esm/integrations/tracing/fastify/index.js +5 -5
  96. package/build/esm/integrations/tracing/fastify/index.js.map +1 -1
  97. package/build/esm/integrations/tracing/genericPool.js +1 -1
  98. package/build/esm/integrations/tracing/genericPool.js.map +1 -1
  99. package/build/esm/integrations/tracing/graphql.js +2 -3
  100. package/build/esm/integrations/tracing/graphql.js.map +1 -1
  101. package/build/esm/integrations/tracing/hapi/index.js +1 -2
  102. package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
  103. package/build/esm/integrations/tracing/kafka.js +1 -2
  104. package/build/esm/integrations/tracing/kafka.js.map +1 -1
  105. package/build/esm/integrations/tracing/knex.js +1 -1
  106. package/build/esm/integrations/tracing/knex.js.map +1 -1
  107. package/build/esm/integrations/tracing/koa.js +2 -4
  108. package/build/esm/integrations/tracing/koa.js.map +1 -1
  109. package/build/esm/integrations/tracing/lrumemoizer.js +1 -1
  110. package/build/esm/integrations/tracing/lrumemoizer.js.map +1 -1
  111. package/build/esm/integrations/tracing/mongo.js +1 -2
  112. package/build/esm/integrations/tracing/mongo.js.map +1 -1
  113. package/build/esm/integrations/tracing/mongoose.js +1 -2
  114. package/build/esm/integrations/tracing/mongoose.js.map +1 -1
  115. package/build/esm/integrations/tracing/mysql.js +1 -1
  116. package/build/esm/integrations/tracing/mysql.js.map +1 -1
  117. package/build/esm/integrations/tracing/mysql2.js +1 -2
  118. package/build/esm/integrations/tracing/mysql2.js.map +1 -1
  119. package/build/esm/integrations/tracing/postgres.js +1 -2
  120. package/build/esm/integrations/tracing/postgres.js.map +1 -1
  121. package/build/esm/integrations/tracing/postgresjs.js +2 -3
  122. package/build/esm/integrations/tracing/postgresjs.js.map +1 -1
  123. package/build/esm/integrations/tracing/prisma.js +1 -1
  124. package/build/esm/integrations/tracing/prisma.js.map +1 -1
  125. package/build/esm/integrations/tracing/redis.js +1 -1
  126. package/build/esm/integrations/tracing/redis.js.map +1 -1
  127. package/build/esm/integrations/tracing/tedious.js +1 -1
  128. package/build/esm/integrations/tracing/tedious.js.map +1 -1
  129. package/build/esm/integrations/tracing/vercelai/index.js +1 -1
  130. package/build/esm/integrations/tracing/vercelai/index.js.map +1 -1
  131. package/build/esm/package.json +1 -1
  132. package/build/esm/preload.js +1 -1
  133. package/build/esm/preload.js.map +1 -1
  134. package/build/esm/sdk/index.js +22 -202
  135. package/build/esm/sdk/index.js.map +1 -1
  136. package/build/esm/sdk/initOtel.js +3 -21
  137. package/build/esm/sdk/initOtel.js.map +1 -1
  138. package/build/types/index.d.ts +3 -21
  139. package/build/types/index.d.ts.map +1 -1
  140. package/build/types/integrations/featureFlagShims/index.d.ts +5 -0
  141. package/build/types/integrations/featureFlagShims/index.d.ts.map +1 -0
  142. package/build/types/integrations/featureFlagShims/launchDarkly.d.ts +10 -0
  143. package/build/types/integrations/featureFlagShims/launchDarkly.d.ts.map +1 -0
  144. package/build/types/integrations/featureFlagShims/openFeature.d.ts +23 -0
  145. package/build/types/integrations/featureFlagShims/openFeature.d.ts.map +1 -0
  146. package/build/types/integrations/featureFlagShims/statsig.d.ts +6 -0
  147. package/build/types/integrations/featureFlagShims/statsig.d.ts.map +1 -0
  148. package/build/types/integrations/featureFlagShims/unleash.d.ts +6 -0
  149. package/build/types/integrations/featureFlagShims/unleash.d.ts.map +1 -0
  150. package/build/types/integrations/http/index.d.ts +1 -1
  151. package/build/types/integrations/http/index.d.ts.map +1 -1
  152. package/build/types/integrations/node-fetch/index.d.ts.map +1 -1
  153. package/build/types/integrations/tracing/amqplib.d.ts.map +1 -1
  154. package/build/types/integrations/tracing/connect.d.ts.map +1 -1
  155. package/build/types/integrations/tracing/express.d.ts.map +1 -1
  156. package/build/types/integrations/tracing/graphql.d.ts.map +1 -1
  157. package/build/types/integrations/tracing/hapi/index.d.ts.map +1 -1
  158. package/build/types/integrations/tracing/kafka.d.ts.map +1 -1
  159. package/build/types/integrations/tracing/koa.d.ts.map +1 -1
  160. package/build/types/integrations/tracing/mongo.d.ts.map +1 -1
  161. package/build/types/integrations/tracing/mongoose.d.ts.map +1 -1
  162. package/build/types/integrations/tracing/mysql2.d.ts.map +1 -1
  163. package/build/types/integrations/tracing/postgres.d.ts.map +1 -1
  164. package/build/types/integrations/tracing/postgresjs.d.ts.map +1 -1
  165. package/build/types/integrations/tracing/vercelai/index.d.ts.map +1 -1
  166. package/build/types/sdk/index.d.ts +2 -6
  167. package/build/types/sdk/index.d.ts.map +1 -1
  168. package/build/types/sdk/initOtel.d.ts +1 -1
  169. package/build/types/sdk/initOtel.d.ts.map +1 -1
  170. package/build/types/types.d.ts +1 -1
  171. package/build/types/types.d.ts.map +1 -1
  172. package/build/types-ts3.8/index.d.ts +3 -21
  173. package/build/types-ts3.8/integrations/featureFlagShims/index.d.ts +5 -0
  174. package/build/types-ts3.8/integrations/featureFlagShims/launchDarkly.d.ts +10 -0
  175. package/build/types-ts3.8/integrations/featureFlagShims/openFeature.d.ts +23 -0
  176. package/build/types-ts3.8/integrations/featureFlagShims/statsig.d.ts +6 -0
  177. package/build/types-ts3.8/integrations/featureFlagShims/unleash.d.ts +6 -0
  178. package/build/types-ts3.8/integrations/http/index.d.ts +1 -1
  179. package/build/types-ts3.8/sdk/index.d.ts +2 -6
  180. package/build/types-ts3.8/sdk/initOtel.d.ts +1 -1
  181. package/build/types-ts3.8/types.d.ts +1 -1
  182. package/package.json +4 -3
  183. package/build/cjs/cron/common.js +0 -56
  184. package/build/cjs/cron/common.js.map +0 -1
  185. package/build/cjs/cron/cron.js +0 -112
  186. package/build/cjs/cron/cron.js.map +0 -1
  187. package/build/cjs/cron/index.js +0 -15
  188. package/build/cjs/cron/index.js.map +0 -1
  189. package/build/cjs/cron/node-cron.js +0 -71
  190. package/build/cjs/cron/node-cron.js.map +0 -1
  191. package/build/cjs/cron/node-schedule.js +0 -65
  192. package/build/cjs/cron/node-schedule.js.map +0 -1
  193. package/build/cjs/integrations/anr/index.js +0 -238
  194. package/build/cjs/integrations/anr/index.js.map +0 -1
  195. package/build/cjs/integrations/childProcess.js +0 -100
  196. package/build/cjs/integrations/childProcess.js.map +0 -1
  197. package/build/cjs/integrations/context.js +0 -457
  198. package/build/cjs/integrations/context.js.map +0 -1
  199. package/build/cjs/integrations/contextlines.js +0 -405
  200. package/build/cjs/integrations/contextlines.js.map +0 -1
  201. package/build/cjs/integrations/http/SentryHttpInstrumentation.js +0 -558
  202. package/build/cjs/integrations/http/SentryHttpInstrumentation.js.map +0 -1
  203. package/build/cjs/integrations/local-variables/common.js +0 -69
  204. package/build/cjs/integrations/local-variables/common.js.map +0 -1
  205. package/build/cjs/integrations/local-variables/index.js +0 -12
  206. package/build/cjs/integrations/local-variables/index.js.map +0 -1
  207. package/build/cjs/integrations/local-variables/local-variables-async.js +0 -143
  208. package/build/cjs/integrations/local-variables/local-variables-async.js.map +0 -1
  209. package/build/cjs/integrations/local-variables/local-variables-sync.js +0 -410
  210. package/build/cjs/integrations/local-variables/local-variables-sync.js.map +0 -1
  211. package/build/cjs/integrations/modules.js +0 -135
  212. package/build/cjs/integrations/modules.js.map +0 -1
  213. package/build/cjs/integrations/node-fetch/SentryNodeFetchInstrumentation.js +0 -291
  214. package/build/cjs/integrations/node-fetch/SentryNodeFetchInstrumentation.js.map +0 -1
  215. package/build/cjs/integrations/onuncaughtexception.js +0 -134
  216. package/build/cjs/integrations/onuncaughtexception.js.map +0 -1
  217. package/build/cjs/integrations/onunhandledrejection.js +0 -89
  218. package/build/cjs/integrations/onunhandledrejection.js.map +0 -1
  219. package/build/cjs/integrations/processSession.js +0 -36
  220. package/build/cjs/integrations/processSession.js.map +0 -1
  221. package/build/cjs/integrations/spotlight.js +0 -101
  222. package/build/cjs/integrations/spotlight.js.map +0 -1
  223. package/build/cjs/integrations/winston.js +0 -151
  224. package/build/cjs/integrations/winston.js.map +0 -1
  225. package/build/cjs/logs/capture.js +0 -29
  226. package/build/cjs/logs/capture.js.map +0 -1
  227. package/build/cjs/logs/exports.js +0 -178
  228. package/build/cjs/logs/exports.js.map +0 -1
  229. package/build/cjs/nodeVersion.js +0 -12
  230. package/build/cjs/nodeVersion.js.map +0 -1
  231. package/build/cjs/otel/contextManager.js +0 -16
  232. package/build/cjs/otel/contextManager.js.map +0 -1
  233. package/build/cjs/otel/instrument.js +0 -139
  234. package/build/cjs/otel/instrument.js.map +0 -1
  235. package/build/cjs/proxy/base.js +0 -122
  236. package/build/cjs/proxy/base.js.map +0 -1
  237. package/build/cjs/proxy/index.js +0 -173
  238. package/build/cjs/proxy/index.js.map +0 -1
  239. package/build/cjs/proxy/parse-proxy-response.js +0 -104
  240. package/build/cjs/proxy/parse-proxy-response.js.map +0 -1
  241. package/build/cjs/sdk/api.js +0 -117
  242. package/build/cjs/sdk/api.js.map +0 -1
  243. package/build/cjs/sdk/client.js +0 -156
  244. package/build/cjs/sdk/client.js.map +0 -1
  245. package/build/cjs/transports/http.js +0 -158
  246. package/build/cjs/transports/http.js.map +0 -1
  247. package/build/cjs/utils/addOriginToSpan.js +0 -11
  248. package/build/cjs/utils/addOriginToSpan.js.map +0 -1
  249. package/build/cjs/utils/baggage.js +0 -36
  250. package/build/cjs/utils/baggage.js.map +0 -1
  251. package/build/cjs/utils/commonjs.js +0 -13
  252. package/build/cjs/utils/commonjs.js.map +0 -1
  253. package/build/cjs/utils/createMissingInstrumentationContext.js +0 -11
  254. package/build/cjs/utils/createMissingInstrumentationContext.js.map +0 -1
  255. package/build/cjs/utils/debug.js +0 -23
  256. package/build/cjs/utils/debug.js.map +0 -1
  257. package/build/cjs/utils/ensureIsWrapped.js +0 -41
  258. package/build/cjs/utils/ensureIsWrapped.js.map +0 -1
  259. package/build/cjs/utils/envToBool.js +0 -32
  260. package/build/cjs/utils/envToBool.js.map +0 -1
  261. package/build/cjs/utils/errorhandling.js +0 -42
  262. package/build/cjs/utils/errorhandling.js.map +0 -1
  263. package/build/cjs/utils/getRequestUrl.js +0 -18
  264. package/build/cjs/utils/getRequestUrl.js.map +0 -1
  265. package/build/cjs/utils/module.js +0 -60
  266. package/build/cjs/utils/module.js.map +0 -1
  267. package/build/esm/cron/common.js +0 -54
  268. package/build/esm/cron/common.js.map +0 -1
  269. package/build/esm/cron/cron.js +0 -110
  270. package/build/esm/cron/cron.js.map +0 -1
  271. package/build/esm/cron/index.js +0 -13
  272. package/build/esm/cron/index.js.map +0 -1
  273. package/build/esm/cron/node-cron.js +0 -69
  274. package/build/esm/cron/node-cron.js.map +0 -1
  275. package/build/esm/cron/node-schedule.js +0 -63
  276. package/build/esm/cron/node-schedule.js.map +0 -1
  277. package/build/esm/integrations/anr/index.js +0 -234
  278. package/build/esm/integrations/anr/index.js.map +0 -1
  279. package/build/esm/integrations/anr/worker-script.js +0 -2
  280. package/build/esm/integrations/childProcess.js +0 -98
  281. package/build/esm/integrations/childProcess.js.map +0 -1
  282. package/build/esm/integrations/context.js +0 -451
  283. package/build/esm/integrations/context.js.map +0 -1
  284. package/build/esm/integrations/contextlines.js +0 -399
  285. package/build/esm/integrations/contextlines.js.map +0 -1
  286. package/build/esm/integrations/http/SentryHttpInstrumentation.js +0 -555
  287. package/build/esm/integrations/http/SentryHttpInstrumentation.js.map +0 -1
  288. package/build/esm/integrations/local-variables/common.js +0 -64
  289. package/build/esm/integrations/local-variables/common.js.map +0 -1
  290. package/build/esm/integrations/local-variables/index.js +0 -10
  291. package/build/esm/integrations/local-variables/index.js.map +0 -1
  292. package/build/esm/integrations/local-variables/local-variables-async.js +0 -140
  293. package/build/esm/integrations/local-variables/local-variables-async.js.map +0 -1
  294. package/build/esm/integrations/local-variables/local-variables-sync.js +0 -405
  295. package/build/esm/integrations/local-variables/local-variables-sync.js.map +0 -1
  296. package/build/esm/integrations/local-variables/worker-script.js +0 -2
  297. package/build/esm/integrations/modules.js +0 -133
  298. package/build/esm/integrations/modules.js.map +0 -1
  299. package/build/esm/integrations/node-fetch/SentryNodeFetchInstrumentation.js +0 -289
  300. package/build/esm/integrations/node-fetch/SentryNodeFetchInstrumentation.js.map +0 -1
  301. package/build/esm/integrations/onuncaughtexception.js +0 -131
  302. package/build/esm/integrations/onuncaughtexception.js.map +0 -1
  303. package/build/esm/integrations/onunhandledrejection.js +0 -86
  304. package/build/esm/integrations/onunhandledrejection.js.map +0 -1
  305. package/build/esm/integrations/processSession.js +0 -34
  306. package/build/esm/integrations/processSession.js.map +0 -1
  307. package/build/esm/integrations/spotlight.js +0 -98
  308. package/build/esm/integrations/spotlight.js.map +0 -1
  309. package/build/esm/integrations/winston.js +0 -149
  310. package/build/esm/integrations/winston.js.map +0 -1
  311. package/build/esm/logs/capture.js +0 -27
  312. package/build/esm/logs/capture.js.map +0 -1
  313. package/build/esm/logs/exports.js +0 -170
  314. package/build/esm/logs/exports.js.map +0 -1
  315. package/build/esm/nodeVersion.js +0 -8
  316. package/build/esm/nodeVersion.js.map +0 -1
  317. package/build/esm/otel/contextManager.js +0 -14
  318. package/build/esm/otel/contextManager.js.map +0 -1
  319. package/build/esm/otel/instrument.js +0 -135
  320. package/build/esm/otel/instrument.js.map +0 -1
  321. package/build/esm/proxy/base.js +0 -120
  322. package/build/esm/proxy/base.js.map +0 -1
  323. package/build/esm/proxy/index.js +0 -171
  324. package/build/esm/proxy/index.js.map +0 -1
  325. package/build/esm/proxy/parse-proxy-response.js +0 -102
  326. package/build/esm/proxy/parse-proxy-response.js.map +0 -1
  327. package/build/esm/sdk/api.js +0 -114
  328. package/build/esm/sdk/api.js.map +0 -1
  329. package/build/esm/sdk/client.js +0 -154
  330. package/build/esm/sdk/client.js.map +0 -1
  331. package/build/esm/transports/http.js +0 -156
  332. package/build/esm/transports/http.js.map +0 -1
  333. package/build/esm/utils/addOriginToSpan.js +0 -9
  334. package/build/esm/utils/addOriginToSpan.js.map +0 -1
  335. package/build/esm/utils/baggage.js +0 -34
  336. package/build/esm/utils/baggage.js.map +0 -1
  337. package/build/esm/utils/commonjs.js +0 -11
  338. package/build/esm/utils/commonjs.js.map +0 -1
  339. package/build/esm/utils/createMissingInstrumentationContext.js +0 -9
  340. package/build/esm/utils/createMissingInstrumentationContext.js.map +0 -1
  341. package/build/esm/utils/debug.js +0 -21
  342. package/build/esm/utils/debug.js.map +0 -1
  343. package/build/esm/utils/ensureIsWrapped.js +0 -39
  344. package/build/esm/utils/ensureIsWrapped.js.map +0 -1
  345. package/build/esm/utils/envToBool.js +0 -28
  346. package/build/esm/utils/envToBool.js.map +0 -1
  347. package/build/esm/utils/errorhandling.js +0 -40
  348. package/build/esm/utils/errorhandling.js.map +0 -1
  349. package/build/esm/utils/getRequestUrl.js +0 -16
  350. package/build/esm/utils/getRequestUrl.js.map +0 -1
  351. package/build/esm/utils/module.js +0 -58
  352. package/build/esm/utils/module.js.map +0 -1
  353. package/build/types/cron/common.d.ts +0 -5
  354. package/build/types/cron/common.d.ts.map +0 -1
  355. package/build/types/cron/cron.d.ts +0 -43
  356. package/build/types/cron/cron.d.ts.map +0 -1
  357. package/build/types/cron/index.d.ts +0 -10
  358. package/build/types/cron/index.d.ts.map +0 -1
  359. package/build/types/cron/node-cron.d.ts +0 -27
  360. package/build/types/cron/node-cron.d.ts.map +0 -1
  361. package/build/types/cron/node-schedule.d.ts +0 -19
  362. package/build/types/cron/node-schedule.d.ts.map +0 -1
  363. package/build/types/integrations/anr/common.d.ts +0 -52
  364. package/build/types/integrations/anr/common.d.ts.map +0 -1
  365. package/build/types/integrations/anr/index.d.ts +0 -13
  366. package/build/types/integrations/anr/index.d.ts.map +0 -1
  367. package/build/types/integrations/anr/worker.d.ts +0 -2
  368. package/build/types/integrations/anr/worker.d.ts.map +0 -1
  369. package/build/types/integrations/childProcess.d.ts +0 -20
  370. package/build/types/integrations/childProcess.d.ts.map +0 -1
  371. package/build/types/integrations/context.d.ts +0 -30
  372. package/build/types/integrations/context.d.ts.map +0 -1
  373. package/build/types/integrations/contextlines.d.ts +0 -31
  374. package/build/types/integrations/contextlines.d.ts.map +0 -1
  375. package/build/types/integrations/http/SentryHttpInstrumentation.d.ts +0 -131
  376. package/build/types/integrations/http/SentryHttpInstrumentation.d.ts.map +0 -1
  377. package/build/types/integrations/local-variables/common.d.ts +0 -66
  378. package/build/types/integrations/local-variables/common.d.ts.map +0 -1
  379. package/build/types/integrations/local-variables/index.d.ts +0 -4
  380. package/build/types/integrations/local-variables/index.d.ts.map +0 -1
  381. package/build/types/integrations/local-variables/local-variables-async.d.ts +0 -7
  382. package/build/types/integrations/local-variables/local-variables-async.d.ts.map +0 -1
  383. package/build/types/integrations/local-variables/local-variables-sync.d.ts +0 -34
  384. package/build/types/integrations/local-variables/local-variables-sync.d.ts.map +0 -1
  385. package/build/types/integrations/local-variables/worker.d.ts +0 -2
  386. package/build/types/integrations/local-variables/worker.d.ts.map +0 -1
  387. package/build/types/integrations/modules.d.ts +0 -17
  388. package/build/types/integrations/modules.d.ts.map +0 -1
  389. package/build/types/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts +0 -56
  390. package/build/types/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts.map +0 -1
  391. package/build/types/integrations/onuncaughtexception.d.ts +0 -31
  392. package/build/types/integrations/onuncaughtexception.d.ts.map +0 -1
  393. package/build/types/integrations/onunhandledrejection.d.ts +0 -23
  394. package/build/types/integrations/onunhandledrejection.d.ts.map +0 -1
  395. package/build/types/integrations/processSession.d.ts +0 -5
  396. package/build/types/integrations/processSession.d.ts.map +0 -1
  397. package/build/types/integrations/spotlight.d.ts +0 -18
  398. package/build/types/integrations/spotlight.d.ts.map +0 -1
  399. package/build/types/integrations/winston.d.ts +0 -44
  400. package/build/types/integrations/winston.d.ts.map +0 -1
  401. package/build/types/logs/capture.d.ts +0 -11
  402. package/build/types/logs/capture.d.ts.map +0 -1
  403. package/build/types/logs/exports.d.ts +0 -150
  404. package/build/types/logs/exports.d.ts.map +0 -1
  405. package/build/types/nodeVersion.d.ts +0 -8
  406. package/build/types/nodeVersion.d.ts.map +0 -1
  407. package/build/types/otel/contextManager.d.ts +0 -10
  408. package/build/types/otel/contextManager.d.ts.map +0 -1
  409. package/build/types/otel/instrument.d.ts +0 -23
  410. package/build/types/otel/instrument.d.ts.map +0 -1
  411. package/build/types/proxy/base.d.ts +0 -65
  412. package/build/types/proxy/base.d.ts.map +0 -1
  413. package/build/types/proxy/helpers.d.ts +0 -42
  414. package/build/types/proxy/helpers.d.ts.map +0 -1
  415. package/build/types/proxy/index.d.ts +0 -73
  416. package/build/types/proxy/index.d.ts.map +0 -1
  417. package/build/types/proxy/parse-proxy-response.d.ts +0 -43
  418. package/build/types/proxy/parse-proxy-response.d.ts.map +0 -1
  419. package/build/types/sdk/api.d.ts +0 -8
  420. package/build/types/sdk/api.d.ts.map +0 -1
  421. package/build/types/sdk/client.d.ts +0 -29
  422. package/build/types/sdk/client.d.ts.map +0 -1
  423. package/build/types/sdk/scope.d.ts +0 -7
  424. package/build/types/sdk/scope.d.ts.map +0 -1
  425. package/build/types/transports/http-module.d.ts +0 -31
  426. package/build/types/transports/http-module.d.ts.map +0 -1
  427. package/build/types/transports/http.d.ts +0 -21
  428. package/build/types/transports/http.d.ts.map +0 -1
  429. package/build/types/transports/index.d.ts +0 -3
  430. package/build/types/transports/index.d.ts.map +0 -1
  431. package/build/types/utils/addOriginToSpan.d.ts +0 -5
  432. package/build/types/utils/addOriginToSpan.d.ts.map +0 -1
  433. package/build/types/utils/baggage.d.ts +0 -6
  434. package/build/types/utils/baggage.d.ts.map +0 -1
  435. package/build/types/utils/commonjs.d.ts +0 -3
  436. package/build/types/utils/commonjs.d.ts.map +0 -1
  437. package/build/types/utils/createMissingInstrumentationContext.d.ts +0 -3
  438. package/build/types/utils/createMissingInstrumentationContext.d.ts.map +0 -1
  439. package/build/types/utils/debug.d.ts +0 -5
  440. package/build/types/utils/debug.d.ts.map +0 -1
  441. package/build/types/utils/ensureIsWrapped.d.ts +0 -5
  442. package/build/types/utils/ensureIsWrapped.d.ts.map +0 -1
  443. package/build/types/utils/entry-point.d.ts +0 -24
  444. package/build/types/utils/entry-point.d.ts.map +0 -1
  445. package/build/types/utils/envToBool.d.ts +0 -13
  446. package/build/types/utils/envToBool.d.ts.map +0 -1
  447. package/build/types/utils/errorhandling.d.ts +0 -5
  448. package/build/types/utils/errorhandling.d.ts.map +0 -1
  449. package/build/types/utils/getRequestUrl.d.ts +0 -5
  450. package/build/types/utils/getRequestUrl.d.ts.map +0 -1
  451. package/build/types/utils/module.d.ts +0 -3
  452. package/build/types/utils/module.d.ts.map +0 -1
  453. package/build/types/utils/prepareEvent.d.ts +0 -17
  454. package/build/types/utils/prepareEvent.d.ts.map +0 -1
  455. package/build/types-ts3.8/cron/common.d.ts +0 -5
  456. package/build/types-ts3.8/cron/cron.d.ts +0 -43
  457. package/build/types-ts3.8/cron/index.d.ts +0 -10
  458. package/build/types-ts3.8/cron/node-cron.d.ts +0 -27
  459. package/build/types-ts3.8/cron/node-schedule.d.ts +0 -19
  460. package/build/types-ts3.8/integrations/anr/common.d.ts +0 -52
  461. package/build/types-ts3.8/integrations/anr/index.d.ts +0 -13
  462. package/build/types-ts3.8/integrations/anr/worker.d.ts +0 -2
  463. package/build/types-ts3.8/integrations/childProcess.d.ts +0 -20
  464. package/build/types-ts3.8/integrations/context.d.ts +0 -30
  465. package/build/types-ts3.8/integrations/contextlines.d.ts +0 -31
  466. package/build/types-ts3.8/integrations/http/SentryHttpInstrumentation.d.ts +0 -133
  467. package/build/types-ts3.8/integrations/local-variables/common.d.ts +0 -66
  468. package/build/types-ts3.8/integrations/local-variables/index.d.ts +0 -4
  469. package/build/types-ts3.8/integrations/local-variables/local-variables-async.d.ts +0 -7
  470. package/build/types-ts3.8/integrations/local-variables/local-variables-sync.d.ts +0 -34
  471. package/build/types-ts3.8/integrations/local-variables/worker.d.ts +0 -2
  472. package/build/types-ts3.8/integrations/modules.d.ts +0 -17
  473. package/build/types-ts3.8/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts +0 -56
  474. package/build/types-ts3.8/integrations/onuncaughtexception.d.ts +0 -31
  475. package/build/types-ts3.8/integrations/onunhandledrejection.d.ts +0 -23
  476. package/build/types-ts3.8/integrations/processSession.d.ts +0 -5
  477. package/build/types-ts3.8/integrations/spotlight.d.ts +0 -18
  478. package/build/types-ts3.8/integrations/winston.d.ts +0 -44
  479. package/build/types-ts3.8/logs/capture.d.ts +0 -18
  480. package/build/types-ts3.8/logs/exports.d.ts +0 -150
  481. package/build/types-ts3.8/nodeVersion.d.ts +0 -8
  482. package/build/types-ts3.8/otel/contextManager.d.ts +0 -10
  483. package/build/types-ts3.8/otel/instrument.d.ts +0 -23
  484. package/build/types-ts3.8/proxy/base.d.ts +0 -60
  485. package/build/types-ts3.8/proxy/helpers.d.ts +0 -38
  486. package/build/types-ts3.8/proxy/index.d.ts +0 -74
  487. package/build/types-ts3.8/proxy/parse-proxy-response.d.ts +0 -40
  488. package/build/types-ts3.8/sdk/api.d.ts +0 -8
  489. package/build/types-ts3.8/sdk/client.d.ts +0 -32
  490. package/build/types-ts3.8/sdk/scope.d.ts +0 -7
  491. package/build/types-ts3.8/transports/http-module.d.ts +0 -28
  492. package/build/types-ts3.8/transports/http.d.ts +0 -20
  493. package/build/types-ts3.8/transports/index.d.ts +0 -3
  494. package/build/types-ts3.8/utils/addOriginToSpan.d.ts +0 -5
  495. package/build/types-ts3.8/utils/baggage.d.ts +0 -6
  496. package/build/types-ts3.8/utils/commonjs.d.ts +0 -3
  497. package/build/types-ts3.8/utils/createMissingInstrumentationContext.d.ts +0 -3
  498. package/build/types-ts3.8/utils/debug.d.ts +0 -5
  499. package/build/types-ts3.8/utils/ensureIsWrapped.d.ts +0 -5
  500. package/build/types-ts3.8/utils/entry-point.d.ts +0 -24
  501. package/build/types-ts3.8/utils/envToBool.d.ts +0 -13
  502. package/build/types-ts3.8/utils/errorhandling.d.ts +0 -5
  503. package/build/types-ts3.8/utils/getRequestUrl.d.ts +0 -5
  504. package/build/types-ts3.8/utils/module.d.ts +0 -3
  505. package/build/types-ts3.8/utils/prepareEvent.d.ts +0 -17
@@ -1,170 +0,0 @@
1
- import { captureLog } from './capture.js';
2
- export { fmt } from '@sentry/core';
3
-
4
- /**
5
- * @summary Capture a log with the `trace` level. Requires `_experiments.enableLogs` to be enabled.
6
- *
7
- * You can either pass a message and attributes or a message template, params and attributes.
8
- *
9
- * @example
10
- *
11
- * ```
12
- * Sentry.logger.trace('Starting database connection', {
13
- * database: 'users',
14
- * connectionId: 'conn_123'
15
- * });
16
- * ```
17
- *
18
- * @example With template strings
19
- *
20
- * ```
21
- * Sentry.logger.trace('Database connection %s established for %s',
22
- * ['successful', 'users'],
23
- * { connectionId: 'conn_123' }
24
- * );
25
- * ```
26
- */
27
- function trace(...args) {
28
- captureLog('trace', ...args);
29
- }
30
-
31
- /**
32
- * @summary Capture a log with the `debug` level. Requires `_experiments.enableLogs` to be enabled.
33
- *
34
- * You can either pass a message and attributes or a message template, params and attributes.
35
- *
36
- * @example
37
- *
38
- * ```
39
- * Sentry.logger.debug('Cache miss for user profile', {
40
- * userId: 'user_123',
41
- * cacheKey: 'profile:user_123'
42
- * });
43
- * ```
44
- *
45
- * @example With template strings
46
- *
47
- * ```
48
- * Sentry.logger.debug('Cache %s for %s: %s',
49
- * ['miss', 'user profile', 'key not found'],
50
- * { userId: 'user_123' }
51
- * );
52
- * ```
53
- */
54
- function debug(...args) {
55
- captureLog('debug', ...args);
56
- }
57
-
58
- /**
59
- * @summary Capture a log with the `info` level. Requires `_experiments.enableLogs` to be enabled.
60
- *
61
- * You can either pass a message and attributes or a message template, params and attributes.
62
- *
63
- * @example
64
- *
65
- * ```
66
- * Sentry.logger.info('User profile updated', {
67
- * userId: 'user_123',
68
- * updatedFields: ['email', 'preferences']
69
- * });
70
- * ```
71
- *
72
- * @example With template strings
73
- *
74
- * ```
75
- * Sentry.logger.info('User %s updated their %s',
76
- * ['John Doe', 'profile settings'],
77
- * { userId: 'user_123' }
78
- * );
79
- * ```
80
- */
81
- function info(...args) {
82
- captureLog('info', ...args);
83
- }
84
-
85
- /**
86
- * @summary Capture a log with the `warn` level. Requires `_experiments.enableLogs` to be enabled.
87
- *
88
- * You can either pass a message and attributes or a message template, params and attributes.
89
- *
90
- * @example
91
- *
92
- * ```
93
- * Sentry.logger.warn('Rate limit approaching', {
94
- * endpoint: '/api/users',
95
- * currentRate: '95/100',
96
- * resetTime: '2024-03-20T10:00:00Z'
97
- * });
98
- * ```
99
- *
100
- * @example With template strings
101
- *
102
- * ```
103
- * Sentry.logger.warn('Rate limit %s for %s: %s',
104
- * ['approaching', '/api/users', '95/100 requests'],
105
- * { resetTime: '2024-03-20T10:00:00Z' }
106
- * );
107
- * ```
108
- */
109
- function warn(...args) {
110
- captureLog('warn', ...args);
111
- }
112
-
113
- /**
114
- * @summary Capture a log with the `error` level. Requires `_experiments.enableLogs` to be enabled.
115
- *
116
- * You can either pass a message and attributes or a message template, params and attributes.
117
- *
118
- * @example
119
- *
120
- * ```
121
- * Sentry.logger.error('Failed to process payment', {
122
- * orderId: 'order_123',
123
- * errorCode: 'PAYMENT_FAILED',
124
- * amount: 99.99
125
- * });
126
- * ```
127
- *
128
- * @example With template strings
129
- *
130
- * ```
131
- * Sentry.logger.error('Payment processing failed for order %s: %s',
132
- * ['order_123', 'insufficient funds'],
133
- * { amount: 99.99 }
134
- * );
135
- * ```
136
- */
137
- function error(...args) {
138
- captureLog('error', ...args);
139
- }
140
-
141
- /**
142
- * @summary Capture a log with the `fatal` level. Requires `_experiments.enableLogs` to be enabled.
143
- *
144
- * You can either pass a message and attributes or a message template, params and attributes.
145
- *
146
- * @example
147
- *
148
- * ```
149
- * Sentry.logger.fatal('Database connection pool exhausted', {
150
- * database: 'users',
151
- * activeConnections: 100,
152
- * maxConnections: 100
153
- * });
154
- * ```
155
- *
156
- * @example With template strings
157
- *
158
- * ```
159
- * Sentry.logger.fatal('Database %s: %s connections active',
160
- * ['connection pool exhausted', '100/100'],
161
- * { database: 'users' }
162
- * );
163
- * ```
164
- */
165
- function fatal(...args) {
166
- captureLog('fatal', ...args);
167
- }
168
-
169
- export { debug, error, fatal, info, trace, warn };
170
- //# 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":[],"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,EAAE,UAAU,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,EAAE,UAAU,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,EAAE,UAAU,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,EAAE,UAAU,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,EAAE,UAAU,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,EAAE,UAAU,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;AAC9B;;;;"}
@@ -1,8 +0,0 @@
1
- import { parseSemver } from '@sentry/core';
2
-
3
- const NODE_VERSION = parseSemver(process.versions.node) ;
4
- const NODE_MAJOR = NODE_VERSION.major;
5
- const NODE_MINOR = NODE_VERSION.minor;
6
-
7
- export { NODE_MAJOR, NODE_MINOR, NODE_VERSION };
8
- //# 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":[],"mappings":";;AAEO,MAAM,YAAa,GAAE,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAE;AAClD,MAAA,UAAA,GAAa,YAAY,CAAC;AAC1B,MAAA,UAAA,GAAa,YAAY,CAAC;;;;"}
@@ -1,14 +0,0 @@
1
- import { AsyncLocalStorageContextManager } from '@opentelemetry/context-async-hooks';
2
- import { wrapContextManagerClass } from '@sentry/opentelemetry';
3
-
4
- /**
5
- * This is a custom ContextManager for OpenTelemetry, which extends the default AsyncLocalStorageContextManager.
6
- * It ensures that we create a new hub per context, so that the OTEL Context & the Sentry Scopes are always in sync.
7
- *
8
- * Note that we currently only support AsyncHooks with this,
9
- * but since this should work for Node 14+ anyhow that should be good enough.
10
- */
11
- const SentryContextManager = wrapContextManagerClass(AsyncLocalStorageContextManager);
12
-
13
- export { SentryContextManager };
14
- //# 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":[],"mappings":";;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,oBAAqB,GAAE,uBAAuB,CAAC,+BAA+B;;;;"}
@@ -1,135 +0,0 @@
1
- import { registerInstrumentations } from '@opentelemetry/instrumentation';
2
-
3
- /** Exported only for tests. */
4
- const INSTRUMENTED = {};
5
-
6
- /**
7
- * Instrument an OpenTelemetry instrumentation once.
8
- * This will skip running instrumentation again if it was already instrumented.
9
- */
10
- function generateInstrumentOnce(
11
- name,
12
- creatorOrClass,
13
- optionsCallback,
14
- ) {
15
- if (optionsCallback) {
16
- return _generateInstrumentOnceWithOptions(
17
- name,
18
- creatorOrClass ,
19
- optionsCallback,
20
- );
21
- }
22
-
23
- return _generateInstrumentOnce(name, creatorOrClass );
24
- }
25
-
26
- // The plain version without handling of options
27
- // Should not be used with custom options that are mutated in the creator!
28
- function _generateInstrumentOnce(
29
- name,
30
- creator,
31
- ) {
32
- return Object.assign(
33
- (options) => {
34
- const instrumented = INSTRUMENTED[name] ;
35
- if (instrumented) {
36
- // If options are provided, ensure we update them
37
- if (options) {
38
- instrumented.setConfig(options);
39
- }
40
- return instrumented;
41
- }
42
-
43
- const instrumentation = creator(options);
44
- INSTRUMENTED[name] = instrumentation;
45
-
46
- registerInstrumentations({
47
- instrumentations: [instrumentation],
48
- });
49
-
50
- return instrumentation;
51
- },
52
- { id: name },
53
- );
54
- }
55
-
56
- // This version handles options properly
57
- function _generateInstrumentOnceWithOptions
58
-
59
- (
60
- name,
61
- instrumentationClass,
62
- optionsCallback,
63
- ) {
64
- return Object.assign(
65
- (_options) => {
66
- const options = optionsCallback(_options);
67
-
68
- const instrumented = INSTRUMENTED[name] ;
69
- if (instrumented) {
70
- // Ensure we update options
71
- instrumented.setConfig(options);
72
- return instrumented;
73
- }
74
-
75
- const instrumentation = new instrumentationClass(options) ;
76
- INSTRUMENTED[name] = instrumentation;
77
-
78
- registerInstrumentations({
79
- instrumentations: [instrumentation],
80
- });
81
-
82
- return instrumentation;
83
- },
84
- { id: name },
85
- );
86
- }
87
-
88
- /**
89
- * Ensure a given callback is called when the instrumentation is actually wrapping something.
90
- * This can be used to ensure some logic is only called when the instrumentation is actually active.
91
- *
92
- * This function returns a function that can be invoked with a callback.
93
- * This callback will either be invoked immediately
94
- * (e.g. if the instrumentation was already wrapped, or if _wrap could not be patched),
95
- * or once the instrumentation is actually wrapping something.
96
- *
97
- * Make sure to call this function right after adding the instrumentation, otherwise it may be too late!
98
- * The returned callback can be used any time, and also multiple times.
99
- */
100
- function instrumentWhenWrapped(instrumentation) {
101
- let isWrapped = false;
102
- let callbacks = [];
103
-
104
- if (!hasWrap(instrumentation)) {
105
- isWrapped = true;
106
- } else {
107
- const originalWrap = instrumentation['_wrap'];
108
-
109
- instrumentation['_wrap'] = (...args) => {
110
- isWrapped = true;
111
- callbacks.forEach(callback => callback());
112
- callbacks = [];
113
- return originalWrap(...args);
114
- };
115
- }
116
-
117
- const registerCallback = (callback) => {
118
- if (isWrapped) {
119
- callback();
120
- } else {
121
- callbacks.push(callback);
122
- }
123
- };
124
-
125
- return registerCallback;
126
- }
127
-
128
- function hasWrap(
129
- instrumentation,
130
- ) {
131
- return typeof (instrumentation )['_wrap'] === 'function';
132
- }
133
-
134
- export { INSTRUMENTED, generateInstrumentOnce, instrumentWhenWrapped };
135
- //# 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":[],"mappings":"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"}
@@ -1,120 +0,0 @@
1
- import * as http from 'node:http';
2
- import 'node:https';
3
-
4
- /**
5
- * This code was originally forked from https://github.com/TooTallNate/proxy-agents/tree/b133295fd16f6475578b6b15bd9b4e33ecb0d0b7
6
- * With the following LICENSE:
7
- *
8
- * (The MIT License)
9
- *
10
- * Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>*
11
- *
12
- * Permission is hereby granted, free of charge, to any person obtaining
13
- * a copy of this software and associated documentation files (the
14
- * 'Software'), to deal in the Software without restriction, including
15
- * without limitation the rights to use, copy, modify, merge, publish,
16
- * distribute, sublicense, and/or sell copies of the Software, and to
17
- * permit persons to whom the Software is furnished to do so, subject to
18
- * the following conditions:*
19
- *
20
- * The above copyright notice and this permission notice shall be
21
- * included in all copies or substantial portions of the Software.*
22
- *
23
- * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
24
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
26
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
27
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
28
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
29
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30
- */
31
-
32
-
33
- const INTERNAL = Symbol('AgentBaseInternalState');
34
-
35
- class Agent extends http.Agent {
36
-
37
- // Set by `http.Agent` - missing from `@types/node`
38
-
39
- constructor(opts) {
40
- super(opts);
41
- this[INTERNAL] = {};
42
- }
43
-
44
- /**
45
- * Determine whether this is an `http` or `https` request.
46
- */
47
- isSecureEndpoint(options) {
48
- if (options) {
49
- // First check the `secureEndpoint` property explicitly, since this
50
- // means that a parent `Agent` is "passing through" to this instance.
51
- if (typeof (options ).secureEndpoint === 'boolean') {
52
- return options.secureEndpoint;
53
- }
54
-
55
- // If no explicit `secure` endpoint, check if `protocol` property is
56
- // set. This will usually be the case since using a full string URL
57
- // or `URL` instance should be the most common usage.
58
- if (typeof options.protocol === 'string') {
59
- return options.protocol === 'https:';
60
- }
61
- }
62
-
63
- // Finally, if no `protocol` property was set, then fall back to
64
- // checking the stack trace of the current call stack, and try to
65
- // detect the "https" module.
66
- const { stack } = new Error();
67
- if (typeof stack !== 'string') return false;
68
- return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1 || l.indexOf('node:https:') !== -1);
69
- }
70
-
71
- createSocket(req, options, cb) {
72
- const connectOpts = {
73
- ...options,
74
- secureEndpoint: this.isSecureEndpoint(options),
75
- };
76
- Promise.resolve()
77
- .then(() => this.connect(req, connectOpts))
78
- .then(socket => {
79
- if (socket instanceof http.Agent) {
80
- // @ts-expect-error `addRequest()` isn't defined in `@types/node`
81
- return socket.addRequest(req, connectOpts);
82
- }
83
- this[INTERNAL].currentSocket = socket;
84
- // @ts-expect-error `createSocket()` isn't defined in `@types/node`
85
- super.createSocket(req, options, cb);
86
- }, cb);
87
- }
88
-
89
- createConnection() {
90
- const socket = this[INTERNAL].currentSocket;
91
- this[INTERNAL].currentSocket = undefined;
92
- if (!socket) {
93
- throw new Error('No socket was returned in the `connect()` function');
94
- }
95
- return socket;
96
- }
97
-
98
- get defaultPort() {
99
- return this[INTERNAL].defaultPort ?? (this.protocol === 'https:' ? 443 : 80);
100
- }
101
-
102
- set defaultPort(v) {
103
- if (this[INTERNAL]) {
104
- this[INTERNAL].defaultPort = v;
105
- }
106
- }
107
-
108
- get protocol() {
109
- return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? 'https:' : 'http:');
110
- }
111
-
112
- set protocol(v) {
113
- if (this[INTERNAL]) {
114
- this[INTERNAL].protocol = v;
115
- }
116
- }
117
- }
118
-
119
- export { Agent };
120
- //# 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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"}
@@ -1,171 +0,0 @@
1
- import * as net from 'node:net';
2
- import * as tls from 'node:tls';
3
- import { logger } from '@sentry/core';
4
- import { Agent } from './base.js';
5
- import { parseProxyResponse } from './parse-proxy-response.js';
6
-
7
- function debug(...args) {
8
- logger.log('[https-proxy-agent]', ...args);
9
- }
10
-
11
- /**
12
- * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to
13
- * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests.
14
- *
15
- * Outgoing HTTP requests are first tunneled through the proxy server using the
16
- * `CONNECT` HTTP request method to establish a connection to the proxy server,
17
- * and then the proxy server connects to the destination target and issues the
18
- * HTTP request from the proxy server.
19
- *
20
- * `https:` requests have their socket connection upgraded to TLS once
21
- * the connection to the proxy server has been established.
22
- */
23
- class HttpsProxyAgent extends Agent {
24
- static __initStatic() {this.protocols = ['http', 'https']; }
25
-
26
- constructor(proxy, opts) {
27
- super(opts);
28
- this.options = {};
29
- this.proxy = typeof proxy === 'string' ? new URL(proxy) : proxy;
30
- this.proxyHeaders = opts?.headers ?? {};
31
- debug('Creating new HttpsProxyAgent instance: %o', this.proxy.href);
32
-
33
- // Trim off the brackets from IPv6 addresses
34
- const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, '');
35
- const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === 'https:' ? 443 : 80;
36
- this.connectOpts = {
37
- // Attempt to negotiate http/1.1 for proxy servers that support http/2
38
- ALPNProtocols: ['http/1.1'],
39
- ...(opts ? omit(opts, 'headers') : null),
40
- host,
41
- port,
42
- };
43
- }
44
-
45
- /**
46
- * Called when the node-core HTTP client library is creating a
47
- * new HTTP request.
48
- */
49
- async connect(req, opts) {
50
- const { proxy } = this;
51
-
52
- if (!opts.host) {
53
- throw new TypeError('No "host" provided');
54
- }
55
-
56
- // Create a socket connection to the proxy server.
57
- let socket;
58
- if (proxy.protocol === 'https:') {
59
- debug('Creating `tls.Socket`: %o', this.connectOpts);
60
- const servername = this.connectOpts.servername || this.connectOpts.host;
61
- socket = tls.connect({
62
- ...this.connectOpts,
63
- servername: servername && net.isIP(servername) ? undefined : servername,
64
- });
65
- } else {
66
- debug('Creating `net.Socket`: %o', this.connectOpts);
67
- socket = net.connect(this.connectOpts);
68
- }
69
-
70
- const headers =
71
- typeof this.proxyHeaders === 'function' ? this.proxyHeaders() : { ...this.proxyHeaders };
72
- const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
73
- let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r\n`;
74
-
75
- // Inject the `Proxy-Authorization` header if necessary.
76
- if (proxy.username || proxy.password) {
77
- const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`;
78
- headers['Proxy-Authorization'] = `Basic ${Buffer.from(auth).toString('base64')}`;
79
- }
80
-
81
- headers.Host = `${host}:${opts.port}`;
82
-
83
- if (!headers['Proxy-Connection']) {
84
- headers['Proxy-Connection'] = this.keepAlive ? 'Keep-Alive' : 'close';
85
- }
86
- for (const name of Object.keys(headers)) {
87
- payload += `${name}: ${headers[name]}\r\n`;
88
- }
89
-
90
- const proxyResponsePromise = parseProxyResponse(socket);
91
-
92
- socket.write(`${payload}\r\n`);
93
-
94
- const { connect, buffered } = await proxyResponsePromise;
95
- req.emit('proxyConnect', connect);
96
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
97
- // @ts-ignore Not EventEmitter in Node types
98
- this.emit('proxyConnect', connect, req);
99
-
100
- if (connect.statusCode === 200) {
101
- req.once('socket', resume);
102
-
103
- if (opts.secureEndpoint) {
104
- // The proxy is connecting to a TLS server, so upgrade
105
- // this socket connection to a TLS connection.
106
- debug('Upgrading socket connection to TLS');
107
- const servername = opts.servername || opts.host;
108
- return tls.connect({
109
- ...omit(opts, 'host', 'path', 'port'),
110
- socket,
111
- servername: net.isIP(servername) ? undefined : servername,
112
- });
113
- }
114
-
115
- return socket;
116
- }
117
-
118
- // Some other status code that's not 200... need to re-play the HTTP
119
- // header "data" events onto the socket once the HTTP machinery is
120
- // attached so that the node core `http` can parse and handle the
121
- // error status code.
122
-
123
- // Close the original socket, and a new "fake" socket is returned
124
- // instead, so that the proxy doesn't get the HTTP request
125
- // written to it (which may contain `Authorization` headers or other
126
- // sensitive data).
127
- //
128
- // See: https://hackerone.com/reports/541502
129
- socket.destroy();
130
-
131
- const fakeSocket = new net.Socket({ writable: false });
132
- fakeSocket.readable = true;
133
-
134
- // Need to wait for the "socket" event to re-play the "data" events.
135
- req.once('socket', (s) => {
136
- debug('Replaying proxy buffer for failed request');
137
- // Replay the "buffered" Buffer onto the fake `socket`, since at
138
- // this point the HTTP module machinery has been hooked up for
139
- // the user.
140
- s.push(buffered);
141
- s.push(null);
142
- });
143
-
144
- return fakeSocket;
145
- }
146
- } HttpsProxyAgent.__initStatic();
147
-
148
- function resume(socket) {
149
- socket.resume();
150
- }
151
-
152
- function omit(
153
- obj,
154
- ...keys
155
- )
156
-
157
- {
158
- const ret = {}
159
-
160
- ;
161
- let key;
162
- for (key in obj) {
163
- if (!keys.includes(key)) {
164
- ret[key] = obj[key];
165
- }
166
- }
167
- return ret;
168
- }
169
-
170
- export { HttpsProxyAgent };
171
- //# sourceMappingURL=index.js.map