@sentry/node 8.54.0 → 9.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (282) hide show
  1. package/build/cjs/cron/common.js +1 -1
  2. package/build/cjs/cron/cron.js +1 -1
  3. package/build/cjs/cron/index.js +1 -1
  4. package/build/cjs/cron/node-cron.js +10 -11
  5. package/build/cjs/cron/node-cron.js.map +1 -1
  6. package/build/cjs/cron/node-schedule.js +2 -6
  7. package/build/cjs/cron/node-schedule.js.map +1 -1
  8. package/build/cjs/debug-build.js +1 -1
  9. package/build/cjs/index.js +3 -15
  10. package/build/cjs/index.js.map +1 -1
  11. package/build/cjs/integrations/anr/index.js +8 -13
  12. package/build/cjs/integrations/anr/index.js.map +1 -1
  13. package/build/cjs/integrations/childProcess.js +19 -24
  14. package/build/cjs/integrations/childProcess.js.map +1 -1
  15. package/build/cjs/integrations/console.js +1 -1
  16. package/build/cjs/integrations/context.js +16 -19
  17. package/build/cjs/integrations/context.js.map +1 -1
  18. package/build/cjs/integrations/contextlines.js +6 -10
  19. package/build/cjs/integrations/contextlines.js.map +1 -1
  20. package/build/cjs/integrations/fs.js +1 -1
  21. package/build/cjs/integrations/http/SentryHttpInstrumentation.js +99 -19
  22. package/build/cjs/integrations/http/SentryHttpInstrumentation.js.map +1 -1
  23. package/build/cjs/integrations/http/index.js +32 -46
  24. package/build/cjs/integrations/http/index.js.map +1 -1
  25. package/build/cjs/integrations/http/vendor/getRequestInfo.js +1 -1
  26. package/build/cjs/integrations/http/vendor/getRequestInfo.js.map +1 -1
  27. package/build/cjs/integrations/local-variables/common.js +1 -1
  28. package/build/cjs/integrations/local-variables/index.js +1 -1
  29. package/build/cjs/integrations/local-variables/local-variables-async.js +4 -8
  30. package/build/cjs/integrations/local-variables/local-variables-async.js.map +1 -1
  31. package/build/cjs/integrations/local-variables/local-variables-sync.js +18 -22
  32. package/build/cjs/integrations/local-variables/local-variables-sync.js.map +1 -1
  33. package/build/cjs/integrations/modules.js +2 -2
  34. package/build/cjs/integrations/modules.js.map +1 -1
  35. package/build/cjs/integrations/node-fetch.js +3 -7
  36. package/build/cjs/integrations/node-fetch.js.map +1 -1
  37. package/build/cjs/integrations/onuncaughtexception.js +1 -1
  38. package/build/cjs/integrations/onunhandledrejection.js +1 -1
  39. package/build/cjs/integrations/processSession.js +36 -0
  40. package/build/cjs/integrations/processSession.js.map +1 -0
  41. package/build/cjs/integrations/spotlight.js +2 -2
  42. package/build/cjs/integrations/spotlight.js.map +1 -1
  43. package/build/cjs/integrations/tracing/amqplib.js +1 -1
  44. package/build/cjs/integrations/tracing/connect.js +2 -2
  45. package/build/cjs/integrations/tracing/connect.js.map +1 -1
  46. package/build/cjs/integrations/tracing/dataloader.js +2 -6
  47. package/build/cjs/integrations/tracing/dataloader.js.map +1 -1
  48. package/build/cjs/integrations/tracing/express.js +4 -31
  49. package/build/cjs/integrations/tracing/express.js.map +1 -1
  50. package/build/cjs/integrations/tracing/fastify.js +3 -7
  51. package/build/cjs/integrations/tracing/fastify.js.map +1 -1
  52. package/build/cjs/integrations/tracing/genericPool.js +1 -1
  53. package/build/cjs/integrations/tracing/graphql.js +5 -5
  54. package/build/cjs/integrations/tracing/graphql.js.map +1 -1
  55. package/build/cjs/integrations/tracing/hapi/index.js +5 -9
  56. package/build/cjs/integrations/tracing/hapi/index.js.map +1 -1
  57. package/build/cjs/integrations/tracing/index.js +1 -6
  58. package/build/cjs/integrations/tracing/index.js.map +1 -1
  59. package/build/cjs/integrations/tracing/kafka.js +1 -1
  60. package/build/cjs/integrations/tracing/knex.js +2 -2
  61. package/build/cjs/integrations/tracing/knex.js.map +1 -1
  62. package/build/cjs/integrations/tracing/koa.js +4 -8
  63. package/build/cjs/integrations/tracing/koa.js.map +1 -1
  64. package/build/cjs/integrations/tracing/lrumemoizer.js +1 -1
  65. package/build/cjs/integrations/tracing/mongo.js +1 -1
  66. package/build/cjs/integrations/tracing/mongoose.js +1 -1
  67. package/build/cjs/integrations/tracing/mysql.js +1 -1
  68. package/build/cjs/integrations/tracing/mysql2.js +1 -1
  69. package/build/cjs/integrations/tracing/postgres.js +1 -1
  70. package/build/cjs/integrations/tracing/prisma.js +21 -67
  71. package/build/cjs/integrations/tracing/prisma.js.map +1 -1
  72. package/build/cjs/integrations/tracing/redis.js +4 -8
  73. package/build/cjs/integrations/tracing/redis.js.map +1 -1
  74. package/build/cjs/integrations/tracing/tedious.js +3 -7
  75. package/build/cjs/integrations/tracing/tedious.js.map +1 -1
  76. package/build/cjs/integrations/tracing/vercelai/index.js +14 -20
  77. package/build/cjs/integrations/tracing/vercelai/index.js.map +1 -1
  78. package/build/cjs/integrations/tracing/vercelai/instrumentation.js +1 -1
  79. package/build/cjs/nodeVersion.js +1 -1
  80. package/build/cjs/otel/contextManager.js +2 -2
  81. package/build/cjs/otel/contextManager.js.map +1 -1
  82. package/build/cjs/otel/instrument.js +1 -1
  83. package/build/cjs/proxy/base.js +30 -33
  84. package/build/cjs/proxy/base.js.map +1 -1
  85. package/build/cjs/proxy/index.js +3 -8
  86. package/build/cjs/proxy/index.js.map +1 -1
  87. package/build/cjs/proxy/parse-proxy-response.js +2 -2
  88. package/build/cjs/proxy/parse-proxy-response.js.map +1 -1
  89. package/build/cjs/sdk/api.js +2 -2
  90. package/build/cjs/sdk/api.js.map +1 -1
  91. package/build/cjs/sdk/client.js +3 -8
  92. package/build/cjs/sdk/client.js.map +1 -1
  93. package/build/cjs/sdk/index.js +5 -58
  94. package/build/cjs/sdk/index.js.map +1 -1
  95. package/build/cjs/sdk/initOtel.js +8 -22
  96. package/build/cjs/sdk/initOtel.js.map +1 -1
  97. package/build/cjs/transports/http.js +10 -16
  98. package/build/cjs/transports/http.js.map +1 -1
  99. package/build/cjs/utils/addOriginToSpan.js +1 -1
  100. package/build/cjs/utils/commonjs.js +1 -1
  101. package/build/cjs/utils/createMissingInstrumentationContext.js +1 -1
  102. package/build/cjs/utils/debug.js +1 -1
  103. package/build/cjs/utils/ensureIsWrapped.js +2 -6
  104. package/build/cjs/utils/ensureIsWrapped.js.map +1 -1
  105. package/build/cjs/utils/envToBool.js +2 -2
  106. package/build/cjs/utils/envToBool.js.map +1 -1
  107. package/build/cjs/utils/errorhandling.js +2 -3
  108. package/build/cjs/utils/errorhandling.js.map +1 -1
  109. package/build/cjs/utils/getRequestUrl.js +1 -1
  110. package/build/cjs/utils/module.js +1 -1
  111. package/build/cjs/utils/module.js.map +1 -1
  112. package/build/cjs/utils/redisCache.js +1 -4
  113. package/build/cjs/utils/redisCache.js.map +1 -1
  114. package/build/esm/cron/node-cron.js +9 -7
  115. package/build/esm/cron/node-cron.js.map +1 -1
  116. package/build/esm/cron/node-schedule.js +1 -2
  117. package/build/esm/cron/node-schedule.js.map +1 -1
  118. package/build/esm/index.js +3 -4
  119. package/build/esm/index.js.map +1 -1
  120. package/build/esm/integrations/anr/index.js +8 -9
  121. package/build/esm/integrations/anr/index.js.map +1 -1
  122. package/build/esm/integrations/anr/worker-script.js +2 -2
  123. package/build/esm/integrations/childProcess.js +20 -24
  124. package/build/esm/integrations/childProcess.js.map +1 -1
  125. package/build/esm/integrations/context.js +15 -15
  126. package/build/esm/integrations/context.js.map +1 -1
  127. package/build/esm/integrations/contextlines.js +5 -6
  128. package/build/esm/integrations/contextlines.js.map +1 -1
  129. package/build/esm/integrations/http/SentryHttpInstrumentation.js +99 -20
  130. package/build/esm/integrations/http/SentryHttpInstrumentation.js.map +1 -1
  131. package/build/esm/integrations/http/index.js +32 -43
  132. package/build/esm/integrations/http/index.js.map +1 -1
  133. package/build/esm/integrations/http/vendor/getRequestInfo.js.map +1 -1
  134. package/build/esm/integrations/local-variables/local-variables-async.js +3 -4
  135. package/build/esm/integrations/local-variables/local-variables-async.js.map +1 -1
  136. package/build/esm/integrations/local-variables/local-variables-sync.js +17 -18
  137. package/build/esm/integrations/local-variables/local-variables-sync.js.map +1 -1
  138. package/build/esm/integrations/local-variables/worker-script.js +2 -2
  139. package/build/esm/integrations/modules.js +1 -1
  140. package/build/esm/integrations/modules.js.map +1 -1
  141. package/build/esm/integrations/node-fetch.js +3 -4
  142. package/build/esm/integrations/node-fetch.js.map +1 -1
  143. package/build/esm/integrations/processSession.js +34 -0
  144. package/build/esm/integrations/processSession.js.map +1 -0
  145. package/build/esm/integrations/spotlight.js +1 -1
  146. package/build/esm/integrations/spotlight.js.map +1 -1
  147. package/build/esm/integrations/tracing/connect.js +1 -1
  148. package/build/esm/integrations/tracing/connect.js.map +1 -1
  149. package/build/esm/integrations/tracing/dataloader.js +1 -2
  150. package/build/esm/integrations/tracing/dataloader.js.map +1 -1
  151. package/build/esm/integrations/tracing/express.js +4 -28
  152. package/build/esm/integrations/tracing/express.js.map +1 -1
  153. package/build/esm/integrations/tracing/fastify.js +2 -3
  154. package/build/esm/integrations/tracing/fastify.js.map +1 -1
  155. package/build/esm/integrations/tracing/graphql.js +4 -4
  156. package/build/esm/integrations/tracing/graphql.js.map +1 -1
  157. package/build/esm/integrations/tracing/hapi/index.js +4 -5
  158. package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
  159. package/build/esm/integrations/tracing/index.js +0 -5
  160. package/build/esm/integrations/tracing/index.js.map +1 -1
  161. package/build/esm/integrations/tracing/knex.js +1 -1
  162. package/build/esm/integrations/tracing/knex.js.map +1 -1
  163. package/build/esm/integrations/tracing/koa.js +3 -4
  164. package/build/esm/integrations/tracing/koa.js.map +1 -1
  165. package/build/esm/integrations/tracing/prisma.js +21 -64
  166. package/build/esm/integrations/tracing/prisma.js.map +1 -1
  167. package/build/esm/integrations/tracing/redis.js +4 -5
  168. package/build/esm/integrations/tracing/redis.js.map +1 -1
  169. package/build/esm/integrations/tracing/tedious.js +2 -3
  170. package/build/esm/integrations/tracing/tedious.js.map +1 -1
  171. package/build/esm/integrations/tracing/vercelai/index.js +13 -16
  172. package/build/esm/integrations/tracing/vercelai/index.js.map +1 -1
  173. package/build/esm/otel/contextManager.js +1 -1
  174. package/build/esm/otel/contextManager.js.map +1 -1
  175. package/build/esm/package.json +1 -1
  176. package/build/esm/proxy/base.js +29 -29
  177. package/build/esm/proxy/base.js.map +1 -1
  178. package/build/esm/proxy/index.js +2 -3
  179. package/build/esm/proxy/index.js.map +1 -1
  180. package/build/esm/proxy/parse-proxy-response.js +1 -1
  181. package/build/esm/proxy/parse-proxy-response.js.map +1 -1
  182. package/build/esm/sdk/api.js +1 -1
  183. package/build/esm/sdk/api.js.map +1 -1
  184. package/build/esm/sdk/client.js +2 -3
  185. package/build/esm/sdk/client.js.map +1 -1
  186. package/build/esm/sdk/index.js +5 -58
  187. package/build/esm/sdk/index.js.map +1 -1
  188. package/build/esm/sdk/initOtel.js +7 -18
  189. package/build/esm/sdk/initOtel.js.map +1 -1
  190. package/build/esm/transports/http.js +9 -12
  191. package/build/esm/transports/http.js.map +1 -1
  192. package/build/esm/utils/ensureIsWrapped.js +1 -2
  193. package/build/esm/utils/ensureIsWrapped.js.map +1 -1
  194. package/build/esm/utils/envToBool.js +1 -1
  195. package/build/esm/utils/envToBool.js.map +1 -1
  196. package/build/esm/utils/errorhandling.js +1 -2
  197. package/build/esm/utils/errorhandling.js.map +1 -1
  198. package/build/esm/utils/module.js.map +1 -1
  199. package/build/esm/utils/redisCache.js +0 -3
  200. package/build/esm/utils/redisCache.js.map +1 -1
  201. package/build/types/cron/node-cron.d.ts +1 -1
  202. package/build/types/cron/node-cron.d.ts.map +1 -1
  203. package/build/types/index.d.ts +4 -6
  204. package/build/types/index.d.ts.map +1 -1
  205. package/build/types/integrations/childProcess.d.ts +7 -7
  206. package/build/types/integrations/childProcess.d.ts.map +1 -1
  207. package/build/types/integrations/http/SentryHttpInstrumentation.d.ts +30 -0
  208. package/build/types/integrations/http/SentryHttpInstrumentation.d.ts.map +1 -1
  209. package/build/types/integrations/http/index.d.ts +11 -8
  210. package/build/types/integrations/http/index.d.ts.map +1 -1
  211. package/build/types/integrations/processSession.d.ts +5 -0
  212. package/build/types/integrations/processSession.d.ts.map +1 -0
  213. package/build/types/integrations/tracing/express.d.ts.map +1 -1
  214. package/build/types/integrations/tracing/hapi/types.d.ts +1 -0
  215. package/build/types/integrations/tracing/hapi/types.d.ts.map +1 -1
  216. package/build/types/integrations/tracing/index.d.ts.map +1 -1
  217. package/build/types/integrations/tracing/prisma.d.ts +11 -12
  218. package/build/types/integrations/tracing/prisma.d.ts.map +1 -1
  219. package/build/types/integrations/tracing/vercelai/index.d.ts.map +1 -1
  220. package/build/types/otel/contextManager.d.ts +1 -1
  221. package/build/types/proxy/helpers.d.ts +1 -0
  222. package/build/types/proxy/helpers.d.ts.map +1 -1
  223. package/build/types/proxy/parse-proxy-response.d.ts +1 -0
  224. package/build/types/proxy/parse-proxy-response.d.ts.map +1 -1
  225. package/build/types/sdk/index.d.ts.map +1 -1
  226. package/build/types/sdk/initOtel.d.ts +1 -3
  227. package/build/types/sdk/initOtel.d.ts.map +1 -1
  228. package/build/types/transports/http-module.d.ts +1 -0
  229. package/build/types/transports/http-module.d.ts.map +1 -1
  230. package/build/types/transports/http.d.ts +1 -0
  231. package/build/types/transports/http.d.ts.map +1 -1
  232. package/build/types/types.d.ts +2 -48
  233. package/build/types/types.d.ts.map +1 -1
  234. package/build/types/utils/errorhandling.d.ts.map +1 -1
  235. package/build/types-ts3.8/cron/node-cron.d.ts +1 -1
  236. package/build/types-ts3.8/index.d.ts +4 -6
  237. package/build/types-ts3.8/integrations/childProcess.d.ts +7 -7
  238. package/build/types-ts3.8/integrations/http/SentryHttpInstrumentation.d.ts +29 -0
  239. package/build/types-ts3.8/integrations/http/index.d.ts +11 -8
  240. package/build/types-ts3.8/integrations/processSession.d.ts +5 -0
  241. package/build/types-ts3.8/integrations/tracing/prisma.d.ts +11 -12
  242. package/build/types-ts3.8/otel/contextManager.d.ts +1 -1
  243. package/build/types-ts3.8/sdk/initOtel.d.ts +1 -3
  244. package/build/types-ts3.8/types.d.ts +2 -48
  245. package/package.json +8 -9
  246. package/build/cjs/integrations/tracing/nest/helpers.js +0 -100
  247. package/build/cjs/integrations/tracing/nest/helpers.js.map +0 -1
  248. package/build/cjs/integrations/tracing/nest/nest.js +0 -148
  249. package/build/cjs/integrations/tracing/nest/nest.js.map +0 -1
  250. package/build/cjs/integrations/tracing/nest/sentry-nest-event-instrumentation.js +0 -117
  251. package/build/cjs/integrations/tracing/nest/sentry-nest-event-instrumentation.js.map +0 -1
  252. package/build/cjs/integrations/tracing/nest/sentry-nest-instrumentation.js +0 -301
  253. package/build/cjs/integrations/tracing/nest/sentry-nest-instrumentation.js.map +0 -1
  254. package/build/esm/integrations/tracing/nest/helpers.js +0 -91
  255. package/build/esm/integrations/tracing/nest/helpers.js.map +0 -1
  256. package/build/esm/integrations/tracing/nest/nest.js +0 -141
  257. package/build/esm/integrations/tracing/nest/nest.js.map +0 -1
  258. package/build/esm/integrations/tracing/nest/sentry-nest-event-instrumentation.js +0 -115
  259. package/build/esm/integrations/tracing/nest/sentry-nest-event-instrumentation.js.map +0 -1
  260. package/build/esm/integrations/tracing/nest/sentry-nest-instrumentation.js +0 -295
  261. package/build/esm/integrations/tracing/nest/sentry-nest-instrumentation.js.map +0 -1
  262. package/build/types/integrations/tracing/nest/helpers.d.ts +0 -36
  263. package/build/types/integrations/tracing/nest/helpers.d.ts.map +0 -1
  264. package/build/types/integrations/tracing/nest/nest.d.ts +0 -19
  265. package/build/types/integrations/tracing/nest/nest.d.ts.map +0 -1
  266. package/build/types/integrations/tracing/nest/sentry-nest-event-instrumentation.d.ts +0 -27
  267. package/build/types/integrations/tracing/nest/sentry-nest-event-instrumentation.d.ts.map +0 -1
  268. package/build/types/integrations/tracing/nest/sentry-nest-instrumentation.d.ts +0 -37
  269. package/build/types/integrations/tracing/nest/sentry-nest-instrumentation.d.ts.map +0 -1
  270. package/build/types/integrations/tracing/nest/types.d.ts +0 -84
  271. package/build/types/integrations/tracing/nest/types.d.ts.map +0 -1
  272. package/build/types/integrations/tracing/prisma/vendor/v5-tracing-helper.d.ts +0 -38
  273. package/build/types/integrations/tracing/prisma/vendor/v5-tracing-helper.d.ts.map +0 -1
  274. package/build/types/integrations/tracing/prisma/vendor/v6-tracing-helper.d.ts +0 -31
  275. package/build/types/integrations/tracing/prisma/vendor/v6-tracing-helper.d.ts.map +0 -1
  276. package/build/types-ts3.8/integrations/tracing/nest/helpers.d.ts +0 -36
  277. package/build/types-ts3.8/integrations/tracing/nest/nest.d.ts +0 -19
  278. package/build/types-ts3.8/integrations/tracing/nest/sentry-nest-event-instrumentation.d.ts +0 -27
  279. package/build/types-ts3.8/integrations/tracing/nest/sentry-nest-instrumentation.d.ts +0 -37
  280. package/build/types-ts3.8/integrations/tracing/nest/types.d.ts +0 -84
  281. package/build/types-ts3.8/integrations/tracing/prisma/vendor/v5-tracing-helper.d.ts +0 -44
  282. package/build/types-ts3.8/integrations/tracing/prisma/vendor/v6-tracing-helper.d.ts +0 -34
