@sentry/core 10.53.0 → 10.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1519) hide show
  1. package/browser.d.ts +4 -0
  2. package/build/cjs/api.js +10 -34
  3. package/build/cjs/api.js.map +1 -1
  4. package/build/cjs/asyncContext/index.js +0 -14
  5. package/build/cjs/asyncContext/index.js.map +1 -1
  6. package/build/cjs/asyncContext/stackStrategy.js +16 -47
  7. package/build/cjs/asyncContext/stackStrategy.js.map +1 -1
  8. package/build/cjs/attributes.js +17 -95
  9. package/build/cjs/attributes.js.map +1 -1
  10. package/build/cjs/breadcrumbs.js +2 -22
  11. package/build/cjs/breadcrumbs.js.map +1 -1
  12. package/build/cjs/browser.js +12 -3
  13. package/build/cjs/browser.js.map +1 -1
  14. package/build/cjs/carrier.js +5 -42
  15. package/build/cjs/carrier.js.map +1 -1
  16. package/build/cjs/checkin.js +5 -19
  17. package/build/cjs/checkin.js.map +1 -1
  18. package/build/cjs/client.js +216 -585
  19. package/build/cjs/client.js.map +1 -1
  20. package/build/cjs/constants.js +2 -2
  21. package/build/cjs/currentScopes.js +5 -86
  22. package/build/cjs/currentScopes.js.map +1 -1
  23. package/build/cjs/debug-build.js +0 -5
  24. package/build/cjs/debug-build.js.map +1 -1
  25. package/build/cjs/defaultScopes.js +2 -5
  26. package/build/cjs/defaultScopes.js.map +1 -1
  27. package/build/cjs/envelope.js +32 -103
  28. package/build/cjs/envelope.js.map +1 -1
  29. package/build/cjs/eventProcessors.js +4 -23
  30. package/build/cjs/eventProcessors.js.map +1 -1
  31. package/build/cjs/exports.js +21 -197
  32. package/build/cjs/exports.js.map +1 -1
  33. package/build/cjs/feedback.js +7 -19
  34. package/build/cjs/feedback.js.map +1 -1
  35. package/build/cjs/fetch.js +66 -201
  36. package/build/cjs/fetch.js.map +1 -1
  37. package/build/cjs/index.js +17 -3
  38. package/build/cjs/index.js.map +1 -1
  39. package/build/cjs/instrument/console.js +9 -41
  40. package/build/cjs/instrument/console.js.map +1 -1
  41. package/build/cjs/instrument/fetch.js +47 -156
  42. package/build/cjs/instrument/fetch.js.map +1 -1
  43. package/build/cjs/instrument/globalError.js +4 -25
  44. package/build/cjs/instrument/globalError.js.map +1 -1
  45. package/build/cjs/instrument/globalUnhandledRejection.js +4 -21
  46. package/build/cjs/instrument/globalUnhandledRejection.js.map +1 -1
  47. package/build/cjs/instrument/handlers.js +9 -21
  48. package/build/cjs/instrument/handlers.js.map +1 -1
  49. package/build/cjs/integration.js +13 -77
  50. package/build/cjs/integration.js.map +1 -1
  51. package/build/cjs/integrations/captureconsole.js +16 -40
  52. package/build/cjs/integrations/captureconsole.js.map +1 -1
  53. package/build/cjs/integrations/consola.js +57 -163
  54. package/build/cjs/integrations/consola.js.map +1 -1
  55. package/build/cjs/integrations/console.js +11 -43
  56. package/build/cjs/integrations/console.js.map +1 -1
  57. package/build/cjs/integrations/conversationId.js +5 -22
  58. package/build/cjs/integrations/conversationId.js.map +1 -1
  59. package/build/cjs/integrations/dedupe.js +16 -74
  60. package/build/cjs/integrations/dedupe.js.map +1 -1
  61. package/build/cjs/integrations/eventFilters.js +63 -114
  62. package/build/cjs/integrations/eventFilters.js.map +1 -1
  63. package/build/cjs/integrations/express/index.js +30 -145
  64. package/build/cjs/integrations/express/index.js.map +1 -1
  65. package/build/cjs/integrations/express/patch-layer.js +20 -130
  66. package/build/cjs/integrations/express/patch-layer.js.map +1 -1
  67. package/build/cjs/integrations/express/request-layer-store.js +1 -3
  68. package/build/cjs/integrations/express/request-layer-store.js.map +1 -1
  69. package/build/cjs/integrations/express/set-sdk-processing-metadata.js +0 -2
  70. package/build/cjs/integrations/express/set-sdk-processing-metadata.js.map +1 -1
  71. package/build/cjs/integrations/express/types.js +6 -7
  72. package/build/cjs/integrations/express/types.js.map +1 -1
  73. package/build/cjs/integrations/express/utils.js +37 -145
  74. package/build/cjs/integrations/express/utils.js.map +1 -1
  75. package/build/cjs/integrations/extraerrordata.js +24 -69
  76. package/build/cjs/integrations/extraerrordata.js.map +1 -1
  77. package/build/cjs/integrations/featureFlags/featureFlagsIntegration.js +3 -29
  78. package/build/cjs/integrations/featureFlags/featureFlagsIntegration.js.map +1 -1
  79. package/build/cjs/integrations/featureFlags/growthbook.js +11 -40
  80. package/build/cjs/integrations/featureFlags/growthbook.js.map +1 -1
  81. package/build/cjs/integrations/functiontostring.js +6 -27
  82. package/build/cjs/integrations/functiontostring.js.map +1 -1
  83. package/build/cjs/integrations/http/add-outgoing-request-breadcrumb.js +10 -18
  84. package/build/cjs/integrations/http/add-outgoing-request-breadcrumb.js.map +1 -1
  85. package/build/cjs/integrations/http/client-patch.js +8 -70
  86. package/build/cjs/integrations/http/client-patch.js.map +1 -1
  87. package/build/cjs/integrations/http/client-subscriptions.js +22 -59
  88. package/build/cjs/integrations/http/client-subscriptions.js.map +1 -1
  89. package/build/cjs/integrations/http/constants.js +3 -3
  90. package/build/cjs/integrations/http/double-wrap-warning.js +10 -18
  91. package/build/cjs/integrations/http/double-wrap-warning.js.map +1 -1
  92. package/build/cjs/integrations/http/get-outgoing-span-data.js +30 -47
  93. package/build/cjs/integrations/http/get-outgoing-span-data.js.map +1 -1
  94. package/build/cjs/integrations/http/get-request-url.js +7 -24
  95. package/build/cjs/integrations/http/get-request-url.js.map +1 -1
  96. package/build/cjs/integrations/http/inject-trace-propagation-headers.js +14 -38
  97. package/build/cjs/integrations/http/inject-trace-propagation-headers.js.map +1 -1
  98. package/build/cjs/integrations/http/patch-request-to-capture-body.js +80 -0
  99. package/build/cjs/integrations/http/patch-request-to-capture-body.js.map +1 -0
  100. package/build/cjs/integrations/http/record-request-session.js +61 -0
  101. package/build/cjs/integrations/http/record-request-session.js.map +1 -0
  102. package/build/cjs/integrations/http/server-subscription.js +289 -0
  103. package/build/cjs/integrations/http/server-subscription.js.map +1 -0
  104. package/build/cjs/integrations/linkederrors.js +6 -11
  105. package/build/cjs/integrations/linkederrors.js.map +1 -1
  106. package/build/cjs/integrations/mcp-server/attributeExtraction.js +26 -69
  107. package/build/cjs/integrations/mcp-server/attributeExtraction.js.map +1 -1
  108. package/build/cjs/integrations/mcp-server/attributes.js +30 -138
  109. package/build/cjs/integrations/mcp-server/attributes.js.map +1 -1
  110. package/build/cjs/integrations/mcp-server/correlation.js +20 -91
  111. package/build/cjs/integrations/mcp-server/correlation.js.map +1 -1
  112. package/build/cjs/integrations/mcp-server/errorCapture.js +6 -25
  113. package/build/cjs/integrations/mcp-server/errorCapture.js.map +1 -1
  114. package/build/cjs/integrations/mcp-server/handlers.js +55 -169
  115. package/build/cjs/integrations/mcp-server/handlers.js.map +1 -1
  116. package/build/cjs/integrations/mcp-server/index.js +7 -60
  117. package/build/cjs/integrations/mcp-server/index.js.map +1 -1
  118. package/build/cjs/integrations/mcp-server/methodConfig.js +21 -59
  119. package/build/cjs/integrations/mcp-server/methodConfig.js.map +1 -1
  120. package/build/cjs/integrations/mcp-server/piiFiltering.js +5 -33
  121. package/build/cjs/integrations/mcp-server/piiFiltering.js.map +1 -1
  122. package/build/cjs/integrations/mcp-server/resultExtraction.js +20 -76
  123. package/build/cjs/integrations/mcp-server/resultExtraction.js.map +1 -1
  124. package/build/cjs/integrations/mcp-server/sessionExtraction.js +30 -121
  125. package/build/cjs/integrations/mcp-server/sessionExtraction.js.map +1 -1
  126. package/build/cjs/integrations/mcp-server/sessionManagement.js +2 -60
  127. package/build/cjs/integrations/mcp-server/sessionManagement.js.map +1 -1
  128. package/build/cjs/integrations/mcp-server/spans.js +20 -107
  129. package/build/cjs/integrations/mcp-server/spans.js.map +1 -1
  130. package/build/cjs/integrations/mcp-server/transport.js +26 -94
  131. package/build/cjs/integrations/mcp-server/transport.js.map +1 -1
  132. package/build/cjs/integrations/mcp-server/validation.js +6 -72
  133. package/build/cjs/integrations/mcp-server/validation.js.map +1 -1
  134. package/build/cjs/integrations/moduleMetadata.js +6 -20
  135. package/build/cjs/integrations/moduleMetadata.js.map +1 -1
  136. package/build/cjs/integrations/postgresjs.js +78 -287
  137. package/build/cjs/integrations/postgresjs.js.map +1 -1
  138. package/build/cjs/integrations/requestdata.js +30 -93
  139. package/build/cjs/integrations/requestdata.js.map +1 -1
  140. package/build/cjs/integrations/rewriteframes.js +14 -45
  141. package/build/cjs/integrations/rewriteframes.js.map +1 -1
  142. package/build/cjs/integrations/spanStreaming.js +9 -15
  143. package/build/cjs/integrations/spanStreaming.js.map +1 -1
  144. package/build/cjs/integrations/supabase.js +224 -333
  145. package/build/cjs/integrations/supabase.js.map +1 -1
  146. package/build/cjs/integrations/third-party-errors-filter.js +60 -85
  147. package/build/cjs/integrations/third-party-errors-filter.js.map +1 -1
  148. package/build/cjs/integrations/zoderrors.js +35 -111
  149. package/build/cjs/integrations/zoderrors.js.map +1 -1
  150. package/build/cjs/logs/console-integration.js +15 -50
  151. package/build/cjs/logs/console-integration.js.map +1 -1
  152. package/build/cjs/logs/constants.js +1 -6
  153. package/build/cjs/logs/constants.js.map +1 -1
  154. package/build/cjs/logs/envelope.js +10 -40
  155. package/build/cjs/logs/envelope.js.map +1 -1
  156. package/build/cjs/logs/internal.js +53 -125
  157. package/build/cjs/logs/internal.js.map +1 -1
  158. package/build/cjs/logs/public-api.js +13 -228
  159. package/build/cjs/logs/public-api.js.map +1 -1
  160. package/build/cjs/logs/utils.js +6 -47
  161. package/build/cjs/logs/utils.js.map +1 -1
  162. package/build/cjs/metadata.js +6 -51
  163. package/build/cjs/metadata.js.map +1 -1
  164. package/build/cjs/metrics/envelope.js +12 -45
  165. package/build/cjs/metrics/envelope.js.map +1 -1
  166. package/build/cjs/metrics/internal.js +31 -144
  167. package/build/cjs/metrics/internal.js.map +1 -1
  168. package/build/cjs/metrics/public-api.js +4 -109
  169. package/build/cjs/metrics/public-api.js.map +1 -1
  170. package/build/cjs/profiling.js +11 -41
  171. package/build/cjs/profiling.js.map +1 -1
  172. package/build/cjs/scope.js +73 -224
  173. package/build/cjs/scope.js.map +1 -1
  174. package/build/cjs/sdk.js +2 -21
  175. package/build/cjs/sdk.js.map +1 -1
  176. package/build/cjs/semanticAttributes.js +30 -116
  177. package/build/cjs/semanticAttributes.js.map +1 -1
  178. package/build/cjs/server-runtime-client.js +32 -87
  179. package/build/cjs/server-runtime-client.js.map +1 -1
  180. package/build/cjs/server.js +17 -3
  181. package/build/cjs/server.js.map +1 -1
  182. package/build/cjs/session.js +14 -67
  183. package/build/cjs/session.js.map +1 -1
  184. package/build/cjs/tracing/ai/gen-ai-attributes.js +45 -249
  185. package/build/cjs/tracing/ai/gen-ai-attributes.js.map +1 -1
  186. package/build/cjs/tracing/ai/mediaStripping.js +21 -116
  187. package/build/cjs/tracing/ai/mediaStripping.js.map +1 -1
  188. package/build/cjs/tracing/ai/messageTruncation.js +26 -212
  189. package/build/cjs/tracing/ai/messageTruncation.js.map +1 -1
  190. package/build/cjs/tracing/ai/utils.js +40 -180
  191. package/build/cjs/tracing/ai/utils.js.map +1 -1
  192. package/build/cjs/tracing/anthropic-ai/constants.js +9 -12
  193. package/build/cjs/tracing/anthropic-ai/constants.js.map +1 -1
  194. package/build/cjs/tracing/anthropic-ai/index.js +67 -172
  195. package/build/cjs/tracing/anthropic-ai/index.js.map +1 -1
  196. package/build/cjs/tracing/anthropic-ai/streaming.js +45 -149
  197. package/build/cjs/tracing/anthropic-ai/streaming.js.map +1 -1
  198. package/build/cjs/tracing/anthropic-ai/utils.js +17 -47
  199. package/build/cjs/tracing/anthropic-ai/utils.js.map +1 -1
  200. package/build/cjs/tracing/dynamicSamplingContext.js +18 -85
  201. package/build/cjs/tracing/dynamicSamplingContext.js.map +1 -1
  202. package/build/cjs/tracing/errors.js +2 -14
  203. package/build/cjs/tracing/errors.js.map +1 -1
  204. package/build/cjs/tracing/google-genai/constants.js +9 -16
  205. package/build/cjs/tracing/google-genai/constants.js.map +1 -1
  206. package/build/cjs/tracing/google-genai/index.js +79 -223
  207. package/build/cjs/tracing/google-genai/index.js.map +1 -1
  208. package/build/cjs/tracing/google-genai/streaming.js +11 -56
  209. package/build/cjs/tracing/google-genai/streaming.js.map +1 -1
  210. package/build/cjs/tracing/google-genai/utils.js +8 -13
  211. package/build/cjs/tracing/google-genai/utils.js.map +1 -1
  212. package/build/cjs/tracing/idleSpan.js +48 -174
  213. package/build/cjs/tracing/idleSpan.js.map +1 -1
  214. package/build/cjs/tracing/langchain/constants.js +8 -9
  215. package/build/cjs/tracing/langchain/constants.js.map +1 -1
  216. package/build/cjs/tracing/langchain/embeddings.js +31 -75
  217. package/build/cjs/tracing/langchain/embeddings.js.map +1 -1
  218. package/build/cjs/tracing/langchain/index.js +64 -161
  219. package/build/cjs/tracing/langchain/index.js.map +1 -1
  220. package/build/cjs/tracing/langchain/utils.js +101 -311
  221. package/build/cjs/tracing/langchain/utils.js.map +1 -1
  222. package/build/cjs/tracing/langgraph/constants.js +2 -2
  223. package/build/cjs/tracing/langgraph/index.js +57 -160
  224. package/build/cjs/tracing/langgraph/index.js.map +1 -1
  225. package/build/cjs/tracing/langgraph/utils.js +53 -170
  226. package/build/cjs/tracing/langgraph/utils.js.map +1 -1
  227. package/build/cjs/tracing/logSpans.js +10 -26
  228. package/build/cjs/tracing/logSpans.js.map +1 -1
  229. package/build/cjs/tracing/measurement.js +6 -18
  230. package/build/cjs/tracing/measurement.js.map +1 -1
  231. package/build/cjs/tracing/openai/constants.js +20 -24
  232. package/build/cjs/tracing/openai/constants.js.map +1 -1
  233. package/build/cjs/tracing/openai/index.js +52 -132
  234. package/build/cjs/tracing/openai/index.js.map +1 -1
  235. package/build/cjs/tracing/openai/streaming.js +24 -102
  236. package/build/cjs/tracing/openai/streaming.js.map +1 -1
  237. package/build/cjs/tracing/openai/utils.js +36 -107
  238. package/build/cjs/tracing/openai/utils.js.map +1 -1
  239. package/build/cjs/tracing/sampling.js +23 -63
  240. package/build/cjs/tracing/sampling.js.map +1 -1
  241. package/build/cjs/tracing/sentryNonRecordingSpan.js +15 -40
  242. package/build/cjs/tracing/sentryNonRecordingSpan.js.map +1 -1
  243. package/build/cjs/tracing/sentrySpan.js +66 -172
  244. package/build/cjs/tracing/sentrySpan.js.map +1 -1
  245. package/build/cjs/tracing/spans/beforeSendSpan.js +4 -32
  246. package/build/cjs/tracing/spans/beforeSendSpan.js.map +1 -1
  247. package/build/cjs/tracing/spans/captureSpan.js +63 -165
  248. package/build/cjs/tracing/spans/captureSpan.js.map +1 -1
  249. package/build/cjs/tracing/spans/envelope.js +12 -24
  250. package/build/cjs/tracing/spans/envelope.js.map +1 -1
  251. package/build/cjs/tracing/spans/estimateSize.js +0 -22
  252. package/build/cjs/tracing/spans/estimateSize.js.map +1 -1
  253. package/build/cjs/tracing/spans/extractGenAiSpans.js +11 -33
  254. package/build/cjs/tracing/spans/extractGenAiSpans.js.map +1 -1
  255. package/build/cjs/tracing/spans/hasSpanStreamingEnabled.js +1 -4
  256. package/build/cjs/tracing/spans/hasSpanStreamingEnabled.js.map +1 -1
  257. package/build/cjs/tracing/spans/scopeContextAttributes.js +58 -0
  258. package/build/cjs/tracing/spans/scopeContextAttributes.js.map +1 -0
  259. package/build/cjs/tracing/spans/spanBuffer.js +21 -71
  260. package/build/cjs/tracing/spans/spanBuffer.js.map +1 -1
  261. package/build/cjs/tracing/spans/spanJsonToStreamedSpan.js +4 -8
  262. package/build/cjs/tracing/spans/spanJsonToStreamedSpan.js.map +1 -1
  263. package/build/cjs/tracing/spanstatus.js +15 -32
  264. package/build/cjs/tracing/spanstatus.js.map +1 -1
  265. package/build/cjs/tracing/trace.js +95 -311
  266. package/build/cjs/tracing/trace.js.map +1 -1
  267. package/build/cjs/tracing/utils.js +4 -14
  268. package/build/cjs/tracing/utils.js.map +1 -1
  269. package/build/cjs/tracing/vercel-ai/constants.js +15 -26
  270. package/build/cjs/tracing/vercel-ai/constants.js.map +1 -1
  271. package/build/cjs/tracing/vercel-ai/index.js +84 -288
  272. package/build/cjs/tracing/vercel-ai/index.js.map +1 -1
  273. package/build/cjs/tracing/vercel-ai/utils.js +30 -128
  274. package/build/cjs/tracing/vercel-ai/utils.js.map +1 -1
  275. package/build/cjs/tracing/vercel-ai/vercel-ai-attributes.js +22 -229
  276. package/build/cjs/tracing/vercel-ai/vercel-ai-attributes.js.map +1 -1
  277. package/build/cjs/transports/base.js +32 -67
  278. package/build/cjs/transports/base.js.map +1 -1
  279. package/build/cjs/transports/multiplexed.js +38 -103
  280. package/build/cjs/transports/multiplexed.js.map +1 -1
  281. package/build/cjs/transports/offline.js +31 -72
  282. package/build/cjs/transports/offline.js.map +1 -1
  283. package/build/cjs/transports/userAgent.js +4 -13
  284. package/build/cjs/transports/userAgent.js.map +1 -1
  285. package/build/cjs/trpc.js +19 -39
  286. package/build/cjs/trpc.js.map +1 -1
  287. package/build/cjs/utils/aggregate-errors.js +18 -62
  288. package/build/cjs/utils/aggregate-errors.js.map +1 -1
  289. package/build/cjs/utils/ai/providerSkip.js +3 -50
  290. package/build/cjs/utils/ai/providerSkip.js.map +1 -1
  291. package/build/cjs/utils/anr.js +7 -36
  292. package/build/cjs/utils/anr.js.map +1 -1
  293. package/build/cjs/utils/baggage.js +37 -146
  294. package/build/cjs/utils/baggage.js.map +1 -1
  295. package/build/cjs/utils/breadcrumb-log-level.js +5 -9
  296. package/build/cjs/utils/breadcrumb-log-level.js.map +1 -1
  297. package/build/cjs/utils/browser.js +24 -86
  298. package/build/cjs/utils/browser.js.map +1 -1
  299. package/build/cjs/utils/chain-and-copy-promiselike.js +10 -27
  300. package/build/cjs/utils/chain-and-copy-promiselike.js.map +1 -1
  301. package/build/cjs/utils/clientreport.js +4 -13
  302. package/build/cjs/utils/clientreport.js.map +1 -1
  303. package/build/cjs/utils/cookie.js +6 -53
  304. package/build/cjs/utils/cookie.js.map +1 -1
  305. package/build/cjs/utils/data-collection/defaultPiiToCollectionOptions.js +28 -0
  306. package/build/cjs/utils/data-collection/defaultPiiToCollectionOptions.js.map +1 -0
  307. package/build/cjs/utils/data-collection/filterCookies.js +23 -0
  308. package/build/cjs/utils/data-collection/filterCookies.js.map +1 -0
  309. package/build/cjs/utils/data-collection/filterKeyValueData.js +43 -0
  310. package/build/cjs/utils/data-collection/filterKeyValueData.js.map +1 -0
  311. package/build/cjs/utils/data-collection/filterQueryParams.js +26 -0
  312. package/build/cjs/utils/data-collection/filterQueryParams.js.map +1 -0
  313. package/build/cjs/utils/data-collection/filtering-snippets.js +61 -0
  314. package/build/cjs/utils/data-collection/filtering-snippets.js.map +1 -0
  315. package/build/cjs/utils/data-collection/resolveDataCollectionOptions.js +37 -0
  316. package/build/cjs/utils/data-collection/resolveDataCollectionOptions.js.map +1 -0
  317. package/build/cjs/utils/debounce.js +5 -32
  318. package/build/cjs/utils/debounce.js.map +1 -1
  319. package/build/cjs/utils/debug-ids.js +4 -42
  320. package/build/cjs/utils/debug-ids.js.map +1 -1
  321. package/build/cjs/utils/debug-logger.js +23 -56
  322. package/build/cjs/utils/debug-logger.js.map +1 -1
  323. package/build/cjs/utils/dsn.js +18 -81
  324. package/build/cjs/utils/dsn.js.map +1 -1
  325. package/build/cjs/utils/env.js +3 -27
  326. package/build/cjs/utils/env.js.map +1 -1
  327. package/build/cjs/utils/envToBool.js +2 -15
  328. package/build/cjs/utils/envToBool.js.map +1 -1
  329. package/build/cjs/utils/envelope.js +39 -133
  330. package/build/cjs/utils/envelope.js.map +1 -1
  331. package/build/cjs/utils/error.js +3 -10
  332. package/build/cjs/utils/error.js.map +1 -1
  333. package/build/cjs/utils/eventUtils.js +0 -8
  334. package/build/cjs/utils/eventUtils.js.map +1 -1
  335. package/build/cjs/utils/eventbuilder.js +30 -114
  336. package/build/cjs/utils/eventbuilder.js.map +1 -1
  337. package/build/cjs/utils/exports.js +5 -24
  338. package/build/cjs/utils/exports.js.map +1 -1
  339. package/build/cjs/utils/featureFlags.js +10 -96
  340. package/build/cjs/utils/featureFlags.js.map +1 -1
  341. package/build/cjs/utils/flushIfServerless.js +14 -48
  342. package/build/cjs/utils/flushIfServerless.js.map +1 -1
  343. package/build/cjs/utils/get-default-export.js +1 -25
  344. package/build/cjs/utils/get-default-export.js.map +1 -1
  345. package/build/cjs/utils/handleCallbackErrors.js +10 -48
  346. package/build/cjs/utils/handleCallbackErrors.js.map +1 -1
  347. package/build/cjs/utils/hasSpansEnabled.js +4 -28
  348. package/build/cjs/utils/hasSpansEnabled.js.map +1 -1
  349. package/build/cjs/utils/ipAddress.js +7 -19
  350. package/build/cjs/utils/ipAddress.js.map +1 -1
  351. package/build/cjs/utils/is.js +18 -163
  352. package/build/cjs/utils/is.js.map +1 -1
  353. package/build/cjs/utils/isBrowser.js +3 -9
  354. package/build/cjs/utils/isBrowser.js.map +1 -1
  355. package/build/cjs/utils/isSentryRequestUrl.js +2 -19
  356. package/build/cjs/utils/isSentryRequestUrl.js.map +1 -1
  357. package/build/cjs/utils/lru.js +13 -24
  358. package/build/cjs/utils/lru.js.map +1 -1
  359. package/build/cjs/utils/merge.js +1 -17
  360. package/build/cjs/utils/merge.js.map +1 -1
  361. package/build/cjs/utils/meta.js +1 -24
  362. package/build/cjs/utils/meta.js.map +1 -1
  363. package/build/cjs/utils/misc.js +31 -134
  364. package/build/cjs/utils/misc.js.map +1 -1
  365. package/build/cjs/utils/node-stack-trace.js +22 -61
  366. package/build/cjs/utils/node-stack-trace.js.map +1 -1
  367. package/build/cjs/utils/node.js +3 -48
  368. package/build/cjs/utils/node.js.map +1 -1
  369. package/build/cjs/utils/normalizationHints.js +5 -18
  370. package/build/cjs/utils/normalizationHints.js.map +1 -1
  371. package/build/cjs/utils/normalize.js +39 -205
  372. package/build/cjs/utils/normalize.js.map +1 -1
  373. package/build/cjs/utils/object.js +33 -168
  374. package/build/cjs/utils/object.js.map +1 -1
  375. package/build/cjs/utils/parameterize.js +2 -21
  376. package/build/cjs/utils/parameterize.js.map +1 -1
  377. package/build/cjs/utils/parseSampleRate.js +4 -13
  378. package/build/cjs/utils/parseSampleRate.js.map +1 -1
  379. package/build/cjs/utils/path.js +28 -115
  380. package/build/cjs/utils/path.js.map +1 -1
  381. package/build/cjs/utils/prepareEvent.js +53 -191
  382. package/build/cjs/utils/prepareEvent.js.map +1 -1
  383. package/build/cjs/utils/promisebuffer.js +5 -47
  384. package/build/cjs/utils/promisebuffer.js.map +1 -1
  385. package/build/cjs/utils/propagationContext.js +0 -7
  386. package/build/cjs/utils/propagationContext.js.map +1 -1
  387. package/build/cjs/utils/randomSafeContext.js +3 -22
  388. package/build/cjs/utils/randomSafeContext.js.map +1 -1
  389. package/build/cjs/utils/ratelimit.js +13 -66
  390. package/build/cjs/utils/ratelimit.js.map +1 -1
  391. package/build/cjs/utils/request.js +62 -269
  392. package/build/cjs/utils/request.js.map +1 -1
  393. package/build/cjs/utils/scopeData.js +15 -79
  394. package/build/cjs/utils/scopeData.js.map +1 -1
  395. package/build/cjs/utils/sdkMetadata.js +5 -19
  396. package/build/cjs/utils/sdkMetadata.js.map +1 -1
  397. package/build/cjs/utils/severity.js +1 -9
  398. package/build/cjs/utils/severity.js.map +1 -1
  399. package/build/cjs/utils/should-ignore-span.js +6 -38
  400. package/build/cjs/utils/should-ignore-span.js.map +1 -1
  401. package/build/cjs/utils/spanOnScope.js +3 -14
  402. package/build/cjs/utils/spanOnScope.js.map +1 -1
  403. package/build/cjs/utils/spanUtils.js +42 -222
  404. package/build/cjs/utils/spanUtils.js.map +1 -1
  405. package/build/cjs/utils/stacktrace.js +19 -106
  406. package/build/cjs/utils/stacktrace.js.map +1 -1
  407. package/build/cjs/utils/string.js +7 -75
  408. package/build/cjs/utils/string.js.map +1 -1
  409. package/build/cjs/utils/supports.js +14 -99
  410. package/build/cjs/utils/supports.js.map +1 -1
  411. package/build/cjs/utils/syncpromise.js +19 -68
  412. package/build/cjs/utils/syncpromise.js.map +1 -1
  413. package/build/cjs/utils/time.js +7 -84
  414. package/build/cjs/utils/time.js.map +1 -1
  415. package/build/cjs/utils/timer.js +1 -10
  416. package/build/cjs/utils/timer.js.map +1 -1
  417. package/build/cjs/utils/timestampSequence.js +5 -21
  418. package/build/cjs/utils/timestampSequence.js.map +1 -1
  419. package/build/cjs/utils/trace-info.js +3 -10
  420. package/build/cjs/utils/trace-info.js.map +1 -1
  421. package/build/cjs/utils/traceData.js +4 -39
  422. package/build/cjs/utils/traceData.js.map +1 -1
  423. package/build/cjs/utils/tracePropagationTargets.js +4 -18
  424. package/build/cjs/utils/tracePropagationTargets.js.map +1 -1
  425. package/build/cjs/utils/tracing.js +32 -106
  426. package/build/cjs/utils/tracing.js.map +1 -1
  427. package/build/cjs/utils/transactionEvent.js +11 -19
  428. package/build/cjs/utils/transactionEvent.js.map +1 -1
  429. package/build/cjs/utils/tunnel.js +12 -33
  430. package/build/cjs/utils/tunnel.js.map +1 -1
  431. package/build/cjs/utils/url.js +42 -176
  432. package/build/cjs/utils/url.js.map +1 -1
  433. package/build/cjs/utils/vercelWaitUntil.js +4 -12
  434. package/build/cjs/utils/vercelWaitUntil.js.map +1 -1
  435. package/build/cjs/utils/version.js +1 -3
  436. package/build/cjs/utils/version.js.map +1 -1
  437. package/build/cjs/utils/weakRef.js +5 -36
  438. package/build/cjs/utils/weakRef.js.map +1 -1
  439. package/build/cjs/utils/worldwide.js +1 -4
  440. package/build/cjs/utils/worldwide.js.map +1 -1
  441. package/build/cjs/vendor/escapeStringForRegex.js +1 -32
  442. package/build/cjs/vendor/escapeStringForRegex.js.map +1 -1
  443. package/build/cjs/vendor/getIpAddress.js +19 -99
  444. package/build/cjs/vendor/getIpAddress.js.map +1 -1
  445. package/build/esm/api.js +10 -34
  446. package/build/esm/api.js.map +1 -1
  447. package/build/esm/asyncContext/index.js +0 -14
  448. package/build/esm/asyncContext/index.js.map +1 -1
  449. package/build/esm/asyncContext/stackStrategy.js +16 -47
  450. package/build/esm/asyncContext/stackStrategy.js.map +1 -1
  451. package/build/esm/attributes.js +17 -95
  452. package/build/esm/attributes.js.map +1 -1
  453. package/build/esm/breadcrumbs.js +2 -22
  454. package/build/esm/breadcrumbs.js.map +1 -1
  455. package/build/esm/browser.js +5 -1
  456. package/build/esm/browser.js.map +1 -1
  457. package/build/esm/carrier.js +5 -42
  458. package/build/esm/carrier.js.map +1 -1
  459. package/build/esm/checkin.js +5 -19
  460. package/build/esm/checkin.js.map +1 -1
  461. package/build/esm/client.js +216 -585
  462. package/build/esm/client.js.map +1 -1
  463. package/build/esm/constants.js +2 -2
  464. package/build/esm/currentScopes.js +5 -86
  465. package/build/esm/currentScopes.js.map +1 -1
  466. package/build/esm/debug-build.js +0 -5
  467. package/build/esm/debug-build.js.map +1 -1
  468. package/build/esm/defaultScopes.js +2 -5
  469. package/build/esm/defaultScopes.js.map +1 -1
  470. package/build/esm/envelope.js +32 -103
  471. package/build/esm/envelope.js.map +1 -1
  472. package/build/esm/eventProcessors.js +4 -23
  473. package/build/esm/eventProcessors.js.map +1 -1
  474. package/build/esm/exports.js +21 -197
  475. package/build/esm/exports.js.map +1 -1
  476. package/build/esm/feedback.js +7 -19
  477. package/build/esm/feedback.js.map +1 -1
  478. package/build/esm/fetch.js +66 -201
  479. package/build/esm/fetch.js.map +1 -1
  480. package/build/esm/index.js +7 -1
  481. package/build/esm/index.js.map +1 -1
  482. package/build/esm/instrument/console.js +9 -41
  483. package/build/esm/instrument/console.js.map +1 -1
  484. package/build/esm/instrument/fetch.js +47 -156
  485. package/build/esm/instrument/fetch.js.map +1 -1
  486. package/build/esm/instrument/globalError.js +4 -25
  487. package/build/esm/instrument/globalError.js.map +1 -1
  488. package/build/esm/instrument/globalUnhandledRejection.js +4 -21
  489. package/build/esm/instrument/globalUnhandledRejection.js.map +1 -1
  490. package/build/esm/instrument/handlers.js +9 -21
  491. package/build/esm/instrument/handlers.js.map +1 -1
  492. package/build/esm/integration.js +13 -77
  493. package/build/esm/integration.js.map +1 -1
  494. package/build/esm/integrations/captureconsole.js +16 -40
  495. package/build/esm/integrations/captureconsole.js.map +1 -1
  496. package/build/esm/integrations/consola.js +57 -163
  497. package/build/esm/integrations/consola.js.map +1 -1
  498. package/build/esm/integrations/console.js +11 -43
  499. package/build/esm/integrations/console.js.map +1 -1
  500. package/build/esm/integrations/conversationId.js +5 -22
  501. package/build/esm/integrations/conversationId.js.map +1 -1
  502. package/build/esm/integrations/dedupe.js +16 -74
  503. package/build/esm/integrations/dedupe.js.map +1 -1
  504. package/build/esm/integrations/eventFilters.js +63 -114
  505. package/build/esm/integrations/eventFilters.js.map +1 -1
  506. package/build/esm/integrations/express/index.js +30 -145
  507. package/build/esm/integrations/express/index.js.map +1 -1
  508. package/build/esm/integrations/express/patch-layer.js +20 -130
  509. package/build/esm/integrations/express/patch-layer.js.map +1 -1
  510. package/build/esm/integrations/express/request-layer-store.js +1 -3
  511. package/build/esm/integrations/express/request-layer-store.js.map +1 -1
  512. package/build/esm/integrations/express/set-sdk-processing-metadata.js +0 -2
  513. package/build/esm/integrations/express/set-sdk-processing-metadata.js.map +1 -1
  514. package/build/esm/integrations/express/types.js +6 -7
  515. package/build/esm/integrations/express/types.js.map +1 -1
  516. package/build/esm/integrations/express/utils.js +37 -145
  517. package/build/esm/integrations/express/utils.js.map +1 -1
  518. package/build/esm/integrations/extraerrordata.js +24 -69
  519. package/build/esm/integrations/extraerrordata.js.map +1 -1
  520. package/build/esm/integrations/featureFlags/featureFlagsIntegration.js +3 -29
  521. package/build/esm/integrations/featureFlags/featureFlagsIntegration.js.map +1 -1
  522. package/build/esm/integrations/featureFlags/growthbook.js +11 -40
  523. package/build/esm/integrations/featureFlags/growthbook.js.map +1 -1
  524. package/build/esm/integrations/functiontostring.js +6 -27
  525. package/build/esm/integrations/functiontostring.js.map +1 -1
  526. package/build/esm/integrations/http/add-outgoing-request-breadcrumb.js +10 -18
  527. package/build/esm/integrations/http/add-outgoing-request-breadcrumb.js.map +1 -1
  528. package/build/esm/integrations/http/client-patch.js +8 -70
  529. package/build/esm/integrations/http/client-patch.js.map +1 -1
  530. package/build/esm/integrations/http/client-subscriptions.js +22 -59
  531. package/build/esm/integrations/http/client-subscriptions.js.map +1 -1
  532. package/build/esm/integrations/http/constants.js +3 -3
  533. package/build/esm/integrations/http/double-wrap-warning.js +10 -18
  534. package/build/esm/integrations/http/double-wrap-warning.js.map +1 -1
  535. package/build/esm/integrations/http/get-outgoing-span-data.js +30 -47
  536. package/build/esm/integrations/http/get-outgoing-span-data.js.map +1 -1
  537. package/build/esm/integrations/http/get-request-url.js +7 -24
  538. package/build/esm/integrations/http/get-request-url.js.map +1 -1
  539. package/build/esm/integrations/http/inject-trace-propagation-headers.js +14 -38
  540. package/build/esm/integrations/http/inject-trace-propagation-headers.js.map +1 -1
  541. package/build/esm/integrations/http/patch-request-to-capture-body.js +78 -0
  542. package/build/esm/integrations/http/patch-request-to-capture-body.js.map +1 -0
  543. package/build/esm/integrations/http/record-request-session.js +59 -0
  544. package/build/esm/integrations/http/record-request-session.js.map +1 -0
  545. package/build/esm/integrations/http/server-subscription.js +285 -0
  546. package/build/esm/integrations/http/server-subscription.js.map +1 -0
  547. package/build/esm/integrations/linkederrors.js +6 -11
  548. package/build/esm/integrations/linkederrors.js.map +1 -1
  549. package/build/esm/integrations/mcp-server/attributeExtraction.js +26 -69
  550. package/build/esm/integrations/mcp-server/attributeExtraction.js.map +1 -1
  551. package/build/esm/integrations/mcp-server/attributes.js +30 -138
  552. package/build/esm/integrations/mcp-server/attributes.js.map +1 -1
  553. package/build/esm/integrations/mcp-server/correlation.js +20 -91
  554. package/build/esm/integrations/mcp-server/correlation.js.map +1 -1
  555. package/build/esm/integrations/mcp-server/errorCapture.js +6 -25
  556. package/build/esm/integrations/mcp-server/errorCapture.js.map +1 -1
  557. package/build/esm/integrations/mcp-server/handlers.js +55 -169
  558. package/build/esm/integrations/mcp-server/handlers.js.map +1 -1
  559. package/build/esm/integrations/mcp-server/index.js +7 -60
  560. package/build/esm/integrations/mcp-server/index.js.map +1 -1
  561. package/build/esm/integrations/mcp-server/methodConfig.js +21 -59
  562. package/build/esm/integrations/mcp-server/methodConfig.js.map +1 -1
  563. package/build/esm/integrations/mcp-server/piiFiltering.js +5 -33
  564. package/build/esm/integrations/mcp-server/piiFiltering.js.map +1 -1
  565. package/build/esm/integrations/mcp-server/resultExtraction.js +20 -76
  566. package/build/esm/integrations/mcp-server/resultExtraction.js.map +1 -1
  567. package/build/esm/integrations/mcp-server/sessionExtraction.js +30 -121
  568. package/build/esm/integrations/mcp-server/sessionExtraction.js.map +1 -1
  569. package/build/esm/integrations/mcp-server/sessionManagement.js +2 -60
  570. package/build/esm/integrations/mcp-server/sessionManagement.js.map +1 -1
  571. package/build/esm/integrations/mcp-server/spans.js +20 -107
  572. package/build/esm/integrations/mcp-server/spans.js.map +1 -1
  573. package/build/esm/integrations/mcp-server/transport.js +26 -94
  574. package/build/esm/integrations/mcp-server/transport.js.map +1 -1
  575. package/build/esm/integrations/mcp-server/validation.js +6 -72
  576. package/build/esm/integrations/mcp-server/validation.js.map +1 -1
  577. package/build/esm/integrations/moduleMetadata.js +6 -20
  578. package/build/esm/integrations/moduleMetadata.js.map +1 -1
  579. package/build/esm/integrations/postgresjs.js +78 -287
  580. package/build/esm/integrations/postgresjs.js.map +1 -1
  581. package/build/esm/integrations/requestdata.js +30 -93
  582. package/build/esm/integrations/requestdata.js.map +1 -1
  583. package/build/esm/integrations/rewriteframes.js +14 -45
  584. package/build/esm/integrations/rewriteframes.js.map +1 -1
  585. package/build/esm/integrations/spanStreaming.js +9 -15
  586. package/build/esm/integrations/spanStreaming.js.map +1 -1
  587. package/build/esm/integrations/supabase.js +224 -333
  588. package/build/esm/integrations/supabase.js.map +1 -1
  589. package/build/esm/integrations/third-party-errors-filter.js +60 -85
  590. package/build/esm/integrations/third-party-errors-filter.js.map +1 -1
  591. package/build/esm/integrations/zoderrors.js +35 -111
  592. package/build/esm/integrations/zoderrors.js.map +1 -1
  593. package/build/esm/logs/console-integration.js +15 -50
  594. package/build/esm/logs/console-integration.js.map +1 -1
  595. package/build/esm/logs/constants.js +1 -6
  596. package/build/esm/logs/constants.js.map +1 -1
  597. package/build/esm/logs/envelope.js +10 -40
  598. package/build/esm/logs/envelope.js.map +1 -1
  599. package/build/esm/logs/internal.js +53 -126
  600. package/build/esm/logs/internal.js.map +1 -1
  601. package/build/esm/logs/public-api.js +13 -228
  602. package/build/esm/logs/public-api.js.map +1 -1
  603. package/build/esm/logs/utils.js +6 -47
  604. package/build/esm/logs/utils.js.map +1 -1
  605. package/build/esm/metadata.js +6 -51
  606. package/build/esm/metadata.js.map +1 -1
  607. package/build/esm/metrics/envelope.js +12 -45
  608. package/build/esm/metrics/envelope.js.map +1 -1
  609. package/build/esm/metrics/internal.js +31 -144
  610. package/build/esm/metrics/internal.js.map +1 -1
  611. package/build/esm/metrics/public-api.js +4 -109
  612. package/build/esm/metrics/public-api.js.map +1 -1
  613. package/build/esm/package.json +1 -1
  614. package/build/esm/profiling.js +11 -41
  615. package/build/esm/profiling.js.map +1 -1
  616. package/build/esm/scope.js +73 -224
  617. package/build/esm/scope.js.map +1 -1
  618. package/build/esm/sdk.js +2 -21
  619. package/build/esm/sdk.js.map +1 -1
  620. package/build/esm/semanticAttributes.js +31 -118
  621. package/build/esm/semanticAttributes.js.map +1 -1
  622. package/build/esm/server-runtime-client.js +32 -87
  623. package/build/esm/server-runtime-client.js.map +1 -1
  624. package/build/esm/server.js +7 -1
  625. package/build/esm/server.js.map +1 -1
  626. package/build/esm/session.js +14 -67
  627. package/build/esm/session.js.map +1 -1
  628. package/build/esm/tracing/ai/gen-ai-attributes.js +45 -249
  629. package/build/esm/tracing/ai/gen-ai-attributes.js.map +1 -1
  630. package/build/esm/tracing/ai/mediaStripping.js +21 -116
  631. package/build/esm/tracing/ai/mediaStripping.js.map +1 -1
  632. package/build/esm/tracing/ai/messageTruncation.js +26 -212
  633. package/build/esm/tracing/ai/messageTruncation.js.map +1 -1
  634. package/build/esm/tracing/ai/utils.js +40 -180
  635. package/build/esm/tracing/ai/utils.js.map +1 -1
  636. package/build/esm/tracing/anthropic-ai/constants.js +9 -12
  637. package/build/esm/tracing/anthropic-ai/constants.js.map +1 -1
  638. package/build/esm/tracing/anthropic-ai/index.js +67 -172
  639. package/build/esm/tracing/anthropic-ai/index.js.map +1 -1
  640. package/build/esm/tracing/anthropic-ai/streaming.js +45 -149
  641. package/build/esm/tracing/anthropic-ai/streaming.js.map +1 -1
  642. package/build/esm/tracing/anthropic-ai/utils.js +17 -47
  643. package/build/esm/tracing/anthropic-ai/utils.js.map +1 -1
  644. package/build/esm/tracing/dynamicSamplingContext.js +18 -85
  645. package/build/esm/tracing/dynamicSamplingContext.js.map +1 -1
  646. package/build/esm/tracing/errors.js +2 -14
  647. package/build/esm/tracing/errors.js.map +1 -1
  648. package/build/esm/tracing/google-genai/constants.js +9 -16
  649. package/build/esm/tracing/google-genai/constants.js.map +1 -1
  650. package/build/esm/tracing/google-genai/index.js +79 -223
  651. package/build/esm/tracing/google-genai/index.js.map +1 -1
  652. package/build/esm/tracing/google-genai/streaming.js +11 -56
  653. package/build/esm/tracing/google-genai/streaming.js.map +1 -1
  654. package/build/esm/tracing/google-genai/utils.js +8 -13
  655. package/build/esm/tracing/google-genai/utils.js.map +1 -1
  656. package/build/esm/tracing/idleSpan.js +48 -174
  657. package/build/esm/tracing/idleSpan.js.map +1 -1
  658. package/build/esm/tracing/langchain/constants.js +8 -9
  659. package/build/esm/tracing/langchain/constants.js.map +1 -1
  660. package/build/esm/tracing/langchain/embeddings.js +31 -75
  661. package/build/esm/tracing/langchain/embeddings.js.map +1 -1
  662. package/build/esm/tracing/langchain/index.js +64 -161
  663. package/build/esm/tracing/langchain/index.js.map +1 -1
  664. package/build/esm/tracing/langchain/utils.js +101 -312
  665. package/build/esm/tracing/langchain/utils.js.map +1 -1
  666. package/build/esm/tracing/langgraph/constants.js +2 -2
  667. package/build/esm/tracing/langgraph/index.js +59 -162
  668. package/build/esm/tracing/langgraph/index.js.map +1 -1
  669. package/build/esm/tracing/langgraph/utils.js +54 -170
  670. package/build/esm/tracing/langgraph/utils.js.map +1 -1
  671. package/build/esm/tracing/logSpans.js +10 -26
  672. package/build/esm/tracing/logSpans.js.map +1 -1
  673. package/build/esm/tracing/measurement.js +6 -18
  674. package/build/esm/tracing/measurement.js.map +1 -1
  675. package/build/esm/tracing/openai/constants.js +20 -24
  676. package/build/esm/tracing/openai/constants.js.map +1 -1
  677. package/build/esm/tracing/openai/index.js +52 -132
  678. package/build/esm/tracing/openai/index.js.map +1 -1
  679. package/build/esm/tracing/openai/streaming.js +24 -102
  680. package/build/esm/tracing/openai/streaming.js.map +1 -1
  681. package/build/esm/tracing/openai/utils.js +36 -107
  682. package/build/esm/tracing/openai/utils.js.map +1 -1
  683. package/build/esm/tracing/sampling.js +23 -63
  684. package/build/esm/tracing/sampling.js.map +1 -1
  685. package/build/esm/tracing/sentryNonRecordingSpan.js +15 -40
  686. package/build/esm/tracing/sentryNonRecordingSpan.js.map +1 -1
  687. package/build/esm/tracing/sentrySpan.js +66 -172
  688. package/build/esm/tracing/sentrySpan.js.map +1 -1
  689. package/build/esm/tracing/spans/beforeSendSpan.js +4 -32
  690. package/build/esm/tracing/spans/beforeSendSpan.js.map +1 -1
  691. package/build/esm/tracing/spans/captureSpan.js +64 -166
  692. package/build/esm/tracing/spans/captureSpan.js.map +1 -1
  693. package/build/esm/tracing/spans/envelope.js +12 -24
  694. package/build/esm/tracing/spans/envelope.js.map +1 -1
  695. package/build/esm/tracing/spans/estimateSize.js +0 -22
  696. package/build/esm/tracing/spans/estimateSize.js.map +1 -1
  697. package/build/esm/tracing/spans/extractGenAiSpans.js +11 -33
  698. package/build/esm/tracing/spans/extractGenAiSpans.js.map +1 -1
  699. package/build/esm/tracing/spans/hasSpanStreamingEnabled.js +1 -4
  700. package/build/esm/tracing/spans/hasSpanStreamingEnabled.js.map +1 -1
  701. package/build/esm/tracing/spans/scopeContextAttributes.js +56 -0
  702. package/build/esm/tracing/spans/scopeContextAttributes.js.map +1 -0
  703. package/build/esm/tracing/spans/spanBuffer.js +21 -71
  704. package/build/esm/tracing/spans/spanBuffer.js.map +1 -1
  705. package/build/esm/tracing/spans/spanJsonToStreamedSpan.js +4 -8
  706. package/build/esm/tracing/spans/spanJsonToStreamedSpan.js.map +1 -1
  707. package/build/esm/tracing/spanstatus.js +15 -32
  708. package/build/esm/tracing/spanstatus.js.map +1 -1
  709. package/build/esm/tracing/trace.js +95 -311
  710. package/build/esm/tracing/trace.js.map +1 -1
  711. package/build/esm/tracing/utils.js +4 -14
  712. package/build/esm/tracing/utils.js.map +1 -1
  713. package/build/esm/tracing/vercel-ai/constants.js +15 -26
  714. package/build/esm/tracing/vercel-ai/constants.js.map +1 -1
  715. package/build/esm/tracing/vercel-ai/index.js +84 -288
  716. package/build/esm/tracing/vercel-ai/index.js.map +1 -1
  717. package/build/esm/tracing/vercel-ai/utils.js +30 -128
  718. package/build/esm/tracing/vercel-ai/utils.js.map +1 -1
  719. package/build/esm/tracing/vercel-ai/vercel-ai-attributes.js +22 -229
  720. package/build/esm/tracing/vercel-ai/vercel-ai-attributes.js.map +1 -1
  721. package/build/esm/transports/base.js +32 -67
  722. package/build/esm/transports/base.js.map +1 -1
  723. package/build/esm/transports/multiplexed.js +38 -103
  724. package/build/esm/transports/multiplexed.js.map +1 -1
  725. package/build/esm/transports/offline.js +31 -72
  726. package/build/esm/transports/offline.js.map +1 -1
  727. package/build/esm/transports/userAgent.js +4 -13
  728. package/build/esm/transports/userAgent.js.map +1 -1
  729. package/build/esm/trpc.js +19 -39
  730. package/build/esm/trpc.js.map +1 -1
  731. package/build/esm/utils/aggregate-errors.js +18 -62
  732. package/build/esm/utils/aggregate-errors.js.map +1 -1
  733. package/build/esm/utils/ai/providerSkip.js +3 -50
  734. package/build/esm/utils/ai/providerSkip.js.map +1 -1
  735. package/build/esm/utils/anr.js +7 -36
  736. package/build/esm/utils/anr.js.map +1 -1
  737. package/build/esm/utils/baggage.js +37 -146
  738. package/build/esm/utils/baggage.js.map +1 -1
  739. package/build/esm/utils/breadcrumb-log-level.js +5 -9
  740. package/build/esm/utils/breadcrumb-log-level.js.map +1 -1
  741. package/build/esm/utils/browser.js +24 -86
  742. package/build/esm/utils/browser.js.map +1 -1
  743. package/build/esm/utils/chain-and-copy-promiselike.js +10 -27
  744. package/build/esm/utils/chain-and-copy-promiselike.js.map +1 -1
  745. package/build/esm/utils/clientreport.js +4 -13
  746. package/build/esm/utils/clientreport.js.map +1 -1
  747. package/build/esm/utils/cookie.js +6 -53
  748. package/build/esm/utils/cookie.js.map +1 -1
  749. package/build/esm/utils/data-collection/defaultPiiToCollectionOptions.js +26 -0
  750. package/build/esm/utils/data-collection/defaultPiiToCollectionOptions.js.map +1 -0
  751. package/build/esm/utils/data-collection/filterCookies.js +21 -0
  752. package/build/esm/utils/data-collection/filterCookies.js.map +1 -0
  753. package/build/esm/utils/data-collection/filterKeyValueData.js +41 -0
  754. package/build/esm/utils/data-collection/filterKeyValueData.js.map +1 -0
  755. package/build/esm/utils/data-collection/filterQueryParams.js +24 -0
  756. package/build/esm/utils/data-collection/filterQueryParams.js.map +1 -0
  757. package/build/esm/utils/data-collection/filtering-snippets.js +56 -0
  758. package/build/esm/utils/data-collection/filtering-snippets.js.map +1 -0
  759. package/build/esm/utils/data-collection/resolveDataCollectionOptions.js +35 -0
  760. package/build/esm/utils/data-collection/resolveDataCollectionOptions.js.map +1 -0
  761. package/build/esm/utils/debounce.js +5 -32
  762. package/build/esm/utils/debounce.js.map +1 -1
  763. package/build/esm/utils/debug-ids.js +4 -42
  764. package/build/esm/utils/debug-ids.js.map +1 -1
  765. package/build/esm/utils/debug-logger.js +23 -56
  766. package/build/esm/utils/debug-logger.js.map +1 -1
  767. package/build/esm/utils/dsn.js +18 -81
  768. package/build/esm/utils/dsn.js.map +1 -1
  769. package/build/esm/utils/env.js +3 -27
  770. package/build/esm/utils/env.js.map +1 -1
  771. package/build/esm/utils/envToBool.js +2 -15
  772. package/build/esm/utils/envToBool.js.map +1 -1
  773. package/build/esm/utils/envelope.js +39 -133
  774. package/build/esm/utils/envelope.js.map +1 -1
  775. package/build/esm/utils/error.js +3 -10
  776. package/build/esm/utils/error.js.map +1 -1
  777. package/build/esm/utils/eventUtils.js +0 -8
  778. package/build/esm/utils/eventUtils.js.map +1 -1
  779. package/build/esm/utils/eventbuilder.js +30 -114
  780. package/build/esm/utils/eventbuilder.js.map +1 -1
  781. package/build/esm/utils/exports.js +5 -24
  782. package/build/esm/utils/exports.js.map +1 -1
  783. package/build/esm/utils/featureFlags.js +10 -96
  784. package/build/esm/utils/featureFlags.js.map +1 -1
  785. package/build/esm/utils/flushIfServerless.js +14 -48
  786. package/build/esm/utils/flushIfServerless.js.map +1 -1
  787. package/build/esm/utils/get-default-export.js +1 -25
  788. package/build/esm/utils/get-default-export.js.map +1 -1
  789. package/build/esm/utils/handleCallbackErrors.js +10 -48
  790. package/build/esm/utils/handleCallbackErrors.js.map +1 -1
  791. package/build/esm/utils/hasSpansEnabled.js +4 -28
  792. package/build/esm/utils/hasSpansEnabled.js.map +1 -1
  793. package/build/esm/utils/ipAddress.js +7 -19
  794. package/build/esm/utils/ipAddress.js.map +1 -1
  795. package/build/esm/utils/is.js +18 -163
  796. package/build/esm/utils/is.js.map +1 -1
  797. package/build/esm/utils/isBrowser.js +3 -9
  798. package/build/esm/utils/isBrowser.js.map +1 -1
  799. package/build/esm/utils/isSentryRequestUrl.js +2 -19
  800. package/build/esm/utils/isSentryRequestUrl.js.map +1 -1
  801. package/build/esm/utils/lru.js +13 -24
  802. package/build/esm/utils/lru.js.map +1 -1
  803. package/build/esm/utils/merge.js +1 -17
  804. package/build/esm/utils/merge.js.map +1 -1
  805. package/build/esm/utils/meta.js +1 -24
  806. package/build/esm/utils/meta.js.map +1 -1
  807. package/build/esm/utils/misc.js +31 -134
  808. package/build/esm/utils/misc.js.map +1 -1
  809. package/build/esm/utils/node-stack-trace.js +22 -61
  810. package/build/esm/utils/node-stack-trace.js.map +1 -1
  811. package/build/esm/utils/node.js +3 -48
  812. package/build/esm/utils/node.js.map +1 -1
  813. package/build/esm/utils/normalizationHints.js +5 -18
  814. package/build/esm/utils/normalizationHints.js.map +1 -1
  815. package/build/esm/utils/normalize.js +39 -205
  816. package/build/esm/utils/normalize.js.map +1 -1
  817. package/build/esm/utils/object.js +33 -168
  818. package/build/esm/utils/object.js.map +1 -1
  819. package/build/esm/utils/parameterize.js +2 -21
  820. package/build/esm/utils/parameterize.js.map +1 -1
  821. package/build/esm/utils/parseSampleRate.js +4 -13
  822. package/build/esm/utils/parseSampleRate.js.map +1 -1
  823. package/build/esm/utils/path.js +28 -115
  824. package/build/esm/utils/path.js.map +1 -1
  825. package/build/esm/utils/prepareEvent.js +53 -191
  826. package/build/esm/utils/prepareEvent.js.map +1 -1
  827. package/build/esm/utils/promisebuffer.js +5 -47
  828. package/build/esm/utils/promisebuffer.js.map +1 -1
  829. package/build/esm/utils/propagationContext.js +0 -7
  830. package/build/esm/utils/propagationContext.js.map +1 -1
  831. package/build/esm/utils/randomSafeContext.js +3 -22
  832. package/build/esm/utils/randomSafeContext.js.map +1 -1
  833. package/build/esm/utils/ratelimit.js +13 -66
  834. package/build/esm/utils/ratelimit.js.map +1 -1
  835. package/build/esm/utils/request.js +62 -269
  836. package/build/esm/utils/request.js.map +1 -1
  837. package/build/esm/utils/scopeData.js +15 -79
  838. package/build/esm/utils/scopeData.js.map +1 -1
  839. package/build/esm/utils/sdkMetadata.js +5 -19
  840. package/build/esm/utils/sdkMetadata.js.map +1 -1
  841. package/build/esm/utils/severity.js +1 -9
  842. package/build/esm/utils/severity.js.map +1 -1
  843. package/build/esm/utils/should-ignore-span.js +6 -38
  844. package/build/esm/utils/should-ignore-span.js.map +1 -1
  845. package/build/esm/utils/spanOnScope.js +3 -14
  846. package/build/esm/utils/spanOnScope.js.map +1 -1
  847. package/build/esm/utils/spanUtils.js +42 -222
  848. package/build/esm/utils/spanUtils.js.map +1 -1
  849. package/build/esm/utils/stacktrace.js +19 -106
  850. package/build/esm/utils/stacktrace.js.map +1 -1
  851. package/build/esm/utils/string.js +7 -75
  852. package/build/esm/utils/string.js.map +1 -1
  853. package/build/esm/utils/supports.js +14 -99
  854. package/build/esm/utils/supports.js.map +1 -1
  855. package/build/esm/utils/syncpromise.js +19 -68
  856. package/build/esm/utils/syncpromise.js.map +1 -1
  857. package/build/esm/utils/time.js +7 -84
  858. package/build/esm/utils/time.js.map +1 -1
  859. package/build/esm/utils/timer.js +1 -10
  860. package/build/esm/utils/timer.js.map +1 -1
  861. package/build/esm/utils/timestampSequence.js +5 -21
  862. package/build/esm/utils/timestampSequence.js.map +1 -1
  863. package/build/esm/utils/trace-info.js +3 -10
  864. package/build/esm/utils/trace-info.js.map +1 -1
  865. package/build/esm/utils/traceData.js +4 -39
  866. package/build/esm/utils/traceData.js.map +1 -1
  867. package/build/esm/utils/tracePropagationTargets.js +4 -18
  868. package/build/esm/utils/tracePropagationTargets.js.map +1 -1
  869. package/build/esm/utils/tracing.js +32 -106
  870. package/build/esm/utils/tracing.js.map +1 -1
  871. package/build/esm/utils/transactionEvent.js +11 -19
  872. package/build/esm/utils/transactionEvent.js.map +1 -1
  873. package/build/esm/utils/tunnel.js +12 -33
  874. package/build/esm/utils/tunnel.js.map +1 -1
  875. package/build/esm/utils/url.js +42 -176
  876. package/build/esm/utils/url.js.map +1 -1
  877. package/build/esm/utils/vercelWaitUntil.js +4 -12
  878. package/build/esm/utils/vercelWaitUntil.js.map +1 -1
  879. package/build/esm/utils/version.js +1 -3
  880. package/build/esm/utils/version.js.map +1 -1
  881. package/build/esm/utils/weakRef.js +5 -36
  882. package/build/esm/utils/weakRef.js.map +1 -1
  883. package/build/esm/utils/worldwide.js +1 -4
  884. package/build/esm/utils/worldwide.js.map +1 -1
  885. package/build/esm/vendor/escapeStringForRegex.js +1 -32
  886. package/build/esm/vendor/escapeStringForRegex.js.map +1 -1
  887. package/build/esm/vendor/getIpAddress.js +19 -99
  888. package/build/esm/vendor/getIpAddress.js.map +1 -1
  889. package/build/types/api.d.ts +2 -2
  890. package/build/types/api.d.ts.map +1 -1
  891. package/build/types/attributes.d.ts +5 -8
  892. package/build/types/attributes.d.ts.map +1 -1
  893. package/build/types/breadcrumbs.d.ts +1 -1
  894. package/build/types/breadcrumbs.d.ts.map +1 -1
  895. package/build/types/browser-exports.d.ts +3 -3
  896. package/build/types/browser-exports.d.ts.map +1 -1
  897. package/build/types/carrier.d.ts +2 -2
  898. package/build/types/carrier.d.ts.map +1 -1
  899. package/build/types/checkin.d.ts +4 -4
  900. package/build/types/checkin.d.ts.map +1 -1
  901. package/build/types/client.d.ts +32 -22
  902. package/build/types/client.d.ts.map +1 -1
  903. package/build/types/currentScopes.d.ts +1 -1
  904. package/build/types/currentScopes.d.ts.map +1 -1
  905. package/build/types/envelope.d.ts +7 -7
  906. package/build/types/envelope.d.ts.map +1 -1
  907. package/build/types/eventProcessors.d.ts +2 -2
  908. package/build/types/eventProcessors.d.ts.map +1 -1
  909. package/build/types/exports.d.ts +8 -8
  910. package/build/types/exports.d.ts.map +1 -1
  911. package/build/types/feedback.d.ts +2 -2
  912. package/build/types/feedback.d.ts.map +1 -1
  913. package/build/types/fetch.d.ts +3 -3
  914. package/build/types/fetch.d.ts.map +1 -1
  915. package/build/types/instrument/console.d.ts +1 -1
  916. package/build/types/instrument/console.d.ts.map +1 -1
  917. package/build/types/instrument/fetch.d.ts +1 -1
  918. package/build/types/instrument/fetch.d.ts.map +1 -1
  919. package/build/types/instrument/globalError.d.ts +1 -1
  920. package/build/types/instrument/globalError.d.ts.map +1 -1
  921. package/build/types/instrument/globalUnhandledRejection.d.ts +1 -1
  922. package/build/types/instrument/globalUnhandledRejection.d.ts.map +1 -1
  923. package/build/types/integration.d.ts +2 -2
  924. package/build/types/integration.d.ts.map +1 -1
  925. package/build/types/integrations/consola.d.ts +1 -1
  926. package/build/types/integrations/consola.d.ts.map +1 -1
  927. package/build/types/integrations/console.d.ts +1 -1
  928. package/build/types/integrations/console.d.ts.map +1 -1
  929. package/build/types/integrations/dedupe.d.ts +1 -1
  930. package/build/types/integrations/dedupe.d.ts.map +1 -1
  931. package/build/types/integrations/express/types.d.ts +2 -2
  932. package/build/types/integrations/express/types.d.ts.map +1 -1
  933. package/build/types/integrations/express/utils.d.ts +1 -1
  934. package/build/types/integrations/express/utils.d.ts.map +1 -1
  935. package/build/types/integrations/featureFlags/featureFlagsIntegration.d.ts +1 -1
  936. package/build/types/integrations/featureFlags/featureFlagsIntegration.d.ts.map +1 -1
  937. package/build/types/integrations/featureFlags/growthbook.d.ts +1 -1
  938. package/build/types/integrations/featureFlags/growthbook.d.ts.map +1 -1
  939. package/build/types/integrations/http/double-wrap-warning.d.ts +1 -1
  940. package/build/types/integrations/http/double-wrap-warning.d.ts.map +1 -1
  941. package/build/types/integrations/http/get-outgoing-span-data.d.ts +2 -2
  942. package/build/types/integrations/http/get-outgoing-span-data.d.ts.map +1 -1
  943. package/build/types/integrations/http/patch-request-to-capture-body.d.ts +12 -0
  944. package/build/types/integrations/http/patch-request-to-capture-body.d.ts.map +1 -0
  945. package/build/types/integrations/http/record-request-session.d.ts +18 -0
  946. package/build/types/integrations/http/record-request-session.d.ts.map +1 -0
  947. package/build/types/integrations/http/server-subscription.d.ts +26 -0
  948. package/build/types/integrations/http/server-subscription.d.ts.map +1 -0
  949. package/build/types/integrations/http/types.d.ts +12 -6
  950. package/build/types/integrations/http/types.d.ts.map +1 -1
  951. package/build/types/integrations/mcp-server/correlation.d.ts +1 -1
  952. package/build/types/integrations/mcp-server/correlation.d.ts.map +1 -1
  953. package/build/types/integrations/mcp-server/piiFiltering.d.ts +1 -1
  954. package/build/types/integrations/mcp-server/piiFiltering.d.ts.map +1 -1
  955. package/build/types/integrations/mcp-server/types.d.ts +1 -1
  956. package/build/types/integrations/mcp-server/types.d.ts.map +1 -1
  957. package/build/types/integrations/postgresjs.d.ts +1 -1
  958. package/build/types/integrations/postgresjs.d.ts.map +1 -1
  959. package/build/types/integrations/rewriteframes.d.ts +1 -1
  960. package/build/types/integrations/rewriteframes.d.ts.map +1 -1
  961. package/build/types/integrations/supabase.d.ts +14 -3
  962. package/build/types/integrations/supabase.d.ts.map +1 -1
  963. package/build/types/integrations/third-party-errors-filter.d.ts.map +1 -1
  964. package/build/types/integrations/zoderrors.d.ts +1 -1
  965. package/build/types/integrations/zoderrors.d.ts.map +1 -1
  966. package/build/types/logs/console-integration.d.ts +1 -1
  967. package/build/types/logs/console-integration.d.ts.map +1 -1
  968. package/build/types/logs/constants.d.ts +1 -1
  969. package/build/types/logs/constants.d.ts.map +1 -1
  970. package/build/types/logs/envelope.d.ts +4 -4
  971. package/build/types/logs/envelope.d.ts.map +1 -1
  972. package/build/types/logs/internal.d.ts +16 -1
  973. package/build/types/logs/internal.d.ts.map +1 -1
  974. package/build/types/logs/public-api.d.ts +2 -2
  975. package/build/types/logs/public-api.d.ts.map +1 -1
  976. package/build/types/metadata.d.ts +2 -2
  977. package/build/types/metadata.d.ts.map +1 -1
  978. package/build/types/metrics/envelope.d.ts +4 -4
  979. package/build/types/metrics/envelope.d.ts.map +1 -1
  980. package/build/types/metrics/internal.d.ts +1 -1
  981. package/build/types/metrics/internal.d.ts.map +1 -1
  982. package/build/types/metrics/public-api.d.ts +1 -1
  983. package/build/types/metrics/public-api.d.ts.map +1 -1
  984. package/build/types/profiling.d.ts +1 -1
  985. package/build/types/profiling.d.ts.map +1 -1
  986. package/build/types/report-dialog.d.ts +1 -1
  987. package/build/types/report-dialog.d.ts.map +1 -1
  988. package/build/types/scope.d.ts +14 -14
  989. package/build/types/scope.d.ts.map +1 -1
  990. package/build/types/sdk.d.ts +1 -1
  991. package/build/types/sdk.d.ts.map +1 -1
  992. package/build/types/semanticAttributes.d.ts +6 -4
  993. package/build/types/semanticAttributes.d.ts.map +1 -1
  994. package/build/types/server-exports.d.ts +3 -1
  995. package/build/types/server-exports.d.ts.map +1 -1
  996. package/build/types/server-runtime-client.d.ts +6 -6
  997. package/build/types/server-runtime-client.d.ts.map +1 -1
  998. package/build/types/session.d.ts +1 -1
  999. package/build/types/session.d.ts.map +1 -1
  1000. package/build/types/shared-exports.d.ts +58 -53
  1001. package/build/types/shared-exports.d.ts.map +1 -1
  1002. package/build/types/tracing/ai/utils.d.ts +1 -1
  1003. package/build/types/tracing/ai/utils.d.ts.map +1 -1
  1004. package/build/types/tracing/anthropic-ai/streaming.d.ts +1 -1
  1005. package/build/types/tracing/anthropic-ai/streaming.d.ts.map +1 -1
  1006. package/build/types/tracing/anthropic-ai/utils.d.ts +2 -2
  1007. package/build/types/tracing/anthropic-ai/utils.d.ts.map +1 -1
  1008. package/build/types/tracing/dynamicSamplingContext.d.ts +2 -2
  1009. package/build/types/tracing/dynamicSamplingContext.d.ts.map +1 -1
  1010. package/build/types/tracing/google-genai/streaming.d.ts +1 -1
  1011. package/build/types/tracing/google-genai/streaming.d.ts.map +1 -1
  1012. package/build/types/tracing/idleSpan.d.ts +2 -2
  1013. package/build/types/tracing/idleSpan.d.ts.map +1 -1
  1014. package/build/types/tracing/langchain/utils.d.ts +6 -1
  1015. package/build/types/tracing/langchain/utils.d.ts.map +1 -1
  1016. package/build/types/tracing/langgraph/index.d.ts.map +1 -1
  1017. package/build/types/tracing/langgraph/utils.d.ts +1 -3
  1018. package/build/types/tracing/langgraph/utils.d.ts.map +1 -1
  1019. package/build/types/tracing/logSpans.d.ts +1 -1
  1020. package/build/types/tracing/logSpans.d.ts.map +1 -1
  1021. package/build/types/tracing/measurement.d.ts +2 -2
  1022. package/build/types/tracing/measurement.d.ts.map +1 -1
  1023. package/build/types/tracing/openai/streaming.d.ts +1 -1
  1024. package/build/types/tracing/openai/streaming.d.ts.map +1 -1
  1025. package/build/types/tracing/openai/utils.d.ts +1 -1
  1026. package/build/types/tracing/openai/utils.d.ts.map +1 -1
  1027. package/build/types/tracing/sampling.d.ts +2 -2
  1028. package/build/types/tracing/sampling.d.ts.map +1 -1
  1029. package/build/types/tracing/sentryNonRecordingSpan.d.ts +3 -3
  1030. package/build/types/tracing/sentryNonRecordingSpan.d.ts.map +1 -1
  1031. package/build/types/tracing/sentrySpan.d.ts +4 -4
  1032. package/build/types/tracing/sentrySpan.d.ts.map +1 -1
  1033. package/build/types/tracing/spans/beforeSendSpan.d.ts +3 -3
  1034. package/build/types/tracing/spans/beforeSendSpan.d.ts.map +1 -1
  1035. package/build/types/tracing/spans/captureSpan.d.ts +1 -1
  1036. package/build/types/tracing/spans/captureSpan.d.ts.map +1 -1
  1037. package/build/types/tracing/spans/envelope.d.ts +2 -2
  1038. package/build/types/tracing/spans/envelope.d.ts.map +1 -1
  1039. package/build/types/tracing/spans/estimateSize.d.ts +1 -1
  1040. package/build/types/tracing/spans/estimateSize.d.ts.map +1 -1
  1041. package/build/types/tracing/spans/extractGenAiSpans.d.ts +2 -2
  1042. package/build/types/tracing/spans/extractGenAiSpans.d.ts.map +1 -1
  1043. package/build/types/tracing/spans/scopeContextAttributes.d.ts +9 -0
  1044. package/build/types/tracing/spans/scopeContextAttributes.d.ts.map +1 -0
  1045. package/build/types/tracing/spans/spanJsonToStreamedSpan.d.ts +1 -1
  1046. package/build/types/tracing/spans/spanJsonToStreamedSpan.d.ts.map +1 -1
  1047. package/build/types/tracing/spanstatus.d.ts +2 -2
  1048. package/build/types/tracing/spanstatus.d.ts.map +1 -1
  1049. package/build/types/tracing/trace.d.ts +2 -2
  1050. package/build/types/tracing/trace.d.ts.map +1 -1
  1051. package/build/types/tracing/utils.d.ts +1 -1
  1052. package/build/types/tracing/utils.d.ts.map +1 -1
  1053. package/build/types/tracing/vercel-ai/utils.d.ts +2 -2
  1054. package/build/types/tracing/vercel-ai/utils.d.ts.map +1 -1
  1055. package/build/types/transports/base.d.ts +1 -1
  1056. package/build/types/transports/base.d.ts.map +1 -1
  1057. package/build/types/transports/multiplexed.d.ts +3 -3
  1058. package/build/types/transports/multiplexed.d.ts.map +1 -1
  1059. package/build/types/transports/offline.d.ts +2 -2
  1060. package/build/types/transports/offline.d.ts.map +1 -1
  1061. package/build/types/transports/userAgent.d.ts +1 -1
  1062. package/build/types/transports/userAgent.d.ts.map +1 -1
  1063. package/build/types/trpc.d.ts.map +1 -1
  1064. package/build/types/types/attachment.d.ts.map +1 -0
  1065. package/build/types/types/breadcrumb.d.ts.map +1 -0
  1066. package/build/types/types/browseroptions.d.ts.map +1 -0
  1067. package/build/types/types/checkin.d.ts.map +1 -0
  1068. package/build/types/types/clientreport.d.ts.map +1 -0
  1069. package/build/types/types/context.d.ts.map +1 -0
  1070. package/build/types/types/csp.d.ts.map +1 -0
  1071. package/build/types/types/datacategory.d.ts.map +1 -0
  1072. package/build/types/types/datacollection.d.ts +75 -0
  1073. package/build/types/types/datacollection.d.ts.map +1 -0
  1074. package/build/types/types/debugMeta.d.ts.map +1 -0
  1075. package/build/types/types/dsn.d.ts.map +1 -0
  1076. package/build/types/types/envelope.d.ts.map +1 -0
  1077. package/build/types/types/error.d.ts.map +1 -0
  1078. package/build/types/types/event.d.ts.map +1 -0
  1079. package/build/types/types/eventprocessor.d.ts.map +1 -0
  1080. package/build/types/types/exception.d.ts.map +1 -0
  1081. package/build/types/types/extra.d.ts.map +1 -0
  1082. package/build/types/types/feedback/config.d.ts.map +1 -0
  1083. package/build/types/types/feedback/form.d.ts.map +1 -0
  1084. package/build/types/types/feedback/index.d.ts.map +1 -0
  1085. package/build/types/types/feedback/sendFeedback.d.ts.map +1 -0
  1086. package/build/types/types/feedback/theme.d.ts.map +1 -0
  1087. package/build/types/types/instrument.d.ts.map +1 -0
  1088. package/build/types/types/integration.d.ts.map +1 -0
  1089. package/build/types/types/link.d.ts.map +1 -0
  1090. package/build/types/types/log.d.ts.map +1 -0
  1091. package/build/types/types/measurement.d.ts.map +1 -0
  1092. package/build/types/types/mechanism.d.ts.map +1 -0
  1093. package/build/types/types/metric.d.ts.map +1 -0
  1094. package/build/types/types/misc.d.ts.map +1 -0
  1095. package/build/types/types/opentelemetry.d.ts.map +1 -0
  1096. package/build/types/{types-hoist → types}/options.d.ts +17 -0
  1097. package/build/types/types/options.d.ts.map +1 -0
  1098. package/build/types/types/package.d.ts.map +1 -0
  1099. package/build/types/types/parameterize.d.ts.map +1 -0
  1100. package/build/types/types/polymorphics.d.ts.map +1 -0
  1101. package/build/types/types/profiling.d.ts.map +1 -0
  1102. package/build/types/types/replay.d.ts.map +1 -0
  1103. package/build/types/types/request.d.ts.map +1 -0
  1104. package/build/types/types/runtime.d.ts.map +1 -0
  1105. package/build/types/{types-hoist → types}/samplingcontext.d.ts +1 -1
  1106. package/build/types/types/samplingcontext.d.ts.map +1 -0
  1107. package/build/types/types/sdkinfo.d.ts.map +1 -0
  1108. package/build/types/types/sdkmetadata.d.ts.map +1 -0
  1109. package/build/types/types/session.d.ts.map +1 -0
  1110. package/build/types/types/severity.d.ts.map +1 -0
  1111. package/build/types/types/span.d.ts.map +1 -0
  1112. package/build/types/types/spanStatus.d.ts.map +1 -0
  1113. package/build/types/types/stackframe.d.ts.map +1 -0
  1114. package/build/types/types/stacktrace.d.ts.map +1 -0
  1115. package/build/types/{types-hoist → types}/startSpanOptions.d.ts +13 -0
  1116. package/build/types/types/startSpanOptions.d.ts.map +1 -0
  1117. package/build/types/types/thread.d.ts.map +1 -0
  1118. package/build/types/types/timedEvent.d.ts.map +1 -0
  1119. package/build/types/types/tracing.d.ts.map +1 -0
  1120. package/build/types/types/transaction.d.ts.map +1 -0
  1121. package/build/types/types/transport.d.ts.map +1 -0
  1122. package/build/types/types/user.d.ts.map +1 -0
  1123. package/build/types/types/view-hierarchy.d.ts.map +1 -0
  1124. package/build/types/types/vue.d.ts.map +1 -0
  1125. package/build/types/types/webfetchapi.d.ts.map +1 -0
  1126. package/build/types/types/wrappedfunction.d.ts.map +1 -0
  1127. package/build/types/utils/aggregate-errors.d.ts +3 -3
  1128. package/build/types/utils/aggregate-errors.d.ts.map +1 -1
  1129. package/build/types/utils/anr.d.ts +1 -1
  1130. package/build/types/utils/anr.d.ts.map +1 -1
  1131. package/build/types/utils/baggage.d.ts +1 -1
  1132. package/build/types/utils/baggage.d.ts.map +1 -1
  1133. package/build/types/utils/breadcrumb-log-level.d.ts +1 -1
  1134. package/build/types/utils/breadcrumb-log-level.d.ts.map +1 -1
  1135. package/build/types/utils/clientreport.d.ts +2 -2
  1136. package/build/types/utils/clientreport.d.ts.map +1 -1
  1137. package/build/types/utils/data-collection/defaultPiiToCollectionOptions.d.ts +6 -0
  1138. package/build/types/utils/data-collection/defaultPiiToCollectionOptions.d.ts.map +1 -0
  1139. package/build/types/utils/data-collection/filterCookies.d.ts +9 -0
  1140. package/build/types/utils/data-collection/filterCookies.d.ts.map +1 -0
  1141. package/build/types/utils/data-collection/filterKeyValueData.d.ts +11 -0
  1142. package/build/types/utils/data-collection/filterKeyValueData.d.ts.map +1 -0
  1143. package/build/types/utils/data-collection/filterQueryParams.d.ts +9 -0
  1144. package/build/types/utils/data-collection/filterQueryParams.d.ts.map +1 -0
  1145. package/build/types/utils/data-collection/filtering-snippets.d.ts +14 -0
  1146. package/build/types/utils/data-collection/filtering-snippets.d.ts.map +1 -0
  1147. package/build/types/utils/data-collection/resolveDataCollectionOptions.d.ts +14 -0
  1148. package/build/types/utils/data-collection/resolveDataCollectionOptions.d.ts.map +1 -0
  1149. package/build/types/utils/debug-ids.d.ts +2 -2
  1150. package/build/types/utils/debug-ids.d.ts.map +1 -1
  1151. package/build/types/utils/debug-logger.d.ts +1 -1
  1152. package/build/types/utils/debug-logger.d.ts.map +1 -1
  1153. package/build/types/utils/dsn.d.ts +1 -1
  1154. package/build/types/utils/dsn.d.ts.map +1 -1
  1155. package/build/types/utils/env.d.ts.map +1 -1
  1156. package/build/types/utils/envelope.d.ts +8 -8
  1157. package/build/types/utils/envelope.d.ts.map +1 -1
  1158. package/build/types/utils/error.d.ts +1 -1
  1159. package/build/types/utils/error.d.ts.map +1 -1
  1160. package/build/types/utils/eventUtils.d.ts +1 -1
  1161. package/build/types/utils/eventUtils.d.ts.map +1 -1
  1162. package/build/types/utils/eventbuilder.d.ts +6 -6
  1163. package/build/types/utils/eventbuilder.d.ts.map +1 -1
  1164. package/build/types/utils/featureFlags.d.ts +1 -1
  1165. package/build/types/utils/featureFlags.d.ts.map +1 -1
  1166. package/build/types/utils/hasSpansEnabled.d.ts +1 -1
  1167. package/build/types/utils/hasSpansEnabled.d.ts.map +1 -1
  1168. package/build/types/utils/ipAddress.d.ts +2 -2
  1169. package/build/types/utils/ipAddress.d.ts.map +1 -1
  1170. package/build/types/utils/is.d.ts +4 -4
  1171. package/build/types/utils/is.d.ts.map +1 -1
  1172. package/build/types/utils/meta.d.ts +1 -1
  1173. package/build/types/utils/meta.d.ts.map +1 -1
  1174. package/build/types/utils/misc.d.ts +3 -3
  1175. package/build/types/utils/misc.d.ts.map +1 -1
  1176. package/build/types/utils/node-stack-trace.d.ts +1 -1
  1177. package/build/types/utils/node-stack-trace.d.ts.map +1 -1
  1178. package/build/types/utils/object.d.ts +1 -1
  1179. package/build/types/utils/object.d.ts.map +1 -1
  1180. package/build/types/utils/parameterize.d.ts +1 -1
  1181. package/build/types/utils/parameterize.d.ts.map +1 -1
  1182. package/build/types/utils/prepareEvent.d.ts +3 -3
  1183. package/build/types/utils/prepareEvent.d.ts.map +1 -1
  1184. package/build/types/utils/ratelimit.d.ts +2 -2
  1185. package/build/types/utils/ratelimit.d.ts.map +1 -1
  1186. package/build/types/utils/request.d.ts +3 -3
  1187. package/build/types/utils/request.d.ts.map +1 -1
  1188. package/build/types/utils/scopeData.d.ts +1 -1
  1189. package/build/types/utils/scopeData.d.ts.map +1 -1
  1190. package/build/types/utils/sdkMetadata.d.ts +1 -1
  1191. package/build/types/utils/sdkMetadata.d.ts.map +1 -1
  1192. package/build/types/utils/severity.d.ts +1 -1
  1193. package/build/types/utils/severity.d.ts.map +1 -1
  1194. package/build/types/utils/should-ignore-span.d.ts +2 -2
  1195. package/build/types/utils/should-ignore-span.d.ts.map +1 -1
  1196. package/build/types/utils/spanOnScope.d.ts +1 -1
  1197. package/build/types/utils/spanOnScope.d.ts.map +1 -1
  1198. package/build/types/utils/spanUtils.d.ts +4 -4
  1199. package/build/types/utils/spanUtils.d.ts.map +1 -1
  1200. package/build/types/utils/stacktrace.d.ts +4 -4
  1201. package/build/types/utils/stacktrace.d.ts.map +1 -1
  1202. package/build/types/utils/trace-info.d.ts +2 -2
  1203. package/build/types/utils/trace-info.d.ts.map +1 -1
  1204. package/build/types/utils/traceData.d.ts +2 -2
  1205. package/build/types/utils/traceData.d.ts.map +1 -1
  1206. package/build/types/utils/tracePropagationTargets.d.ts +1 -1
  1207. package/build/types/utils/tracePropagationTargets.d.ts.map +1 -1
  1208. package/build/types/utils/tracing.d.ts +2 -2
  1209. package/build/types/utils/tracing.d.ts.map +1 -1
  1210. package/build/types/utils/transactionEvent.d.ts +2 -2
  1211. package/build/types/utils/transactionEvent.d.ts.map +1 -1
  1212. package/build/types/utils/url.d.ts +1 -1
  1213. package/build/types/utils/url.d.ts.map +1 -1
  1214. package/build/types/utils/worldwide.d.ts +1 -0
  1215. package/build/types/utils/worldwide.d.ts.map +1 -1
  1216. package/build/types-ts3.8/api.d.ts +2 -2
  1217. package/build/types-ts3.8/attributes.d.ts +5 -8
  1218. package/build/types-ts3.8/breadcrumbs.d.ts +1 -1
  1219. package/build/types-ts3.8/browser-exports.d.ts +3 -3
  1220. package/build/types-ts3.8/carrier.d.ts +2 -2
  1221. package/build/types-ts3.8/checkin.d.ts +4 -4
  1222. package/build/types-ts3.8/client.d.ts +32 -22
  1223. package/build/types-ts3.8/currentScopes.d.ts +1 -1
  1224. package/build/types-ts3.8/envelope.d.ts +7 -7
  1225. package/build/types-ts3.8/eventProcessors.d.ts +2 -2
  1226. package/build/types-ts3.8/exports.d.ts +8 -8
  1227. package/build/types-ts3.8/feedback.d.ts +2 -2
  1228. package/build/types-ts3.8/fetch.d.ts +3 -3
  1229. package/build/types-ts3.8/instrument/console.d.ts +1 -1
  1230. package/build/types-ts3.8/instrument/fetch.d.ts +1 -1
  1231. package/build/types-ts3.8/instrument/globalError.d.ts +1 -1
  1232. package/build/types-ts3.8/instrument/globalUnhandledRejection.d.ts +1 -1
  1233. package/build/types-ts3.8/integration.d.ts +2 -2
  1234. package/build/types-ts3.8/integrations/consola.d.ts +1 -1
  1235. package/build/types-ts3.8/integrations/console.d.ts +1 -1
  1236. package/build/types-ts3.8/integrations/dedupe.d.ts +1 -1
  1237. package/build/types-ts3.8/integrations/express/types.d.ts +2 -2
  1238. package/build/types-ts3.8/integrations/express/utils.d.ts +1 -1
  1239. package/build/types-ts3.8/integrations/featureFlags/featureFlagsIntegration.d.ts +1 -1
  1240. package/build/types-ts3.8/integrations/featureFlags/growthbook.d.ts +1 -1
  1241. package/build/types-ts3.8/integrations/http/double-wrap-warning.d.ts +1 -1
  1242. package/build/types-ts3.8/integrations/http/get-outgoing-span-data.d.ts +2 -2
  1243. package/build/types-ts3.8/integrations/http/patch-request-to-capture-body.d.ts +12 -0
  1244. package/build/types-ts3.8/integrations/http/record-request-session.d.ts +18 -0
  1245. package/build/types-ts3.8/integrations/http/server-subscription.d.ts +26 -0
  1246. package/build/types-ts3.8/integrations/http/types.d.ts +12 -6
  1247. package/build/types-ts3.8/integrations/mcp-server/correlation.d.ts +1 -1
  1248. package/build/types-ts3.8/integrations/mcp-server/piiFiltering.d.ts +1 -1
  1249. package/build/types-ts3.8/integrations/mcp-server/types.d.ts +1 -1
  1250. package/build/types-ts3.8/integrations/postgresjs.d.ts +1 -1
  1251. package/build/types-ts3.8/integrations/rewriteframes.d.ts +1 -1
  1252. package/build/types-ts3.8/integrations/supabase.d.ts +14 -3
  1253. package/build/types-ts3.8/integrations/zoderrors.d.ts +1 -1
  1254. package/build/types-ts3.8/logs/console-integration.d.ts +1 -1
  1255. package/build/types-ts3.8/logs/constants.d.ts +1 -1
  1256. package/build/types-ts3.8/logs/envelope.d.ts +4 -4
  1257. package/build/types-ts3.8/logs/internal.d.ts +16 -1
  1258. package/build/types-ts3.8/logs/public-api.d.ts +2 -2
  1259. package/build/types-ts3.8/metadata.d.ts +2 -2
  1260. package/build/types-ts3.8/metrics/envelope.d.ts +4 -4
  1261. package/build/types-ts3.8/metrics/internal.d.ts +1 -1
  1262. package/build/types-ts3.8/metrics/public-api.d.ts +1 -1
  1263. package/build/types-ts3.8/profiling.d.ts +1 -1
  1264. package/build/types-ts3.8/report-dialog.d.ts +1 -1
  1265. package/build/types-ts3.8/scope.d.ts +14 -14
  1266. package/build/types-ts3.8/sdk.d.ts +1 -1
  1267. package/build/types-ts3.8/semanticAttributes.d.ts +6 -4
  1268. package/build/types-ts3.8/server-exports.d.ts +3 -1
  1269. package/build/types-ts3.8/server-runtime-client.d.ts +6 -6
  1270. package/build/types-ts3.8/session.d.ts +1 -1
  1271. package/build/types-ts3.8/shared-exports.d.ts +58 -53
  1272. package/build/types-ts3.8/tracing/ai/utils.d.ts +1 -1
  1273. package/build/types-ts3.8/tracing/anthropic-ai/streaming.d.ts +1 -1
  1274. package/build/types-ts3.8/tracing/anthropic-ai/utils.d.ts +2 -2
  1275. package/build/types-ts3.8/tracing/dynamicSamplingContext.d.ts +2 -2
  1276. package/build/types-ts3.8/tracing/google-genai/streaming.d.ts +1 -1
  1277. package/build/types-ts3.8/tracing/idleSpan.d.ts +2 -2
  1278. package/build/types-ts3.8/tracing/langchain/utils.d.ts +6 -1
  1279. package/build/types-ts3.8/tracing/langgraph/utils.d.ts +1 -3
  1280. package/build/types-ts3.8/tracing/logSpans.d.ts +1 -1
  1281. package/build/types-ts3.8/tracing/measurement.d.ts +2 -2
  1282. package/build/types-ts3.8/tracing/openai/streaming.d.ts +1 -1
  1283. package/build/types-ts3.8/tracing/openai/utils.d.ts +1 -1
  1284. package/build/types-ts3.8/tracing/sampling.d.ts +2 -2
  1285. package/build/types-ts3.8/tracing/sentryNonRecordingSpan.d.ts +3 -3
  1286. package/build/types-ts3.8/tracing/sentrySpan.d.ts +4 -4
  1287. package/build/types-ts3.8/tracing/spans/beforeSendSpan.d.ts +3 -3
  1288. package/build/types-ts3.8/tracing/spans/captureSpan.d.ts +1 -1
  1289. package/build/types-ts3.8/tracing/spans/envelope.d.ts +2 -2
  1290. package/build/types-ts3.8/tracing/spans/estimateSize.d.ts +1 -1
  1291. package/build/types-ts3.8/tracing/spans/extractGenAiSpans.d.ts +2 -2
  1292. package/build/types-ts3.8/tracing/spans/scopeContextAttributes.d.ts +9 -0
  1293. package/build/types-ts3.8/tracing/spans/spanJsonToStreamedSpan.d.ts +1 -1
  1294. package/build/types-ts3.8/tracing/spanstatus.d.ts +2 -2
  1295. package/build/types-ts3.8/tracing/trace.d.ts +2 -2
  1296. package/build/types-ts3.8/tracing/utils.d.ts +1 -1
  1297. package/build/types-ts3.8/tracing/vercel-ai/utils.d.ts +2 -2
  1298. package/build/types-ts3.8/transports/base.d.ts +1 -1
  1299. package/build/types-ts3.8/transports/multiplexed.d.ts +3 -3
  1300. package/build/types-ts3.8/transports/offline.d.ts +2 -2
  1301. package/build/types-ts3.8/transports/userAgent.d.ts +1 -1
  1302. package/build/types-ts3.8/types/datacollection.d.ts +75 -0
  1303. package/build/types-ts3.8/{types-hoist → types}/options.d.ts +17 -0
  1304. package/build/types-ts3.8/{types-hoist → types}/samplingcontext.d.ts +1 -1
  1305. package/build/types-ts3.8/{types-hoist → types}/startSpanOptions.d.ts +13 -0
  1306. package/build/types-ts3.8/utils/aggregate-errors.d.ts +3 -3
  1307. package/build/types-ts3.8/utils/anr.d.ts +1 -1
  1308. package/build/types-ts3.8/utils/baggage.d.ts +1 -1
  1309. package/build/types-ts3.8/utils/breadcrumb-log-level.d.ts +1 -1
  1310. package/build/types-ts3.8/utils/clientreport.d.ts +2 -2
  1311. package/build/types-ts3.8/utils/data-collection/defaultPiiToCollectionOptions.d.ts +6 -0
  1312. package/build/types-ts3.8/utils/data-collection/filterCookies.d.ts +9 -0
  1313. package/build/types-ts3.8/utils/data-collection/filterKeyValueData.d.ts +11 -0
  1314. package/build/types-ts3.8/utils/data-collection/filterQueryParams.d.ts +9 -0
  1315. package/build/types-ts3.8/utils/data-collection/filtering-snippets.d.ts +14 -0
  1316. package/build/types-ts3.8/utils/data-collection/resolveDataCollectionOptions.d.ts +14 -0
  1317. package/build/types-ts3.8/utils/debug-ids.d.ts +2 -2
  1318. package/build/types-ts3.8/utils/debug-logger.d.ts +1 -1
  1319. package/build/types-ts3.8/utils/dsn.d.ts +1 -1
  1320. package/build/types-ts3.8/utils/envelope.d.ts +8 -8
  1321. package/build/types-ts3.8/utils/error.d.ts +1 -1
  1322. package/build/types-ts3.8/utils/eventUtils.d.ts +1 -1
  1323. package/build/types-ts3.8/utils/eventbuilder.d.ts +6 -6
  1324. package/build/types-ts3.8/utils/featureFlags.d.ts +1 -1
  1325. package/build/types-ts3.8/utils/hasSpansEnabled.d.ts +1 -1
  1326. package/build/types-ts3.8/utils/ipAddress.d.ts +2 -2
  1327. package/build/types-ts3.8/utils/is.d.ts +4 -4
  1328. package/build/types-ts3.8/utils/meta.d.ts +1 -1
  1329. package/build/types-ts3.8/utils/misc.d.ts +3 -3
  1330. package/build/types-ts3.8/utils/node-stack-trace.d.ts +1 -1
  1331. package/build/types-ts3.8/utils/object.d.ts +1 -1
  1332. package/build/types-ts3.8/utils/parameterize.d.ts +1 -1
  1333. package/build/types-ts3.8/utils/prepareEvent.d.ts +3 -3
  1334. package/build/types-ts3.8/utils/ratelimit.d.ts +2 -2
  1335. package/build/types-ts3.8/utils/request.d.ts +3 -3
  1336. package/build/types-ts3.8/utils/scopeData.d.ts +1 -1
  1337. package/build/types-ts3.8/utils/sdkMetadata.d.ts +1 -1
  1338. package/build/types-ts3.8/utils/severity.d.ts +1 -1
  1339. package/build/types-ts3.8/utils/should-ignore-span.d.ts +2 -2
  1340. package/build/types-ts3.8/utils/spanOnScope.d.ts +1 -1
  1341. package/build/types-ts3.8/utils/spanUtils.d.ts +4 -4
  1342. package/build/types-ts3.8/utils/stacktrace.d.ts +4 -4
  1343. package/build/types-ts3.8/utils/trace-info.d.ts +2 -2
  1344. package/build/types-ts3.8/utils/traceData.d.ts +2 -2
  1345. package/build/types-ts3.8/utils/tracePropagationTargets.d.ts +1 -1
  1346. package/build/types-ts3.8/utils/tracing.d.ts +2 -2
  1347. package/build/types-ts3.8/utils/transactionEvent.d.ts +2 -2
  1348. package/build/types-ts3.8/utils/url.d.ts +1 -1
  1349. package/build/types-ts3.8/utils/worldwide.d.ts +1 -0
  1350. package/package.json +10 -2
  1351. package/server.d.ts +4 -0
  1352. package/build/types/types-hoist/attachment.d.ts.map +0 -1
  1353. package/build/types/types-hoist/breadcrumb.d.ts.map +0 -1
  1354. package/build/types/types-hoist/browseroptions.d.ts.map +0 -1
  1355. package/build/types/types-hoist/checkin.d.ts.map +0 -1
  1356. package/build/types/types-hoist/clientreport.d.ts.map +0 -1
  1357. package/build/types/types-hoist/context.d.ts.map +0 -1
  1358. package/build/types/types-hoist/csp.d.ts.map +0 -1
  1359. package/build/types/types-hoist/datacategory.d.ts.map +0 -1
  1360. package/build/types/types-hoist/debugMeta.d.ts.map +0 -1
  1361. package/build/types/types-hoist/dsn.d.ts.map +0 -1
  1362. package/build/types/types-hoist/envelope.d.ts.map +0 -1
  1363. package/build/types/types-hoist/error.d.ts.map +0 -1
  1364. package/build/types/types-hoist/event.d.ts.map +0 -1
  1365. package/build/types/types-hoist/eventprocessor.d.ts.map +0 -1
  1366. package/build/types/types-hoist/exception.d.ts.map +0 -1
  1367. package/build/types/types-hoist/extra.d.ts.map +0 -1
  1368. package/build/types/types-hoist/feedback/config.d.ts.map +0 -1
  1369. package/build/types/types-hoist/feedback/form.d.ts.map +0 -1
  1370. package/build/types/types-hoist/feedback/index.d.ts.map +0 -1
  1371. package/build/types/types-hoist/feedback/sendFeedback.d.ts.map +0 -1
  1372. package/build/types/types-hoist/feedback/theme.d.ts.map +0 -1
  1373. package/build/types/types-hoist/instrument.d.ts.map +0 -1
  1374. package/build/types/types-hoist/integration.d.ts.map +0 -1
  1375. package/build/types/types-hoist/link.d.ts.map +0 -1
  1376. package/build/types/types-hoist/log.d.ts.map +0 -1
  1377. package/build/types/types-hoist/measurement.d.ts.map +0 -1
  1378. package/build/types/types-hoist/mechanism.d.ts.map +0 -1
  1379. package/build/types/types-hoist/metric.d.ts.map +0 -1
  1380. package/build/types/types-hoist/misc.d.ts.map +0 -1
  1381. package/build/types/types-hoist/opentelemetry.d.ts.map +0 -1
  1382. package/build/types/types-hoist/options.d.ts.map +0 -1
  1383. package/build/types/types-hoist/package.d.ts.map +0 -1
  1384. package/build/types/types-hoist/parameterize.d.ts.map +0 -1
  1385. package/build/types/types-hoist/polymorphics.d.ts.map +0 -1
  1386. package/build/types/types-hoist/profiling.d.ts.map +0 -1
  1387. package/build/types/types-hoist/replay.d.ts.map +0 -1
  1388. package/build/types/types-hoist/request.d.ts.map +0 -1
  1389. package/build/types/types-hoist/runtime.d.ts.map +0 -1
  1390. package/build/types/types-hoist/samplingcontext.d.ts.map +0 -1
  1391. package/build/types/types-hoist/sdkinfo.d.ts.map +0 -1
  1392. package/build/types/types-hoist/sdkmetadata.d.ts.map +0 -1
  1393. package/build/types/types-hoist/session.d.ts.map +0 -1
  1394. package/build/types/types-hoist/severity.d.ts.map +0 -1
  1395. package/build/types/types-hoist/span.d.ts.map +0 -1
  1396. package/build/types/types-hoist/spanStatus.d.ts.map +0 -1
  1397. package/build/types/types-hoist/stackframe.d.ts.map +0 -1
  1398. package/build/types/types-hoist/stacktrace.d.ts.map +0 -1
  1399. package/build/types/types-hoist/startSpanOptions.d.ts.map +0 -1
  1400. package/build/types/types-hoist/thread.d.ts.map +0 -1
  1401. package/build/types/types-hoist/timedEvent.d.ts.map +0 -1
  1402. package/build/types/types-hoist/tracing.d.ts.map +0 -1
  1403. package/build/types/types-hoist/transaction.d.ts.map +0 -1
  1404. package/build/types/types-hoist/transport.d.ts.map +0 -1
  1405. package/build/types/types-hoist/user.d.ts.map +0 -1
  1406. package/build/types/types-hoist/view-hierarchy.d.ts.map +0 -1
  1407. package/build/types/types-hoist/vue.d.ts.map +0 -1
  1408. package/build/types/types-hoist/webfetchapi.d.ts.map +0 -1
  1409. package/build/types/types-hoist/wrappedfunction.d.ts.map +0 -1
  1410. /package/build/types/{types-hoist → types}/attachment.d.ts +0 -0
  1411. /package/build/types/{types-hoist → types}/breadcrumb.d.ts +0 -0
  1412. /package/build/types/{types-hoist → types}/browseroptions.d.ts +0 -0
  1413. /package/build/types/{types-hoist → types}/checkin.d.ts +0 -0
  1414. /package/build/types/{types-hoist → types}/clientreport.d.ts +0 -0
  1415. /package/build/types/{types-hoist → types}/context.d.ts +0 -0
  1416. /package/build/types/{types-hoist → types}/csp.d.ts +0 -0
  1417. /package/build/types/{types-hoist → types}/datacategory.d.ts +0 -0
  1418. /package/build/types/{types-hoist → types}/debugMeta.d.ts +0 -0
  1419. /package/build/types/{types-hoist → types}/dsn.d.ts +0 -0
  1420. /package/build/types/{types-hoist → types}/envelope.d.ts +0 -0
  1421. /package/build/types/{types-hoist → types}/error.d.ts +0 -0
  1422. /package/build/types/{types-hoist → types}/event.d.ts +0 -0
  1423. /package/build/types/{types-hoist → types}/eventprocessor.d.ts +0 -0
  1424. /package/build/types/{types-hoist → types}/exception.d.ts +0 -0
  1425. /package/build/types/{types-hoist → types}/extra.d.ts +0 -0
  1426. /package/build/types/{types-hoist → types}/feedback/config.d.ts +0 -0
  1427. /package/build/types/{types-hoist → types}/feedback/form.d.ts +0 -0
  1428. /package/build/types/{types-hoist → types}/feedback/index.d.ts +0 -0
  1429. /package/build/types/{types-hoist → types}/feedback/sendFeedback.d.ts +0 -0
  1430. /package/build/types/{types-hoist → types}/feedback/theme.d.ts +0 -0
  1431. /package/build/types/{types-hoist → types}/instrument.d.ts +0 -0
  1432. /package/build/types/{types-hoist → types}/integration.d.ts +0 -0
  1433. /package/build/types/{types-hoist → types}/link.d.ts +0 -0
  1434. /package/build/types/{types-hoist → types}/log.d.ts +0 -0
  1435. /package/build/types/{types-hoist → types}/measurement.d.ts +0 -0
  1436. /package/build/types/{types-hoist → types}/mechanism.d.ts +0 -0
  1437. /package/build/types/{types-hoist → types}/metric.d.ts +0 -0
  1438. /package/build/types/{types-hoist → types}/misc.d.ts +0 -0
  1439. /package/build/types/{types-hoist → types}/opentelemetry.d.ts +0 -0
  1440. /package/build/types/{types-hoist → types}/package.d.ts +0 -0
  1441. /package/build/types/{types-hoist → types}/parameterize.d.ts +0 -0
  1442. /package/build/types/{types-hoist → types}/polymorphics.d.ts +0 -0
  1443. /package/build/types/{types-hoist → types}/profiling.d.ts +0 -0
  1444. /package/build/types/{types-hoist → types}/replay.d.ts +0 -0
  1445. /package/build/types/{types-hoist → types}/request.d.ts +0 -0
  1446. /package/build/types/{types-hoist → types}/runtime.d.ts +0 -0
  1447. /package/build/types/{types-hoist → types}/sdkinfo.d.ts +0 -0
  1448. /package/build/types/{types-hoist → types}/sdkmetadata.d.ts +0 -0
  1449. /package/build/types/{types-hoist → types}/session.d.ts +0 -0
  1450. /package/build/types/{types-hoist → types}/severity.d.ts +0 -0
  1451. /package/build/types/{types-hoist → types}/span.d.ts +0 -0
  1452. /package/build/types/{types-hoist → types}/spanStatus.d.ts +0 -0
  1453. /package/build/types/{types-hoist → types}/stackframe.d.ts +0 -0
  1454. /package/build/types/{types-hoist → types}/stacktrace.d.ts +0 -0
  1455. /package/build/types/{types-hoist → types}/thread.d.ts +0 -0
  1456. /package/build/types/{types-hoist → types}/timedEvent.d.ts +0 -0
  1457. /package/build/types/{types-hoist → types}/tracing.d.ts +0 -0
  1458. /package/build/types/{types-hoist → types}/transaction.d.ts +0 -0
  1459. /package/build/types/{types-hoist → types}/transport.d.ts +0 -0
  1460. /package/build/types/{types-hoist → types}/user.d.ts +0 -0
  1461. /package/build/types/{types-hoist → types}/view-hierarchy.d.ts +0 -0
  1462. /package/build/types/{types-hoist → types}/vue.d.ts +0 -0
  1463. /package/build/types/{types-hoist → types}/webfetchapi.d.ts +0 -0
  1464. /package/build/types/{types-hoist → types}/wrappedfunction.d.ts +0 -0
  1465. /package/build/types-ts3.8/{types-hoist → types}/attachment.d.ts +0 -0
  1466. /package/build/types-ts3.8/{types-hoist → types}/breadcrumb.d.ts +0 -0
  1467. /package/build/types-ts3.8/{types-hoist → types}/browseroptions.d.ts +0 -0
  1468. /package/build/types-ts3.8/{types-hoist → types}/checkin.d.ts +0 -0
  1469. /package/build/types-ts3.8/{types-hoist → types}/clientreport.d.ts +0 -0
  1470. /package/build/types-ts3.8/{types-hoist → types}/context.d.ts +0 -0
  1471. /package/build/types-ts3.8/{types-hoist → types}/csp.d.ts +0 -0
  1472. /package/build/types-ts3.8/{types-hoist → types}/datacategory.d.ts +0 -0
  1473. /package/build/types-ts3.8/{types-hoist → types}/debugMeta.d.ts +0 -0
  1474. /package/build/types-ts3.8/{types-hoist → types}/dsn.d.ts +0 -0
  1475. /package/build/types-ts3.8/{types-hoist → types}/envelope.d.ts +0 -0
  1476. /package/build/types-ts3.8/{types-hoist → types}/error.d.ts +0 -0
  1477. /package/build/types-ts3.8/{types-hoist → types}/event.d.ts +0 -0
  1478. /package/build/types-ts3.8/{types-hoist → types}/eventprocessor.d.ts +0 -0
  1479. /package/build/types-ts3.8/{types-hoist → types}/exception.d.ts +0 -0
  1480. /package/build/types-ts3.8/{types-hoist → types}/extra.d.ts +0 -0
  1481. /package/build/types-ts3.8/{types-hoist → types}/feedback/config.d.ts +0 -0
  1482. /package/build/types-ts3.8/{types-hoist → types}/feedback/form.d.ts +0 -0
  1483. /package/build/types-ts3.8/{types-hoist → types}/feedback/index.d.ts +0 -0
  1484. /package/build/types-ts3.8/{types-hoist → types}/feedback/sendFeedback.d.ts +0 -0
  1485. /package/build/types-ts3.8/{types-hoist → types}/feedback/theme.d.ts +0 -0
  1486. /package/build/types-ts3.8/{types-hoist → types}/instrument.d.ts +0 -0
  1487. /package/build/types-ts3.8/{types-hoist → types}/integration.d.ts +0 -0
  1488. /package/build/types-ts3.8/{types-hoist → types}/link.d.ts +0 -0
  1489. /package/build/types-ts3.8/{types-hoist → types}/log.d.ts +0 -0
  1490. /package/build/types-ts3.8/{types-hoist → types}/measurement.d.ts +0 -0
  1491. /package/build/types-ts3.8/{types-hoist → types}/mechanism.d.ts +0 -0
  1492. /package/build/types-ts3.8/{types-hoist → types}/metric.d.ts +0 -0
  1493. /package/build/types-ts3.8/{types-hoist → types}/misc.d.ts +0 -0
  1494. /package/build/types-ts3.8/{types-hoist → types}/opentelemetry.d.ts +0 -0
  1495. /package/build/types-ts3.8/{types-hoist → types}/package.d.ts +0 -0
  1496. /package/build/types-ts3.8/{types-hoist → types}/parameterize.d.ts +0 -0
  1497. /package/build/types-ts3.8/{types-hoist → types}/polymorphics.d.ts +0 -0
  1498. /package/build/types-ts3.8/{types-hoist → types}/profiling.d.ts +0 -0
  1499. /package/build/types-ts3.8/{types-hoist → types}/replay.d.ts +0 -0
  1500. /package/build/types-ts3.8/{types-hoist → types}/request.d.ts +0 -0
  1501. /package/build/types-ts3.8/{types-hoist → types}/runtime.d.ts +0 -0
  1502. /package/build/types-ts3.8/{types-hoist → types}/sdkinfo.d.ts +0 -0
  1503. /package/build/types-ts3.8/{types-hoist → types}/sdkmetadata.d.ts +0 -0
  1504. /package/build/types-ts3.8/{types-hoist → types}/session.d.ts +0 -0
  1505. /package/build/types-ts3.8/{types-hoist → types}/severity.d.ts +0 -0
  1506. /package/build/types-ts3.8/{types-hoist → types}/span.d.ts +0 -0
  1507. /package/build/types-ts3.8/{types-hoist → types}/spanStatus.d.ts +0 -0
  1508. /package/build/types-ts3.8/{types-hoist → types}/stackframe.d.ts +0 -0
  1509. /package/build/types-ts3.8/{types-hoist → types}/stacktrace.d.ts +0 -0
  1510. /package/build/types-ts3.8/{types-hoist → types}/thread.d.ts +0 -0
  1511. /package/build/types-ts3.8/{types-hoist → types}/timedEvent.d.ts +0 -0
  1512. /package/build/types-ts3.8/{types-hoist → types}/tracing.d.ts +0 -0
  1513. /package/build/types-ts3.8/{types-hoist → types}/transaction.d.ts +0 -0
  1514. /package/build/types-ts3.8/{types-hoist → types}/transport.d.ts +0 -0
  1515. /package/build/types-ts3.8/{types-hoist → types}/user.d.ts +0 -0
  1516. /package/build/types-ts3.8/{types-hoist → types}/view-hierarchy.d.ts +0 -0
  1517. /package/build/types-ts3.8/{types-hoist → types}/vue.d.ts +0 -0
  1518. /package/build/types-ts3.8/{types-hoist → types}/webfetchapi.d.ts +0 -0
  1519. /package/build/types-ts3.8/{types-hoist → types}/wrappedfunction.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"supabase.js","sources":["../../../src/integrations/supabase.ts"],"sourcesContent":["// Based on Kamil Ogórek's work on:\n// https://github.com/supabase-community/sentry-integration-js\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable max-lines */\nimport { addBreadcrumb } from '../breadcrumbs';\nimport { getClient } from '../currentScopes';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { captureException } from '../exports';\nimport { defineIntegration } from '../integration';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '../semanticAttributes';\nimport { setHttpStatus, SPAN_STATUS_ERROR, SPAN_STATUS_OK, startSpan } from '../tracing';\nimport type { IntegrationFn } from '../types-hoist/integration';\nimport { debug } from '../utils/debug-logger';\nimport { isPlainObject } from '../utils/is';\nimport { addExceptionMechanism } from '../utils/misc';\n\nconst AUTH_OPERATIONS_TO_INSTRUMENT = [\n 'reauthenticate',\n 'signInAnonymously',\n 'signInWithOAuth',\n 'signInWithIdToken',\n 'signInWithOtp',\n 'signInWithPassword',\n 'signInWithSSO',\n 'signOut',\n 'signUp',\n 'verifyOtp',\n];\n\nconst AUTH_ADMIN_OPERATIONS_TO_INSTRUMENT = [\n 'createUser',\n 'deleteUser',\n 'listUsers',\n 'getUserById',\n 'updateUserById',\n 'inviteUserByEmail',\n];\n\nexport const FILTER_MAPPINGS = {\n eq: 'eq',\n neq: 'neq',\n gt: 'gt',\n gte: 'gte',\n lt: 'lt',\n lte: 'lte',\n like: 'like',\n 'like(all)': 'likeAllOf',\n 'like(any)': 'likeAnyOf',\n ilike: 'ilike',\n 'ilike(all)': 'ilikeAllOf',\n 'ilike(any)': 'ilikeAnyOf',\n is: 'is',\n in: 'in',\n cs: 'contains',\n cd: 'containedBy',\n sr: 'rangeGt',\n nxl: 'rangeGte',\n sl: 'rangeLt',\n nxr: 'rangeLte',\n adj: 'rangeAdjacent',\n ov: 'overlaps',\n fts: '',\n plfts: 'plain',\n phfts: 'phrase',\n wfts: 'websearch',\n not: 'not',\n};\n\nexport const DB_OPERATIONS_TO_INSTRUMENT = ['select', 'insert', 'upsert', 'update', 'delete'];\n\ntype AuthOperationFn = (...args: unknown[]) => Promise<unknown>;\ntype AuthOperationName = (typeof AUTH_OPERATIONS_TO_INSTRUMENT)[number];\ntype AuthAdminOperationName = (typeof AUTH_ADMIN_OPERATIONS_TO_INSTRUMENT)[number];\ntype PostgRESTQueryOperationFn = (...args: unknown[]) => PostgRESTFilterBuilder;\n\nexport interface SupabaseClientInstance {\n auth: {\n admin: Record<AuthAdminOperationName, AuthOperationFn>;\n } & Record<AuthOperationName, AuthOperationFn>;\n}\n\nexport interface PostgRESTQueryBuilder {\n [key: string]: PostgRESTQueryOperationFn;\n}\n\nexport interface PostgRESTFilterBuilder {\n method: string;\n headers: Record<string, string>;\n url: URL;\n schema: string;\n body: any;\n}\n\nexport interface SupabaseResponse {\n status?: number;\n error?: {\n message: string;\n code?: string;\n details?: unknown;\n };\n}\n\nexport interface SupabaseError extends Error {\n code?: string;\n details?: unknown;\n}\n\nexport interface SupabaseBreadcrumb {\n type: string;\n category: string;\n message: string;\n data?: {\n query?: string[];\n body?: Record<string, unknown>;\n };\n}\n\nexport interface SupabaseClientConstructor {\n prototype: {\n from: (table: string) => PostgRESTQueryBuilder;\n };\n}\n\nexport interface PostgRESTProtoThenable {\n then: <T>(\n onfulfilled?: ((value: T) => T | PromiseLike<T>) | null,\n onrejected?: ((reason: any) => T | PromiseLike<T>) | null,\n ) => Promise<T>;\n}\n\ntype SentryInstrumented<T> = T & {\n __SENTRY_INSTRUMENTED__?: boolean;\n};\n\nfunction markAsInstrumented<T>(fn: T): void {\n try {\n (fn as SentryInstrumented<T>).__SENTRY_INSTRUMENTED__ = true;\n } catch {\n // ignore errors here\n }\n}\n\nfunction isInstrumented<T>(fn: T): boolean | undefined {\n try {\n return (fn as SentryInstrumented<T>).__SENTRY_INSTRUMENTED__;\n } catch {\n return false;\n }\n}\n\n/**\n * Plain-object bodies are copied into `plainBody`; array inserts (and other non-plain shapes) stay only on `rawBody`.\n * Returns a payload suitable for span attributes / breadcrumbs when the client has `sendDefaultPii` enabled.\n */\nfunction getMutationBodyPayloadForTelemetry(rawBody: unknown, plainBody: Record<string, unknown>): unknown | undefined {\n if (Object.keys(plainBody).length > 0) {\n return plainBody;\n }\n if (Array.isArray(rawBody) && rawBody.length > 0) {\n return rawBody;\n }\n return undefined;\n}\n\n/** True when the PostgREST builder carries a mutation body (for `insert(...)`, etc. in span descriptions). */\nfunction hasMutationBodyForDescription(rawBody: unknown, plainBody: Record<string, unknown>): boolean {\n return getMutationBodyPayloadForTelemetry(rawBody, plainBody) !== undefined;\n}\n\n/**\n * Extracts the database operation type from the HTTP method and headers\n * @param method - The HTTP method of the request\n * @param headers - The request headers\n * @returns The database operation type ('select', 'insert', 'upsert', 'update', or 'delete')\n */\nexport function extractOperation(method: string, headers: Record<string, string> = {}): string {\n switch (method) {\n case 'GET': {\n return 'select';\n }\n case 'POST': {\n if (headers['Prefer']?.includes('resolution=')) {\n return 'upsert';\n } else {\n return 'insert';\n }\n }\n case 'PATCH': {\n return 'update';\n }\n case 'DELETE': {\n return 'delete';\n }\n default: {\n return '<unknown-op>';\n }\n }\n}\n\n/**\n * Translates Supabase filter parameters into readable method names for tracing\n * @param key - The filter key from the URL search parameters\n * @param query - The filter value from the URL search parameters\n * @returns A string representation of the filter as a method call\n */\nexport function translateFiltersIntoMethods(key: string, query: string): string {\n if (query === '' || query === '*') {\n return 'select(*)';\n }\n\n if (key === 'select') {\n return `select(${query})`;\n }\n\n if (key === 'or' || key.endsWith('.or')) {\n return `${key}${query}`;\n }\n\n const [filter, ...value] = query.split('.');\n\n let method;\n // Handle optional `configPart` of the filter\n if (filter?.startsWith('fts')) {\n method = 'textSearch';\n } else if (filter?.startsWith('plfts')) {\n method = 'textSearch[plain]';\n } else if (filter?.startsWith('phfts')) {\n method = 'textSearch[phrase]';\n } else if (filter?.startsWith('wfts')) {\n method = 'textSearch[websearch]';\n } else {\n method = (filter && FILTER_MAPPINGS[filter as keyof typeof FILTER_MAPPINGS]) || 'filter';\n }\n\n return `${method}(${key}, ${value.join('.')})`;\n}\n\nfunction instrumentAuthOperation(operation: AuthOperationFn, isAdmin = false): AuthOperationFn {\n return new Proxy(operation, {\n apply(target, thisArg, argumentsList) {\n return startSpan(\n {\n name: `auth ${isAdmin ? '(admin) ' : ''}${operation.name}`,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.db.supabase',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'db',\n 'db.system': 'postgresql',\n 'db.operation': `auth.${isAdmin ? 'admin.' : ''}${operation.name}`,\n },\n },\n span => {\n return Reflect.apply(target, thisArg, argumentsList)\n .then((res: unknown) => {\n if (res && typeof res === 'object' && 'error' in res && res.error) {\n span.setStatus({ code: SPAN_STATUS_ERROR });\n\n captureException(res.error, {\n mechanism: {\n handled: false,\n type: 'auto.db.supabase.auth',\n },\n });\n } else {\n span.setStatus({ code: SPAN_STATUS_OK });\n }\n\n span.end();\n return res;\n })\n .catch((err: unknown) => {\n span.setStatus({ code: SPAN_STATUS_ERROR });\n span.end();\n\n captureException(err, {\n mechanism: {\n handled: false,\n type: 'auto.db.supabase.auth',\n },\n });\n\n throw err;\n })\n .then(...argumentsList);\n },\n );\n },\n });\n}\n\nfunction instrumentSupabaseAuthClient(supabaseClientInstance: SupabaseClientInstance): void {\n const auth = supabaseClientInstance.auth;\n\n if (!auth || isInstrumented(supabaseClientInstance.auth)) {\n return;\n }\n\n for (const operation of AUTH_OPERATIONS_TO_INSTRUMENT) {\n const authOperation = auth[operation];\n\n if (!authOperation) {\n continue;\n }\n\n if (typeof supabaseClientInstance.auth[operation] === 'function') {\n supabaseClientInstance.auth[operation] = instrumentAuthOperation(authOperation);\n }\n }\n\n for (const operation of AUTH_ADMIN_OPERATIONS_TO_INSTRUMENT) {\n const authOperation = auth.admin[operation];\n\n if (!authOperation) {\n continue;\n }\n\n if (typeof supabaseClientInstance.auth.admin[operation] === 'function') {\n supabaseClientInstance.auth.admin[operation] = instrumentAuthOperation(authOperation, true);\n }\n }\n\n markAsInstrumented(supabaseClientInstance.auth);\n}\n\nfunction instrumentSupabaseClientConstructor(SupabaseClient: unknown): void {\n if (isInstrumented((SupabaseClient as SupabaseClientConstructor).prototype.from)) {\n return;\n }\n\n (SupabaseClient as SupabaseClientConstructor).prototype.from = new Proxy(\n (SupabaseClient as SupabaseClientConstructor).prototype.from,\n {\n apply(target, thisArg, argumentsList) {\n const rv = Reflect.apply(target, thisArg, argumentsList);\n const PostgRESTQueryBuilder = (rv as PostgRESTQueryBuilder).constructor;\n\n instrumentPostgRESTQueryBuilder(PostgRESTQueryBuilder as unknown as new () => PostgRESTQueryBuilder);\n\n return rv;\n },\n },\n );\n\n markAsInstrumented((SupabaseClient as SupabaseClientConstructor).prototype.from);\n}\n\nfunction instrumentPostgRESTFilterBuilder(PostgRESTFilterBuilder: PostgRESTFilterBuilder['constructor']): void {\n if (isInstrumented((PostgRESTFilterBuilder.prototype as unknown as PostgRESTProtoThenable).then)) {\n return;\n }\n\n (PostgRESTFilterBuilder.prototype as unknown as PostgRESTProtoThenable).then = new Proxy(\n (PostgRESTFilterBuilder.prototype as unknown as PostgRESTProtoThenable).then,\n {\n apply(target, thisArg, argumentsList) {\n const operations = DB_OPERATIONS_TO_INSTRUMENT;\n const typedThis = thisArg as PostgRESTFilterBuilder;\n const operation = extractOperation(typedThis.method, typedThis.headers);\n\n if (!operations.includes(operation)) {\n return Reflect.apply(target, thisArg, argumentsList);\n }\n\n if (!typedThis?.url?.pathname || typeof typedThis.url.pathname !== 'string') {\n return Reflect.apply(target, thisArg, argumentsList);\n }\n\n const pathParts = typedThis.url.pathname.split('/');\n const table = pathParts.length > 0 ? pathParts[pathParts.length - 1] : '';\n\n const queryItems: string[] = [];\n for (const [key, value] of typedThis.url.searchParams.entries()) {\n // It's possible to have multiple entries for the same key, eg. `id=eq.7&id=eq.3`,\n // so we need to use array instead of object to collect them.\n queryItems.push(translateFiltersIntoMethods(key, value));\n }\n const body: Record<string, unknown> = Object.create(null);\n if (isPlainObject(typedThis.body)) {\n for (const [key, value] of Object.entries(typedThis.body)) {\n body[key] = value;\n }\n }\n\n const sendDefaultPii = Boolean(getClient()?.getOptions().sendDefaultPii);\n const bodyPayload = getMutationBodyPayloadForTelemetry(typedThis.body, body);\n\n // Adding operation to the beginning of the description if it's not a `select` operation\n // For example, it can be an `insert` or `update` operation but the query can be `select(...)`\n // For `select` operations, we don't need repeat it in the description\n const mutationPart =\n operation === 'select'\n ? ''\n : `${operation}${hasMutationBodyForDescription(typedThis.body, body) ? '(...) ' : ''}`;\n const queryPart = sendDefaultPii ? queryItems.join(' ') : queryItems.length > 0 ? '[redacted]' : '';\n const descriptionMiddle = [mutationPart.trimEnd(), queryPart].filter(Boolean).join(' ');\n const description = descriptionMiddle ? `${descriptionMiddle} from(${table})` : `from(${table})`;\n\n const attributes: Record<string, any> = {\n 'db.table': table,\n 'db.schema': typedThis.schema,\n 'db.url': typedThis.url.origin,\n 'db.sdk': typedThis.headers['X-Client-Info'],\n 'db.system': 'postgresql',\n 'db.operation': operation,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.db.supabase',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'db',\n };\n\n if (queryItems.length && sendDefaultPii) {\n attributes['db.query'] = queryItems;\n }\n\n if (bodyPayload !== undefined && sendDefaultPii) {\n attributes['db.body'] = bodyPayload;\n }\n\n return startSpan(\n {\n name: description,\n attributes,\n },\n span => {\n return (Reflect.apply(target, thisArg, []) as Promise<SupabaseResponse>)\n .then(\n (res: SupabaseResponse) => {\n if (span) {\n if (res && typeof res === 'object' && 'status' in res) {\n setHttpStatus(span, res.status || 500);\n }\n span.end();\n }\n\n if (res?.error) {\n const err = new Error(res.error.message) as SupabaseError;\n if (res.error.code) {\n err.code = res.error.code;\n }\n if (res.error.details) {\n err.details = res.error.details;\n }\n\n const supabaseContext: Record<string, any> = {};\n if (queryItems.length && sendDefaultPii) {\n supabaseContext.query = queryItems;\n }\n if (bodyPayload !== undefined && sendDefaultPii) {\n supabaseContext.body = bodyPayload;\n }\n\n captureException(err, scope => {\n scope.addEventProcessor(e => {\n addExceptionMechanism(e, {\n handled: false,\n type: 'auto.db.supabase.postgres',\n });\n\n return e;\n });\n\n scope.setContext('supabase', supabaseContext);\n\n return scope;\n });\n }\n\n const breadcrumb: SupabaseBreadcrumb = {\n type: 'supabase',\n category: `db.${operation}`,\n message: description,\n };\n\n const data: Record<string, unknown> = {};\n\n if (queryItems.length && sendDefaultPii) {\n data.query = queryItems;\n }\n\n if (bodyPayload !== undefined && sendDefaultPii) {\n data.body = bodyPayload;\n }\n\n if (Object.keys(data).length) {\n breadcrumb.data = data;\n }\n\n addBreadcrumb(breadcrumb);\n\n return res;\n },\n (err: Error) => {\n // TODO: shouldn't we capture this error?\n if (span) {\n setHttpStatus(span, 500);\n span.end();\n }\n throw err;\n },\n )\n .then(...argumentsList);\n },\n );\n },\n },\n );\n\n markAsInstrumented((PostgRESTFilterBuilder.prototype as unknown as PostgRESTProtoThenable).then);\n}\n\nfunction instrumentPostgRESTQueryBuilder(PostgRESTQueryBuilder: new () => PostgRESTQueryBuilder): void {\n // We need to wrap _all_ operations despite them sharing the same `PostgRESTFilterBuilder`\n // constructor, as we don't know which method will be called first, and we don't want to miss any calls.\n for (const operation of DB_OPERATIONS_TO_INSTRUMENT) {\n if (isInstrumented((PostgRESTQueryBuilder.prototype as Record<string, any>)[operation])) {\n continue;\n }\n\n type PostgRESTOperation = keyof Pick<PostgRESTQueryBuilder, 'select' | 'insert' | 'upsert' | 'update' | 'delete'>;\n (PostgRESTQueryBuilder.prototype as Record<string, any>)[operation as PostgRESTOperation] = new Proxy(\n (PostgRESTQueryBuilder.prototype as Record<string, any>)[operation as PostgRESTOperation],\n {\n apply(target, thisArg, argumentsList) {\n const rv = Reflect.apply(target, thisArg, argumentsList);\n const PostgRESTFilterBuilder = (rv as PostgRESTFilterBuilder).constructor;\n\n DEBUG_BUILD && debug.log(`Instrumenting ${operation} operation's PostgRESTFilterBuilder`);\n\n instrumentPostgRESTFilterBuilder(PostgRESTFilterBuilder);\n\n return rv;\n },\n },\n );\n\n markAsInstrumented((PostgRESTQueryBuilder.prototype as Record<string, any>)[operation]);\n }\n}\n\nexport const instrumentSupabaseClient = (supabaseClient: unknown): void => {\n if (!supabaseClient) {\n DEBUG_BUILD && debug.warn('Supabase integration was not installed because no Supabase client was provided.');\n return;\n }\n const SupabaseClientConstructor =\n supabaseClient.constructor === Function ? supabaseClient : supabaseClient.constructor;\n\n instrumentSupabaseClientConstructor(SupabaseClientConstructor);\n instrumentSupabaseAuthClient(supabaseClient as SupabaseClientInstance);\n};\n\nconst INTEGRATION_NAME = 'Supabase';\n\nconst _supabaseIntegration = ((supabaseClient: unknown) => {\n return {\n setupOnce() {\n instrumentSupabaseClient(supabaseClient);\n },\n name: INTEGRATION_NAME,\n };\n}) satisfies IntegrationFn;\n\nexport const supabaseIntegration = defineIntegration((options: { supabaseClient: any }) => {\n return _supabaseIntegration(options.supabaseClient);\n}) satisfies IntegrationFn;\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;AACA;;;AAgBA,MAAM,gCAAgC;AACtC,EAAE,gBAAgB;AAClB,EAAE,mBAAmB;AACrB,EAAE,iBAAiB;AACnB,EAAE,mBAAmB;AACrB,EAAE,eAAe;AACjB,EAAE,oBAAoB;AACtB,EAAE,eAAe;AACjB,EAAE,SAAS;AACX,EAAE,QAAQ;AACV,EAAE,WAAW;AACb,CAAC;;AAED,MAAM,sCAAsC;AAC5C,EAAE,YAAY;AACd,EAAE,YAAY;AACd,EAAE,WAAW;AACb,EAAE,aAAa;AACf,EAAE,gBAAgB;AAClB,EAAE,mBAAmB;AACrB,CAAC;;AAEM,MAAM,kBAAkB;AAC/B,EAAE,EA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CAAA,cAAA,EAAA;AACA;;AAEA,MAAA,gBAAA,GAAA,UAAA;;AAEA,MAAA,oBAAA,IAAA,CAAA,cAAA,KAAA;AACA,EAAA,OAAA;AACA,IAAA,SAAA,GAAA;AACA,MAAA,wBAAA,CAAA,cAAA,CAAA;AACA,IAAA,CAAA;AACA,IAAA,IAAA,EAAA,gBAAA;AACA,GAAA;AACA,CAAA,CAAA;;AAEA,MAAA,mBAAA,GAAA,iBAAA,CAAA,CAAA,OAAA,KAAA;AACA,EAAA,OAAA,oBAAA,CAAA,OAAA,CAAA,cAAA,CAAA;AACA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"supabase.js","sources":["../../../src/integrations/supabase.ts"],"sourcesContent":["// Based on Kamil Ogórek's work on:\n// https://github.com/supabase-community/sentry-integration-js\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable max-lines */\nimport { addBreadcrumb } from '../breadcrumbs';\nimport { getClient } from '../currentScopes';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { captureException } from '../exports';\nimport { defineIntegration } from '../integration';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '../semanticAttributes';\nimport { setHttpStatus, SPAN_STATUS_ERROR, SPAN_STATUS_OK, startSpan } from '../tracing';\nimport type { IntegrationFn } from '../types/integration';\nimport { debug } from '../utils/debug-logger';\nimport { isPlainObject } from '../utils/is';\nimport { addExceptionMechanism } from '../utils/misc';\n\nconst AUTH_OPERATIONS_TO_INSTRUMENT = [\n 'reauthenticate',\n 'signInAnonymously',\n 'signInWithOAuth',\n 'signInWithIdToken',\n 'signInWithOtp',\n 'signInWithPassword',\n 'signInWithSSO',\n 'signOut',\n 'signUp',\n 'verifyOtp',\n];\n\nconst AUTH_ADMIN_OPERATIONS_TO_INSTRUMENT = [\n 'createUser',\n 'deleteUser',\n 'listUsers',\n 'getUserById',\n 'updateUserById',\n 'inviteUserByEmail',\n];\n\nexport const FILTER_MAPPINGS = {\n eq: 'eq',\n neq: 'neq',\n gt: 'gt',\n gte: 'gte',\n lt: 'lt',\n lte: 'lte',\n like: 'like',\n 'like(all)': 'likeAllOf',\n 'like(any)': 'likeAnyOf',\n ilike: 'ilike',\n 'ilike(all)': 'ilikeAllOf',\n 'ilike(any)': 'ilikeAnyOf',\n is: 'is',\n in: 'in',\n cs: 'contains',\n cd: 'containedBy',\n sr: 'rangeGt',\n nxl: 'rangeGte',\n sl: 'rangeLt',\n nxr: 'rangeLte',\n adj: 'rangeAdjacent',\n ov: 'overlaps',\n fts: '',\n plfts: 'plain',\n phfts: 'phrase',\n wfts: 'websearch',\n not: 'not',\n};\n\nexport const DB_OPERATIONS_TO_INSTRUMENT = ['select', 'insert', 'upsert', 'update', 'delete'];\n\ntype AuthOperationFn = (...args: unknown[]) => Promise<unknown>;\ntype AuthOperationName = (typeof AUTH_OPERATIONS_TO_INSTRUMENT)[number];\ntype AuthAdminOperationName = (typeof AUTH_ADMIN_OPERATIONS_TO_INSTRUMENT)[number];\ntype PostgRESTQueryOperationFn = (...args: unknown[]) => PostgRESTFilterBuilder;\n\nexport interface SupabaseClientInstance {\n auth: {\n admin: Record<AuthAdminOperationName, AuthOperationFn>;\n } & Record<AuthOperationName, AuthOperationFn>;\n}\n\nexport interface PostgRESTQueryBuilder {\n [key: string]: PostgRESTQueryOperationFn;\n}\n\nexport interface PostgRESTFilterBuilder {\n method: string;\n headers: Record<string, string>;\n url: URL;\n schema: string;\n body: any;\n}\n\nexport interface SupabaseResponse {\n status?: number;\n error?: {\n message: string;\n code?: string;\n details?: unknown;\n };\n}\n\nexport interface SupabaseError extends Error {\n code?: string;\n details?: unknown;\n}\n\nexport interface SupabaseBreadcrumb {\n type: string;\n category: string;\n message: string;\n data?: {\n query?: string[];\n body?: Record<string, unknown>;\n };\n}\n\nexport interface SupabaseClientConstructor {\n prototype: {\n from: (table: string) => PostgRESTQueryBuilder;\n };\n}\n\nexport interface PostgRESTProtoThenable {\n then: <T>(\n onfulfilled?: ((value: T) => T | PromiseLike<T>) | null,\n onrejected?: ((reason: any) => T | PromiseLike<T>) | null,\n ) => Promise<T>;\n}\n\ntype SentryInstrumented<T> = T & {\n __SENTRY_INSTRUMENTED__?: boolean;\n};\n\nfunction markAsInstrumented<T>(fn: T): void {\n try {\n (fn as SentryInstrumented<T>).__SENTRY_INSTRUMENTED__ = true;\n } catch {\n // ignore errors here\n }\n}\n\nfunction isInstrumented<T>(fn: T): boolean | undefined {\n try {\n return (fn as SentryInstrumented<T>).__SENTRY_INSTRUMENTED__;\n } catch {\n return false;\n }\n}\n\n/**\n * Plain-object bodies are copied into `plainBody`; array inserts (and other non-plain shapes) stay only on `rawBody`.\n * Returns a payload suitable for span attributes / breadcrumbs when operation data collection is enabled.\n */\nfunction getMutationBodyPayloadForTelemetry(rawBody: unknown, plainBody: Record<string, unknown>): unknown | undefined {\n if (Object.keys(plainBody).length > 0) {\n return plainBody;\n }\n if (Array.isArray(rawBody) && rawBody.length > 0) {\n return rawBody;\n }\n return undefined;\n}\n\n/** True when the PostgREST builder carries a mutation body (for `insert(...)`, etc. in span descriptions). */\nfunction hasMutationBodyForDescription(rawBody: unknown, plainBody: Record<string, unknown>): boolean {\n return getMutationBodyPayloadForTelemetry(rawBody, plainBody) !== undefined;\n}\n\n/**\n * Extracts the database operation type from the HTTP method and headers\n * @param method - The HTTP method of the request\n * @param headers - The request headers\n * @returns The database operation type ('select', 'insert', 'upsert', 'update', or 'delete')\n */\nexport function extractOperation(method: string, headers: Record<string, string> = {}): string {\n switch (method) {\n case 'GET': {\n return 'select';\n }\n case 'POST': {\n if (headers['Prefer']?.includes('resolution=')) {\n return 'upsert';\n } else {\n return 'insert';\n }\n }\n case 'PATCH': {\n return 'update';\n }\n case 'DELETE': {\n return 'delete';\n }\n default: {\n return '<unknown-op>';\n }\n }\n}\n\n/**\n * Translates Supabase filter parameters into readable method names for tracing\n * @param key - The filter key from the URL search parameters\n * @param query - The filter value from the URL search parameters\n * @returns A string representation of the filter as a method call\n */\nexport function translateFiltersIntoMethods(key: string, query: string): string {\n if (query === '' || query === '*') {\n return 'select(*)';\n }\n\n if (key === 'select') {\n return `select(${query})`;\n }\n\n if (key === 'or' || key.endsWith('.or')) {\n return `${key}${query}`;\n }\n\n const [filter, ...value] = query.split('.');\n\n let method;\n // Handle optional `configPart` of the filter\n if (filter?.startsWith('fts')) {\n method = 'textSearch';\n } else if (filter?.startsWith('plfts')) {\n method = 'textSearch[plain]';\n } else if (filter?.startsWith('phfts')) {\n method = 'textSearch[phrase]';\n } else if (filter?.startsWith('wfts')) {\n method = 'textSearch[websearch]';\n } else {\n method = (filter && FILTER_MAPPINGS[filter as keyof typeof FILTER_MAPPINGS]) || 'filter';\n }\n\n return `${method}(${key}, ${value.join('.')})`;\n}\n\nfunction instrumentAuthOperation(operation: AuthOperationFn, isAdmin = false): AuthOperationFn {\n return new Proxy(operation, {\n apply(target, thisArg, argumentsList) {\n return startSpan(\n {\n name: `auth ${isAdmin ? '(admin) ' : ''}${operation.name}`,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.db.supabase',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'db',\n 'db.system': 'postgresql',\n 'db.operation': `auth.${isAdmin ? 'admin.' : ''}${operation.name}`,\n },\n },\n span => {\n return Reflect.apply(target, thisArg, argumentsList)\n .then((res: unknown) => {\n if (res && typeof res === 'object' && 'error' in res && res.error) {\n span.setStatus({ code: SPAN_STATUS_ERROR });\n\n captureException(res.error, {\n mechanism: {\n handled: false,\n type: 'auto.db.supabase.auth',\n },\n });\n } else {\n span.setStatus({ code: SPAN_STATUS_OK });\n }\n\n span.end();\n return res;\n })\n .catch((err: unknown) => {\n span.setStatus({ code: SPAN_STATUS_ERROR });\n span.end();\n\n captureException(err, {\n mechanism: {\n handled: false,\n type: 'auto.db.supabase.auth',\n },\n });\n\n throw err;\n })\n .then(...argumentsList);\n },\n );\n },\n });\n}\n\nfunction instrumentSupabaseAuthClient(supabaseClientInstance: SupabaseClientInstance): void {\n const auth = supabaseClientInstance.auth;\n\n if (!auth || isInstrumented(supabaseClientInstance.auth)) {\n return;\n }\n\n for (const operation of AUTH_OPERATIONS_TO_INSTRUMENT) {\n const authOperation = auth[operation];\n\n if (!authOperation) {\n continue;\n }\n\n if (typeof supabaseClientInstance.auth[operation] === 'function') {\n supabaseClientInstance.auth[operation] = instrumentAuthOperation(authOperation);\n }\n }\n\n for (const operation of AUTH_ADMIN_OPERATIONS_TO_INSTRUMENT) {\n const authOperation = auth.admin[operation];\n\n if (!authOperation) {\n continue;\n }\n\n if (typeof supabaseClientInstance.auth.admin[operation] === 'function') {\n supabaseClientInstance.auth.admin[operation] = instrumentAuthOperation(authOperation, true);\n }\n }\n\n markAsInstrumented(supabaseClientInstance.auth);\n}\n\nfunction instrumentSupabaseClientConstructor(SupabaseClient: unknown, _options: { sendOperationData?: boolean }): void {\n if (isInstrumented((SupabaseClient as SupabaseClientConstructor).prototype.from)) {\n return;\n }\n\n (SupabaseClient as SupabaseClientConstructor).prototype.from = new Proxy(\n (SupabaseClient as SupabaseClientConstructor).prototype.from,\n {\n apply(target, thisArg, argumentsList) {\n const rv = Reflect.apply(target, thisArg, argumentsList);\n const PostgRESTQueryBuilder = (rv as PostgRESTQueryBuilder).constructor;\n\n instrumentPostgRESTQueryBuilder(PostgRESTQueryBuilder as unknown as new () => PostgRESTQueryBuilder, _options);\n\n return rv;\n },\n },\n );\n\n markAsInstrumented((SupabaseClient as SupabaseClientConstructor).prototype.from);\n}\n\nfunction instrumentPostgRESTFilterBuilder(\n PostgRESTFilterBuilder: PostgRESTFilterBuilder['constructor'],\n _options: { sendOperationData?: boolean },\n): void {\n if (isInstrumented((PostgRESTFilterBuilder.prototype as unknown as PostgRESTProtoThenable).then)) {\n return;\n }\n\n (PostgRESTFilterBuilder.prototype as unknown as PostgRESTProtoThenable).then = new Proxy(\n (PostgRESTFilterBuilder.prototype as unknown as PostgRESTProtoThenable).then,\n {\n apply(target, thisArg, argumentsList) {\n const operations = DB_OPERATIONS_TO_INSTRUMENT;\n const typedThis = thisArg as PostgRESTFilterBuilder;\n const operation = extractOperation(typedThis.method, typedThis.headers);\n\n if (!operations.includes(operation)) {\n return Reflect.apply(target, thisArg, argumentsList);\n }\n\n if (!typedThis?.url?.pathname || typeof typedThis.url.pathname !== 'string') {\n return Reflect.apply(target, thisArg, argumentsList);\n }\n\n const pathParts = typedThis.url.pathname.split('/');\n const table = pathParts.length > 0 ? pathParts[pathParts.length - 1] : '';\n\n const queryItems: string[] = [];\n for (const [key, value] of typedThis.url.searchParams.entries()) {\n // It's possible to have multiple entries for the same key, eg. `id=eq.7&id=eq.3`,\n // so we need to use array instead of object to collect them.\n queryItems.push(translateFiltersIntoMethods(key, value));\n }\n const body: Record<string, unknown> = Object.create(null);\n if (isPlainObject(typedThis.body)) {\n for (const [key, value] of Object.entries(typedThis.body)) {\n body[key] = value;\n }\n }\n\n const client = getClient();\n const shouldSendData = _options.sendOperationData ?? client?.getDataCollectionOptions().userInfo === true;\n const bodyPayload = getMutationBodyPayloadForTelemetry(typedThis.body, body);\n\n // Adding operation to the beginning of the description if it's not a `select` operation\n // For example, it can be an `insert` or `update` operation but the query can be `select(...)`\n // For `select` operations, we don't need repeat it in the description\n const mutationPart =\n operation === 'select'\n ? ''\n : `${operation}${hasMutationBodyForDescription(typedThis.body, body) ? '(...) ' : ''}`;\n const queryPart = shouldSendData ? queryItems.join(' ') : queryItems.length > 0 ? '[redacted]' : '';\n const descriptionMiddle = [mutationPart.trimEnd(), queryPart].filter(Boolean).join(' ');\n const description = descriptionMiddle ? `${descriptionMiddle} from(${table})` : `from(${table})`;\n\n const attributes: Record<string, any> = {\n 'db.table': table,\n 'db.schema': typedThis.schema,\n 'db.url': typedThis.url.origin,\n 'db.sdk': typedThis.headers['X-Client-Info'],\n 'db.system': 'postgresql',\n 'db.operation': operation,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.db.supabase',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'db',\n };\n\n if (queryItems.length && shouldSendData) {\n attributes['db.query'] = queryItems;\n }\n\n if (bodyPayload !== undefined && shouldSendData) {\n attributes['db.body'] = bodyPayload;\n }\n\n return startSpan(\n {\n name: description,\n attributes,\n },\n span => {\n return (Reflect.apply(target, thisArg, []) as Promise<SupabaseResponse>)\n .then(\n (res: SupabaseResponse) => {\n if (span) {\n if (res && typeof res === 'object' && 'status' in res) {\n setHttpStatus(span, res.status || 500);\n }\n span.end();\n }\n\n if (res?.error) {\n const err = new Error(res.error.message) as SupabaseError;\n if (res.error.code) {\n err.code = res.error.code;\n }\n if (res.error.details) {\n err.details = res.error.details;\n }\n\n const supabaseContext: Record<string, any> = {};\n if (queryItems.length && shouldSendData) {\n supabaseContext.query = queryItems;\n }\n if (bodyPayload !== undefined && shouldSendData) {\n supabaseContext.body = bodyPayload;\n }\n\n captureException(err, scope => {\n scope.addEventProcessor(e => {\n addExceptionMechanism(e, {\n handled: false,\n type: 'auto.db.supabase.postgres',\n });\n\n return e;\n });\n\n scope.setContext('supabase', supabaseContext);\n\n return scope;\n });\n }\n\n const breadcrumb: SupabaseBreadcrumb = {\n type: 'supabase',\n category: `db.${operation}`,\n message: description,\n };\n\n const data: Record<string, unknown> = {};\n\n if (queryItems.length && shouldSendData) {\n data.query = queryItems;\n }\n\n if (bodyPayload !== undefined && shouldSendData) {\n data.body = bodyPayload;\n }\n\n if (Object.keys(data).length) {\n breadcrumb.data = data;\n }\n\n addBreadcrumb(breadcrumb);\n\n return res;\n },\n (err: Error) => {\n // TODO: shouldn't we capture this error?\n if (span) {\n setHttpStatus(span, 500);\n span.end();\n }\n throw err;\n },\n )\n .then(...argumentsList);\n },\n );\n },\n },\n );\n\n markAsInstrumented((PostgRESTFilterBuilder.prototype as unknown as PostgRESTProtoThenable).then);\n}\n\nfunction instrumentPostgRESTQueryBuilder(\n PostgRESTQueryBuilder: new () => PostgRESTQueryBuilder,\n _options: { sendOperationData?: boolean },\n): void {\n // We need to wrap _all_ operations despite them sharing the same `PostgRESTFilterBuilder`\n // constructor, as we don't know which method will be called first, and we don't want to miss any calls.\n for (const operation of DB_OPERATIONS_TO_INSTRUMENT) {\n if (isInstrumented((PostgRESTQueryBuilder.prototype as Record<string, any>)[operation])) {\n continue;\n }\n\n type PostgRESTOperation = keyof Pick<PostgRESTQueryBuilder, 'select' | 'insert' | 'upsert' | 'update' | 'delete'>;\n (PostgRESTQueryBuilder.prototype as Record<string, any>)[operation as PostgRESTOperation] = new Proxy(\n (PostgRESTQueryBuilder.prototype as Record<string, any>)[operation as PostgRESTOperation],\n {\n apply(target, thisArg, argumentsList) {\n const rv = Reflect.apply(target, thisArg, argumentsList);\n const PostgRESTFilterBuilder = (rv as PostgRESTFilterBuilder).constructor;\n\n DEBUG_BUILD && debug.log(`Instrumenting ${operation} operation's PostgRESTFilterBuilder`);\n\n instrumentPostgRESTFilterBuilder(PostgRESTFilterBuilder, _options);\n\n return rv;\n },\n },\n );\n\n markAsInstrumented((PostgRESTQueryBuilder.prototype as Record<string, any>)[operation]);\n }\n}\n\nexport const instrumentSupabaseClient = (\n supabaseClient: unknown,\n options: { sendOperationData?: boolean } = {},\n): void => {\n if (!supabaseClient) {\n DEBUG_BUILD && debug.warn('Supabase integration was not installed because no Supabase client was provided.');\n return;\n }\n const SupabaseClientConstructor =\n supabaseClient.constructor === Function ? supabaseClient : supabaseClient.constructor;\n\n instrumentSupabaseClientConstructor(SupabaseClientConstructor, options);\n instrumentSupabaseAuthClient(supabaseClient as SupabaseClientInstance);\n};\n\ninterface SupabaseIntegrationOptions {\n supabaseClient: any;\n /**\n * Whether to attach PostgREST query filters and mutation body payloads\n * to Sentry telemetry.\n *\n * Falls back to `dataCollection.userInfo` when not set.\n * @default undefined\n */\n sendOperationData?: boolean;\n}\n\nconst INTEGRATION_NAME = 'Supabase';\n\nconst _supabaseIntegration = ((supabaseClient: unknown, options: { sendOperationData?: boolean }) => {\n return {\n setupOnce() {\n instrumentSupabaseClient(supabaseClient, options);\n },\n name: INTEGRATION_NAME,\n };\n}) satisfies IntegrationFn;\n\nexport const supabaseIntegration = defineIntegration((options: SupabaseIntegrationOptions) => {\n return _supabaseIntegration(options.supabaseClient, { sendOperationData: options.sendOperationData });\n}) satisfies IntegrationFn;\n"],"names":[],"mappings":";;;;;;;;;;;;AAiBA,MAAM,6BAAA,GAAgC;AAAA,EACpC,gBAAA;AAAA,EACA,mBAAA;AAAA,EACA,iBAAA;AAAA,EACA,mBAAA;AAAA,EACA,eAAA;AAAA,EACA,oBAAA;AAAA,EACA,eAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF,CAAA;AAEA,MAAM,mCAAA,GAAsC;AAAA,EAC1C,YAAA;AAAA,EACA,YAAA;AAAA,EACA,WAAA;AAAA,EACA,aAAA;AAAA,EACA,gBAAA;AAAA,EACA;AACF,CAAA;AAEO,MAAM,eAAA,GAAkB;AAAA,EAC7B,EAAA,EAAI,IAAA;AAAA,EACJ,GAAA,EAAK,KAAA;AAAA,EACL,EAAA,EAAI,IAAA;AAAA,EACJ,GAAA,EAAK,KAAA;AAAA,EACL,EAAA,EAAI,IAAA;AAAA,EACJ,GAAA,EAAK,KAAA;AAAA,EACL,IAAA,EAAM,MAAA;AAAA,EACN,WAAA,EAAa,WAAA;AAAA,EACb,WAAA,EAAa,WAAA;AAAA,EACb,KAAA,EAAO,OAAA;AAAA,EACP,YAAA,EAAc,YAAA;AAAA,EACd,YAAA,EAAc,YAAA;AAAA,EACd,EAAA,EAAI,IAAA;AAAA,EACJ,EAAA,EAAI,IAAA;AAAA,EACJ,EAAA,EAAI,UAAA;AAAA,EACJ,EAAA,EAAI,aAAA;AAAA,EACJ,EAAA,EAAI,SAAA;AAAA,EACJ,GAAA,EAAK,UAAA;AAAA,EACL,EAAA,EAAI,SAAA;AAAA,EACJ,GAAA,EAAK,UAAA;AAAA,EACL,GAAA,EAAK,eAAA;AAAA,EACL,EA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mCAAA,CAAoC,2BAA2B,OAAO,CAAA;AACtE,EAAA,4BAAA,CAA6B,cAAwC,CAAA;AACvE;AAcA,MAAM,gBAAA,GAAmB,UAAA;AAEzB,MAAM,oBAAA,IAAwB,CAAC,cAAA,EAAyB,OAAA,KAA6C;AACnG,EAAA,OAAO;AAAA,IACL,SAAA,GAAY;AACV,MAAA,wBAAA,CAAyB,gBAAgB,OAAO,CAAA;AAAA,IAClD,CAAA;AAAA,IACA,IAAA,EAAM;AAAA,GACR;AACF,CAAA,CAAA;AAEO,MAAM,mBAAA,GAAsB,iBAAA,CAAkB,CAAC,OAAA,KAAwC;AAC5F,EAAA,OAAO,qBAAqB,OAAA,CAAQ,cAAA,EAAgB,EAAE,iBAAA,EAAmB,OAAA,CAAQ,mBAAmB,CAAA;AACtG,CAAC;;;;"}
@@ -2,20 +2,16 @@ import { defineIntegration } from '../integration.js';
2
2
  import { stripMetadataFromStackFrames, addMetadataToStackFrames } from '../metadata.js';
3
3
  import { forEachEnvelopeItem } from '../utils/envelope.js';
4
4
  import { getFramesFromEvent } from '../utils/stacktrace.js';
5
+ import { GLOBAL_OBJ } from '../utils/worldwide.js';
5
6
 
6
- /**
7
- * This integration allows you to filter out, or tag error events that do not come from user code marked with a bundle key via the Sentry bundler plugins.
8
- */
9
7
  const thirdPartyErrorFilterIntegration = defineIntegration((options) => {
10
8
  return {
11
- name: 'ThirdPartyErrorsFilter',
9
+ name: "ThirdPartyErrorsFilter",
12
10
  setup(client) {
13
- // We need to strip metadata from stack frames before sending them to Sentry since these are client side only.
14
- client.on('beforeEnvelope', envelope => {
11
+ client.on("beforeEnvelope", (envelope) => {
15
12
  forEachEnvelopeItem(envelope, (item, type) => {
16
- if (type === 'event') {
17
- const event = Array.isArray(item) ? (item )[1] : undefined;
18
-
13
+ if (type === "event") {
14
+ const event = Array.isArray(item) ? item[1] : void 0;
19
15
  if (event) {
20
16
  stripMetadataFromStackFrames(event);
21
17
  item[1] = event;
@@ -23,73 +19,65 @@ const thirdPartyErrorFilterIntegration = defineIntegration((options) => {
23
19
  }
24
20
  });
25
21
  });
26
-
27
- client.on('applyFrameMetadata', event => {
28
- // Only apply stack frame metadata to error events
22
+ client.on("applyFrameMetadata", (event) => {
29
23
  if (event.type) {
30
24
  return;
31
25
  }
32
-
33
26
  const stackParser = client.getOptions().stackParser;
34
27
  addMetadataToStackFrames(stackParser, event);
35
28
  });
36
29
  },
37
-
30
+ preprocessEvent(event) {
31
+ if (options.ignoreSentryInternalFrames && (GLOBAL_OBJ._sentryWrappedDepth ?? 0) > 0) {
32
+ event.sdkProcessingMetadata = {
33
+ ...event.sdkProcessingMetadata,
34
+ insideSentryWrapped: true
35
+ };
36
+ }
37
+ },
38
38
  processEvent(event) {
39
- const frameKeys = getBundleKeysForAllFramesWithFilenames(event, options.ignoreSentryInternalFrames);
40
-
39
+ const insideSentryWrapped = options.ignoreSentryInternalFrames ? event.sdkProcessingMetadata?.insideSentryWrapped === true && event.exception?.values?.length === 1 : false;
40
+ const frameKeys = getBundleKeysForAllFramesWithFilenames(
41
+ event,
42
+ options.ignoreSentryInternalFrames,
43
+ insideSentryWrapped
44
+ );
41
45
  if (frameKeys) {
42
- const arrayMethod =
43
- options.behaviour === 'drop-error-if-contains-third-party-frames' ||
44
- options.behaviour === 'apply-tag-if-contains-third-party-frames'
45
- ? 'some'
46
- : 'every';
47
-
48
- const behaviourApplies = frameKeys[arrayMethod](keys => !keys.some(key => options.filterKeys.includes(key)));
49
-
46
+ const arrayMethod = options.behaviour === "drop-error-if-contains-third-party-frames" || options.behaviour === "apply-tag-if-contains-third-party-frames" ? "some" : "every";
47
+ const behaviourApplies = frameKeys[arrayMethod]((keys) => !keys.some((key) => options.filterKeys.includes(key)));
50
48
  if (behaviourApplies) {
51
- const shouldDrop =
52
- options.behaviour === 'drop-error-if-contains-third-party-frames' ||
53
- options.behaviour === 'drop-error-if-exclusively-contains-third-party-frames';
49
+ const shouldDrop = options.behaviour === "drop-error-if-contains-third-party-frames" || options.behaviour === "drop-error-if-exclusively-contains-third-party-frames";
54
50
  if (shouldDrop) {
55
51
  return null;
56
52
  } else {
57
53
  event.tags = {
58
54
  ...event.tags,
59
- third_party_code: true,
55
+ third_party_code: true
60
56
  };
61
57
  }
62
58
  }
63
59
  }
64
-
65
60
  return event;
66
- },
61
+ }
67
62
  };
68
63
  });
69
-
70
- /**
71
- * Checks if a stack frame is a Sentry internal frame by strictly matching:
72
- * 1. The frame must be the last frame in the stack
73
- * 2. The filename must indicate the internal helpers file
74
- * 3. The context_line must contain the exact pattern "fn.apply(this, wrappedArguments)"
75
- * 4. The comment pattern "Attempt to invoke user-land function" must be present in pre_context
76
- *
77
- */
78
- function isSentryInternalFrame(frame, frameIndex) {
79
- // Only match the last frame (index 0 in reversed stack)
80
- if (frameIndex !== 0 || !frame.context_line || !frame.filename) {
64
+ function isSentryInternalFrame(frame, frameIndex, insideSentryWrapped) {
65
+ if (frameIndex !== 0) {
81
66
  return false;
82
67
  }
83
-
84
- if (
85
- !frame.filename.includes('sentry') ||
86
- !frame.filename.includes('helpers') || // Filename would look something like this: 'node_modules/@sentry/browser/build/npm/esm/helpers.js'
87
- !frame.context_line.includes(SENTRY_INTERNAL_FN_APPLY) // Must have context_line with the exact fn.apply pattern
88
- ) {
68
+ if (insideSentryWrapped && isLikelyMinifiedSentryWrappedFrame(frame)) {
69
+ return true;
70
+ }
71
+ if (frame.function === "sentryWrapped") {
72
+ return true;
73
+ }
74
+ if (!frame.context_line || !frame.filename) {
75
+ return false;
76
+ }
77
+ if (!frame.filename.includes("sentry") || !frame.filename.includes("helpers") || // Filename would look something like this: 'node_modules/@sentry/browser/build/npm/esm/helpers.js'
78
+ !frame.context_line.includes(SENTRY_INTERNAL_FN_APPLY)) {
89
79
  return false;
90
80
  }
91
-
92
- // Check pre_context array for comment pattern
93
81
  if (frame.pre_context) {
94
82
  const len = frame.pre_context.length;
95
83
  for (let i = 0; i < len; i++) {
@@ -98,47 +86,34 @@ function isSentryInternalFrame(frame, frameIndex) {
98
86
  }
99
87
  }
100
88
  }
101
-
102
89
  return false;
103
90
  }
104
-
105
- function getBundleKeysForAllFramesWithFilenames(
106
- event,
107
- ignoreSentryInternalFrames,
108
- ) {
91
+ function getBundleKeysForAllFramesWithFilenames(event, ignoreSentryInternalFrames, insideSentryWrapped) {
109
92
  const frames = getFramesFromEvent(event);
110
-
111
93
  if (!frames) {
112
- return undefined;
94
+ return void 0;
113
95
  }
114
-
115
- return frames
116
- .filter((frame, index) => {
117
- // Exclude frames without a filename
118
- if (!frame.filename) {
119
- return false;
120
- }
121
- // Exclude frames without location info, since these are likely native code or built-ins.
122
- // JS frames have lineno/colno, WASM frames have instruction_addr instead.
123
- if (frame.lineno == null && frame.colno == null && frame.instruction_addr == null) {
124
- return false;
125
- }
126
- // Optionally ignore Sentry internal frames
127
- return !ignoreSentryInternalFrames || !isSentryInternalFrame(frame, index);
128
- })
129
- .map(frame => {
130
- if (!frame.module_metadata) {
131
- return [];
132
- }
133
- return Object.keys(frame.module_metadata)
134
- .filter(key => key.startsWith(BUNDLER_PLUGIN_APP_KEY_PREFIX))
135
- .map(key => key.slice(BUNDLER_PLUGIN_APP_KEY_PREFIX.length));
136
- });
96
+ return frames.filter((frame, index) => {
97
+ if (!frame.filename) {
98
+ return false;
99
+ }
100
+ if (frame.lineno == null && frame.colno == null && frame.instruction_addr == null) {
101
+ return false;
102
+ }
103
+ return !ignoreSentryInternalFrames || !isSentryInternalFrame(frame, index, !!insideSentryWrapped);
104
+ }).map((frame) => {
105
+ if (!frame.module_metadata) {
106
+ return [];
107
+ }
108
+ return Object.keys(frame.module_metadata).filter((key) => key.startsWith(BUNDLER_PLUGIN_APP_KEY_PREFIX)).map((key) => key.slice(BUNDLER_PLUGIN_APP_KEY_PREFIX.length));
109
+ });
137
110
  }
138
-
139
- const BUNDLER_PLUGIN_APP_KEY_PREFIX = '_sentryBundlerPluginAppKey:';
140
- const SENTRY_INTERNAL_COMMENT = 'Attempt to invoke user-land function';
141
- const SENTRY_INTERNAL_FN_APPLY = 'fn.apply(this, wrappedArguments)';
111
+ function isLikelyMinifiedSentryWrappedFrame(frame) {
112
+ return !frame.context_line && !frame.pre_context && !!frame.function && frame.function.length <= 2;
113
+ }
114
+ const BUNDLER_PLUGIN_APP_KEY_PREFIX = "_sentryBundlerPluginAppKey:";
115
+ const SENTRY_INTERNAL_COMMENT = "Attempt to invoke user-land function";
116
+ const SENTRY_INTERNAL_FN_APPLY = "fn.apply(this, wrappedArguments)";
142
117
 
143
118
  export { thirdPartyErrorFilterIntegration };
144
119
  //# sourceMappingURL=third-party-errors-filter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"third-party-errors-filter.js","sources":["../../../src/integrations/third-party-errors-filter.ts"],"sourcesContent":["import { defineIntegration } from '../integration';\nimport { addMetadataToStackFrames, stripMetadataFromStackFrames } from '../metadata';\nimport type { EventItem } from '../types-hoist/envelope';\nimport type { Event } from '../types-hoist/event';\nimport type { StackFrame } from '../types-hoist/stackframe';\nimport { forEachEnvelopeItem } from '../utils/envelope';\nimport { getFramesFromEvent } from '../utils/stacktrace';\n\ninterface Options {\n /**\n * Keys that have been provided in the Sentry bundler plugin via the the `applicationKey` option, identifying your bundles.\n *\n * - Webpack plugin: https://www.npmjs.com/package/@sentry/webpack-plugin#applicationkey\n * - Vite plugin: https://www.npmjs.com/package/@sentry/vite-plugin#applicationkey\n * - Esbuild plugin: https://www.npmjs.com/package/@sentry/esbuild-plugin#applicationkey\n * - Rollup plugin: https://www.npmjs.com/package/@sentry/rollup-plugin#applicationkey\n */\n filterKeys: string[];\n\n /**\n * Defines how the integration should behave. \"Third-Party Stack Frames\" are stack frames that did not come from files marked with a matching bundle key.\n *\n * You can define the behaviour with one of 4 modes:\n * - `drop-error-if-contains-third-party-frames`: Drop error events that contain at least one third-party stack frame.\n * - `drop-error-if-exclusively-contains-third-party-frames`: Drop error events that exclusively contain third-party stack frames.\n * - `apply-tag-if-contains-third-party-frames`: Keep all error events, but apply a `third_party_code: true` tag in case the error contains at least one third-party stack frame.\n * - `apply-tag-if-exclusively-contains-third-party-frames`: Keep all error events, but apply a `third_party_code: true` tag in case the error contains exclusively third-party stack frames.\n *\n * If you chose the mode to only apply tags, the tags can then be used in Sentry to filter your issue stream by entering `!third_party_code:True` in the search bar.\n */\n behaviour:\n | 'drop-error-if-contains-third-party-frames'\n | 'drop-error-if-exclusively-contains-third-party-frames'\n | 'apply-tag-if-contains-third-party-frames'\n | 'apply-tag-if-exclusively-contains-third-party-frames';\n\n /**\n * @experimental\n * If set to true, the integration will ignore frames that are internal to the Sentry SDK from the third-party frame detection.\n * Note that enabling this option might lead to errors being misclassified as third-party errors.\n */\n ignoreSentryInternalFrames?: boolean;\n}\n\n/**\n * This integration allows you to filter out, or tag error events that do not come from user code marked with a bundle key via the Sentry bundler plugins.\n */\nexport const thirdPartyErrorFilterIntegration = defineIntegration((options: Options) => {\n return {\n name: 'ThirdPartyErrorsFilter',\n setup(client) {\n // We need to strip metadata from stack frames before sending them to Sentry since these are client side only.\n client.on('beforeEnvelope', envelope => {\n forEachEnvelopeItem(envelope, (item, type) => {\n if (type === 'event') {\n const event = Array.isArray(item) ? (item as EventItem)[1] : undefined;\n\n if (event) {\n stripMetadataFromStackFrames(event);\n item[1] = event;\n }\n }\n });\n });\n\n client.on('applyFrameMetadata', event => {\n // Only apply stack frame metadata to error events\n if (event.type) {\n return;\n }\n\n const stackParser = client.getOptions().stackParser;\n addMetadataToStackFrames(stackParser, event);\n });\n },\n\n processEvent(event) {\n const frameKeys = getBundleKeysForAllFramesWithFilenames(event, options.ignoreSentryInternalFrames);\n\n if (frameKeys) {\n const arrayMethod =\n options.behaviour === 'drop-error-if-contains-third-party-frames' ||\n options.behaviour === 'apply-tag-if-contains-third-party-frames'\n ? 'some'\n : 'every';\n\n const behaviourApplies = frameKeys[arrayMethod](keys => !keys.some(key => options.filterKeys.includes(key)));\n\n if (behaviourApplies) {\n const shouldDrop =\n options.behaviour === 'drop-error-if-contains-third-party-frames' ||\n options.behaviour === 'drop-error-if-exclusively-contains-third-party-frames';\n if (shouldDrop) {\n return null;\n } else {\n event.tags = {\n ...event.tags,\n third_party_code: true,\n };\n }\n }\n }\n\n return event;\n },\n };\n});\n\n/**\n * Checks if a stack frame is a Sentry internal frame by strictly matching:\n * 1. The frame must be the last frame in the stack\n * 2. The filename must indicate the internal helpers file\n * 3. The context_line must contain the exact pattern \"fn.apply(this, wrappedArguments)\"\n * 4. The comment pattern \"Attempt to invoke user-land function\" must be present in pre_context\n *\n */\nfunction isSentryInternalFrame(frame: StackFrame, frameIndex: number): boolean {\n // Only match the last frame (index 0 in reversed stack)\n if (frameIndex !== 0 || !frame.context_line || !frame.filename) {\n return false;\n }\n\n if (\n !frame.filename.includes('sentry') ||\n !frame.filename.includes('helpers') || // Filename would look something like this: 'node_modules/@sentry/browser/build/npm/esm/helpers.js'\n !frame.context_line.includes(SENTRY_INTERNAL_FN_APPLY) // Must have context_line with the exact fn.apply pattern\n ) {\n return false;\n }\n\n // Check pre_context array for comment pattern\n if (frame.pre_context) {\n const len = frame.pre_context.length;\n for (let i = 0; i < len; i++) {\n if (frame.pre_context[i]?.includes(SENTRY_INTERNAL_COMMENT)) {\n return true;\n }\n }\n }\n\n return false;\n}\n\nfunction getBundleKeysForAllFramesWithFilenames(\n event: Event,\n ignoreSentryInternalFrames?: boolean,\n): string[][] | undefined {\n const frames = getFramesFromEvent(event);\n\n if (!frames) {\n return undefined;\n }\n\n return frames\n .filter((frame, index) => {\n // Exclude frames without a filename\n if (!frame.filename) {\n return false;\n }\n // Exclude frames without location info, since these are likely native code or built-ins.\n // JS frames have lineno/colno, WASM frames have instruction_addr instead.\n if (frame.lineno == null && frame.colno == null && frame.instruction_addr == null) {\n return false;\n }\n // Optionally ignore Sentry internal frames\n return !ignoreSentryInternalFrames || !isSentryInternalFrame(frame, index);\n })\n .map(frame => {\n if (!frame.module_metadata) {\n return [];\n }\n return Object.keys(frame.module_metadata)\n .filter(key => key.startsWith(BUNDLER_PLUGIN_APP_KEY_PREFIX))\n .map(key => key.slice(BUNDLER_PLUGIN_APP_KEY_PREFIX.length));\n });\n}\n\nconst BUNDLER_PLUGIN_APP_KEY_PREFIX = '_sentryBundlerPluginAppKey:';\nconst SENTRY_INTERNAL_COMMENT = 'Attempt to invoke user-land function';\nconst SENTRY_INTERNAL_FN_APPLY = 'fn.apply(this, wrappedArguments)';\n"],"names":[],"mappings":";;;;;AA4CA;AACA;AACA;AACO,MAAM,mCAAmC,iBAAiB,CAAC,CAAC,OAAO,KAAc;AACxF,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,wBAAwB;AAClC,IAAI,KAAK,CAAC,MAAM,EAAE;AAClB;AACA,MAAM,MAAM,CAAC,EAAE,CAAC,gBAAgB,EAAE,YAAY;AAC9C,QAAQ,mBAAmB,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK;AACtD,UAAU,IAAI,IAAA,KAAS,OAAO,EAAE;AAChC,YAAY,MAAM,KAAA,GAAQ,KAAK,CAAC,OAAO,CAAC,IAAI,CAAA,GAAI,CAAC,IAAA,GAAmB,CAAC,CAAA,GAAI,SAAS;;AAElF,YAAY,IAAI,KAAK,EAAE;AACvB,cAAc,4BAA4B,CAAC,KAAK,CAAC;AACjD,cAAc,IAAI,CAAC,CAAC,CAAA,GAAI,KAAK;AAC7B,YAAY;AACZ,UAAU;AACV,QAAQ,CAAC,CAAC;AACV,MAAM,CAAC,CAAC;;AAER,MAAM,MAAM,CAAC,EAAE,CAAC,oBAAoB,EAAE,SAAS;AAC/C;AACA,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE;AACxB,UAAU;AACV,QAAQ;;AAER,QAAQ,MAAM,cAAc,MAAM,CAAC,UAAU,EAAE,CAAC,WAAW;AAC3D,QAAQ,wBAAwB,CAAC,WAAW,EAAE,KAAK,CAAC;AACpD,MAAM,CAAC,CAAC;AACR,IAAI,CAAC;;AAEL,IAAI,YAAY,CAAC,KAAK,EAAE;AACxB,MAAM,MAAM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,OAAO,EAAE;AACjB,MAAM;AACN,MAAM,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe;AAC9C,SAAS,MAAM,CAAC,GAAA,IAAO,GAAG,CAAC,UAAU,CAAC,6BAA6B,CAAC;AACpE,SAAS,GAAG,CAAC,GAAA,IAAO,GAAG,CAAC,KAAK,CAAC,6BAA6B,CAAC,MAAM,CAAC,CAAC;AACpE,IAAI,CAAC,CAAC;AACN;;AAEA,MAAM,6BAAA,GAAgC,6BAA6B;AACnE,MAAM,uBAAA,GAA0B,sCAAsC;AACtE,MAAM,wBAAA,GAA2B,kCAAkC;;;;"}
1
+ {"version":3,"file":"third-party-errors-filter.js","sources":["../../../src/integrations/third-party-errors-filter.ts"],"sourcesContent":["import { defineIntegration } from '../integration';\nimport { addMetadataToStackFrames, stripMetadataFromStackFrames } from '../metadata';\nimport type { EventItem } from '../types/envelope';\nimport type { Event } from '../types/event';\nimport type { StackFrame } from '../types/stackframe';\nimport { forEachEnvelopeItem } from '../utils/envelope';\nimport { getFramesFromEvent } from '../utils/stacktrace';\nimport { GLOBAL_OBJ } from '../utils/worldwide';\n\ninterface Options {\n /**\n * Keys that have been provided in the Sentry bundler plugin via the the `applicationKey` option, identifying your bundles.\n *\n * - Webpack plugin: https://www.npmjs.com/package/@sentry/webpack-plugin#applicationkey\n * - Vite plugin: https://www.npmjs.com/package/@sentry/vite-plugin#applicationkey\n * - Esbuild plugin: https://www.npmjs.com/package/@sentry/esbuild-plugin#applicationkey\n * - Rollup plugin: https://www.npmjs.com/package/@sentry/rollup-plugin#applicationkey\n */\n filterKeys: string[];\n\n /**\n * Defines how the integration should behave. \"Third-Party Stack Frames\" are stack frames that did not come from files marked with a matching bundle key.\n *\n * You can define the behaviour with one of 4 modes:\n * - `drop-error-if-contains-third-party-frames`: Drop error events that contain at least one third-party stack frame.\n * - `drop-error-if-exclusively-contains-third-party-frames`: Drop error events that exclusively contain third-party stack frames.\n * - `apply-tag-if-contains-third-party-frames`: Keep all error events, but apply a `third_party_code: true` tag in case the error contains at least one third-party stack frame.\n * - `apply-tag-if-exclusively-contains-third-party-frames`: Keep all error events, but apply a `third_party_code: true` tag in case the error contains exclusively third-party stack frames.\n *\n * If you chose the mode to only apply tags, the tags can then be used in Sentry to filter your issue stream by entering `!third_party_code:True` in the search bar.\n */\n behaviour:\n | 'drop-error-if-contains-third-party-frames'\n | 'drop-error-if-exclusively-contains-third-party-frames'\n | 'apply-tag-if-contains-third-party-frames'\n | 'apply-tag-if-exclusively-contains-third-party-frames';\n\n /**\n * @experimental\n * If set to true, the integration will ignore frames that are internal to the Sentry SDK from the third-party frame detection.\n * Note that enabling this option might lead to errors being misclassified as third-party errors.\n */\n ignoreSentryInternalFrames?: boolean;\n}\n\n/**\n * This integration allows you to filter out, or tag error events that do not come from user code marked with a bundle key via the Sentry bundler plugins.\n */\nexport const thirdPartyErrorFilterIntegration = defineIntegration((options: Options) => {\n return {\n name: 'ThirdPartyErrorsFilter',\n setup(client) {\n // We need to strip metadata from stack frames before sending them to Sentry since these are client side only.\n client.on('beforeEnvelope', envelope => {\n forEachEnvelopeItem(envelope, (item, type) => {\n if (type === 'event') {\n const event = Array.isArray(item) ? (item as EventItem)[1] : undefined;\n\n if (event) {\n stripMetadataFromStackFrames(event);\n item[1] = event;\n }\n }\n });\n });\n\n client.on('applyFrameMetadata', event => {\n // Only apply stack frame metadata to error events\n if (event.type) {\n return;\n }\n\n const stackParser = client.getOptions().stackParser;\n addMetadataToStackFrames(stackParser, event);\n });\n },\n\n preprocessEvent(event) {\n // Snapshot the depth counter onto the event before any event processors run.\n // This is necessary because async event processors could cause the finally block\n // in sentryWrapped to decrement the counter before processEvent reads it.\n if (options.ignoreSentryInternalFrames && (GLOBAL_OBJ._sentryWrappedDepth ?? 0) > 0) {\n event.sdkProcessingMetadata = {\n ...event.sdkProcessingMetadata,\n insideSentryWrapped: true,\n };\n }\n },\n\n processEvent(event) {\n const insideSentryWrapped = options.ignoreSentryInternalFrames\n ? event.sdkProcessingMetadata?.insideSentryWrapped === true && event.exception?.values?.length === 1\n : false;\n const frameKeys = getBundleKeysForAllFramesWithFilenames(\n event,\n options.ignoreSentryInternalFrames,\n insideSentryWrapped,\n );\n\n if (frameKeys) {\n const arrayMethod =\n options.behaviour === 'drop-error-if-contains-third-party-frames' ||\n options.behaviour === 'apply-tag-if-contains-third-party-frames'\n ? 'some'\n : 'every';\n\n const behaviourApplies = frameKeys[arrayMethod](keys => !keys.some(key => options.filterKeys.includes(key)));\n\n if (behaviourApplies) {\n const shouldDrop =\n options.behaviour === 'drop-error-if-contains-third-party-frames' ||\n options.behaviour === 'drop-error-if-exclusively-contains-third-party-frames';\n if (shouldDrop) {\n return null;\n } else {\n event.tags = {\n ...event.tags,\n third_party_code: true,\n };\n }\n }\n }\n\n return event;\n },\n };\n});\n\n/** Checks if a frame is Sentry-internal via runtime depth, function name, or source patterns. */\nfunction isSentryInternalFrame(frame: StackFrame, frameIndex: number, insideSentryWrapped: boolean): boolean {\n // Only match the last frame (index 0 in reversed stack)\n if (frameIndex !== 0) {\n return false;\n }\n\n // When processEvent runs inside a sentryWrapped call and the frame looks minified,\n // the outermost frame is the sentryWrapped function with a mangled name.\n // We gate on minified shape to avoid false positives in non-minified builds\n // where stripSentryFramesAndReverse already removed the sentryWrapped frame.\n if (insideSentryWrapped && isLikelyMinifiedSentryWrappedFrame(frame)) {\n return true;\n }\n\n // Match by function name (works when function names survive bundling but source patterns don't)\n if (frame.function === 'sentryWrapped') {\n return true;\n }\n\n if (!frame.context_line || !frame.filename) {\n return false;\n }\n\n // Match by source code patterns (works in development / unbundled builds)\n if (\n !frame.filename.includes('sentry') ||\n !frame.filename.includes('helpers') || // Filename would look something like this: 'node_modules/@sentry/browser/build/npm/esm/helpers.js'\n !frame.context_line.includes(SENTRY_INTERNAL_FN_APPLY) // Must have context_line with the exact fn.apply pattern\n ) {\n return false;\n }\n\n // Check pre_context array for comment pattern\n if (frame.pre_context) {\n const len = frame.pre_context.length;\n for (let i = 0; i < len; i++) {\n if (frame.pre_context[i]?.includes(SENTRY_INTERNAL_COMMENT)) {\n return true;\n }\n }\n }\n\n return false;\n}\n\nfunction getBundleKeysForAllFramesWithFilenames(\n event: Event,\n ignoreSentryInternalFrames?: boolean,\n insideSentryWrapped?: boolean,\n): string[][] | undefined {\n const frames = getFramesFromEvent(event);\n\n if (!frames) {\n return undefined;\n }\n\n return frames\n .filter((frame, index) => {\n // Exclude frames without a filename\n if (!frame.filename) {\n return false;\n }\n // Exclude frames without location info, since these are likely native code or built-ins.\n // JS frames have lineno/colno, WASM frames have instruction_addr instead.\n if (frame.lineno == null && frame.colno == null && frame.instruction_addr == null) {\n return false;\n }\n // Optionally ignore Sentry internal frames\n return !ignoreSentryInternalFrames || !isSentryInternalFrame(frame, index, !!insideSentryWrapped);\n })\n .map(frame => {\n if (!frame.module_metadata) {\n return [];\n }\n return Object.keys(frame.module_metadata)\n .filter(key => key.startsWith(BUNDLER_PLUGIN_APP_KEY_PREFIX))\n .map(key => key.slice(BUNDLER_PLUGIN_APP_KEY_PREFIX.length));\n });\n}\n\nfunction isLikelyMinifiedSentryWrappedFrame(frame: StackFrame): boolean {\n return !frame.context_line && !frame.pre_context && !!frame.function && frame.function.length <= 2;\n}\n\nconst BUNDLER_PLUGIN_APP_KEY_PREFIX = '_sentryBundlerPluginAppKey:';\nconst SENTRY_INTERNAL_COMMENT = 'Attempt to invoke user-land function';\nconst SENTRY_INTERNAL_FN_APPLY = 'fn.apply(this, wrappedArguments)';\n"],"names":[],"mappings":";;;;;;AAgDO,MAAM,gCAAA,GAAmC,iBAAA,CAAkB,CAAC,OAAA,KAAqB;AACtF,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,wBAAA;AAAA,IACN,MAAM,MAAA,EAAQ;AAEZ,MAAA,MAAA,CAAO,EAAA,CAAG,kBAAkB,CAAA,QAAA,KAAY;AACtC,QAAA,mBAAA,CAAoB,QAAA,EAAU,CAAC,IAAA,EAAM,IAAA,KAAS;AAC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CAAA,CACrC,MAAA,CAAO,SAAO,GAAA,CAAI,UAAA,CAAW,6BAA6B,CAAC,EAC3D,GAAA,CAAI,CAAA,GAAA,KAAO,IAAI,KAAA,CAAM,6BAAA,CAA8B,MAAM,CAAC,CAAA;AAAA,EAC/D,CAAC,CAAA;AACL;AAEA,SAAS,mCAAmC,KAAA,EAA4B;AACtE,EAAA,OAAO,CAAC,KAAA,CAAM,YAAA,IAAgB,CAAC,KAAA,CAAM,WAAA,IAAe,CAAC,CAAC,KAAA,CAAM,QAAA,IAAY,KAAA,CAAM,QAAA,CAAS,MAAA,IAAU,CAAA;AACnG;AAEA,MAAM,6BAAA,GAAgC,6BAAA;AACtC,MAAM,uBAAA,GAA0B,sCAAA;AAChC,MAAM,wBAAA,GAA2B,kCAAA;;;;"}
@@ -3,135 +3,66 @@ import { isError } from '../utils/is.js';
3
3
  import { truncate } from '../utils/string.js';
4
4
 
5
5
  const DEFAULT_LIMIT = 10;
6
- const INTEGRATION_NAME = 'ZodErrors';
7
-
8
- /**
9
- * Simplified ZodIssue type definition
10
- */
11
-
6
+ const INTEGRATION_NAME = "ZodErrors";
12
7
  function originalExceptionIsZodError(originalException) {
13
- return (
14
- isError(originalException) &&
15
- originalException.name === 'ZodError' &&
16
- Array.isArray((originalException ).issues)
17
- );
8
+ return isError(originalException) && originalException.name === "ZodError" && Array.isArray(originalException.issues);
18
9
  }
19
-
20
- /**
21
- * Formats child objects or arrays to a string
22
- * that is preserved when sent to Sentry.
23
- *
24
- * Without this, we end up with something like this in Sentry:
25
- *
26
- * [
27
- * [Object],
28
- * [Object],
29
- * [Object],
30
- * [Object]
31
- * ]
32
- */
33
10
  function flattenIssue(issue) {
34
11
  return {
35
12
  ...issue,
36
- path: 'path' in issue && Array.isArray(issue.path) ? issue.path.join('.') : undefined,
37
- keys: 'keys' in issue ? JSON.stringify(issue.keys) : undefined,
38
- unionErrors: 'unionErrors' in issue ? JSON.stringify(issue.unionErrors) : undefined,
13
+ path: "path" in issue && Array.isArray(issue.path) ? issue.path.join(".") : void 0,
14
+ keys: "keys" in issue ? JSON.stringify(issue.keys) : void 0,
15
+ unionErrors: "unionErrors" in issue ? JSON.stringify(issue.unionErrors) : void 0
39
16
  };
40
17
  }
41
-
42
- /**
43
- * Takes ZodError issue path array and returns a flattened version as a string.
44
- * This makes it easier to display paths within a Sentry error message.
45
- *
46
- * Array indexes are normalized to reduce duplicate entries
47
- *
48
- * @param path ZodError issue path
49
- * @returns flattened path
50
- *
51
- * @example
52
- * flattenIssuePath([0, 'foo', 1, 'bar']) // -> '<array>.foo.<array>.bar'
53
- */
54
18
  function flattenIssuePath(path) {
55
- return path
56
- .map(p => {
57
- if (typeof p === 'number') {
58
- return '<array>';
59
- } else {
60
- return p;
61
- }
62
- })
63
- .join('.');
19
+ return path.map((p) => {
20
+ if (typeof p === "number") {
21
+ return "<array>";
22
+ } else {
23
+ return p;
24
+ }
25
+ }).join(".");
64
26
  }
65
-
66
- /**
67
- * Zod error message is a stringified version of ZodError.issues
68
- * This doesn't display well in the Sentry UI. Replace it with something shorter.
69
- */
70
27
  function formatIssueMessage(zodError) {
71
- const errorKeyMap = new Set();
28
+ const errorKeyMap = /* @__PURE__ */ new Set();
72
29
  for (const iss of zodError.issues) {
73
30
  const issuePath = flattenIssuePath(iss.path);
74
31
  if (issuePath.length > 0) {
75
32
  errorKeyMap.add(issuePath);
76
33
  }
77
34
  }
78
-
79
35
  const errorKeys = Array.from(errorKeyMap);
80
36
  if (errorKeys.length === 0) {
81
- // If there are no keys, then we're likely validating the root
82
- // variable rather than a key within an object. This attempts
83
- // to extract what type it was that failed to validate.
84
- // For example, z.string().parse(123) would return "string" here.
85
- let rootExpectedType = 'variable';
37
+ let rootExpectedType = "variable";
86
38
  if (zodError.issues.length > 0) {
87
39
  const iss = zodError.issues[0];
88
- if (iss !== undefined && 'expected' in iss && typeof iss.expected === 'string') {
40
+ if (iss !== void 0 && "expected" in iss && typeof iss.expected === "string") {
89
41
  rootExpectedType = iss.expected;
90
42
  }
91
43
  }
92
44
  return `Failed to validate ${rootExpectedType}`;
93
45
  }
94
- return `Failed to validate keys: ${truncate(errorKeys.join(', '), 100)}`;
46
+ return `Failed to validate keys: ${truncate(errorKeys.join(", "), 100)}`;
95
47
  }
96
-
97
- /**
98
- * Applies ZodError issues to an event extra and replaces the error message
99
- */
100
- function applyZodErrorsToEvent(
101
- limit,
102
- saveZodIssuesAsAttachment = false,
103
- event,
104
- hint,
105
- ) {
106
- if (
107
- !event.exception?.values ||
108
- !hint.originalException ||
109
- !originalExceptionIsZodError(hint.originalException) ||
110
- hint.originalException.issues.length === 0
111
- ) {
48
+ function applyZodErrorsToEvent(limit, saveZodIssuesAsAttachment = false, event, hint) {
49
+ if (!event.exception?.values || !hint.originalException || !originalExceptionIsZodError(hint.originalException) || hint.originalException.issues.length === 0) {
112
50
  return event;
113
51
  }
114
-
115
52
  try {
116
- const issuesToFlatten = saveZodIssuesAsAttachment
117
- ? hint.originalException.issues
118
- : hint.originalException.issues.slice(0, limit);
53
+ const issuesToFlatten = saveZodIssuesAsAttachment ? hint.originalException.issues : hint.originalException.issues.slice(0, limit);
119
54
  const flattenedIssues = issuesToFlatten.map(flattenIssue);
120
-
121
55
  if (saveZodIssuesAsAttachment) {
122
- // Sometimes having the full error details can be helpful.
123
- // Attachments have much higher limits, so we can include the full list of issues.
124
56
  if (!Array.isArray(hint.attachments)) {
125
57
  hint.attachments = [];
126
58
  }
127
59
  hint.attachments.push({
128
- filename: 'zod_issues.json',
60
+ filename: "zod_issues.json",
129
61
  data: JSON.stringify({
130
- issues: flattenedIssues,
131
- }),
62
+ issues: flattenedIssues
63
+ })
132
64
  });
133
65
  }
134
-
135
66
  return {
136
67
  ...event,
137
68
  exception: {
@@ -139,47 +70,40 @@ function applyZodErrorsToEvent(
139
70
  values: [
140
71
  {
141
72
  ...event.exception.values[0],
142
- value: formatIssueMessage(hint.originalException),
73
+ value: formatIssueMessage(hint.originalException)
143
74
  },
144
- ...event.exception.values.slice(1),
145
- ],
75
+ ...event.exception.values.slice(1)
76
+ ]
146
77
  },
147
78
  extra: {
148
79
  ...event.extra,
149
- 'zoderror.issues': flattenedIssues.slice(0, limit),
150
- },
80
+ "zoderror.issues": flattenedIssues.slice(0, limit)
81
+ }
151
82
  };
152
83
  } catch (e) {
153
- // Hopefully we never throw errors here, but record it
154
- // with the event just in case.
155
84
  return {
156
85
  ...event,
157
86
  extra: {
158
87
  ...event.extra,
159
- 'zoderrors sentry integration parse error': {
160
- message: 'an exception was thrown while processing ZodError within applyZodErrorsToEvent()',
161
- error: e instanceof Error ? `${e.name}: ${e.message}\n${e.stack}` : 'unknown',
162
- },
163
- },
88
+ "zoderrors sentry integration parse error": {
89
+ message: "an exception was thrown while processing ZodError within applyZodErrorsToEvent()",
90
+ error: e instanceof Error ? `${e.name}: ${e.message}
91
+ ${e.stack}` : "unknown"
92
+ }
93
+ }
164
94
  };
165
95
  }
166
96
  }
167
-
168
97
  const _zodErrorsIntegration = ((options = {}) => {
169
98
  const limit = options.limit ?? DEFAULT_LIMIT;
170
-
171
99
  return {
172
100
  name: INTEGRATION_NAME,
173
101
  processEvent(originalEvent, hint) {
174
102
  const processedEvent = applyZodErrorsToEvent(limit, options.saveZodIssuesAsAttachment, originalEvent, hint);
175
103
  return processedEvent;
176
- },
104
+ }
177
105
  };
178
- }) ;
179
-
180
- /**
181
- * Sentry integration to process Zod errors, making them easier to work with in Sentry.
182
- */
106
+ });
183
107
  const zodErrorsIntegration = defineIntegration(_zodErrorsIntegration);
184
108
 
185
109
  export { applyZodErrorsToEvent, flattenIssue, flattenIssuePath, formatIssueMessage, zodErrorsIntegration };