@sentry/node 7.104.0 → 8.0.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 (426) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +114 -38
  3. package/cjs/cron/index.js +15 -0
  4. package/cjs/cron/index.js.map +1 -0
  5. package/cjs/index.js +79 -98
  6. package/cjs/index.js.map +1 -1
  7. package/cjs/integrations/anr/index.js +4 -30
  8. package/cjs/integrations/anr/index.js.map +1 -1
  9. package/cjs/integrations/anr/worker-script.js +2 -2
  10. package/cjs/integrations/console.js +2 -13
  11. package/cjs/integrations/console.js.map +1 -1
  12. package/cjs/integrations/context.js +2 -16
  13. package/cjs/integrations/context.js.map +1 -1
  14. package/cjs/integrations/contextlines.js +6 -23
  15. package/cjs/integrations/contextlines.js.map +1 -1
  16. package/cjs/integrations/http.js +103 -354
  17. package/cjs/integrations/http.js.map +1 -1
  18. package/cjs/integrations/local-variables/index.js +0 -10
  19. package/cjs/integrations/local-variables/index.js.map +1 -1
  20. package/cjs/integrations/local-variables/local-variables-sync.js +29 -24
  21. package/cjs/integrations/local-variables/local-variables-sync.js.map +1 -1
  22. package/cjs/integrations/modules.js +19 -30
  23. package/cjs/integrations/modules.js.map +1 -1
  24. package/cjs/integrations/node-fetch.js +82 -0
  25. package/cjs/integrations/node-fetch.js.map +1 -0
  26. package/cjs/integrations/onuncaughtexception.js +15 -30
  27. package/cjs/integrations/onuncaughtexception.js.map +1 -1
  28. package/cjs/integrations/onunhandledrejection.js +3 -17
  29. package/cjs/integrations/onunhandledrejection.js.map +1 -1
  30. package/cjs/integrations/spotlight.js +4 -22
  31. package/cjs/integrations/spotlight.js.map +1 -1
  32. package/cjs/integrations/tracing/express.js +103 -0
  33. package/cjs/integrations/tracing/express.js.map +1 -0
  34. package/cjs/integrations/tracing/fastify.js +33 -0
  35. package/cjs/integrations/tracing/fastify.js.map +1 -0
  36. package/cjs/integrations/tracing/graphql.js +34 -0
  37. package/cjs/integrations/tracing/graphql.js.map +1 -0
  38. package/cjs/integrations/tracing/hapi/index.js +81 -0
  39. package/cjs/integrations/tracing/hapi/index.js.map +1 -0
  40. package/cjs/integrations/tracing/index.js +37 -0
  41. package/cjs/integrations/tracing/index.js.map +1 -0
  42. package/cjs/integrations/tracing/koa.js +21 -0
  43. package/cjs/integrations/tracing/koa.js.map +1 -0
  44. package/cjs/integrations/tracing/mongo.js +33 -0
  45. package/cjs/integrations/tracing/mongo.js.map +1 -0
  46. package/cjs/integrations/tracing/mongoose.js +33 -0
  47. package/cjs/integrations/tracing/mongoose.js.map +1 -0
  48. package/cjs/integrations/tracing/mysql.js +26 -0
  49. package/cjs/integrations/tracing/mysql.js.map +1 -0
  50. package/cjs/integrations/tracing/mysql2.js +33 -0
  51. package/cjs/integrations/tracing/mysql2.js.map +1 -0
  52. package/cjs/integrations/tracing/nest.js +26 -0
  53. package/cjs/integrations/tracing/nest.js.map +1 -0
  54. package/cjs/integrations/tracing/postgres.js +34 -0
  55. package/cjs/integrations/tracing/postgres.js.map +1 -0
  56. package/cjs/integrations/tracing/prisma.js +33 -0
  57. package/cjs/integrations/tracing/prisma.js.map +1 -0
  58. package/cjs/nodeVersion.js +5 -1
  59. package/cjs/nodeVersion.js.map +1 -1
  60. package/cjs/otel/contextManager.js +16 -0
  61. package/cjs/otel/contextManager.js.map +1 -0
  62. package/cjs/proxy/index.js +1 -2
  63. package/cjs/proxy/index.js.map +1 -1
  64. package/cjs/sdk/api.js +74 -0
  65. package/cjs/sdk/api.js.map +1 -0
  66. package/cjs/sdk/client.js +57 -0
  67. package/cjs/sdk/client.js.map +1 -0
  68. package/cjs/sdk/hub.js +104 -0
  69. package/cjs/sdk/hub.js.map +1 -0
  70. package/cjs/sdk/init.js +224 -0
  71. package/cjs/sdk/init.js.map +1 -0
  72. package/cjs/sdk/initOtel.js +70 -0
  73. package/cjs/sdk/initOtel.js.map +1 -0
  74. package/cjs/sdk/scope.js +18 -0
  75. package/cjs/sdk/scope.js.map +1 -0
  76. package/cjs/transports/http.js +2 -3
  77. package/cjs/transports/http.js.map +1 -1
  78. package/cjs/utils/addOriginToSpan.js +11 -0
  79. package/cjs/utils/addOriginToSpan.js.map +1 -0
  80. package/cjs/{integrations/utils → utils}/errorhandling.js +2 -1
  81. package/cjs/utils/errorhandling.js.map +1 -0
  82. package/cjs/utils/getRequestUrl.js +18 -0
  83. package/cjs/utils/getRequestUrl.js.map +1 -0
  84. package/cjs/utils/module.js.map +1 -0
  85. package/esm/cron/index.js +13 -0
  86. package/esm/cron/index.js.map +1 -0
  87. package/esm/index.js +28 -48
  88. package/esm/index.js.map +1 -1
  89. package/esm/integrations/anr/index.js +7 -32
  90. package/esm/integrations/anr/index.js.map +1 -1
  91. package/esm/integrations/anr/worker-script.js +2 -2
  92. package/esm/integrations/console.js +4 -14
  93. package/esm/integrations/console.js.map +1 -1
  94. package/esm/integrations/context.js +4 -17
  95. package/esm/integrations/context.js.map +1 -1
  96. package/esm/integrations/contextlines.js +8 -25
  97. package/esm/integrations/contextlines.js.map +1 -1
  98. package/esm/integrations/http.js +105 -353
  99. package/esm/integrations/http.js.map +1 -1
  100. package/esm/integrations/local-variables/index.js +2 -11
  101. package/esm/integrations/local-variables/index.js.map +1 -1
  102. package/esm/integrations/local-variables/local-variables-sync.js +31 -25
  103. package/esm/integrations/local-variables/local-variables-sync.js.map +1 -1
  104. package/esm/integrations/modules.js +21 -31
  105. package/esm/integrations/modules.js.map +1 -1
  106. package/esm/integrations/node-fetch.js +80 -0
  107. package/esm/integrations/node-fetch.js.map +1 -0
  108. package/esm/integrations/onuncaughtexception.js +17 -31
  109. package/esm/integrations/onuncaughtexception.js.map +1 -1
  110. package/esm/integrations/onunhandledrejection.js +5 -18
  111. package/esm/integrations/onunhandledrejection.js.map +1 -1
  112. package/esm/integrations/spotlight.js +3 -20
  113. package/esm/integrations/spotlight.js.map +1 -1
  114. package/esm/integrations/tracing/express.js +96 -0
  115. package/esm/integrations/tracing/express.js.map +1 -0
  116. package/esm/integrations/tracing/fastify.js +31 -0
  117. package/esm/integrations/tracing/fastify.js.map +1 -0
  118. package/esm/integrations/tracing/graphql.js +32 -0
  119. package/esm/integrations/tracing/graphql.js.map +1 -0
  120. package/esm/integrations/tracing/hapi/index.js +77 -0
  121. package/esm/integrations/tracing/hapi/index.js.map +1 -0
  122. package/esm/integrations/tracing/index.js +35 -0
  123. package/esm/integrations/tracing/index.js.map +1 -0
  124. package/esm/integrations/tracing/koa.js +19 -0
  125. package/esm/integrations/tracing/koa.js.map +1 -0
  126. package/esm/integrations/tracing/mongo.js +31 -0
  127. package/esm/integrations/tracing/mongo.js.map +1 -0
  128. package/esm/integrations/tracing/mongoose.js +31 -0
  129. package/esm/integrations/tracing/mongoose.js.map +1 -0
  130. package/esm/integrations/tracing/mysql.js +24 -0
  131. package/esm/integrations/tracing/mysql.js.map +1 -0
  132. package/esm/integrations/tracing/mysql2.js +31 -0
  133. package/esm/integrations/tracing/mysql2.js.map +1 -0
  134. package/esm/integrations/tracing/nest.js +24 -0
  135. package/esm/integrations/tracing/nest.js.map +1 -0
  136. package/esm/integrations/tracing/postgres.js +32 -0
  137. package/esm/integrations/tracing/postgres.js.map +1 -0
  138. package/esm/integrations/tracing/prisma.js +31 -0
  139. package/esm/integrations/tracing/prisma.js.map +1 -0
  140. package/esm/nodeVersion.js +5 -2
  141. package/esm/nodeVersion.js.map +1 -1
  142. package/esm/otel/contextManager.js +14 -0
  143. package/esm/otel/contextManager.js.map +1 -0
  144. package/esm/proxy/index.js +0 -1
  145. package/esm/proxy/index.js.map +1 -1
  146. package/esm/sdk/api.js +69 -0
  147. package/esm/sdk/api.js.map +1 -0
  148. package/esm/sdk/client.js +52 -0
  149. package/esm/sdk/client.js.map +1 -0
  150. package/esm/sdk/hub.js +102 -0
  151. package/esm/sdk/hub.js.map +1 -0
  152. package/esm/sdk/init.js +221 -0
  153. package/esm/sdk/init.js.map +1 -0
  154. package/esm/sdk/initOtel.js +67 -0
  155. package/esm/sdk/initOtel.js.map +1 -0
  156. package/esm/sdk/scope.js +16 -0
  157. package/esm/sdk/scope.js.map +1 -0
  158. package/esm/transports/http.js +0 -1
  159. package/esm/transports/http.js.map +1 -1
  160. package/esm/utils/addOriginToSpan.js +9 -0
  161. package/esm/utils/addOriginToSpan.js.map +1 -0
  162. package/esm/{integrations/utils → utils}/errorhandling.js +2 -1
  163. package/esm/utils/errorhandling.js.map +1 -0
  164. package/esm/utils/getRequestUrl.js +16 -0
  165. package/esm/utils/getRequestUrl.js.map +1 -0
  166. package/esm/utils/module.js.map +1 -0
  167. package/package.json +31 -23
  168. package/types/cron/index.d.ts +10 -0
  169. package/types/cron/index.d.ts.map +1 -0
  170. package/types/index.d.ts +30 -142
  171. package/types/index.d.ts.map +1 -1
  172. package/types/integrations/anr/index.d.ts +0 -15
  173. package/types/integrations/anr/index.d.ts.map +1 -1
  174. package/types/integrations/console.d.ts +2 -8
  175. package/types/integrations/console.d.ts.map +1 -1
  176. package/types/integrations/context.d.ts +3 -18
  177. package/types/integrations/context.d.ts.map +1 -1
  178. package/types/integrations/contextlines.d.ts +8 -10
  179. package/types/integrations/contextlines.d.ts.map +1 -1
  180. package/types/integrations/http.d.ts +8 -89
  181. package/types/integrations/http.d.ts.map +1 -1
  182. package/types/integrations/local-variables/index.d.ts +0 -11
  183. package/types/integrations/local-variables/index.d.ts.map +1 -1
  184. package/types/integrations/local-variables/local-variables-async.d.ts +1 -1
  185. package/types/integrations/local-variables/local-variables-async.d.ts.map +1 -1
  186. package/types/integrations/local-variables/local-variables-sync.d.ts +1 -1
  187. package/types/integrations/local-variables/local-variables-sync.d.ts.map +1 -1
  188. package/types/integrations/modules.d.ts +1 -7
  189. package/types/integrations/modules.d.ts.map +1 -1
  190. package/types/integrations/node-fetch.d.ts +15 -0
  191. package/types/integrations/node-fetch.d.ts.map +1 -0
  192. package/types/integrations/onuncaughtexception.d.ts +3 -12
  193. package/types/integrations/onuncaughtexception.d.ts.map +1 -1
  194. package/types/integrations/onunhandledrejection.d.ts +3 -10
  195. package/types/integrations/onunhandledrejection.d.ts.map +1 -1
  196. package/types/integrations/spotlight.d.ts +1 -10
  197. package/types/integrations/spotlight.d.ts.map +1 -1
  198. package/types/integrations/tracing/express.d.ts +37 -0
  199. package/types/integrations/tracing/express.d.ts.map +1 -0
  200. package/types/integrations/tracing/fastify.d.ts +7 -0
  201. package/types/integrations/tracing/fastify.d.ts.map +1 -0
  202. package/types/integrations/tracing/graphql.d.ts +7 -0
  203. package/types/integrations/tracing/graphql.d.ts.map +1 -0
  204. package/types/integrations/tracing/hapi/index.d.ts +18 -0
  205. package/types/integrations/tracing/hapi/index.d.ts.map +1 -0
  206. package/types/integrations/{hapi → tracing/hapi}/types.d.ts +1 -2
  207. package/types/integrations/tracing/hapi/types.d.ts.map +1 -0
  208. package/types/integrations/tracing/index.d.ts +6 -0
  209. package/types/integrations/tracing/index.d.ts.map +1 -0
  210. package/types/integrations/tracing/koa.d.ts +2 -0
  211. package/types/integrations/tracing/koa.d.ts.map +1 -0
  212. package/types/integrations/tracing/mongo.d.ts +7 -0
  213. package/types/integrations/tracing/mongo.d.ts.map +1 -0
  214. package/types/integrations/tracing/mongoose.d.ts +7 -0
  215. package/types/integrations/tracing/mongoose.d.ts.map +1 -0
  216. package/types/integrations/tracing/mysql.d.ts +7 -0
  217. package/types/integrations/tracing/mysql.d.ts.map +1 -0
  218. package/types/integrations/tracing/mysql2.d.ts +7 -0
  219. package/types/integrations/tracing/mysql2.d.ts.map +1 -0
  220. package/types/integrations/tracing/nest.d.ts +7 -0
  221. package/types/integrations/tracing/nest.d.ts.map +1 -0
  222. package/types/integrations/tracing/postgres.d.ts +7 -0
  223. package/types/integrations/tracing/postgres.d.ts.map +1 -0
  224. package/types/integrations/tracing/prisma.d.ts +11 -0
  225. package/types/integrations/tracing/prisma.d.ts.map +1 -0
  226. package/types/nodeVersion.d.ts +3 -3
  227. package/types/nodeVersion.d.ts.map +1 -1
  228. package/types/otel/contextManager.d.ts +10 -0
  229. package/types/otel/contextManager.d.ts.map +1 -0
  230. package/types/proxy/helpers.d.ts +0 -1
  231. package/types/proxy/helpers.d.ts.map +1 -1
  232. package/types/proxy/index.d.ts +0 -1
  233. package/types/proxy/index.d.ts.map +1 -1
  234. package/types/sdk/api.d.ts +18 -0
  235. package/types/sdk/api.d.ts.map +1 -0
  236. package/types/sdk/client.d.ts +17 -0
  237. package/types/sdk/client.d.ts.map +1 -0
  238. package/types/sdk/globals.d.ts +6 -0
  239. package/types/sdk/globals.d.ts.map +1 -0
  240. package/types/sdk/hub.d.ts +7 -0
  241. package/types/sdk/hub.d.ts.map +1 -0
  242. package/types/sdk/init.d.ts +9 -0
  243. package/types/sdk/init.d.ts.map +1 -0
  244. package/types/sdk/initOtel.d.ts +9 -0
  245. package/types/sdk/initOtel.d.ts.map +1 -0
  246. package/types/sdk/scope.d.ts +7 -0
  247. package/types/sdk/scope.d.ts.map +1 -0
  248. package/types/transports/http-module.d.ts +2 -5
  249. package/types/transports/http-module.d.ts.map +1 -1
  250. package/types/transports/http.d.ts.map +1 -1
  251. package/types/types.d.ts +18 -25
  252. package/types/types.d.ts.map +1 -1
  253. package/types/utils/addOriginToSpan.d.ts +5 -0
  254. package/types/utils/addOriginToSpan.d.ts.map +1 -0
  255. package/types/utils/errorhandling.d.ts.map +1 -0
  256. package/types/utils/getRequestUrl.d.ts +5 -0
  257. package/types/utils/getRequestUrl.d.ts.map +1 -0
  258. package/types/utils/module.d.ts.map +1 -0
  259. package/types/utils/prepareEvent.d.ts +17 -0
  260. package/types/utils/prepareEvent.d.ts.map +1 -0
  261. package/types-ts3.8/cron/index.d.ts +10 -0
  262. package/types-ts3.8/index.d.ts +30 -142
  263. package/types-ts3.8/integrations/anr/index.d.ts +0 -15
  264. package/types-ts3.8/integrations/console.d.ts +2 -8
  265. package/types-ts3.8/integrations/context.d.ts +3 -18
  266. package/types-ts3.8/integrations/contextlines.d.ts +8 -10
  267. package/types-ts3.8/integrations/http.d.ts +8 -89
  268. package/types-ts3.8/integrations/local-variables/index.d.ts +0 -11
  269. package/types-ts3.8/integrations/local-variables/local-variables-async.d.ts +1 -1
  270. package/types-ts3.8/integrations/local-variables/local-variables-sync.d.ts +1 -1
  271. package/types-ts3.8/integrations/modules.d.ts +1 -7
  272. package/types-ts3.8/integrations/node-fetch.d.ts +15 -0
  273. package/types-ts3.8/integrations/onuncaughtexception.d.ts +3 -12
  274. package/types-ts3.8/integrations/onunhandledrejection.d.ts +3 -10
  275. package/types-ts3.8/integrations/spotlight.d.ts +1 -10
  276. package/types-ts3.8/integrations/tracing/express.d.ts +37 -0
  277. package/types-ts3.8/integrations/tracing/fastify.d.ts +7 -0
  278. package/types-ts3.8/integrations/tracing/graphql.d.ts +7 -0
  279. package/types-ts3.8/integrations/tracing/hapi/index.d.ts +18 -0
  280. package/types-ts3.8/integrations/{hapi → tracing/hapi}/types.d.ts +1 -2
  281. package/types-ts3.8/integrations/tracing/index.d.ts +6 -0
  282. package/types-ts3.8/integrations/tracing/koa.d.ts +2 -0
  283. package/types-ts3.8/integrations/tracing/mongo.d.ts +7 -0
  284. package/types-ts3.8/integrations/tracing/mongoose.d.ts +7 -0
  285. package/types-ts3.8/integrations/tracing/mysql.d.ts +7 -0
  286. package/types-ts3.8/integrations/tracing/mysql2.d.ts +7 -0
  287. package/types-ts3.8/integrations/tracing/nest.d.ts +7 -0
  288. package/types-ts3.8/integrations/tracing/postgres.d.ts +7 -0
  289. package/types-ts3.8/integrations/tracing/prisma.d.ts +11 -0
  290. package/types-ts3.8/nodeVersion.d.ts +3 -3
  291. package/types-ts3.8/otel/contextManager.d.ts +10 -0
  292. package/types-ts3.8/proxy/helpers.d.ts +0 -1
  293. package/types-ts3.8/proxy/index.d.ts +0 -1
  294. package/types-ts3.8/sdk/api.d.ts +18 -0
  295. package/types-ts3.8/sdk/client.d.ts +17 -0
  296. package/types-ts3.8/sdk/globals.d.ts +6 -0
  297. package/types-ts3.8/sdk/hub.d.ts +7 -0
  298. package/types-ts3.8/sdk/init.d.ts +9 -0
  299. package/types-ts3.8/sdk/initOtel.d.ts +9 -0
  300. package/types-ts3.8/sdk/scope.d.ts +7 -0
  301. package/types-ts3.8/transports/http-module.d.ts +2 -4
  302. package/types-ts3.8/types.d.ts +18 -25
  303. package/types-ts3.8/utils/addOriginToSpan.d.ts +5 -0
  304. package/types-ts3.8/utils/getRequestUrl.d.ts +5 -0
  305. package/types-ts3.8/utils/prepareEvent.d.ts +17 -0
  306. package/cjs/async/domain.js +0 -61
  307. package/cjs/async/domain.js.map +0 -1
  308. package/cjs/async/hooks.js +0 -50
  309. package/cjs/async/hooks.js.map +0 -1
  310. package/cjs/async/index.js +0 -22
  311. package/cjs/async/index.js.map +0 -1
  312. package/cjs/client.js +0 -39
  313. package/cjs/client.js.map +0 -1
  314. package/cjs/handlers.js +0 -340
  315. package/cjs/handlers.js.map +0 -1
  316. package/cjs/integrations/anr/legacy.js +0 -29
  317. package/cjs/integrations/anr/legacy.js.map +0 -1
  318. package/cjs/integrations/hapi/index.js +0 -161
  319. package/cjs/integrations/hapi/index.js.map +0 -1
  320. package/cjs/integrations/index.js +0 -32
  321. package/cjs/integrations/index.js.map +0 -1
  322. package/cjs/integrations/undici/index.js +0 -307
  323. package/cjs/integrations/undici/index.js.map +0 -1
  324. package/cjs/integrations/utils/errorhandling.js.map +0 -1
  325. package/cjs/integrations/utils/http.js +0 -225
  326. package/cjs/integrations/utils/http.js.map +0 -1
  327. package/cjs/module.js.map +0 -1
  328. package/cjs/requestDataDeprecated.js +0 -45
  329. package/cjs/requestDataDeprecated.js.map +0 -1
  330. package/cjs/sdk.js +0 -284
  331. package/cjs/sdk.js.map +0 -1
  332. package/cjs/tracing/index.js +0 -29
  333. package/cjs/tracing/index.js.map +0 -1
  334. package/cjs/tracing/integrations.js +0 -14
  335. package/cjs/tracing/integrations.js.map +0 -1
  336. package/cjs/utils.js +0 -45
  337. package/cjs/utils.js.map +0 -1
  338. package/esm/async/domain.js +0 -56
  339. package/esm/async/domain.js.map +0 -1
  340. package/esm/async/hooks.js +0 -45
  341. package/esm/async/hooks.js.map +0 -1
  342. package/esm/async/index.js +0 -20
  343. package/esm/async/index.js.map +0 -1
  344. package/esm/client.js +0 -37
  345. package/esm/client.js.map +0 -1
  346. package/esm/handlers.js +0 -330
  347. package/esm/handlers.js.map +0 -1
  348. package/esm/integrations/anr/legacy.js +0 -27
  349. package/esm/integrations/anr/legacy.js.map +0 -1
  350. package/esm/integrations/hapi/index.js +0 -156
  351. package/esm/integrations/hapi/index.js.map +0 -1
  352. package/esm/integrations/index.js +0 -16
  353. package/esm/integrations/index.js.map +0 -1
  354. package/esm/integrations/undici/index.js +0 -301
  355. package/esm/integrations/undici/index.js.map +0 -1
  356. package/esm/integrations/utils/errorhandling.js.map +0 -1
  357. package/esm/integrations/utils/http.js +0 -216
  358. package/esm/integrations/utils/http.js.map +0 -1
  359. package/esm/module.js.map +0 -1
  360. package/esm/requestDataDeprecated.js +0 -42
  361. package/esm/requestDataDeprecated.js.map +0 -1
  362. package/esm/sdk.js +0 -274
  363. package/esm/sdk.js.map +0 -1
  364. package/esm/tracing/index.js +0 -27
  365. package/esm/tracing/index.js.map +0 -1
  366. package/esm/tracing/integrations.js +0 -2
  367. package/esm/tracing/integrations.js.map +0 -1
  368. package/esm/utils.js +0 -43
  369. package/esm/utils.js.map +0 -1
  370. package/types/async/domain.d.ts +0 -5
  371. package/types/async/domain.d.ts.map +0 -1
  372. package/types/async/hooks.d.ts +0 -5
  373. package/types/async/hooks.d.ts.map +0 -1
  374. package/types/async/index.d.ts +0 -8
  375. package/types/async/index.d.ts.map +0 -1
  376. package/types/client.d.ts +0 -16
  377. package/types/client.d.ts.map +0 -1
  378. package/types/handlers.d.ts +0 -57
  379. package/types/handlers.d.ts.map +0 -1
  380. package/types/integrations/anr/legacy.d.ts +0 -22
  381. package/types/integrations/anr/legacy.d.ts.map +0 -1
  382. package/types/integrations/hapi/index.d.ts +0 -22
  383. package/types/integrations/hapi/index.d.ts.map +0 -1
  384. package/types/integrations/hapi/types.d.ts.map +0 -1
  385. package/types/integrations/index.d.ts +0 -14
  386. package/types/integrations/index.d.ts.map +0 -1
  387. package/types/integrations/undici/index.d.ts +0 -58
  388. package/types/integrations/undici/index.d.ts.map +0 -1
  389. package/types/integrations/undici/types.d.ts +0 -224
  390. package/types/integrations/undici/types.d.ts.map +0 -1
  391. package/types/integrations/utils/errorhandling.d.ts.map +0 -1
  392. package/types/integrations/utils/http.d.ts +0 -70
  393. package/types/integrations/utils/http.d.ts.map +0 -1
  394. package/types/module.d.ts.map +0 -1
  395. package/types/requestDataDeprecated.d.ts +0 -45
  396. package/types/requestDataDeprecated.d.ts.map +0 -1
  397. package/types/sdk.d.ts +0 -74
  398. package/types/sdk.d.ts.map +0 -1
  399. package/types/tracing/index.d.ts +0 -6
  400. package/types/tracing/index.d.ts.map +0 -1
  401. package/types/tracing/integrations.d.ts +0 -2
  402. package/types/tracing/integrations.d.ts.map +0 -1
  403. package/types/utils.d.ts +0 -10
  404. package/types/utils.d.ts.map +0 -1
  405. package/types-ts3.8/async/domain.d.ts +0 -5
  406. package/types-ts3.8/async/hooks.d.ts +0 -5
  407. package/types-ts3.8/async/index.d.ts +0 -8
  408. package/types-ts3.8/client.d.ts +0 -16
  409. package/types-ts3.8/handlers.d.ts +0 -57
  410. package/types-ts3.8/integrations/anr/legacy.d.ts +0 -22
  411. package/types-ts3.8/integrations/hapi/index.d.ts +0 -22
  412. package/types-ts3.8/integrations/index.d.ts +0 -14
  413. package/types-ts3.8/integrations/undici/index.d.ts +0 -58
  414. package/types-ts3.8/integrations/undici/types.d.ts +0 -223
  415. package/types-ts3.8/integrations/utils/http.d.ts +0 -80
  416. package/types-ts3.8/requestDataDeprecated.d.ts +0 -45
  417. package/types-ts3.8/sdk.d.ts +0 -74
  418. package/types-ts3.8/tracing/index.d.ts +0 -6
  419. package/types-ts3.8/tracing/integrations.d.ts +0 -2
  420. package/types-ts3.8/utils.d.ts +0 -10
  421. /package/cjs/{module.js → utils/module.js} +0 -0
  422. /package/esm/{module.js → utils/module.js} +0 -0
  423. /package/types/{integrations/utils → utils}/errorhandling.d.ts +0 -0
  424. /package/types/{module.d.ts → utils/module.d.ts} +0 -0
  425. /package/types-ts3.8/{integrations/utils → utils}/errorhandling.d.ts +0 -0
  426. /package/types-ts3.8/{module.d.ts → utils/module.d.ts} +0 -0
