@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,259 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const core = require('@sentry/core');
4
+ const helpers = require('../helpers.js');
5
+
6
+ const DEFAULT_EVENT_TARGET = [
7
+ 'EventTarget',
8
+ 'Window',
9
+ 'Node',
10
+ 'ApplicationCache',
11
+ 'AudioTrackList',
12
+ 'BroadcastChannel',
13
+ 'ChannelMergerNode',
14
+ 'CryptoOperation',
15
+ 'EventSource',
16
+ 'FileReader',
17
+ 'HTMLUnknownElement',
18
+ 'IDBDatabase',
19
+ 'IDBRequest',
20
+ 'IDBTransaction',
21
+ 'KeyOperation',
22
+ 'MediaController',
23
+ 'MessagePort',
24
+ 'ModalWindow',
25
+ 'Notification',
26
+ 'SVGElementInstance',
27
+ 'Screen',
28
+ 'SharedWorker',
29
+ 'TextTrack',
30
+ 'TextTrackCue',
31
+ 'TextTrackList',
32
+ 'WebSocket',
33
+ 'WebSocketWorker',
34
+ 'Worker',
35
+ 'XMLHttpRequest',
36
+ 'XMLHttpRequestEventTarget',
37
+ 'XMLHttpRequestUpload',
38
+ ];
39
+
40
+ const INTEGRATION_NAME = 'BrowserApiErrors';
41
+
42
+ const _browserApiErrorsIntegration = ((options = {}) => {
43
+ const _options = {
44
+ XMLHttpRequest: true,
45
+ eventTarget: true,
46
+ requestAnimationFrame: true,
47
+ setInterval: true,
48
+ setTimeout: true,
49
+ unregisterOriginalCallbacks: false,
50
+ ...options,
51
+ };
52
+
53
+ return {
54
+ name: INTEGRATION_NAME,
55
+ // TODO: This currently only works for the first client this is setup
56
+ // We may want to adjust this to check for client etc.
57
+ setupOnce() {
58
+ if (_options.setTimeout) {
59
+ core.fill(helpers.WINDOW, 'setTimeout', _wrapTimeFunction);
60
+ }
61
+
62
+ if (_options.setInterval) {
63
+ core.fill(helpers.WINDOW, 'setInterval', _wrapTimeFunction);
64
+ }
65
+
66
+ if (_options.requestAnimationFrame) {
67
+ core.fill(helpers.WINDOW, 'requestAnimationFrame', _wrapRAF);
68
+ }
69
+
70
+ if (_options.XMLHttpRequest && 'XMLHttpRequest' in helpers.WINDOW) {
71
+ core.fill(XMLHttpRequest.prototype, 'send', _wrapXHR);
72
+ }
73
+
74
+ const eventTargetOption = _options.eventTarget;
75
+ if (eventTargetOption) {
76
+ const eventTarget = Array.isArray(eventTargetOption) ? eventTargetOption : DEFAULT_EVENT_TARGET;
77
+ eventTarget.forEach(target => _wrapEventTarget(target, _options));
78
+ }
79
+ },
80
+ };
81
+ }) ;
82
+
83
+ /**
84
+ * Wrap timer functions and event targets to catch errors and provide better meta data.
85
+ */
86
+ const browserApiErrorsIntegration = core.defineIntegration(_browserApiErrorsIntegration);
87
+
88
+ function _wrapTimeFunction(original) {
89
+ return function ( ...args) {
90
+ const originalCallback = args[0];
91
+ args[0] = helpers.wrap(originalCallback, {
92
+ mechanism: {
93
+ handled: false,
94
+ type: `auto.browser.browserapierrors.${core.getFunctionName(original)}`,
95
+ },
96
+ });
97
+ return original.apply(this, args);
98
+ };
99
+ }
100
+
101
+ function _wrapRAF(original) {
102
+ return function ( callback) {
103
+ return original.apply(this, [
104
+ helpers.wrap(callback, {
105
+ mechanism: {
106
+ data: {
107
+ handler: core.getFunctionName(original),
108
+ },
109
+ handled: false,
110
+ type: 'auto.browser.browserapierrors.requestAnimationFrame',
111
+ },
112
+ }),
113
+ ]);
114
+ };
115
+ }
116
+
117
+ function _wrapXHR(originalSend) {
118
+ return function ( ...args) {
119
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
120
+ const xhr = this;
121
+ const xmlHttpRequestProps = ['onload', 'onerror', 'onprogress', 'onreadystatechange'];
122
+
123
+ xmlHttpRequestProps.forEach(prop => {
124
+ if (prop in xhr && typeof xhr[prop] === 'function') {
125
+ core.fill(xhr, prop, function (original) {
126
+ const wrapOptions = {
127
+ mechanism: {
128
+ data: {
129
+ handler: core.getFunctionName(original),
130
+ },
131
+ handled: false,
132
+ type: `auto.browser.browserapierrors.xhr.${prop}`,
133
+ },
134
+ };
135
+
136
+ // If Instrument integration has been called before BrowserApiErrors, get the name of original function
137
+ const originalFunction = core.getOriginalFunction(original);
138
+ if (originalFunction) {
139
+ wrapOptions.mechanism.data.handler = core.getFunctionName(originalFunction);
140
+ }
141
+
142
+ // Otherwise wrap directly
143
+ return helpers.wrap(original, wrapOptions);
144
+ });
145
+ }
146
+ });
147
+
148
+ return originalSend.apply(this, args);
149
+ };
150
+ }
151
+
152
+ function _wrapEventTarget(target, integrationOptions) {
153
+ const globalObject = helpers.WINDOW ;
154
+ const proto = globalObject[target]?.prototype;
155
+
156
+ // eslint-disable-next-line no-prototype-builtins
157
+ if (!proto?.hasOwnProperty?.('addEventListener')) {
158
+ return;
159
+ }
160
+
161
+ core.fill(proto, 'addEventListener', function (original)
162
+
163
+ {
164
+ return function ( eventName, fn, options) {
165
+ try {
166
+ if (isEventListenerObject(fn)) {
167
+ // ESlint disable explanation:
168
+ // First, it is generally safe to call `wrap` with an unbound function. Furthermore, using `.bind()` would
169
+ // introduce a bug here, because bind returns a new function that doesn't have our
170
+ // flags(like __sentry_original__) attached. `wrap` checks for those flags to avoid unnecessary wrapping.
171
+ // Without those flags, every call to addEventListener wraps the function again, causing a memory leak.
172
+ // eslint-disable-next-line @typescript-eslint/unbound-method
173
+ fn.handleEvent = helpers.wrap(fn.handleEvent, {
174
+ mechanism: {
175
+ data: {
176
+ handler: core.getFunctionName(fn),
177
+ target,
178
+ },
179
+ handled: false,
180
+ type: 'auto.browser.browserapierrors.handleEvent',
181
+ },
182
+ });
183
+ }
184
+ } catch {
185
+ // can sometimes get 'Permission denied to access property "handle Event'
186
+ }
187
+
188
+ if (integrationOptions.unregisterOriginalCallbacks) {
189
+ unregisterOriginalCallback(this, eventName, fn);
190
+ }
191
+
192
+ return original.apply(this, [
193
+ eventName,
194
+ helpers.wrap(fn, {
195
+ mechanism: {
196
+ data: {
197
+ handler: core.getFunctionName(fn),
198
+ target,
199
+ },
200
+ handled: false,
201
+ type: 'auto.browser.browserapierrors.addEventListener',
202
+ },
203
+ }),
204
+ options,
205
+ ]);
206
+ };
207
+ });
208
+
209
+ core.fill(proto, 'removeEventListener', function (originalRemoveEventListener)
210
+
211
+ {
212
+ return function ( eventName, fn, options) {
213
+ /**
214
+ * There are 2 possible scenarios here:
215
+ *
216
+ * 1. Someone passes a callback, which was attached prior to Sentry initialization, or by using unmodified
217
+ * method, eg. `document.addEventListener.call(el, name, handler). In this case, we treat this function
218
+ * as a pass-through, and call original `removeEventListener` with it.
219
+ *
220
+ * 2. Someone passes a callback, which was attached after Sentry was initialized, which means that it was using
221
+ * our wrapped version of `addEventListener`, which internally calls `wrap` helper.
222
+ * This helper "wraps" whole callback inside a try/catch statement, and attached appropriate metadata to it,
223
+ * in order for us to make a distinction between wrapped/non-wrapped functions possible.
224
+ * If a function was wrapped, it has additional property of `__sentry_wrapped__`, holding the handler.
225
+ *
226
+ * When someone adds a handler prior to initialization, and then do it again, but after,
227
+ * then we have to detach both of them. Otherwise, if we'd detach only wrapped one, it'd be impossible
228
+ * to get rid of the initial handler and it'd stick there forever.
229
+ */
230
+ try {
231
+ const originalEventHandler = (fn ).__sentry_wrapped__;
232
+ if (originalEventHandler) {
233
+ originalRemoveEventListener.call(this, eventName, originalEventHandler, options);
234
+ }
235
+ } catch {
236
+ // ignore, accessing __sentry_wrapped__ will throw in some Selenium environments
237
+ }
238
+ return originalRemoveEventListener.call(this, eventName, fn, options);
239
+ };
240
+ });
241
+ }
242
+
243
+ function isEventListenerObject(obj) {
244
+ return typeof (obj ).handleEvent === 'function';
245
+ }
246
+
247
+ function unregisterOriginalCallback(target, eventName, fn) {
248
+ if (
249
+ target &&
250
+ typeof target === 'object' &&
251
+ 'removeEventListener' in target &&
252
+ typeof target.removeEventListener === 'function'
253
+ ) {
254
+ target.removeEventListener(eventName, fn);
255
+ }
256
+ }
257
+
258
+ exports.browserApiErrorsIntegration = browserApiErrorsIntegration;
259
+ //# sourceMappingURL=browserapierrors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browserapierrors.js","sources":["../../../../../src/integrations/browserapierrors.ts"],"sourcesContent":["import type { IntegrationFn, WrappedFunction } from '@sentry/core';\nimport { defineIntegration, fill, getFunctionName, getOriginalFunction } from '@sentry/core';\nimport { WINDOW, wrap } from '../helpers';\n\nconst DEFAULT_EVENT_TARGET = [\n 'EventTarget',\n 'Window',\n 'Node',\n 'ApplicationCache',\n 'AudioTrackList',\n 'BroadcastChannel',\n 'ChannelMergerNode',\n 'CryptoOperation',\n 'EventSource',\n 'FileReader',\n 'HTMLUnknownElement',\n 'IDBDatabase',\n 'IDBRequest',\n 'IDBTransaction',\n 'KeyOperation',\n 'MediaController',\n 'MessagePort',\n 'ModalWindow',\n 'Notification',\n 'SVGElementInstance',\n 'Screen',\n 'SharedWorker',\n 'TextTrack',\n 'TextTrackCue',\n 'TextTrackList',\n 'WebSocket',\n 'WebSocketWorker',\n 'Worker',\n 'XMLHttpRequest',\n 'XMLHttpRequestEventTarget',\n 'XMLHttpRequestUpload',\n];\n\nconst INTEGRATION_NAME = 'BrowserApiErrors';\n\ntype XMLHttpRequestProp = 'onload' | 'onerror' | 'onprogress' | 'onreadystatechange';\n\ninterface BrowserApiErrorsOptions {\n setTimeout: boolean;\n setInterval: boolean;\n requestAnimationFrame: boolean;\n XMLHttpRequest: boolean;\n eventTarget: boolean | string[];\n\n /**\n * If you experience issues with this integration causing double-invocations of event listeners,\n * try setting this option to `true`. It will unregister the original callbacks from the event targets\n * before adding the instrumented callback.\n *\n * @default false\n */\n unregisterOriginalCallbacks: boolean;\n}\n\nconst _browserApiErrorsIntegration = ((options: Partial<BrowserApiErrorsOptions> = {}) => {\n const _options = {\n XMLHttpRequest: true,\n eventTarget: true,\n requestAnimationFrame: true,\n setInterval: true,\n setTimeout: true,\n unregisterOriginalCallbacks: false,\n ...options,\n };\n\n return {\n name: INTEGRATION_NAME,\n // TODO: This currently only works for the first client this is setup\n // We may want to adjust this to check for client etc.\n setupOnce() {\n if (_options.setTimeout) {\n fill(WINDOW, 'setTimeout', _wrapTimeFunction);\n }\n\n if (_options.setInterval) {\n fill(WINDOW, 'setInterval', _wrapTimeFunction);\n }\n\n if (_options.requestAnimationFrame) {\n fill(WINDOW, 'requestAnimationFrame', _wrapRAF);\n }\n\n if (_options.XMLHttpRequest && 'XMLHttpRequest' in WINDOW) {\n fill(XMLHttpRequest.prototype, 'send', _wrapXHR);\n }\n\n const eventTargetOption = _options.eventTarget;\n if (eventTargetOption) {\n const eventTarget = Array.isArray(eventTargetOption) ? eventTargetOption : DEFAULT_EVENT_TARGET;\n eventTarget.forEach(target => _wrapEventTarget(target, _options));\n }\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Wrap timer functions and event targets to catch errors and provide better meta data.\n */\nexport const browserApiErrorsIntegration = defineIntegration(_browserApiErrorsIntegration);\n\nfunction _wrapTimeFunction(original: () => void): () => number {\n return function (this: unknown, ...args: unknown[]): number {\n const originalCallback = args[0];\n args[0] = wrap(originalCallback, {\n mechanism: {\n handled: false,\n type: `auto.browser.browserapierrors.${getFunctionName(original)}`,\n },\n });\n return original.apply(this, args);\n };\n}\n\nfunction _wrapRAF(original: () => void): (callback: () => void) => unknown {\n return function (this: unknown, callback: () => void): () => void {\n return original.apply(this, [\n wrap(callback, {\n mechanism: {\n data: {\n handler: getFunctionName(original),\n },\n handled: false,\n type: 'auto.browser.browserapierrors.requestAnimationFrame',\n },\n }),\n ]);\n };\n}\n\nfunction _wrapXHR(originalSend: () => void): () => void {\n return function (this: XMLHttpRequest, ...args: unknown[]): void {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const xhr = this;\n const xmlHttpRequestProps: XMLHttpRequestProp[] = ['onload', 'onerror', 'onprogress', 'onreadystatechange'];\n\n xmlHttpRequestProps.forEach(prop => {\n if (prop in xhr && typeof xhr[prop] === 'function') {\n fill(xhr, prop, function (original) {\n const wrapOptions = {\n mechanism: {\n data: {\n handler: getFunctionName(original),\n },\n handled: false,\n type: `auto.browser.browserapierrors.xhr.${prop}`,\n },\n };\n\n // If Instrument integration has been called before BrowserApiErrors, get the name of original function\n const originalFunction = getOriginalFunction(original);\n if (originalFunction) {\n wrapOptions.mechanism.data.handler = getFunctionName(originalFunction);\n }\n\n // Otherwise wrap directly\n return wrap(original, wrapOptions);\n });\n }\n });\n\n return originalSend.apply(this, args);\n };\n}\n\nfunction _wrapEventTarget(target: string, integrationOptions: BrowserApiErrorsOptions): void {\n const globalObject = WINDOW as unknown as Record<string, { prototype?: object }>;\n const proto = globalObject[target]?.prototype;\n\n // eslint-disable-next-line no-prototype-builtins\n if (!proto?.hasOwnProperty?.('addEventListener')) {\n return;\n }\n\n fill(proto, 'addEventListener', function (original: VoidFunction): (\n ...args: Parameters<typeof WINDOW.addEventListener>\n ) => ReturnType<typeof WINDOW.addEventListener> {\n return function (this: unknown, eventName, fn, options): VoidFunction {\n try {\n if (isEventListenerObject(fn)) {\n // ESlint disable explanation:\n // First, it is generally safe to call `wrap` with an unbound function. Furthermore, using `.bind()` would\n // introduce a bug here, because bind returns a new function that doesn't have our\n // flags(like __sentry_original__) attached. `wrap` checks for those flags to avoid unnecessary wrapping.\n // Without those flags, every call to addEventListener wraps the function again, causing a memory leak.\n // eslint-disable-next-line @typescript-eslint/unbound-method\n fn.handleEvent = wrap(fn.handleEvent, {\n mechanism: {\n data: {\n handler: getFunctionName(fn),\n target,\n },\n handled: false,\n type: 'auto.browser.browserapierrors.handleEvent',\n },\n });\n }\n } catch {\n // can sometimes get 'Permission denied to access property \"handle Event'\n }\n\n if (integrationOptions.unregisterOriginalCallbacks) {\n unregisterOriginalCallback(this, eventName, fn);\n }\n\n return original.apply(this, [\n eventName,\n wrap(fn, {\n mechanism: {\n data: {\n handler: getFunctionName(fn),\n target,\n },\n handled: false,\n type: 'auto.browser.browserapierrors.addEventListener',\n },\n }),\n options,\n ]);\n };\n });\n\n fill(proto, 'removeEventListener', function (originalRemoveEventListener: VoidFunction): (\n this: unknown,\n ...args: Parameters<typeof WINDOW.removeEventListener>\n ) => ReturnType<typeof WINDOW.removeEventListener> {\n return function (this: unknown, eventName, fn, options): VoidFunction {\n /**\n * There are 2 possible scenarios here:\n *\n * 1. Someone passes a callback, which was attached prior to Sentry initialization, or by using unmodified\n * method, eg. `document.addEventListener.call(el, name, handler). In this case, we treat this function\n * as a pass-through, and call original `removeEventListener` with it.\n *\n * 2. Someone passes a callback, which was attached after Sentry was initialized, which means that it was using\n * our wrapped version of `addEventListener`, which internally calls `wrap` helper.\n * This helper \"wraps\" whole callback inside a try/catch statement, and attached appropriate metadata to it,\n * in order for us to make a distinction between wrapped/non-wrapped functions possible.\n * If a function was wrapped, it has additional property of `__sentry_wrapped__`, holding the handler.\n *\n * When someone adds a handler prior to initialization, and then do it again, but after,\n * then we have to detach both of them. Otherwise, if we'd detach only wrapped one, it'd be impossible\n * to get rid of the initial handler and it'd stick there forever.\n */\n try {\n const originalEventHandler = (fn as WrappedFunction).__sentry_wrapped__;\n if (originalEventHandler) {\n originalRemoveEventListener.call(this, eventName, originalEventHandler, options);\n }\n } catch {\n // ignore, accessing __sentry_wrapped__ will throw in some Selenium environments\n }\n return originalRemoveEventListener.call(this, eventName, fn, options);\n };\n });\n}\n\nfunction isEventListenerObject(obj: unknown): obj is EventListenerObject {\n return typeof (obj as EventListenerObject).handleEvent === 'function';\n}\n\nfunction unregisterOriginalCallback(target: unknown, eventName: string, fn: EventListenerOrEventListenerObject): void {\n if (\n target &&\n typeof target === 'object' &&\n 'removeEventListener' in target &&\n typeof target.removeEventListener === 'function'\n ) {\n target.removeEventListener(eventName, fn);\n }\n}\n"],"names":["fill","WINDOW","defineIntegration","wrap","getFunctionName","getOriginalFunction"],"mappings":";;;;;AAIA,MAAM,uBAAuB;AAC7B,EAAE,aAAa;AACf,EAAE,QAAQ;AACV,EAAE,MAAM;AACR,EAAE,kBAAkB;AACpB,EAAE,gBAAgB;AAClB,EAAE,kBAAkB;AACpB,EAAE,mBAAmB;AACrB,EAAE,iBAAiB;AACnB,EAAE,aAAa;AACf,EAAE,YAAY;AACd,EAAE,oBAAoB;AACtB,EAAE,aAAa;AACf,EAAE,YAAY;AACd,EAAE,gBAAgB;AAClB,EAAE,cAAc;AAChB,EAAE,iBAAiB;AACnB,EAAE,aAAa;AACf,EAAE,aAAa;AACf,EAAE,cAAc;AAChB,EAAE,oBAAoB;AACtB,EAAE,QAAQ;AACV,EAAE,cAAc;AAChB,EAAE,WAAW;AACb,EAAE,cAAc;AAChB,EAAE,eAAe;AACjB,EAAE,W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A,MAAA,IAAA;AACA,QAAA,MAAA,oBAAA,GAAA,CAAA,EAAA,GAAA,kBAAA;AACA,QAAA,IAAA,oBAAA,EAAA;AACA,UAAA,2BAAA,CAAA,IAAA,CAAA,IAAA,EAAA,SAAA,EAAA,oBAAA,EAAA,OAAA,CAAA;AACA,QAAA;AACA,MAAA,CAAA,CAAA,MAAA;AACA;AACA,MAAA;AACA,MAAA,OAAA,2BAAA,CAAA,IAAA,CAAA,IAAA,EAAA,SAAA,EAAA,EAAA,EAAA,OAAA,CAAA;AACA,IAAA,CAAA;AACA,EAAA,CAAA,CAAA;AACA;;AAEA,SAAA,qBAAA,CAAA,GAAA,EAAA;AACA,EAAA,OAAA,OAAA,CAAA,GAAA,GAAA,WAAA,KAAA,UAAA;AACA;;AAEA,SAAA,0BAAA,CAAA,MAAA,EAAA,SAAA,EAAA,EAAA,EAAA;AACA,EAAA;AACA,IAAA,MAAA;AACA,IAAA,OAAA,MAAA,KAAA,QAAA;AACA,IAAA,qBAAA,IAAA,MAAA;AACA,IAAA,OAAA,MAAA,CAAA,mBAAA,KAAA;AACA,IAAA;AACA,IAAA,MAAA,CAAA,mBAAA,CAAA,SAAA,EAAA,EAAA,CAAA;AACA,EAAA;AACA;;;;"}
@@ -0,0 +1,44 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const core = require('@sentry/core');
4
+ const browserUtils = require('@sentry-internal/browser-utils');
5
+ const debugBuild = require('../debug-build.js');
6
+ const helpers = require('../helpers.js');
7
+
8
+ /**
9
+ * When added, automatically creates sessions which allow you to track adoption and crashes (crash free rate) in your Releases in Sentry.
10
+ * More information: https://docs.sentry.io/product/releases/health/
11
+ *
12
+ * Note: In order for session tracking to work, you need to set up Releases: https://docs.sentry.io/product/releases/
13
+ */
14
+ const browserSessionIntegration = core.defineIntegration(() => {
15
+ return {
16
+ name: 'BrowserSession',
17
+ setupOnce() {
18
+ if (typeof helpers.WINDOW.document === 'undefined') {
19
+ debugBuild.DEBUG_BUILD &&
20
+ core.debug.warn('Using the `browserSessionIntegration` in non-browser environments is not supported.');
21
+ return;
22
+ }
23
+
24
+ // The session duration for browser sessions does not track a meaningful
25
+ // concept that can be used as a metric.
26
+ // Automatically captured sessions are akin to page views, and thus we
27
+ // discard their duration.
28
+ core.startSession({ ignoreDuration: true });
29
+ core.captureSession();
30
+
31
+ // We want to create a session for every navigation as well
32
+ browserUtils.addHistoryInstrumentationHandler(({ from, to }) => {
33
+ // Don't create an additional session for the initial route or if the location did not change
34
+ if (from !== undefined && from !== to) {
35
+ core.startSession({ ignoreDuration: true });
36
+ core.captureSession();
37
+ }
38
+ });
39
+ },
40
+ };
41
+ });
42
+
43
+ exports.browserSessionIntegration = browserSessionIntegration;
44
+ //# sourceMappingURL=browsersession.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browsersession.js","sources":["../../../../../src/integrations/browsersession.ts"],"sourcesContent":["import { captureSession, debug, defineIntegration, startSession } from '@sentry/core';\nimport { addHistoryInstrumentationHandler } from '@sentry-internal/browser-utils';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\n\n/**\n * When added, automatically creates sessions which allow you to track adoption and crashes (crash free rate) in your Releases in Sentry.\n * More information: https://docs.sentry.io/product/releases/health/\n *\n * Note: In order for session tracking to work, you need to set up Releases: https://docs.sentry.io/product/releases/\n */\nexport const browserSessionIntegration = defineIntegration(() => {\n return {\n name: 'BrowserSession',\n setupOnce() {\n if (typeof WINDOW.document === 'undefined') {\n DEBUG_BUILD &&\n debug.warn('Using the `browserSessionIntegration` in non-browser environments is not supported.');\n return;\n }\n\n // The session duration for browser sessions does not track a meaningful\n // concept that can be used as a metric.\n // Automatically captured sessions are akin to page views, and thus we\n // discard their duration.\n startSession({ ignoreDuration: true });\n captureSession();\n\n // We want to create a session for every navigation as well\n addHistoryInstrumentationHandler(({ from, to }) => {\n // Don't create an additional session for the initial route or if the location did not change\n if (from !== undefined && from !== to) {\n startSession({ ignoreDuration: true });\n captureSession();\n }\n });\n },\n };\n});\n"],"names":["defineIntegration","WINDOW","DEBUG_BUILD","debug","startSession","captureSession","addHistoryInstrumentationHandler"],"mappings":";;;;;;;AAKA;AACA;AACA;AACA;AACA;AACA;MACa,yBAAA,GAA4BA,sBAAiB,CAAC,MAAM;AACjE,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,IAAI,OAAOC,cAAM,CAAC,QAAA,KAAa,WAAW,EAAE;AAClD,QAAQC,sBAAA;AACR,UAAUC,UAAK,CAAC,IAAI,CAAC,qFAAqF,CAAC;AAC3G,QAAQ;AACR,MAAM;;AAEN;AACA;AACA;AACA;AACA,MAAMC,iBAAY,CAAC,EAAE,cAAc,EAAE,IAAA,EAAM,CAAC;AAC5C,MAAMC,mBAAc,EAAE;;AAEtB;AACA,MAAMC,6CAAgC,CAAC,CAAC,EAAE,IAAI,EAAE,EAAA,EAAI,KAAK;AACzD;AACA,QAAQ,IAAI,IAAA,KAAS,aAAa,IAAA,KAAS,EAAE,EAAE;AAC/C,UAAUF,iBAAY,CAAC,EAAE,cAAc,EAAE,IAAA,EAAM,CAAC;AAChD,UAAUC,mBAAc,EAAE;AAC1B,QAAQ;AACR,MAAM,CAAC,CAAC;AACR,IAAI,CAAC;AACL,GAAG;AACH,CAAC;;;;"}
@@ -0,0 +1,89 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const core = require('@sentry/core');
4
+
5
+ const WINDOW = core.GLOBAL_OBJ ;
6
+
7
+ const DEFAULT_LINES_OF_CONTEXT = 7;
8
+
9
+ const INTEGRATION_NAME = 'ContextLines';
10
+
11
+ const _contextLinesIntegration = ((options = {}) => {
12
+ const contextLines = options.frameContextLines != null ? options.frameContextLines : DEFAULT_LINES_OF_CONTEXT;
13
+
14
+ return {
15
+ name: INTEGRATION_NAME,
16
+ processEvent(event) {
17
+ return addSourceContext(event, contextLines);
18
+ },
19
+ };
20
+ }) ;
21
+
22
+ /**
23
+ * Collects source context lines around the lines of stackframes pointing to JS embedded in
24
+ * the current page's HTML.
25
+ *
26
+ * This integration DOES NOT work for stack frames pointing to JS files that are loaded by the browser.
27
+ * For frames pointing to files, context lines are added during ingestion and symbolication
28
+ * by attempting to download the JS files to the Sentry backend.
29
+ *
30
+ * Use this integration if you have inline JS code in HTML pages that can't be accessed
31
+ * by our backend (e.g. due to a login-protected page).
32
+ */
33
+ const contextLinesIntegration = core.defineIntegration(_contextLinesIntegration);
34
+
35
+ /**
36
+ * Processes an event and adds context lines.
37
+ */
38
+ function addSourceContext(event, contextLines) {
39
+ const doc = WINDOW.document;
40
+ const htmlFilename = WINDOW.location && core.stripUrlQueryAndFragment(WINDOW.location.href);
41
+ if (!doc || !htmlFilename) {
42
+ return event;
43
+ }
44
+
45
+ const exceptions = event.exception?.values;
46
+ if (!exceptions?.length) {
47
+ return event;
48
+ }
49
+
50
+ const html = doc.documentElement.innerHTML;
51
+ if (!html) {
52
+ return event;
53
+ }
54
+
55
+ const htmlLines = ['<!DOCTYPE html>', '<html>', ...html.split('\n'), '</html>'];
56
+
57
+ exceptions.forEach(exception => {
58
+ const stacktrace = exception.stacktrace;
59
+ if (stacktrace?.frames) {
60
+ stacktrace.frames = stacktrace.frames.map(frame =>
61
+ applySourceContextToFrame(frame, htmlLines, htmlFilename, contextLines),
62
+ );
63
+ }
64
+ });
65
+
66
+ return event;
67
+ }
68
+
69
+ /**
70
+ * Only exported for testing
71
+ */
72
+ function applySourceContextToFrame(
73
+ frame,
74
+ htmlLines,
75
+ htmlFilename,
76
+ linesOfContext,
77
+ ) {
78
+ if (frame.filename !== htmlFilename || !frame.lineno || !htmlLines.length) {
79
+ return frame;
80
+ }
81
+
82
+ core.addContextToFrame(htmlLines, frame, linesOfContext);
83
+
84
+ return frame;
85
+ }
86
+
87
+ exports.applySourceContextToFrame = applySourceContextToFrame;
88
+ exports.contextLinesIntegration = contextLinesIntegration;
89
+ //# sourceMappingURL=contextlines.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contextlines.js","sources":["../../../../../src/integrations/contextlines.ts"],"sourcesContent":["import type { Event, IntegrationFn, StackFrame } from '@sentry/core';\nimport { addContextToFrame, defineIntegration, GLOBAL_OBJ, stripUrlQueryAndFragment } from '@sentry/core';\n\nconst WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n\nconst DEFAULT_LINES_OF_CONTEXT = 7;\n\nconst INTEGRATION_NAME = 'ContextLines';\n\ninterface ContextLinesOptions {\n /**\n * Sets the number of context lines for each frame when loading a file.\n * Defaults to 7.\n *\n * Set to 0 to disable loading and inclusion of source files.\n **/\n frameContextLines?: number;\n}\n\nconst _contextLinesIntegration = ((options: ContextLinesOptions = {}) => {\n const contextLines = options.frameContextLines != null ? options.frameContextLines : DEFAULT_LINES_OF_CONTEXT;\n\n return {\n name: INTEGRATION_NAME,\n processEvent(event) {\n return addSourceContext(event, contextLines);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Collects source context lines around the lines of stackframes pointing to JS embedded in\n * the current page's HTML.\n *\n * This integration DOES NOT work for stack frames pointing to JS files that are loaded by the browser.\n * For frames pointing to files, context lines are added during ingestion and symbolication\n * by attempting to download the JS files to the Sentry backend.\n *\n * Use this integration if you have inline JS code in HTML pages that can't be accessed\n * by our backend (e.g. due to a login-protected page).\n */\nexport const contextLinesIntegration = defineIntegration(_contextLinesIntegration);\n\n/**\n * Processes an event and adds context lines.\n */\nfunction addSourceContext(event: Event, contextLines: number): Event {\n const doc = WINDOW.document;\n const htmlFilename = WINDOW.location && stripUrlQueryAndFragment(WINDOW.location.href);\n if (!doc || !htmlFilename) {\n return event;\n }\n\n const exceptions = event.exception?.values;\n if (!exceptions?.length) {\n return event;\n }\n\n const html = doc.documentElement.innerHTML;\n if (!html) {\n return event;\n }\n\n const htmlLines = ['<!DOCTYPE html>', '<html>', ...html.split('\\n'), '</html>'];\n\n exceptions.forEach(exception => {\n const stacktrace = exception.stacktrace;\n if (stacktrace?.frames) {\n stacktrace.frames = stacktrace.frames.map(frame =>\n applySourceContextToFrame(frame, htmlLines, htmlFilename, contextLines),\n );\n }\n });\n\n return event;\n}\n\n/**\n * Only exported for testing\n */\nexport function applySourceContextToFrame(\n frame: StackFrame,\n htmlLines: string[],\n htmlFilename: string,\n linesOfContext: number,\n): StackFrame {\n if (frame.filename !== htmlFilename || !frame.lineno || !htmlLines.length) {\n return frame;\n }\n\n addContextToFrame(htmlLines, frame, linesOfContext);\n\n return frame;\n}\n"],"names":["GLOBAL_OBJ","defineIntegration","stripUrlQueryAndFragment","addContextToFrame"],"mappings":";;;;AAGA,MAAM,MAAA,GAASA,eAAA;;AAEf,MAAM,wBAAA,GAA2B,CAAC;;AAElC,MAAM,gBAAA,GAAmB,cAAc;;AAYvC,MAAM,wBAAA,IAA4B,CAAC,OAAO,GAAwB,EAAE,KAAK;AACzE,EAAE,MAAM,YAAA,GAAe,OAAO,CAAC,iBAAA,IAAqB,IAAA,GAAO,OAAO,CAAC,iBAAA,GAAoB,wBAAwB;;AAE/G,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,YAAY,CAAC,KAAK,EAAE;AACxB,MAAM,OAAO,gBAAgB,CAAC,KAAK,EAAE,YAAY,CAAC;AAClD,IAAI,CAAC;AACL,GAAG;AACH,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,uBAAA,GAA0BC,sBAAiB,CAAC,wBAAwB;;AAEjF;AACA;AACA;AACA,SAAS,gBAAgB,CAAC,KAAK,EAAS,YAAY,EAAiB;AACrE,EAAE,MAAM,GAAA,GAAM,MAAM,CAAC,QAAQ;AAC7B,EAAE,MAAM,YAAA,GAAe,MAAM,CAAC,QAAA,IAAYC,6BAAwB,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;AACxF,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE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toStringTag, { value: 'Module' });
2
+
3
+ const core = require('@sentry/core');
4
+
5
+ /**
6
+ * Sentry integration for capturing feature flag evaluations from GrowthBook.
7
+ *
8
+ * See the feature flag documentation: https://develop.sentry.dev/sdk/expected-features/#feature-flags
9
+ *
10
+ * @example
11
+ * ```
12
+ * import { GrowthBook } from '@growthbook/growthbook';
13
+ * import * as Sentry from '@sentry/browser';
14
+ *
15
+ * Sentry.init({
16
+ * dsn: '___PUBLIC_DSN___',
17
+ * integrations: [Sentry.growthbookIntegration({ growthbookClass: GrowthBook })],
18
+ * });
19
+ *
20
+ * const gb = new GrowthBook();
21
+ * gb.isOn('my-feature');
22
+ * Sentry.captureException(new Error('something went wrong'));
23
+ * ```
24
+ */
25
+ const growthbookIntegration = (({ growthbookClass }) =>
26
+ core.growthbookIntegration({ growthbookClass })) ;
27
+
28
+ exports.growthbookIntegration = growthbookIntegration;
29
+ //# sourceMappingURL=integration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration.js","sources":["../../../../../../../src/integrations/featureFlags/growthbook/integration.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core';\nimport { growthbookIntegration as coreGrowthbookIntegration } from '@sentry/core';\nimport type { GrowthBookClass } from './types';\n\n/**\n * Sentry integration for capturing feature flag evaluations from GrowthBook.\n *\n * See the feature flag documentation: https://develop.sentry.dev/sdk/expected-features/#feature-flags\n *\n * @example\n * ```\n * import { GrowthBook } from '@growthbook/growthbook';\n * import * as Sentry from '@sentry/browser';\n *\n * Sentry.init({\n * dsn: '___PUBLIC_DSN___',\n * integrations: [Sentry.growthbookIntegration({ growthbookClass: GrowthBook })],\n * });\n *\n * const gb = new GrowthBook();\n * gb.isOn('my-feature');\n * Sentry.captureException(new Error('something went wrong'));\n * ```\n */\nexport const growthbookIntegration = (({ growthbookClass }: { growthbookClass: GrowthBookClass }) =>\n coreGrowthbookIntegration({ growthbookClass })) satisfies IntegrationFn;\n"],"names":["coreGrowthbookIntegration"],"mappings":";;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,yBAAyB,CAAC,EAAE,eAAA,EAAiB;AAC1D,EAAEA,0BAAyB,CAAC,EAAE,eAAA,EAAiB,CAAC,CAAA;;;;"}
@@ -0,0 +1,55 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const core = require('@sentry/core');
4
+
5
+ /**
6
+ * Sentry integration for capturing feature flag evaluations from LaunchDarkly.
7
+ *
8
+ * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.
9
+ *
10
+ * @example
11
+ * ```
12
+ * import * as Sentry from '@sentry/browser';
13
+ * import {launchDarklyIntegration, buildLaunchDarklyFlagUsedInspector} from '@sentry/browser';
14
+ * import * as LaunchDarkly from 'launchdarkly-js-client-sdk';
15
+ *
16
+ * Sentry.init(..., integrations: [launchDarklyIntegration()])
17
+ * const ldClient = LaunchDarkly.initialize(..., {inspectors: [buildLaunchDarklyFlagUsedHandler()]});
18
+ * ```
19
+ */
20
+ const launchDarklyIntegration = core.defineIntegration(() => {
21
+ return {
22
+ name: 'LaunchDarkly',
23
+
24
+ processEvent(event, _hint, _client) {
25
+ return core._INTERNAL_copyFlagsFromScopeToEvent(event);
26
+ },
27
+ };
28
+ }) ;
29
+
30
+ /**
31
+ * LaunchDarkly hook to listen for and buffer flag evaluations. This needs to
32
+ * be registered as an 'inspector' in LaunchDarkly initialize() options,
33
+ * separately from `launchDarklyIntegration`. Both the hook and the integration
34
+ * are needed to capture LaunchDarkly flags.
35
+ */
36
+ function buildLaunchDarklyFlagUsedHandler() {
37
+ return {
38
+ name: 'sentry-flag-auditor',
39
+ type: 'flag-used',
40
+
41
+ synchronous: true,
42
+
43
+ /**
44
+ * Handle a flag evaluation by storing its name and value on the current scope.
45
+ */
46
+ method: (flagKey, flagDetail, _context) => {
47
+ core._INTERNAL_insertFlagToScope(flagKey, flagDetail.value);
48
+ core._INTERNAL_addFeatureFlagToActiveSpan(flagKey, flagDetail.value);
49
+ },
50
+ };
51
+ }
52
+
53
+ exports.buildLaunchDarklyFlagUsedHandler = buildLaunchDarklyFlagUsedHandler;
54
+ exports.launchDarklyIntegration = launchDarklyIntegration;
55
+ //# sourceMappingURL=integration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration.js","sources":["../../../../../../../src/integrations/featureFlags/launchdarkly/integration.ts"],"sourcesContent":["import type { Client, Event, EventHint, IntegrationFn } from '@sentry/core';\nimport {\n _INTERNAL_addFeatureFlagToActiveSpan,\n _INTERNAL_copyFlagsFromScopeToEvent,\n _INTERNAL_insertFlagToScope,\n defineIntegration,\n} from '@sentry/core';\nimport type { LDContext, LDEvaluationDetail, LDInspectionFlagUsedHandler } from './types';\n\n/**\n * Sentry integration for capturing feature flag evaluations from LaunchDarkly.\n *\n * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.\n *\n * @example\n * ```\n * import * as Sentry from '@sentry/browser';\n * import {launchDarklyIntegration, buildLaunchDarklyFlagUsedInspector} from '@sentry/browser';\n * import * as LaunchDarkly from 'launchdarkly-js-client-sdk';\n *\n * Sentry.init(..., integrations: [launchDarklyIntegration()])\n * const ldClient = LaunchDarkly.initialize(..., {inspectors: [buildLaunchDarklyFlagUsedHandler()]});\n * ```\n */\nexport const launchDarklyIntegration = defineIntegration(() => {\n return {\n name: 'LaunchDarkly',\n\n processEvent(event: Event, _hint: EventHint, _client: Client): Event {\n return _INTERNAL_copyFlagsFromScopeToEvent(event);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * LaunchDarkly hook to listen for and buffer flag evaluations. This needs to\n * be registered as an 'inspector' in LaunchDarkly initialize() options,\n * separately from `launchDarklyIntegration`. Both the hook and the integration\n * are needed to capture LaunchDarkly flags.\n */\nexport function buildLaunchDarklyFlagUsedHandler(): LDInspectionFlagUsedHandler {\n return {\n name: 'sentry-flag-auditor',\n type: 'flag-used',\n\n synchronous: true,\n\n /**\n * Handle a flag evaluation by storing its name and value on the current scope.\n */\n method: (flagKey: string, flagDetail: LDEvaluationDetail, _context: LDContext) => {\n _INTERNAL_insertFlagToScope(flagKey, flagDetail.value);\n _INTERNAL_addFeatureFlagToActiveSpan(flagKey, flagDetail.value);\n },\n };\n}\n"],"names":["defineIntegration","_INTERNAL_copyFlagsFromScopeToEvent","_INTERNAL_insertFlagToScope","_INTERNAL_addFeatureFlagToActiveSpan"],"mappings":";;;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,uBAAA,GAA0BA,sBAAiB,CAAC,MAAM;AAC/D,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,cAAc;;AAExB,IAAI,YAAY,CAAC,KAAK,EAAS,KAAK,EAAa,OAAO,EAAiB;AACzE,MAAM,OAAOC,wCAAmC,CAAC,KAAK,CAAC;AACvD,IAAI,CAAC;AACL,GAAG;AACH,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gCAAgC,GAAgC;AAChF,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,qBAAqB;AAC/B,IAAI,IAAI,EAAE,WAAW;;AAErB,IAAI,WAAW,EAAE,IAAI;;AAErB;AACA;AACA;AACA,IAAI,MAAM,EAAE,CAAC,OAAO,EAAU,UAAU,EAAsB,QAAQ,KAAgB;AACtF,MAAMC,gCAA2B,CAAC,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC;AAC5D,MAAMC,yCAAoC,CAAC,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC;AACrE,IAAI,CAAC;AACL,GAAG;AACH;;;;;"}
@@ -0,0 +1,38 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const core = require('@sentry/core');
4
+
5
+ const openFeatureIntegration = core.defineIntegration(() => {
6
+ return {
7
+ name: 'OpenFeature',
8
+
9
+ processEvent(event, _hint, _client) {
10
+ return core._INTERNAL_copyFlagsFromScopeToEvent(event);
11
+ },
12
+ };
13
+ }) ;
14
+
15
+ /**
16
+ * OpenFeature Hook class implementation.
17
+ */
18
+ class OpenFeatureIntegrationHook {
19
+ /**
20
+ * Successful evaluation result.
21
+ */
22
+ after(_hookContext, evaluationDetails) {
23
+ core._INTERNAL_insertFlagToScope(evaluationDetails.flagKey, evaluationDetails.value);
24
+ core._INTERNAL_addFeatureFlagToActiveSpan(evaluationDetails.flagKey, evaluationDetails.value);
25
+ }
26
+
27
+ /**
28
+ * On error evaluation result.
29
+ */
30
+ error(hookContext, _error, _hookHints) {
31
+ core._INTERNAL_insertFlagToScope(hookContext.flagKey, hookContext.defaultValue);
32
+ core._INTERNAL_addFeatureFlagToActiveSpan(hookContext.flagKey, hookContext.defaultValue);
33
+ }
34
+ }
35
+
36
+ exports.OpenFeatureIntegrationHook = OpenFeatureIntegrationHook;
37
+ exports.openFeatureIntegration = openFeatureIntegration;
38
+ //# sourceMappingURL=integration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration.js","sources":["../../../../../../../src/integrations/featureFlags/openfeature/integration.ts"],"sourcesContent":["/**\n * Sentry integration for capturing OpenFeature feature flag evaluations.\n *\n * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.\n *\n * @example\n * ```\n * import * as Sentry from \"@sentry/browser\";\n * import { OpenFeature } from \"@openfeature/web-sdk\";\n *\n * Sentry.init(..., integrations: [Sentry.openFeatureIntegration()]);\n * OpenFeature.setProvider(new MyProviderOfChoice());\n * OpenFeature.addHooks(new Sentry.OpenFeatureIntegrationHook());\n * ```\n */\nimport type { Client, Event, EventHint, IntegrationFn } from '@sentry/core';\nimport {\n _INTERNAL_addFeatureFlagToActiveSpan,\n _INTERNAL_copyFlagsFromScopeToEvent,\n _INTERNAL_insertFlagToScope,\n defineIntegration,\n} from '@sentry/core';\nimport type { EvaluationDetails, HookContext, HookHints, JsonValue, OpenFeatureHook } from './types';\n\nexport const openFeatureIntegration = defineIntegration(() => {\n return {\n name: 'OpenFeature',\n\n processEvent(event: Event, _hint: EventHint, _client: Client): Event {\n return _INTERNAL_copyFlagsFromScopeToEvent(event);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * OpenFeature Hook class implementation.\n */\nexport class OpenFeatureIntegrationHook implements OpenFeatureHook {\n /**\n * Successful evaluation result.\n */\n public after(_hookContext: Readonly<HookContext<JsonValue>>, evaluationDetails: EvaluationDetails<JsonValue>): void {\n _INTERNAL_insertFlagToScope(evaluationDetails.flagKey, evaluationDetails.value);\n _INTERNAL_addFeatureFlagToActiveSpan(evaluationDetails.flagKey, evaluationDetails.value);\n }\n\n /**\n * On error evaluation result.\n */\n public error(hookContext: Readonly<HookContext<JsonValue>>, _error: unknown, _hookHints?: HookHints): void {\n _INTERNAL_insertFlagToScope(hookContext.flagKey, hookContext.defaultValue);\n _INTERNAL_addFeatureFlagToActiveSpan(hookContext.flagKey, hookContext.defaultValue);\n }\n}\n"],"names":["defineIntegration","_INTERNAL_copyFlagsFromScopeToEvent","_INTERNAL_insertFlagToScope","_INTERNAL_addFeatureFlagToActiveSpan"],"mappings":";;;;MAwBa,sBAAA,GAAyBA,sBAAiB,CAAC,MAAM;AAC9D,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,aAAa;;AAEvB,IAAI,YAAY,CAAC,KAAK,EAAS,KAAK,EAAa,OAAO,EAAiB;AACzE,MAAM,OAAOC,wCAAmC,CAAC,KAAK,CAAC;AACvD,IAAI,CAAC;AACL,GAAG;AACH,CAAC,CAAA;;AAED;AACA;AACA;AACO,MAAM,4BAAsD;AACnE;AACA;AACA;AACA,GAAS,KAAK,CAAC,YAAY,EAAoC,iBAAiB,EAAsC;AACtH,IAAIC,gCAA2B,CAAC,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,CAAC,KAAK,CAAC;AACnF,IAAIC,yCAAoC,CAAC,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,CAAC,KAAK,CAAC;AAC5F,EAAE;;AAEF;AACA;AACA;AACA,GAAS,KAAK,CAAC,WAAW,EAAoC,MAAM,EAAW,UAAU,EAAoB;AAC7G,IAAID,gCAA2B,CAAC,WAAW,CAAC,OAAO,EAAE,WAAW,CAAC,YAAY,CAAC;AAC9E,IAAIC,yCAAoC,CAAC,WAAW,CAAC,OAAO,EAAE,WAAW,CAAC,YAAY,CAAC;AACvF,EAAE;AACF;;;;;"}
@@ -0,0 +1,48 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const core = require('@sentry/core');
4
+
5
+ /**
6
+ * Sentry integration for capturing feature flag evaluations from the Statsig js-client SDK.
7
+ *
8
+ * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.
9
+ *
10
+ * @example
11
+ * ```
12
+ * import { StatsigClient } from '@statsig/js-client';
13
+ * import * as Sentry from '@sentry/browser';
14
+ *
15
+ * const statsigClient = new StatsigClient();
16
+ *
17
+ * Sentry.init({
18
+ * dsn: '___PUBLIC_DSN___',
19
+ * integrations: [Sentry.statsigIntegration({featureFlagClient: statsigClient})],
20
+ * });
21
+ *
22
+ * await statsigClient.initializeAsync(); // or statsigClient.initializeSync();
23
+ *
24
+ * const result = statsigClient.checkGate('my-feature-gate');
25
+ * Sentry.captureException(new Error('something went wrong'));
26
+ * ```
27
+ */
28
+ const statsigIntegration = core.defineIntegration(
29
+ ({ featureFlagClient: statsigClient }) => {
30
+ return {
31
+ name: 'Statsig',
32
+
33
+ setup(_client) {
34
+ statsigClient.on('gate_evaluation', (event) => {
35
+ core._INTERNAL_insertFlagToScope(event.gate.name, event.gate.value);
36
+ core._INTERNAL_addFeatureFlagToActiveSpan(event.gate.name, event.gate.value);
37
+ });
38
+ },
39
+
40
+ processEvent(event, _hint, _client) {
41
+ return core._INTERNAL_copyFlagsFromScopeToEvent(event);
42
+ },
43
+ };
44
+ },
45
+ ) ;
46
+
47
+ exports.statsigIntegration = statsigIntegration;
48
+ //# sourceMappingURL=integration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration.js","sources":["../../../../../../../src/integrations/featureFlags/statsig/integration.ts"],"sourcesContent":["import type { Client, Event, EventHint, IntegrationFn } from '@sentry/core';\nimport {\n _INTERNAL_addFeatureFlagToActiveSpan,\n _INTERNAL_copyFlagsFromScopeToEvent,\n _INTERNAL_insertFlagToScope,\n defineIntegration,\n} from '@sentry/core';\nimport type { FeatureGate, StatsigClient } from './types';\n\n/**\n * Sentry integration for capturing feature flag evaluations from the Statsig js-client SDK.\n *\n * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.\n *\n * @example\n * ```\n * import { StatsigClient } from '@statsig/js-client';\n * import * as Sentry from '@sentry/browser';\n *\n * const statsigClient = new StatsigClient();\n *\n * Sentry.init({\n * dsn: '___PUBLIC_DSN___',\n * integrations: [Sentry.statsigIntegration({featureFlagClient: statsigClient})],\n * });\n *\n * await statsigClient.initializeAsync(); // or statsigClient.initializeSync();\n *\n * const result = statsigClient.checkGate('my-feature-gate');\n * Sentry.captureException(new Error('something went wrong'));\n * ```\n */\nexport const statsigIntegration = defineIntegration(\n ({ featureFlagClient: statsigClient }: { featureFlagClient: StatsigClient }) => {\n return {\n name: 'Statsig',\n\n setup(_client: Client) {\n statsigClient.on('gate_evaluation', (event: { gate: FeatureGate }) => {\n _INTERNAL_insertFlagToScope(event.gate.name, event.gate.value);\n _INTERNAL_addFeatureFlagToActiveSpan(event.gate.name, event.gate.value);\n });\n },\n\n processEvent(event: Event, _hint: EventHint, _client: Client): Event {\n return _INTERNAL_copyFlagsFromScopeToEvent(event);\n },\n };\n },\n) satisfies IntegrationFn;\n"],"names":["defineIntegration","_INTERNAL_insertFlagToScope","_INTERNAL_addFeatureFlagToActiveSpan","_INTERNAL_copyFlagsFromScopeToEvent"],"mappings":";;;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,kBAAA,GAAqBA,sBAAiB;AACnD,EAAE,CAAC,EAAE,iBAAiB,EAAE,aAAA,EAAe,KAA2C;AAClF,IAAI,OAAO;AACX,MAAM,IAAI,EAAE,SAAS;;AAErB,MAAM,KAAK,CAAC,OAAO,EAAU;AAC7B,QAAQ,aAAa,CAAC,EAAE,CAAC,iBAAiB,EAAE,CAAC,KAAK,KAA4B;AAC9E,UAAUC,gCAA2B,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;AACxE,UAAUC,yCAAoC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;AACjF,QAAQ,CAAC,CAAC;AACV,MAAM,CAAC;;AAEP,MAAM,YAAY,CAAC,KAAK,EAAS,KAAK,EAAa,OAAO,EAAiB;AAC3E,QAAQ,OAAOC,wCAAmC,CAAC,KAAK,CAAC;AACzD,MAAM,CAAC;AACP,KAAK;AACL,EAAE,CAAC;AACH,CAAA;;;;"}