@sentry/node 9.32.0 → 9.34.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 (524) hide show
  1. package/build/cjs/index.js +50 -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 +47 -10
  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/index.js +3 -0
  36. package/build/cjs/integrations/tracing/index.js.map +1 -1
  37. package/build/cjs/integrations/tracing/kafka.js +4 -5
  38. package/build/cjs/integrations/tracing/kafka.js.map +1 -1
  39. package/build/cjs/integrations/tracing/knex.js +3 -3
  40. package/build/cjs/integrations/tracing/knex.js.map +1 -1
  41. package/build/cjs/integrations/tracing/koa.js +4 -6
  42. package/build/cjs/integrations/tracing/koa.js.map +1 -1
  43. package/build/cjs/integrations/tracing/lrumemoizer.js +2 -2
  44. package/build/cjs/integrations/tracing/lrumemoizer.js.map +1 -1
  45. package/build/cjs/integrations/tracing/mongo.js +3 -4
  46. package/build/cjs/integrations/tracing/mongo.js.map +1 -1
  47. package/build/cjs/integrations/tracing/mongoose.js +3 -4
  48. package/build/cjs/integrations/tracing/mongoose.js.map +1 -1
  49. package/build/cjs/integrations/tracing/mysql.js +2 -2
  50. package/build/cjs/integrations/tracing/mysql.js.map +1 -1
  51. package/build/cjs/integrations/tracing/mysql2.js +3 -4
  52. package/build/cjs/integrations/tracing/mysql2.js.map +1 -1
  53. package/build/cjs/integrations/tracing/postgres.js +3 -4
  54. package/build/cjs/integrations/tracing/postgres.js.map +1 -1
  55. package/build/cjs/integrations/tracing/postgresjs.js +282 -0
  56. package/build/cjs/integrations/tracing/postgresjs.js.map +1 -0
  57. package/build/cjs/integrations/tracing/prisma.js +2 -2
  58. package/build/cjs/integrations/tracing/prisma.js.map +1 -1
  59. package/build/cjs/integrations/tracing/redis.js +3 -3
  60. package/build/cjs/integrations/tracing/redis.js.map +1 -1
  61. package/build/cjs/integrations/tracing/tedious.js +3 -3
  62. package/build/cjs/integrations/tracing/tedious.js.map +1 -1
  63. package/build/cjs/integrations/tracing/vercelai/index.js +9 -185
  64. package/build/cjs/integrations/tracing/vercelai/index.js.map +1 -1
  65. package/build/cjs/preload.js +2 -2
  66. package/build/cjs/preload.js.map +1 -1
  67. package/build/cjs/sdk/index.js +22 -203
  68. package/build/cjs/sdk/index.js.map +1 -1
  69. package/build/cjs/sdk/initOtel.js +4 -22
  70. package/build/cjs/sdk/initOtel.js.map +1 -1
  71. package/build/esm/index.js +7 -21
  72. package/build/esm/index.js.map +1 -1
  73. package/build/esm/integrations/featureFlagShims/launchDarkly.js +40 -0
  74. package/build/esm/integrations/featureFlagShims/launchDarkly.js.map +1 -0
  75. package/build/esm/integrations/featureFlagShims/openFeature.js +52 -0
  76. package/build/esm/integrations/featureFlagShims/openFeature.js.map +1 -0
  77. package/build/esm/integrations/featureFlagShims/statsig.js +21 -0
  78. package/build/esm/integrations/featureFlagShims/statsig.js.map +1 -0
  79. package/build/esm/integrations/featureFlagShims/unleash.js +21 -0
  80. package/build/esm/integrations/featureFlagShims/unleash.js.map +1 -0
  81. package/build/esm/integrations/fs.js +1 -1
  82. package/build/esm/integrations/fs.js.map +1 -1
  83. package/build/esm/integrations/http/index.js +1 -5
  84. package/build/esm/integrations/http/index.js.map +1 -1
  85. package/build/esm/integrations/node-fetch/index.js +2 -3
  86. package/build/esm/integrations/node-fetch/index.js.map +1 -1
  87. package/build/esm/integrations/tracing/amqplib.js +1 -2
  88. package/build/esm/integrations/tracing/amqplib.js.map +1 -1
  89. package/build/esm/integrations/tracing/connect.js +1 -2
  90. package/build/esm/integrations/tracing/connect.js.map +1 -1
  91. package/build/esm/integrations/tracing/dataloader.js +1 -1
  92. package/build/esm/integrations/tracing/dataloader.js.map +1 -1
  93. package/build/esm/integrations/tracing/express.js +2 -4
  94. package/build/esm/integrations/tracing/express.js.map +1 -1
  95. package/build/esm/integrations/tracing/fastify/fastify-otel/index.js +5 -10
  96. package/build/esm/integrations/tracing/fastify/fastify-otel/index.js.map +1 -1
  97. package/build/esm/integrations/tracing/fastify/index.js +46 -9
  98. package/build/esm/integrations/tracing/fastify/index.js.map +1 -1
  99. package/build/esm/integrations/tracing/genericPool.js +1 -1
  100. package/build/esm/integrations/tracing/genericPool.js.map +1 -1
  101. package/build/esm/integrations/tracing/graphql.js +2 -3
  102. package/build/esm/integrations/tracing/graphql.js.map +1 -1
  103. package/build/esm/integrations/tracing/hapi/index.js +1 -2
  104. package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
  105. package/build/esm/integrations/tracing/index.js +3 -0
  106. package/build/esm/integrations/tracing/index.js.map +1 -1
  107. package/build/esm/integrations/tracing/kafka.js +1 -2
  108. package/build/esm/integrations/tracing/kafka.js.map +1 -1
  109. package/build/esm/integrations/tracing/knex.js +1 -1
  110. package/build/esm/integrations/tracing/knex.js.map +1 -1
  111. package/build/esm/integrations/tracing/koa.js +2 -4
  112. package/build/esm/integrations/tracing/koa.js.map +1 -1
  113. package/build/esm/integrations/tracing/lrumemoizer.js +1 -1
  114. package/build/esm/integrations/tracing/lrumemoizer.js.map +1 -1
  115. package/build/esm/integrations/tracing/mongo.js +1 -2
  116. package/build/esm/integrations/tracing/mongo.js.map +1 -1
  117. package/build/esm/integrations/tracing/mongoose.js +1 -2
  118. package/build/esm/integrations/tracing/mongoose.js.map +1 -1
  119. package/build/esm/integrations/tracing/mysql.js +1 -1
  120. package/build/esm/integrations/tracing/mysql.js.map +1 -1
  121. package/build/esm/integrations/tracing/mysql2.js +1 -2
  122. package/build/esm/integrations/tracing/mysql2.js.map +1 -1
  123. package/build/esm/integrations/tracing/postgres.js +1 -2
  124. package/build/esm/integrations/tracing/postgres.js.map +1 -1
  125. package/build/esm/integrations/tracing/postgresjs.js +278 -0
  126. package/build/esm/integrations/tracing/postgresjs.js.map +1 -0
  127. package/build/esm/integrations/tracing/prisma.js +1 -1
  128. package/build/esm/integrations/tracing/prisma.js.map +1 -1
  129. package/build/esm/integrations/tracing/redis.js +1 -1
  130. package/build/esm/integrations/tracing/redis.js.map +1 -1
  131. package/build/esm/integrations/tracing/tedious.js +1 -1
  132. package/build/esm/integrations/tracing/tedious.js.map +1 -1
  133. package/build/esm/integrations/tracing/vercelai/index.js +9 -185
  134. package/build/esm/integrations/tracing/vercelai/index.js.map +1 -1
  135. package/build/esm/package.json +1 -1
  136. package/build/esm/preload.js +1 -1
  137. package/build/esm/preload.js.map +1 -1
  138. package/build/esm/sdk/index.js +22 -202
  139. package/build/esm/sdk/index.js.map +1 -1
  140. package/build/esm/sdk/initOtel.js +3 -21
  141. package/build/esm/sdk/initOtel.js.map +1 -1
  142. package/build/types/index.d.ts +4 -21
  143. package/build/types/index.d.ts.map +1 -1
  144. package/build/types/integrations/featureFlagShims/index.d.ts +5 -0
  145. package/build/types/integrations/featureFlagShims/index.d.ts.map +1 -0
  146. package/build/types/integrations/featureFlagShims/launchDarkly.d.ts +10 -0
  147. package/build/types/integrations/featureFlagShims/launchDarkly.d.ts.map +1 -0
  148. package/build/types/integrations/featureFlagShims/openFeature.d.ts +23 -0
  149. package/build/types/integrations/featureFlagShims/openFeature.d.ts.map +1 -0
  150. package/build/types/integrations/featureFlagShims/statsig.d.ts +6 -0
  151. package/build/types/integrations/featureFlagShims/statsig.d.ts.map +1 -0
  152. package/build/types/integrations/featureFlagShims/unleash.d.ts +6 -0
  153. package/build/types/integrations/featureFlagShims/unleash.d.ts.map +1 -0
  154. package/build/types/integrations/http/index.d.ts +1 -1
  155. package/build/types/integrations/http/index.d.ts.map +1 -1
  156. package/build/types/integrations/node-fetch/index.d.ts.map +1 -1
  157. package/build/types/integrations/tracing/amqplib.d.ts.map +1 -1
  158. package/build/types/integrations/tracing/connect.d.ts.map +1 -1
  159. package/build/types/integrations/tracing/express.d.ts.map +1 -1
  160. package/build/types/integrations/tracing/fastify/index.d.ts +1 -1
  161. package/build/types/integrations/tracing/fastify/index.d.ts.map +1 -1
  162. package/build/types/integrations/tracing/graphql.d.ts.map +1 -1
  163. package/build/types/integrations/tracing/hapi/index.d.ts.map +1 -1
  164. package/build/types/integrations/tracing/index.d.ts.map +1 -1
  165. package/build/types/integrations/tracing/kafka.d.ts.map +1 -1
  166. package/build/types/integrations/tracing/koa.d.ts.map +1 -1
  167. package/build/types/integrations/tracing/mongo.d.ts.map +1 -1
  168. package/build/types/integrations/tracing/mongoose.d.ts.map +1 -1
  169. package/build/types/integrations/tracing/mysql2.d.ts.map +1 -1
  170. package/build/types/integrations/tracing/postgres.d.ts.map +1 -1
  171. package/build/types/integrations/tracing/postgresjs.d.ts +81 -0
  172. package/build/types/integrations/tracing/postgresjs.d.ts.map +1 -0
  173. package/build/types/integrations/tracing/vercelai/index.d.ts +5 -7
  174. package/build/types/integrations/tracing/vercelai/index.d.ts.map +1 -1
  175. package/build/types/sdk/index.d.ts +2 -6
  176. package/build/types/sdk/index.d.ts.map +1 -1
  177. package/build/types/sdk/initOtel.d.ts +1 -1
  178. package/build/types/sdk/initOtel.d.ts.map +1 -1
  179. package/build/types/types.d.ts +1 -1
  180. package/build/types/types.d.ts.map +1 -1
  181. package/build/types-ts3.8/index.d.ts +4 -21
  182. package/build/types-ts3.8/integrations/featureFlagShims/index.d.ts +5 -0
  183. package/build/types-ts3.8/integrations/featureFlagShims/launchDarkly.d.ts +10 -0
  184. package/build/types-ts3.8/integrations/featureFlagShims/openFeature.d.ts +23 -0
  185. package/build/types-ts3.8/integrations/featureFlagShims/statsig.d.ts +6 -0
  186. package/build/types-ts3.8/integrations/featureFlagShims/unleash.d.ts +6 -0
  187. package/build/types-ts3.8/integrations/http/index.d.ts +1 -1
  188. package/build/types-ts3.8/integrations/tracing/fastify/index.d.ts +1 -1
  189. package/build/types-ts3.8/integrations/tracing/postgresjs.d.ts +81 -0
  190. package/build/types-ts3.8/integrations/tracing/vercelai/index.d.ts +5 -7
  191. package/build/types-ts3.8/sdk/index.d.ts +2 -6
  192. package/build/types-ts3.8/sdk/initOtel.d.ts +1 -1
  193. package/build/types-ts3.8/types.d.ts +1 -1
  194. package/package.json +4 -3
  195. package/build/cjs/cron/common.js +0 -56
  196. package/build/cjs/cron/common.js.map +0 -1
  197. package/build/cjs/cron/cron.js +0 -112
  198. package/build/cjs/cron/cron.js.map +0 -1
  199. package/build/cjs/cron/index.js +0 -15
  200. package/build/cjs/cron/index.js.map +0 -1
  201. package/build/cjs/cron/node-cron.js +0 -71
  202. package/build/cjs/cron/node-cron.js.map +0 -1
  203. package/build/cjs/cron/node-schedule.js +0 -65
  204. package/build/cjs/cron/node-schedule.js.map +0 -1
  205. package/build/cjs/integrations/anr/index.js +0 -238
  206. package/build/cjs/integrations/anr/index.js.map +0 -1
  207. package/build/cjs/integrations/childProcess.js +0 -100
  208. package/build/cjs/integrations/childProcess.js.map +0 -1
  209. package/build/cjs/integrations/context.js +0 -457
  210. package/build/cjs/integrations/context.js.map +0 -1
  211. package/build/cjs/integrations/contextlines.js +0 -405
  212. package/build/cjs/integrations/contextlines.js.map +0 -1
  213. package/build/cjs/integrations/http/SentryHttpInstrumentation.js +0 -558
  214. package/build/cjs/integrations/http/SentryHttpInstrumentation.js.map +0 -1
  215. package/build/cjs/integrations/local-variables/common.js +0 -69
  216. package/build/cjs/integrations/local-variables/common.js.map +0 -1
  217. package/build/cjs/integrations/local-variables/index.js +0 -12
  218. package/build/cjs/integrations/local-variables/index.js.map +0 -1
  219. package/build/cjs/integrations/local-variables/local-variables-async.js +0 -143
  220. package/build/cjs/integrations/local-variables/local-variables-async.js.map +0 -1
  221. package/build/cjs/integrations/local-variables/local-variables-sync.js +0 -410
  222. package/build/cjs/integrations/local-variables/local-variables-sync.js.map +0 -1
  223. package/build/cjs/integrations/modules.js +0 -135
  224. package/build/cjs/integrations/modules.js.map +0 -1
  225. package/build/cjs/integrations/node-fetch/SentryNodeFetchInstrumentation.js +0 -291
  226. package/build/cjs/integrations/node-fetch/SentryNodeFetchInstrumentation.js.map +0 -1
  227. package/build/cjs/integrations/onuncaughtexception.js +0 -134
  228. package/build/cjs/integrations/onuncaughtexception.js.map +0 -1
  229. package/build/cjs/integrations/onunhandledrejection.js +0 -89
  230. package/build/cjs/integrations/onunhandledrejection.js.map +0 -1
  231. package/build/cjs/integrations/processSession.js +0 -36
  232. package/build/cjs/integrations/processSession.js.map +0 -1
  233. package/build/cjs/integrations/spotlight.js +0 -101
  234. package/build/cjs/integrations/spotlight.js.map +0 -1
  235. package/build/cjs/integrations/tracing/vercelai/ai_sdk_attributes.js +0 -168
  236. package/build/cjs/integrations/tracing/vercelai/ai_sdk_attributes.js.map +0 -1
  237. package/build/cjs/integrations/winston.js +0 -151
  238. package/build/cjs/integrations/winston.js.map +0 -1
  239. package/build/cjs/logs/capture.js +0 -29
  240. package/build/cjs/logs/capture.js.map +0 -1
  241. package/build/cjs/logs/exports.js +0 -178
  242. package/build/cjs/logs/exports.js.map +0 -1
  243. package/build/cjs/nodeVersion.js +0 -12
  244. package/build/cjs/nodeVersion.js.map +0 -1
  245. package/build/cjs/otel/contextManager.js +0 -16
  246. package/build/cjs/otel/contextManager.js.map +0 -1
  247. package/build/cjs/otel/instrument.js +0 -139
  248. package/build/cjs/otel/instrument.js.map +0 -1
  249. package/build/cjs/proxy/base.js +0 -122
  250. package/build/cjs/proxy/base.js.map +0 -1
  251. package/build/cjs/proxy/index.js +0 -173
  252. package/build/cjs/proxy/index.js.map +0 -1
  253. package/build/cjs/proxy/parse-proxy-response.js +0 -104
  254. package/build/cjs/proxy/parse-proxy-response.js.map +0 -1
  255. package/build/cjs/sdk/api.js +0 -117
  256. package/build/cjs/sdk/api.js.map +0 -1
  257. package/build/cjs/sdk/client.js +0 -156
  258. package/build/cjs/sdk/client.js.map +0 -1
  259. package/build/cjs/transports/http.js +0 -158
  260. package/build/cjs/transports/http.js.map +0 -1
  261. package/build/cjs/utils/addOriginToSpan.js +0 -11
  262. package/build/cjs/utils/addOriginToSpan.js.map +0 -1
  263. package/build/cjs/utils/baggage.js +0 -36
  264. package/build/cjs/utils/baggage.js.map +0 -1
  265. package/build/cjs/utils/commonjs.js +0 -13
  266. package/build/cjs/utils/commonjs.js.map +0 -1
  267. package/build/cjs/utils/createMissingInstrumentationContext.js +0 -11
  268. package/build/cjs/utils/createMissingInstrumentationContext.js.map +0 -1
  269. package/build/cjs/utils/debug.js +0 -23
  270. package/build/cjs/utils/debug.js.map +0 -1
  271. package/build/cjs/utils/ensureIsWrapped.js +0 -41
  272. package/build/cjs/utils/ensureIsWrapped.js.map +0 -1
  273. package/build/cjs/utils/envToBool.js +0 -32
  274. package/build/cjs/utils/envToBool.js.map +0 -1
  275. package/build/cjs/utils/errorhandling.js +0 -42
  276. package/build/cjs/utils/errorhandling.js.map +0 -1
  277. package/build/cjs/utils/getRequestUrl.js +0 -18
  278. package/build/cjs/utils/getRequestUrl.js.map +0 -1
  279. package/build/cjs/utils/module.js +0 -60
  280. package/build/cjs/utils/module.js.map +0 -1
  281. package/build/esm/cron/common.js +0 -54
  282. package/build/esm/cron/common.js.map +0 -1
  283. package/build/esm/cron/cron.js +0 -110
  284. package/build/esm/cron/cron.js.map +0 -1
  285. package/build/esm/cron/index.js +0 -13
  286. package/build/esm/cron/index.js.map +0 -1
  287. package/build/esm/cron/node-cron.js +0 -69
  288. package/build/esm/cron/node-cron.js.map +0 -1
  289. package/build/esm/cron/node-schedule.js +0 -63
  290. package/build/esm/cron/node-schedule.js.map +0 -1
  291. package/build/esm/integrations/anr/index.js +0 -234
  292. package/build/esm/integrations/anr/index.js.map +0 -1
  293. package/build/esm/integrations/anr/worker-script.js +0 -2
  294. package/build/esm/integrations/childProcess.js +0 -98
  295. package/build/esm/integrations/childProcess.js.map +0 -1
  296. package/build/esm/integrations/context.js +0 -451
  297. package/build/esm/integrations/context.js.map +0 -1
  298. package/build/esm/integrations/contextlines.js +0 -399
  299. package/build/esm/integrations/contextlines.js.map +0 -1
  300. package/build/esm/integrations/http/SentryHttpInstrumentation.js +0 -555
  301. package/build/esm/integrations/http/SentryHttpInstrumentation.js.map +0 -1
  302. package/build/esm/integrations/local-variables/common.js +0 -64
  303. package/build/esm/integrations/local-variables/common.js.map +0 -1
  304. package/build/esm/integrations/local-variables/index.js +0 -10
  305. package/build/esm/integrations/local-variables/index.js.map +0 -1
  306. package/build/esm/integrations/local-variables/local-variables-async.js +0 -140
  307. package/build/esm/integrations/local-variables/local-variables-async.js.map +0 -1
  308. package/build/esm/integrations/local-variables/local-variables-sync.js +0 -405
  309. package/build/esm/integrations/local-variables/local-variables-sync.js.map +0 -1
  310. package/build/esm/integrations/local-variables/worker-script.js +0 -2
  311. package/build/esm/integrations/modules.js +0 -133
  312. package/build/esm/integrations/modules.js.map +0 -1
  313. package/build/esm/integrations/node-fetch/SentryNodeFetchInstrumentation.js +0 -289
  314. package/build/esm/integrations/node-fetch/SentryNodeFetchInstrumentation.js.map +0 -1
  315. package/build/esm/integrations/onuncaughtexception.js +0 -131
  316. package/build/esm/integrations/onuncaughtexception.js.map +0 -1
  317. package/build/esm/integrations/onunhandledrejection.js +0 -86
  318. package/build/esm/integrations/onunhandledrejection.js.map +0 -1
  319. package/build/esm/integrations/processSession.js +0 -34
  320. package/build/esm/integrations/processSession.js.map +0 -1
  321. package/build/esm/integrations/spotlight.js +0 -98
  322. package/build/esm/integrations/spotlight.js.map +0 -1
  323. package/build/esm/integrations/tracing/vercelai/ai_sdk_attributes.js +0 -152
  324. package/build/esm/integrations/tracing/vercelai/ai_sdk_attributes.js.map +0 -1
  325. package/build/esm/integrations/winston.js +0 -149
  326. package/build/esm/integrations/winston.js.map +0 -1
  327. package/build/esm/logs/capture.js +0 -27
  328. package/build/esm/logs/capture.js.map +0 -1
  329. package/build/esm/logs/exports.js +0 -170
  330. package/build/esm/logs/exports.js.map +0 -1
  331. package/build/esm/nodeVersion.js +0 -8
  332. package/build/esm/nodeVersion.js.map +0 -1
  333. package/build/esm/otel/contextManager.js +0 -14
  334. package/build/esm/otel/contextManager.js.map +0 -1
  335. package/build/esm/otel/instrument.js +0 -135
  336. package/build/esm/otel/instrument.js.map +0 -1
  337. package/build/esm/proxy/base.js +0 -120
  338. package/build/esm/proxy/base.js.map +0 -1
  339. package/build/esm/proxy/index.js +0 -171
  340. package/build/esm/proxy/index.js.map +0 -1
  341. package/build/esm/proxy/parse-proxy-response.js +0 -102
  342. package/build/esm/proxy/parse-proxy-response.js.map +0 -1
  343. package/build/esm/sdk/api.js +0 -114
  344. package/build/esm/sdk/api.js.map +0 -1
  345. package/build/esm/sdk/client.js +0 -154
  346. package/build/esm/sdk/client.js.map +0 -1
  347. package/build/esm/transports/http.js +0 -156
  348. package/build/esm/transports/http.js.map +0 -1
  349. package/build/esm/utils/addOriginToSpan.js +0 -9
  350. package/build/esm/utils/addOriginToSpan.js.map +0 -1
  351. package/build/esm/utils/baggage.js +0 -34
  352. package/build/esm/utils/baggage.js.map +0 -1
  353. package/build/esm/utils/commonjs.js +0 -11
  354. package/build/esm/utils/commonjs.js.map +0 -1
  355. package/build/esm/utils/createMissingInstrumentationContext.js +0 -9
  356. package/build/esm/utils/createMissingInstrumentationContext.js.map +0 -1
  357. package/build/esm/utils/debug.js +0 -21
  358. package/build/esm/utils/debug.js.map +0 -1
  359. package/build/esm/utils/ensureIsWrapped.js +0 -39
  360. package/build/esm/utils/ensureIsWrapped.js.map +0 -1
  361. package/build/esm/utils/envToBool.js +0 -28
  362. package/build/esm/utils/envToBool.js.map +0 -1
  363. package/build/esm/utils/errorhandling.js +0 -40
  364. package/build/esm/utils/errorhandling.js.map +0 -1
  365. package/build/esm/utils/getRequestUrl.js +0 -16
  366. package/build/esm/utils/getRequestUrl.js.map +0 -1
  367. package/build/esm/utils/module.js +0 -58
  368. package/build/esm/utils/module.js.map +0 -1
  369. package/build/types/cron/common.d.ts +0 -5
  370. package/build/types/cron/common.d.ts.map +0 -1
  371. package/build/types/cron/cron.d.ts +0 -43
  372. package/build/types/cron/cron.d.ts.map +0 -1
  373. package/build/types/cron/index.d.ts +0 -10
  374. package/build/types/cron/index.d.ts.map +0 -1
  375. package/build/types/cron/node-cron.d.ts +0 -27
  376. package/build/types/cron/node-cron.d.ts.map +0 -1
  377. package/build/types/cron/node-schedule.d.ts +0 -19
  378. package/build/types/cron/node-schedule.d.ts.map +0 -1
  379. package/build/types/integrations/anr/common.d.ts +0 -52
  380. package/build/types/integrations/anr/common.d.ts.map +0 -1
  381. package/build/types/integrations/anr/index.d.ts +0 -13
  382. package/build/types/integrations/anr/index.d.ts.map +0 -1
  383. package/build/types/integrations/anr/worker.d.ts +0 -2
  384. package/build/types/integrations/anr/worker.d.ts.map +0 -1
  385. package/build/types/integrations/childProcess.d.ts +0 -20
  386. package/build/types/integrations/childProcess.d.ts.map +0 -1
  387. package/build/types/integrations/context.d.ts +0 -30
  388. package/build/types/integrations/context.d.ts.map +0 -1
  389. package/build/types/integrations/contextlines.d.ts +0 -31
  390. package/build/types/integrations/contextlines.d.ts.map +0 -1
  391. package/build/types/integrations/http/SentryHttpInstrumentation.d.ts +0 -131
  392. package/build/types/integrations/http/SentryHttpInstrumentation.d.ts.map +0 -1
  393. package/build/types/integrations/local-variables/common.d.ts +0 -66
  394. package/build/types/integrations/local-variables/common.d.ts.map +0 -1
  395. package/build/types/integrations/local-variables/index.d.ts +0 -4
  396. package/build/types/integrations/local-variables/index.d.ts.map +0 -1
  397. package/build/types/integrations/local-variables/local-variables-async.d.ts +0 -7
  398. package/build/types/integrations/local-variables/local-variables-async.d.ts.map +0 -1
  399. package/build/types/integrations/local-variables/local-variables-sync.d.ts +0 -34
  400. package/build/types/integrations/local-variables/local-variables-sync.d.ts.map +0 -1
  401. package/build/types/integrations/local-variables/worker.d.ts +0 -2
  402. package/build/types/integrations/local-variables/worker.d.ts.map +0 -1
  403. package/build/types/integrations/modules.d.ts +0 -17
  404. package/build/types/integrations/modules.d.ts.map +0 -1
  405. package/build/types/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts +0 -56
  406. package/build/types/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts.map +0 -1
  407. package/build/types/integrations/onuncaughtexception.d.ts +0 -31
  408. package/build/types/integrations/onuncaughtexception.d.ts.map +0 -1
  409. package/build/types/integrations/onunhandledrejection.d.ts +0 -23
  410. package/build/types/integrations/onunhandledrejection.d.ts.map +0 -1
  411. package/build/types/integrations/processSession.d.ts +0 -5
  412. package/build/types/integrations/processSession.d.ts.map +0 -1
  413. package/build/types/integrations/spotlight.d.ts +0 -18
  414. package/build/types/integrations/spotlight.d.ts.map +0 -1
  415. package/build/types/integrations/tracing/vercelai/ai_sdk_attributes.d.ts +0 -669
  416. package/build/types/integrations/tracing/vercelai/ai_sdk_attributes.d.ts.map +0 -1
  417. package/build/types/integrations/winston.d.ts +0 -44
  418. package/build/types/integrations/winston.d.ts.map +0 -1
  419. package/build/types/logs/capture.d.ts +0 -11
  420. package/build/types/logs/capture.d.ts.map +0 -1
  421. package/build/types/logs/exports.d.ts +0 -150
  422. package/build/types/logs/exports.d.ts.map +0 -1
  423. package/build/types/nodeVersion.d.ts +0 -8
  424. package/build/types/nodeVersion.d.ts.map +0 -1
  425. package/build/types/otel/contextManager.d.ts +0 -10
  426. package/build/types/otel/contextManager.d.ts.map +0 -1
  427. package/build/types/otel/instrument.d.ts +0 -23
  428. package/build/types/otel/instrument.d.ts.map +0 -1
  429. package/build/types/proxy/base.d.ts +0 -65
  430. package/build/types/proxy/base.d.ts.map +0 -1
  431. package/build/types/proxy/helpers.d.ts +0 -42
  432. package/build/types/proxy/helpers.d.ts.map +0 -1
  433. package/build/types/proxy/index.d.ts +0 -73
  434. package/build/types/proxy/index.d.ts.map +0 -1
  435. package/build/types/proxy/parse-proxy-response.d.ts +0 -43
  436. package/build/types/proxy/parse-proxy-response.d.ts.map +0 -1
  437. package/build/types/sdk/api.d.ts +0 -8
  438. package/build/types/sdk/api.d.ts.map +0 -1
  439. package/build/types/sdk/client.d.ts +0 -29
  440. package/build/types/sdk/client.d.ts.map +0 -1
  441. package/build/types/sdk/scope.d.ts +0 -7
  442. package/build/types/sdk/scope.d.ts.map +0 -1
  443. package/build/types/transports/http-module.d.ts +0 -31
  444. package/build/types/transports/http-module.d.ts.map +0 -1
  445. package/build/types/transports/http.d.ts +0 -21
  446. package/build/types/transports/http.d.ts.map +0 -1
  447. package/build/types/transports/index.d.ts +0 -3
  448. package/build/types/transports/index.d.ts.map +0 -1
  449. package/build/types/utils/addOriginToSpan.d.ts +0 -5
  450. package/build/types/utils/addOriginToSpan.d.ts.map +0 -1
  451. package/build/types/utils/baggage.d.ts +0 -6
  452. package/build/types/utils/baggage.d.ts.map +0 -1
  453. package/build/types/utils/commonjs.d.ts +0 -3
  454. package/build/types/utils/commonjs.d.ts.map +0 -1
  455. package/build/types/utils/createMissingInstrumentationContext.d.ts +0 -3
  456. package/build/types/utils/createMissingInstrumentationContext.d.ts.map +0 -1
  457. package/build/types/utils/debug.d.ts +0 -5
  458. package/build/types/utils/debug.d.ts.map +0 -1
  459. package/build/types/utils/ensureIsWrapped.d.ts +0 -5
  460. package/build/types/utils/ensureIsWrapped.d.ts.map +0 -1
  461. package/build/types/utils/entry-point.d.ts +0 -24
  462. package/build/types/utils/entry-point.d.ts.map +0 -1
  463. package/build/types/utils/envToBool.d.ts +0 -13
  464. package/build/types/utils/envToBool.d.ts.map +0 -1
  465. package/build/types/utils/errorhandling.d.ts +0 -5
  466. package/build/types/utils/errorhandling.d.ts.map +0 -1
  467. package/build/types/utils/getRequestUrl.d.ts +0 -5
  468. package/build/types/utils/getRequestUrl.d.ts.map +0 -1
  469. package/build/types/utils/module.d.ts +0 -3
  470. package/build/types/utils/module.d.ts.map +0 -1
  471. package/build/types/utils/prepareEvent.d.ts +0 -17
  472. package/build/types/utils/prepareEvent.d.ts.map +0 -1
  473. package/build/types-ts3.8/cron/common.d.ts +0 -5
  474. package/build/types-ts3.8/cron/cron.d.ts +0 -43
  475. package/build/types-ts3.8/cron/index.d.ts +0 -10
  476. package/build/types-ts3.8/cron/node-cron.d.ts +0 -27
  477. package/build/types-ts3.8/cron/node-schedule.d.ts +0 -19
  478. package/build/types-ts3.8/integrations/anr/common.d.ts +0 -52
  479. package/build/types-ts3.8/integrations/anr/index.d.ts +0 -13
  480. package/build/types-ts3.8/integrations/anr/worker.d.ts +0 -2
  481. package/build/types-ts3.8/integrations/childProcess.d.ts +0 -20
  482. package/build/types-ts3.8/integrations/context.d.ts +0 -30
  483. package/build/types-ts3.8/integrations/contextlines.d.ts +0 -31
  484. package/build/types-ts3.8/integrations/http/SentryHttpInstrumentation.d.ts +0 -133
  485. package/build/types-ts3.8/integrations/local-variables/common.d.ts +0 -66
  486. package/build/types-ts3.8/integrations/local-variables/index.d.ts +0 -4
  487. package/build/types-ts3.8/integrations/local-variables/local-variables-async.d.ts +0 -7
  488. package/build/types-ts3.8/integrations/local-variables/local-variables-sync.d.ts +0 -34
  489. package/build/types-ts3.8/integrations/local-variables/worker.d.ts +0 -2
  490. package/build/types-ts3.8/integrations/modules.d.ts +0 -17
  491. package/build/types-ts3.8/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts +0 -56
  492. package/build/types-ts3.8/integrations/onuncaughtexception.d.ts +0 -31
  493. package/build/types-ts3.8/integrations/onunhandledrejection.d.ts +0 -23
  494. package/build/types-ts3.8/integrations/processSession.d.ts +0 -5
  495. package/build/types-ts3.8/integrations/spotlight.d.ts +0 -18
  496. package/build/types-ts3.8/integrations/tracing/vercelai/ai_sdk_attributes.d.ts +0 -669
  497. package/build/types-ts3.8/integrations/winston.d.ts +0 -44
  498. package/build/types-ts3.8/logs/capture.d.ts +0 -18
  499. package/build/types-ts3.8/logs/exports.d.ts +0 -150
  500. package/build/types-ts3.8/nodeVersion.d.ts +0 -8
  501. package/build/types-ts3.8/otel/contextManager.d.ts +0 -10
  502. package/build/types-ts3.8/otel/instrument.d.ts +0 -23
  503. package/build/types-ts3.8/proxy/base.d.ts +0 -60
  504. package/build/types-ts3.8/proxy/helpers.d.ts +0 -38
  505. package/build/types-ts3.8/proxy/index.d.ts +0 -74
  506. package/build/types-ts3.8/proxy/parse-proxy-response.d.ts +0 -40
  507. package/build/types-ts3.8/sdk/api.d.ts +0 -8
  508. package/build/types-ts3.8/sdk/client.d.ts +0 -32
  509. package/build/types-ts3.8/sdk/scope.d.ts +0 -7
  510. package/build/types-ts3.8/transports/http-module.d.ts +0 -28
  511. package/build/types-ts3.8/transports/http.d.ts +0 -20
  512. package/build/types-ts3.8/transports/index.d.ts +0 -3
  513. package/build/types-ts3.8/utils/addOriginToSpan.d.ts +0 -5
  514. package/build/types-ts3.8/utils/baggage.d.ts +0 -6
  515. package/build/types-ts3.8/utils/commonjs.d.ts +0 -3
  516. package/build/types-ts3.8/utils/createMissingInstrumentationContext.d.ts +0 -3
  517. package/build/types-ts3.8/utils/debug.d.ts +0 -5
  518. package/build/types-ts3.8/utils/ensureIsWrapped.d.ts +0 -5
  519. package/build/types-ts3.8/utils/entry-point.d.ts +0 -24
  520. package/build/types-ts3.8/utils/envToBool.d.ts +0 -13
  521. package/build/types-ts3.8/utils/errorhandling.d.ts +0 -5
  522. package/build/types-ts3.8/utils/getRequestUrl.d.ts +0 -5
  523. package/build/types-ts3.8/utils/module.d.ts +0 -3
  524. package/build/types-ts3.8/utils/prepareEvent.d.ts +0 -17
