@sentry/node 9.35.0 → 9.36.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (474) hide show
  1. package/build/cjs/index.js +38 -56
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/integrations/fs.js +2 -2
  4. package/build/cjs/integrations/fs.js.map +1 -1
  5. package/build/cjs/integrations/http/index.js +7 -11
  6. package/build/cjs/integrations/http/index.js.map +1 -1
  7. package/build/cjs/integrations/node-fetch/index.js +4 -5
  8. package/build/cjs/integrations/node-fetch/index.js.map +1 -1
  9. package/build/cjs/integrations/tracing/amqplib.js +4 -5
  10. package/build/cjs/integrations/tracing/amqplib.js.map +1 -1
  11. package/build/cjs/integrations/tracing/connect.js +3 -4
  12. package/build/cjs/integrations/tracing/connect.js.map +1 -1
  13. package/build/cjs/integrations/tracing/dataloader.js +3 -3
  14. package/build/cjs/integrations/tracing/dataloader.js.map +1 -1
  15. package/build/cjs/integrations/tracing/express.js +5 -7
  16. package/build/cjs/integrations/tracing/express.js.map +1 -1
  17. package/build/cjs/integrations/tracing/fastify/fastify-otel/index.js +3 -3
  18. package/build/cjs/integrations/tracing/fastify/fastify-otel/index.js.map +1 -1
  19. package/build/cjs/integrations/tracing/fastify/index.js +6 -6
  20. package/build/cjs/integrations/tracing/fastify/index.js.map +1 -1
  21. package/build/cjs/integrations/tracing/genericPool.js +3 -3
  22. package/build/cjs/integrations/tracing/genericPool.js.map +1 -1
  23. package/build/cjs/integrations/tracing/graphql.js +3 -4
  24. package/build/cjs/integrations/tracing/graphql.js.map +1 -1
  25. package/build/cjs/integrations/tracing/hapi/index.js +3 -4
  26. package/build/cjs/integrations/tracing/hapi/index.js.map +1 -1
  27. package/build/cjs/integrations/tracing/kafka.js +4 -5
  28. package/build/cjs/integrations/tracing/kafka.js.map +1 -1
  29. package/build/cjs/integrations/tracing/knex.js +3 -3
  30. package/build/cjs/integrations/tracing/knex.js.map +1 -1
  31. package/build/cjs/integrations/tracing/koa.js +4 -6
  32. package/build/cjs/integrations/tracing/koa.js.map +1 -1
  33. package/build/cjs/integrations/tracing/lrumemoizer.js +2 -2
  34. package/build/cjs/integrations/tracing/lrumemoizer.js.map +1 -1
  35. package/build/cjs/integrations/tracing/mongo.js +3 -4
  36. package/build/cjs/integrations/tracing/mongo.js.map +1 -1
  37. package/build/cjs/integrations/tracing/mongoose.js +3 -4
  38. package/build/cjs/integrations/tracing/mongoose.js.map +1 -1
  39. package/build/cjs/integrations/tracing/mysql.js +2 -2
  40. package/build/cjs/integrations/tracing/mysql.js.map +1 -1
  41. package/build/cjs/integrations/tracing/mysql2.js +3 -4
  42. package/build/cjs/integrations/tracing/mysql2.js.map +1 -1
  43. package/build/cjs/integrations/tracing/postgres.js +3 -4
  44. package/build/cjs/integrations/tracing/postgres.js.map +1 -1
  45. package/build/cjs/integrations/tracing/postgresjs.js +3 -4
  46. package/build/cjs/integrations/tracing/postgresjs.js.map +1 -1
  47. package/build/cjs/integrations/tracing/prisma.js +2 -2
  48. package/build/cjs/integrations/tracing/prisma.js.map +1 -1
  49. package/build/cjs/integrations/tracing/redis.js +3 -3
  50. package/build/cjs/integrations/tracing/redis.js.map +1 -1
  51. package/build/cjs/integrations/tracing/tedious.js +3 -3
  52. package/build/cjs/integrations/tracing/tedious.js.map +1 -1
  53. package/build/cjs/integrations/tracing/vercelai/index.js +2 -2
  54. package/build/cjs/integrations/tracing/vercelai/index.js.map +1 -1
  55. package/build/cjs/preload.js +2 -2
  56. package/build/cjs/preload.js.map +1 -1
  57. package/build/cjs/sdk/index.js +22 -203
  58. package/build/cjs/sdk/index.js.map +1 -1
  59. package/build/cjs/sdk/initOtel.js +4 -22
  60. package/build/cjs/sdk/initOtel.js.map +1 -1
  61. package/build/esm/index.js +2 -21
  62. package/build/esm/index.js.map +1 -1
  63. package/build/esm/integrations/fs.js +1 -1
  64. package/build/esm/integrations/fs.js.map +1 -1
  65. package/build/esm/integrations/http/index.js +1 -5
  66. package/build/esm/integrations/http/index.js.map +1 -1
  67. package/build/esm/integrations/node-fetch/index.js +2 -3
  68. package/build/esm/integrations/node-fetch/index.js.map +1 -1
  69. package/build/esm/integrations/tracing/amqplib.js +1 -2
  70. package/build/esm/integrations/tracing/amqplib.js.map +1 -1
  71. package/build/esm/integrations/tracing/connect.js +1 -2
  72. package/build/esm/integrations/tracing/connect.js.map +1 -1
  73. package/build/esm/integrations/tracing/dataloader.js +1 -1
  74. package/build/esm/integrations/tracing/dataloader.js.map +1 -1
  75. package/build/esm/integrations/tracing/express.js +2 -4
  76. package/build/esm/integrations/tracing/express.js.map +1 -1
  77. package/build/esm/integrations/tracing/fastify/fastify-otel/index.js +3 -3
  78. package/build/esm/integrations/tracing/fastify/fastify-otel/index.js.map +1 -1
  79. package/build/esm/integrations/tracing/fastify/index.js +5 -5
  80. package/build/esm/integrations/tracing/fastify/index.js.map +1 -1
  81. package/build/esm/integrations/tracing/genericPool.js +1 -1
  82. package/build/esm/integrations/tracing/genericPool.js.map +1 -1
  83. package/build/esm/integrations/tracing/graphql.js +2 -3
  84. package/build/esm/integrations/tracing/graphql.js.map +1 -1
  85. package/build/esm/integrations/tracing/hapi/index.js +1 -2
  86. package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
  87. package/build/esm/integrations/tracing/kafka.js +1 -2
  88. package/build/esm/integrations/tracing/kafka.js.map +1 -1
  89. package/build/esm/integrations/tracing/knex.js +1 -1
  90. package/build/esm/integrations/tracing/knex.js.map +1 -1
  91. package/build/esm/integrations/tracing/koa.js +2 -4
  92. package/build/esm/integrations/tracing/koa.js.map +1 -1
  93. package/build/esm/integrations/tracing/lrumemoizer.js +1 -1
  94. package/build/esm/integrations/tracing/lrumemoizer.js.map +1 -1
  95. package/build/esm/integrations/tracing/mongo.js +1 -2
  96. package/build/esm/integrations/tracing/mongo.js.map +1 -1
  97. package/build/esm/integrations/tracing/mongoose.js +1 -2
  98. package/build/esm/integrations/tracing/mongoose.js.map +1 -1
  99. package/build/esm/integrations/tracing/mysql.js +1 -1
  100. package/build/esm/integrations/tracing/mysql.js.map +1 -1
  101. package/build/esm/integrations/tracing/mysql2.js +1 -2
  102. package/build/esm/integrations/tracing/mysql2.js.map +1 -1
  103. package/build/esm/integrations/tracing/postgres.js +1 -2
  104. package/build/esm/integrations/tracing/postgres.js.map +1 -1
  105. package/build/esm/integrations/tracing/postgresjs.js +2 -3
  106. package/build/esm/integrations/tracing/postgresjs.js.map +1 -1
  107. package/build/esm/integrations/tracing/prisma.js +1 -1
  108. package/build/esm/integrations/tracing/prisma.js.map +1 -1
  109. package/build/esm/integrations/tracing/redis.js +1 -1
  110. package/build/esm/integrations/tracing/redis.js.map +1 -1
  111. package/build/esm/integrations/tracing/tedious.js +1 -1
  112. package/build/esm/integrations/tracing/tedious.js.map +1 -1
  113. package/build/esm/integrations/tracing/vercelai/index.js +1 -1
  114. package/build/esm/integrations/tracing/vercelai/index.js.map +1 -1
  115. package/build/esm/package.json +1 -1
  116. package/build/esm/preload.js +1 -1
  117. package/build/esm/preload.js.map +1 -1
  118. package/build/esm/sdk/index.js +22 -202
  119. package/build/esm/sdk/index.js.map +1 -1
  120. package/build/esm/sdk/initOtel.js +3 -21
  121. package/build/esm/sdk/initOtel.js.map +1 -1
  122. package/build/types/index.d.ts +2 -21
  123. package/build/types/index.d.ts.map +1 -1
  124. package/build/types/integrations/http/index.d.ts +1 -1
  125. package/build/types/integrations/http/index.d.ts.map +1 -1
  126. package/build/types/integrations/node-fetch/index.d.ts.map +1 -1
  127. package/build/types/integrations/tracing/amqplib.d.ts.map +1 -1
  128. package/build/types/integrations/tracing/connect.d.ts.map +1 -1
  129. package/build/types/integrations/tracing/express.d.ts.map +1 -1
  130. package/build/types/integrations/tracing/graphql.d.ts.map +1 -1
  131. package/build/types/integrations/tracing/hapi/index.d.ts.map +1 -1
  132. package/build/types/integrations/tracing/kafka.d.ts.map +1 -1
  133. package/build/types/integrations/tracing/koa.d.ts.map +1 -1
  134. package/build/types/integrations/tracing/mongo.d.ts.map +1 -1
  135. package/build/types/integrations/tracing/mongoose.d.ts.map +1 -1
  136. package/build/types/integrations/tracing/mysql2.d.ts.map +1 -1
  137. package/build/types/integrations/tracing/postgres.d.ts.map +1 -1
  138. package/build/types/integrations/tracing/postgresjs.d.ts.map +1 -1
  139. package/build/types/integrations/tracing/vercelai/index.d.ts.map +1 -1
  140. package/build/types/sdk/index.d.ts +2 -6
  141. package/build/types/sdk/index.d.ts.map +1 -1
  142. package/build/types/sdk/initOtel.d.ts +1 -1
  143. package/build/types/sdk/initOtel.d.ts.map +1 -1
  144. package/build/types/types.d.ts +1 -1
  145. package/build/types/types.d.ts.map +1 -1
  146. package/build/types-ts3.8/index.d.ts +2 -21
  147. package/build/types-ts3.8/integrations/http/index.d.ts +1 -1
  148. package/build/types-ts3.8/sdk/index.d.ts +2 -6
  149. package/build/types-ts3.8/sdk/initOtel.d.ts +1 -1
  150. package/build/types-ts3.8/types.d.ts +1 -1
  151. package/package.json +4 -3
  152. package/build/cjs/cron/common.js +0 -56
  153. package/build/cjs/cron/common.js.map +0 -1
  154. package/build/cjs/cron/cron.js +0 -112
  155. package/build/cjs/cron/cron.js.map +0 -1
  156. package/build/cjs/cron/index.js +0 -15
  157. package/build/cjs/cron/index.js.map +0 -1
  158. package/build/cjs/cron/node-cron.js +0 -71
  159. package/build/cjs/cron/node-cron.js.map +0 -1
  160. package/build/cjs/cron/node-schedule.js +0 -65
  161. package/build/cjs/cron/node-schedule.js.map +0 -1
  162. package/build/cjs/integrations/anr/index.js +0 -238
  163. package/build/cjs/integrations/anr/index.js.map +0 -1
  164. package/build/cjs/integrations/childProcess.js +0 -100
  165. package/build/cjs/integrations/childProcess.js.map +0 -1
  166. package/build/cjs/integrations/context.js +0 -457
  167. package/build/cjs/integrations/context.js.map +0 -1
  168. package/build/cjs/integrations/contextlines.js +0 -405
  169. package/build/cjs/integrations/contextlines.js.map +0 -1
  170. package/build/cjs/integrations/http/SentryHttpInstrumentation.js +0 -558
  171. package/build/cjs/integrations/http/SentryHttpInstrumentation.js.map +0 -1
  172. package/build/cjs/integrations/local-variables/common.js +0 -69
  173. package/build/cjs/integrations/local-variables/common.js.map +0 -1
  174. package/build/cjs/integrations/local-variables/index.js +0 -12
  175. package/build/cjs/integrations/local-variables/index.js.map +0 -1
  176. package/build/cjs/integrations/local-variables/local-variables-async.js +0 -143
  177. package/build/cjs/integrations/local-variables/local-variables-async.js.map +0 -1
  178. package/build/cjs/integrations/local-variables/local-variables-sync.js +0 -410
  179. package/build/cjs/integrations/local-variables/local-variables-sync.js.map +0 -1
  180. package/build/cjs/integrations/modules.js +0 -135
  181. package/build/cjs/integrations/modules.js.map +0 -1
  182. package/build/cjs/integrations/node-fetch/SentryNodeFetchInstrumentation.js +0 -291
  183. package/build/cjs/integrations/node-fetch/SentryNodeFetchInstrumentation.js.map +0 -1
  184. package/build/cjs/integrations/onuncaughtexception.js +0 -134
  185. package/build/cjs/integrations/onuncaughtexception.js.map +0 -1
  186. package/build/cjs/integrations/onunhandledrejection.js +0 -89
  187. package/build/cjs/integrations/onunhandledrejection.js.map +0 -1
  188. package/build/cjs/integrations/processSession.js +0 -36
  189. package/build/cjs/integrations/processSession.js.map +0 -1
  190. package/build/cjs/integrations/spotlight.js +0 -101
  191. package/build/cjs/integrations/spotlight.js.map +0 -1
  192. package/build/cjs/integrations/winston.js +0 -151
  193. package/build/cjs/integrations/winston.js.map +0 -1
  194. package/build/cjs/logs/capture.js +0 -29
  195. package/build/cjs/logs/capture.js.map +0 -1
  196. package/build/cjs/logs/exports.js +0 -178
  197. package/build/cjs/logs/exports.js.map +0 -1
  198. package/build/cjs/nodeVersion.js +0 -12
  199. package/build/cjs/nodeVersion.js.map +0 -1
  200. package/build/cjs/otel/contextManager.js +0 -16
  201. package/build/cjs/otel/contextManager.js.map +0 -1
  202. package/build/cjs/otel/instrument.js +0 -139
  203. package/build/cjs/otel/instrument.js.map +0 -1
  204. package/build/cjs/proxy/base.js +0 -122
  205. package/build/cjs/proxy/base.js.map +0 -1
  206. package/build/cjs/proxy/index.js +0 -173
  207. package/build/cjs/proxy/index.js.map +0 -1
  208. package/build/cjs/proxy/parse-proxy-response.js +0 -104
  209. package/build/cjs/proxy/parse-proxy-response.js.map +0 -1
  210. package/build/cjs/sdk/api.js +0 -117
  211. package/build/cjs/sdk/api.js.map +0 -1
  212. package/build/cjs/sdk/client.js +0 -156
  213. package/build/cjs/sdk/client.js.map +0 -1
  214. package/build/cjs/transports/http.js +0 -158
  215. package/build/cjs/transports/http.js.map +0 -1
  216. package/build/cjs/utils/addOriginToSpan.js +0 -11
  217. package/build/cjs/utils/addOriginToSpan.js.map +0 -1
  218. package/build/cjs/utils/baggage.js +0 -36
  219. package/build/cjs/utils/baggage.js.map +0 -1
  220. package/build/cjs/utils/commonjs.js +0 -13
  221. package/build/cjs/utils/commonjs.js.map +0 -1
  222. package/build/cjs/utils/createMissingInstrumentationContext.js +0 -11
  223. package/build/cjs/utils/createMissingInstrumentationContext.js.map +0 -1
  224. package/build/cjs/utils/debug.js +0 -23
  225. package/build/cjs/utils/debug.js.map +0 -1
  226. package/build/cjs/utils/ensureIsWrapped.js +0 -41
  227. package/build/cjs/utils/ensureIsWrapped.js.map +0 -1
  228. package/build/cjs/utils/envToBool.js +0 -32
  229. package/build/cjs/utils/envToBool.js.map +0 -1
  230. package/build/cjs/utils/errorhandling.js +0 -42
  231. package/build/cjs/utils/errorhandling.js.map +0 -1
  232. package/build/cjs/utils/getRequestUrl.js +0 -18
  233. package/build/cjs/utils/getRequestUrl.js.map +0 -1
  234. package/build/cjs/utils/module.js +0 -60
  235. package/build/cjs/utils/module.js.map +0 -1
  236. package/build/esm/cron/common.js +0 -54
  237. package/build/esm/cron/common.js.map +0 -1
  238. package/build/esm/cron/cron.js +0 -110
  239. package/build/esm/cron/cron.js.map +0 -1
  240. package/build/esm/cron/index.js +0 -13
  241. package/build/esm/cron/index.js.map +0 -1
  242. package/build/esm/cron/node-cron.js +0 -69
  243. package/build/esm/cron/node-cron.js.map +0 -1
  244. package/build/esm/cron/node-schedule.js +0 -63
  245. package/build/esm/cron/node-schedule.js.map +0 -1
  246. package/build/esm/integrations/anr/index.js +0 -234
  247. package/build/esm/integrations/anr/index.js.map +0 -1
  248. package/build/esm/integrations/anr/worker-script.js +0 -2
  249. package/build/esm/integrations/childProcess.js +0 -98
  250. package/build/esm/integrations/childProcess.js.map +0 -1
  251. package/build/esm/integrations/context.js +0 -451
  252. package/build/esm/integrations/context.js.map +0 -1
  253. package/build/esm/integrations/contextlines.js +0 -399
  254. package/build/esm/integrations/contextlines.js.map +0 -1
  255. package/build/esm/integrations/http/SentryHttpInstrumentation.js +0 -555
  256. package/build/esm/integrations/http/SentryHttpInstrumentation.js.map +0 -1
  257. package/build/esm/integrations/local-variables/common.js +0 -64
  258. package/build/esm/integrations/local-variables/common.js.map +0 -1
  259. package/build/esm/integrations/local-variables/index.js +0 -10
  260. package/build/esm/integrations/local-variables/index.js.map +0 -1
  261. package/build/esm/integrations/local-variables/local-variables-async.js +0 -140
  262. package/build/esm/integrations/local-variables/local-variables-async.js.map +0 -1
  263. package/build/esm/integrations/local-variables/local-variables-sync.js +0 -405
  264. package/build/esm/integrations/local-variables/local-variables-sync.js.map +0 -1
  265. package/build/esm/integrations/local-variables/worker-script.js +0 -2
  266. package/build/esm/integrations/modules.js +0 -133
  267. package/build/esm/integrations/modules.js.map +0 -1
  268. package/build/esm/integrations/node-fetch/SentryNodeFetchInstrumentation.js +0 -289
  269. package/build/esm/integrations/node-fetch/SentryNodeFetchInstrumentation.js.map +0 -1
  270. package/build/esm/integrations/onuncaughtexception.js +0 -131
  271. package/build/esm/integrations/onuncaughtexception.js.map +0 -1
  272. package/build/esm/integrations/onunhandledrejection.js +0 -86
  273. package/build/esm/integrations/onunhandledrejection.js.map +0 -1
  274. package/build/esm/integrations/processSession.js +0 -34
  275. package/build/esm/integrations/processSession.js.map +0 -1
  276. package/build/esm/integrations/spotlight.js +0 -98
  277. package/build/esm/integrations/spotlight.js.map +0 -1
  278. package/build/esm/integrations/winston.js +0 -149
  279. package/build/esm/integrations/winston.js.map +0 -1
  280. package/build/esm/logs/capture.js +0 -27
  281. package/build/esm/logs/capture.js.map +0 -1
  282. package/build/esm/logs/exports.js +0 -170
  283. package/build/esm/logs/exports.js.map +0 -1
  284. package/build/esm/nodeVersion.js +0 -8
  285. package/build/esm/nodeVersion.js.map +0 -1
  286. package/build/esm/otel/contextManager.js +0 -14
  287. package/build/esm/otel/contextManager.js.map +0 -1
  288. package/build/esm/otel/instrument.js +0 -135
  289. package/build/esm/otel/instrument.js.map +0 -1
  290. package/build/esm/proxy/base.js +0 -120
  291. package/build/esm/proxy/base.js.map +0 -1
  292. package/build/esm/proxy/index.js +0 -171
  293. package/build/esm/proxy/index.js.map +0 -1
  294. package/build/esm/proxy/parse-proxy-response.js +0 -102
  295. package/build/esm/proxy/parse-proxy-response.js.map +0 -1
  296. package/build/esm/sdk/api.js +0 -114
  297. package/build/esm/sdk/api.js.map +0 -1
  298. package/build/esm/sdk/client.js +0 -154
  299. package/build/esm/sdk/client.js.map +0 -1
  300. package/build/esm/transports/http.js +0 -156
  301. package/build/esm/transports/http.js.map +0 -1
  302. package/build/esm/utils/addOriginToSpan.js +0 -9
  303. package/build/esm/utils/addOriginToSpan.js.map +0 -1
  304. package/build/esm/utils/baggage.js +0 -34
  305. package/build/esm/utils/baggage.js.map +0 -1
  306. package/build/esm/utils/commonjs.js +0 -11
  307. package/build/esm/utils/commonjs.js.map +0 -1
  308. package/build/esm/utils/createMissingInstrumentationContext.js +0 -9
  309. package/build/esm/utils/createMissingInstrumentationContext.js.map +0 -1
  310. package/build/esm/utils/debug.js +0 -21
  311. package/build/esm/utils/debug.js.map +0 -1
  312. package/build/esm/utils/ensureIsWrapped.js +0 -39
  313. package/build/esm/utils/ensureIsWrapped.js.map +0 -1
  314. package/build/esm/utils/envToBool.js +0 -28
  315. package/build/esm/utils/envToBool.js.map +0 -1
  316. package/build/esm/utils/errorhandling.js +0 -40
  317. package/build/esm/utils/errorhandling.js.map +0 -1
  318. package/build/esm/utils/getRequestUrl.js +0 -16
  319. package/build/esm/utils/getRequestUrl.js.map +0 -1
  320. package/build/esm/utils/module.js +0 -58
  321. package/build/esm/utils/module.js.map +0 -1
  322. package/build/types/cron/common.d.ts +0 -5
  323. package/build/types/cron/common.d.ts.map +0 -1
  324. package/build/types/cron/cron.d.ts +0 -43
  325. package/build/types/cron/cron.d.ts.map +0 -1
  326. package/build/types/cron/index.d.ts +0 -10
  327. package/build/types/cron/index.d.ts.map +0 -1
  328. package/build/types/cron/node-cron.d.ts +0 -27
  329. package/build/types/cron/node-cron.d.ts.map +0 -1
  330. package/build/types/cron/node-schedule.d.ts +0 -19
  331. package/build/types/cron/node-schedule.d.ts.map +0 -1
  332. package/build/types/integrations/anr/common.d.ts +0 -52
  333. package/build/types/integrations/anr/common.d.ts.map +0 -1
  334. package/build/types/integrations/anr/index.d.ts +0 -13
  335. package/build/types/integrations/anr/index.d.ts.map +0 -1
  336. package/build/types/integrations/anr/worker.d.ts +0 -2
  337. package/build/types/integrations/anr/worker.d.ts.map +0 -1
  338. package/build/types/integrations/childProcess.d.ts +0 -20
  339. package/build/types/integrations/childProcess.d.ts.map +0 -1
  340. package/build/types/integrations/context.d.ts +0 -30
  341. package/build/types/integrations/context.d.ts.map +0 -1
  342. package/build/types/integrations/contextlines.d.ts +0 -31
  343. package/build/types/integrations/contextlines.d.ts.map +0 -1
  344. package/build/types/integrations/http/SentryHttpInstrumentation.d.ts +0 -131
  345. package/build/types/integrations/http/SentryHttpInstrumentation.d.ts.map +0 -1
  346. package/build/types/integrations/local-variables/common.d.ts +0 -66
  347. package/build/types/integrations/local-variables/common.d.ts.map +0 -1
  348. package/build/types/integrations/local-variables/index.d.ts +0 -4
  349. package/build/types/integrations/local-variables/index.d.ts.map +0 -1
  350. package/build/types/integrations/local-variables/local-variables-async.d.ts +0 -7
  351. package/build/types/integrations/local-variables/local-variables-async.d.ts.map +0 -1
  352. package/build/types/integrations/local-variables/local-variables-sync.d.ts +0 -34
  353. package/build/types/integrations/local-variables/local-variables-sync.d.ts.map +0 -1
  354. package/build/types/integrations/local-variables/worker.d.ts +0 -2
  355. package/build/types/integrations/local-variables/worker.d.ts.map +0 -1
  356. package/build/types/integrations/modules.d.ts +0 -17
  357. package/build/types/integrations/modules.d.ts.map +0 -1
  358. package/build/types/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts +0 -56
  359. package/build/types/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts.map +0 -1
  360. package/build/types/integrations/onuncaughtexception.d.ts +0 -31
  361. package/build/types/integrations/onuncaughtexception.d.ts.map +0 -1
  362. package/build/types/integrations/onunhandledrejection.d.ts +0 -23
  363. package/build/types/integrations/onunhandledrejection.d.ts.map +0 -1
  364. package/build/types/integrations/processSession.d.ts +0 -5
  365. package/build/types/integrations/processSession.d.ts.map +0 -1
  366. package/build/types/integrations/spotlight.d.ts +0 -18
  367. package/build/types/integrations/spotlight.d.ts.map +0 -1
  368. package/build/types/integrations/winston.d.ts +0 -44
  369. package/build/types/integrations/winston.d.ts.map +0 -1
  370. package/build/types/logs/capture.d.ts +0 -11
  371. package/build/types/logs/capture.d.ts.map +0 -1
  372. package/build/types/logs/exports.d.ts +0 -150
  373. package/build/types/logs/exports.d.ts.map +0 -1
  374. package/build/types/nodeVersion.d.ts +0 -8
  375. package/build/types/nodeVersion.d.ts.map +0 -1
  376. package/build/types/otel/contextManager.d.ts +0 -10
  377. package/build/types/otel/contextManager.d.ts.map +0 -1
  378. package/build/types/otel/instrument.d.ts +0 -23
  379. package/build/types/otel/instrument.d.ts.map +0 -1
  380. package/build/types/proxy/base.d.ts +0 -65
  381. package/build/types/proxy/base.d.ts.map +0 -1
  382. package/build/types/proxy/helpers.d.ts +0 -42
  383. package/build/types/proxy/helpers.d.ts.map +0 -1
  384. package/build/types/proxy/index.d.ts +0 -73
  385. package/build/types/proxy/index.d.ts.map +0 -1
  386. package/build/types/proxy/parse-proxy-response.d.ts +0 -43
  387. package/build/types/proxy/parse-proxy-response.d.ts.map +0 -1
  388. package/build/types/sdk/api.d.ts +0 -8
  389. package/build/types/sdk/api.d.ts.map +0 -1
  390. package/build/types/sdk/client.d.ts +0 -29
  391. package/build/types/sdk/client.d.ts.map +0 -1
  392. package/build/types/sdk/scope.d.ts +0 -7
  393. package/build/types/sdk/scope.d.ts.map +0 -1
  394. package/build/types/transports/http-module.d.ts +0 -31
  395. package/build/types/transports/http-module.d.ts.map +0 -1
  396. package/build/types/transports/http.d.ts +0 -21
  397. package/build/types/transports/http.d.ts.map +0 -1
  398. package/build/types/transports/index.d.ts +0 -3
  399. package/build/types/transports/index.d.ts.map +0 -1
  400. package/build/types/utils/addOriginToSpan.d.ts +0 -5
  401. package/build/types/utils/addOriginToSpan.d.ts.map +0 -1
  402. package/build/types/utils/baggage.d.ts +0 -6
  403. package/build/types/utils/baggage.d.ts.map +0 -1
  404. package/build/types/utils/commonjs.d.ts +0 -3
  405. package/build/types/utils/commonjs.d.ts.map +0 -1
  406. package/build/types/utils/createMissingInstrumentationContext.d.ts +0 -3
  407. package/build/types/utils/createMissingInstrumentationContext.d.ts.map +0 -1
  408. package/build/types/utils/debug.d.ts +0 -5
  409. package/build/types/utils/debug.d.ts.map +0 -1
  410. package/build/types/utils/ensureIsWrapped.d.ts +0 -5
  411. package/build/types/utils/ensureIsWrapped.d.ts.map +0 -1
  412. package/build/types/utils/entry-point.d.ts +0 -24
  413. package/build/types/utils/entry-point.d.ts.map +0 -1
  414. package/build/types/utils/envToBool.d.ts +0 -13
  415. package/build/types/utils/envToBool.d.ts.map +0 -1
  416. package/build/types/utils/errorhandling.d.ts +0 -5
  417. package/build/types/utils/errorhandling.d.ts.map +0 -1
  418. package/build/types/utils/getRequestUrl.d.ts +0 -5
  419. package/build/types/utils/getRequestUrl.d.ts.map +0 -1
  420. package/build/types/utils/module.d.ts +0 -3
  421. package/build/types/utils/module.d.ts.map +0 -1
  422. package/build/types/utils/prepareEvent.d.ts +0 -17
  423. package/build/types/utils/prepareEvent.d.ts.map +0 -1
  424. package/build/types-ts3.8/cron/common.d.ts +0 -5
  425. package/build/types-ts3.8/cron/cron.d.ts +0 -43
  426. package/build/types-ts3.8/cron/index.d.ts +0 -10
  427. package/build/types-ts3.8/cron/node-cron.d.ts +0 -27
  428. package/build/types-ts3.8/cron/node-schedule.d.ts +0 -19
  429. package/build/types-ts3.8/integrations/anr/common.d.ts +0 -52
  430. package/build/types-ts3.8/integrations/anr/index.d.ts +0 -13
  431. package/build/types-ts3.8/integrations/anr/worker.d.ts +0 -2
  432. package/build/types-ts3.8/integrations/childProcess.d.ts +0 -20
  433. package/build/types-ts3.8/integrations/context.d.ts +0 -30
  434. package/build/types-ts3.8/integrations/contextlines.d.ts +0 -31
  435. package/build/types-ts3.8/integrations/http/SentryHttpInstrumentation.d.ts +0 -133
  436. package/build/types-ts3.8/integrations/local-variables/common.d.ts +0 -66
  437. package/build/types-ts3.8/integrations/local-variables/index.d.ts +0 -4
  438. package/build/types-ts3.8/integrations/local-variables/local-variables-async.d.ts +0 -7
  439. package/build/types-ts3.8/integrations/local-variables/local-variables-sync.d.ts +0 -34
  440. package/build/types-ts3.8/integrations/local-variables/worker.d.ts +0 -2
  441. package/build/types-ts3.8/integrations/modules.d.ts +0 -17
  442. package/build/types-ts3.8/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts +0 -56
  443. package/build/types-ts3.8/integrations/onuncaughtexception.d.ts +0 -31
  444. package/build/types-ts3.8/integrations/onunhandledrejection.d.ts +0 -23
  445. package/build/types-ts3.8/integrations/processSession.d.ts +0 -5
  446. package/build/types-ts3.8/integrations/spotlight.d.ts +0 -18
  447. package/build/types-ts3.8/integrations/winston.d.ts +0 -44
  448. package/build/types-ts3.8/logs/capture.d.ts +0 -18
  449. package/build/types-ts3.8/logs/exports.d.ts +0 -150
  450. package/build/types-ts3.8/nodeVersion.d.ts +0 -8
  451. package/build/types-ts3.8/otel/contextManager.d.ts +0 -10
  452. package/build/types-ts3.8/otel/instrument.d.ts +0 -23
  453. package/build/types-ts3.8/proxy/base.d.ts +0 -60
  454. package/build/types-ts3.8/proxy/helpers.d.ts +0 -38
  455. package/build/types-ts3.8/proxy/index.d.ts +0 -74
  456. package/build/types-ts3.8/proxy/parse-proxy-response.d.ts +0 -40
  457. package/build/types-ts3.8/sdk/api.d.ts +0 -8
  458. package/build/types-ts3.8/sdk/client.d.ts +0 -32
  459. package/build/types-ts3.8/sdk/scope.d.ts +0 -7
  460. package/build/types-ts3.8/transports/http-module.d.ts +0 -28
  461. package/build/types-ts3.8/transports/http.d.ts +0 -20
  462. package/build/types-ts3.8/transports/index.d.ts +0 -3
  463. package/build/types-ts3.8/utils/addOriginToSpan.d.ts +0 -5
  464. package/build/types-ts3.8/utils/baggage.d.ts +0 -6
  465. package/build/types-ts3.8/utils/commonjs.d.ts +0 -3
  466. package/build/types-ts3.8/utils/createMissingInstrumentationContext.d.ts +0 -3
  467. package/build/types-ts3.8/utils/debug.d.ts +0 -5
  468. package/build/types-ts3.8/utils/ensureIsWrapped.d.ts +0 -5
  469. package/build/types-ts3.8/utils/entry-point.d.ts +0 -24
  470. package/build/types-ts3.8/utils/envToBool.d.ts +0 -13
  471. package/build/types-ts3.8/utils/errorhandling.d.ts +0 -5
  472. package/build/types-ts3.8/utils/getRequestUrl.d.ts +0 -5
  473. package/build/types-ts3.8/utils/module.d.ts +0 -3
  474. package/build/types-ts3.8/utils/prepareEvent.d.ts +0 -17
