@sentry/browser 10.24.0 → 10.26.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 (450) hide show
  1. package/build/npm/cjs/dev/client.js.map +1 -0
  2. package/build/npm/cjs/dev/debug-build.js.map +1 -0
  3. package/build/npm/cjs/dev/diagnose-sdk.js.map +1 -0
  4. package/build/npm/cjs/dev/eventbuilder.js.map +1 -0
  5. package/build/npm/cjs/dev/feedbackAsync.js.map +1 -0
  6. package/build/npm/cjs/dev/feedbackSync.js.map +1 -0
  7. package/build/npm/cjs/dev/helpers.js.map +1 -0
  8. package/build/npm/cjs/dev/integrations/breadcrumbs.js.map +1 -0
  9. package/build/npm/cjs/dev/integrations/browserapierrors.js.map +1 -0
  10. package/build/npm/cjs/dev/integrations/browsersession.js.map +1 -0
  11. package/build/npm/cjs/dev/integrations/contextlines.js.map +1 -0
  12. package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js.map +1 -0
  13. package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
  14. package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js.map +1 -0
  15. package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js.map +1 -0
  16. package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js.map +1 -0
  17. package/build/npm/cjs/{integrations → dev/integrations}/globalhandlers.js +1 -1
  18. package/build/npm/cjs/dev/integrations/globalhandlers.js.map +1 -0
  19. package/build/npm/cjs/dev/integrations/graphqlClient.js.map +1 -0
  20. package/build/npm/cjs/dev/integrations/httpclient.js.map +1 -0
  21. package/build/npm/cjs/dev/integrations/httpcontext.js.map +1 -0
  22. package/build/npm/cjs/dev/integrations/linkederrors.js.map +1 -0
  23. package/build/npm/cjs/dev/integrations/reportingobserver.js.map +1 -0
  24. package/build/npm/cjs/dev/integrations/spotlight.js.map +1 -0
  25. package/build/npm/cjs/dev/integrations/webWorker.js.map +1 -0
  26. package/build/npm/cjs/{profiling/lifecycleMode/traceLifecycleProfiler.js → dev/profiling/UIProfiler.js} +73 -75
  27. package/build/npm/cjs/dev/profiling/UIProfiler.js.map +1 -0
  28. package/build/npm/cjs/{profiling → dev/profiling}/integration.js +5 -5
  29. package/build/npm/cjs/dev/profiling/integration.js.map +1 -0
  30. package/build/npm/cjs/dev/profiling/startProfileForSpan.js.map +1 -0
  31. package/build/npm/cjs/dev/profiling/utils.js.map +1 -0
  32. package/build/npm/cjs/dev/report-dialog.js.map +1 -0
  33. package/build/npm/cjs/dev/sdk.js +133 -0
  34. package/build/npm/cjs/dev/sdk.js.map +1 -0
  35. package/build/npm/cjs/dev/stack-parsers.js.map +1 -0
  36. package/build/npm/cjs/dev/tracing/backgroundtab.js.map +1 -0
  37. package/build/npm/cjs/dev/tracing/browserTracingIntegration.js.map +1 -0
  38. package/build/npm/cjs/{tracing → dev/tracing}/linkedTraces.js +1 -0
  39. package/build/npm/cjs/dev/tracing/linkedTraces.js.map +1 -0
  40. package/build/npm/cjs/dev/tracing/reportPageLoaded.js.map +1 -0
  41. package/build/npm/cjs/dev/tracing/request.js.map +1 -0
  42. package/build/npm/cjs/dev/tracing/setActiveSpan.js.map +1 -0
  43. package/build/npm/cjs/dev/tracing/utils.js.map +1 -0
  44. package/build/npm/cjs/dev/transports/fetch.js.map +1 -0
  45. package/build/npm/cjs/dev/transports/offline.js.map +1 -0
  46. package/build/npm/cjs/dev/userfeedback.js.map +1 -0
  47. package/build/npm/cjs/dev/utils/detectBrowserExtension.js.map +1 -0
  48. package/build/npm/cjs/dev/utils/lazyLoadIntegration.js.map +1 -0
  49. package/build/npm/cjs/prod/client.js +125 -0
  50. package/build/npm/cjs/prod/client.js.map +1 -0
  51. package/build/npm/cjs/prod/debug-build.js +11 -0
  52. package/build/npm/cjs/prod/debug-build.js.map +1 -0
  53. package/build/npm/cjs/prod/diagnose-sdk.js +51 -0
  54. package/build/npm/cjs/prod/diagnose-sdk.js.map +1 -0
  55. package/build/npm/cjs/prod/eventbuilder.js +397 -0
  56. package/build/npm/cjs/prod/eventbuilder.js.map +1 -0
  57. package/build/npm/cjs/prod/feedbackAsync.js +15 -0
  58. package/build/npm/cjs/prod/feedbackAsync.js.map +1 -0
  59. package/build/npm/cjs/prod/feedbackSync.js +12 -0
  60. package/build/npm/cjs/prod/feedbackSync.js.map +1 -0
  61. package/build/npm/cjs/prod/helpers.js +185 -0
  62. package/build/npm/cjs/prod/helpers.js.map +1 -0
  63. package/build/npm/cjs/prod/index.js +179 -0
  64. package/build/npm/cjs/prod/index.js.map +1 -0
  65. package/build/npm/cjs/prod/integrations/breadcrumbs.js +341 -0
  66. package/build/npm/cjs/prod/integrations/breadcrumbs.js.map +1 -0
  67. package/build/npm/cjs/prod/integrations/browserapierrors.js +259 -0
  68. package/build/npm/cjs/prod/integrations/browserapierrors.js.map +1 -0
  69. package/build/npm/cjs/prod/integrations/browsersession.js +44 -0
  70. package/build/npm/cjs/prod/integrations/browsersession.js.map +1 -0
  71. package/build/npm/cjs/prod/integrations/contextlines.js +89 -0
  72. package/build/npm/cjs/prod/integrations/contextlines.js.map +1 -0
  73. package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js +29 -0
  74. package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js.map +1 -0
  75. package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js +55 -0
  76. package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
  77. package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js +38 -0
  78. package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js.map +1 -0
  79. package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js +48 -0
  80. package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js.map +1 -0
  81. package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js +74 -0
  82. package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js.map +1 -0
  83. package/build/npm/cjs/prod/integrations/globalhandlers.js +210 -0
  84. package/build/npm/cjs/prod/integrations/globalhandlers.js.map +1 -0
  85. package/build/npm/cjs/prod/integrations/graphqlClient.js +180 -0
  86. package/build/npm/cjs/prod/integrations/graphqlClient.js.map +1 -0
  87. package/build/npm/cjs/prod/integrations/httpclient.js +395 -0
  88. package/build/npm/cjs/prod/integrations/httpclient.js.map +1 -0
  89. package/build/npm/cjs/prod/integrations/httpcontext.js +35 -0
  90. package/build/npm/cjs/prod/integrations/httpcontext.js.map +1 -0
  91. package/build/npm/cjs/prod/integrations/linkederrors.js +39 -0
  92. package/build/npm/cjs/prod/integrations/linkederrors.js.map +1 -0
  93. package/build/npm/cjs/prod/integrations/reportingobserver.js +85 -0
  94. package/build/npm/cjs/prod/integrations/reportingobserver.js.map +1 -0
  95. package/build/npm/cjs/prod/integrations/spotlight.js +85 -0
  96. package/build/npm/cjs/prod/integrations/spotlight.js.map +1 -0
  97. package/build/npm/cjs/prod/integrations/webWorker.js +251 -0
  98. package/build/npm/cjs/prod/integrations/webWorker.js.map +1 -0
  99. package/build/npm/cjs/prod/profiling/UIProfiler.js +341 -0
  100. package/build/npm/cjs/prod/profiling/UIProfiler.js.map +1 -0
  101. package/build/npm/cjs/prod/profiling/integration.js +150 -0
  102. package/build/npm/cjs/prod/profiling/integration.js.map +1 -0
  103. package/build/npm/cjs/prod/profiling/startProfileForSpan.js +144 -0
  104. package/build/npm/cjs/prod/profiling/startProfileForSpan.js.map +1 -0
  105. package/build/npm/cjs/prod/profiling/utils.js +786 -0
  106. package/build/npm/cjs/prod/profiling/utils.js.map +1 -0
  107. package/build/npm/cjs/prod/report-dialog.js +68 -0
  108. package/build/npm/cjs/prod/report-dialog.js.map +1 -0
  109. package/build/npm/cjs/{sdk.js → prod/sdk.js} +5 -2
  110. package/build/npm/cjs/prod/sdk.js.map +1 -0
  111. package/build/npm/cjs/prod/stack-parsers.js +202 -0
  112. package/build/npm/cjs/prod/stack-parsers.js.map +1 -0
  113. package/build/npm/cjs/prod/tracing/backgroundtab.js +46 -0
  114. package/build/npm/cjs/prod/tracing/backgroundtab.js.map +1 -0
  115. package/build/npm/cjs/prod/tracing/browserTracingIntegration.js +577 -0
  116. package/build/npm/cjs/prod/tracing/browserTracingIntegration.js.map +1 -0
  117. package/build/npm/cjs/prod/tracing/linkedTraces.js +227 -0
  118. package/build/npm/cjs/prod/tracing/linkedTraces.js.map +1 -0
  119. package/build/npm/cjs/prod/tracing/reportPageLoaded.js +18 -0
  120. package/build/npm/cjs/prod/tracing/reportPageLoaded.js.map +1 -0
  121. package/build/npm/cjs/prod/tracing/request.js +342 -0
  122. package/build/npm/cjs/prod/tracing/request.js.map +1 -0
  123. package/build/npm/cjs/prod/tracing/setActiveSpan.js +68 -0
  124. package/build/npm/cjs/prod/tracing/setActiveSpan.js.map +1 -0
  125. package/build/npm/cjs/prod/tracing/utils.js +54 -0
  126. package/build/npm/cjs/prod/tracing/utils.js.map +1 -0
  127. package/build/npm/cjs/prod/transports/fetch.js +71 -0
  128. package/build/npm/cjs/prod/transports/fetch.js.map +1 -0
  129. package/build/npm/cjs/prod/transports/offline.js +168 -0
  130. package/build/npm/cjs/prod/transports/offline.js.map +1 -0
  131. package/build/npm/cjs/prod/userfeedback.js +42 -0
  132. package/build/npm/cjs/prod/userfeedback.js.map +1 -0
  133. package/build/npm/cjs/prod/utils/detectBrowserExtension.js +59 -0
  134. package/build/npm/cjs/prod/utils/detectBrowserExtension.js.map +1 -0
  135. package/build/npm/cjs/prod/utils/lazyLoadIntegration.js +106 -0
  136. package/build/npm/cjs/prod/utils/lazyLoadIntegration.js.map +1 -0
  137. package/build/npm/esm/dev/client.js.map +1 -0
  138. package/build/npm/esm/dev/debug-build.js.map +1 -0
  139. package/build/npm/esm/dev/diagnose-sdk.js.map +1 -0
  140. package/build/npm/esm/dev/eventbuilder.js.map +1 -0
  141. package/build/npm/esm/dev/feedbackAsync.js.map +1 -0
  142. package/build/npm/esm/dev/feedbackSync.js.map +1 -0
  143. package/build/npm/esm/dev/helpers.js.map +1 -0
  144. package/build/npm/esm/dev/integrations/breadcrumbs.js.map +1 -0
  145. package/build/npm/esm/dev/integrations/browserapierrors.js.map +1 -0
  146. package/build/npm/esm/dev/integrations/browsersession.js.map +1 -0
  147. package/build/npm/esm/dev/integrations/contextlines.js.map +1 -0
  148. package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js.map +1 -0
  149. package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
  150. package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js.map +1 -0
  151. package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js.map +1 -0
  152. package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js.map +1 -0
  153. package/build/npm/esm/{integrations → dev/integrations}/globalhandlers.js +1 -1
  154. package/build/npm/esm/dev/integrations/globalhandlers.js.map +1 -0
  155. package/build/npm/esm/dev/integrations/graphqlClient.js.map +1 -0
  156. package/build/npm/esm/dev/integrations/httpclient.js.map +1 -0
  157. package/build/npm/esm/dev/integrations/httpcontext.js.map +1 -0
  158. package/build/npm/esm/dev/integrations/linkederrors.js.map +1 -0
  159. package/build/npm/esm/dev/integrations/reportingobserver.js.map +1 -0
  160. package/build/npm/esm/dev/integrations/spotlight.js.map +1 -0
  161. package/build/npm/esm/dev/integrations/webWorker.js.map +1 -0
  162. package/build/npm/esm/dev/package.json +1 -0
  163. package/build/npm/esm/{profiling/lifecycleMode/traceLifecycleProfiler.js → dev/profiling/UIProfiler.js} +74 -76
  164. package/build/npm/esm/dev/profiling/UIProfiler.js.map +1 -0
  165. package/build/npm/esm/{profiling → dev/profiling}/integration.js +2 -2
  166. package/build/npm/esm/dev/profiling/integration.js.map +1 -0
  167. package/build/npm/esm/dev/profiling/startProfileForSpan.js.map +1 -0
  168. package/build/npm/esm/dev/profiling/utils.js.map +1 -0
  169. package/build/npm/esm/dev/report-dialog.js.map +1 -0
  170. package/build/npm/esm/dev/sdk.js +128 -0
  171. package/build/npm/esm/dev/sdk.js.map +1 -0
  172. package/build/npm/esm/dev/stack-parsers.js.map +1 -0
  173. package/build/npm/esm/dev/tracing/backgroundtab.js.map +1 -0
  174. package/build/npm/esm/dev/tracing/browserTracingIntegration.js.map +1 -0
  175. package/build/npm/esm/{tracing → dev/tracing}/linkedTraces.js +1 -0
  176. package/build/npm/esm/dev/tracing/linkedTraces.js.map +1 -0
  177. package/build/npm/esm/dev/tracing/reportPageLoaded.js.map +1 -0
  178. package/build/npm/esm/dev/tracing/request.js.map +1 -0
  179. package/build/npm/esm/dev/tracing/setActiveSpan.js.map +1 -0
  180. package/build/npm/esm/dev/tracing/utils.js.map +1 -0
  181. package/build/npm/esm/dev/transports/fetch.js.map +1 -0
  182. package/build/npm/esm/dev/transports/offline.js.map +1 -0
  183. package/build/npm/esm/dev/userfeedback.js.map +1 -0
  184. package/build/npm/esm/dev/utils/detectBrowserExtension.js.map +1 -0
  185. package/build/npm/esm/dev/utils/lazyLoadIntegration.js.map +1 -0
  186. package/build/npm/esm/prod/client.js +122 -0
  187. package/build/npm/esm/prod/client.js.map +1 -0
  188. package/build/npm/esm/prod/debug-build.js +9 -0
  189. package/build/npm/esm/prod/debug-build.js.map +1 -0
  190. package/build/npm/esm/prod/diagnose-sdk.js +49 -0
  191. package/build/npm/esm/prod/diagnose-sdk.js.map +1 -0
  192. package/build/npm/esm/prod/eventbuilder.js +390 -0
  193. package/build/npm/esm/prod/eventbuilder.js.map +1 -0
  194. package/build/npm/esm/prod/feedbackAsync.js +13 -0
  195. package/build/npm/esm/prod/feedbackAsync.js.map +1 -0
  196. package/build/npm/esm/prod/feedbackSync.js +10 -0
  197. package/build/npm/esm/prod/feedbackSync.js.map +1 -0
  198. package/build/npm/esm/prod/helpers.js +179 -0
  199. package/build/npm/esm/prod/helpers.js.map +1 -0
  200. package/build/npm/esm/prod/index.js +40 -0
  201. package/build/npm/esm/prod/index.js.map +1 -0
  202. package/build/npm/esm/prod/integrations/breadcrumbs.js +339 -0
  203. package/build/npm/esm/prod/integrations/breadcrumbs.js.map +1 -0
  204. package/build/npm/esm/prod/integrations/browserapierrors.js +257 -0
  205. package/build/npm/esm/prod/integrations/browserapierrors.js.map +1 -0
  206. package/build/npm/esm/prod/integrations/browsersession.js +42 -0
  207. package/build/npm/esm/prod/integrations/browsersession.js.map +1 -0
  208. package/build/npm/esm/prod/integrations/contextlines.js +86 -0
  209. package/build/npm/esm/prod/integrations/contextlines.js.map +1 -0
  210. package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js +27 -0
  211. package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js.map +1 -0
  212. package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js +52 -0
  213. package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
  214. package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js +35 -0
  215. package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js.map +1 -0
  216. package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js +46 -0
  217. package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js.map +1 -0
  218. package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js +72 -0
  219. package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js.map +1 -0
  220. package/build/npm/esm/prod/integrations/globalhandlers.js +206 -0
  221. package/build/npm/esm/prod/integrations/globalhandlers.js.map +1 -0
  222. package/build/npm/esm/prod/integrations/graphqlClient.js +175 -0
  223. package/build/npm/esm/prod/integrations/graphqlClient.js.map +1 -0
  224. package/build/npm/esm/prod/integrations/httpclient.js +393 -0
  225. package/build/npm/esm/prod/integrations/httpclient.js.map +1 -0
  226. package/build/npm/esm/prod/integrations/httpcontext.js +33 -0
  227. package/build/npm/esm/prod/integrations/httpcontext.js.map +1 -0
  228. package/build/npm/esm/prod/integrations/linkederrors.js +37 -0
  229. package/build/npm/esm/prod/integrations/linkederrors.js.map +1 -0
  230. package/build/npm/esm/prod/integrations/reportingobserver.js +83 -0
  231. package/build/npm/esm/prod/integrations/reportingobserver.js.map +1 -0
  232. package/build/npm/esm/prod/integrations/spotlight.js +81 -0
  233. package/build/npm/esm/prod/integrations/spotlight.js.map +1 -0
  234. package/build/npm/esm/prod/integrations/webWorker.js +247 -0
  235. package/build/npm/esm/prod/integrations/webWorker.js.map +1 -0
  236. package/build/npm/esm/prod/package.json +1 -0
  237. package/build/npm/esm/prod/profiling/UIProfiler.js +339 -0
  238. package/build/npm/esm/prod/profiling/UIProfiler.js.map +1 -0
  239. package/build/npm/esm/prod/profiling/integration.js +148 -0
  240. package/build/npm/esm/prod/profiling/integration.js.map +1 -0
  241. package/build/npm/esm/prod/profiling/startProfileForSpan.js +142 -0
  242. package/build/npm/esm/prod/profiling/startProfileForSpan.js.map +1 -0
  243. package/build/npm/esm/prod/profiling/utils.js +763 -0
  244. package/build/npm/esm/prod/profiling/utils.js.map +1 -0
  245. package/build/npm/esm/prod/report-dialog.js +66 -0
  246. package/build/npm/esm/prod/report-dialog.js.map +1 -0
  247. package/build/npm/esm/{sdk.js → prod/sdk.js} +5 -2
  248. package/build/npm/esm/prod/sdk.js.map +1 -0
  249. package/build/npm/esm/prod/stack-parsers.js +194 -0
  250. package/build/npm/esm/prod/stack-parsers.js.map +1 -0
  251. package/build/npm/esm/prod/tracing/backgroundtab.js +44 -0
  252. package/build/npm/esm/prod/tracing/backgroundtab.js.map +1 -0
  253. package/build/npm/esm/prod/tracing/browserTracingIntegration.js +571 -0
  254. package/build/npm/esm/prod/tracing/browserTracingIntegration.js.map +1 -0
  255. package/build/npm/esm/prod/tracing/linkedTraces.js +218 -0
  256. package/build/npm/esm/prod/tracing/linkedTraces.js.map +1 -0
  257. package/build/npm/esm/prod/tracing/reportPageLoaded.js +16 -0
  258. package/build/npm/esm/prod/tracing/reportPageLoaded.js.map +1 -0
  259. package/build/npm/esm/prod/tracing/request.js +338 -0
  260. package/build/npm/esm/prod/tracing/request.js.map +1 -0
  261. package/build/npm/esm/prod/tracing/setActiveSpan.js +66 -0
  262. package/build/npm/esm/prod/tracing/setActiveSpan.js.map +1 -0
  263. package/build/npm/esm/prod/tracing/utils.js +49 -0
  264. package/build/npm/esm/prod/tracing/utils.js.map +1 -0
  265. package/build/npm/esm/prod/transports/fetch.js +69 -0
  266. package/build/npm/esm/prod/transports/fetch.js.map +1 -0
  267. package/build/npm/esm/prod/transports/offline.js +162 -0
  268. package/build/npm/esm/prod/transports/offline.js.map +1 -0
  269. package/build/npm/esm/prod/userfeedback.js +40 -0
  270. package/build/npm/esm/prod/userfeedback.js.map +1 -0
  271. package/build/npm/esm/prod/utils/detectBrowserExtension.js +57 -0
  272. package/build/npm/esm/prod/utils/detectBrowserExtension.js.map +1 -0
  273. package/build/npm/esm/prod/utils/lazyLoadIntegration.js +104 -0
  274. package/build/npm/esm/prod/utils/lazyLoadIntegration.js.map +1 -0
  275. package/build/npm/types/client.d.ts +11 -0
  276. package/build/npm/types/client.d.ts.map +1 -1
  277. package/build/npm/types/profiling/{lifecycleMode/traceLifecycleProfiler.d.ts → UIProfiler.d.ts} +6 -2
  278. package/build/npm/types/profiling/UIProfiler.d.ts.map +1 -0
  279. package/build/npm/types/sdk.d.ts.map +1 -1
  280. package/build/npm/types-ts3.8/client.d.ts +11 -0
  281. package/build/npm/types-ts3.8/profiling/{lifecycleMode/traceLifecycleProfiler.d.ts → UIProfiler.d.ts} +6 -2
  282. package/package.json +21 -16
  283. package/build/npm/cjs/client.js.map +0 -1
  284. package/build/npm/cjs/debug-build.js.map +0 -1
  285. package/build/npm/cjs/diagnose-sdk.js.map +0 -1
  286. package/build/npm/cjs/eventbuilder.js.map +0 -1
  287. package/build/npm/cjs/feedbackAsync.js.map +0 -1
  288. package/build/npm/cjs/feedbackSync.js.map +0 -1
  289. package/build/npm/cjs/helpers.js.map +0 -1
  290. package/build/npm/cjs/integrations/breadcrumbs.js.map +0 -1
  291. package/build/npm/cjs/integrations/browserapierrors.js.map +0 -1
  292. package/build/npm/cjs/integrations/browsersession.js.map +0 -1
  293. package/build/npm/cjs/integrations/contextlines.js.map +0 -1
  294. package/build/npm/cjs/integrations/featureFlags/growthbook/integration.js.map +0 -1
  295. package/build/npm/cjs/integrations/featureFlags/launchdarkly/integration.js.map +0 -1
  296. package/build/npm/cjs/integrations/featureFlags/openfeature/integration.js.map +0 -1
  297. package/build/npm/cjs/integrations/featureFlags/statsig/integration.js.map +0 -1
  298. package/build/npm/cjs/integrations/featureFlags/unleash/integration.js.map +0 -1
  299. package/build/npm/cjs/integrations/globalhandlers.js.map +0 -1
  300. package/build/npm/cjs/integrations/graphqlClient.js.map +0 -1
  301. package/build/npm/cjs/integrations/httpclient.js.map +0 -1
  302. package/build/npm/cjs/integrations/httpcontext.js.map +0 -1
  303. package/build/npm/cjs/integrations/linkederrors.js.map +0 -1
  304. package/build/npm/cjs/integrations/reportingobserver.js.map +0 -1
  305. package/build/npm/cjs/integrations/spotlight.js.map +0 -1
  306. package/build/npm/cjs/integrations/webWorker.js.map +0 -1
  307. package/build/npm/cjs/profiling/integration.js.map +0 -1
  308. package/build/npm/cjs/profiling/lifecycleMode/traceLifecycleProfiler.js.map +0 -1
  309. package/build/npm/cjs/profiling/startProfileForSpan.js.map +0 -1
  310. package/build/npm/cjs/profiling/utils.js.map +0 -1
  311. package/build/npm/cjs/report-dialog.js.map +0 -1
  312. package/build/npm/cjs/sdk.js.map +0 -1
  313. package/build/npm/cjs/stack-parsers.js.map +0 -1
  314. package/build/npm/cjs/tracing/backgroundtab.js.map +0 -1
  315. package/build/npm/cjs/tracing/browserTracingIntegration.js.map +0 -1
  316. package/build/npm/cjs/tracing/linkedTraces.js.map +0 -1
  317. package/build/npm/cjs/tracing/reportPageLoaded.js.map +0 -1
  318. package/build/npm/cjs/tracing/request.js.map +0 -1
  319. package/build/npm/cjs/tracing/setActiveSpan.js.map +0 -1
  320. package/build/npm/cjs/tracing/utils.js.map +0 -1
  321. package/build/npm/cjs/transports/fetch.js.map +0 -1
  322. package/build/npm/cjs/transports/offline.js.map +0 -1
  323. package/build/npm/cjs/userfeedback.js.map +0 -1
  324. package/build/npm/cjs/utils/detectBrowserExtension.js.map +0 -1
  325. package/build/npm/cjs/utils/lazyLoadIntegration.js.map +0 -1
  326. package/build/npm/esm/client.js.map +0 -1
  327. package/build/npm/esm/debug-build.js.map +0 -1
  328. package/build/npm/esm/diagnose-sdk.js.map +0 -1
  329. package/build/npm/esm/eventbuilder.js.map +0 -1
  330. package/build/npm/esm/feedbackAsync.js.map +0 -1
  331. package/build/npm/esm/feedbackSync.js.map +0 -1
  332. package/build/npm/esm/helpers.js.map +0 -1
  333. package/build/npm/esm/integrations/breadcrumbs.js.map +0 -1
  334. package/build/npm/esm/integrations/browserapierrors.js.map +0 -1
  335. package/build/npm/esm/integrations/browsersession.js.map +0 -1
  336. package/build/npm/esm/integrations/contextlines.js.map +0 -1
  337. package/build/npm/esm/integrations/featureFlags/growthbook/integration.js.map +0 -1
  338. package/build/npm/esm/integrations/featureFlags/launchdarkly/integration.js.map +0 -1
  339. package/build/npm/esm/integrations/featureFlags/openfeature/integration.js.map +0 -1
  340. package/build/npm/esm/integrations/featureFlags/statsig/integration.js.map +0 -1
  341. package/build/npm/esm/integrations/featureFlags/unleash/integration.js.map +0 -1
  342. package/build/npm/esm/integrations/globalhandlers.js.map +0 -1
  343. package/build/npm/esm/integrations/graphqlClient.js.map +0 -1
  344. package/build/npm/esm/integrations/httpclient.js.map +0 -1
  345. package/build/npm/esm/integrations/httpcontext.js.map +0 -1
  346. package/build/npm/esm/integrations/linkederrors.js.map +0 -1
  347. package/build/npm/esm/integrations/reportingobserver.js.map +0 -1
  348. package/build/npm/esm/integrations/spotlight.js.map +0 -1
  349. package/build/npm/esm/integrations/webWorker.js.map +0 -1
  350. package/build/npm/esm/package.json +0 -1
  351. package/build/npm/esm/profiling/integration.js.map +0 -1
  352. package/build/npm/esm/profiling/lifecycleMode/traceLifecycleProfiler.js.map +0 -1
  353. package/build/npm/esm/profiling/startProfileForSpan.js.map +0 -1
  354. package/build/npm/esm/profiling/utils.js.map +0 -1
  355. package/build/npm/esm/report-dialog.js.map +0 -1
  356. package/build/npm/esm/sdk.js.map +0 -1
  357. package/build/npm/esm/stack-parsers.js.map +0 -1
  358. package/build/npm/esm/tracing/backgroundtab.js.map +0 -1
  359. package/build/npm/esm/tracing/browserTracingIntegration.js.map +0 -1
  360. package/build/npm/esm/tracing/linkedTraces.js.map +0 -1
  361. package/build/npm/esm/tracing/reportPageLoaded.js.map +0 -1
  362. package/build/npm/esm/tracing/request.js.map +0 -1
  363. package/build/npm/esm/tracing/setActiveSpan.js.map +0 -1
  364. package/build/npm/esm/tracing/utils.js.map +0 -1
  365. package/build/npm/esm/transports/fetch.js.map +0 -1
  366. package/build/npm/esm/transports/offline.js.map +0 -1
  367. package/build/npm/esm/userfeedback.js.map +0 -1
  368. package/build/npm/esm/utils/detectBrowserExtension.js.map +0 -1
  369. package/build/npm/esm/utils/lazyLoadIntegration.js.map +0 -1
  370. package/build/npm/types/profiling/lifecycleMode/traceLifecycleProfiler.d.ts.map +0 -1
  371. /package/build/npm/cjs/{client.js → dev/client.js} +0 -0
  372. /package/build/npm/cjs/{debug-build.js → dev/debug-build.js} +0 -0
  373. /package/build/npm/cjs/{diagnose-sdk.js → dev/diagnose-sdk.js} +0 -0
  374. /package/build/npm/cjs/{eventbuilder.js → dev/eventbuilder.js} +0 -0
  375. /package/build/npm/cjs/{feedbackAsync.js → dev/feedbackAsync.js} +0 -0
  376. /package/build/npm/cjs/{feedbackSync.js → dev/feedbackSync.js} +0 -0
  377. /package/build/npm/cjs/{helpers.js → dev/helpers.js} +0 -0
  378. /package/build/npm/cjs/{index.js → dev/index.js} +0 -0
  379. /package/build/npm/cjs/{index.js.map → dev/index.js.map} +0 -0
  380. /package/build/npm/cjs/{integrations → dev/integrations}/breadcrumbs.js +0 -0
  381. /package/build/npm/cjs/{integrations → dev/integrations}/browserapierrors.js +0 -0
  382. /package/build/npm/cjs/{integrations → dev/integrations}/browsersession.js +0 -0
  383. /package/build/npm/cjs/{integrations → dev/integrations}/contextlines.js +0 -0
  384. /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/growthbook/integration.js +0 -0
  385. /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/launchdarkly/integration.js +0 -0
  386. /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/openfeature/integration.js +0 -0
  387. /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/statsig/integration.js +0 -0
  388. /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/unleash/integration.js +0 -0
  389. /package/build/npm/cjs/{integrations → dev/integrations}/graphqlClient.js +0 -0
  390. /package/build/npm/cjs/{integrations → dev/integrations}/httpclient.js +0 -0
  391. /package/build/npm/cjs/{integrations → dev/integrations}/httpcontext.js +0 -0
  392. /package/build/npm/cjs/{integrations → dev/integrations}/linkederrors.js +0 -0
  393. /package/build/npm/cjs/{integrations → dev/integrations}/reportingobserver.js +0 -0
  394. /package/build/npm/cjs/{integrations → dev/integrations}/spotlight.js +0 -0
  395. /package/build/npm/cjs/{integrations → dev/integrations}/webWorker.js +0 -0
  396. /package/build/npm/cjs/{profiling → dev/profiling}/startProfileForSpan.js +0 -0
  397. /package/build/npm/cjs/{profiling → dev/profiling}/utils.js +0 -0
  398. /package/build/npm/cjs/{report-dialog.js → dev/report-dialog.js} +0 -0
  399. /package/build/npm/cjs/{stack-parsers.js → dev/stack-parsers.js} +0 -0
  400. /package/build/npm/cjs/{tracing → dev/tracing}/backgroundtab.js +0 -0
  401. /package/build/npm/cjs/{tracing → dev/tracing}/browserTracingIntegration.js +0 -0
  402. /package/build/npm/cjs/{tracing → dev/tracing}/reportPageLoaded.js +0 -0
  403. /package/build/npm/cjs/{tracing → dev/tracing}/request.js +0 -0
  404. /package/build/npm/cjs/{tracing → dev/tracing}/setActiveSpan.js +0 -0
  405. /package/build/npm/cjs/{tracing → dev/tracing}/utils.js +0 -0
  406. /package/build/npm/cjs/{transports → dev/transports}/fetch.js +0 -0
  407. /package/build/npm/cjs/{transports → dev/transports}/offline.js +0 -0
  408. /package/build/npm/cjs/{userfeedback.js → dev/userfeedback.js} +0 -0
  409. /package/build/npm/cjs/{utils → dev/utils}/detectBrowserExtension.js +0 -0
  410. /package/build/npm/cjs/{utils → dev/utils}/lazyLoadIntegration.js +0 -0
  411. /package/build/npm/esm/{client.js → dev/client.js} +0 -0
  412. /package/build/npm/esm/{debug-build.js → dev/debug-build.js} +0 -0
  413. /package/build/npm/esm/{diagnose-sdk.js → dev/diagnose-sdk.js} +0 -0
  414. /package/build/npm/esm/{eventbuilder.js → dev/eventbuilder.js} +0 -0
  415. /package/build/npm/esm/{feedbackAsync.js → dev/feedbackAsync.js} +0 -0
  416. /package/build/npm/esm/{feedbackSync.js → dev/feedbackSync.js} +0 -0
  417. /package/build/npm/esm/{helpers.js → dev/helpers.js} +0 -0
  418. /package/build/npm/esm/{index.js → dev/index.js} +0 -0
  419. /package/build/npm/esm/{index.js.map → dev/index.js.map} +0 -0
  420. /package/build/npm/esm/{integrations → dev/integrations}/breadcrumbs.js +0 -0
  421. /package/build/npm/esm/{integrations → dev/integrations}/browserapierrors.js +0 -0
  422. /package/build/npm/esm/{integrations → dev/integrations}/browsersession.js +0 -0
  423. /package/build/npm/esm/{integrations → dev/integrations}/contextlines.js +0 -0
  424. /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/growthbook/integration.js +0 -0
  425. /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/launchdarkly/integration.js +0 -0
  426. /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/openfeature/integration.js +0 -0
  427. /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/statsig/integration.js +0 -0
  428. /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/unleash/integration.js +0 -0
  429. /package/build/npm/esm/{integrations → dev/integrations}/graphqlClient.js +0 -0
  430. /package/build/npm/esm/{integrations → dev/integrations}/httpclient.js +0 -0
  431. /package/build/npm/esm/{integrations → dev/integrations}/httpcontext.js +0 -0
  432. /package/build/npm/esm/{integrations → dev/integrations}/linkederrors.js +0 -0
  433. /package/build/npm/esm/{integrations → dev/integrations}/reportingobserver.js +0 -0
  434. /package/build/npm/esm/{integrations → dev/integrations}/spotlight.js +0 -0
  435. /package/build/npm/esm/{integrations → dev/integrations}/webWorker.js +0 -0
  436. /package/build/npm/esm/{profiling → dev/profiling}/startProfileForSpan.js +0 -0
  437. /package/build/npm/esm/{profiling → dev/profiling}/utils.js +0 -0
  438. /package/build/npm/esm/{report-dialog.js → dev/report-dialog.js} +0 -0
  439. /package/build/npm/esm/{stack-parsers.js → dev/stack-parsers.js} +0 -0
  440. /package/build/npm/esm/{tracing → dev/tracing}/backgroundtab.js +0 -0
  441. /package/build/npm/esm/{tracing → dev/tracing}/browserTracingIntegration.js +0 -0
  442. /package/build/npm/esm/{tracing → dev/tracing}/reportPageLoaded.js +0 -0
  443. /package/build/npm/esm/{tracing → dev/tracing}/request.js +0 -0
  444. /package/build/npm/esm/{tracing → dev/tracing}/setActiveSpan.js +0 -0
  445. /package/build/npm/esm/{tracing → dev/tracing}/utils.js +0 -0
  446. /package/build/npm/esm/{transports → dev/transports}/fetch.js +0 -0
  447. /package/build/npm/esm/{transports → dev/transports}/offline.js +0 -0
  448. /package/build/npm/esm/{userfeedback.js → dev/userfeedback.js} +0 -0
  449. /package/build/npm/esm/{utils → dev/utils}/detectBrowserExtension.js +0 -0
  450. /package/build/npm/esm/{utils → dev/utils}/lazyLoadIntegration.js +0 -0
