@sentry/react-native 6.5.0-beta.1 → 6.5.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 (300) hide show
  1. package/RNSentry.podspec +1 -1
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +31 -22
  4. package/android/src/main/java/io/sentry/react/RNSentryVersion.java +8 -0
  5. package/dist/js/NativeRNSentry.d.ts +1 -1
  6. package/dist/js/NativeRNSentry.d.ts.map +1 -1
  7. package/dist/js/NativeRNSentry.js.map +1 -1
  8. package/dist/js/breadcrumb.d.ts +1 -1
  9. package/dist/js/breadcrumb.d.ts.map +1 -1
  10. package/dist/js/breadcrumb.js +1 -1
  11. package/dist/js/breadcrumb.js.map +1 -1
  12. package/dist/js/client.d.ts +1 -1
  13. package/dist/js/client.d.ts.map +1 -1
  14. package/dist/js/client.js +1 -2
  15. package/dist/js/client.js.map +1 -1
  16. package/dist/js/index.d.ts +1 -1
  17. package/dist/js/index.d.ts.map +1 -1
  18. package/dist/js/index.js.map +1 -1
  19. package/dist/js/integrations/debugsymbolicator.d.ts +1 -1
  20. package/dist/js/integrations/debugsymbolicator.d.ts.map +1 -1
  21. package/dist/js/integrations/debugsymbolicator.js +1 -1
  22. package/dist/js/integrations/debugsymbolicator.js.map +1 -1
  23. package/dist/js/integrations/debugsymbolicatorutils.d.ts +1 -1
  24. package/dist/js/integrations/debugsymbolicatorutils.d.ts.map +1 -1
  25. package/dist/js/integrations/debugsymbolicatorutils.js +1 -1
  26. package/dist/js/integrations/debugsymbolicatorutils.js.map +1 -1
  27. package/dist/js/integrations/default.d.ts +1 -1
  28. package/dist/js/integrations/default.d.ts.map +1 -1
  29. package/dist/js/integrations/default.js +13 -12
  30. package/dist/js/integrations/default.js.map +1 -1
  31. package/dist/js/integrations/devicecontext.d.ts +1 -1
  32. package/dist/js/integrations/devicecontext.d.ts.map +1 -1
  33. package/dist/js/integrations/devicecontext.js +1 -1
  34. package/dist/js/integrations/devicecontext.js.map +1 -1
  35. package/dist/js/integrations/eventorigin.d.ts +1 -1
  36. package/dist/js/integrations/eventorigin.d.ts.map +1 -1
  37. package/dist/js/integrations/eventorigin.js.map +1 -1
  38. package/dist/js/integrations/expocontext.d.ts +1 -1
  39. package/dist/js/integrations/expocontext.d.ts.map +1 -1
  40. package/dist/js/integrations/expocontext.js.map +1 -1
  41. package/dist/js/integrations/factory.d.ts +1 -1
  42. package/dist/js/integrations/factory.d.ts.map +1 -1
  43. package/dist/js/integrations/factory.js.map +1 -1
  44. package/dist/js/integrations/modulesloader.d.ts +1 -1
  45. package/dist/js/integrations/modulesloader.d.ts.map +1 -1
  46. package/dist/js/integrations/modulesloader.js +1 -1
  47. package/dist/js/integrations/modulesloader.js.map +1 -1
  48. package/dist/js/integrations/nativelinkederrors.d.ts +1 -1
  49. package/dist/js/integrations/nativelinkederrors.d.ts.map +1 -1
  50. package/dist/js/integrations/nativelinkederrors.js +1 -1
  51. package/dist/js/integrations/nativelinkederrors.js.map +1 -1
  52. package/dist/js/integrations/reactnativeerrorhandlers.d.ts +1 -1
  53. package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
  54. package/dist/js/integrations/reactnativeerrorhandlers.js +1 -2
  55. package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
  56. package/dist/js/integrations/reactnativeerrorhandlersutils.js +1 -1
  57. package/dist/js/integrations/reactnativeerrorhandlersutils.js.map +1 -1
  58. package/dist/js/integrations/reactnativeinfo.d.ts +1 -1
  59. package/dist/js/integrations/reactnativeinfo.d.ts.map +1 -1
  60. package/dist/js/integrations/reactnativeinfo.js.map +1 -1
  61. package/dist/js/integrations/release.d.ts +1 -1
  62. package/dist/js/integrations/release.d.ts.map +1 -1
  63. package/dist/js/integrations/release.js.map +1 -1
  64. package/dist/js/integrations/rewriteframes.d.ts +1 -1
  65. package/dist/js/integrations/rewriteframes.d.ts.map +1 -1
  66. package/dist/js/integrations/rewriteframes.js.map +1 -1
  67. package/dist/js/integrations/screenshot.d.ts +1 -1
  68. package/dist/js/integrations/screenshot.d.ts.map +1 -1
  69. package/dist/js/integrations/screenshot.js.map +1 -1
  70. package/dist/js/integrations/sdkinfo.d.ts +1 -1
  71. package/dist/js/integrations/sdkinfo.d.ts.map +1 -1
  72. package/dist/js/integrations/sdkinfo.js +1 -1
  73. package/dist/js/integrations/sdkinfo.js.map +1 -1
  74. package/dist/js/integrations/spotlight.d.ts +1 -1
  75. package/dist/js/integrations/spotlight.d.ts.map +1 -1
  76. package/dist/js/integrations/spotlight.js +1 -1
  77. package/dist/js/integrations/spotlight.js.map +1 -1
  78. package/dist/js/integrations/viewhierarchy.d.ts +1 -1
  79. package/dist/js/integrations/viewhierarchy.d.ts.map +1 -1
  80. package/dist/js/integrations/viewhierarchy.js +1 -1
  81. package/dist/js/integrations/viewhierarchy.js.map +1 -1
  82. package/dist/js/misc.d.ts +1 -1
  83. package/dist/js/misc.d.ts.map +1 -1
  84. package/dist/js/misc.js.map +1 -1
  85. package/dist/js/options.d.ts +18 -6
  86. package/dist/js/options.d.ts.map +1 -1
  87. package/dist/js/options.js.map +1 -1
  88. package/dist/js/profiling/cache.d.ts.map +1 -1
  89. package/dist/js/profiling/cache.js +53 -1
  90. package/dist/js/profiling/cache.js.map +1 -1
  91. package/dist/js/profiling/convertHermesProfile.d.ts +1 -1
  92. package/dist/js/profiling/convertHermesProfile.d.ts.map +1 -1
  93. package/dist/js/profiling/convertHermesProfile.js +1 -1
  94. package/dist/js/profiling/convertHermesProfile.js.map +1 -1
  95. package/dist/js/profiling/debugid.d.ts +1 -1
  96. package/dist/js/profiling/debugid.d.ts.map +1 -1
  97. package/dist/js/profiling/debugid.js +1 -1
  98. package/dist/js/profiling/debugid.js.map +1 -1
  99. package/dist/js/profiling/integration.d.ts +1 -1
  100. package/dist/js/profiling/integration.d.ts.map +1 -1
  101. package/dist/js/profiling/integration.js +1 -3
  102. package/dist/js/profiling/integration.js.map +1 -1
  103. package/dist/js/profiling/types.d.ts +1 -1
  104. package/dist/js/profiling/types.d.ts.map +1 -1
  105. package/dist/js/profiling/types.js.map +1 -1
  106. package/dist/js/profiling/utils.d.ts +1 -1
  107. package/dist/js/profiling/utils.d.ts.map +1 -1
  108. package/dist/js/profiling/utils.js +1 -1
  109. package/dist/js/profiling/utils.js.map +1 -1
  110. package/dist/js/replay/CustomMask.js +1 -1
  111. package/dist/js/replay/CustomMask.js.map +1 -1
  112. package/dist/js/replay/mobilereplay.d.ts +3 -5
  113. package/dist/js/replay/mobilereplay.d.ts.map +1 -1
  114. package/dist/js/replay/mobilereplay.js +3 -5
  115. package/dist/js/replay/mobilereplay.js.map +1 -1
  116. package/dist/js/replay/networkUtils.d.ts +1 -0
  117. package/dist/js/replay/networkUtils.d.ts.map +1 -1
  118. package/dist/js/replay/xhrUtils.d.ts +1 -1
  119. package/dist/js/replay/xhrUtils.d.ts.map +1 -1
  120. package/dist/js/replay/xhrUtils.js +1 -1
  121. package/dist/js/replay/xhrUtils.js.map +1 -1
  122. package/dist/js/scopeSync.d.ts +1 -1
  123. package/dist/js/scopeSync.d.ts.map +1 -1
  124. package/dist/js/scopeSync.js.map +1 -1
  125. package/dist/js/sdk.d.ts +1 -1
  126. package/dist/js/sdk.d.ts.map +1 -1
  127. package/dist/js/sdk.js +1 -3
  128. package/dist/js/sdk.js.map +1 -1
  129. package/dist/js/tools/ModulesCollector.js +13 -13
  130. package/dist/js/tools/ModulesCollector.js.map +1 -1
  131. package/dist/js/tools/enableLogger.js +2 -2
  132. package/dist/js/tools/enableLogger.js.map +1 -1
  133. package/dist/js/tools/metroMiddleware.js +8 -8
  134. package/dist/js/tools/metroMiddleware.js.map +1 -1
  135. package/dist/js/tools/metroconfig.js +4 -4
  136. package/dist/js/tools/metroconfig.js.map +1 -1
  137. package/dist/js/tools/sentryBabelTransformerUtils.js +3 -3
  138. package/dist/js/tools/sentryBabelTransformerUtils.js.map +1 -1
  139. package/dist/js/touchevents.d.ts.map +1 -1
  140. package/dist/js/touchevents.js +1 -2
  141. package/dist/js/touchevents.js.map +1 -1
  142. package/dist/js/tracing/gesturetracing.d.ts.map +1 -1
  143. package/dist/js/tracing/gesturetracing.js +1 -2
  144. package/dist/js/tracing/gesturetracing.js.map +1 -1
  145. package/dist/js/tracing/integrations/appStart.d.ts +1 -1
  146. package/dist/js/tracing/integrations/appStart.d.ts.map +1 -1
  147. package/dist/js/tracing/integrations/appStart.js +1 -3
  148. package/dist/js/tracing/integrations/appStart.js.map +1 -1
  149. package/dist/js/tracing/integrations/nativeFrames.d.ts +1 -1
  150. package/dist/js/tracing/integrations/nativeFrames.d.ts.map +1 -1
  151. package/dist/js/tracing/integrations/nativeFrames.js +1 -1
  152. package/dist/js/tracing/integrations/nativeFrames.js.map +1 -1
  153. package/dist/js/tracing/integrations/stalltracking.d.ts +1 -1
  154. package/dist/js/tracing/integrations/stalltracking.d.ts.map +1 -1
  155. package/dist/js/tracing/integrations/stalltracking.js +1 -3
  156. package/dist/js/tracing/integrations/stalltracking.js.map +1 -1
  157. package/dist/js/tracing/integrations/userInteraction.d.ts +1 -1
  158. package/dist/js/tracing/integrations/userInteraction.d.ts.map +1 -1
  159. package/dist/js/tracing/integrations/userInteraction.js +1 -2
  160. package/dist/js/tracing/integrations/userInteraction.js.map +1 -1
  161. package/dist/js/tracing/onSpanEndUtils.d.ts +1 -1
  162. package/dist/js/tracing/onSpanEndUtils.d.ts.map +1 -1
  163. package/dist/js/tracing/onSpanEndUtils.js +1 -2
  164. package/dist/js/tracing/onSpanEndUtils.js.map +1 -1
  165. package/dist/js/tracing/reactnativenavigation.d.ts +1 -1
  166. package/dist/js/tracing/reactnativenavigation.d.ts.map +1 -1
  167. package/dist/js/tracing/reactnativenavigation.js.map +1 -1
  168. package/dist/js/tracing/reactnativeprofiler.d.ts.map +1 -1
  169. package/dist/js/tracing/reactnativeprofiler.js +1 -1
  170. package/dist/js/tracing/reactnativeprofiler.js.map +1 -1
  171. package/dist/js/tracing/reactnativetracing.d.ts +1 -1
  172. package/dist/js/tracing/reactnativetracing.d.ts.map +1 -1
  173. package/dist/js/tracing/reactnativetracing.js.map +1 -1
  174. package/dist/js/tracing/reactnavigation.d.ts +1 -1
  175. package/dist/js/tracing/reactnavigation.d.ts.map +1 -1
  176. package/dist/js/tracing/reactnavigation.js +1 -3
  177. package/dist/js/tracing/reactnavigation.js.map +1 -1
  178. package/dist/js/tracing/span.d.ts +1 -1
  179. package/dist/js/tracing/span.d.ts.map +1 -1
  180. package/dist/js/tracing/span.js +1 -2
  181. package/dist/js/tracing/span.js.map +1 -1
  182. package/dist/js/tracing/timetodisplay.d.ts +1 -1
  183. package/dist/js/tracing/timetodisplay.d.ts.map +1 -1
  184. package/dist/js/tracing/timetodisplay.js +1 -2
  185. package/dist/js/tracing/timetodisplay.js.map +1 -1
  186. package/dist/js/tracing/timetodisplaynative.types.d.ts +1 -0
  187. package/dist/js/tracing/timetodisplaynative.types.d.ts.map +1 -1
  188. package/dist/js/tracing/types.d.ts +1 -1
  189. package/dist/js/tracing/types.d.ts.map +1 -1
  190. package/dist/js/tracing/types.js.map +1 -1
  191. package/dist/js/tracing/utils.d.ts +1 -1
  192. package/dist/js/tracing/utils.d.ts.map +1 -1
  193. package/dist/js/tracing/utils.js +1 -2
  194. package/dist/js/tracing/utils.js.map +1 -1
  195. package/dist/js/transports/native.d.ts +1 -2
  196. package/dist/js/transports/native.d.ts.map +1 -1
  197. package/dist/js/transports/native.js +1 -1
  198. package/dist/js/transports/native.js.map +1 -1
  199. package/dist/js/user.d.ts +1 -1
  200. package/dist/js/user.d.ts.map +1 -1
  201. package/dist/js/user.js.map +1 -1
  202. package/dist/js/utils/clientutils.d.ts +1 -1
  203. package/dist/js/utils/clientutils.d.ts.map +1 -1
  204. package/dist/js/utils/clientutils.js.map +1 -1
  205. package/dist/js/utils/envelope.d.ts +1 -1
  206. package/dist/js/utils/envelope.d.ts.map +1 -1
  207. package/dist/js/utils/envelope.js +1 -1
  208. package/dist/js/utils/envelope.js.map +1 -1
  209. package/dist/js/utils/fill.d.ts +1 -1
  210. package/dist/js/utils/fill.js +2 -2
  211. package/dist/js/utils/fill.js.map +1 -1
  212. package/dist/js/utils/normalize.js +1 -1
  213. package/dist/js/utils/normalize.js.map +1 -1
  214. package/dist/js/utils/outcome.d.ts +1 -1
  215. package/dist/js/utils/outcome.d.ts.map +1 -1
  216. package/dist/js/utils/outcome.js.map +1 -1
  217. package/dist/js/utils/safe.js +1 -1
  218. package/dist/js/utils/safe.js.map +1 -1
  219. package/dist/js/utils/sentryeventemitter.js +1 -1
  220. package/dist/js/utils/sentryeventemitter.js.map +1 -1
  221. package/dist/js/utils/sentryeventemitterfallback.js +1 -1
  222. package/dist/js/utils/sentryeventemitterfallback.js.map +1 -1
  223. package/dist/js/utils/span.d.ts +1 -1
  224. package/dist/js/utils/span.d.ts.map +1 -1
  225. package/dist/js/utils/span.js.map +1 -1
  226. package/dist/js/utils/worldwide.d.ts +1 -1
  227. package/dist/js/utils/worldwide.d.ts.map +1 -1
  228. package/dist/js/utils/worldwide.js +1 -1
  229. package/dist/js/utils/worldwide.js.map +1 -1
  230. package/dist/js/vendor/react-native/index.d.ts +1 -0
  231. package/dist/js/vendor/react-native/index.d.ts.map +1 -1
  232. package/dist/js/version.d.ts +1 -1
  233. package/dist/js/version.d.ts.map +1 -1
  234. package/dist/js/version.js +1 -1
  235. package/dist/js/version.js.map +1 -1
  236. package/dist/js/wrapper.d.ts +1 -1
  237. package/dist/js/wrapper.d.ts.map +1 -1
  238. package/dist/js/wrapper.js +1 -1
  239. package/dist/js/wrapper.js.map +1 -1
  240. package/ios/RNSentry.mm +1 -1
  241. package/ios/RNSentryReplay.mm +8 -17
  242. package/package.json +11 -11
  243. package/src/js/NativeRNSentry.ts +1 -1
  244. package/ts3.8/dist/js/NativeRNSentry.d.ts +1 -1
  245. package/ts3.8/dist/js/breadcrumb.d.ts +1 -1
  246. package/ts3.8/dist/js/client.d.ts +1 -1
  247. package/ts3.8/dist/js/index.d.ts +1 -1
  248. package/ts3.8/dist/js/integrations/debugsymbolicator.d.ts +1 -1
  249. package/ts3.8/dist/js/integrations/debugsymbolicatorutils.d.ts +1 -1
  250. package/ts3.8/dist/js/integrations/default.d.ts +1 -1
  251. package/ts3.8/dist/js/integrations/devicecontext.d.ts +1 -1
  252. package/ts3.8/dist/js/integrations/eventorigin.d.ts +1 -1
  253. package/ts3.8/dist/js/integrations/expocontext.d.ts +1 -1
  254. package/ts3.8/dist/js/integrations/factory.d.ts +1 -1
  255. package/ts3.8/dist/js/integrations/modulesloader.d.ts +1 -1
  256. package/ts3.8/dist/js/integrations/nativelinkederrors.d.ts +1 -1
  257. package/ts3.8/dist/js/integrations/reactnativeerrorhandlers.d.ts +1 -1
  258. package/ts3.8/dist/js/integrations/reactnativeinfo.d.ts +1 -1
  259. package/ts3.8/dist/js/integrations/release.d.ts +1 -1
  260. package/ts3.8/dist/js/integrations/rewriteframes.d.ts +1 -1
  261. package/ts3.8/dist/js/integrations/screenshot.d.ts +1 -1
  262. package/ts3.8/dist/js/integrations/sdkinfo.d.ts +1 -1
  263. package/ts3.8/dist/js/integrations/spotlight.d.ts +1 -1
  264. package/ts3.8/dist/js/integrations/viewhierarchy.d.ts +1 -1
  265. package/ts3.8/dist/js/misc.d.ts +1 -1
  266. package/ts3.8/dist/js/options.d.ts +18 -6
  267. package/ts3.8/dist/js/profiling/convertHermesProfile.d.ts +1 -1
  268. package/ts3.8/dist/js/profiling/debugid.d.ts +1 -1
  269. package/ts3.8/dist/js/profiling/integration.d.ts +1 -1
  270. package/ts3.8/dist/js/profiling/types.d.ts +1 -1
  271. package/ts3.8/dist/js/profiling/utils.d.ts +1 -1
  272. package/ts3.8/dist/js/replay/mobilereplay.d.ts +3 -5
  273. package/ts3.8/dist/js/replay/networkUtils.d.ts +1 -0
  274. package/ts3.8/dist/js/replay/xhrUtils.d.ts +1 -1
  275. package/ts3.8/dist/js/scopeSync.d.ts +1 -1
  276. package/ts3.8/dist/js/sdk.d.ts +1 -1
  277. package/ts3.8/dist/js/tracing/integrations/appStart.d.ts +1 -1
  278. package/ts3.8/dist/js/tracing/integrations/nativeFrames.d.ts +1 -1
  279. package/ts3.8/dist/js/tracing/integrations/stalltracking.d.ts +1 -1
  280. package/ts3.8/dist/js/tracing/integrations/userInteraction.d.ts +1 -1
  281. package/ts3.8/dist/js/tracing/onSpanEndUtils.d.ts +1 -1
  282. package/ts3.8/dist/js/tracing/reactnativenavigation.d.ts +1 -1
  283. package/ts3.8/dist/js/tracing/reactnativetracing.d.ts +1 -1
  284. package/ts3.8/dist/js/tracing/reactnavigation.d.ts +1 -1
  285. package/ts3.8/dist/js/tracing/span.d.ts +1 -1
  286. package/ts3.8/dist/js/tracing/timetodisplay.d.ts +1 -1
  287. package/ts3.8/dist/js/tracing/timetodisplaynative.types.d.ts +1 -0
  288. package/ts3.8/dist/js/tracing/types.d.ts +1 -1
  289. package/ts3.8/dist/js/tracing/utils.d.ts +1 -1
  290. package/ts3.8/dist/js/transports/native.d.ts +1 -2
  291. package/ts3.8/dist/js/user.d.ts +1 -1
  292. package/ts3.8/dist/js/utils/clientutils.d.ts +1 -1
  293. package/ts3.8/dist/js/utils/envelope.d.ts +1 -1
  294. package/ts3.8/dist/js/utils/fill.d.ts +1 -1
  295. package/ts3.8/dist/js/utils/outcome.d.ts +1 -1
  296. package/ts3.8/dist/js/utils/span.d.ts +1 -1
  297. package/ts3.8/dist/js/utils/worldwide.d.ts +1 -1
  298. package/ts3.8/dist/js/vendor/react-native/index.d.ts +1 -0
  299. package/ts3.8/dist/js/version.d.ts +1 -1
  300. package/ts3.8/dist/js/wrapper.d.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/js/profiling/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;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;QACpB,OAAO,QAAQ,CAAC;KACjB;IAED,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;QAC9B,oCAAoC;QACpC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;KAClD;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["/* eslint-disable complexity */\nimport type { Envelope, Event, ThreadCpuProfile } from '@sentry/types';\nimport { forEachEnvelopeItem, logger } from '@sentry/utils';\n\nimport { getDefaultEnvironment } from '../utils/environment';\nimport { getDebugMetadata } from './debugid';\nimport type {\n AndroidCombinedProfileEvent,\n AndroidProfileEvent,\n CombinedProfileEvent,\n HermesProfileEvent,\n ProfileEvent,\n RawThreadCpuProfile,\n} from './types';\n\n/**\n *\n */\nexport function isValidProfile(profile: ThreadCpuProfile): profile is RawThreadCpuProfile & { profile_id: string } {\n if (profile.samples.length <= 1) {\n if (__DEV__) {\n // Log a warning if the profile has less than 2 samples so users can know why\n // they are not seeing any profiling data and we cant avoid the back and forth\n // of asking them to provide us with a dump of the profile data.\n logger.log('[Profiling] Discarding profile because it contains less than 2 samples');\n }\n return false;\n }\n return true;\n}\n\n/**\n * Finds transactions with profile_id context in the envelope\n * @param envelope\n * @returns\n */\nexport function findProfiledTransactionsFromEnvelope(envelope: Envelope): Event[] {\n const events: Event[] = [];\n\n forEachEnvelopeItem(envelope, (item, type) => {\n if (type !== 'transaction') {\n return;\n }\n\n // First item is the type\n for (let j = 1; j < item.length; j++) {\n const event = item[j];\n\n // @ts-expect-error accessing private property\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (event.contexts?.trace?.data?.profile_id) {\n events.push(item[j] as Event);\n }\n }\n });\n\n return events;\n}\n\n/**\n * Creates a profiling envelope item, if the profile does not pass validation, returns null.\n * @param event\n * @returns {ProfileEvent | null}\n */\nexport function enrichCombinedProfileWithEventContext(\n profile_id: string,\n profile: CombinedProfileEvent | AndroidCombinedProfileEvent,\n event: Event,\n): ProfileEvent | null {\n if ('js_profile' in profile) {\n return enrichAndroidProfileWithEventContext(profile_id, profile, event);\n }\n\n if (!profile.profile || !isValidProfile(profile.profile)) {\n return null;\n }\n\n const trace_id = (event.contexts && event.contexts.trace && event.contexts.trace.trace_id) || '';\n\n // Log a warning if the profile has an invalid traceId (should be uuidv4).\n // All profiles and transactions are rejected if this is the case and we want to\n // warn users that this is happening if they enable debug flag\n if (trace_id && trace_id.length !== 32) {\n if (__DEV__) {\n logger.log(`[Profiling] Invalid traceId: ${trace_id} on profiled event`);\n }\n }\n\n return {\n ...profile,\n event_id: profile_id,\n runtime: {\n name: 'hermes',\n version: '', // TODO: get hermes version\n },\n timestamp: event.start_timestamp ? new Date(event.start_timestamp * 1000).toISOString() : new Date().toISOString(),\n release: event.release || '',\n environment: event.environment || getDefaultEnvironment(),\n os: {\n name: (event.contexts && event.contexts.os && event.contexts.os.name) || '',\n version: (event.contexts && event.contexts.os && event.contexts.os.version) || '',\n build_number: (event.contexts && event.contexts.os && event.contexts.os.build) || '',\n },\n device: {\n locale: (event.contexts && event.contexts.device && (event.contexts.device.locale as string)) || '',\n model: (event.contexts && event.contexts.device && event.contexts.device.model) || '',\n manufacturer: (event.contexts && event.contexts.device && event.contexts.device.manufacturer) || '',\n architecture: (event.contexts && event.contexts.device && event.contexts.device.arch) || '',\n is_emulator: (event.contexts && event.contexts.device && event.contexts.device.simulator) || false,\n },\n transaction: {\n name: event.transaction || '',\n id: event.event_id || '',\n trace_id,\n active_thread_id: (profile.transaction && profile.transaction.active_thread_id) || '',\n },\n debug_meta: {\n images: [...getDebugMetadata(), ...((profile.debug_meta && profile.debug_meta.images) || [])],\n },\n };\n}\n\n/**\n * Creates Android profiling envelope item.\n */\nexport function enrichAndroidProfileWithEventContext(\n profile_id: string,\n profile: AndroidCombinedProfileEvent,\n event: Event,\n): AndroidProfileEvent | null {\n return {\n ...profile,\n debug_meta: {\n images: getDebugMetadata(),\n },\n build_id: profile.build_id || '',\n\n device_cpu_frequencies: [],\n device_is_emulator: (event.contexts && event.contexts.device && event.contexts.device.simulator) || false,\n device_locale: (event.contexts && event.contexts.device && (event.contexts.device.locale as string)) || '',\n device_manufacturer: (event.contexts && event.contexts.device && event.contexts.device.manufacturer) || '',\n device_model: (event.contexts && event.contexts.device && event.contexts.device.model) || '',\n device_os_name: (event.contexts && event.contexts.os && event.contexts.os.name) || '',\n device_os_version: (event.contexts && event.contexts.os && event.contexts.os.version) || '',\n\n device_physical_memory_bytes:\n (event.contexts &&\n event.contexts.device &&\n event.contexts.device.memory_size &&\n Number(event.contexts.device.memory_size).toString(10)) ||\n '',\n\n environment: event.environment || getDefaultEnvironment(),\n\n profile_id,\n\n timestamp: event.start_timestamp ? new Date(event.start_timestamp * 1000).toISOString() : new Date().toISOString(),\n\n release: event.release || '',\n dist: event.dist || '',\n\n transaction_id: event.event_id || '',\n transaction_name: event.transaction || '',\n trace_id: (event.contexts && event.contexts.trace && event.contexts.trace.trace_id) || '',\n\n version_name: event.release || '',\n version_code: event.dist || '',\n };\n}\n\n/**\n * Creates profiling event compatible carrier Object from raw Hermes profile.\n */\nexport function createHermesProfilingEvent(profile: RawThreadCpuProfile): HermesProfileEvent {\n return {\n platform: 'javascript',\n version: '1',\n profile,\n transaction: {\n active_thread_id: profile.active_thread_id,\n },\n };\n}\n\n/**\n * Adds items to envelope if they are not already present - mutates the envelope.\n * @param envelope\n */\nexport function addProfilesToEnvelope(envelope: Envelope, profiles: ProfileEvent[]): Envelope {\n if (!profiles.length) {\n return envelope;\n }\n\n for (const profile of profiles) {\n // @ts-expect-error untyped envelope\n envelope[1].push([{ type: 'profile' }, profile]);\n }\n return envelope;\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/js/profiling/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAE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IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;QACpB,OAAO,QAAQ,CAAC;KACjB;IAED,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;QAC9B,oCAAoC;QACpC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;KAClD;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["/* eslint-disable complexity */\nimport type { Envelope, Event, ThreadCpuProfile } from '@sentry/core';\nimport { forEachEnvelopeItem, logger } from '@sentry/core';\n\nimport { getDefaultEnvironment } from '../utils/environment';\nimport { getDebugMetadata } from './debugid';\nimport type {\n AndroidCombinedProfileEvent,\n AndroidProfileEvent,\n CombinedProfileEvent,\n HermesProfileEvent,\n ProfileEvent,\n RawThreadCpuProfile,\n} from './types';\n\n/**\n *\n */\nexport function isValidProfile(profile: ThreadCpuProfile): profile is RawThreadCpuProfile & { profile_id: string } {\n if (profile.samples.length <= 1) {\n if (__DEV__) {\n // Log a warning if the profile has less than 2 samples so users can know why\n // they are not seeing any profiling data and we cant avoid the back and forth\n // of asking them to provide us with a dump of the profile data.\n logger.log('[Profiling] Discarding profile because it contains less than 2 samples');\n }\n return false;\n }\n return true;\n}\n\n/**\n * Finds transactions with profile_id context in the envelope\n * @param envelope\n * @returns\n */\nexport function findProfiledTransactionsFromEnvelope(envelope: Envelope): Event[] {\n const events: Event[] = [];\n\n forEachEnvelopeItem(envelope, (item, type) => {\n if (type !== 'transaction') {\n return;\n }\n\n // First item is the type\n for (let j = 1; j < item.length; j++) {\n const event = item[j];\n\n // @ts-expect-error accessing private property\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (event.contexts?.trace?.data?.profile_id) {\n events.push(item[j] as Event);\n }\n }\n });\n\n return events;\n}\n\n/**\n * Creates a profiling envelope item, if the profile does not pass validation, returns null.\n * @param event\n * @returns {ProfileEvent | null}\n */\nexport function enrichCombinedProfileWithEventContext(\n profile_id: string,\n profile: CombinedProfileEvent | AndroidCombinedProfileEvent,\n event: Event,\n): ProfileEvent | null {\n if ('js_profile' in profile) {\n return enrichAndroidProfileWithEventContext(profile_id, profile, event);\n }\n\n if (!profile.profile || !isValidProfile(profile.profile)) {\n return null;\n }\n\n const trace_id = (event.contexts && event.contexts.trace && event.contexts.trace.trace_id) || '';\n\n // Log a warning if the profile has an invalid traceId (should be uuidv4).\n // All profiles and transactions are rejected if this is the case and we want to\n // warn users that this is happening if they enable debug flag\n if (trace_id && trace_id.length !== 32) {\n if (__DEV__) {\n logger.log(`[Profiling] Invalid traceId: ${trace_id} on profiled event`);\n }\n }\n\n return {\n ...profile,\n event_id: profile_id,\n runtime: {\n name: 'hermes',\n version: '', // TODO: get hermes version\n },\n timestamp: event.start_timestamp ? new Date(event.start_timestamp * 1000).toISOString() : new Date().toISOString(),\n release: event.release || '',\n environment: event.environment || getDefaultEnvironment(),\n os: {\n name: (event.contexts && event.contexts.os && event.contexts.os.name) || '',\n version: (event.contexts && event.contexts.os && event.contexts.os.version) || '',\n build_number: (event.contexts && event.contexts.os && event.contexts.os.build) || '',\n },\n device: {\n locale: (event.contexts && event.contexts.device && (event.contexts.device.locale as string)) || '',\n model: (event.contexts && event.contexts.device && event.contexts.device.model) || '',\n manufacturer: (event.contexts && event.contexts.device && event.contexts.device.manufacturer) || '',\n architecture: (event.contexts && event.contexts.device && event.contexts.device.arch) || '',\n is_emulator: (event.contexts && event.contexts.device && event.contexts.device.simulator) || false,\n },\n transaction: {\n name: event.transaction || '',\n id: event.event_id || '',\n trace_id,\n active_thread_id: (profile.transaction && profile.transaction.active_thread_id) || '',\n },\n debug_meta: {\n images: [...getDebugMetadata(), ...((profile.debug_meta && profile.debug_meta.images) || [])],\n },\n };\n}\n\n/**\n * Creates Android profiling envelope item.\n */\nexport function enrichAndroidProfileWithEventContext(\n profile_id: string,\n profile: AndroidCombinedProfileEvent,\n event: Event,\n): AndroidProfileEvent | null {\n return {\n ...profile,\n debug_meta: {\n images: getDebugMetadata(),\n },\n build_id: profile.build_id || '',\n\n device_cpu_frequencies: [],\n device_is_emulator: (event.contexts && event.contexts.device && event.contexts.device.simulator) || false,\n device_locale: (event.contexts && event.contexts.device && (event.contexts.device.locale as string)) || '',\n device_manufacturer: (event.contexts && event.contexts.device && event.contexts.device.manufacturer) || '',\n device_model: (event.contexts && event.contexts.device && event.contexts.device.model) || '',\n device_os_name: (event.contexts && event.contexts.os && event.contexts.os.name) || '',\n device_os_version: (event.contexts && event.contexts.os && event.contexts.os.version) || '',\n\n device_physical_memory_bytes:\n (event.contexts &&\n event.contexts.device &&\n event.contexts.device.memory_size &&\n Number(event.contexts.device.memory_size).toString(10)) ||\n '',\n\n environment: event.environment || getDefaultEnvironment(),\n\n profile_id,\n\n timestamp: event.start_timestamp ? new Date(event.start_timestamp * 1000).toISOString() : new Date().toISOString(),\n\n release: event.release || '',\n dist: event.dist || '',\n\n transaction_id: event.event_id || '',\n transaction_name: event.transaction || '',\n trace_id: (event.contexts && event.contexts.trace && event.contexts.trace.trace_id) || '',\n\n version_name: event.release || '',\n version_code: event.dist || '',\n };\n}\n\n/**\n * Creates profiling event compatible carrier Object from raw Hermes profile.\n */\nexport function createHermesProfilingEvent(profile: RawThreadCpuProfile): HermesProfileEvent {\n return {\n platform: 'javascript',\n version: '1',\n profile,\n transaction: {\n active_thread_id: profile.active_thread_id,\n },\n };\n}\n\n/**\n * Adds items to envelope if they are not already present - mutates the envelope.\n * @param envelope\n */\nexport function addProfilesToEnvelope(envelope: Envelope, profiles: ProfileEvent[]): Envelope {\n if (!profiles.length) {\n return envelope;\n }\n\n for (const profile of profiles) {\n // @ts-expect-error untyped envelope\n envelope[1].push([{ type: 'profile' }, profile]);\n }\n return envelope;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { logger } from '@sentry/utils';
1
+ import { logger } from '@sentry/core';
2
2
  import * as React from 'react';
3
3
  import { UIManager, View } from 'react-native';
4
4
  const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
@@ -1 +1 @@
1
- {"version":3,"file":"CustomMask.js","sourceRoot":"","sources":["../../../src/js/replay/CustomMask.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,uBAAuB,GAGzB,OAAO,CAAC,gEAAgE,CAAC,CAAC;AAE9E,MAAM,uBAAuB,GAAG,oBAAoB,CAAC;AACrD,MAAM,yBAAyB,GAAG,sBAAsB,CAAC;AAEzD,MAAM,WAAW,GAAG,CAAC,SAAiB,EAAU,EAAE,CAAC,yBAAyB,SAAS,2DAA2D,SAAS,+EAA+E,CAAC;AAEzO,MAAM,IAAI,GAAG,CAAC,SAAiB,EAAQ,EAAE;IACvC,UAAU,CAAC,GAAG,EAAE;QACd,gGAAgG;QAChG,4CAA4C;QAC5C,sCAAsC;QACtC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC;IACvC,CAAC,EAAE,CAAC,CAAC,CAAC;AACR,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,SAAoB,EAAsB,EAAE;IAChE,IAAI,CAAC,MAAM,CAAC,CAAC;IACb,OAAO,oBAAC,IAAI,oBAAK,SAAS,EAAI,CAAC;AACjC,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,SAAoB,EAAsB,EAAE;IAClE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACf,OAAO,oBAAC,IAAI,oBAAK,SAAS,EAAI,CAAC;AACjC,CAAC,CAAC;AAEF,MAAM,oBAAoB,GAAG,CAAC,mBAA2B,EAAW,EAAE,CAAC,SAAS,CAAC,oBAAoB,IAAI,SAAS,CAAC,oBAAoB,CAAC,mBAAmB,CAAC,CAAC;AAE7J,MAAM,IAAI,GAAG,CAAC,GAA8D,EAAE;IAC5E,IAAI,CAAC,oBAAoB,CAAC,uBAAuB,CAAC,EAAE;QAClD,MAAM,CAAC,IAAI,CAAC,oCAAoC,uBAAuB,GAAG,CAAC,CAAC;QAC5E,OAAO,YAAY,CAAC;KACrB;IAED,qDAAqD;IACrD,8KAA8K;IAC9K,OAAO,uBAAuB,CAAC,GAAG,CAAC,uBAAuB,EAAE,GAAG,EAAE,CAAC,CAAC;QACjE,eAAe,EAAE,uBAAuB;KACzC,CAAC,CAAC,CAAC;AACN,CAAC,CAAC,EAAE,CAAA;AAEJ,MAAM,MAAM,GAAG,CAAC,GAA8D,EAAE;IAC9E,IAAI,CAAC,oBAAoB,CAAC,yBAAyB,CAAC,EAAE;QACpD,MAAM,CAAC,IAAI,CAAC,oCAAoC,yBAAyB,GAAG,CAAC,CAAC;QAC9E,OAAO,cAAc,CAAC;KACvB;IAED,qDAAqD;IACrD,8KAA8K;IAC9K,OAAO,uBAAuB,CAAC,GAAG,CAAC,yBAAyB,EAAE,GAAG,EAAE,CAAC,CAAC;QACnE,eAAe,EAAE,yBAAyB;KAC3C,CAAC,CAAC,CAAC;AACN,CAAC,CAAC,EAAE,CAAC;AAEL,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import { logger } from '@sentry/utils';\nimport * as React from 'react';\nimport type { HostComponent, ViewProps } from 'react-native';\nimport { UIManager, View } from 'react-native';\n\nconst NativeComponentRegistry: {\n get<T, C extends Record<string, unknown>>(componentName: string, createViewConfig: () => C): HostComponent<T>;\n// eslint-disable-next-line @typescript-eslint/no-var-requires\n} = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');\n\nconst MaskNativeComponentName = 'RNSentryReplayMask';\nconst UnmaskNativeComponentName = 'RNSentryReplayUnmask';\n\nconst warnMessage = (component: string): string => `[SentrySessionReplay] ${component} component is not supported on the current platform. If ${component} should be supported, please ensure that the application build is up to date.`;\n\nconst warn = (component: string): void => {\n setTimeout(() => {\n // Missing mask component could cause leaking PII, we have to ensure that the warning is visible\n // even if the app is running without debug.\n // eslint-disable-next-line no-console\n console.warn(warnMessage(component));\n }, 0);\n};\n\nconst MaskFallback = (viewProps: ViewProps): React.ReactElement => {\n warn('Mask');\n return <View {...viewProps} />;\n};\n\nconst UnmaskFallback = (viewProps: ViewProps): React.ReactElement => {\n warn('Unmask');\n return <View {...viewProps} />;\n};\n\nconst hasViewManagerConfig = (nativeComponentName: string): boolean => UIManager.hasViewManagerConfig && UIManager.hasViewManagerConfig(nativeComponentName);\n\nconst Mask = ((): HostComponent<ViewProps> | React.ComponentType<ViewProps> => {\n if (!hasViewManagerConfig(MaskNativeComponentName)) {\n logger.warn(`[SentrySessionReplay] Can't load ${MaskNativeComponentName}.`);\n return MaskFallback;\n }\n\n // Based on @react-native/babel-plugin-codegen output\n // https://github.com/facebook/react-native/blob/b32c6c2cc1bc566a85a883901dbf5e23b5a75b61/packages/react-native-codegen/src/generators/components/GenerateViewConfigJs.js#L139\n return NativeComponentRegistry.get(MaskNativeComponentName, () => ({\n uiViewClassName: MaskNativeComponentName,\n }));\n})()\n\nconst Unmask = ((): HostComponent<ViewProps> | React.ComponentType<ViewProps> => {\n if (!hasViewManagerConfig(UnmaskNativeComponentName)) {\n logger.warn(`[SentrySessionReplay] Can't load ${UnmaskNativeComponentName}.`);\n return UnmaskFallback;\n }\n\n // Based on @react-native/babel-plugin-codegen output\n // https://github.com/facebook/react-native/blob/b32c6c2cc1bc566a85a883901dbf5e23b5a75b61/packages/react-native-codegen/src/generators/components/GenerateViewConfigJs.js#L139\n return NativeComponentRegistry.get(UnmaskNativeComponentName, () => ({\n uiViewClassName: UnmaskNativeComponentName,\n }));\n})();\n\nexport { Mask, Unmask, MaskFallback, UnmaskFallback };\n"]}
1
+ {"version":3,"file":"CustomMask.js","sourceRoot":"","sources":["../../../src/js/replay/CustomMask.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAA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AAO,YAAY,CAAC;KACrB;IAED,qDAAqD;IACrD,8KAA8K;IAC9K,OAAO,uBAAuB,CAAC,GAAG,CAAC,uBAAuB,EAAE,GAAG,EAAE,CAAC,CAAC;QACjE,eAAe,EAAE,uBAAuB;KACzC,CAAC,CAAC,CAAC;AACN,CAAC,CAAC,EAAE,CAAA;AAEJ,MAAM,MAAM,GAAG,CAAC,GAA8D,EAAE;IAC9E,IAAI,CAAC,oBAAoB,CAAC,yBAAyB,CAAC,EAAE;QACpD,MAAM,CAAC,IAAI,CAAC,oCAAoC,yBAAyB,GAAG,CAAC,CAAC;QAC9E,OAAO,cAAc,CAAC;KACvB;IAED,qDAAqD;IACrD,8KAA8K;IAC9K,OAAO,uBAAuB,CAAC,GAAG,CAAC,yBAAyB,EAAE,GAAG,EAAE,CAAC,CAAC;QACnE,eAAe,EAAE,yBAAyB;KAC3C,CAAC,CAAC,CAAC;AACN,CAAC,CAAC,EAAE,CAAC;AAEL,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import { logger } from '@sentry/core';\nimport * as React from 'react';\nimport type { HostComponent, ViewProps } from 'react-native';\nimport { UIManager, View } from 'react-native';\n\nconst NativeComponentRegistry: {\n get<T, C extends Record<string, unknown>>(componentName: string, createViewConfig: () => C): HostComponent<T>;\n// eslint-disable-next-line @typescript-eslint/no-var-requires\n} = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');\n\nconst MaskNativeComponentName = 'RNSentryReplayMask';\nconst UnmaskNativeComponentName = 'RNSentryReplayUnmask';\n\nconst warnMessage = (component: string): string => `[SentrySessionReplay] ${component} component is not supported on the current platform. If ${component} should be supported, please ensure that the application build is up to date.`;\n\nconst warn = (component: string): void => {\n setTimeout(() => {\n // Missing mask component could cause leaking PII, we have to ensure that the warning is visible\n // even if the app is running without debug.\n // eslint-disable-next-line no-console\n console.warn(warnMessage(component));\n }, 0);\n};\n\nconst MaskFallback = (viewProps: ViewProps): React.ReactElement => {\n warn('Mask');\n return <View {...viewProps} />;\n};\n\nconst UnmaskFallback = (viewProps: ViewProps): React.ReactElement => {\n warn('Unmask');\n return <View {...viewProps} />;\n};\n\nconst hasViewManagerConfig = (nativeComponentName: string): boolean => UIManager.hasViewManagerConfig && UIManager.hasViewManagerConfig(nativeComponentName);\n\nconst Mask = ((): HostComponent<ViewProps> | React.ComponentType<ViewProps> => {\n if (!hasViewManagerConfig(MaskNativeComponentName)) {\n logger.warn(`[SentrySessionReplay] Can't load ${MaskNativeComponentName}.`);\n return MaskFallback;\n }\n\n // Based on @react-native/babel-plugin-codegen output\n // https://github.com/facebook/react-native/blob/b32c6c2cc1bc566a85a883901dbf5e23b5a75b61/packages/react-native-codegen/src/generators/components/GenerateViewConfigJs.js#L139\n return NativeComponentRegistry.get(MaskNativeComponentName, () => ({\n uiViewClassName: MaskNativeComponentName,\n }));\n})()\n\nconst Unmask = ((): HostComponent<ViewProps> | React.ComponentType<ViewProps> => {\n if (!hasViewManagerConfig(UnmaskNativeComponentName)) {\n logger.warn(`[SentrySessionReplay] Can't load ${UnmaskNativeComponentName}.`);\n return UnmaskFallback;\n }\n\n // Based on @react-native/babel-plugin-codegen output\n // https://github.com/facebook/react-native/blob/b32c6c2cc1bc566a85a883901dbf5e23b5a75b61/packages/react-native-codegen/src/generators/components/GenerateViewConfigJs.js#L139\n return NativeComponentRegistry.get(UnmaskNativeComponentName, () => ({\n uiViewClassName: UnmaskNativeComponentName,\n }));\n})();\n\nexport { Mask, Unmask, MaskFallback, UnmaskFallback };\n"]}
@@ -1,4 +1,4 @@
1
- import type { Integration } from '@sentry/types';
1
+ import type { Integration } from '@sentry/core';
2
2
  export declare const MOBILE_REPLAY_INTEGRATION_NAME = "MobileReplay";
3
3
  export interface MobileReplayOptions {
4
4
  /**
@@ -30,10 +30,8 @@ type MobileReplayIntegration = Integration & {
30
30
  *
31
31
  * ```javascript
32
32
  * Sentry.init({
33
- * _experiments: {
34
- * replaysOnErrorSampleRate: 1.0,
35
- * replaysSessionSampleRate: 1.0,
36
- * },
33
+ * replaysOnErrorSampleRate: 1.0,
34
+ * replaysSessionSampleRate: 1.0,
37
35
  * integrations: [mobileReplayIntegration({
38
36
  * // Adjust the default options
39
37
  * })],
@@ -1 +1 @@
1
- {"version":3,"file":"mobilereplay.d.ts","sourceRoot":"","sources":["../../../src/js/replay/mobilereplay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAyC,WAAW,EAAE,MAAM,eAAe,CAAC;AASxF,eAAO,MAAM,8BAA8B,iBAAiB,CAAC;AAE7D,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAQD,KAAK,uBAAuB,GAAG,WAAW,GAAG;IAC3C,OAAO,EAAE,QAAQ,CAAC,mBAAmB,CAAC,CAAC;CACxC,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,uBAAuB,iBAAiB,mBAAmB,KAAoB,uBAuE3F,CAAC"}
1
+ {"version":3,"file":"mobilereplay.d.ts","sourceRoot":"","sources":["../../../src/js/replay/mobilereplay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAyC,WAAW,EAAE,MAAM,cAAc,CAAC;AASvF,eAAO,MAAM,8BAA8B,iBAAiB,CAAC;AAE7D,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAQD,KAAK,uBAAuB,GAAG,WAAW,GAAG;IAC3C,OAAO,EAAE,QAAQ,CAAC,mBAAmB,CAAC,CAAC;CACxC,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,uBAAuB,iBAAiB,mBAAmB,KAAoB,uBAuE3F,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { __awaiter } from "tslib";
2
- import { logger } from '@sentry/utils';
2
+ import { logger } from '@sentry/core';
3
3
  import { isHardCrash } from '../misc';
4
4
  import { hasHooks } from '../utils/clientutils';
5
5
  import { isExpoGo, notMobileOs } from '../utils/environment';
@@ -17,10 +17,8 @@ const defaultOptions = {
17
17
  *
18
18
  * ```javascript
19
19
  * Sentry.init({
20
- * _experiments: {
21
- * replaysOnErrorSampleRate: 1.0,
22
- * replaysSessionSampleRate: 1.0,
23
- * },
20
+ * replaysOnErrorSampleRate: 1.0,
21
+ * replaysSessionSampleRate: 1.0,
24
22
  * integrations: [mobileReplayIntegration({
25
23
  * // Adjust the default options
26
24
  * })],
@@ -1 +1 @@
1
- {"version":3,"file":"mobilereplay.js","sourceRoot":"","sources":["../../../src/js/replay/mobilereplay.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,mCAAmC,EAAE,MAAM,YAAY,CAAC;AAEjE,MAAM,CAAC,MAAM,8BAA8B,GAAG,cAAc,CAAC;AA0B7D,MAAM,cAAc,GAAkC;IACpD,WAAW,EAAE,IAAI;IACjB,aAAa,EAAE,IAAI;IACnB,cAAc,EAAE,IAAI;CACrB,CAAC;AAMF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,cAAmC,cAAc,EAA2B,EAAE;IACpH,IAAI,QAAQ,EAAE,EAAE;QACd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AAI,GAAG,CAAC,SAAS,EAAE;gBACjB,OAAO;aACR;YAED,6GAA6G;YAC7G,MAAM,eAAe,GAAG,MAAM,CAAC,kBAAkB,EAAE,CAAC;YACpD,IAAI,eAAe,EAAE;gBACnB,GAAG,CAAC,SAAS,GAAG,eAAe,CAAC;aACjC;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,EAAE,CAAC,qBAAqB,EAAE,mCAAmC,CAAC,CAAC;IACxE,CAAC;IAED,iHAAiH;IACjH,8GAA8G;IAC9G,OAAO;QACL,IAAI,EAAE,8BAA8B;QACpC,SAAS;YACP,UAAU;QACZ,CAAC;QACD,KAAK;QACL,YAAY;QACZ,OAAO,EAAE,OAAO;KACjB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,2BAA2B,GAAG,GAA4B,EAAE;IAChE,OAAO;QACL,IAAI,EAAE,8BAA8B;QACpC,SAAS;YACP,UAAU;QACZ,CAAC;QACD,OAAO,EAAE,cAAc;KACxB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { Client, DynamicSamplingContext, Event, Integration } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { isHardCrash } from '../misc';\nimport { hasHooks } from '../utils/clientutils';\nimport { isExpoGo, notMobileOs } from '../utils/environment';\nimport { NATIVE } from '../wrapper';\nimport { enrichXhrBreadcrumbsForMobileReplay } from './xhrUtils';\n\nexport const MOBILE_REPLAY_INTEGRATION_NAME = 'MobileReplay';\n\nexport interface MobileReplayOptions {\n /**\n * Mask all text in recordings\n *\n * @default true\n */\n maskAllText?: boolean;\n\n /**\n * Mask all images in recordings\n *\n * @default true\n */\n maskAllImages?: boolean;\n\n /**\n * Mask all vector graphics in recordings\n * Supports `react-native-svg`\n *\n * @default true\n */\n maskAllVectors?: boolean;\n}\n\nconst defaultOptions: Required<MobileReplayOptions> = {\n maskAllText: true,\n maskAllImages: true,\n maskAllVectors: true,\n};\n\ntype MobileReplayIntegration = Integration & {\n options: Required<MobileReplayOptions>;\n};\n\n/**\n * The Mobile Replay Integration, let's you adjust the default mobile replay options.\n * To be passed to `Sentry.init` with `replaysOnErrorSampleRate` or `replaysSessionSampleRate`.\n *\n * ```javascript\n * Sentry.init({\n * _experiments: {\n * replaysOnErrorSampleRate: 1.0,\n * replaysSessionSampleRate: 1.0,\n * },\n * integrations: [mobileReplayIntegration({\n * // Adjust the default options\n * })],\n * });\n * ```\n *\n * @experimental\n */\nexport const mobileReplayIntegration = (initOptions: MobileReplayOptions = defaultOptions): MobileReplayIntegration => {\n if (isExpoGo()) {\n logger.warn(\n `[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} is not supported in Expo Go. Use EAS Build or \\`expo prebuild\\` to enable it.`,\n );\n }\n if (notMobileOs()) {\n logger.warn(`[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} is not supported on this platform.`);\n }\n\n if (isExpoGo() || notMobileOs()) {\n return mobileReplayIntegrationNoop();\n }\n\n const options = { ...defaultOptions, ...initOptions };\n\n async function processEvent(event: Event): Promise<Event> {\n const hasException = event.exception && event.exception.values && event.exception.values.length > 0;\n if (!hasException) {\n // Event is not an error, will not capture replay\n return event;\n }\n\n const recordingReplayId = NATIVE.getCurrentReplayId();\n if (recordingReplayId) {\n logger.debug(\n `[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} assign already recording replay ${recordingReplayId} for event ${event.event_id}.`,\n );\n return event;\n }\n\n const replayId = await NATIVE.captureReplay(isHardCrash(event));\n if (!replayId) {\n logger.debug(`[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} not sampled for event ${event.event_id}.`);\n return event;\n }\n\n return event;\n }\n\n function setup(client: Client): void {\n if (!hasHooks(client)) {\n return;\n }\n\n client.on('createDsc', (dsc: DynamicSamplingContext) => {\n if (dsc.replay_id) {\n return;\n }\n\n // TODO: For better performance, we should emit replayId changes on native, and hold the replayId value in JS\n const currentReplayId = NATIVE.getCurrentReplayId();\n if (currentReplayId) {\n dsc.replay_id = currentReplayId;\n }\n });\n\n client.on('beforeAddBreadcrumb', enrichXhrBreadcrumbsForMobileReplay);\n }\n\n // TODO: When adding manual API, ensure overlap with the web replay so users can use the same API interchangeably\n // https://github.com/getsentry/sentry-javascript/blob/develop/packages/replay-internal/src/integration.ts#L45\n return {\n name: MOBILE_REPLAY_INTEGRATION_NAME,\n setupOnce() {\n /* Noop */\n },\n setup,\n processEvent,\n options: options,\n };\n};\n\nconst mobileReplayIntegrationNoop = (): MobileReplayIntegration => {\n return {\n name: MOBILE_REPLAY_INTEGRATION_NAME,\n setupOnce() {\n /* Noop */\n },\n options: defaultOptions,\n };\n};\n"]}
1
+ {"version":3,"file":"mobilereplay.js","sourceRoot":"","sources":["../../../src/js/replay/mobilereplay.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,mCAAmC,EAAE,MAAM,YAAY,CAAC;AAEjE,MAAM,CAAC,MAAM,8BAA8B,GAAG,cAAc,CAAC;AA0B7D,MAAM,cAAc,GAAkC;IACpD,WAAW,EAAE,IAAI;IACjB,aAAa,EAAE,IAAI;IACnB,cAAc,EAAE,IAAI;CACrB,CAAC;AAMF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,cAAmC,cAAc,EAA2B,EAAE;IACpH,IAAI,QAAQ,EAAE,EAAE;QACd,MAAM,CAAC,IAAI,CACT,YAAY,8BAA8B,gFAAgF,CAC3H,CAAC;KACH;IACD,IAAI,WAAW,EAAE,EAAE;QACjB,MAAM,CAAC,IAAI,CAAC,YAAY,8BAA8B,qCAAqC,CAAC,CAAC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AC,SAAS,GAAG,eAAe,CAAC;aACjC;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,EAAE,CAAC,qBAAqB,EAAE,mCAAmC,CAAC,CAAC;IACxE,CAAC;IAED,iHAAiH;IACjH,8GAA8G;IAC9G,OAAO;QACL,IAAI,EAAE,8BAA8B;QACpC,SAAS;YACP,UAAU;QACZ,CAAC;QACD,KAAK;QACL,YAAY;QACZ,OAAO,EAAE,OAAO;KACjB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,2BAA2B,GAAG,GAA4B,EAAE;IAChE,OAAO;QACL,IAAI,EAAE,8BAA8B;QACpC,SAAS;YACP,UAAU;QACZ,CAAC;QACD,OAAO,EAAE,cAAc;KACxB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { Client, DynamicSamplingContext, Event, Integration } from '@sentry/core';\nimport { logger } from '@sentry/core';\n\nimport { isHardCrash } from '../misc';\nimport { hasHooks } from '../utils/clientutils';\nimport { isExpoGo, notMobileOs } from '../utils/environment';\nimport { NATIVE } from '../wrapper';\nimport { enrichXhrBreadcrumbsForMobileReplay } from './xhrUtils';\n\nexport const MOBILE_REPLAY_INTEGRATION_NAME = 'MobileReplay';\n\nexport interface MobileReplayOptions {\n /**\n * Mask all text in recordings\n *\n * @default true\n */\n maskAllText?: boolean;\n\n /**\n * Mask all images in recordings\n *\n * @default true\n */\n maskAllImages?: boolean;\n\n /**\n * Mask all vector graphics in recordings\n * Supports `react-native-svg`\n *\n * @default true\n */\n maskAllVectors?: boolean;\n}\n\nconst defaultOptions: Required<MobileReplayOptions> = {\n maskAllText: true,\n maskAllImages: true,\n maskAllVectors: true,\n};\n\ntype MobileReplayIntegration = Integration & {\n options: Required<MobileReplayOptions>;\n};\n\n/**\n * The Mobile Replay Integration, let's you adjust the default mobile replay options.\n * To be passed to `Sentry.init` with `replaysOnErrorSampleRate` or `replaysSessionSampleRate`.\n *\n * ```javascript\n * Sentry.init({\n * replaysOnErrorSampleRate: 1.0,\n * replaysSessionSampleRate: 1.0,\n * integrations: [mobileReplayIntegration({\n * // Adjust the default options\n * })],\n * });\n * ```\n *\n * @experimental\n */\nexport const mobileReplayIntegration = (initOptions: MobileReplayOptions = defaultOptions): MobileReplayIntegration => {\n if (isExpoGo()) {\n logger.warn(\n `[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} is not supported in Expo Go. Use EAS Build or \\`expo prebuild\\` to enable it.`,\n );\n }\n if (notMobileOs()) {\n logger.warn(`[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} is not supported on this platform.`);\n }\n\n if (isExpoGo() || notMobileOs()) {\n return mobileReplayIntegrationNoop();\n }\n\n const options = { ...defaultOptions, ...initOptions };\n\n async function processEvent(event: Event): Promise<Event> {\n const hasException = event.exception && event.exception.values && event.exception.values.length > 0;\n if (!hasException) {\n // Event is not an error, will not capture replay\n return event;\n }\n\n const recordingReplayId = NATIVE.getCurrentReplayId();\n if (recordingReplayId) {\n logger.debug(\n `[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} assign already recording replay ${recordingReplayId} for event ${event.event_id}.`,\n );\n return event;\n }\n\n const replayId = await NATIVE.captureReplay(isHardCrash(event));\n if (!replayId) {\n logger.debug(`[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} not sampled for event ${event.event_id}.`);\n return event;\n }\n\n return event;\n }\n\n function setup(client: Client): void {\n if (!hasHooks(client)) {\n return;\n }\n\n client.on('createDsc', (dsc: DynamicSamplingContext) => {\n if (dsc.replay_id) {\n return;\n }\n\n // TODO: For better performance, we should emit replayId changes on native, and hold the replayId value in JS\n const currentReplayId = NATIVE.getCurrentReplayId();\n if (currentReplayId) {\n dsc.replay_id = currentReplayId;\n }\n });\n\n client.on('beforeAddBreadcrumb', enrichXhrBreadcrumbsForMobileReplay);\n }\n\n // TODO: When adding manual API, ensure overlap with the web replay so users can use the same API interchangeably\n // https://github.com/getsentry/sentry-javascript/blob/develop/packages/replay-internal/src/integration.ts#L45\n return {\n name: MOBILE_REPLAY_INTEGRATION_NAME,\n setupOnce() {\n /* Noop */\n },\n setup,\n processEvent,\n options: options,\n };\n};\n\nconst mobileReplayIntegrationNoop = (): MobileReplayIntegration => {\n return {\n name: MOBILE_REPLAY_INTEGRATION_NAME,\n setupOnce() {\n /* Noop */\n },\n options: defaultOptions,\n };\n};\n"]}
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react-native" />
2
+ /// <reference types="react" />
2
3
  /** Convert a Content-Length header to number/undefined. */
3
4
  export declare function parseContentLengthHeader(header: string | null | undefined): number | undefined;
4
5
  export type RequestBody = null | Blob | FormData | URLSearchParams | string | ArrayBuffer | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"networkUtils.d.ts","sourceRoot":"","sources":["../../../src/js/replay/networkUtils.ts"],"names":[],"mappings":";AAGA,2DAA2D;AAC3D,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAO9F;AAED,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,QAAQ,GAAG,eAAe,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,CAAC;AAEtG,8BAA8B;AAC9B,wBAAgB,WAAW,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAiCjE"}
1
+ {"version":3,"file":"networkUtils.d.ts","sourceRoot":"","sources":["../../../src/js/replay/networkUtils.ts"],"names":[],"mappings":";;AAGA,2DAA2D;AAC3D,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAO9F;AAED,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,QAAQ,GAAG,eAAe,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,CAAC;AAEtG,8BAA8B;AAC9B,wBAAgB,WAAW,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAiCjE"}
@@ -1,4 +1,4 @@
1
- import type { Breadcrumb, BreadcrumbHint } from '@sentry/types';
1
+ import type { Breadcrumb, BreadcrumbHint } from '@sentry/core';
2
2
  /**
3
3
  * Enrich an XHR breadcrumb with additional data for Mobile Replay network tab.
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"xhrUtils.d.ts","sourceRoot":"","sources":["../../../src/js/replay/xhrUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAkD,MAAM,eAAe,CAAC;AAMhH;;GAEG;AACH,wBAAgB,mCAAmC,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,cAAc,GAAG,SAAS,GAAG,IAAI,CAyBlH"}
1
+ {"version":3,"file":"xhrUtils.d.ts","sourceRoot":"","sources":["../../../src/js/replay/xhrUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAkD,MAAM,cAAc,CAAC;AAM/G;;GAEG;AACH,wBAAgB,mCAAmC,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,cAAc,GAAG,SAAS,GAAG,IAAI,CAyBlH"}
@@ -1,4 +1,4 @@
1
- import { dropUndefinedKeys } from '@sentry/utils';
1
+ import { dropUndefinedKeys } from '@sentry/core';
2
2
  import { getBodySize, parseContentLengthHeader } from './networkUtils';
3
3
  /**
4
4
  * Enrich an XHR breadcrumb with additional data for Mobile Replay network tab.
@@ -1 +1 @@
1
- {"version":3,"file":"xhrUtils.js","sourceRoot":"","sources":["../../../src/js/replay/xhrUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGlD,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAEvE;;GAEG;AACH,MAAM,UAAU,mCAAmC,CAAC,UAAsB,EAAE,IAAgC;IAC1G,IAAI,UAAU,CAAC,QAAQ,KAAK,KAAK,IAAI,CAAC,IAAI,EAAE;QAC1C,OAAO;KACR;IAED,MAAM,OAAO,GAAG,IAAwB,CAAC;IACzC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;QAChB,OAAO;KACR;IAED,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACvB,MAAM,EAAE,cAAc,GAAG,GAAG,EAAE,YAAY,GAAG,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;IAEzE,MAAM,OAAO,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IACnC,MAAM,OAAO,GAAG,GAAG,CAAC,iBAAiB,CAAC,gBAAgB,CAAC;QACrD,CAAC,CAAC,wBAAwB,CAAC,GAAG,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;QACnE,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC;IAEjD,UAAU,CAAC,IAAI,GAAG,iBAAiB,iBACjC,eAAe,EAAE,cAAc,EAC/B,aAAa,EAAE,YAAY,EAC3B,iBAAiB,EAAE,OAAO,EAC1B,kBAAkB,EAAE,OAAO,IACxB,UAAU,CAAC,IAAI,EAClB,CAAC;AACL,CAAC;AAOD,SAAS,YAAY,CACnB,IAAgC,EAChC,YAA4C;IAE5C,IAAI;QACF,MAAM,OAAO,GAAG,YAAY,KAAK,MAAM,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC1G,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC;KAC7B;IAAC,WAAM;QACN,OAAO,SAAS,CAAC;KAClB;AACH,CAAC","sourcesContent":["import type { Breadcrumb, BreadcrumbHint, SentryWrappedXMLHttpRequest, XhrBreadcrumbHint } from '@sentry/types';\nimport { dropUndefinedKeys } from '@sentry/utils';\n\nimport type { RequestBody } from './networkUtils';\nimport { getBodySize, parseContentLengthHeader } from './networkUtils';\n\n/**\n * Enrich an XHR breadcrumb with additional data for Mobile Replay network tab.\n */\nexport function enrichXhrBreadcrumbsForMobileReplay(breadcrumb: Breadcrumb, hint: BreadcrumbHint | undefined): void {\n if (breadcrumb.category !== 'xhr' || !hint) {\n return;\n }\n\n const xhrHint = hint as Partial<XhrHint>;\n if (!xhrHint.xhr) {\n return;\n }\n\n const now = Date.now();\n const { startTimestamp = now, endTimestamp = now, input, xhr } = xhrHint;\n\n const reqSize = getBodySize(input);\n const resSize = xhr.getResponseHeader('content-length')\n ? parseContentLengthHeader(xhr.getResponseHeader('content-length'))\n : _getBodySize(xhr.response, xhr.responseType);\n\n breadcrumb.data = dropUndefinedKeys({\n start_timestamp: startTimestamp,\n end_timestamp: endTimestamp,\n request_body_size: reqSize,\n response_body_size: resSize,\n ...breadcrumb.data,\n });\n}\n\ntype XhrHint = XhrBreadcrumbHint & {\n xhr: XMLHttpRequest & SentryWrappedXMLHttpRequest;\n input?: RequestBody;\n};\n\nfunction _getBodySize(\n body: XMLHttpRequest['response'],\n responseType: XMLHttpRequest['responseType'],\n): number | undefined {\n try {\n const bodyStr = responseType === 'json' && body && typeof body === 'object' ? JSON.stringify(body) : body;\n return getBodySize(bodyStr);\n } catch {\n return undefined;\n }\n}\n"]}
1
+ {"version":3,"file":"xhrUtils.js","sourceRoot":"","sources":["../../../src/js/replay/xhrUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGjD,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAEvE;;GAEG;AACH,MAAM,UAAU,mCAAmC,CAAC,UAAsB,EAAE,IAAgC;IAC1G,IAAI,UAAU,CAAC,QAAQ,KAAK,KAAK,IAAI,CAAC,IAAI,EAAE;QAC1C,OAAO;KACR;IAED,MAAM,OAAO,GAAG,IAAwB,CAAC;IACzC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;QAChB,OAAO;KACR;IAED,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACvB,MAAM,EAAE,cAAc,GAAG,GAAG,EAAE,YAAY,GAAG,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;IAEzE,MAAM,OAAO,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IACnC,MAAM,OAAO,GAAG,GAAG,CAAC,iBAAiB,CAAC,gBAAgB,CAAC;QACrD,CAAC,CAAC,wBAAwB,CAAC,GAAG,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;QACnE,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC;IAEjD,UAAU,CAAC,IAAI,GAAG,iBAAiB,iBACjC,eAAe,EAAE,cAAc,EAC/B,aAAa,EAAE,YAAY,EAC3B,iBAAiB,EAAE,OAAO,EAC1B,kBAAkB,EAAE,OAAO,IACxB,UAAU,CAAC,IAAI,EAClB,CAAC;AACL,CAAC;AAOD,SAAS,YAAY,CACnB,IAAgC,EAChC,YAA4C;IAE5C,IAAI;QACF,MAAM,OAAO,GAAG,YAAY,KAAK,MAAM,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC1G,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC;KAC7B;IAAC,WAAM;QACN,OAAO,SAAS,CAAC;KAClB;AACH,CAAC","sourcesContent":["import type { Breadcrumb, BreadcrumbHint, SentryWrappedXMLHttpRequest, XhrBreadcrumbHint } from '@sentry/core';\nimport { dropUndefinedKeys } from '@sentry/core';\n\nimport type { RequestBody } from './networkUtils';\nimport { getBodySize, parseContentLengthHeader } from './networkUtils';\n\n/**\n * Enrich an XHR breadcrumb with additional data for Mobile Replay network tab.\n */\nexport function enrichXhrBreadcrumbsForMobileReplay(breadcrumb: Breadcrumb, hint: BreadcrumbHint | undefined): void {\n if (breadcrumb.category !== 'xhr' || !hint) {\n return;\n }\n\n const xhrHint = hint as Partial<XhrHint>;\n if (!xhrHint.xhr) {\n return;\n }\n\n const now = Date.now();\n const { startTimestamp = now, endTimestamp = now, input, xhr } = xhrHint;\n\n const reqSize = getBodySize(input);\n const resSize = xhr.getResponseHeader('content-length')\n ? parseContentLengthHeader(xhr.getResponseHeader('content-length'))\n : _getBodySize(xhr.response, xhr.responseType);\n\n breadcrumb.data = dropUndefinedKeys({\n start_timestamp: startTimestamp,\n end_timestamp: endTimestamp,\n request_body_size: reqSize,\n response_body_size: resSize,\n ...breadcrumb.data,\n });\n}\n\ntype XhrHint = XhrBreadcrumbHint & {\n xhr: XMLHttpRequest & SentryWrappedXMLHttpRequest;\n input?: RequestBody;\n};\n\nfunction _getBodySize(\n body: XMLHttpRequest['response'],\n responseType: XMLHttpRequest['responseType'],\n): number | undefined {\n try {\n const bodyStr = responseType === 'json' && body && typeof body === 'object' ? JSON.stringify(body) : body;\n return getBodySize(bodyStr);\n } catch {\n return undefined;\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { Scope } from '@sentry/types';
1
+ import type { Scope } from '@sentry/core';
2
2
  /**
3
3
  * Hooks into the scope set methods and sync new data added to the given scope with the native SDKs.
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"scopeSync.d.ts","sourceRoot":"","sources":["../../src/js/scopeSync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,KAAK,EAAE,MAAM,eAAe,CAAC;AAavD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CA6DrD"}
1
+ {"version":3,"file":"scopeSync.d.ts","sourceRoot":"","sources":["../../src/js/scopeSync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,KAAK,EAAE,MAAM,cAAc,CAAC;AAatD;;GAE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,IAAI,CAAC,KAAK,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAC;QAEvD,MAAM,eAAe,GAAG,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAClD,MAAM,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;QAEtC,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,KAAK,EAAE,kBAAkB,EAAE,QAAQ,CAAC,EAAE,CAAC,GAAU,EAAE;QAC3D,MAAM,CAAC,gBAAgB,EAAE,CAAC;QAC1B,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEH,8DAA8D;IAC9D,SAAS,CAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,GAAW,EAAE,OAAsC,EAAS,EAAE;QACxG,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAChC,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { Breadcrumb, Scope } from '@sentry/types';\n\nimport { DEFAULT_BREADCRUMB_LEVEL } from './breadcrumb';\nimport { fillTyped } from './utils/fill';\nimport { convertToNormalizedObject } from './utils/normalize';\nimport { NATIVE } from './wrapper';\n\n/**\n * This WeakMap is used to keep track of which scopes have been synced to the native SDKs.\n * This ensures that we don't double sync the same scope.\n */\nconst syncedToNativeMap = new WeakMap<Scope, true>();\n\n/**\n * Hooks into the scope set methods and sync new data added to the given scope with the native SDKs.\n */\nexport function enableSyncToNative(scope: Scope): void {\n if (syncedToNativeMap.has(scope)) {\n return;\n }\n syncedToNativeMap.set(scope, true);\n\n fillTyped(scope, 'setUser', original => (user): Scope => {\n NATIVE.setUser(user);\n return original.call(scope, user);\n });\n\n fillTyped(scope, 'setTag', original => (key, value): Scope => {\n NATIVE.setTag(key, value as string);\n return original.call(scope, key, value);\n });\n\n fillTyped(scope, 'setTags', original => (tags): Scope => {\n // As native only has setTag, we just loop through each tag key.\n Object.keys(tags).forEach(key => {\n NATIVE.setTag(key, tags[key] as string);\n });\n return original.call(scope, tags);\n });\n\n fillTyped(scope, 'setExtras', original => (extras): Scope => {\n Object.keys(extras).forEach(key => {\n NATIVE.setExtra(key, extras[key]);\n });\n return original.call(scope, extras);\n });\n\n fillTyped(scope, 'setExtra', original => (key, value): Scope => {\n NATIVE.setExtra(key, value);\n return original.call(scope, key, value);\n });\n\n fillTyped(scope, 'addBreadcrumb', original => (breadcrumb, maxBreadcrumbs): Scope => {\n const mergedBreadcrumb: Breadcrumb = {\n ...breadcrumb,\n level: breadcrumb.level || DEFAULT_BREADCRUMB_LEVEL,\n data: breadcrumb.data ? convertToNormalizedObject(breadcrumb.data) : undefined,\n };\n\n original.call(scope, mergedBreadcrumb, maxBreadcrumbs);\n\n const finalBreadcrumb = scope.getLastBreadcrumb();\n NATIVE.addBreadcrumb(finalBreadcrumb);\n\n return scope;\n });\n\n fillTyped(scope, 'clearBreadcrumbs', original => (): Scope => {\n NATIVE.clearBreadcrumbs();\n return original.call(scope);\n });\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n fillTyped(scope, 'setContext', original => (key: string, context: { [key: string]: any } | null): Scope => {\n NATIVE.setContext(key, context);\n return original.call(scope, key, context);\n });\n}\n"]}
1
+ {"version":3,"file":"scopeSync.js","sourceRoot":"","sources":["../../src/js/scopeSync.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC;;;GAGG;AACH,MAAM,iBAAiB,GAAG,IAAI,OAAO,EAAe,CAAC;AAErD;;GAE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,SAAS,CAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,GAAW,EAAE,OAAsC,EAAS,EAAE;QACxG,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAChC,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { Breadcrumb, Scope } from '@sentry/core';\n\nimport { DEFAULT_BREADCRUMB_LEVEL } from './breadcrumb';\nimport { fillTyped } from './utils/fill';\nimport { convertToNormalizedObject } from './utils/normalize';\nimport { NATIVE } from './wrapper';\n\n/**\n * This WeakMap is used to keep track of which scopes have been synced to the native SDKs.\n * This ensures that we don't double sync the same scope.\n */\nconst syncedToNativeMap = new WeakMap<Scope, true>();\n\n/**\n * Hooks into the scope set methods and sync new data added to the given scope with the native SDKs.\n */\nexport function enableSyncToNative(scope: Scope): void {\n if (syncedToNativeMap.has(scope)) {\n return;\n }\n syncedToNativeMap.set(scope, true);\n\n fillTyped(scope, 'setUser', original => (user): Scope => {\n NATIVE.setUser(user);\n return original.call(scope, user);\n });\n\n fillTyped(scope, 'setTag', original => (key, value): Scope => {\n NATIVE.setTag(key, value as string);\n return original.call(scope, key, value);\n });\n\n fillTyped(scope, 'setTags', original => (tags): Scope => {\n // As native only has setTag, we just loop through each tag key.\n Object.keys(tags).forEach(key => {\n NATIVE.setTag(key, tags[key] as string);\n });\n return original.call(scope, tags);\n });\n\n fillTyped(scope, 'setExtras', original => (extras): Scope => {\n Object.keys(extras).forEach(key => {\n NATIVE.setExtra(key, extras[key]);\n });\n return original.call(scope, extras);\n });\n\n fillTyped(scope, 'setExtra', original => (key, value): Scope => {\n NATIVE.setExtra(key, value);\n return original.call(scope, key, value);\n });\n\n fillTyped(scope, 'addBreadcrumb', original => (breadcrumb, maxBreadcrumbs): Scope => {\n const mergedBreadcrumb: Breadcrumb = {\n ...breadcrumb,\n level: breadcrumb.level || DEFAULT_BREADCRUMB_LEVEL,\n data: breadcrumb.data ? convertToNormalizedObject(breadcrumb.data) : undefined,\n };\n\n original.call(scope, mergedBreadcrumb, maxBreadcrumbs);\n\n const finalBreadcrumb = scope.getLastBreadcrumb();\n NATIVE.addBreadcrumb(finalBreadcrumb);\n\n return scope;\n });\n\n fillTyped(scope, 'clearBreadcrumbs', original => (): Scope => {\n NATIVE.clearBreadcrumbs();\n return original.call(scope);\n });\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n fillTyped(scope, 'setContext', original => (key: string, context: { [key: string]: any } | null): Scope => {\n NATIVE.setContext(key, context);\n return original.call(scope, key, context);\n });\n}\n"]}
package/dist/js/sdk.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Scope, UserFeedback } from '@sentry/types';
1
+ import type { Scope, UserFeedback } from '@sentry/core';
2
2
  import * as React from 'react';
3
3
  import type { ReactNativeOptions, ReactNativeWrapperOptions } from './options';
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/js/sdk.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAA2C,KAAK,EAAsB,YAAY,EAAE,MAAM,eAAe,CAAC;AAEtH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAA4B,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AA6BzG;;GAEG;AACH,wBAAgB,IAAI,CAAC,aAAa,EAAE,kBAAkB,GAAG,IAAI,CAuG5D;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpD,aAAa,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,EACrC,OAAO,CAAC,EAAE,yBAAyB,GAClC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAiBxB;AAED;;;GAGG;AACH,wBAAgB,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AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI,CAQhE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,CAAC,GAAG,CAAC,GAAG,SAAS,CAUzE;AAED;;GAEG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAE9D"}
package/dist/js/sdk.js CHANGED
@@ -1,8 +1,6 @@
1
1
  import { __awaiter } from "tslib";
2
- /* eslint-disable complexity */
3
- import { captureFeedback, getClient, getGlobalScope, getIntegrationsToSetup, getIsolationScope, initAndBind, withScope as coreWithScope } from '@sentry/core';
2
+ import { captureFeedback, getClient, getGlobalScope, getIntegrationsToSetup, getIsolationScope, initAndBind, logger, stackParserFromStackParserOptions, withScope as coreWithScope } from '@sentry/core';
4
3
  import { defaultStackParser, makeFetchTransport, } from '@sentry/react';
5
- import { logger, stackParserFromStackParserOptions } from '@sentry/utils';
6
4
  import * as React from 'react';
7
5
  import { ReactNativeClient } from './client';
8
6
  import { getDevServer } from './integrations/debugsymbolicatorutils';
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../src/js/sdk.tsx"],"names":[],"mappings":";AAAA,+BAA+B;AAC/B,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,cAAc,EAAC,sBAAsB,EAAE,iBAAiB,EAAC,WAAW,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,cAAc,CAAC;AAC5J,OAAO,EACL,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,MAAM,EAAE,iCAAiC,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,uC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,KAAK,CAAC,CAAC;SACxB;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,CAAC,KAAK,CAAC,wCAAwC,EAAE,CAAC,CAAC,CAAC;YAC1D,OAAO,SAAS,CAAC;SAClB;IACH,CAAC,CAAC;IACF,OAAO,aAAa,CAAC,YAAY,CAAC,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,MAAM,UAAgB,cAAc;;QAClC,OAAO,MAAM,CAAC,cAAc,EAAE,CAAC;IACjC,CAAC;CAAA","sourcesContent":["/* eslint-disable complexity */\nimport { captureFeedback, getClient, getGlobalScope,getIntegrationsToSetup, getIsolationScope,initAndBind, withScope as coreWithScope } from '@sentry/core';\nimport {\n defaultStackParser,\n makeFetchTransport,\n} from '@sentry/react';\nimport type { Breadcrumb, BreadcrumbHint, Integration, Scope, SendFeedbackParams, UserFeedback } from '@sentry/types';\nimport { logger, stackParserFromStackParserOptions } from '@sentry/utils';\nimport * as React from 'react';\n\nimport { ReactNativeClient } from './client';\nimport { getDevServer } from './integrations/debugsymbolicatorutils';\nimport { getDefaultIntegrations } from './integrations/default';\nimport type { ReactNativeClientOptions, ReactNativeOptions, ReactNativeWrapperOptions } from './options';\nimport { shouldEnableNativeNagger } from './options';\nimport { enableSyncToNative } from './scopeSync';\nimport { TouchEventBoundary } from './touchevents';\nimport { ReactNativeProfiler } from './tracing';\nimport { useEncodePolyfill } from './transports/encodePolyfill';\nimport { DEFAULT_BUFFER_SIZE, makeNativeTransportFactory } from './transports/native';\nimport { getDefaultEnvironment, isExpoGo, isRunningInMetroDevServer } from './utils/environment';\nimport { safeFactory, safeTracesSampler } from './utils/safe';\nimport { NATIVE } from './wrapper';\n\nconst DEFAULT_OPTIONS: ReactNativeOptions = {\n enableNativeCrashHandling: true,\n enableNativeNagger: true,\n autoInitializeNativeSdk: true,\n enableAutoPerformanceTracing: true,\n enableWatchdogTerminationTracking: true,\n patchGlobalPromise: true,\n sendClientReports: true,\n maxQueueSize: DEFAULT_BUFFER_SIZE,\n attachStacktrace: true,\n enableCaptureFailedRequests: false,\n enableNdk: true,\n enableAppStartTracking: true,\n enableNativeFramesTracking: true,\n enableStallTracking: true,\n enableUserInteractionTracing: false,\n};\n\n/**\n * Inits the SDK and returns the final options.\n */\nexport function init(passedOptions: ReactNativeOptions): void {\n if (isRunningInMetroDevServer()) {\n return;\n }\n\n const maxQueueSize = passedOptions.maxQueueSize\n // eslint-disable-next-line deprecation/deprecation\n ?? passedOptions.transportOptions?.bufferSize\n ?? DEFAULT_OPTIONS.maxQueueSize;\n\n const enableNative = passedOptions.enableNative === undefined || passedOptions.enableNative\n ? NATIVE.isNativeAvailable()\n : false;\n\n useEncodePolyfill();\n if (enableNative) {\n enableSyncToNative(getGlobalScope());\n enableSyncToNative(getIsolationScope());\n }\n\n const getURLFromDSN = (dsn: string | null): string | undefined => {\n if (!dsn) {\n return undefined;\n }\n try {\n const url = new URL(dsn);\n return `${url.protocol}//${url.host}`;\n } catch (e) {\n logger.error('Failed to extract url from DSN', e);\n return undefined;\n }\n };\n\n const userBeforeBreadcrumb = safeFactory(passedOptions.beforeBreadcrumb, { loggerMessage: 'The beforeBreadcrumb threw an error' });\n\n // Exclude Dev Server and Sentry Dsn request from Breadcrumbs\n const devServerUrl = getDevServer()?.url;\n const dsn = getURLFromDSN(passedOptions.dsn);\n const defaultBeforeBreadcrumb = (breadcrumb: Breadcrumb, _hint?: BreadcrumbHint): Breadcrumb | null => {\n const type = breadcrumb.type || '';\n const url = typeof breadcrumb.data?.url === 'string' ? breadcrumb.data.url : '';\n if (type === 'http' && ((devServerUrl && url.startsWith(devServerUrl)) || (dsn && url.startsWith(dsn)))) {\n return null;\n }\n return breadcrumb;\n };\n\n const chainedBeforeBreadcrumb = (breadcrumb: Breadcrumb, hint?: BreadcrumbHint): Breadcrumb | null => {\n let modifiedBreadcrumb = breadcrumb;\n if (userBeforeBreadcrumb) {\n const result = userBeforeBreadcrumb(breadcrumb, hint);\n if (result === null) {\n return null;\n }\n modifiedBreadcrumb = result;\n }\n return defaultBeforeBreadcrumb(modifiedBreadcrumb, hint);\n };\n\n const options: ReactNativeClientOptions = {\n ...DEFAULT_OPTIONS,\n ...passedOptions,\n enableNative,\n enableNativeNagger: shouldEnableNativeNagger(passedOptions.enableNativeNagger),\n // If custom transport factory fails the SDK won't initialize\n transport: passedOptions.transport\n || makeNativeTransportFactory({\n enableNative,\n })\n || makeFetchTransport,\n transportOptions: {\n ...DEFAULT_OPTIONS.transportOptions,\n ...(passedOptions.transportOptions ?? {}),\n bufferSize: maxQueueSize,\n },\n maxQueueSize,\n integrations: [],\n stackParser: stackParserFromStackParserOptions(passedOptions.stackParser || defaultStackParser),\n beforeBreadcrumb: chainedBeforeBreadcrumb,\n initialScope: safeFactory(passedOptions.initialScope, { loggerMessage: 'The initialScope threw an error' }),\n };\n if ('tracesSampler' in options) {\n options.tracesSampler = safeTracesSampler(options.tracesSampler);\n }\n\n if (!('environment' in options)) {\n options.environment = getDefaultEnvironment();\n }\n\n const defaultIntegrations: false | Integration[] = passedOptions.defaultIntegrations === undefined\n ? getDefaultIntegrations(options)\n : passedOptions.defaultIntegrations;\n\n options.integrations = getIntegrationsToSetup({\n integrations: safeFactory(passedOptions.integrations, { loggerMessage: 'The integrations threw an error' }),\n defaultIntegrations,\n });\n initAndBind(ReactNativeClient, options);\n\n if (isExpoGo()) {\n logger.info('Offline caching, native errors features are not available in Expo Go.');\n logger.info('Use EAS Build / Native Release Build to test these features.');\n }\n}\n\n/**\n * Inits the Sentry React Native SDK with automatic instrumentation and wrapped features.\n */\nexport function wrap<P extends Record<string, unknown>>(\n RootComponent: React.ComponentType<P>,\n options?: ReactNativeWrapperOptions\n): React.ComponentType<P> {\n const profilerProps = {\n ...(options?.profilerProps ?? {}),\n name: RootComponent.displayName ?? 'Root',\n };\n\n const RootApp: React.FC<P> = (appProps) => {\n return (\n <TouchEventBoundary {...(options?.touchEventBoundaryProps ?? {})}>\n <ReactNativeProfiler {...profilerProps}>\n <RootComponent {...appProps} />\n </ReactNativeProfiler>\n </TouchEventBoundary>\n );\n };\n\n return RootApp;\n}\n\n/**\n * If native client is available it will trigger a native crash.\n * Use this only for testing purposes.\n */\nexport function nativeCrash(): void {\n NATIVE.nativeCrash();\n}\n\n/**\n * Flushes all pending events in the queue to disk.\n * Use this before applying any realtime updates such as code-push or expo updates.\n */\nexport async function flush(): Promise<boolean> {\n try {\n const client = getClient();\n\n if (client) {\n const result = await client.flush();\n\n return result;\n }\n // eslint-disable-next-line no-empty\n } catch (_) { }\n\n logger.error('Failed to flush the event queue.');\n\n return false;\n}\n\n/**\n * Closes the SDK, stops sending events.\n */\nexport async function close(): Promise<void> {\n try {\n const client = getClient();\n\n if (client) {\n await client.close();\n }\n } catch (e) {\n logger.error('Failed to close the SDK');\n }\n}\n\n/**\n * Captures user feedback and sends it to Sentry.\n * @deprecated Use `Sentry.captureFeedback` instead.\n */\nexport function captureUserFeedback(feedback: UserFeedback): void {\n const feedbackParams: SendFeedbackParams = {\n name: feedback.name,\n email: feedback.email,\n message: feedback.comments,\n associatedEventId: feedback.event_id,\n };\n captureFeedback(feedbackParams);\n}\n\n/**\n * Creates a new scope with and executes the given operation within.\n * The scope is automatically removed once the operation\n * finishes or throws.\n *\n * This is essentially a convenience function for:\n *\n * pushScope();\n * callback();\n * popScope();\n *\n * @param callback that will be enclosed into push/popScope.\n */\nexport function withScope<T>(callback: (scope: Scope) => T): T | undefined {\n const safeCallback = (scope: Scope): T | undefined => {\n try {\n return callback(scope);\n } catch (e) {\n logger.error('Error while running withScope callback', e);\n return undefined;\n }\n };\n return coreWithScope(safeCallback);\n}\n\n/**\n * Returns if the app crashed in the last run.\n */\nexport async function crashedLastRun(): Promise<boolean | null> {\n return NATIVE.crashedLastRun();\n}\n"]}
1
+ {"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../src/js/sdk.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,cAAc,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,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OAAO,EAAE,QAAQ,CAAC,QAAQ;QAC1B,iBAAiB,EAAE,QAAQ,CAAC,QAAQ;KACrC,CAAC;IACF,eAAe,CAAC,cAAc,CAAC,CAAC;AAClC,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,SAAS,CAAI,QAA6B;IACxD,MAAM,YAAY,GAAG,CAAC,KAAY,EAAiB,EAAE;QACnD,IAAI;YACF,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;SACxB;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,CAAC,KAAK,CAAC,wCAAwC,EAAE,CAAC,CAAC,CAAC;YAC1D,OAAO,SAAS,CAAC;SAClB;IACH,CAAC,CAAC;IACF,OAAO,aAAa,CAAC,YAAY,CAAC,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,MAAM,UAAgB,cAAc;;QAClC,OAAO,MAAM,CAAC,cAAc,EAAE,CAAC;IACjC,CAAC;CAAA","sourcesContent":["/* eslint-disable complexity */\nimport type { Breadcrumb, BreadcrumbHint, Integration, Scope, SendFeedbackParams, UserFeedback } from '@sentry/core';\nimport { captureFeedback, getClient, getGlobalScope, getIntegrationsToSetup, getIsolationScope, initAndBind, logger, stackParserFromStackParserOptions, withScope as coreWithScope } from '@sentry/core';\nimport {\n defaultStackParser,\n makeFetchTransport,\n} from '@sentry/react';\nimport * as React from 'react';\n\nimport { ReactNativeClient } from './client';\nimport { getDevServer } from './integrations/debugsymbolicatorutils';\nimport { getDefaultIntegrations } from './integrations/default';\nimport type { ReactNativeClientOptions, ReactNativeOptions, ReactNativeWrapperOptions } from './options';\nimport { shouldEnableNativeNagger } from './options';\nimport { enableSyncToNative } from './scopeSync';\nimport { TouchEventBoundary } from './touchevents';\nimport { ReactNativeProfiler } from './tracing';\nimport { useEncodePolyfill } from './transports/encodePolyfill';\nimport { DEFAULT_BUFFER_SIZE, makeNativeTransportFactory } from './transports/native';\nimport { getDefaultEnvironment, isExpoGo, isRunningInMetroDevServer } from './utils/environment';\nimport { safeFactory, safeTracesSampler } from './utils/safe';\nimport { NATIVE } from './wrapper';\n\nconst DEFAULT_OPTIONS: ReactNativeOptions = {\n enableNativeCrashHandling: true,\n enableNativeNagger: true,\n autoInitializeNativeSdk: true,\n enableAutoPerformanceTracing: true,\n enableWatchdogTerminationTracking: true,\n patchGlobalPromise: true,\n sendClientReports: true,\n maxQueueSize: DEFAULT_BUFFER_SIZE,\n attachStacktrace: true,\n enableCaptureFailedRequests: false,\n enableNdk: true,\n enableAppStartTracking: true,\n enableNativeFramesTracking: true,\n enableStallTracking: true,\n enableUserInteractionTracing: false,\n};\n\n/**\n * Inits the SDK and returns the final options.\n */\nexport function init(passedOptions: ReactNativeOptions): void {\n if (isRunningInMetroDevServer()) {\n return;\n }\n\n const maxQueueSize = passedOptions.maxQueueSize\n // eslint-disable-next-line deprecation/deprecation\n ?? passedOptions.transportOptions?.bufferSize\n ?? DEFAULT_OPTIONS.maxQueueSize;\n\n const enableNative = passedOptions.enableNative === undefined || passedOptions.enableNative\n ? NATIVE.isNativeAvailable()\n : false;\n\n useEncodePolyfill();\n if (enableNative) {\n enableSyncToNative(getGlobalScope());\n enableSyncToNative(getIsolationScope());\n }\n\n const getURLFromDSN = (dsn: string | null): string | undefined => {\n if (!dsn) {\n return undefined;\n }\n try {\n const url = new URL(dsn);\n return `${url.protocol}//${url.host}`;\n } catch (e) {\n logger.error('Failed to extract url from DSN', e);\n return undefined;\n }\n };\n\n const userBeforeBreadcrumb = safeFactory(passedOptions.beforeBreadcrumb, { loggerMessage: 'The beforeBreadcrumb threw an error' });\n\n // Exclude Dev Server and Sentry Dsn request from Breadcrumbs\n const devServerUrl = getDevServer()?.url;\n const dsn = getURLFromDSN(passedOptions.dsn);\n const defaultBeforeBreadcrumb = (breadcrumb: Breadcrumb, _hint?: BreadcrumbHint): Breadcrumb | null => {\n const type = breadcrumb.type || '';\n const url = typeof breadcrumb.data?.url === 'string' ? breadcrumb.data.url : '';\n if (type === 'http' && ((devServerUrl && url.startsWith(devServerUrl)) || (dsn && url.startsWith(dsn)))) {\n return null;\n }\n return breadcrumb;\n };\n\n const chainedBeforeBreadcrumb = (breadcrumb: Breadcrumb, hint?: BreadcrumbHint): Breadcrumb | null => {\n let modifiedBreadcrumb = breadcrumb;\n if (userBeforeBreadcrumb) {\n const result = userBeforeBreadcrumb(breadcrumb, hint);\n if (result === null) {\n return null;\n }\n modifiedBreadcrumb = result;\n }\n return defaultBeforeBreadcrumb(modifiedBreadcrumb, hint);\n };\n\n const options: ReactNativeClientOptions = {\n ...DEFAULT_OPTIONS,\n ...passedOptions,\n enableNative,\n enableNativeNagger: shouldEnableNativeNagger(passedOptions.enableNativeNagger),\n // If custom transport factory fails the SDK won't initialize\n transport: passedOptions.transport\n || makeNativeTransportFactory({\n enableNative,\n })\n || makeFetchTransport,\n transportOptions: {\n ...DEFAULT_OPTIONS.transportOptions,\n ...(passedOptions.transportOptions ?? {}),\n bufferSize: maxQueueSize,\n },\n maxQueueSize,\n integrations: [],\n stackParser: stackParserFromStackParserOptions(passedOptions.stackParser || defaultStackParser),\n beforeBreadcrumb: chainedBeforeBreadcrumb,\n initialScope: safeFactory(passedOptions.initialScope, { loggerMessage: 'The initialScope threw an error' }),\n };\n if ('tracesSampler' in options) {\n options.tracesSampler = safeTracesSampler(options.tracesSampler);\n }\n\n if (!('environment' in options)) {\n options.environment = getDefaultEnvironment();\n }\n\n const defaultIntegrations: false | Integration[] = passedOptions.defaultIntegrations === undefined\n ? getDefaultIntegrations(options)\n : passedOptions.defaultIntegrations;\n\n options.integrations = getIntegrationsToSetup({\n integrations: safeFactory(passedOptions.integrations, { loggerMessage: 'The integrations threw an error' }),\n defaultIntegrations,\n });\n initAndBind(ReactNativeClient, options);\n\n if (isExpoGo()) {\n logger.info('Offline caching, native errors features are not available in Expo Go.');\n logger.info('Use EAS Build / Native Release Build to test these features.');\n }\n}\n\n/**\n * Inits the Sentry React Native SDK with automatic instrumentation and wrapped features.\n */\nexport function wrap<P extends Record<string, unknown>>(\n RootComponent: React.ComponentType<P>,\n options?: ReactNativeWrapperOptions\n): React.ComponentType<P> {\n const profilerProps = {\n ...(options?.profilerProps ?? {}),\n name: RootComponent.displayName ?? 'Root',\n };\n\n const RootApp: React.FC<P> = (appProps) => {\n return (\n <TouchEventBoundary {...(options?.touchEventBoundaryProps ?? {})}>\n <ReactNativeProfiler {...profilerProps}>\n <RootComponent {...appProps} />\n </ReactNativeProfiler>\n </TouchEventBoundary>\n );\n };\n\n return RootApp;\n}\n\n/**\n * If native client is available it will trigger a native crash.\n * Use this only for testing purposes.\n */\nexport function nativeCrash(): void {\n NATIVE.nativeCrash();\n}\n\n/**\n * Flushes all pending events in the queue to disk.\n * Use this before applying any realtime updates such as code-push or expo updates.\n */\nexport async function flush(): Promise<boolean> {\n try {\n const client = getClient();\n\n if (client) {\n const result = await client.flush();\n\n return result;\n }\n // eslint-disable-next-line no-empty\n } catch (_) { }\n\n logger.error('Failed to flush the event queue.');\n\n return false;\n}\n\n/**\n * Closes the SDK, stops sending events.\n */\nexport async function close(): Promise<void> {\n try {\n const client = getClient();\n\n if (client) {\n await client.close();\n }\n } catch (e) {\n logger.error('Failed to close the SDK');\n }\n}\n\n/**\n * Captures user feedback and sends it to Sentry.\n * @deprecated Use `Sentry.captureFeedback` instead.\n */\nexport function captureUserFeedback(feedback: UserFeedback): void {\n const feedbackParams: SendFeedbackParams = {\n name: feedback.name,\n email: feedback.email,\n message: feedback.comments,\n associatedEventId: feedback.event_id,\n };\n captureFeedback(feedbackParams);\n}\n\n/**\n * Creates a new scope with and executes the given operation within.\n * The scope is automatically removed once the operation\n * finishes or throws.\n *\n * This is essentially a convenience function for:\n *\n * pushScope();\n * callback();\n * popScope();\n *\n * @param callback that will be enclosed into push/popScope.\n */\nexport function withScope<T>(callback: (scope: Scope) => T): T | undefined {\n const safeCallback = (scope: Scope): T | undefined => {\n try {\n return callback(scope);\n } catch (e) {\n logger.error('Error while running withScope callback', e);\n return undefined;\n }\n };\n return coreWithScope(safeCallback);\n}\n\n/**\n * Returns if the app crashed in the last run.\n */\nexport async function crashedLastRun(): Promise<boolean | null> {\n return NATIVE.crashedLastRun();\n}\n"]}
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, "__esModule", { value: true });
2
- const utils_1 = require("@sentry/utils");
2
+ const core_1 = require("@sentry/core");
3
3
  const fs_1 = require("fs");
4
4
  const path_1 = require("path");
5
- utils_1.logger.enable();
5
+ core_1.logger.enable();
6
6
  // eslint-disable-next-line @typescript-eslint/unbound-method
7
7
  const { dirname, join, resolve, sep: posixSep } = path_1.posix;
8
8
  /**
@@ -50,7 +50,7 @@ class ModulesCollector {
50
50
  };
51
51
  }
52
52
  catch (error) {
53
- utils_1.logger.error(`Failed to read ${pkgPath}`);
53
+ core_1.logger.error(`Failed to read ${pkgPath}`);
54
54
  }
55
55
  return upDirSearch(); // processed package.json file, continue up search
56
56
  };
@@ -63,33 +63,33 @@ class ModulesCollector {
63
63
  */
64
64
  static run({ sourceMapPath, outputModulesPath, modulesPaths, collect, }) {
65
65
  if (!sourceMapPath) {
66
- utils_1.logger.error('First argument `source-map-path` is missing!');
66
+ core_1.logger.error('First argument `source-map-path` is missing!');
67
67
  return;
68
68
  }
69
69
  if (!outputModulesPath) {
70
- utils_1.logger.error('Second argument `modules-output-path` is missing!');
70
+ core_1.logger.error('Second argument `modules-output-path` is missing!');
71
71
  return;
72
72
  }
73
73
  if (!modulesPaths || modulesPaths.length === 0) {
74
- utils_1.logger.error('Third argument `modules-paths` is missing!');
74
+ core_1.logger.error('Third argument `modules-paths` is missing!');
75
75
  return;
76
76
  }
77
- utils_1.logger.info('Reading source map from', sourceMapPath);
78
- utils_1.logger.info('Saving modules to', outputModulesPath);
79
- utils_1.logger.info('Resolving modules from paths', modulesPaths.join(', '));
77
+ core_1.logger.info('Reading source map from', sourceMapPath);
78
+ core_1.logger.info('Saving modules to', outputModulesPath);
79
+ core_1.logger.info('Resolving modules from paths', modulesPaths.join(', '));
80
80
  if (!(0, fs_1.existsSync)(sourceMapPath)) {
81
- utils_1.logger.error(`Source map file does not exist at ${sourceMapPath}`);
81
+ core_1.logger.error(`Source map file does not exist at ${sourceMapPath}`);
82
82
  return;
83
83
  }
84
84
  for (const modulesPath of modulesPaths) {
85
85
  if (!(0, fs_1.existsSync)(modulesPath)) {
86
- utils_1.logger.error(`Modules path does not exist at ${modulesPath}`);
86
+ core_1.logger.error(`Modules path does not exist at ${modulesPath}`);
87
87
  return;
88
88
  }
89
89
  }
90
90
  const map = JSON.parse((0, fs_1.readFileSync)(sourceMapPath, 'utf8'));
91
91
  if (!map.sources || !Array.isArray(map.sources)) {
92
- utils_1.logger.error(`Modules not collected. No sources found in the source map (${sourceMapPath})!`);
92
+ core_1.logger.error(`Modules not collected. No sources found in the source map (${sourceMapPath})!`);
93
93
  return;
94
94
  }
95
95
  const sources = map.sources;
@@ -99,7 +99,7 @@ class ModulesCollector {
99
99
  (0, fs_1.mkdirSync)(outputModulesDirPath, { recursive: true });
100
100
  }
101
101
  (0, fs_1.writeFileSync)(outputModulesPath, JSON.stringify(modules, null, 2));
102
- utils_1.logger.info(`Modules collected and saved to: ${outputModulesPath}`);
102
+ core_1.logger.info(`Modules collected and saved to: ${outputModulesPath}`);
103
103
  }
104
104
  }
105
105
  exports.default = ModulesCollector;
@@ -1 +1 @@
1
- {"version":3,"file":"ModulesCollector.js","sourceRoot":"","sources":["../../../src/js/tools/ModulesCollector.ts"],"names":[],"mappings":";AAAA,yCAAuC;AACvC,2BAAwE;AACxE,+BAAkC;AAElC,cAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,6DAA6D;AAC7D,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,YAAK,CAAC;AAOxD;;GAEG;AACH,MAAqB,gBAAgB;IACnC,qBAAqB;IACd,MAAM,CAAC,OAAO,CAAC,OAAkB,EAAE,YAAsB;QAC9D,MAAM,sBAAsB,GAAG,YAAY,CAA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existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';\nimport { posix, sep } from 'path';\n\nlogger.enable();\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst { dirname, join, resolve, sep: posixSep } = posix;\n\ninterface Package {\n name?: string;\n version?: string;\n}\n\n/**\n * Collects JS modules from source paths.\n */\nexport default class ModulesCollector {\n /** Collect method */\n public static collect(sources: unknown[], modulesPaths: string[]): Record<string, string> {\n const normalizedModulesPaths = modulesPaths.map(modulesPath => resolve(modulesPath.split(sep).join(posixSep)));\n\n const infos: Record<string, string> = {};\n const seen: Record<string, true> = {};\n\n sources.forEach((path: unknown) => {\n if (typeof path !== 'string') {\n return;\n }\n\n let dir = path; // included source file path\n let candidate: Package | null = null;\n\n /** Traverse directories upward in the search of all package.json files */\n const upDirSearch = (): void => {\n const parentDir = dir;\n dir = dirname(parentDir);\n\n if (normalizedModulesPaths.includes(resolve(dir))) {\n if (candidate?.name && candidate?.version) {\n infos[candidate.name] = candidate.version;\n } else if (candidate?.name) {\n infos[candidate.name] = 'unknown';\n }\n return;\n }\n\n if (!dir || parentDir === dir || seen[dir]) {\n return;\n }\n seen[dir] = true;\n\n const pkgPath = join(dir, 'package.json');\n if (!existsSync(pkgPath)) {\n // fast-forward if the package.json doesn't exist\n return upDirSearch();\n }\n\n try {\n const info: Package = JSON.parse(readFileSync(pkgPath, 'utf8'));\n candidate = {\n name: info.name,\n version: info.version,\n };\n } catch (error) {\n logger.error(`Failed to read ${pkgPath}`);\n }\n\n return upDirSearch(); // processed package.json file, continue up search\n };\n\n upDirSearch();\n });\n\n return infos;\n }\n\n /**\n * Runs collection of modules.\n */\n public static run({\n sourceMapPath,\n outputModulesPath,\n modulesPaths,\n collect,\n }: Partial<{\n sourceMapPath: string;\n outputModulesPath: string;\n modulesPaths: string[];\n collect: (sources: unknown[], modulesPaths: string[]) => Record<string, string>;\n }>): void {\n if (!sourceMapPath) {\n logger.error('First argument `source-map-path` is missing!');\n return;\n }\n if (!outputModulesPath) {\n logger.error('Second argument `modules-output-path` is missing!');\n return;\n }\n if (!modulesPaths || modulesPaths.length === 0) {\n logger.error('Third argument `modules-paths` is missing!');\n return;\n }\n\n logger.info('Reading source map from', sourceMapPath);\n logger.info('Saving modules to', outputModulesPath);\n logger.info('Resolving modules from paths', modulesPaths.join(', '));\n\n if (!existsSync(sourceMapPath)) {\n logger.error(`Source map file does not exist at ${sourceMapPath}`);\n return;\n }\n for (const modulesPath of modulesPaths) {\n if (!existsSync(modulesPath)) {\n logger.error(`Modules path does not exist at ${modulesPath}`);\n return;\n }\n }\n\n const map: { sources?: unknown } = JSON.parse(readFileSync(sourceMapPath, 'utf8'));\n if (!map.sources || !Array.isArray(map.sources)) {\n logger.error(`Modules not collected. No sources found in the source map (${sourceMapPath})!`);\n return;\n }\n\n const sources: unknown[] = map.sources;\n const modules = collect ? collect(sources, modulesPaths) : ModulesCollector.collect(sources, modulesPaths);\n\n const outputModulesDirPath = dirname(outputModulesPath);\n if (!existsSync(outputModulesDirPath)) {\n mkdirSync(outputModulesDirPath, { recursive: true });\n }\n writeFileSync(outputModulesPath, JSON.stringify(modules, null, 2));\n logger.info(`Modules collected and saved to: ${outputModulesPath}`);\n }\n}\n"]}
1
+ {"version":3,"file":"ModulesCollector.js","sourceRoot":"","sources":["../../../src/js/tools/ModulesCollector.ts"],"names":[],"mappings":";AAAA,uCAAsC;AACtC,2BAAwE;AACxE,+BAAkC;AAElC,aAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,6DAA6D;AAC7D,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,YAAK,CAAC;AAOxD;;GAEG;AACH,MAAqB,gBAAgB;IACnC,qBAAqB;IACd,MAAM,CAAC,OAAO,CAAC,OAAkB,EAAE,YAAsB;QAC9D,MAAM,sBAAsB,GAAG,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,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aAAa,EAAE,CAAC,CAAC;YACnE,OAAO;SACR;QACD,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE;YACtC,IAAI,CAAC,IAAA,eAAU,EAAC,WAAW,CAAC,EAAE;gBAC5B,aAAM,CAAC,KAAK,CAAC,kCAAkC,WAAW,EAAE,CAAC,CAAC;gBAC9D,OAAO;aACR;SACF;QAED,MAAM,GAAG,GAA0B,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAY,EAAC,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC;QACnF,IAAI,CAAC,GAAG,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;YAC/C,aAAM,CAAC,KAAK,CAAC,8DAA8D,aAAa,IAAI,CAAC,CAAC;YAC9F,OAAO;SACR;QAED,MAAM,OAAO,GAAc,GAAG,CAAC,OAAO,CAAC;QACvC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,OAAO,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QAE3G,MAAM,oBAAoB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;QACxD,IAAI,CAAC,IAAA,eAAU,EAAC,oBAAoB,CAAC,EAAE;YACrC,IAAA,cAAS,EAAC,oBAAoB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;SACtD;QACD,IAAA,kBAAa,EAAC,iBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACnE,aAAM,CAAC,IAAI,CAAC,mCAAmC,iBAAiB,EAAE,CAAC,CAAC;IACtE,CAAC;CACF;AAtHD,mCAsHC","sourcesContent":["import { logger } from '@sentry/core';\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';\nimport { posix, sep } from 'path';\n\nlogger.enable();\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst { dirname, join, resolve, sep: posixSep } = posix;\n\ninterface Package {\n name?: string;\n version?: string;\n}\n\n/**\n * Collects JS modules from source paths.\n */\nexport default class ModulesCollector {\n /** Collect method */\n public static collect(sources: unknown[], modulesPaths: string[]): Record<string, string> {\n const normalizedModulesPaths = modulesPaths.map(modulesPath => resolve(modulesPath.split(sep).join(posixSep)));\n\n const infos: Record<string, string> = {};\n const seen: Record<string, true> = {};\n\n sources.forEach((path: unknown) => {\n if (typeof path !== 'string') {\n return;\n }\n\n let dir = path; // included source file path\n let candidate: Package | null = null;\n\n /** Traverse directories upward in the search of all package.json files */\n const upDirSearch = (): void => {\n const parentDir = dir;\n dir = dirname(parentDir);\n\n if (normalizedModulesPaths.includes(resolve(dir))) {\n if (candidate?.name && candidate?.version) {\n infos[candidate.name] = candidate.version;\n } else if (candidate?.name) {\n infos[candidate.name] = 'unknown';\n }\n return;\n }\n\n if (!dir || parentDir === dir || seen[dir]) {\n return;\n }\n seen[dir] = true;\n\n const pkgPath = join(dir, 'package.json');\n if (!existsSync(pkgPath)) {\n // fast-forward if the package.json doesn't exist\n return upDirSearch();\n }\n\n try {\n const info: Package = JSON.parse(readFileSync(pkgPath, 'utf8'));\n candidate = {\n name: info.name,\n version: info.version,\n };\n } catch (error) {\n logger.error(`Failed to read ${pkgPath}`);\n }\n\n return upDirSearch(); // processed package.json file, continue up search\n };\n\n upDirSearch();\n });\n\n return infos;\n }\n\n /**\n * Runs collection of modules.\n */\n public static run({\n sourceMapPath,\n outputModulesPath,\n modulesPaths,\n collect,\n }: Partial<{\n sourceMapPath: string;\n outputModulesPath: string;\n modulesPaths: string[];\n collect: (sources: unknown[], modulesPaths: string[]) => Record<string, string>;\n }>): void {\n if (!sourceMapPath) {\n logger.error('First argument `source-map-path` is missing!');\n return;\n }\n if (!outputModulesPath) {\n logger.error('Second argument `modules-output-path` is missing!');\n return;\n }\n if (!modulesPaths || modulesPaths.length === 0) {\n logger.error('Third argument `modules-paths` is missing!');\n return;\n }\n\n logger.info('Reading source map from', sourceMapPath);\n logger.info('Saving modules to', outputModulesPath);\n logger.info('Resolving modules from paths', modulesPaths.join(', '));\n\n if (!existsSync(sourceMapPath)) {\n logger.error(`Source map file does not exist at ${sourceMapPath}`);\n return;\n }\n for (const modulesPath of modulesPaths) {\n if (!existsSync(modulesPath)) {\n logger.error(`Modules path does not exist at ${modulesPath}`);\n return;\n }\n }\n\n const map: { sources?: unknown } = JSON.parse(readFileSync(sourceMapPath, 'utf8'));\n if (!map.sources || !Array.isArray(map.sources)) {\n logger.error(`Modules not collected. No sources found in the source map (${sourceMapPath})!`);\n return;\n }\n\n const sources: unknown[] = map.sources;\n const modules = collect ? collect(sources, modulesPaths) : ModulesCollector.collect(sources, modulesPaths);\n\n const outputModulesDirPath = dirname(outputModulesPath);\n if (!existsSync(outputModulesDirPath)) {\n mkdirSync(outputModulesDirPath, { recursive: true });\n }\n writeFileSync(outputModulesPath, JSON.stringify(modules, null, 2));\n logger.info(`Modules collected and saved to: ${outputModulesPath}`);\n }\n}\n"]}
@@ -1,12 +1,12 @@
1
1
  Object.defineProperty(exports, "__esModule", { value: true });
2
2
  exports.enableLogger = void 0;
3
- const utils_1 = require("@sentry/utils");
3
+ const core_1 = require("@sentry/core");
4
4
  /**
5
5
  * Enables debug logger when SENTRY_LOG_LEVEL=debug.
6
6
  */
7
7
  function enableLogger() {
8
8
  if (process.env.SENTRY_LOG_LEVEL === 'debug') {
9
- utils_1.logger.enable();
9
+ core_1.logger.enable();
10
10
  }
11
11
  }
12
12
  exports.enableLogger = enableLogger;
@@ -1 +1 @@
1
- {"version":3,"file":"enableLogger.js","sourceRoot":"","sources":["../../../src/js/tools/enableLogger.ts"],"names":[],"mappings":";;AAAA,yCAAuC;AAEvC;;GAEG;AACH,SAAgB,YAAY;IAC1B,IAAI,OAAO,CAAC,GAAG,CAAC,gBAAgB,KAAK,OAAO,EAAE;QAC5C,cAAM,CAAC,MAAM,EAAE,CAAC;KACjB;AACH,CAAC;AAJD,oCAIC","sourcesContent":["import { logger } from '@sentry/utils';\n\n/**\n * Enables debug logger when SENTRY_LOG_LEVEL=debug.\n */\nexport function enableLogger(): void {\n if (process.env.SENTRY_LOG_LEVEL === 'debug') {\n logger.enable();\n }\n}\n"]}
1
+ {"version":3,"file":"enableLogger.js","sourceRoot":"","sources":["../../../src/js/tools/enableLogger.ts"],"names":[],"mappings":";;AAAA,uCAAsC;AAEtC;;GAEG;AACH,SAAgB,YAAY;IAC1B,IAAI,OAAO,CAAC,GAAG,CAAC,gBAAgB,KAAK,OAAO,EAAE;QAC5C,aAAM,CAAC,MAAM,EAAE,CAAC;KACjB;AACH,CAAC;AAJD,oCAIC","sourcesContent":["import { logger } from '@sentry/core';\n\n/**\n * Enables debug logger when SENTRY_LOG_LEVEL=debug.\n */\nexport function enableLogger(): void {\n if (process.env.SENTRY_LOG_LEVEL === 'debug') {\n logger.enable();\n }\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, "__esModule", { value: true });
2
2
  exports.withSentryMiddleware = exports.createSentryMetroMiddleware = exports.stackFramesContextMiddleware = void 0;
3
3
  const tslib_1 = require("tslib");
4
- const utils_1 = require("@sentry/utils");
4
+ const core_1 = require("@sentry/core");
5
5
  const fs_1 = require("fs");
6
6
  const util_1 = require("util");
7
7
  const readFileAsync = (0, util_1.promisify)(fs_1.readFile);
@@ -10,7 +10,7 @@ const readFileAsync = (0, util_1.promisify)(fs_1.readFile);
10
10
  * adds source context to the in app frames.
11
11
  */
12
12
  const stackFramesContextMiddleware = (request, response) => tslib_1.__awaiter(this, void 0, void 0, function* () {
13
- utils_1.logger.debug('[@sentry/react-native/metro] Received request for stack frames context.');
13
+ core_1.logger.debug('[@sentry/react-native/metro] Received request for stack frames context.');
14
14
  request.setEncoding('utf8');
15
15
  const rawBody = yield getRawBody(request);
16
16
  let body = {};
@@ -18,13 +18,13 @@ const stackFramesContextMiddleware = (request, response) => tslib_1.__awaiter(th
18
18
  body = JSON.parse(rawBody);
19
19
  }
20
20
  catch (e) {
21
- utils_1.logger.debug('[@sentry/react-native/metro] Could not parse request body.', e);
21
+ core_1.logger.debug('[@sentry/react-native/metro] Could not parse request body.', e);
22
22
  badRequest(response, 'Invalid request body. Expected a JSON object.');
23
23
  return;
24
24
  }
25
25
  const stack = body.stack;
26
26
  if (!Array.isArray(stack)) {
27
- utils_1.logger.debug('[@sentry/react-native/metro] Invalid stack frames.', stack);
27
+ core_1.logger.debug('[@sentry/react-native/metro] Invalid stack frames.', stack);
28
28
  badRequest(response, 'Invalid stack frames. Expected an array.');
29
29
  return;
30
30
  }
@@ -32,7 +32,7 @@ const stackFramesContextMiddleware = (request, response) => tslib_1.__awaiter(th
32
32
  response.setHeader('Content-Type', 'application/json');
33
33
  response.statusCode = 200;
34
34
  response.end(JSON.stringify({ stack: stackWithSourceContext }));
35
- utils_1.logger.debug('[@sentry/react-native/metro] Sent stack frames context.');
35
+ core_1.logger.debug('[@sentry/react-native/metro] Sent stack frames context.');
36
36
  });
37
37
  exports.stackFramesContextMiddleware = stackFramesContextMiddleware;
38
38
  function addSourceContext(frame) {
@@ -42,15 +42,15 @@ function addSourceContext(frame) {
42
42
  }
43
43
  try {
44
44
  if (typeof frame.filename !== 'string') {
45
- utils_1.logger.warn('[@sentry/react-native/metro] Could not read source context for frame without filename.');
45
+ core_1.logger.warn('[@sentry/react-native/metro] Could not read source context for frame without filename.');
46
46
  return frame;
47
47
  }
48
48
  const source = yield readFileAsync(frame.filename, { encoding: 'utf8' });
49
49
  const lines = source.split('\n');
50
- (0, utils_1.addContextToFrame)(lines, frame);
50
+ (0, core_1.addContextToFrame)(lines, frame);
51
51
  }
52
52
  catch (error) {
53
- utils_1.logger.warn('[@sentry/react-native/metro] Could not read source context for frame.', error);
53
+ core_1.logger.warn('[@sentry/react-native/metro] Could not read source context for frame.', error);
54
54
  }
55
55
  return frame;
56
56
  });