package/types/sdk.d.ts DELETED
@@ -1,74 +0,0 @@
1
- import type { Integration, Options, StackParser } from '@sentry/types';
2
- import { NodeClient } from './client';
3
- import type { NodeOptions } from './types';
4
- /** @deprecated Use `getDefaultIntegrations(options)` instead. */
5
- export declare const defaultIntegrations: import("@sentry/types").IntegrationFnResult[];
6
- /** Get the default integrations for the Node SDK. */
7
- export declare function getDefaultIntegrations(_options: Options): Integration[];
8
- /**
9
- * The Sentry Node SDK Client.
10
- *
11
- * To use this SDK, call the {@link init} function as early as possible in the
12
- * main entry module. To set context information or send manual events, use the
13
- * provided methods.
14
- *
15
- * @example
16
- * ```
17
- *
18
- * const { init } = require('@sentry/node');
19
- *
20
- * init({
21
- * dsn: '__DSN__',
22
- * // ...
23
- * });
24
- * ```
25
- *
26
- * @example
27
- * ```
28
- *
29
- * const { configureScope } = require('@sentry/node');
30
- * configureScope((scope: Scope) => {
31
- * scope.setExtra({ battery: 0.7 });
32
- * scope.setTag({ user_mode: 'admin' });
33
- * scope.setUser({ id: '4711' });
34
- * });
35
- * ```
36
- *
37
- * @example
38
- * ```
39
- *
40
- * const { addBreadcrumb } = require('@sentry/node');
41
- * addBreadcrumb({
42
- * message: 'My Breadcrumb',
43
- * // ...
44
- * });
45
- * ```
46
- *
47
- * @example
48
- * ```
49
- *
50
- * const Sentry = require('@sentry/node');
51
- * Sentry.captureMessage('Hello, world!');
52
- * Sentry.captureException(new Error('Good bye'));
53
- * Sentry.captureEvent({
54
- * message: 'Manual',
55
- * stacktrace: [
56
- * // ...
57
- * ],
58
- * });
59
- * ```
60
- *
61
- * @see {@link NodeOptions} for documentation on configuration options.
62
- */
63
- export declare function init(options?: NodeOptions): void;
64
- /**
65
- * Function that takes an instance of NodeClient and checks if autoSessionTracking option is enabled for that client
66
- */
67
- export declare function isAutoSessionTrackingEnabled(client?: NodeClient): boolean;
68
- /**
69
- * Returns a release dynamically from environment variables.
70
- */
71
- export declare function getSentryRelease(fallback?: string): string | undefined;
72
- /** Node.js stack parser */
73
- export declare const defaultStackParser: StackParser;
74
- //# sourceMappingURL=sdk.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAiB,WAAW,EAAE,MAAM,eAAe,CAAC;AAUtF,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAatC,OAAO,KAAK,EAAqB,WAAW,EAAE,MAAM,SAAS,CAAC;AAE9D,iEAAiE;AACjE,eAAO,MAAM,mBAAmB,+CAkB/B,CAAC;AAEF,qDAAqD;AACrD,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,OAAO,GAAG,WAAW,EAAE,CAUvE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAEH,wBAAgB,IAAI,CAAC,OAAO,GAAE,WAAgB,GAAG,IAAI,CAuEpD;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,OAAO,CASzE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CA6BtE;AAED,2BAA2B;AAC3B,eAAO,MAAM,kBAAkB,EAAE,WAAmF,CAAC"}
@@ -1,6 +0,0 @@
1
- import type { Integration } from '@sentry/types';
2
- /**
3
- * Automatically detects and returns integrations that will work with your dependencies.
4
- */
5
- export declare function autoDiscoverNodePerformanceMonitoringIntegrations(): Integration[];
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tracing/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjD;;GAEG;AACH,wBAAgB,iDAAiD,IAAI,WAAW,EAAE,CAiBjF"}
@@ -1,2 +0,0 @@
1
- export { Apollo, Express, GraphQL, Mongo, Mysql, Postgres, Prisma } from '@sentry-internal/tracing';
2
- //# sourceMappingURL=integrations.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../../src/tracing/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC"}
package/types/utils.d.ts DELETED
@@ -1,10 +0,0 @@
1
- /**
2
- * Recursively read the contents of a directory.
3
- *
4
- * @param targetDir Absolute or relative path of the directory to scan. All returned paths will be relative to this
5
- * directory.
6
- * @returns Array holding all relative paths
7
- * @deprecated This function will be removed in the next major version.
8
- */
9
- export declare function deepReadDirSync(targetDir: string): string[];
10
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CA4B3D"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Sets the async context strategy to use Node.js domains.
3
- */
4
- export declare function setDomainAsyncContextStrategy(): void;
5
- //# sourceMappingURL=domain.d.ts.map
@@ -1,5 +0,0 @@
1
- /**
2
- * Sets the async context strategy to use AsyncLocalStorage which requires Node v12.17.0 or v13.10.0.
3
- */
4
- export declare function setHooksAsyncContextStrategy(): void;
5
- //# sourceMappingURL=hooks.d.ts.map
@@ -1,8 +0,0 @@
1
- /**
2
- * Sets the correct async context strategy for Node.js
3
- *
4
- * Node.js >= 14 uses AsyncLocalStorage
5
- * Node.js < 14 uses domains
6
- */
7
- export declare function setNodeAsyncContextStrategy(): void;
8
- //# sourceMappingURL=index.d.ts.map
@@ -1,16 +0,0 @@
1
- import { ServerRuntimeClient } from '@sentry/core';
2
- import { NodeClientOptions } from './types';
3
- /**
4
- * The Sentry Node SDK Client.
5
- *
6
- * @see NodeClientOptions for documentation on configuration options.
7
- * @see SentryClient for usage documentation.
8
- */
9
- export declare class NodeClient extends ServerRuntimeClient<NodeClientOptions> {
10
- /**
11
- * Creates a new Node SDK instance.
12
- * @param options Configuration options for this SDK.
13
- */
14
- constructor(options: NodeClientOptions);
15
- }
16
- //# sourceMappingURL=client.d.ts.map
@@ -1,57 +0,0 @@
1
- /// <reference types="node" />
2
- import * as http from 'http';
3
- import { AddRequestDataToEventOptions } from '@sentry/utils';
4
- import { ParseRequestOptions } from './requestDataDeprecated';
5
- /**
6
- * Express-compatible tracing handler.
7
- * @see Exposed as `Handlers.tracingHandler`
8
- */
9
- export declare function tracingHandler(): (req: http.IncomingMessage, res: http.ServerResponse, next: (error?: any) => void) => void;
10
- export type RequestHandlerOptions = (ParseRequestOptions | AddRequestDataToEventOptions) & {
11
- flushTimeout?: number;
12
- };
13
- /**
14
- * Express compatible request handler.
15
- * @see Exposed as `Handlers.requestHandler`
16
- */
17
- export declare function requestHandler(options?: RequestHandlerOptions): (req: http.IncomingMessage, res: http.ServerResponse, next: (error?: any) => void) => void;
18
- /** JSDoc */
19
- interface MiddlewareError extends Error {
20
- status?: number | string;
21
- statusCode?: number | string;
22
- status_code?: number | string;
23
- output?: {
24
- statusCode?: number | string;
25
- };
26
- }
27
- /**
28
- * Express compatible error handler.
29
- * @see Exposed as `Handlers.errorHandler`
30
- */
31
- export declare function errorHandler(options?: {
32
- /**
33
- * Callback method deciding whether error should be captured and sent to Sentry
34
- * @param error Captured middleware error
35
- */
36
- shouldHandleError?(this: void, error: MiddlewareError): boolean;
37
- }): (error: MiddlewareError, req: http.IncomingMessage, res: http.ServerResponse, next: (error: MiddlewareError) => void) => void;
38
- interface SentryTrpcMiddlewareOptions {
39
- /** Whether to include procedure inputs in reported events. Defaults to `false`. */
40
- attachRpcInput?: boolean;
41
- }
42
- interface TrpcMiddlewareArguments<T> {
43
- path: string;
44
- type: string;
45
- next: () => T;
46
- rawInput: unknown;
47
- }
48
- /**
49
- * Sentry tRPC middleware that names the handling transaction after the called procedure.
50
- *
51
- * Use the Sentry tRPC middleware in combination with the Sentry server integration,
52
- * e.g. Express Request Handlers or Next.js SDK.
53
- */
54
- export declare function trpcMiddleware(options?: SentryTrpcMiddlewareOptions): <T>({ path, type, next, rawInput }: TrpcMiddlewareArguments<T>) => T;
55
- export { ParseRequestOptions, ExpressRequest } from './requestDataDeprecated';
56
- export { parseRequest, extractRequestData } from './requestDataDeprecated';
57
- //# sourceMappingURL=handlers.d.ts.map
@@ -1,22 +0,0 @@
1
- interface LegacyOptions {
2
- entryScript: string;
3
- pollInterval: number;
4
- anrThreshold: number;
5
- captureStackTrace: boolean;
6
- debug: boolean;
7
- }
8
- /**
9
- * @deprecated Use the `Anr` integration instead.
10
- *
11
- * ```ts
12
- * import * as Sentry from '@sentry/node';
13
- *
14
- * Sentry.init({
15
- * dsn: '__DSN__',
16
- * integrations: [new Sentry.Integrations.Anr({ captureStackTrace: true })],
17
- * });
18
- * ```
19
- */
20
- export declare function enableAnrDetection(options: Partial<LegacyOptions>): Promise<void>;
21
- export {};
22
- //# sourceMappingURL=legacy.d.ts.map
@@ -1,22 +0,0 @@
1
- export declare const hapiErrorPlugin: {
2
- name: string;
3
- version: string;
4
- register: (serverArg: Record<any, any>) => Promise<void>;
5
- };
6
- export declare const hapiTracingPlugin: {
7
- name: string;
8
- version: string;
9
- register: (serverArg: Record<any, any>) => Promise<void>;
10
- };
11
- export type HapiOptions = {
12
- /** Hapi server instance */
13
- server?: Record<any, any>;
14
- };
15
- export declare const hapiIntegration: (options?: HapiOptions | undefined) => import("@sentry/types").IntegrationFnResult;
16
- /**
17
- * Hapi Framework Integration.
18
- * @deprecated Use `hapiIntegration()` instead.
19
- */
20
- export declare const Hapi: import("@sentry/types").IntegrationClass<import("@sentry/types").Integration>;
21
- export type Hapi = typeof Hapi;
22
- //# sourceMappingURL=index.d.ts.map
@@ -1,14 +0,0 @@
1
- export { Console } from './console';
2
- export { Http } from './http';
3
- export { OnUncaughtException } from './onuncaughtexception';
4
- export { OnUnhandledRejection } from './onunhandledrejection';
5
- export { Modules } from './modules';
6
- export { ContextLines } from './contextlines';
7
- export { Context } from './context';
8
- export { RequestData } from '@sentry/core';
9
- export { LocalVariables } from './local-variables';
10
- export { Undici } from './undici';
11
- export { Spotlight } from './spotlight';
12
- export { Anr } from './anr';
13
- export { Hapi } from './hapi';
14
- //# sourceMappingURL=index.d.ts.map
@@ -1,58 +0,0 @@
1
- import { EventProcessor, Integration, IntegrationFnResult } from '@sentry/types';
2
- export declare enum ChannelName {
3
- RequestCreate = "undici:request:create",
4
- RequestEnd = "undici:request:headers",
5
- RequestError = "undici:request:error"
6
- }
7
- export interface UndiciOptions {
8
- /**
9
- * Whether breadcrumbs should be recorded for requests
10
- * Defaults to true
11
- */
12
- breadcrumbs: boolean;
13
- /**
14
- * Whether tracing spans should be created for requests
15
- * If not set, this will be enabled/disabled based on if tracing is enabled.
16
- */
17
- tracing?: boolean;
18
- /**
19
- * Function determining whether or not to create spans to track outgoing requests to the given URL.
20
- * By default, spans will be created for all outgoing requests.
21
- */
22
- shouldCreateSpanForRequest?: (url: string) => boolean;
23
- }
24
- export declare const nativeNodeFetchintegration: (options?: Partial<UndiciOptions> | undefined) => IntegrationFnResult;
25
- /**
26
- * Instruments outgoing HTTP requests made with the `undici` package via
27
- * Node's `diagnostics_channel` API.
28
- *
29
- * Supports Undici 4.7.0 or higher.
30
- *
31
- * Requires Node 16.17.0 or higher.
32
- *
33
- * @deprecated Use `nativeNodeFetchintegration()` instead.
34
- */
35
- export declare class Undici implements Integration {
36
- /**
37
- * @inheritDoc
38
- */
39
- static id: string;
40
- /**
41
- * @inheritDoc
42
- */
43
- name: string;
44
- private readonly _options;
45
- private readonly _createSpanUrlMap;
46
- private readonly _headersUrlMap;
47
- constructor(_options?: Partial<UndiciOptions>);
48
- /**
49
- * @inheritDoc
50
- */
51
- setupOnce(_addGlobalEventProcessor: (callback: EventProcessor) => void): void;
52
- /** Helper that wraps shouldCreateSpanForRequest option */
53
- private _shouldCreateSpan;
54
- private _onRequestCreate;
55
- private _onRequestEnd;
56
- private _onRequestError;
57
- }
58
- //# sourceMappingURL=index.d.ts.map
@@ -1,223 +0,0 @@
1
- /// <reference types="node" />
2
- import { URL } from 'url';
3
- import { Span } from '@sentry/types';
4
- export type ChannelListener = (message: unknown, name: string | symbol) => void;
5
- /**
6
- * The `diagnostics_channel` module provides an API to create named channels
7
- * to report arbitrary message data for diagnostics purposes.
8
- *
9
- * It can be accessed using:
10
- *
11
- * ```js
12
- * import diagnostics_channel from 'diagnostics_channel';
13
- * ```
14
- *
15
- * It is intended that a module writer wanting to report diagnostics messages
16
- * will create one or many top-level channels to report messages through.
17
- * Channels may also be acquired at runtime but it is not encouraged
18
- * due to the additional overhead of doing so. Channels may be exported for
19
- * convenience, but as long as the name is known it can be acquired anywhere.
20
- *
21
- * If you intend for your module to produce diagnostics data for others to
22
- * consume it is recommended that you include documentation of what named
23
- * channels are used along with the shape of the message data. Channel names
24
- * should generally include the module name to avoid collisions with data from
25
- * other modules.
26
- * @experimental
27
- * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/diagnostics_channel.js)
28
- */
29
- export interface DiagnosticsChannel {
30
- /**
31
- * Check if there are active subscribers to the named channel. This is helpful if
32
- * the message you want to send might be expensive to prepare.
33
- *
34
- * This API is optional but helpful when trying to publish messages from very
35
- * performance-sensitive code.
36
- *
37
- * ```js
38
- * import diagnostics_channel from 'diagnostics_channel';
39
- *
40
- * if (diagnostics_channel.hasSubscribers('my-channel')) {
41
- * // There are subscribers, prepare and publish message
42
- * }
43
- * ```
44
- * @since v15.1.0, v14.17.0
45
- * @param name The channel name
46
- * @return If there are active subscribers
47
- */
48
- hasSubscribers(name: string | symbol): boolean;
49
- /**
50
- * This is the primary entry-point for anyone wanting to interact with a named
51
- * channel. It produces a channel object which is optimized to reduce overhead at
52
- * publish time as much as possible.
53
- *
54
- * ```js
55
- * import diagnostics_channel from 'diagnostics_channel';
56
- *
57
- * const channel = diagnostics_channel.channel('my-channel');
58
- * ```
59
- * @since v15.1.0, v14.17.0
60
- * @param name The channel name
61
- * @return The named channel object
62
- */
63
- channel(name: string | symbol): Channel;
64
- /**
65
- * Register a message handler to subscribe to this channel. This message handler will be run synchronously
66
- * whenever a message is published to the channel. Any errors thrown in the message handler will
67
- * trigger an 'uncaughtException'.
68
- *
69
- * ```js
70
- * import diagnostics_channel from 'diagnostics_channel';
71
- *
72
- * diagnostics_channel.subscribe('my-channel', (message, name) => {
73
- * // Received data
74
- * });
75
- * ```
76
- *
77
- * @since v18.7.0, v16.17.0
78
- * @param name The channel name
79
- * @param onMessage The handler to receive channel messages
80
- */
81
- subscribe(name: string | symbol, onMessage: ChannelListener): void;
82
- /**
83
- * Remove a message handler previously registered to this channel with diagnostics_channel.subscribe(name, onMessage).
84
- *
85
- * ```js
86
- * import diagnostics_channel from 'diagnostics_channel';
87
- *
88
- * function onMessage(message, name) {
89
- * // Received data
90
- * }
91
- *
92
- * diagnostics_channel.subscribe('my-channel', onMessage);
93
- *
94
- * diagnostics_channel.unsubscribe('my-channel', onMessage);
95
- * ```
96
- *
97
- * @since v18.7.0, v16.17.0
98
- * @param name The channel name
99
- * @param onMessage The previous subscribed handler to remove
100
- * @returns `true` if the handler was found, `false` otherwise
101
- */
102
- unsubscribe(name: string | symbol, onMessage: ChannelListener): boolean;
103
- }
104
- /**
105
- * The class `Channel` represents an individual named channel within the data
106
- * pipeline. It is use to track subscribers and to publish messages when there
107
- * are subscribers present. It exists as a separate object to avoid channel
108
- * lookups at publish time, enabling very fast publish speeds and allowing
109
- * for heavy use while incurring very minimal cost. Channels are created with {@link channel}, constructing a channel directly
110
- * with `new Channel(name)` is not supported.
111
- * @since v15.1.0, v14.17.0
112
- */
113
- interface ChannelI {
114
- readonly name: string | symbol;
115
- /**
116
- * Check if there are active subscribers to this channel. This is helpful if
117
- * the message you want to send might be expensive to prepare.
118
- *
119
- * This API is optional but helpful when trying to publish messages from very
120
- * performance-sensitive code.
121
- *
122
- * ```js
123
- * import diagnostics_channel from 'diagnostics_channel';
124
- *
125
- * const channel = diagnostics_channel.channel('my-channel');
126
- *
127
- * if (channel.hasSubscribers) {
128
- * // There are subscribers, prepare and publish message
129
- * }
130
- * ```
131
- * @since v15.1.0, v14.17.0
132
- */
133
- readonly hasSubscribers: boolean;
134
- /**
135
- * Publish a message to any subscribers to the channel. This will
136
- * trigger message handlers synchronously so they will execute within
137
- * the same context.
138
- *
139
- * ```js
140
- * import diagnostics_channel from 'diagnostics_channel';
141
- *
142
- * const channel = diagnostics_channel.channel('my-channel');
143
- *
144
- * channel.publish({
145
- * some: 'message'
146
- * });
147
- * ```
148
- * @since v15.1.0, v14.17.0
149
- * @param message The message to send to the channel subscribers
150
- */
151
- publish(message: unknown): void;
152
- /**
153
- * Register a message handler to subscribe to this channel. This message handler
154
- * will be run synchronously whenever a message is published to the channel. Any
155
- * errors thrown in the message handler will trigger an `'uncaughtException'`.
156
- *
157
- * ```js
158
- * import diagnostics_channel from 'diagnostics_channel';
159
- *
160
- * const channel = diagnostics_channel.channel('my-channel');
161
- *
162
- * channel.subscribe((message, name) => {
163
- * // Received data
164
- * });
165
- * ```
166
- * @since v15.1.0, v14.17.0
167
- * @param onMessage The handler to receive channel messages
168
- */
169
- subscribe(onMessage: ChannelListener): void;
170
- /**
171
- * Remove a message handler previously registered to this channel with `channel.subscribe(onMessage)`.
172
- *
173
- * ```js
174
- * import diagnostics_channel from 'diagnostics_channel';
175
- *
176
- * const channel = diagnostics_channel.channel('my-channel');
177
- *
178
- * function onMessage(message, name) {
179
- * // Received data
180
- * }
181
- *
182
- * channel.subscribe(onMessage);
183
- *
184
- * channel.unsubscribe(onMessage);
185
- * ```
186
- * @since v15.1.0, v14.17.0
187
- * @param onMessage The previous subscribed handler to remove
188
- * @return `true` if the handler was found, `false` otherwise.
189
- */
190
- unsubscribe(onMessage: ChannelListener): void;
191
- }
192
- export interface Channel extends ChannelI {
193
- new (name: string | symbol): void;
194
- }
195
- export interface UndiciRequest {
196
- origin?: string | URL;
197
- completed: boolean;
198
- method?: string;
199
- path: string;
200
- headers: string;
201
- addHeader(key: string, value: string): RequestWithSentry;
202
- }
203
- export interface UndiciResponse {
204
- statusCode: number;
205
- statusText: string;
206
- headers: Array<Buffer>;
207
- }
208
- export interface RequestWithSentry extends UndiciRequest {
209
- __sentry_span__?: Span;
210
- }
211
- export interface RequestCreateMessage {
212
- request: RequestWithSentry;
213
- }
214
- export interface RequestEndMessage {
215
- request: RequestWithSentry;
216
- response: UndiciResponse;
217
- }
218
- export interface RequestErrorMessage {
219
- request: RequestWithSentry;
220
- error: Error;
221
- }
222
- export {};
223
- //# sourceMappingURL=types.d.ts.map
@@ -1,80 +0,0 @@
1
- /// <reference types="node" />
2
- import * as http from 'http';
3
- import * as https from 'https';
4
- import { URL } from 'url';
5
- /**
6
- * Assembles a URL that's passed to the users to filter on.
7
- * It can include raw (potentially PII containing) data, which we'll allow users to access to filter
8
- * but won't include in spans or breadcrumbs.
9
- *
10
- * @param requestOptions RequestOptions object containing the component parts for a URL
11
- * @returns Fully-formed URL
12
- */
13
- export declare function extractRawUrl(requestOptions: RequestOptions): string;
14
- /**
15
- * Assemble a URL to be used for breadcrumbs and spans.
16
- *
17
- * @param requestOptions RequestOptions object containing the component parts for a URL
18
- * @returns Fully-formed URL
19
- */
20
- export declare function extractUrl(requestOptions: RequestOptions): string;
21
- /**
22
- * Handle various edge cases in the span description (for spans representing http(s) requests).
23
- *
24
- * @param description current `description` property of the span representing the request
25
- * @param requestOptions Configuration data for the request
26
- * @param Request Request object
27
- *
28
- * @returns The cleaned description
29
- */
30
- export declare function cleanSpanDescription(description: string | undefined, requestOptions: RequestOptions, request: http.ClientRequest): string | undefined;
31
- export type RequestOptions = http.RequestOptions & {
32
- hash?: string;
33
- search?: string;
34
- pathname?: string;
35
- href?: string;
36
- };
37
- type RequestCallback = (response: http.IncomingMessage) => void;
38
- export type RequestMethodArgs = [
39
- RequestOptions | string | URL,
40
- RequestCallback?
41
- ] | [
42
- string | URL,
43
- RequestOptions,
44
- RequestCallback?
45
- ];
46
- export type RequestMethod = (...args: RequestMethodArgs) => http.ClientRequest;
47
- /**
48
- * Convert a URL object into a RequestOptions object.
49
- *
50
- * Copied from Node's internals (where it's used in http(s).request() and http(s).get()), modified only to use the
51
- * RequestOptions type above.
52
- *
53
- * See https://github.com/nodejs/node/blob/master/lib/internal/url.js.
54
- */
55
- export declare function urlToOptions(url: URL): RequestOptions;
56
- /**
57
- * Normalize inputs to `http(s).request()` and `http(s).get()`.
58
- *
59
- * Legal inputs to `http(s).request()` and `http(s).get()` can take one of ten forms:
60
- * [ RequestOptions | string | URL ],
61
- * [ RequestOptions | string | URL, RequestCallback ],
62
- * [ string | URL, RequestOptions ], and
63
- * [ string | URL, RequestOptions, RequestCallback ].
64
- *
65
- * This standardizes to one of two forms: [ RequestOptions ] and [ RequestOptions, RequestCallback ]. A similar thing is
66
- * done as the first step of `http(s).request()` and `http(s).get()`; this just does it early so that we can interact
67
- * with the args in a standard way.
68
- *
69
- * @param requestArgs The inputs to `http(s).request()` or `http(s).get()`, as an array.
70
- *
71
- * @returns Equivalent args of the form [ RequestOptions ] or [ RequestOptions, RequestCallback ].
72
- */
73
- export declare function normalizeRequestArgs(httpModule: typeof http | typeof https, requestArgs: RequestMethodArgs): [
74
- RequestOptions
75
- ] | [
76
- RequestOptions,
77
- RequestCallback
78
- ];
79
- export {};
80
- //# sourceMappingURL=http.d.ts.map