@@ -0,0 +1,390 @@
1
+ import { isErrorEvent, isDOMError, isDOMException, addExceptionTypeValue, isError, isPlainObject, isEvent, addExceptionMechanism, isParameterizedString, getClient, normalizeToSize, extractExceptionKeysForMessage, resolvedSyncPromise } from '@sentry/core';
2
+
3
+ /**
4
+ * This function creates an exception from a JavaScript Error
5
+ */
6
+ function exceptionFromError(stackParser, ex) {
7
+ // Get the frames first since Opera can lose the stack if we touch anything else first
8
+ const frames = parseStackFrames(stackParser, ex);
9
+
10
+ const exception = {
11
+ type: extractType(ex),
12
+ value: extractMessage(ex),
13
+ };
14
+
15
+ if (frames.length) {
16
+ exception.stacktrace = { frames };
17
+ }
18
+
19
+ if (exception.type === undefined && exception.value === '') {
20
+ exception.value = 'Unrecoverable error caught';
21
+ }
22
+
23
+ return exception;
24
+ }
25
+
26
+ function eventFromPlainObject(
27
+ stackParser,
28
+ exception,
29
+ syntheticException,
30
+ isUnhandledRejection,
31
+ ) {
32
+ const client = getClient();
33
+ const normalizeDepth = client?.getOptions().normalizeDepth;
34
+
35
+ // If we can, we extract an exception from the object properties
36
+ const errorFromProp = getErrorPropertyFromObject(exception);
37
+
38
+ const extra = {
39
+ __serialized__: normalizeToSize(exception, normalizeDepth),
40
+ };
41
+
42
+ if (errorFromProp) {
43
+ return {
44
+ exception: {
45
+ values: [exceptionFromError(stackParser, errorFromProp)],
46
+ },
47
+ extra,
48
+ };
49
+ }
50
+
51
+ const event = {
52
+ exception: {
53
+ values: [
54
+ {
55
+ type: isEvent(exception) ? exception.constructor.name : isUnhandledRejection ? 'UnhandledRejection' : 'Error',
56
+ value: getNonErrorObjectExceptionValue(exception, { isUnhandledRejection }),
57
+ } ,
58
+ ],
59
+ },
60
+ extra,
61
+ } ;
62
+
63
+ if (syntheticException) {
64
+ const frames = parseStackFrames(stackParser, syntheticException);
65
+ if (frames.length) {
66
+ // event.exception.values[0] has been set above
67
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
68
+ event.exception.values[0].stacktrace = { frames };
69
+ }
70
+ }
71
+
72
+ return event;
73
+ }
74
+
75
+ function eventFromError(stackParser, ex) {
76
+ return {
77
+ exception: {
78
+ values: [exceptionFromError(stackParser, ex)],
79
+ },
80
+ };
81
+ }
82
+
83
+ /** Parses stack frames from an error */
84
+ function parseStackFrames(
85
+ stackParser,
86
+ ex,
87
+ ) {
88
+ // Access and store the stacktrace property before doing ANYTHING
89
+ // else to it because Opera is not very good at providing it
90
+ // reliably in other circumstances.
91
+ const stacktrace = ex.stacktrace || ex.stack || '';
92
+
93
+ const skipLines = getSkipFirstStackStringLines(ex);
94
+ const framesToPop = getPopFirstTopFrames(ex);
95
+
96
+ try {
97
+ return stackParser(stacktrace, skipLines, framesToPop);
98
+ } catch {
99
+ // no-empty
100
+ }
101
+
102
+ return [];
103
+ }
104
+
105
+ // Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108
106
+ const reactMinifiedRegexp = /Minified React error #\d+;/i;
107
+
108
+ /**
109
+ * Certain known React errors contain links that would be falsely
110
+ * parsed as frames. This function check for these errors and
111
+ * returns number of the stack string lines to skip.
112
+ */
113
+ function getSkipFirstStackStringLines(ex) {
114
+ if (ex && reactMinifiedRegexp.test(ex.message)) {
115
+ return 1;
116
+ }
117
+
118
+ return 0;
119
+ }
120
+
121
+ /**
122
+ * If error has `framesToPop` property, it means that the
123
+ * creator tells us the first x frames will be useless
124
+ * and should be discarded. Typically error from wrapper function
125
+ * which don't point to the actual location in the developer's code.
126
+ *
127
+ * Example: https://github.com/zertosh/invariant/blob/master/invariant.js#L46
128
+ */
129
+ function getPopFirstTopFrames(ex) {
130
+ if (typeof ex.framesToPop === 'number') {
131
+ return ex.framesToPop;
132
+ }
133
+
134
+ return 0;
135
+ }
136
+
137
+ // https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/Exception
138
+ // @ts-expect-error - WebAssembly.Exception is a valid class
139
+ function isWebAssemblyException(exception) {
140
+ // Check for support
141
+ // @ts-expect-error - WebAssembly.Exception is a valid class
142
+ if (typeof WebAssembly !== 'undefined' && typeof WebAssembly.Exception !== 'undefined') {
143
+ // @ts-expect-error - WebAssembly.Exception is a valid class
144
+ return exception instanceof WebAssembly.Exception;
145
+ } else {
146
+ return false;
147
+ }
148
+ }
149
+
150
+ /**
151
+ * Extracts from errors what we use as the exception `type` in error events.
152
+ *
153
+ * Usually, this is the `name` property on Error objects but WASM errors need to be treated differently.
154
+ */
155
+ function extractType(ex) {
156
+ const name = ex?.name;
157
+
158
+ // The name for WebAssembly.Exception Errors needs to be extracted differently.
159
+ // Context: https://github.com/getsentry/sentry-javascript/issues/13787
160
+ if (!name && isWebAssemblyException(ex)) {
161
+ // Emscripten sets array[type, message] to the "message" property on the WebAssembly.Exception object
162
+ const hasTypeInMessage = ex.message && Array.isArray(ex.message) && ex.message.length == 2;
163
+ return hasTypeInMessage ? ex.message[0] : 'WebAssembly.Exception';
164
+ }
165
+
166
+ return name;
167
+ }
168
+
169
+ /**
170
+ * There are cases where stacktrace.message is an Event object
171
+ * https://github.com/getsentry/sentry-javascript/issues/1949
172
+ * In this specific case we try to extract stacktrace.message.error.message
173
+ */
174
+ function extractMessage(ex) {
175
+ const message = ex?.message;
176
+
177
+ if (isWebAssemblyException(ex)) {
178
+ // For Node 18, Emscripten sets array[type, message] to the "message" property on the WebAssembly.Exception object
179
+ if (Array.isArray(ex.message) && ex.message.length == 2) {
180
+ return ex.message[1];
181
+ }
182
+ return 'wasm exception';
183
+ }
184
+
185
+ if (!message) {
186
+ return 'No error message';
187
+ }
188
+
189
+ if (message.error && typeof message.error.message === 'string') {
190
+ return message.error.message;
191
+ }
192
+
193
+ return message;
194
+ }
195
+
196
+ /**
197
+ * Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`.
198
+ * @hidden
199
+ */
200
+ function eventFromException(
201
+ stackParser,
202
+ exception,
203
+ hint,
204
+ attachStacktrace,
205
+ ) {
206
+ const syntheticException = hint?.syntheticException || undefined;
207
+ const event = eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace);
208
+ addExceptionMechanism(event); // defaults to { type: 'generic', handled: true }
209
+ event.level = 'error';
210
+ if (hint?.event_id) {
211
+ event.event_id = hint.event_id;
212
+ }
213
+ return resolvedSyncPromise(event);
214
+ }
215
+
216
+ /**
217
+ * Builds and Event from a Message
218
+ * @hidden
219
+ */
220
+ function eventFromMessage(
221
+ stackParser,
222
+ message,
223
+ level = 'info',
224
+ hint,
225
+ attachStacktrace,
226
+ ) {
227
+ const syntheticException = hint?.syntheticException || undefined;
228
+ const event = eventFromString(stackParser, message, syntheticException, attachStacktrace);
229
+ event.level = level;
230
+ if (hint?.event_id) {
231
+ event.event_id = hint.event_id;
232
+ }
233
+ return resolvedSyncPromise(event);
234
+ }
235
+
236
+ /**
237
+ * @hidden
238
+ */
239
+ function eventFromUnknownInput(
240
+ stackParser,
241
+ exception,
242
+ syntheticException,
243
+ attachStacktrace,
244
+ isUnhandledRejection,
245
+ ) {
246
+ let event;
247
+
248
+ if (isErrorEvent(exception ) && (exception ).error) {
249
+ // If it is an ErrorEvent with `error` property, extract it to get actual Error
250
+ const errorEvent = exception ;
251
+ return eventFromError(stackParser, errorEvent.error );
252
+ }
253
+
254
+ // If it is a `DOMError` (which is a legacy API, but still supported in some browsers) then we just extract the name
255
+ // and message, as it doesn't provide anything else. According to the spec, all `DOMExceptions` should also be
256
+ // `Error`s, but that's not the case in IE11, so in that case we treat it the same as we do a `DOMError`.
257
+ //
258
+ // https://developer.mozilla.org/en-US/docs/Web/API/DOMError
259
+ // https://developer.mozilla.org/en-US/docs/Web/API/DOMException
260
+ // https://webidl.spec.whatwg.org/#es-DOMException-specialness
261
+ if (isDOMError(exception) || isDOMException(exception )) {
262
+ const domException = exception ;
263
+
264
+ if ('stack' in (exception )) {
265
+ event = eventFromError(stackParser, exception );
266
+ } else {
267
+ const name = domException.name || (isDOMError(domException) ? 'DOMError' : 'DOMException');
268
+ const message = domException.message ? `${name}: ${domException.message}` : name;
269
+ event = eventFromString(stackParser, message, syntheticException, attachStacktrace);
270
+ addExceptionTypeValue(event, message);
271
+ }
272
+ if ('code' in domException) {
273
+ // eslint-disable-next-line deprecation/deprecation
274
+ event.tags = { ...event.tags, 'DOMException.code': `${domException.code}` };
275
+ }
276
+
277
+ return event;
278
+ }
279
+ if (isError(exception)) {
280
+ // we have a real Error object, do nothing
281
+ return eventFromError(stackParser, exception);
282
+ }
283
+ if (isPlainObject(exception) || isEvent(exception)) {
284
+ // If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize
285
+ // it manually. This will allow us to group events based on top-level keys which is much better than creating a new
286
+ // group on any key/value change.
287
+ const objectException = exception;
288
+ event = eventFromPlainObject(stackParser, objectException, syntheticException, isUnhandledRejection);
289
+ addExceptionMechanism(event, {
290
+ synthetic: true,
291
+ });
292
+ return event;
293
+ }
294
+
295
+ // If none of previous checks were valid, then it means that it's not:
296
+ // - an instance of DOMError
297
+ // - an instance of DOMException
298
+ // - an instance of Event
299
+ // - an instance of Error
300
+ // - a valid ErrorEvent (one with an error property)
301
+ // - a plain Object
302
+ //
303
+ // So bail out and capture it as a simple message:
304
+ event = eventFromString(stackParser, exception , syntheticException, attachStacktrace);
305
+ addExceptionTypeValue(event, `${exception}`, undefined);
306
+ addExceptionMechanism(event, {
307
+ synthetic: true,
308
+ });
309
+
310
+ return event;
311
+ }
312
+
313
+ function eventFromString(
314
+ stackParser,
315
+ message,
316
+ syntheticException,
317
+ attachStacktrace,
318
+ ) {
319
+ const event = {};
320
+
321
+ if (attachStacktrace && syntheticException) {
322
+ const frames = parseStackFrames(stackParser, syntheticException);
323
+ if (frames.length) {
324
+ event.exception = {
325
+ values: [{ value: message, stacktrace: { frames } }],
326
+ };
327
+ }
328
+ addExceptionMechanism(event, { synthetic: true });
329
+ }
330
+
331
+ if (isParameterizedString(message)) {
332
+ const { __sentry_template_string__, __sentry_template_values__ } = message;
333
+
334
+ event.logentry = {
335
+ message: __sentry_template_string__,
336
+ params: __sentry_template_values__,
337
+ };
338
+ return event;
339
+ }
340
+
341
+ event.message = message;
342
+ return event;
343
+ }
344
+
345
+ function getNonErrorObjectExceptionValue(
346
+ exception,
347
+ { isUnhandledRejection },
348
+ ) {
349
+ const keys = extractExceptionKeysForMessage(exception);
350
+ const captureType = isUnhandledRejection ? 'promise rejection' : 'exception';
351
+
352
+ // Some ErrorEvent instances do not have an `error` property, which is why they are not handled before
353
+ // We still want to try to get a decent message for these cases
354
+ if (isErrorEvent(exception)) {
355
+ return `Event \`ErrorEvent\` captured as ${captureType} with message \`${exception.message}\``;
356
+ }
357
+
358
+ if (isEvent(exception)) {
359
+ const className = getObjectClassName(exception);
360
+ return `Event \`${className}\` (type=${exception.type}) captured as ${captureType}`;
361
+ }
362
+
363
+ return `Object captured as ${captureType} with keys: ${keys}`;
364
+ }
365
+
366
+ function getObjectClassName(obj) {
367
+ try {
368
+ const prototype = Object.getPrototypeOf(obj);
369
+ return prototype ? prototype.constructor.name : undefined;
370
+ } catch {
371
+ // ignore errors here
372
+ }
373
+ }
374
+
375
+ /** If a plain object has a property that is an `Error`, return this error. */
376
+ function getErrorPropertyFromObject(obj) {
377
+ for (const prop in obj) {
378
+ if (Object.prototype.hasOwnProperty.call(obj, prop)) {
379
+ const value = obj[prop];
380
+ if (value instanceof Error) {
381
+ return value;
382
+ }
383
+ }
384
+ }
385
+
386
+ return undefined;
387
+ }
388
+
389
+ export { eventFromException, eventFromMessage, eventFromUnknownInput, exceptionFromError, extractMessage, extractType };
390
+ //# sourceMappingURL=eventbuilder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eventbuilder.js","sources":["../../../../src/eventbuilder.ts"],"sourcesContent":["import type {\n Event,\n EventHint,\n Exception,\n ParameterizedString,\n SeverityLevel,\n StackFrame,\n StackParser,\n} from '@sentry/core';\nimport {\n addExceptionMechanism,\n addExceptionTypeValue,\n extractExceptionKeysForMessage,\n getClient,\n isDOMError,\n isDOMException,\n isError,\n isErrorEvent,\n isEvent,\n isParameterizedString,\n isPlainObject,\n normalizeToSize,\n resolvedSyncPromise,\n} from '@sentry/core';\n\ntype Prototype = { constructor: (...args: unknown[]) => unknown };\n\n/**\n * This function creates an exception from a JavaScript Error\n */\nexport function exceptionFromError(stackParser: StackParser, ex: Error): Exception {\n // Get the frames first since Opera can lose the stack if we touch anything else first\n const frames = parseStackFrames(stackParser, ex);\n\n const exception: Exception = {\n type: extractType(ex),\n value: extractMessage(ex),\n };\n\n if (frames.length) {\n exception.stacktrace = { frames };\n }\n\n if (exception.type === undefined && exception.value === '') {\n exception.value = 'Unrecoverable error caught';\n }\n\n return exception;\n}\n\nfunction eventFromPlainObject(\n stackParser: StackParser,\n exception: Record<string, unknown>,\n syntheticException?: Error,\n isUnhandledRejection?: boolean,\n): Event {\n const client = getClient();\n const normalizeDepth = client?.getOptions().normalizeDepth;\n\n // If we can, we extract an exception from the object properties\n const errorFromProp = getErrorPropertyFromObject(exception);\n\n const extra = {\n __serialized__: normalizeToSize(exception, normalizeDepth),\n };\n\n if (errorFromProp) {\n return {\n exception: {\n values: [exceptionFromError(stackParser, errorFromProp)],\n },\n extra,\n };\n }\n\n const event = {\n exception: {\n values: [\n {\n type: isEvent(exception) ? exception.constructor.name : isUnhandledRejection ? 'UnhandledRejection' : 'Error',\n value: getNonErrorObjectExceptionValue(exception, { isUnhandledRejection }),\n } as Exception,\n ],\n },\n extra,\n } satisfies Event;\n\n if (syntheticException) {\n const frames = parseStackFrames(stackParser, syntheticException);\n if (frames.length) {\n // event.exception.values[0] has been set above\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event.exception.values[0]!.stacktrace = { frames };\n }\n }\n\n return event;\n}\n\nfunction eventFromError(stackParser: StackParser, ex: Error): Event {\n return {\n exception: {\n values: [exceptionFromError(stackParser, ex)],\n },\n };\n}\n\n/** Parses stack frames from an error */\nfunction parseStackFrames(\n stackParser: StackParser,\n ex: Error & { framesToPop?: number; stacktrace?: string },\n): StackFrame[] {\n // Access and store the stacktrace property before doing ANYTHING\n // else to it because Opera is not very good at providing it\n // reliably in other circumstances.\n const stacktrace = ex.stacktrace || ex.stack || '';\n\n const skipLines = getSkipFirstStackStringLines(ex);\n const framesToPop = getPopFirstTopFrames(ex);\n\n try {\n return stackParser(stacktrace, skipLines, framesToPop);\n } catch {\n // no-empty\n }\n\n return [];\n}\n\n// Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108\nconst reactMinifiedRegexp = /Minified React error #\\d+;/i;\n\n/**\n * Certain known React errors contain links that would be falsely\n * parsed as frames. This function check for these errors and\n * returns number of the stack string lines to skip.\n */\nfunction getSkipFirstStackStringLines(ex: Error): number {\n if (ex && reactMinifiedRegexp.test(ex.message)) {\n return 1;\n }\n\n return 0;\n}\n\n/**\n * If error has `framesToPop` property, it means that the\n * creator tells us the first x frames will be useless\n * and should be discarded. Typically error from wrapper function\n * which don't point to the actual location in the developer's code.\n *\n * Example: https://github.com/zertosh/invariant/blob/master/invariant.js#L46\n */\nfunction getPopFirstTopFrames(ex: Error & { framesToPop?: unknown }): number {\n if (typeof ex.framesToPop === 'number') {\n return ex.framesToPop;\n }\n\n return 0;\n}\n\n// https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/Exception\n// @ts-expect-error - WebAssembly.Exception is a valid class\nfunction isWebAssemblyException(exception: unknown): exception is WebAssembly.Exception {\n // Check for support\n // @ts-expect-error - WebAssembly.Exception is a valid class\n if (typeof WebAssembly !== 'undefined' && typeof WebAssembly.Exception !== 'undefined') {\n // @ts-expect-error - WebAssembly.Exception is a valid class\n return exception instanceof WebAssembly.Exception;\n } else {\n return false;\n }\n}\n\n/**\n * Extracts from errors what we use as the exception `type` in error events.\n *\n * Usually, this is the `name` property on Error objects but WASM errors need to be treated differently.\n */\nexport function extractType(ex: Error & { message: { error?: Error } }): string | undefined {\n const name = ex?.name;\n\n // The name for WebAssembly.Exception Errors needs to be extracted differently.\n // Context: https://github.com/getsentry/sentry-javascript/issues/13787\n if (!name && isWebAssemblyException(ex)) {\n // Emscripten sets array[type, message] to the \"message\" property on the WebAssembly.Exception object\n const hasTypeInMessage = ex.message && Array.isArray(ex.message) && ex.message.length == 2;\n return hasTypeInMessage ? ex.message[0] : 'WebAssembly.Exception';\n }\n\n return name;\n}\n\n/**\n * There are cases where stacktrace.message is an Event object\n * https://github.com/getsentry/sentry-javascript/issues/1949\n * In this specific case we try to extract stacktrace.message.error.message\n */\nexport function extractMessage(ex: Error & { message: { error?: Error } }): string {\n const message = ex?.message;\n\n if (isWebAssemblyException(ex)) {\n // For Node 18, Emscripten sets array[type, message] to the \"message\" property on the WebAssembly.Exception object\n if (Array.isArray(ex.message) && ex.message.length == 2) {\n return ex.message[1];\n }\n return 'wasm exception';\n }\n\n if (!message) {\n return 'No error message';\n }\n\n if (message.error && typeof message.error.message === 'string') {\n return message.error.message;\n }\n\n return message;\n}\n\n/**\n * Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`.\n * @hidden\n */\nexport function eventFromException(\n stackParser: StackParser,\n exception: unknown,\n hint?: EventHint,\n attachStacktrace?: boolean,\n): PromiseLike<Event> {\n const syntheticException = hint?.syntheticException || undefined;\n const event = eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace);\n addExceptionMechanism(event); // defaults to { type: 'generic', handled: true }\n event.level = 'error';\n if (hint?.event_id) {\n event.event_id = hint.event_id;\n }\n return resolvedSyncPromise(event);\n}\n\n/**\n * Builds and Event from a Message\n * @hidden\n */\nexport function eventFromMessage(\n stackParser: StackParser,\n message: ParameterizedString,\n level: SeverityLevel = 'info',\n hint?: EventHint,\n attachStacktrace?: boolean,\n): PromiseLike<Event> {\n const syntheticException = hint?.syntheticException || undefined;\n const event = eventFromString(stackParser, message, syntheticException, attachStacktrace);\n event.level = level;\n if (hint?.event_id) {\n event.event_id = hint.event_id;\n }\n return resolvedSyncPromise(event);\n}\n\n/**\n * @hidden\n */\nexport function eventFromUnknownInput(\n stackParser: StackParser,\n exception: unknown,\n syntheticException?: Error,\n attachStacktrace?: boolean,\n isUnhandledRejection?: boolean,\n): Event {\n let event: Event;\n\n if (isErrorEvent(exception as ErrorEvent) && (exception as ErrorEvent).error) {\n // If it is an ErrorEvent with `error` property, extract it to get actual Error\n const errorEvent = exception as ErrorEvent;\n return eventFromError(stackParser, errorEvent.error as Error);\n }\n\n // If it is a `DOMError` (which is a legacy API, but still supported in some browsers) then we just extract the name\n // and message, as it doesn't provide anything else. According to the spec, all `DOMExceptions` should also be\n // `Error`s, but that's not the case in IE11, so in that case we treat it the same as we do a `DOMError`.\n //\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMError\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMException\n // https://webidl.spec.whatwg.org/#es-DOMException-specialness\n if (isDOMError(exception) || isDOMException(exception as DOMException)) {\n const domException = exception as DOMException;\n\n if ('stack' in (exception as Error)) {\n event = eventFromError(stackParser, exception as Error);\n } else {\n const name = domException.name || (isDOMError(domException) ? 'DOMError' : 'DOMException');\n const message = domException.message ? `${name}: ${domException.message}` : name;\n event = eventFromString(stackParser, message, syntheticException, attachStacktrace);\n addExceptionTypeValue(event, message);\n }\n if ('code' in domException) {\n // eslint-disable-next-line deprecation/deprecation\n event.tags = { ...event.tags, 'DOMException.code': `${domException.code}` };\n }\n\n return event;\n }\n if (isError(exception)) {\n // we have a real Error object, do nothing\n return eventFromError(stackParser, exception);\n }\n if (isPlainObject(exception) || isEvent(exception)) {\n // If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize\n // it manually. This will allow us to group events based on top-level keys which is much better than creating a new\n // group on any key/value change.\n const objectException = exception;\n event = eventFromPlainObject(stackParser, objectException, syntheticException, isUnhandledRejection);\n addExceptionMechanism(event, {\n synthetic: true,\n });\n return event;\n }\n\n // If none of previous checks were valid, then it means that it's not:\n // - an instance of DOMError\n // - an instance of DOMException\n // - an instance of Event\n // - an instance of Error\n // - a valid ErrorEvent (one with an error property)\n // - a plain Object\n //\n // So bail out and capture it as a simple message:\n event = eventFromString(stackParser, exception as string, syntheticException, attachStacktrace);\n addExceptionTypeValue(event, `${exception}`, undefined);\n addExceptionMechanism(event, {\n synthetic: true,\n });\n\n return event;\n}\n\nfunction eventFromString(\n stackParser: StackParser,\n message: ParameterizedString,\n syntheticException?: Error,\n attachStacktrace?: boolean,\n): Event {\n const event: Event = {};\n\n if (attachStacktrace && syntheticException) {\n const frames = parseStackFrames(stackParser, syntheticException);\n if (frames.length) {\n event.exception = {\n values: [{ value: message, stacktrace: { frames } }],\n };\n }\n addExceptionMechanism(event, { synthetic: true });\n }\n\n if (isParameterizedString(message)) {\n const { __sentry_template_string__, __sentry_template_values__ } = message;\n\n event.logentry = {\n message: __sentry_template_string__,\n params: __sentry_template_values__,\n };\n return event;\n }\n\n event.message = message;\n return event;\n}\n\nfunction getNonErrorObjectExceptionValue(\n exception: Record<string, unknown>,\n { isUnhandledRejection }: { isUnhandledRejection?: boolean },\n): string {\n const keys = extractExceptionKeysForMessage(exception);\n const captureType = isUnhandledRejection ? 'promise rejection' : 'exception';\n\n // Some ErrorEvent instances do not have an `error` property, which is why they are not handled before\n // We still want to try to get a decent message for these cases\n if (isErrorEvent(exception)) {\n return `Event \\`ErrorEvent\\` captured as ${captureType} with message \\`${exception.message}\\``;\n }\n\n if (isEvent(exception)) {\n const className = getObjectClassName(exception);\n return `Event \\`${className}\\` (type=${exception.type}) captured as ${captureType}`;\n }\n\n return `Object captured as ${captureType} with keys: ${keys}`;\n}\n\nfunction getObjectClassName(obj: unknown): string | undefined | void {\n try {\n const prototype: Prototype | null = Object.getPrototypeOf(obj);\n return prototype ? prototype.constructor.name : undefined;\n } catch {\n // ignore errors here\n }\n}\n\n/** If a plain object has a property that is an `Error`, return this error. */\nfunction getErrorPropertyFromObject(obj: Record<string, unknown>): Error | undefined {\n for (const prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n const value = obj[prop];\n if (value instanceof Error) {\n return value;\n }\n }\n }\n\n return undefined;\n}\n"],"names":[],"mappings":";;AA2BA;AACA;AACA;AACO,SAAS,kBAAkB,CAAC,WAAW,EAAe,EAAE,EAAoB;AACnF;AACA,EAAE,MAAM,SAAS,gBAAgB,CAAC,WAAW,EAAE,EAAE,CAAC;;AAElD,EAAE,MAAM,SAAS,GAAc;AAC/B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A,EAAA,OAAA,CAAA,mBAAA,EAAA,WAAA,CAAA,YAAA,EAAA,IAAA,CAAA,CAAA;AACA;;AAEA,SAAA,kBAAA,CAAA,GAAA,EAAA;AACA,EAAA,IAAA;AACA,IAAA,MAAA,SAAA,GAAA,MAAA,CAAA,cAAA,CAAA,GAAA,CAAA;AACA,IAAA,OAAA,SAAA,GAAA,SAAA,CAAA,WAAA,CAAA,IAAA,GAAA,SAAA;AACA,EAAA,CAAA,CAAA,MAAA;AACA;AACA,EAAA;AACA;;AAEA;AACA,SAAA,0BAAA,CAAA,GAAA,EAAA;AACA,EAAA,KAAA,MAAA,IAAA,IAAA,GAAA,EAAA;AACA,IAAA,IAAA,MAAA,CAAA,SAAA,CAAA,cAAA,CAAA,IAAA,CAAA,GAAA,EAAA,IAAA,CAAA,EAAA;AACA,MAAA,MAAA,KAAA,GAAA,GAAA,CAAA,IAAA,CAAA;AACA,MAAA,IAAA,KAAA,YAAA,KAAA,EAAA;AACA,QAAA,OAAA,KAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;;AAEA,EAAA,OAAA,SAAA;AACA;;;;"}
@@ -0,0 +1,13 @@
1
+ import { buildFeedbackIntegration } from '@sentry-internal/feedback';
2
+ import { lazyLoadIntegration } from './utils/lazyLoadIntegration.js';
3
+
4
+ /**
5
+ * An integration to add user feedback to your application,
6
+ * while loading most of the code lazily only when it's needed.
7
+ */
8
+ const feedbackAsyncIntegration = buildFeedbackIntegration({
9
+ lazyLoadIntegration,
10
+ });
11
+
12
+ export { feedbackAsyncIntegration };
13
+ //# sourceMappingURL=feedbackAsync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feedbackAsync.js","sources":["../../../../src/feedbackAsync.ts"],"sourcesContent":["import { buildFeedbackIntegration } from '@sentry-internal/feedback';\nimport { lazyLoadIntegration } from './utils/lazyLoadIntegration';\n\n/**\n * An integration to add user feedback to your application,\n * while loading most of the code lazily only when it's needed.\n */\nexport const feedbackAsyncIntegration = buildFeedbackIntegration({\n lazyLoadIntegration,\n});\n"],"names":[],"mappings":";;;AAGA;AACA;AACA;AACA;AACO,MAAM,wBAAA,GAA2B,wBAAwB,CAAC;AACjE,EAAE,mBAAmB;AACrB,CAAC;;;;"}
@@ -0,0 +1,10 @@
1
+ import { buildFeedbackIntegration, feedbackScreenshotIntegration, feedbackModalIntegration } from '@sentry-internal/feedback';
2
+
3
+ /** Add a widget to capture user feedback to your application. */
4
+ const feedbackSyncIntegration = buildFeedbackIntegration({
5
+ getModalIntegration: () => feedbackModalIntegration,
6
+ getScreenshotIntegration: () => feedbackScreenshotIntegration,
7
+ });
8
+
9
+ export { feedbackSyncIntegration };
10
+ //# sourceMappingURL=feedbackSync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feedbackSync.js","sources":["../../../../src/feedbackSync.ts"],"sourcesContent":["import {\n buildFeedbackIntegration,\n feedbackModalIntegration,\n feedbackScreenshotIntegration,\n} from '@sentry-internal/feedback';\n\n/** Add a widget to capture user feedback to your application. */\nexport const feedbackSyncIntegration = buildFeedbackIntegration({\n getModalIntegration: () => feedbackModalIntegration,\n getScreenshotIntegration: () => feedbackScreenshotIntegration,\n});\n"],"names":[],"mappings":";;AAMA;AACO,MAAM,uBAAA,GAA0B,wBAAwB,CAAC;AAChE,EAAE,mBAAmB,EAAE,MAAM,wBAAwB;AACrD,EAAE,wBAAwB,EAAE,MAAM,6BAA6B;AAC/D,CAAC;;;;"}
@@ -0,0 +1,179 @@
1
+ import { GLOBAL_OBJ, getOriginalFunction, markFunctionWrapped, addNonEnumerableProperty, withScope, addExceptionTypeValue, addExceptionMechanism, captureException, getLocationHref } from '@sentry/core';
2
+
3
+ const WINDOW = GLOBAL_OBJ ;
4
+
5
+ let ignoreOnError = 0;
6
+
7
+ /**
8
+ * @hidden
9
+ */
10
+ function shouldIgnoreOnError() {
11
+ return ignoreOnError > 0;
12
+ }
13
+
14
+ /**
15
+ * @hidden
16
+ */
17
+ function ignoreNextOnError() {
18
+ // onerror should trigger before setTimeout
19
+ ignoreOnError++;
20
+ setTimeout(() => {
21
+ ignoreOnError--;
22
+ });
23
+ }
24
+
25
+ // eslint-disable-next-line @typescript-eslint/ban-types
26
+
27
+ /**
28
+ * Instruments the given function and sends an event to Sentry every time the
29
+ * function throws an exception.
30
+ *
31
+ * @param fn A function to wrap. It is generally safe to pass an unbound function, because the returned wrapper always
32
+ * has a correct `this` context.
33
+ * @returns The wrapped function.
34
+ * @hidden
35
+ */
36
+ function wrap(
37
+ fn,
38
+ options
39
+
40
+ = {},
41
+ ) {
42
+ // for future readers what this does is wrap a function and then create
43
+ // a bi-directional wrapping between them.
44
+ //
45
+ // example: wrapped = wrap(original);
46
+ // original.__sentry_wrapped__ -> wrapped
47
+ // wrapped.__sentry_original__ -> original
48
+
49
+ function isFunction(fn) {
50
+ return typeof fn === 'function';
51
+ }
52
+
53
+ if (!isFunction(fn)) {
54
+ return fn;
55
+ }
56
+
57
+ try {
58
+ // if we're dealing with a function that was previously wrapped, return
59
+ // the original wrapper.
60
+ const wrapper = (fn ).__sentry_wrapped__;
61
+ if (wrapper) {
62
+ if (typeof wrapper === 'function') {
63
+ return wrapper;
64
+ } else {
65
+ // If we find that the `__sentry_wrapped__` function is not a function at the time of accessing it, it means
66
+ // that something messed with it. In that case we want to return the originally passed function.
67
+ return fn;
68
+ }
69
+ }
70
+
71
+ // We don't wanna wrap it twice
72
+ if (getOriginalFunction(fn)) {
73
+ return fn;
74
+ }
75
+ } catch {
76
+ // Just accessing custom props in some Selenium environments
77
+ // can cause a "Permission denied" exception (see raven-js#495).
78
+ // Bail on wrapping and return the function as-is (defers to window.onerror).
79
+ return fn;
80
+ }
81
+
82
+ // Wrap the function itself
83
+ // It is important that `sentryWrapped` is not an arrow function to preserve the context of `this`
84
+ const sentryWrapped = function ( ...args) {
85
+ try {
86
+ // Also wrap arguments that are themselves functions
87
+ const wrappedArguments = args.map(arg => wrap(arg, options));
88
+
89
+ // Attempt to invoke user-land function
90
+ // NOTE: If you are a Sentry user, and you are seeing this stack frame, it
91
+ // means the sentry.javascript SDK caught an error invoking your application code. This
92
+ // is expected behavior and NOT indicative of a bug with sentry.javascript.
93
+ return fn.apply(this, wrappedArguments);
94
+ } catch (ex) {
95
+ ignoreNextOnError();
96
+
97
+ withScope(scope => {
98
+ scope.addEventProcessor(event => {
99
+ if (options.mechanism) {
100
+ addExceptionTypeValue(event, undefined, undefined);
101
+ addExceptionMechanism(event, options.mechanism);
102
+ }
103
+
104
+ event.extra = {
105
+ ...event.extra,
106
+ arguments: args,
107
+ };
108
+
109
+ return event;
110
+ });
111
+
112
+ // no need to add a mechanism here, we already add it via an event processor above
113
+ captureException(ex);
114
+ });
115
+
116
+ throw ex;
117
+ }
118
+ } ;
119
+
120
+ // Wrap the wrapped function in a proxy, to ensure any other properties of the original function remain available
121
+ try {
122
+ for (const property in fn) {
123
+ if (Object.prototype.hasOwnProperty.call(fn, property)) {
124
+ sentryWrapped[property ] = fn[property ];
125
+ }
126
+ }
127
+ } catch {
128
+ // Accessing some objects may throw
129
+ // ref: https://github.com/getsentry/sentry-javascript/issues/1168
130
+ }
131
+
132
+ // Signal that this function has been wrapped/filled already
133
+ // for both debugging and to prevent it to being wrapped/filled twice
134
+ markFunctionWrapped(sentryWrapped, fn);
135
+
136
+ addNonEnumerableProperty(fn, '__sentry_wrapped__', sentryWrapped);
137
+
138
+ // Restore original function name (not all browsers allow that)
139
+ try {
140
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
141
+ const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name');
142
+ if (descriptor.configurable) {
143
+ Object.defineProperty(sentryWrapped, 'name', {
144
+ get() {
145
+ return fn.name;
146
+ },
147
+ });
148
+ }
149
+ } catch {
150
+ // This may throw if e.g. the descriptor does not exist, or a browser does not allow redefining `name`.
151
+ // to save some bytes we simply try-catch this
152
+ }
153
+
154
+ return sentryWrapped;
155
+ }
156
+
157
+ /**
158
+ * Get HTTP request data from the current page.
159
+ */
160
+ function getHttpRequestData() {
161
+ // grab as much info as exists and add it to the event
162
+ const url = getLocationHref();
163
+ const { referrer } = WINDOW.document || {};
164
+ const { userAgent } = WINDOW.navigator || {};
165
+
166
+ const headers = {
167
+ ...(referrer && { Referer: referrer }),
168
+ ...(userAgent && { 'User-Agent': userAgent }),
169
+ };
170
+ const request = {
171
+ url,
172
+ headers,
173
+ };
174
+
175
+ return request;
176
+ }
177
+
178
+ export { WINDOW, getHttpRequestData, ignoreNextOnError, shouldIgnoreOnError, wrap };
179
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sources":["../../../../src/helpers.ts"],"sourcesContent":["import type { Mechanism, WrappedFunction } from '@sentry/core';\nimport {\n addExceptionMechanism,\n addExceptionTypeValue,\n addNonEnumerableProperty,\n captureException,\n getLocationHref,\n getOriginalFunction,\n GLOBAL_OBJ,\n markFunctionWrapped,\n withScope,\n} from '@sentry/core';\n\nexport const WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n\nlet ignoreOnError: number = 0;\n\n/**\n * @hidden\n */\nexport function shouldIgnoreOnError(): boolean {\n return ignoreOnError > 0;\n}\n\n/**\n * @hidden\n */\nexport function ignoreNextOnError(): void {\n // onerror should trigger before setTimeout\n ignoreOnError++;\n setTimeout(() => {\n ignoreOnError--;\n });\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\ntype WrappableFunction = Function;\n\nexport function wrap<T extends WrappableFunction>(\n fn: T,\n options?: {\n mechanism?: Mechanism;\n },\n): WrappedFunction<T>;\nexport function wrap<NonFunction>(\n fn: NonFunction,\n options?: {\n mechanism?: Mechanism;\n },\n): NonFunction;\n/**\n * Instruments the given function and sends an event to Sentry every time the\n * function throws an exception.\n *\n * @param fn A function to wrap. It is generally safe to pass an unbound function, because the returned wrapper always\n * has a correct `this` context.\n * @returns The wrapped function.\n * @hidden\n */\nexport function wrap<T extends WrappableFunction, NonFunction>(\n fn: T | NonFunction,\n options: {\n mechanism?: Mechanism;\n } = {},\n): NonFunction | WrappedFunction<T> {\n // for future readers what this does is wrap a function and then create\n // a bi-directional wrapping between them.\n //\n // example: wrapped = wrap(original);\n // original.__sentry_wrapped__ -> wrapped\n // wrapped.__sentry_original__ -> original\n\n function isFunction(fn: T | NonFunction): fn is T {\n return typeof fn === 'function';\n }\n\n if (!isFunction(fn)) {\n return fn;\n }\n\n try {\n // if we're dealing with a function that was previously wrapped, return\n // the original wrapper.\n const wrapper = (fn as WrappedFunction<T>).__sentry_wrapped__;\n if (wrapper) {\n if (typeof wrapper === 'function') {\n return wrapper;\n } else {\n // If we find that the `__sentry_wrapped__` function is not a function at the time of accessing it, it means\n // that something messed with it. In that case we want to return the originally passed function.\n return fn;\n }\n }\n\n // We don't wanna wrap it twice\n if (getOriginalFunction(fn)) {\n return fn;\n }\n } catch {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n // Bail on wrapping and return the function as-is (defers to window.onerror).\n return fn;\n }\n\n // Wrap the function itself\n // It is important that `sentryWrapped` is not an arrow function to preserve the context of `this`\n const sentryWrapped = function (this: unknown, ...args: unknown[]): unknown {\n try {\n // Also wrap arguments that are themselves functions\n const wrappedArguments = args.map(arg => wrap(arg, options));\n\n // Attempt to invoke user-land function\n // NOTE: If you are a Sentry user, and you are seeing this stack frame, it\n // means the sentry.javascript SDK caught an error invoking your application code. This\n // is expected behavior and NOT indicative of a bug with sentry.javascript.\n return fn.apply(this, wrappedArguments);\n } catch (ex) {\n ignoreNextOnError();\n\n withScope(scope => {\n scope.addEventProcessor(event => {\n if (options.mechanism) {\n addExceptionTypeValue(event, undefined, undefined);\n addExceptionMechanism(event, options.mechanism);\n }\n\n event.extra = {\n ...event.extra,\n arguments: args,\n };\n\n return event;\n });\n\n // no need to add a mechanism here, we already add it via an event processor above\n captureException(ex);\n });\n\n throw ex;\n }\n } as unknown as WrappedFunction<T>;\n\n // Wrap the wrapped function in a proxy, to ensure any other properties of the original function remain available\n try {\n for (const property in fn) {\n if (Object.prototype.hasOwnProperty.call(fn, property)) {\n sentryWrapped[property as keyof T] = fn[property as keyof T];\n }\n }\n } catch {\n // Accessing some objects may throw\n // ref: https://github.com/getsentry/sentry-javascript/issues/1168\n }\n\n // Signal that this function has been wrapped/filled already\n // for both debugging and to prevent it to being wrapped/filled twice\n markFunctionWrapped(sentryWrapped, fn);\n\n addNonEnumerableProperty(fn, '__sentry_wrapped__', sentryWrapped);\n\n // Restore original function name (not all browsers allow that)\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name')!;\n if (descriptor.configurable) {\n Object.defineProperty(sentryWrapped, 'name', {\n get(): string {\n return fn.name;\n },\n });\n }\n } catch {\n // This may throw if e.g. the descriptor does not exist, or a browser does not allow redefining `name`.\n // to save some bytes we simply try-catch this\n }\n\n return sentryWrapped;\n}\n\n/**\n * Get HTTP request data from the current page.\n */\nexport function getHttpRequestData(): { url: string; headers: Record<string, string> } {\n // grab as much info as exists and add it to the event\n const url = getLocationHref();\n const { referrer } = WINDOW.document || {};\n const { userAgent } = WINDOW.navigator || {};\n\n const headers = {\n ...(referrer && { Referer: referrer }),\n ...(userAgent && { 'User-Agent': userAgent }),\n };\n const request = {\n url,\n headers,\n };\n\n return request;\n}\n"],"names":[],"mappings":";;AAaO,MAAM,MAAA,GAAS,UAAA;;AAEtB,IAAI,aAAa,GAAW,CAAC;;AAE7B;AACA;AACA;AACO,SAAS,mBAAmB,GAAY;AAC/C,EAAE,OAAO,aAAA,GAAgB,CAAC;AAC1B;;AAEA;AACA;AACA;AACO,SAAS,iBAAiB,GAAS;AAC1C;AACA,EAAE,aAAa,EAAE;AACjB,EAAE,UAAU,CAAC,MAAM;AACnB,IAAI,aAAa,EAAE;AACnB,EAAE,CAAC,CAAC;AACJ;;AAEA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,IAAI;AACpB,EAAE,EAAE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