@@ -1,399 +0,0 @@
1
- import { createReadStream } from 'node:fs';
2
- import { createInterface } from 'node:readline';
3
- import { LRUMap, defineIntegration, logger, snipLine } from '@sentry/core';
4
- import { DEBUG_BUILD } from '../debug-build.js';
5
-
6
- const LRU_FILE_CONTENTS_CACHE = new LRUMap(10);
7
- const LRU_FILE_CONTENTS_FS_READ_FAILED = new LRUMap(20);
8
- const DEFAULT_LINES_OF_CONTEXT = 7;
9
- const INTEGRATION_NAME = 'ContextLines';
10
- // Determines the upper bound of lineno/colno that we will attempt to read. Large colno values are likely to be
11
- // minified code while large lineno values are likely to be bundled code.
12
- // Exported for testing purposes.
13
- const MAX_CONTEXTLINES_COLNO = 1000;
14
- const MAX_CONTEXTLINES_LINENO = 10000;
15
-
16
- /**
17
- * Get or init map value
18
- */
19
- function emplace(map, key, contents) {
20
- const value = map.get(key);
21
-
22
- if (value === undefined) {
23
- map.set(key, contents);
24
- return contents;
25
- }
26
-
27
- return value;
28
- }
29
-
30
- /**
31
- * Determines if context lines should be skipped for a file.
32
- * - .min.(mjs|cjs|js) files are and not useful since they dont point to the original source
33
- * - node: prefixed modules are part of the runtime and cannot be resolved to a file
34
- * - data: skip json, wasm and inline js https://nodejs.org/api/esm.html#data-imports
35
- */
36
- function shouldSkipContextLinesForFile(path) {
37
- // Test the most common prefix and extension first. These are the ones we
38
- // are most likely to see in user applications and are the ones we can break out of first.
39
- if (path.startsWith('node:')) return true;
40
- if (path.endsWith('.min.js')) return true;
41
- if (path.endsWith('.min.cjs')) return true;
42
- if (path.endsWith('.min.mjs')) return true;
43
- if (path.startsWith('data:')) return true;
44
- return false;
45
- }
46
-
47
- /**
48
- * Determines if we should skip contextlines based off the max lineno and colno values.
49
- */
50
- function shouldSkipContextLinesForFrame(frame) {
51
- if (frame.lineno !== undefined && frame.lineno > MAX_CONTEXTLINES_LINENO) return true;
52
- if (frame.colno !== undefined && frame.colno > MAX_CONTEXTLINES_COLNO) return true;
53
- return false;
54
- }
55
- /**
56
- * Checks if we have all the contents that we need in the cache.
57
- */
58
- function rangeExistsInContentCache(file, range) {
59
- const contents = LRU_FILE_CONTENTS_CACHE.get(file);
60
- if (contents === undefined) return false;
61
-
62
- for (let i = range[0]; i <= range[1]; i++) {
63
- if (contents[i] === undefined) {
64
- return false;
65
- }
66
- }
67
-
68
- return true;
69
- }
70
-
71
- /**
72
- * Creates contiguous ranges of lines to read from a file. In the case where context lines overlap,
73
- * the ranges are merged to create a single range.
74
- */
75
- function makeLineReaderRanges(lines, linecontext) {
76
- if (!lines.length) {
77
- return [];
78
- }
79
-
80
- let i = 0;
81
- const line = lines[0];
82
-
83
- if (typeof line !== 'number') {
84
- return [];
85
- }
86
-
87
- let current = makeContextRange(line, linecontext);
88
- const out = [];
89
- // eslint-disable-next-line no-constant-condition
90
- while (true) {
91
- if (i === lines.length - 1) {
92
- out.push(current);
93
- break;
94
- }
95
-
96
- // If the next line falls into the current range, extend the current range to lineno + linecontext.
97
- const next = lines[i + 1];
98
- if (typeof next !== 'number') {
99
- break;
100
- }
101
- if (next <= current[1]) {
102
- current[1] = next + linecontext;
103
- } else {
104
- out.push(current);
105
- current = makeContextRange(next, linecontext);
106
- }
107
-
108
- i++;
109
- }
110
-
111
- return out;
112
- }
113
-
114
- /**
115
- * Extracts lines from a file and stores them in a cache.
116
- */
117
- function getContextLinesFromFile(path, ranges, output) {
118
- return new Promise((resolve, _reject) => {
119
- // It is important *not* to have any async code between createInterface and the 'line' event listener
120
- // as it will cause the 'line' event to
121
- // be emitted before the listener is attached.
122
- const stream = createReadStream(path);
123
- const lineReaded = createInterface({
124
- input: stream,
125
- });
126
-
127
- // We need to explicitly destroy the stream to prevent memory leaks,
128
- // removing the listeners on the readline interface is not enough.
129
- // See: https://github.com/nodejs/node/issues/9002 and https://github.com/getsentry/sentry-javascript/issues/14892
130
- function destroyStreamAndResolve() {
131
- stream.destroy();
132
- resolve();
133
- }
134
-
135
- // Init at zero and increment at the start of the loop because lines are 1 indexed.
136
- let lineNumber = 0;
137
- let currentRangeIndex = 0;
138
- const range = ranges[currentRangeIndex];
139
- if (range === undefined) {
140
- // We should never reach this point, but if we do, we should resolve the promise to prevent it from hanging.
141
- destroyStreamAndResolve();
142
- return;
143
- }
144
- let rangeStart = range[0];
145
- let rangeEnd = range[1];
146
-
147
- // We use this inside Promise.all, so we need to resolve the promise even if there is an error
148
- // to prevent Promise.all from short circuiting the rest.
149
- function onStreamError(e) {
150
- // Mark file path as failed to read and prevent multiple read attempts.
151
- LRU_FILE_CONTENTS_FS_READ_FAILED.set(path, 1);
152
- DEBUG_BUILD && logger.error(`Failed to read file: ${path}. Error: ${e}`);
153
- lineReaded.close();
154
- lineReaded.removeAllListeners();
155
- destroyStreamAndResolve();
156
- }
157
-
158
- // We need to handle the error event to prevent the process from crashing in < Node 16
159
- // https://github.com/nodejs/node/pull/31603
160
- stream.on('error', onStreamError);
161
- lineReaded.on('error', onStreamError);
162
- lineReaded.on('close', destroyStreamAndResolve);
163
-
164
- lineReaded.on('line', line => {
165
- lineNumber++;
166
- if (lineNumber < rangeStart) return;
167
-
168
- // !Warning: This mutates the cache by storing the snipped line into the cache.
169
- output[lineNumber] = snipLine(line, 0);
170
-
171
- if (lineNumber >= rangeEnd) {
172
- if (currentRangeIndex === ranges.length - 1) {
173
- // We need to close the file stream and remove listeners, else the reader will continue to run our listener;
174
- lineReaded.close();
175
- lineReaded.removeAllListeners();
176
- return;
177
- }
178
- currentRangeIndex++;
179
- const range = ranges[currentRangeIndex];
180
- if (range === undefined) {
181
- // This should never happen as it means we have a bug in the context.
182
- lineReaded.close();
183
- lineReaded.removeAllListeners();
184
- return;
185
- }
186
- rangeStart = range[0];
187
- rangeEnd = range[1];
188
- }
189
- });
190
- });
191
- }
192
-
193
- /**
194
- * Adds surrounding (context) lines of the line that an exception occurred on to the event.
195
- * This is done by reading the file line by line and extracting the lines. The extracted lines are stored in
196
- * a cache to prevent multiple reads of the same file. Failures to read a file are similarly cached to prevent multiple
197
- * failing reads from happening.
198
- */
199
- /* eslint-disable complexity */
200
- async function addSourceContext(event, contextLines) {
201
- // keep a lookup map of which files we've already enqueued to read,
202
- // so we don't enqueue the same file multiple times which would cause multiple i/o reads
203
- const filesToLines = {};
204
-
205
- if (contextLines > 0 && event.exception?.values) {
206
- for (const exception of event.exception.values) {
207
- if (!exception.stacktrace?.frames?.length) {
208
- continue;
209
- }
210
-
211
- // Maps preserve insertion order, so we iterate in reverse, starting at the
212
- // outermost frame and closer to where the exception has occurred (poor mans priority)
213
- for (let i = exception.stacktrace.frames.length - 1; i >= 0; i--) {
214
- const frame = exception.stacktrace.frames[i];
215
- const filename = frame?.filename;
216
-
217
- if (
218
- !frame ||
219
- typeof filename !== 'string' ||
220
- typeof frame.lineno !== 'number' ||
221
- shouldSkipContextLinesForFile(filename) ||
222
- shouldSkipContextLinesForFrame(frame)
223
- ) {
224
- continue;
225
- }
226
-
227
- const filesToLinesOutput = filesToLines[filename];
228
- if (!filesToLinesOutput) filesToLines[filename] = [];
229
- // @ts-expect-error this is defined above
230
- filesToLines[filename].push(frame.lineno);
231
- }
232
- }
233
- }
234
-
235
- const files = Object.keys(filesToLines);
236
- if (files.length == 0) {
237
- return event;
238
- }
239
-
240
- const readlinePromises = [];
241
- for (const file of files) {
242
- // If we failed to read this before, dont try reading it again.
243
- if (LRU_FILE_CONTENTS_FS_READ_FAILED.get(file)) {
244
- continue;
245
- }
246
-
247
- const filesToLineRanges = filesToLines[file];
248
- if (!filesToLineRanges) {
249
- continue;
250
- }
251
-
252
- // Sort ranges so that they are sorted by line increasing order and match how the file is read.
253
- filesToLineRanges.sort((a, b) => a - b);
254
- // Check if the contents are already in the cache and if we can avoid reading the file again.
255
- const ranges = makeLineReaderRanges(filesToLineRanges, contextLines);
256
- if (ranges.every(r => rangeExistsInContentCache(file, r))) {
257
- continue;
258
- }
259
-
260
- const cache = emplace(LRU_FILE_CONTENTS_CACHE, file, {});
261
- readlinePromises.push(getContextLinesFromFile(file, ranges, cache));
262
- }
263
-
264
- // The promise rejections are caught in order to prevent them from short circuiting Promise.all
265
- await Promise.all(readlinePromises).catch(() => {
266
- DEBUG_BUILD && logger.log('Failed to read one or more source files and resolve context lines');
267
- });
268
-
269
- // Perform the same loop as above, but this time we can assume all files are in the cache
270
- // and attempt to add source context to frames.
271
- if (contextLines > 0 && event.exception?.values) {
272
- for (const exception of event.exception.values) {
273
- if (exception.stacktrace?.frames && exception.stacktrace.frames.length > 0) {
274
- addSourceContextToFrames(exception.stacktrace.frames, contextLines, LRU_FILE_CONTENTS_CACHE);
275
- }
276
- }
277
- }
278
-
279
- return event;
280
- }
281
- /* eslint-enable complexity */
282
-
283
- /** Adds context lines to frames */
284
- function addSourceContextToFrames(
285
- frames,
286
- contextLines,
287
- cache,
288
- ) {
289
- for (const frame of frames) {
290
- // Only add context if we have a filename and it hasn't already been added
291
- if (frame.filename && frame.context_line === undefined && typeof frame.lineno === 'number') {
292
- const contents = cache.get(frame.filename);
293
- if (contents === undefined) {
294
- continue;
295
- }
296
-
297
- addContextToFrame(frame.lineno, frame, contextLines, contents);
298
- }
299
- }
300
- }
301
-
302
- /**
303
- * Clears the context lines from a frame, used to reset a frame to its original state
304
- * if we fail to resolve all context lines for it.
305
- */
306
- function clearLineContext(frame) {
307
- delete frame.pre_context;
308
- delete frame.context_line;
309
- delete frame.post_context;
310
- }
311
-
312
- /**
313
- * Resolves context lines before and after the given line number and appends them to the frame;
314
- */
315
- function addContextToFrame(
316
- lineno,
317
- frame,
318
- contextLines,
319
- contents,
320
- ) {
321
- // When there is no line number in the frame, attaching context is nonsensical and will even break grouping.
322
- // We already check for lineno before calling this, but since StackFrame lineno ism optional, we check it again.
323
- if (frame.lineno === undefined || contents === undefined) {
324
- DEBUG_BUILD && logger.error('Cannot resolve context for frame with no lineno or file contents');
325
- return;
326
- }
327
-
328
- frame.pre_context = [];
329
- for (let i = makeRangeStart(lineno, contextLines); i < lineno; i++) {
330
- // We always expect the start context as line numbers cannot be negative. If we dont find a line, then
331
- // something went wrong somewhere. Clear the context and return without adding any linecontext.
332
- const line = contents[i];
333
- if (line === undefined) {
334
- clearLineContext(frame);
335
- DEBUG_BUILD && logger.error(`Could not find line ${i} in file ${frame.filename}`);
336
- return;
337
- }
338
-
339
- frame.pre_context.push(line);
340
- }
341
-
342
- // We should always have the context line. If we dont, something went wrong, so we clear the context and return
343
- // without adding any linecontext.
344
- if (contents[lineno] === undefined) {
345
- clearLineContext(frame);
346
- DEBUG_BUILD && logger.error(`Could not find line ${lineno} in file ${frame.filename}`);
347
- return;
348
- }
349
-
350
- frame.context_line = contents[lineno];
351
-
352
- const end = makeRangeEnd(lineno, contextLines);
353
- frame.post_context = [];
354
- for (let i = lineno + 1; i <= end; i++) {
355
- // Since we dont track when the file ends, we cant clear the context if we dont find a line as it could
356
- // just be that we reached the end of the file.
357
- const line = contents[i];
358
- if (line === undefined) {
359
- break;
360
- }
361
- frame.post_context.push(line);
362
- }
363
- }
364
-
365
- // Helper functions for generating line context ranges. They take a line number and the number of lines of context to
366
- // include before and after the line and generate an inclusive range of indices.
367
-
368
- // Compute inclusive end context range
369
- function makeRangeStart(line, linecontext) {
370
- return Math.max(1, line - linecontext);
371
- }
372
- // Compute inclusive start context range
373
- function makeRangeEnd(line, linecontext) {
374
- return line + linecontext;
375
- }
376
- // Determine start and end indices for context range (inclusive);
377
- function makeContextRange(line, linecontext) {
378
- return [makeRangeStart(line, linecontext), makeRangeEnd(line, linecontext)];
379
- }
380
-
381
- /** Exported only for tests, as a type-safe variant. */
382
- const _contextLinesIntegration = ((options = {}) => {
383
- const contextLines = options.frameContextLines !== undefined ? options.frameContextLines : DEFAULT_LINES_OF_CONTEXT;
384
-
385
- return {
386
- name: INTEGRATION_NAME,
387
- processEvent(event) {
388
- return addSourceContext(event, contextLines);
389
- },
390
- };
391
- }) ;
392
-
393
- /**
394
- * Capture the lines before and after the frame's context.
395
- */
396
- const contextLinesIntegration = defineIntegration(_contextLinesIntegration);
397
-
398
- export { MAX_CONTEXTLINES_COLNO, MAX_CONTEXTLINES_LINENO, _contextLinesIntegration, addContextToFrame, contextLinesIntegration };
399
- //# sourceMappingURL=contextlines.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contextlines.js","sources":["../../../src/integrations/contextlines.ts"],"sourcesContent":["import { createReadStream } from 'node:fs';\nimport { createInterface } from 'node:readline';\nimport type { Event, IntegrationFn, StackFrame } from '@sentry/core';\nimport { defineIntegration, logger, LRUMap, snipLine } from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\n\nconst LRU_FILE_CONTENTS_CACHE = new LRUMap<string, Record<number, string>>(10);\nconst LRU_FILE_CONTENTS_FS_READ_FAILED = new LRUMap<string, 1>(20);\nconst DEFAULT_LINES_OF_CONTEXT = 7;\nconst INTEGRATION_NAME = 'ContextLines';\n// Determines the upper bound of lineno/colno that we will attempt to read. Large colno values are likely to be\n// minified code while large lineno values are likely to be bundled code.\n// Exported for testing purposes.\nexport const MAX_CONTEXTLINES_COLNO: number = 1000;\nexport const MAX_CONTEXTLINES_LINENO: number = 10000;\n\ninterface ContextLinesOptions {\n /**\n * Sets the number of context lines for each frame when loading a file.\n * Defaults to 7.\n *\n * Set to 0 to disable loading and inclusion of source files.\n **/\n frameContextLines?: number;\n}\n\n/**\n * Exported for testing purposes.\n */\nexport function resetFileContentCache(): void {\n LRU_FILE_CONTENTS_CACHE.clear();\n}\n\n/**\n * Get or init map value\n */\nfunction emplace<T extends LRUMap<K, V>, K extends string, V>(map: T, key: K, contents: V): V {\n const value = map.get(key);\n\n if (value === undefined) {\n map.set(key, contents);\n return contents;\n }\n\n return value;\n}\n\n/**\n * Determines if context lines should be skipped for a file.\n * - .min.(mjs|cjs|js) files are and not useful since they dont point to the original source\n * - node: prefixed modules are part of the runtime and cannot be resolved to a file\n * - data: skip json, wasm and inline js https://nodejs.org/api/esm.html#data-imports\n */\nfunction shouldSkipContextLinesForFile(path: string): boolean {\n // Test the most common prefix and extension first. These are the ones we\n // are most likely to see in user applications and are the ones we can break out of first.\n if (path.startsWith('node:')) return true;\n if (path.endsWith('.min.js')) return true;\n if (path.endsWith('.min.cjs')) return true;\n if (path.endsWith('.min.mjs')) return true;\n if (path.startsWith('data:')) return true;\n return false;\n}\n\n/**\n * Determines if we should skip contextlines based off the max lineno and colno values.\n */\nfunction shouldSkipContextLinesForFrame(frame: StackFrame): boolean {\n if (frame.lineno !== undefined && frame.lineno > MAX_CONTEXTLINES_LINENO) return true;\n if (frame.colno !== undefined && frame.colno > MAX_CONTEXTLINES_COLNO) return true;\n return false;\n}\n/**\n * Checks if we have all the contents that we need in the cache.\n */\nfunction rangeExistsInContentCache(file: string, range: ReadlineRange): boolean {\n const contents = LRU_FILE_CONTENTS_CACHE.get(file);\n if (contents === undefined) return false;\n\n for (let i = range[0]; i <= range[1]; i++) {\n if (contents[i] === undefined) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Creates contiguous ranges of lines to read from a file. In the case where context lines overlap,\n * the ranges are merged to create a single range.\n */\nfunction makeLineReaderRanges(lines: number[], linecontext: number): ReadlineRange[] {\n if (!lines.length) {\n return [];\n }\n\n let i = 0;\n const line = lines[0];\n\n if (typeof line !== 'number') {\n return [];\n }\n\n let current = makeContextRange(line, linecontext);\n const out: ReadlineRange[] = [];\n // eslint-disable-next-line no-constant-condition\n while (true) {\n if (i === lines.length - 1) {\n out.push(current);\n break;\n }\n\n // If the next line falls into the current range, extend the current range to lineno + linecontext.\n const next = lines[i + 1];\n if (typeof next !== 'number') {\n break;\n }\n if (next <= current[1]) {\n current[1] = next + linecontext;\n } else {\n out.push(current);\n current = makeContextRange(next, linecontext);\n }\n\n i++;\n }\n\n return out;\n}\n\n/**\n * Extracts lines from a file and stores them in a cache.\n */\nfunction getContextLinesFromFile(path: string, ranges: ReadlineRange[], output: Record<number, string>): Promise<void> {\n return new Promise((resolve, _reject) => {\n // It is important *not* to have any async code between createInterface and the 'line' event listener\n // as it will cause the 'line' event to\n // be emitted before the listener is attached.\n const stream = createReadStream(path);\n const lineReaded = createInterface({\n input: stream,\n });\n\n // We need to explicitly destroy the stream to prevent memory leaks,\n // removing the listeners on the readline interface is not enough.\n // See: https://github.com/nodejs/node/issues/9002 and https://github.com/getsentry/sentry-javascript/issues/14892\n function destroyStreamAndResolve(): void {\n stream.destroy();\n resolve();\n }\n\n // Init at zero and increment at the start of the loop because lines are 1 indexed.\n let lineNumber = 0;\n let currentRangeIndex = 0;\n const range = ranges[currentRangeIndex];\n if (range === undefined) {\n // We should never reach this point, but if we do, we should resolve the promise to prevent it from hanging.\n destroyStreamAndResolve();\n return;\n }\n let rangeStart = range[0];\n let rangeEnd = range[1];\n\n // We use this inside Promise.all, so we need to resolve the promise even if there is an error\n // to prevent Promise.all from short circuiting the rest.\n function onStreamError(e: Error): void {\n // Mark file path as failed to read and prevent multiple read attempts.\n LRU_FILE_CONTENTS_FS_READ_FAILED.set(path, 1);\n DEBUG_BUILD && logger.error(`Failed to read file: ${path}. Error: ${e}`);\n lineReaded.close();\n lineReaded.removeAllListeners();\n destroyStreamAndResolve();\n }\n\n // We need to handle the error event to prevent the process from crashing in < Node 16\n // https://github.com/nodejs/node/pull/31603\n stream.on('error', onStreamError);\n lineReaded.on('error', onStreamError);\n lineReaded.on('close', destroyStreamAndResolve);\n\n lineReaded.on('line', line => {\n lineNumber++;\n if (lineNumber < rangeStart) return;\n\n // !Warning: This mutates the cache by storing the snipped line into the cache.\n output[lineNumber] = snipLine(line, 0);\n\n if (lineNumber >= rangeEnd) {\n if (currentRangeIndex === ranges.length - 1) {\n // We need to close the file stream and remove listeners, else the reader will continue to run our listener;\n lineReaded.close();\n lineReaded.removeAllListeners();\n return;\n }\n currentRangeIndex++;\n const range = ranges[currentRangeIndex];\n if (range === undefined) {\n // This should never happen as it means we have a bug in the context.\n lineReaded.close();\n lineReaded.removeAllListeners();\n return;\n }\n rangeStart = range[0];\n rangeEnd = range[1];\n }\n });\n });\n}\n\n/**\n * Adds surrounding (context) lines of the line that an exception occurred on to the event.\n * This is done by reading the file line by line and extracting the lines. The extracted lines are stored in\n * a cache to prevent multiple reads of the same file. Failures to read a file are similarly cached to prevent multiple\n * failing reads from happening.\n */\n/* eslint-disable complexity */\nasync function addSourceContext(event: Event, contextLines: number): Promise<Event> {\n // keep a lookup map of which files we've already enqueued to read,\n // so we don't enqueue the same file multiple times which would cause multiple i/o reads\n const filesToLines: Record<string, number[]> = {};\n\n if (contextLines > 0 && event.exception?.values) {\n for (const exception of event.exception.values) {\n if (!exception.stacktrace?.frames?.length) {\n continue;\n }\n\n // Maps preserve insertion order, so we iterate in reverse, starting at the\n // outermost frame and closer to where the exception has occurred (poor mans priority)\n for (let i = exception.stacktrace.frames.length - 1; i >= 0; i--) {\n const frame: StackFrame | undefined = exception.stacktrace.frames[i];\n const filename = frame?.filename;\n\n if (\n !frame ||\n typeof filename !== 'string' ||\n typeof frame.lineno !== 'number' ||\n shouldSkipContextLinesForFile(filename) ||\n shouldSkipContextLinesForFrame(frame)\n ) {\n continue;\n }\n\n const filesToLinesOutput = filesToLines[filename];\n if (!filesToLinesOutput) filesToLines[filename] = [];\n // @ts-expect-error this is defined above\n filesToLines[filename].push(frame.lineno);\n }\n }\n }\n\n const files = Object.keys(filesToLines);\n if (files.length == 0) {\n return event;\n }\n\n const readlinePromises: Promise<void>[] = [];\n for (const file of files) {\n // If we failed to read this before, dont try reading it again.\n if (LRU_FILE_CONTENTS_FS_READ_FAILED.get(file)) {\n continue;\n }\n\n const filesToLineRanges = filesToLines[file];\n if (!filesToLineRanges) {\n continue;\n }\n\n // Sort ranges so that they are sorted by line increasing order and match how the file is read.\n filesToLineRanges.sort((a, b) => a - b);\n // Check if the contents are already in the cache and if we can avoid reading the file again.\n const ranges = makeLineReaderRanges(filesToLineRanges, contextLines);\n if (ranges.every(r => rangeExistsInContentCache(file, r))) {\n continue;\n }\n\n const cache = emplace(LRU_FILE_CONTENTS_CACHE, file, {});\n readlinePromises.push(getContextLinesFromFile(file, ranges, cache));\n }\n\n // The promise rejections are caught in order to prevent them from short circuiting Promise.all\n await Promise.all(readlinePromises).catch(() => {\n DEBUG_BUILD && logger.log('Failed to read one or more source files and resolve context lines');\n });\n\n // Perform the same loop as above, but this time we can assume all files are in the cache\n // and attempt to add source context to frames.\n if (contextLines > 0 && event.exception?.values) {\n for (const exception of event.exception.values) {\n if (exception.stacktrace?.frames && exception.stacktrace.frames.length > 0) {\n addSourceContextToFrames(exception.stacktrace.frames, contextLines, LRU_FILE_CONTENTS_CACHE);\n }\n }\n }\n\n return event;\n}\n/* eslint-enable complexity */\n\n/** Adds context lines to frames */\nfunction addSourceContextToFrames(\n frames: StackFrame[],\n contextLines: number,\n cache: LRUMap<string, Record<number, string>>,\n): void {\n for (const frame of frames) {\n // Only add context if we have a filename and it hasn't already been added\n if (frame.filename && frame.context_line === undefined && typeof frame.lineno === 'number') {\n const contents = cache.get(frame.filename);\n if (contents === undefined) {\n continue;\n }\n\n addContextToFrame(frame.lineno, frame, contextLines, contents);\n }\n }\n}\n\n/**\n * Clears the context lines from a frame, used to reset a frame to its original state\n * if we fail to resolve all context lines for it.\n */\nfunction clearLineContext(frame: StackFrame): void {\n delete frame.pre_context;\n delete frame.context_line;\n delete frame.post_context;\n}\n\n/**\n * Resolves context lines before and after the given line number and appends them to the frame;\n */\nexport function addContextToFrame(\n lineno: number,\n frame: StackFrame,\n contextLines: number,\n contents: Record<number, string> | undefined,\n): void {\n // When there is no line number in the frame, attaching context is nonsensical and will even break grouping.\n // We already check for lineno before calling this, but since StackFrame lineno ism optional, we check it again.\n if (frame.lineno === undefined || contents === undefined) {\n DEBUG_BUILD && logger.error('Cannot resolve context for frame with no lineno or file contents');\n return;\n }\n\n frame.pre_context = [];\n for (let i = makeRangeStart(lineno, contextLines); i < lineno; i++) {\n // We always expect the start context as line numbers cannot be negative. If we dont find a line, then\n // something went wrong somewhere. Clear the context and return without adding any linecontext.\n const line = contents[i];\n if (line === undefined) {\n clearLineContext(frame);\n DEBUG_BUILD && logger.error(`Could not find line ${i} in file ${frame.filename}`);\n return;\n }\n\n frame.pre_context.push(line);\n }\n\n // We should always have the context line. If we dont, something went wrong, so we clear the context and return\n // without adding any linecontext.\n if (contents[lineno] === undefined) {\n clearLineContext(frame);\n DEBUG_BUILD && logger.error(`Could not find line ${lineno} in file ${frame.filename}`);\n return;\n }\n\n frame.context_line = contents[lineno];\n\n const end = makeRangeEnd(lineno, contextLines);\n frame.post_context = [];\n for (let i = lineno + 1; i <= end; i++) {\n // Since we dont track when the file ends, we cant clear the context if we dont find a line as it could\n // just be that we reached the end of the file.\n const line = contents[i];\n if (line === undefined) {\n break;\n }\n frame.post_context.push(line);\n }\n}\n\n// Helper functions for generating line context ranges. They take a line number and the number of lines of context to\n// include before and after the line and generate an inclusive range of indices.\ntype ReadlineRange = [start: number, end: number];\n// Compute inclusive end context range\nfunction makeRangeStart(line: number, linecontext: number): number {\n return Math.max(1, line - linecontext);\n}\n// Compute inclusive start context range\nfunction makeRangeEnd(line: number, linecontext: number): number {\n return line + linecontext;\n}\n// Determine start and end indices for context range (inclusive);\nfunction makeContextRange(line: number, linecontext: number): [start: number, end: number] {\n return [makeRangeStart(line, linecontext), makeRangeEnd(line, linecontext)];\n}\n\n/** Exported only for tests, as a type-safe variant. */\nexport const _contextLinesIntegration = ((options: ContextLinesOptions = {}) => {\n const contextLines = options.frameContextLines !== undefined ? options.frameContextLines : DEFAULT_LINES_OF_CONTEXT;\n\n return {\n name: INTEGRATION_NAME,\n processEvent(event) {\n return addSourceContext(event, contextLines);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Capture the lines before and after the frame's context.\n */\nexport const contextLinesIntegration = defineIntegration(_contextLinesIntegration);\n"],"names":[],"mappings":";;;;;AAMA,MAAM,0BAA0B,IAAI,MAAM,CAAiC,EAAE,CAAC;AAC9E,MAAM,mCAAmC,IAAI,MAAM,CAAY,EAAE,CAAC;AAClE,MAAM,wBAAA,GAA2B,CAAC;AAClC,MAAM,gBAAA,GAAmB,cAAc;AACvC;AACA;AACA;AACa,MAAA,sBAAsB,GAAW;AACjC,MAAA,uBAAuB,GAAW;;AAmB/C;AACA;AACA;AACA,SAAS,OAAO,CAA8C,GAAG,EAAK,GAAG,EAAK,QAAQ,EAAQ;AAC9F,EAAE,MAAM,QAAQ,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC;;AAE5B,EAAE,IAAI,KAAM,KAAI,SAAS,EAAE;AAC3B,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC;AAC1B,IAAI,OAAO,QAAQ;AACnB;;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