@@ -1,4 +1,3 @@
1
- import { _optionalChain } from '@sentry/core';
2
1
  import { defineIntegration, spanToJSON, SEMANTIC_ATTRIBUTE_SENTRY_OP } from '@sentry/core';
3
2
  import { generateInstrumentOnce } from '../../../otel/instrument.js';
4
3
  import { addOriginToSpan } from '../../../utils/addOriginToSpan.js';
@@ -15,28 +14,25 @@ const _vercelAIIntegration = (() => {
15
14
  instrumentVercelAi();
16
15
  },
17
16
  processEvent(event) {
18
- if (event.type === 'transaction' && _optionalChain([event, 'access', _ => _.spans, 'optionalAccess', _2 => _2.length])) {
17
+ if (event.type === 'transaction' && event.spans?.length) {
19
18
  for (const span of event.spans) {
20
19
  const { data: attributes, description: name } = span;
21
20
 
22
- if (!attributes || !name || span.origin !== 'auto.vercelai.otel') {
21
+ if (!name || span.origin !== 'auto.vercelai.otel') {
23
22
  continue;
24
23
  }
25
24
 
26
- // attributes around token usage can only be set on span finish
27
- span.data = span.data || {};
28
-
29
25
  if (attributes['ai.usage.completionTokens'] != undefined) {
30
- span.data['ai.completion_tokens.used'] = attributes['ai.usage.completionTokens'];
26
+ attributes['ai.completion_tokens.used'] = attributes['ai.usage.completionTokens'];
31
27
  }
32
28
  if (attributes['ai.usage.promptTokens'] != undefined) {
33
- span.data['ai.prompt_tokens.used'] = attributes['ai.usage.promptTokens'];
29
+ attributes['ai.prompt_tokens.used'] = attributes['ai.usage.promptTokens'];
34
30
  }
35
31
  if (
36
- attributes['ai.usage.completionTokens'] != undefined &&
37
- attributes['ai.usage.promptTokens'] != undefined
32
+ typeof attributes['ai.usage.completionTokens'] == 'number' &&
33
+ typeof attributes['ai.usage.promptTokens'] == 'number'
38
34
  ) {
39
- span.data['ai.total_tokens.used'] =
35
+ attributes['ai.total_tokens.used'] =
40
36
  attributes['ai.usage.completionTokens'] + attributes['ai.usage.promptTokens'];
41
37
  }
42
38
  }
@@ -52,7 +48,7 @@ const _vercelAIIntegration = (() => {
52
48
 
53
49
  const { data: attributes, description: name } = spanToJSON(span);
54
50
 
55
- if (!attributes || !name) {
51
+ if (!name) {
56
52
  return;
57
53
  }
58
54
 
@@ -63,7 +59,7 @@ const _vercelAIIntegration = (() => {
63
59
  const aiModelProvider = attributes['ai.model.provider'];
64
60
 
65
61
  // both of these must be defined for the integration to work
66
- if (!aiModelId || !aiModelProvider) {
62
+ if (typeof aiModelId !== 'string' || typeof aiModelProvider !== 'string' || !aiModelId || !aiModelProvider) {
67
63
  return;
68
64
  }
69
65
 
@@ -138,9 +134,10 @@ const _vercelAIIntegration = (() => {
138
134
  span.updateName(nameWthoutAi);
139
135
 
140
136
  // If a Telemetry name is set and it is a pipeline span, use that as the operation name
141
- if (attributes['ai.telemetry.functionId'] && isPipelineSpan) {
142
- span.updateName(attributes['ai.telemetry.functionId']);
143
- span.setAttribute('ai.pipeline.name', attributes['ai.telemetry.functionId']);
137
+ const functionId = attributes['ai.telemetry.functionId'];
138
+ if (functionId && typeof functionId === 'string' && isPipelineSpan) {
139
+ span.updateName(functionId);
140
+ span.setAttribute('ai.pipeline.name', functionId);
144
141
  }
145
142
 
146
143
  if (attributes['ai.prompt']) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/vercelai/index.ts"],"sourcesContent":["/* eslint-disable complexity */\nimport { SEMANTIC_ATTRIBUTE_SENTRY_OP, defineIntegration, spanToJSON } from '@sentry/core';\nimport type { IntegrationFn } from '@sentry/core';\nimport { generateInstrumentOnce } from '../../../otel/instrument';\nimport { addOriginToSpan } from '../../../utils/addOriginToSpan';\nimport { SentryVercelAiInstrumentation, sentryVercelAiPatched } from './instrumentation';\n\nexport const instrumentVercelAi = generateInstrumentOnce('vercelAI', () => new SentryVercelAiInstrumentation({}));\n\nconst _vercelAIIntegration = (() => {\n return {\n name: 'vercelAI',\n setupOnce() {\n instrumentVercelAi();\n },\n processEvent(event) {\n if (event.type === 'transaction' && event.spans?.length) {\n for (const span of event.spans) {\n const { data: attributes, description: name } = span;\n\n if (!attributes || !name || span.origin !== 'auto.vercelai.otel') {\n continue;\n }\n\n // attributes around token usage can only be set on span finish\n span.data = span.data || {};\n\n if (attributes['ai.usage.completionTokens'] != undefined) {\n span.data['ai.completion_tokens.used'] = attributes['ai.usage.completionTokens'];\n }\n if (attributes['ai.usage.promptTokens'] != undefined) {\n span.data['ai.prompt_tokens.used'] = attributes['ai.usage.promptTokens'];\n }\n if (\n attributes['ai.usage.completionTokens'] != undefined &&\n attributes['ai.usage.promptTokens'] != undefined\n ) {\n span.data['ai.total_tokens.used'] =\n attributes['ai.usage.completionTokens'] + attributes['ai.usage.promptTokens'];\n }\n }\n }\n\n return event;\n },\n setup(client) {\n client.on('spanStart', span => {\n if (!sentryVercelAiPatched) {\n return;\n }\n\n const { data: attributes, description: name } = spanToJSON(span);\n\n if (!attributes || !name) {\n return;\n }\n\n // The id of the model\n const aiModelId: string | undefined = attributes['ai.model.id'];\n\n // the provider of the model\n const aiModelProvider: string | undefined = attributes['ai.model.provider'];\n\n // both of these must be defined for the integration to work\n if (!aiModelId || !aiModelProvider) {\n return;\n }\n\n let isPipelineSpan = false;\n\n switch (name) {\n case 'ai.generateText': {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.pipeline.generateText');\n isPipelineSpan = true;\n break;\n }\n case 'ai.generateText.doGenerate': {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.run.doGenerate');\n break;\n }\n case 'ai.streamText': {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.pipeline.streamText');\n isPipelineSpan = true;\n break;\n }\n case 'ai.streamText.doStream': {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.run.doStream');\n break;\n }\n case 'ai.generateObject': {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.pipeline.generateObject');\n isPipelineSpan = true;\n break;\n }\n case 'ai.generateObject.doGenerate': {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.run.doGenerate');\n break;\n }\n case 'ai.streamObject': {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.pipeline.streamObject');\n isPipelineSpan = true;\n break;\n }\n case 'ai.streamObject.doStream': {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.run.doStream');\n break;\n }\n case 'ai.embed': {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.pipeline.embed');\n isPipelineSpan = true;\n break;\n }\n case 'ai.embed.doEmbed': {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.embeddings');\n break;\n }\n case 'ai.embedMany': {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.pipeline.embedMany');\n isPipelineSpan = true;\n break;\n }\n case 'ai.embedMany.doEmbed': {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.embeddings');\n break;\n }\n case 'ai.toolCall':\n case 'ai.stream.firstChunk':\n case 'ai.stream.finish':\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.run');\n break;\n }\n\n addOriginToSpan(span, 'auto.vercelai.otel');\n\n const nameWthoutAi = name.replace('ai.', '');\n span.setAttribute('ai.pipeline.name', nameWthoutAi);\n span.updateName(nameWthoutAi);\n\n // If a Telemetry name is set and it is a pipeline span, use that as the operation name\n if (attributes['ai.telemetry.functionId'] && isPipelineSpan) {\n span.updateName(attributes['ai.telemetry.functionId']);\n span.setAttribute('ai.pipeline.name', attributes['ai.telemetry.functionId']);\n }\n\n if (attributes['ai.prompt']) {\n span.setAttribute('ai.input_messages', attributes['ai.prompt']);\n }\n if (attributes['ai.model.id']) {\n span.setAttribute('ai.model_id', attributes['ai.model.id']);\n }\n span.setAttribute('ai.streaming', name.includes('stream'));\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library.\n *\n * For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.vercelAIIntegration()],\n * });\n * ```\n *\n * By default this integration adds tracing support to all `ai` function calls. If you need to disable\n * collecting spans for a specific call, you can do so by setting `experimental_telemetry.isEnabled` to\n * `false` in the first argument of the function call.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: false },\n * });\n * ```\n *\n * If you want to collect inputs and outputs for a specific call, you must specifically opt-in to each\n * function call by setting `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs`\n * to `true`.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true, recordInputs: true, recordOutputs: true },\n * });\n */\nexport const vercelAIIntegration = defineIntegration(_vercelAIIntegration);\n"],"names":[],"mappings":";;;;;;AAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,C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AA;CACA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA;CACA,EAAA,CAAA,CAAA;CACA,CAAA;MACa,CAAoB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAE,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,CAAoB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/vercelai/index.ts"],"sourcesContent":["/* eslint-disable complexity */\nimport { SEMANTIC_ATTRIBUTE_SENTRY_OP, defineIntegration, spanToJSON } from '@sentry/core';\nimport type { IntegrationFn } from '@sentry/core';\nimport { generateInstrumentOnce } from '../../../otel/instrument';\nimport { addOriginToSpan } from '../../../utils/addOriginToSpan';\nimport { SentryVercelAiInstrumentation, sentryVercelAiPatched } from './instrumentation';\n\nexport const instrumentVercelAi = generateInstrumentOnce('vercelAI', () => new SentryVercelAiInstrumentation({}));\n\nconst _vercelAIIntegration = (() => {\n return {\n name: 'vercelAI',\n setupOnce() {\n instrumentVercelAi();\n },\n processEvent(event) {\n if (event.type === 'transaction' && event.spans?.length) {\n for (const span of event.spans) {\n const { data: attributes, description: name } = span;\n\n if (!name || span.origin !== 'auto.vercelai.otel') {\n continue;\n }\n\n if (attributes['ai.usage.completionTokens'] != undefined) {\n attributes['ai.completion_tokens.used'] = attributes['ai.usage.completionTokens'];\n }\n if (attributes['ai.usage.promptTokens'] != undefined) {\n attributes['ai.prompt_tokens.used'] = attributes['ai.usage.promptTokens'];\n }\n if (\n typeof attributes['ai.usage.completionTokens'] == 'number' &&\n typeof attributes['ai.usage.promptTokens'] == 'number'\n ) {\n attributes['ai.total_tokens.used'] =\n attributes['ai.usage.completionTokens'] + attributes['ai.usage.promptTokens'];\n }\n }\n }\n\n return event;\n },\n setup(client) {\n client.on('spanStart', span => {\n if (!sentryVercelAiPatched) {\n return;\n }\n\n const { data: attributes, description: name } = spanToJSON(span);\n\n if (!name) {\n return;\n }\n\n // The id of the model\n const aiModelId = attributes['ai.model.id'];\n\n // the provider of the model\n const aiModelProvider = attributes['ai.model.provider'];\n\n // both of these must be defined for the integration to work\n if (typeof aiModelId !== 'string' || typeof aiModelProvider !== 'string' || !aiModelId || !aiModelProvider) {\n return;\n }\n\n let isPipelineSpan = false;\n\n switch (name) {\n case 'ai.generateText': {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.pipeline.generateText');\n isPipelineSpan = true;\n break;\n }\n case 'ai.generateText.doGenerate': {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.run.doGenerate');\n break;\n }\n case 'ai.streamText': {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.pipeline.streamText');\n isPipelineSpan = true;\n break;\n }\n case 'ai.streamText.doStream': {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.run.doStream');\n break;\n }\n case 'ai.generateObject': {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.pipeline.generateObject');\n isPipelineSpan = true;\n break;\n }\n case 'ai.generateObject.doGenerate': {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.run.doGenerate');\n break;\n }\n case 'ai.streamObject': {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.pipeline.streamObject');\n isPipelineSpan = true;\n break;\n }\n case 'ai.streamObject.doStream': {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.run.doStream');\n break;\n }\n case 'ai.embed': {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.pipeline.embed');\n isPipelineSpan = true;\n break;\n }\n case 'ai.embed.doEmbed': {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.embeddings');\n break;\n }\n case 'ai.embedMany': {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.pipeline.embedMany');\n isPipelineSpan = true;\n break;\n }\n case 'ai.embedMany.doEmbed': {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.embeddings');\n break;\n }\n case 'ai.toolCall':\n case 'ai.stream.firstChunk':\n case 'ai.stream.finish':\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.run');\n break;\n }\n\n addOriginToSpan(span, 'auto.vercelai.otel');\n\n const nameWthoutAi = name.replace('ai.', '');\n span.setAttribute('ai.pipeline.name', nameWthoutAi);\n span.updateName(nameWthoutAi);\n\n // If a Telemetry name is set and it is a pipeline span, use that as the operation name\n const functionId = attributes['ai.telemetry.functionId'];\n if (functionId && typeof functionId === 'string' && isPipelineSpan) {\n span.updateName(functionId);\n span.setAttribute('ai.pipeline.name', functionId);\n }\n\n if (attributes['ai.prompt']) {\n span.setAttribute('ai.input_messages', attributes['ai.prompt']);\n }\n if (attributes['ai.model.id']) {\n span.setAttribute('ai.model_id', attributes['ai.model.id']);\n }\n span.setAttribute('ai.streaming', name.includes('stream'));\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library.\n *\n * For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.vercelAIIntegration()],\n * });\n * ```\n *\n * By default this integration adds tracing support to all `ai` function calls. If you need to disable\n * collecting spans for a specific call, you can do so by setting `experimental_telemetry.isEnabled` to\n * `false` in the first argument of the function call.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: false },\n * });\n * ```\n *\n * If you want to collect inputs and outputs for a specific call, you must specifically opt-in to each\n * function call by setting `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs`\n * to `true`.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true, recordInputs: true, recordOutputs: true },\n * });\n */\nexport const vercelAIIntegration = defineIntegration(_vercelAIIntegration);\n"],"names":[],"mappings":";;;;;AAAA;;MAOa,kBAAmB,GAAE,sBAAsB,CAAC,UAAU,EAAE,MAAM,IAAI,6BAA6B,CAAC,EAAE,CAAC;;AAEhH,MAAM,oBAAqB,IAAG,MAAM;AACpC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,UAAU;AACpB,IAAI,SAAS,GAAG;AAChB,MAAM,kBAAkB,EAAE;AAC1B,KAAK;AACL,IAAI,YAAY,CAAC,KAAK,EAAE;AACxB,MAAM,IAAI,KAAK,CAAC,IAAK,KAAI,aAAc,IAAG,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE;AAC/D,QAAQ,KAAK,MAAM,IAAA,IAAQ,KAAK,CAAC,KAAK,EAAE;AACxC,UAAU,MAAM,EAAE,IAAI,EAAE,UA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AQ,IAAI,UAAU,CAAC,aAAa,CAAC,EAAE;AACvC,UAAU,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC;AACrE;AACA,QAAQ,IAAI,CAAC,YAAY,CAAC,cAAc,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAClE,OAAO,CAAC;AACR,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,mBAAoB,GAAE,iBAAiB,CAAC,oBAAoB;;;;"}
@@ -3,7 +3,7 @@ import { wrapContextManagerClass } from '@sentry/opentelemetry';
3
3
 
4
4
  /**
5
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 Hub are always in sync.
6
+ * It ensures that we create a new hub per context, so that the OTEL Context & the Sentry Scopes are always in sync.
7
7
  *
8
8
  * Note that we currently only support AsyncHooks with this,
9
9
  * but since this should work for Node 14+ anyhow that should be good enough.
@@ -1 +1 @@
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 Hub 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
+ {"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 +1 @@
1
- {"type":"module","version":"8.54.0","sideEffects":false}
1
+ {"type":"module","version":"9.0.0-alpha.0","sideEffects":false}
@@ -1,34 +1,34 @@
1
- import { _nullishCoalesce } from '@sentry/core';
2
1
  import * as http from 'node:http';
3
2
  import 'node:https';
4
3
 
5
4
  /**
6
- * This code was originally forked from https://github.com/TooTallNate/proxy-agents/tree/b133295fd16f6475578b6b15bd9b4e33ecb0d0b7
7
- * With the following LICENSE:
8
- *
9
- * (The MIT License)
10
- *
11
- * Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>*
12
- *
13
- * Permission is hereby granted, free of charge, to any person obtaining
14
- * a copy of this software and associated documentation files (the
15
- * 'Software'), to deal in the Software without restriction, including
16
- * without limitation the rights to use, copy, modify, merge, publish,
17
- * distribute, sublicense, and/or sell copies of the Software, and to
18
- * permit persons to whom the Software is furnished to do so, subject to
19
- * the following conditions:*
20
- *
21
- * The above copyright notice and this permission notice shall be
22
- * included in all copies or substantial portions of the Software.*
23
- *
24
- * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
25
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
27
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
28
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
29
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
30
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31
- */
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
32
 
33
33
  const INTERNAL = Symbol('AgentBaseInternalState');
34
34
 
@@ -96,7 +96,7 @@ class Agent extends http.Agent {
96
96
  }
97
97
 
98
98
  get defaultPort() {
99
- return _nullishCoalesce(this[INTERNAL].defaultPort, () => ( (this.protocol === 'https:' ? 443 : 80)));
99
+ return this[INTERNAL].defaultPort ?? (this.protocol === 'https:' ? 443 : 80);
100
100
  }
101
101
 
102
102
  set defaultPort(v) {
@@ -106,7 +106,7 @@ class Agent extends http.Agent {
106
106
  }
107
107
 
108
108
  get protocol() {
109
- return _nullishCoalesce(this[INTERNAL].protocol, () => ( (this.isSecureEndpoint() ? 'https:' : 'http:')));
109
+ return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? 'https:' : 'http:');
110
110
  }
111
111
 
112
112
  set protocol(v) {
@@ -1 +1 @@
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,CAAA,CAAA;AACA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA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AAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,IAAW,CAAC;IACjC;EACA;AACA;;"}
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;;AAQjC,MAAM,KAAA,SAAc,IAAI,CAAC,KAAM,CAAA;;AAG/C;;AAIA,EAAE,WAAW,CAAC,IAAI,EAAsB;AACxC,IAAI,KAAK,CAAC,IAAI,CAAC;AACf,IAAI,IAAI,CAAC,QAAQ,CAAE,GAAE,EAAE;AACvB;;AAOA;AACA;AACA;AACA,EAAE,gBAAgB,CAAC,OAAO,EAA8B;AACxD,IAAI,IAAI,OAAO,EAAE;AACjB;AACA;AACA,MAAM,IAAI,OAAO,CAAC,OAAA,GAAoC,cAAA,KAAmB,SAAS,EAAE;AACpF,QAAQ,OAAO,OAAO,CAAC,cAAc;AACrC;;AAEA;AACA;AACA;AACA,MAAM,IAAI,OAAO,OAAO,CAAC,QAAS,KAAI,QAAQ,EAAE;AAChD,QAAQ,OAAO,OAAO,CAAC,QAAA,KAAa,QAAQ;AAC5C;AACA;;AAEA;AACA;AACA;AACA,IAAI,MAAM,EAAE,KAAM,EAAA,GAA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AW;AAC5B,IAAI,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,gBAAgB,IAAI,CAAC,aAAa,QAAA,GAAW,GAAI,GAAE,EAAE,CAAC;AAChF;;AAEA,EAAE,IAAI,WAAW,CAAC,CAAC,EAAU;AAC7B,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,EAAE;AACxB,MAAM,IAAI,CAAC,QAAQ,CAAC,CAAC,WAAA,GAAc,CAAC;AACpC;AACA;;AAEA,EAAE,IAAI,QAAQ,GAAW;AACzB,IAAI,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,aAAa,IAAI,CAAC,gBAAgB,EAAC,GAAI,QAAS,GAAE,OAAO,CAAC;AACpF;;AAEA,EAAE,IAAI,QAAQ,CAAC,CAAC,EAAU;AAC1B,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,EAAE;AACxB,MAAM,IAAI,CAAC,QAAQ,CAAC,CAAC,QAAA,GAAW,CAAC;AACjC;AACA;AACA;;;;"}
@@ -1,4 +1,3 @@
1
- import { _nullishCoalesce, _optionalChain } from '@sentry/core';
2
1
  import * as net from 'node:net';
3
2
  import * as tls from 'node:tls';
4
3
  import { logger } from '@sentry/core';
@@ -28,7 +27,7 @@ class HttpsProxyAgent extends Agent {
28
27
  super(opts);
29
28
  this.options = {};
30
29
  this.proxy = typeof proxy === 'string' ? new URL(proxy) : proxy;
31
- this.proxyHeaders = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _2 => _2.headers]), () => ( {}));
30
+ this.proxyHeaders = opts?.headers ?? {};
32
31
  debug('Creating new HttpsProxyAgent instance: %o', this.proxy.href);
33
32
 
34
33
  // Trim off the brackets from IPv6 addresses
@@ -144,7 +143,7 @@ class HttpsProxyAgent extends Agent {
144
143
 
145
144
  return fakeSocket;
146
145
  }
147
- }HttpsProxyAgent.__initStatic();
146
+ } HttpsProxyAgent.__initStatic();
148
147
 
149
148
  function resume(socket) {
150
149
  socket.resume();
@@ -1 +1 @@
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 { Agent } from './base';\nimport type { AgentConnectOpts } 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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAS,CAAK,CAAA,CAAA,CAAA,CAAA,CAAC,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,EAAmB;EACvC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAC,CAAG,CAAA,CAAA,CAAC,qBAAqB,EAAE,CAAA,CAAA,CAAG,IAAI,CAAC;AAC5C;;AAkBA,CAAA,CAAA;CACA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CA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A,GAAA,CAAA;IACA;EACA;EACA,OAAA,CAAA,CAAA,CAAA;AACA;;"}
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 { Agent } from './base';\nimport type { AgentConnectOpts } 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,I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SAAA,CAAA;AACA;;AAEA,MAAA,OAAA,MAAA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAA,MAAA,CAAA,OAAA,EAAA;;AAEA,IAAA,MAAA,UAAA,GAAA,IAAA,GAAA,CAAA,MAAA,CAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA;AACA,IAAA,UAAA,CAAA,QAAA,GAAA,IAAA;;AAEA;AACA,IAAA,GAAA,CAAA,IAAA,CAAA,QAAA,EAAA,CAAA,CAAA,KAAA;AACA,MAAA,KAAA,CAAA,2CAAA,CAAA;AACA;AACA;AACA;AACA,MAAA,CAAA,CAAA,IAAA,CAAA,QAAA,CAAA;AACA,MAAA,CAAA,CAAA,IAAA,CAAA,IAAA,CAAA;AACA,KAAA,CAAA;;AAEA,IAAA,OAAA,UAAA;AACA;AACA,CAAA,CAAA,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;;;;"}
@@ -51,7 +51,7 @@ function parseProxyResponse(socket) {
51
51
  return;
52
52
  }
53
53
 
54
- const headerParts = buffered.slice(0, endOfHeaders).toString('ascii').split('\r\n');
54
+ const headerParts = buffered.subarray(0, endOfHeaders).toString('ascii').split('\r\n');
55
55
  const firstLine = headerParts.shift();
56
56
  if (!firstLine) {
57
57
  socket.destroy();
@@ -1 +1 @@
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.slice(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"],"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,QAAQ,MAAM,GAAA,GAAM,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,WAAW,EAAE;AAC7D,QAAQ,MAAM,KAAA,GAAQ,MAAM,CAAC,KAAK,CAAC,UAAW,GAAE,CAAC,CAAC,CAAC,SAAS,EAAE;AAC9D,QAAQ,MAAM,OAAQ,GAAE,OAAO,CAAC,GAAG,CAAC;AACpC,QAAQ,IAAI,OAAO,OAAQ,KAAI,QAAQ,EAAE;AACzC,UAAU,OAAO,CAAC,GAAG,CAAA,GAAI,CAAC,OAAO,EAAE,KAAK,CAAC;AACzC,SAAQ,MAAO,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
+ {"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;AAC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Q,IAAI,OAAO,OAAQ,KAAI,QAAQ,EAAE;AACzC,UAAU,OAAO,CAAC,GAAG,CAAA,GAAI,CAAC,OAAO,EAAE,KAAK,CAAC;AACzC,SAAQ,MAAO,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;;;;"}
@@ -12,7 +12,7 @@ function getSentryRelease(fallback) {
12
12
  }
13
13
 
14
14
  // This supports the variable that sentry-webpack-plugin injects
15
- if (GLOBAL_OBJ.SENTRY_RELEASE && GLOBAL_OBJ.SENTRY_RELEASE.id) {
15
+ if (GLOBAL_OBJ.SENTRY_RELEASE?.id) {
16
16
  return GLOBAL_OBJ.SENTRY_RELEASE.id;
17
17
  }
18
18
 
@@ -1 +1 @@
1
- {"version":3,"file":"api.js","sources":["../../../src/sdk/api.ts"],"sourcesContent":["// PUBLIC APIS\n\nimport type { StackParser } from '@sentry/core';\nimport { GLOBAL_OBJ, createStackParser, 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 && 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,cAAA,IAAkB,UAAU,CAAC,cAAc,CAAC,EAAE,EAAE;AACjE,IAAI,OAAO,UAAU,CAAC,cAAc,CAAC,EAAE;AACvC;;AAEA;AACA;AACA;AACA;;AAEA,EAAE,MAAM,gC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ourcesContent":["// PUBLIC APIS\n\nimport type { StackParser } from '@sentry/core';\nimport { GLOBAL_OBJ, createStackParser, 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,E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;AACA;;AAEA;AACa,MAAA,kBAAkB,GAAgB,iBAAiB,CAAC,mBAAmB,CAAC,2BAA2B,EAAE,CAAC;;;;"}
@@ -1,4 +1,3 @@
1
- import { _nullishCoalesce, _optionalChain } from '@sentry/core';
2
1
  import * as os from 'node:os';
3
2
  import { trace } from '@opentelemetry/api';
4
3
  import { registerInstrumentations } from '@opentelemetry/instrumentation';
@@ -53,7 +52,7 @@ class NodeClient extends ServerRuntimeClient {
53
52
  // eslint-disable-next-line jsdoc/require-jsdoc
54
53
  async flush(timeout) {
55
54
  const provider = this.traceProvider;
56
- const spanProcessor = _optionalChain([provider, 'optionalAccess', _ => _.activeSpanProcessor]);
55
+ const spanProcessor = provider?.activeSpanProcessor;
57
56
 
58
57
  if (spanProcessor) {
59
58
  await spanProcessor.forceFlush();
@@ -105,7 +104,7 @@ class NodeClient extends ServerRuntimeClient {
105
104
  this._clientReportInterval = setInterval(() => {
106
105
  DEBUG_BUILD && logger.log('Flushing client reports based on interval.');
107
106
  this._flushOutcomes();
108
- }, _nullishCoalesce(clientOptions.clientReportFlushInterval, () => ( DEFAULT_CLIENT_REPORT_FLUSH_INTERVAL_MS)))
107
+ }, clientOptions.clientReportFlushInterval ?? DEFAULT_CLIENT_REPORT_FLUSH_INTERVAL_MS)
109
108
  // Unref is critical for not preventing the process from exiting because the interval is active.
110
109
  .unref();
111
110