@@ -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":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAyBA,MAAM,QAAS,GAAE,MAAM,CAAC,wBAAwB,CAAC;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* 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
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/proxy/index.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/no-unused-vars */\nimport type * as http from 'node:http';\nimport type { OutgoingHttpHeaders } from 'node:http';\nimport * as net from 'node:net';\nimport * as tls from 'node:tls';\nimport { logger } from '@sentry/core';\nimport type { AgentConnectOpts } from './base';\nimport { Agent } from './base';\nimport { parseProxyResponse } from './parse-proxy-response';\n\nfunction debug(...args: unknown[]): void {\n logger.log('[https-proxy-agent]', ...args);\n}\n\ntype Protocol<T> = T extends `${infer Protocol}:${infer _}` ? Protocol : never;\n\ntype ConnectOptsMap = {\n http: Omit<net.TcpNetConnectOpts, 'host' | 'port'>;\n https: Omit<tls.ConnectionOptions, 'host' | 'port'>;\n};\n\ntype ConnectOpts<T> = {\n [P in keyof ConnectOptsMap]: Protocol<T> extends P ? ConnectOptsMap[P] : never;\n}[keyof ConnectOptsMap];\n\nexport type HttpsProxyAgentOptions<T> = ConnectOpts<T> &\n http.AgentOptions & {\n headers?: OutgoingHttpHeaders | (() => OutgoingHttpHeaders);\n };\n\n/**\n * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to\n * the specified \"HTTP(s) proxy server\" in order to proxy HTTPS requests.\n *\n * Outgoing HTTP requests are first tunneled through the proxy server using the\n * `CONNECT` HTTP request method to establish a connection to the proxy server,\n * and then the proxy server connects to the destination target and issues the\n * HTTP request from the proxy server.\n *\n * `https:` requests have their socket connection upgraded to TLS once\n * the connection to the proxy server has been established.\n */\nexport class HttpsProxyAgent<Uri extends string> extends Agent {\n static protocols = ['http', 'https'] as const;\n\n readonly proxy: URL;\n proxyHeaders: OutgoingHttpHeaders | (() => OutgoingHttpHeaders);\n connectOpts: net.TcpNetConnectOpts & tls.ConnectionOptions;\n\n constructor(proxy: Uri | URL, opts?: HttpsProxyAgentOptions<Uri>) {\n super(opts);\n this.options = {};\n this.proxy = typeof proxy === 'string' ? new URL(proxy) : proxy;\n this.proxyHeaders = opts?.headers ?? {};\n debug('Creating new HttpsProxyAgent instance: %o', this.proxy.href);\n\n // Trim off the brackets from IPv6 addresses\n const host = (this.proxy.hostname || this.proxy.host).replace(/^\\[|\\]$/g, '');\n const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === 'https:' ? 443 : 80;\n this.connectOpts = {\n // Attempt to negotiate http/1.1 for proxy servers that support http/2\n ALPNProtocols: ['http/1.1'],\n ...(opts ? omit(opts, 'headers') : null),\n host,\n port,\n };\n }\n\n /**\n * Called when the node-core HTTP client library is creating a\n * new HTTP request.\n */\n async connect(req: http.ClientRequest, opts: AgentConnectOpts): Promise<net.Socket> {\n const { proxy } = this;\n\n if (!opts.host) {\n throw new TypeError('No \"host\" provided');\n }\n\n // Create a socket connection to the proxy server.\n let socket: net.Socket;\n if (proxy.protocol === 'https:') {\n debug('Creating `tls.Socket`: %o', this.connectOpts);\n const servername = this.connectOpts.servername || this.connectOpts.host;\n socket = tls.connect({\n ...this.connectOpts,\n servername: servername && net.isIP(servername) ? undefined : servername,\n });\n } else {\n debug('Creating `net.Socket`: %o', this.connectOpts);\n socket = net.connect(this.connectOpts);\n }\n\n const headers: OutgoingHttpHeaders =\n typeof this.proxyHeaders === 'function' ? this.proxyHeaders() : { ...this.proxyHeaders };\n const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;\n let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\\r\\n`;\n\n // Inject the `Proxy-Authorization` header if necessary.\n if (proxy.username || proxy.password) {\n const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`;\n headers['Proxy-Authorization'] = `Basic ${Buffer.from(auth).toString('base64')}`;\n }\n\n headers.Host = `${host}:${opts.port}`;\n\n if (!headers['Proxy-Connection']) {\n headers['Proxy-Connection'] = this.keepAlive ? 'Keep-Alive' : 'close';\n }\n for (const name of Object.keys(headers)) {\n payload += `${name}: ${headers[name]}\\r\\n`;\n }\n\n const proxyResponsePromise = parseProxyResponse(socket);\n\n socket.write(`${payload}\\r\\n`);\n\n const { connect, buffered } = await proxyResponsePromise;\n req.emit('proxyConnect', connect);\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore Not EventEmitter in Node types\n this.emit('proxyConnect', connect, req);\n\n if (connect.statusCode === 200) {\n req.once('socket', resume);\n\n if (opts.secureEndpoint) {\n // The proxy is connecting to a TLS server, so upgrade\n // this socket connection to a TLS connection.\n debug('Upgrading socket connection to TLS');\n const servername = opts.servername || opts.host;\n return tls.connect({\n ...omit(opts, 'host', 'path', 'port'),\n socket,\n servername: net.isIP(servername) ? undefined : servername,\n });\n }\n\n return socket;\n }\n\n // Some other status code that's not 200... need to re-play the HTTP\n // header \"data\" events onto the socket once the HTTP machinery is\n // attached so that the node core `http` can parse and handle the\n // error status code.\n\n // Close the original socket, and a new \"fake\" socket is returned\n // instead, so that the proxy doesn't get the HTTP request\n // written to it (which may contain `Authorization` headers or other\n // sensitive data).\n //\n // See: https://hackerone.com/reports/541502\n socket.destroy();\n\n const fakeSocket = new net.Socket({ writable: false });\n fakeSocket.readable = true;\n\n // Need to wait for the \"socket\" event to re-play the \"data\" events.\n req.once('socket', (s: net.Socket) => {\n debug('Replaying proxy buffer for failed request');\n // Replay the \"buffered\" Buffer onto the fake `socket`, since at\n // this point the HTTP module machinery has been hooked up for\n // the user.\n s.push(buffered);\n s.push(null);\n });\n\n return fakeSocket;\n }\n}\n\nfunction resume(socket: net.Socket | tls.TLSSocket): void {\n socket.resume();\n}\n\nfunction omit<T extends object, K extends [...(keyof T)[]]>(\n obj: T,\n ...keys: K\n): {\n [K2 in Exclude<keyof T, K[number]>]: T[K2];\n} {\n const ret = {} as {\n [K in keyof typeof obj]: (typeof obj)[K];\n };\n let key: keyof typeof obj;\n for (key in obj) {\n if (!keys.includes(key)) {\n ret[key] = obj[key];\n }\n }\n return ret;\n}\n"],"names":[],"mappings":";;;;;;AAuCA,SAAS,KAAK,CAAC,GAAG,IAAI,EAAmB;AACzC,EAAE,MAAM,CAAC,GAAG,CAAC,qBAAqB,EAAE,GAAG,IAAI,CAAC;AAC5C;;AAkBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,eAAA,SAAA,KAAA,CAAA;AACA,EAAA,OAAA,YAAA,GAAA,CAAA,IAAA,CAAA,SAAA,GAAA,CAAA,MAAA,EAAA,OAAA,EAAA;;AAMA,EAAA,WAAA,CAAA,KAAA,EAAA,IAAA,EAAA;AACA,IAAA,KAAA,CAAA,IAAA,CAAA;AACA,IAAA,IAAA,CAAA,OAAA,GAAA,EAAA;AACA,IAAA,IAAA,CAAA,KAAA,GAAA,OAAA,KAAA,KAAA,QAAA,GAAA,IAAA,GAAA,CAAA,KAAA,CAAA,GAAA,KAAA;AACA,IAAA,IAAA,CAAA,YAAA,GAAA,IAAA,EAAA,OAAA,IAAA,EAAA;AACA,IAAA,KAAA,CAAA,2CAAA,EAAA,IAAA,CAAA,KAAA,CAAA,IAAA,CAAA;;AAEA;AACA,IAAA,MAAA,IAAA,GAAA,CAAA,IAAA,CAAA,KAAA,CAAA,QAAA,IAAA,IAAA,CAAA,KAAA,CAAA,IAAA,EAAA,OAAA,CAAA,UAAA,EAAA,EAAA,CAAA;AACA,IAAA,MAAA,IAAA,GAAA,IAAA,CAAA,KAAA,CAAA,IAAA,GAAA,QAAA,CAAA,IAAA,CAAA,KAAA,CAAA,IAAA,EAAA,EAAA,CA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A,eAAA,CAAA,YAAA,EAAA;;AAEA,SAAA,MAAA,CAAA,MAAA,EAAA;AACA,EAAA,MAAA,CAAA,MAAA,EAAA;AACA;;AAEA,SAAA,IAAA;AACA,EAAA,GAAA;AACA,EAAA,GAAA;AACA;;AAEA,CAAA;AACA,EAAA,MAAA,GAAA,GAAA;;AAEA;AACA,EAAA,IAAA,GAAA;AACA,EAAA,KAAA,GAAA,IAAA,GAAA,EAAA;AACA,IAAA,IAAA,CAAA,IAAA,CAAA,QAAA,CAAA,GAAA,CAAA,EAAA;AACA,MAAA,GAAA,CAAA,GAAA,CAAA,GAAA,GAAA,CAAA,GAAA,CAAA;AACA;AACA;AACA,EAAA,OAAA,GAAA;AACA;;;;"}
@@ -1,102 +0,0 @@
1
- import { logger } from '@sentry/core';
2
-
3
- function debug(...args) {
4
- logger.log('[https-proxy-agent:parse-proxy-response]', ...args);
5
- }
6
-
7
- function parseProxyResponse(socket) {
8
- return new Promise((resolve, reject) => {
9
- // we need to buffer any HTTP traffic that happens with the proxy before we get
10
- // the CONNECT response, so that if the response is anything other than an "200"
11
- // response code, then we can re-play the "data" events on the socket once the
12
- // HTTP parser is hooked up...
13
- let buffersLength = 0;
14
- const buffers = [];
15
-
16
- function read() {
17
- const b = socket.read();
18
- if (b) ondata(b);
19
- else socket.once('readable', read);
20
- }
21
-
22
- function cleanup() {
23
- socket.removeListener('end', onend);
24
- socket.removeListener('error', onerror);
25
- socket.removeListener('readable', read);
26
- }
27
-
28
- function onend() {
29
- cleanup();
30
- debug('onend');
31
- reject(new Error('Proxy connection ended before receiving CONNECT response'));
32
- }
33
-
34
- function onerror(err) {
35
- cleanup();
36
- debug('onerror %o', err);
37
- reject(err);
38
- }
39
-
40
- function ondata(b) {
41
- buffers.push(b);
42
- buffersLength += b.length;
43
-
44
- const buffered = Buffer.concat(buffers, buffersLength);
45
- const endOfHeaders = buffered.indexOf('\r\n\r\n');
46
-
47
- if (endOfHeaders === -1) {
48
- // keep buffering
49
- debug('have not received end of HTTP headers yet...');
50
- read();
51
- return;
52
- }
53
-
54
- const headerParts = buffered.subarray(0, endOfHeaders).toString('ascii').split('\r\n');
55
- const firstLine = headerParts.shift();
56
- if (!firstLine) {
57
- socket.destroy();
58
- return reject(new Error('No header received from proxy CONNECT response'));
59
- }
60
- const firstLineParts = firstLine.split(' ');
61
- const statusCode = +(firstLineParts[1] || 0);
62
- const statusText = firstLineParts.slice(2).join(' ');
63
- const headers = {};
64
- for (const header of headerParts) {
65
- if (!header) continue;
66
- const firstColon = header.indexOf(':');
67
- if (firstColon === -1) {
68
- socket.destroy();
69
- return reject(new Error(`Invalid header from proxy CONNECT response: "${header}"`));
70
- }
71
- const key = header.slice(0, firstColon).toLowerCase();
72
- const value = header.slice(firstColon + 1).trimStart();
73
- const current = headers[key];
74
- if (typeof current === 'string') {
75
- headers[key] = [current, value];
76
- } else if (Array.isArray(current)) {
77
- current.push(value);
78
- } else {
79
- headers[key] = value;
80
- }
81
- }
82
- debug('got proxy server response: %o %o', firstLine, headers);
83
- cleanup();
84
- resolve({
85
- connect: {
86
- statusCode,
87
- statusText,
88
- headers,
89
- },
90
- buffered,
91
- });
92
- }
93
-
94
- socket.on('error', onerror);
95
- socket.on('end', onend);
96
-
97
- read();
98
- });
99
- }
100
-
101
- export { parseProxyResponse };
102
- //# sourceMappingURL=parse-proxy-response.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parse-proxy-response.js","sources":["../../../src/proxy/parse-proxy-response.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-function-return-type */\n/* eslint-disable jsdoc/require-jsdoc */\nimport type { IncomingHttpHeaders } from 'node:http';\nimport type { Readable } from 'node:stream';\nimport { logger } from '@sentry/core';\n\nfunction debug(...args: unknown[]): void {\n logger.log('[https-proxy-agent:parse-proxy-response]', ...args);\n}\n\nexport interface ConnectResponse {\n statusCode: number;\n statusText: string;\n headers: IncomingHttpHeaders;\n}\n\nexport function parseProxyResponse(socket: Readable): Promise<{ connect: ConnectResponse; buffered: Buffer }> {\n return new Promise((resolve, reject) => {\n // we need to buffer any HTTP traffic that happens with the proxy before we get\n // the CONNECT response, so that if the response is anything other than an \"200\"\n // response code, then we can re-play the \"data\" events on the socket once the\n // HTTP parser is hooked up...\n let buffersLength = 0;\n const buffers: Buffer[] = [];\n\n function read() {\n const b = socket.read();\n if (b) ondata(b);\n else socket.once('readable', read);\n }\n\n function cleanup() {\n socket.removeListener('end', onend);\n socket.removeListener('error', onerror);\n socket.removeListener('readable', read);\n }\n\n function onend() {\n cleanup();\n debug('onend');\n reject(new Error('Proxy connection ended before receiving CONNECT response'));\n }\n\n function onerror(err: Error) {\n cleanup();\n debug('onerror %o', err);\n reject(err);\n }\n\n function ondata(b: Buffer) {\n buffers.push(b);\n buffersLength += b.length;\n\n const buffered = Buffer.concat(buffers, buffersLength);\n const endOfHeaders = buffered.indexOf('\\r\\n\\r\\n');\n\n if (endOfHeaders === -1) {\n // keep buffering\n debug('have not received end of HTTP headers yet...');\n read();\n return;\n }\n\n const headerParts = buffered.subarray(0, endOfHeaders).toString('ascii').split('\\r\\n');\n const firstLine = headerParts.shift();\n if (!firstLine) {\n socket.destroy();\n return reject(new Error('No header received from proxy CONNECT response'));\n }\n const firstLineParts = firstLine.split(' ');\n const statusCode = +(firstLineParts[1] || 0);\n const statusText = firstLineParts.slice(2).join(' ');\n const headers: IncomingHttpHeaders = {};\n for (const header of headerParts) {\n if (!header) continue;\n const firstColon = header.indexOf(':');\n if (firstColon === -1) {\n socket.destroy();\n return reject(new Error(`Invalid header from proxy CONNECT response: \"${header}\"`));\n }\n const key = header.slice(0, firstColon).toLowerCase();\n const value = header.slice(firstColon + 1).trimStart();\n const current = headers[key];\n if (typeof current === 'string') {\n headers[key] = [current, value];\n } else if (Array.isArray(current)) {\n current.push(value);\n } else {\n headers[key] = value;\n }\n }\n debug('got proxy server response: %o %o', firstLine, headers);\n cleanup();\n resolve({\n connect: {\n statusCode,\n statusText,\n headers,\n },\n buffered,\n });\n }\n\n socket.on('error', onerror);\n socket.on('end', onend);\n\n read();\n });\n}\n"],"names":[],"mappings":";;AAkCA,SAAS,KAAK,CAAC,GAAG,IAAI,EAAmB;AACzC,EAAE,MAAM,CAAC,GAAG,CAAC,0CAA0C,EAAE,GAAG,IAAI,CAAC;AACjE;;AAQO,SAAS,kBAAkB,CAAC,MAAM,EAAqE;AAC9G,EAAE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK;AAC1C;AACA;AACA;AACA;AACA,IAAI,IAAI,aAAc,GAAE,CAAC;AACzB,IAAI,MAAM,OAAO,GAAa,EAAE;;AAEhC,IAAI,SAAS,IAAI,GAAG;AACpB,MAAM,MAA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O,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;AAC3C,UAAU,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;AAC7B,eAAe;AACf,UAAU,OAAO,CAAC,GAAG,CAAA,GAAI,KAAK;AAC9B;AACA;AACA,MAAM,KAAK,CAAC,kCAAkC,EAAE,SAAS,EAAE,OAAO,CAAC;AACnE,MAAM,OAAO,EAAE;AACf,MAAM,OAAO,CAAC;AACd,QAAQ,OAAO,EAAE;AACjB,UAAU,UAAU;AACpB,UAAU,UAAU;AACpB,UAAU,OAAO;AACjB,SAAS;AACT,QAAQ,QAAQ;AAChB,OAAO,CAAC;AACR;;AAEA,IAAI,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;AAC/B,IAAI,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;;AAE3B,IAAI,IAAI,EAAE;AACV,GAAG,CAAC;AACJ;;;;"}
@@ -1,114 +0,0 @@
1
- import { createStackParser, nodeStackLineParser, GLOBAL_OBJ } from '@sentry/core';
2
- import { createGetModuleFromFilename } from '../utils/module.js';
3
-
4
- /**
5
- * Returns a release dynamically from environment variables.
6
- */
7
- // eslint-disable-next-line complexity
8
- function getSentryRelease(fallback) {
9
- // Always read first as Sentry takes this as precedence
10
- if (process.env.SENTRY_RELEASE) {
11
- return process.env.SENTRY_RELEASE;
12
- }
13
-
14
- // This supports the variable that sentry-webpack-plugin injects
15
- if (GLOBAL_OBJ.SENTRY_RELEASE?.id) {
16
- return GLOBAL_OBJ.SENTRY_RELEASE.id;
17
- }
18
-
19
- // This list is in approximate alpha order, separated into 3 categories:
20
- // 1. Git providers
21
- // 2. CI providers with specific environment variables (has the provider name in the variable name)
22
- // 3. CI providers with generic environment variables (checked for last to prevent possible false positives)
23
-
24
- const possibleReleaseNameOfGitProvider =
25
- // GitHub Actions - https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables
26
- process.env['GITHUB_SHA'] ||
27
- // GitLab CI - https://docs.gitlab.com/ee/ci/variables/predefined_variables.html
28
- process.env['CI_MERGE_REQUEST_SOURCE_BRANCH_SHA'] ||
29
- process.env['CI_BUILD_REF'] ||
30
- process.env['CI_COMMIT_SHA'] ||
31
- // Bitbucket - https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/
32
- process.env['BITBUCKET_COMMIT'];
33
-
34
- const possibleReleaseNameOfCiProvidersWithSpecificEnvVar =
35
- // AppVeyor - https://www.appveyor.com/docs/environment-variables/
36
- process.env['APPVEYOR_PULL_REQUEST_HEAD_COMMIT'] ||
37
- process.env['APPVEYOR_REPO_COMMIT'] ||
38
- // AWS CodeBuild - https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html
39
- process.env['CODEBUILD_RESOLVED_SOURCE_VERSION'] ||
40
- // AWS Amplify - https://docs.aws.amazon.com/amplify/latest/userguide/environment-variables.html
41
- process.env['AWS_COMMIT_ID'] ||
42
- // Azure Pipelines - https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml
43
- process.env['BUILD_SOURCEVERSION'] ||
44
- // Bitrise - https://devcenter.bitrise.io/builds/available-environment-variables/
45
- process.env['GIT_CLONE_COMMIT_HASH'] ||
46
- // Buddy CI - https://buddy.works/docs/pipelines/environment-variables#default-environment-variables
47
- process.env['BUDDY_EXECUTION_REVISION'] ||
48
- // Builtkite - https://buildkite.com/docs/pipelines/environment-variables
49
- process.env['BUILDKITE_COMMIT'] ||
50
- // CircleCI - https://circleci.com/docs/variables/
51
- process.env['CIRCLE_SHA1'] ||
52
- // Cirrus CI - https://cirrus-ci.org/guide/writing-tasks/#environment-variables
53
- process.env['CIRRUS_CHANGE_IN_REPO'] ||
54
- // Codefresh - https://codefresh.io/docs/docs/codefresh-yaml/variables/
55
- process.env['CF_REVISION'] ||
56
- // Codemagic - https://docs.codemagic.io/yaml-basic-configuration/environment-variables/
57
- process.env['CM_COMMIT'] ||
58
- // Cloudflare Pages - https://developers.cloudflare.com/pages/platform/build-configuration/#environment-variables
59
- process.env['CF_PAGES_COMMIT_SHA'] ||
60
- // Drone - https://docs.drone.io/pipeline/environment/reference/
61
- process.env['DRONE_COMMIT_SHA'] ||
62
- // Flightcontrol - https://www.flightcontrol.dev/docs/guides/flightcontrol/environment-variables#built-in-environment-variables
63
- process.env['FC_GIT_COMMIT_SHA'] ||
64
- // Heroku #1 https://devcenter.heroku.com/articles/heroku-ci
65
- process.env['HEROKU_TEST_RUN_COMMIT_VERSION'] ||
66
- // Heroku #2 https://docs.sentry.io/product/integrations/deployment/heroku/#configure-releases
67
- process.env['HEROKU_SLUG_COMMIT'] ||
68
- // Railway - https://docs.railway.app/reference/variables#git-variables
69
- process.env['RAILWAY_GIT_COMMIT_SHA'] ||
70
- // Render - https://render.com/docs/environment-variables
71
- process.env['RENDER_GIT_COMMIT'] ||
72
- // Semaphore CI - https://docs.semaphoreci.com/ci-cd-environment/environment-variables
73
- process.env['SEMAPHORE_GIT_SHA'] ||
74
- // TravisCI - https://docs.travis-ci.com/user/environment-variables/#default-environment-variables
75
- process.env['TRAVIS_PULL_REQUEST_SHA'] ||
76
- // Vercel - https://vercel.com/docs/v2/build-step#system-environment-variables
77
- process.env['VERCEL_GIT_COMMIT_SHA'] ||
78
- process.env['VERCEL_GITHUB_COMMIT_SHA'] ||
79
- process.env['VERCEL_GITLAB_COMMIT_SHA'] ||
80
- process.env['VERCEL_BITBUCKET_COMMIT_SHA'] ||
81
- // Zeit (now known as Vercel)
82
- process.env['ZEIT_GITHUB_COMMIT_SHA'] ||
83
- process.env['ZEIT_GITLAB_COMMIT_SHA'] ||
84
- process.env['ZEIT_BITBUCKET_COMMIT_SHA'];
85
-
86
- const possibleReleaseNameOfCiProvidersWithGenericEnvVar =
87
- // CloudBees CodeShip - https://docs.cloudbees.com/docs/cloudbees-codeship/latest/pro-builds-and-configuration/environment-variables
88
- process.env['CI_COMMIT_ID'] ||
89
- // Coolify - https://coolify.io/docs/knowledge-base/environment-variables
90
- process.env['SOURCE_COMMIT'] ||
91
- // Heroku #3 https://devcenter.heroku.com/changelog-items/630
92
- process.env['SOURCE_VERSION'] ||
93
- // Jenkins - https://plugins.jenkins.io/git/#environment-variables
94
- process.env['GIT_COMMIT'] ||
95
- // Netlify - https://docs.netlify.com/configure-builds/environment-variables/#build-metadata
96
- process.env['COMMIT_REF'] ||
97
- // TeamCity - https://www.jetbrains.com/help/teamcity/predefined-build-parameters.html
98
- process.env['BUILD_VCS_NUMBER'] ||
99
- // Woodpecker CI - https://woodpecker-ci.org/docs/usage/environment
100
- process.env['CI_COMMIT_SHA'];
101
-
102
- return (
103
- possibleReleaseNameOfGitProvider ||
104
- possibleReleaseNameOfCiProvidersWithSpecificEnvVar ||
105
- possibleReleaseNameOfCiProvidersWithGenericEnvVar ||
106
- fallback
107
- );
108
- }
109
-
110
- /** Node.js stack parser */
111
- const defaultStackParser = createStackParser(nodeStackLineParser(createGetModuleFromFilename()));
112
-
113
- export { defaultStackParser, getSentryRelease };
114
- //# sourceMappingURL=api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"api.js","sources":["../../../src/sdk/api.ts"],"sourcesContent":["// PUBLIC APIS\n\nimport type { StackParser } from '@sentry/core';\nimport { createStackParser, GLOBAL_OBJ, nodeStackLineParser } from '@sentry/core';\nimport { createGetModuleFromFilename } from '../utils/module';\n\n/**\n * Returns a release dynamically from environment variables.\n */\n// eslint-disable-next-line complexity\nexport function getSentryRelease(fallback?: string): string | undefined {\n // Always read first as Sentry takes this as precedence\n if (process.env.SENTRY_RELEASE) {\n return process.env.SENTRY_RELEASE;\n }\n\n // This supports the variable that sentry-webpack-plugin injects\n if (GLOBAL_OBJ.SENTRY_RELEASE?.id) {\n return GLOBAL_OBJ.SENTRY_RELEASE.id;\n }\n\n // This list is in approximate alpha order, separated into 3 categories:\n // 1. Git providers\n // 2. CI providers with specific environment variables (has the provider name in the variable name)\n // 3. CI providers with generic environment variables (checked for last to prevent possible false positives)\n\n const possibleReleaseNameOfGitProvider =\n // GitHub Actions - https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables\n process.env['GITHUB_SHA'] ||\n // GitLab CI - https://docs.gitlab.com/ee/ci/variables/predefined_variables.html\n process.env['CI_MERGE_REQUEST_SOURCE_BRANCH_SHA'] ||\n process.env['CI_BUILD_REF'] ||\n process.env['CI_COMMIT_SHA'] ||\n // Bitbucket - https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/\n process.env['BITBUCKET_COMMIT'];\n\n const possibleReleaseNameOfCiProvidersWithSpecificEnvVar =\n // AppVeyor - https://www.appveyor.com/docs/environment-variables/\n process.env['APPVEYOR_PULL_REQUEST_HEAD_COMMIT'] ||\n process.env['APPVEYOR_REPO_COMMIT'] ||\n // AWS CodeBuild - https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html\n process.env['CODEBUILD_RESOLVED_SOURCE_VERSION'] ||\n // AWS Amplify - https://docs.aws.amazon.com/amplify/latest/userguide/environment-variables.html\n process.env['AWS_COMMIT_ID'] ||\n // Azure Pipelines - https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml\n process.env['BUILD_SOURCEVERSION'] ||\n // Bitrise - https://devcenter.bitrise.io/builds/available-environment-variables/\n process.env['GIT_CLONE_COMMIT_HASH'] ||\n // Buddy CI - https://buddy.works/docs/pipelines/environment-variables#default-environment-variables\n process.env['BUDDY_EXECUTION_REVISION'] ||\n // Builtkite - https://buildkite.com/docs/pipelines/environment-variables\n process.env['BUILDKITE_COMMIT'] ||\n // CircleCI - https://circleci.com/docs/variables/\n process.env['CIRCLE_SHA1'] ||\n // Cirrus CI - https://cirrus-ci.org/guide/writing-tasks/#environment-variables\n process.env['CIRRUS_CHANGE_IN_REPO'] ||\n // Codefresh - https://codefresh.io/docs/docs/codefresh-yaml/variables/\n process.env['CF_REVISION'] ||\n // Codemagic - https://docs.codemagic.io/yaml-basic-configuration/environment-variables/\n process.env['CM_COMMIT'] ||\n // Cloudflare Pages - https://developers.cloudflare.com/pages/platform/build-configuration/#environment-variables\n process.env['CF_PAGES_COMMIT_SHA'] ||\n // Drone - https://docs.drone.io/pipeline/environment/reference/\n process.env['DRONE_COMMIT_SHA'] ||\n // Flightcontrol - https://www.flightcontrol.dev/docs/guides/flightcontrol/environment-variables#built-in-environment-variables\n process.env['FC_GIT_COMMIT_SHA'] ||\n // Heroku #1 https://devcenter.heroku.com/articles/heroku-ci\n process.env['HEROKU_TEST_RUN_COMMIT_VERSION'] ||\n // Heroku #2 https://docs.sentry.io/product/integrations/deployment/heroku/#configure-releases\n process.env['HEROKU_SLUG_COMMIT'] ||\n // Railway - https://docs.railway.app/reference/variables#git-variables\n process.env['RAILWAY_GIT_COMMIT_SHA'] ||\n // Render - https://render.com/docs/environment-variables\n process.env['RENDER_GIT_COMMIT'] ||\n // Semaphore CI - https://docs.semaphoreci.com/ci-cd-environment/environment-variables\n process.env['SEMAPHORE_GIT_SHA'] ||\n // TravisCI - https://docs.travis-ci.com/user/environment-variables/#default-environment-variables\n process.env['TRAVIS_PULL_REQUEST_SHA'] ||\n // Vercel - https://vercel.com/docs/v2/build-step#system-environment-variables\n process.env['VERCEL_GIT_COMMIT_SHA'] ||\n process.env['VERCEL_GITHUB_COMMIT_SHA'] ||\n process.env['VERCEL_GITLAB_COMMIT_SHA'] ||\n process.env['VERCEL_BITBUCKET_COMMIT_SHA'] ||\n // Zeit (now known as Vercel)\n process.env['ZEIT_GITHUB_COMMIT_SHA'] ||\n process.env['ZEIT_GITLAB_COMMIT_SHA'] ||\n process.env['ZEIT_BITBUCKET_COMMIT_SHA'];\n\n const possibleReleaseNameOfCiProvidersWithGenericEnvVar =\n // CloudBees CodeShip - https://docs.cloudbees.com/docs/cloudbees-codeship/latest/pro-builds-and-configuration/environment-variables\n process.env['CI_COMMIT_ID'] ||\n // Coolify - https://coolify.io/docs/knowledge-base/environment-variables\n process.env['SOURCE_COMMIT'] ||\n // Heroku #3 https://devcenter.heroku.com/changelog-items/630\n process.env['SOURCE_VERSION'] ||\n // Jenkins - https://plugins.jenkins.io/git/#environment-variables\n process.env['GIT_COMMIT'] ||\n // Netlify - https://docs.netlify.com/configure-builds/environment-variables/#build-metadata\n process.env['COMMIT_REF'] ||\n // TeamCity - https://www.jetbrains.com/help/teamcity/predefined-build-parameters.html\n process.env['BUILD_VCS_NUMBER'] ||\n // Woodpecker CI - https://woodpecker-ci.org/docs/usage/environment\n process.env['CI_COMMIT_SHA'];\n\n return (\n possibleReleaseNameOfGitProvider ||\n possibleReleaseNameOfCiProvidersWithSpecificEnvVar ||\n possibleReleaseNameOfCiProvidersWithGenericEnvVar ||\n fallback\n );\n}\n\n/** Node.js stack parser */\nexport const defaultStackParser: StackParser = createStackParser(nodeStackLineParser(createGetModuleFromFilename()));\n"],"names":[],"mappings":";;;AAMA;AACA;AACA;AACA;AACO,SAAS,gBAAgB,CAAC,QAAQ,EAA+B;AACxE;AACA,EAAE,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE;AAClC,IAAI,OAAO,OAAO,CAAC,GAAG,CAAC,cAAc;AACrC;;AAEA;AACA,EAAE,IAAI,UAAU,CAAC,cAAc,EAAE,EAAE,EAAE;AACrC,IAAI,OAAO,UAAU,CAAC,cAAc,CAAC,EAAE;AACvC;;AAEA;AACA;AACA;AACA;;AAEA,EAAE,MAAM,gCAAiC;AACzC;AACA,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,CAAE;AAC9B;AACA,IAAI,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAE;AACtD,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,CAAE;AAChC,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,CAAE;AACjC;AACA,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;;AAEnC,EAAE,MAAM,kDAAmD;AAC3D;AACA,IAAI,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAE;AACrD,IAAI,O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