@sentry/react-native 5.23.0-alpha.0 → 5.23.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 (161) hide show
  1. package/CHANGELOG.md +62 -18
  2. package/LICENSE.md +1 -1
  3. package/RNSentry.podspec +1 -1
  4. package/android/build.gradle +1 -1
  5. package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +1 -54
  6. package/android/src/newarch/java/io/sentry/react/RNSentryModule.java +0 -10
  7. package/android/src/oldarch/java/io/sentry/react/RNSentryModule.java +0 -10
  8. package/dist/js/NativeRNSentry.d.ts +0 -2
  9. package/dist/js/NativeRNSentry.d.ts.map +1 -1
  10. package/dist/js/NativeRNSentry.js.map +1 -1
  11. package/dist/js/client.d.ts +0 -8
  12. package/dist/js/client.d.ts.map +1 -1
  13. package/dist/js/client.js +4 -20
  14. package/dist/js/client.js.map +1 -1
  15. package/dist/js/index.d.ts +5 -3
  16. package/dist/js/index.d.ts.map +1 -1
  17. package/dist/js/index.js +5 -3
  18. package/dist/js/index.js.map +1 -1
  19. package/dist/js/integrations/debugsymbolicator.d.ts +8 -60
  20. package/dist/js/integrations/debugsymbolicator.d.ts.map +1 -1
  21. package/dist/js/integrations/debugsymbolicator.js +137 -209
  22. package/dist/js/integrations/debugsymbolicator.js.map +1 -1
  23. package/dist/js/integrations/debugsymbolicatorutils.d.ts +18 -0
  24. package/dist/js/integrations/debugsymbolicatorutils.d.ts.map +1 -0
  25. package/dist/js/integrations/debugsymbolicatorutils.js +70 -0
  26. package/dist/js/integrations/debugsymbolicatorutils.js.map +1 -0
  27. package/dist/js/integrations/default.d.ts.map +1 -1
  28. package/dist/js/integrations/default.js +24 -49
  29. package/dist/js/integrations/default.js.map +1 -1
  30. package/dist/js/integrations/devicecontext.d.ts +8 -15
  31. package/dist/js/integrations/devicecontext.d.ts.map +1 -1
  32. package/dist/js/integrations/devicecontext.js +74 -74
  33. package/dist/js/integrations/devicecontext.js.map +1 -1
  34. package/dist/js/integrations/eventorigin.d.ts +8 -15
  35. package/dist/js/integrations/eventorigin.d.ts.map +1 -1
  36. package/dist/js/integrations/eventorigin.js +17 -17
  37. package/dist/js/integrations/eventorigin.js.map +1 -1
  38. package/dist/js/integrations/expocontext.d.ts +8 -15
  39. package/dist/js/integrations/expocontext.d.ts.map +1 -1
  40. package/dist/js/integrations/expocontext.js +28 -32
  41. package/dist/js/integrations/expocontext.js.map +1 -1
  42. package/dist/js/integrations/exports.d.ts +16 -0
  43. package/dist/js/integrations/exports.d.ts.map +1 -0
  44. package/dist/js/integrations/exports.js +16 -0
  45. package/dist/js/integrations/exports.js.map +1 -0
  46. package/dist/js/integrations/index.d.ts +4 -1
  47. package/dist/js/integrations/index.d.ts.map +1 -1
  48. package/dist/js/integrations/index.js +5 -1
  49. package/dist/js/integrations/index.js.map +1 -1
  50. package/dist/js/integrations/modulesloader.d.ts +8 -15
  51. package/dist/js/integrations/modulesloader.d.ts.map +1 -1
  52. package/dist/js/integrations/modulesloader.js +34 -31
  53. package/dist/js/integrations/modulesloader.js.map +1 -1
  54. package/dist/js/integrations/nativelinkederrors.d.ts +8 -51
  55. package/dist/js/integrations/nativelinkederrors.d.ts.map +1 -1
  56. package/dist/js/integrations/nativelinkederrors.js +112 -124
  57. package/dist/js/integrations/nativelinkederrors.js.map +1 -1
  58. package/dist/js/integrations/reactnativeerrorhandlers.d.ts +8 -54
  59. package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
  60. package/dist/js/integrations/reactnativeerrorhandlers.js +109 -199
  61. package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
  62. package/dist/js/integrations/reactnativeerrorhandlersutils.d.ts +27 -0
  63. package/dist/js/integrations/reactnativeerrorhandlersutils.d.ts.map +1 -0
  64. package/dist/js/integrations/reactnativeerrorhandlersutils.js +77 -0
  65. package/dist/js/integrations/reactnativeerrorhandlersutils.js.map +1 -0
  66. package/dist/js/integrations/reactnativeinfo.d.ts +8 -15
  67. package/dist/js/integrations/reactnativeinfo.d.ts.map +1 -1
  68. package/dist/js/integrations/reactnativeinfo.js +51 -51
  69. package/dist/js/integrations/reactnativeinfo.js.map +1 -1
  70. package/dist/js/integrations/release.d.ts +8 -15
  71. package/dist/js/integrations/release.d.ts.map +1 -1
  72. package/dist/js/integrations/release.js +55 -57
  73. package/dist/js/integrations/release.js.map +1 -1
  74. package/dist/js/integrations/rewriteframes.js +2 -2
  75. package/dist/js/integrations/rewriteframes.js.map +1 -1
  76. package/dist/js/integrations/screenshot.d.ts +8 -23
  77. package/dist/js/integrations/screenshot.d.ts.map +1 -1
  78. package/dist/js/integrations/screenshot.js +31 -47
  79. package/dist/js/integrations/screenshot.js.map +1 -1
  80. package/dist/js/integrations/sdkinfo.d.ts +8 -16
  81. package/dist/js/integrations/sdkinfo.d.ts.map +1 -1
  82. package/dist/js/integrations/sdkinfo.js +54 -41
  83. package/dist/js/integrations/sdkinfo.js.map +1 -1
  84. package/dist/js/integrations/spotlight.d.ts +10 -2
  85. package/dist/js/integrations/spotlight.d.ts.map +1 -1
  86. package/dist/js/integrations/spotlight.js +14 -9
  87. package/dist/js/integrations/spotlight.js.map +1 -1
  88. package/dist/js/integrations/viewhierarchy.d.ts +8 -18
  89. package/dist/js/integrations/viewhierarchy.d.ts.map +1 -1
  90. package/dist/js/integrations/viewhierarchy.js +46 -43
  91. package/dist/js/integrations/viewhierarchy.js.map +1 -1
  92. package/dist/js/options.d.ts +2 -24
  93. package/dist/js/options.d.ts.map +1 -1
  94. package/dist/js/options.js.map +1 -1
  95. package/dist/js/profiling/integration.d.ts +8 -32
  96. package/dist/js/profiling/integration.d.ts.map +1 -1
  97. package/dist/js/profiling/integration.js +120 -119
  98. package/dist/js/profiling/integration.js.map +1 -1
  99. package/dist/js/tracing/nativeframes.d.ts +0 -4
  100. package/dist/js/tracing/nativeframes.d.ts.map +1 -1
  101. package/dist/js/tracing/nativeframes.js +14 -14
  102. package/dist/js/tracing/nativeframes.js.map +1 -1
  103. package/dist/js/utils/environment.d.ts +0 -4
  104. package/dist/js/utils/environment.d.ts.map +1 -1
  105. package/dist/js/utils/environment.js +0 -8
  106. package/dist/js/utils/environment.js.map +1 -1
  107. package/dist/js/version.d.ts +1 -1
  108. package/dist/js/version.d.ts.map +1 -1
  109. package/dist/js/version.js +1 -1
  110. package/dist/js/version.js.map +1 -1
  111. package/dist/js/wrapper.d.ts +1 -7
  112. package/dist/js/wrapper.d.ts.map +1 -1
  113. package/dist/js/wrapper.js +0 -24
  114. package/dist/js/wrapper.js.map +1 -1
  115. package/ios/RNSentry.mm +14 -49
  116. package/ios/RNSentryDependencyContainer.h +4 -1
  117. package/ios/RNSentryDependencyContainer.m +4 -0
  118. package/ios/RNSentryFramesTrackerListener.h +6 -0
  119. package/ios/RNSentryFramesTrackerListener.m +4 -0
  120. package/ios/RNSentryOnDrawReporter.h +23 -0
  121. package/ios/RNSentryOnDrawReporter.m +5 -16
  122. package/ios/RNSentryRNSScreen.h +6 -0
  123. package/ios/RNSentryRNSScreen.m +6 -1
  124. package/package.json +12 -20
  125. package/src/js/NativeRNSentry.ts +0 -2
  126. package/ts3.8/dist/js/NativeRNSentry.d.ts +0 -2
  127. package/ts3.8/dist/js/client.d.ts +0 -8
  128. package/ts3.8/dist/js/index.d.ts +5 -3
  129. package/ts3.8/dist/js/integrations/debugsymbolicator.d.ts +8 -60
  130. package/ts3.8/dist/js/integrations/debugsymbolicatorutils.d.ts +18 -0
  131. package/ts3.8/dist/js/integrations/devicecontext.d.ts +8 -15
  132. package/ts3.8/dist/js/integrations/eventorigin.d.ts +8 -15
  133. package/ts3.8/dist/js/integrations/expocontext.d.ts +8 -15
  134. package/ts3.8/dist/js/integrations/exports.d.ts +16 -0
  135. package/ts3.8/dist/js/integrations/index.d.ts +4 -1
  136. package/ts3.8/dist/js/integrations/modulesloader.d.ts +8 -15
  137. package/ts3.8/dist/js/integrations/nativelinkederrors.d.ts +8 -51
  138. package/ts3.8/dist/js/integrations/reactnativeerrorhandlers.d.ts +8 -54
  139. package/ts3.8/dist/js/integrations/reactnativeerrorhandlersutils.d.ts +27 -0
  140. package/ts3.8/dist/js/integrations/reactnativeinfo.d.ts +8 -15
  141. package/ts3.8/dist/js/integrations/release.d.ts +8 -15
  142. package/ts3.8/dist/js/integrations/screenshot.d.ts +8 -23
  143. package/ts3.8/dist/js/integrations/sdkinfo.d.ts +8 -16
  144. package/ts3.8/dist/js/integrations/spotlight.d.ts +10 -2
  145. package/ts3.8/dist/js/integrations/viewhierarchy.d.ts +8 -18
  146. package/ts3.8/dist/js/options.d.ts +2 -24
  147. package/ts3.8/dist/js/profiling/integration.d.ts +8 -32
  148. package/ts3.8/dist/js/tracing/nativeframes.d.ts +0 -4
  149. package/ts3.8/dist/js/utils/environment.d.ts +0 -4
  150. package/ts3.8/dist/js/version.d.ts +1 -1
  151. package/ts3.8/dist/js/wrapper.d.ts +1 -7
  152. package/dist/js/integrations/mobilereplay.d.ts +0 -36
  153. package/dist/js/integrations/mobilereplay.d.ts.map +0 -1
  154. package/dist/js/integrations/mobilereplay.js +0 -97
  155. package/dist/js/integrations/mobilereplay.js.map +0 -1
  156. package/dist/js/utils/clientutils.d.ts +0 -8
  157. package/dist/js/utils/clientutils.d.ts.map +0 -1
  158. package/dist/js/utils/clientutils.js +0 -7
  159. package/dist/js/utils/clientutils.js.map +0 -1
  160. package/ts3.8/dist/js/integrations/mobilereplay.d.ts +0 -36
  161. package/ts3.8/dist/js/utils/clientutils.d.ts +0 -8
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,mCAAmC,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,iBAAiB,EACjB,2BAA2B,EAC3B,yBAAyB,IAAI,gCAAgC,EAC7D,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,IAAI,8BAA8B,EACzD,wBAAwB,GACzB,MAAM,eAAe,CAAC"}
@@ -0,0 +1,16 @@
1
+ export { debugSymbolicatorIntegration } from './debugsymbolicator';
2
+ export { deviceContextIntegration } from './devicecontext';
3
+ export { reactNativeErrorHandlersIntegration } from './reactnativeerrorhandlers';
4
+ export { nativeLinkedErrorsIntegration } from './nativelinkederrors';
5
+ export { nativeReleaseIntegration } from './release';
6
+ export { eventOriginIntegration } from './eventorigin';
7
+ export { sdkInfoIntegration } from './sdkinfo';
8
+ export { reactNativeInfoIntegration } from './reactnativeinfo';
9
+ export { modulesLoaderIntegration } from './modulesloader';
10
+ export { hermesProfilingIntegration } from '../profiling/integration';
11
+ export { screenshotIntegration } from './screenshot';
12
+ export { viewHierarchyIntegration } from './viewhierarchy';
13
+ export { expoContextIntegration } from './expocontext';
14
+ export { spotlightIntegration } from './spotlight';
15
+ export { breadcrumbsIntegration, browserApiErrorsIntegration, dedupeIntegration, functionToStringIntegration, globalHandlersIntegration as browserGlobalHandlersIntegration, httpClientIntegration, httpContextIntegration, inboundFiltersIntegration, linkedErrorsIntegration as browserLinkedErrorsIntegration, rewriteFramesIntegration, } from '@sentry/react';
16
+ //# sourceMappingURL=exports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exports.js","sourceRoot":"","sources":["../../../src/js/integrations/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,mCAAmC,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,iBAAiB,EACjB,2BAA2B,EAC3B,yBAAyB,IAAI,gCAAgC,EAC7D,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,IAAI,8BAA8B,EACzD,wBAAwB,GACzB,MAAM,eAAe,CAAC","sourcesContent":["export { debugSymbolicatorIntegration } from './debugsymbolicator';\nexport { deviceContextIntegration } from './devicecontext';\nexport { reactNativeErrorHandlersIntegration } from './reactnativeerrorhandlers';\nexport { nativeLinkedErrorsIntegration } from './nativelinkederrors';\nexport { nativeReleaseIntegration } from './release';\nexport { eventOriginIntegration } from './eventorigin';\nexport { sdkInfoIntegration } from './sdkinfo';\nexport { reactNativeInfoIntegration } from './reactnativeinfo';\nexport { modulesLoaderIntegration } from './modulesloader';\nexport { hermesProfilingIntegration } from '../profiling/integration';\nexport { screenshotIntegration } from './screenshot';\nexport { viewHierarchyIntegration } from './viewhierarchy';\nexport { expoContextIntegration } from './expocontext';\nexport { spotlightIntegration } from './spotlight';\n\nexport {\n breadcrumbsIntegration,\n browserApiErrorsIntegration,\n dedupeIntegration,\n functionToStringIntegration,\n globalHandlersIntegration as browserGlobalHandlersIntegration,\n httpClientIntegration,\n httpContextIntegration,\n inboundFiltersIntegration,\n linkedErrorsIntegration as browserLinkedErrorsIntegration,\n rewriteFramesIntegration,\n} from '@sentry/react';\n"]}
@@ -1,12 +1,15 @@
1
1
  export { DebugSymbolicator } from './debugsymbolicator';
2
2
  export { DeviceContext } from './devicecontext';
3
3
  export { ReactNativeErrorHandlers } from './reactnativeerrorhandlers';
4
+ export { NativeLinkedErrors } from './nativelinkederrors';
4
5
  export { Release } from './release';
5
6
  export { EventOrigin } from './eventorigin';
6
7
  export { SdkInfo } from './sdkinfo';
7
8
  export { ReactNativeInfo } from './reactnativeinfo';
8
9
  export { ModulesLoader } from './modulesloader';
9
10
  export { HermesProfiling } from '../profiling/integration';
11
+ export { Screenshot } from './screenshot';
12
+ export { ViewHierarchy } from './viewhierarchy';
13
+ export { ExpoContext } from './expocontext';
10
14
  export { Spotlight } from './spotlight';
11
- export { mobileReplayIntegration } from './mobilereplay';
12
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
@@ -1,12 +1,16 @@
1
+ // THESE EXPORTS WILL BE REMOVED IN THE NEXT MAJOR RELEASE
1
2
  export { DebugSymbolicator } from './debugsymbolicator';
2
3
  export { DeviceContext } from './devicecontext';
3
4
  export { ReactNativeErrorHandlers } from './reactnativeerrorhandlers';
5
+ export { NativeLinkedErrors } from './nativelinkederrors';
4
6
  export { Release } from './release';
5
7
  export { EventOrigin } from './eventorigin';
6
8
  export { SdkInfo } from './sdkinfo';
7
9
  export { ReactNativeInfo } from './reactnativeinfo';
8
10
  export { ModulesLoader } from './modulesloader';
9
11
  export { HermesProfiling } from '../profiling/integration';
12
+ export { Screenshot } from './screenshot';
13
+ export { ViewHierarchy } from './viewhierarchy';
14
+ export { ExpoContext } from './expocontext';
10
15
  export { Spotlight } from './spotlight';
11
- export { mobileReplayIntegration } from './mobilereplay';
12
16
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/js/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC","sourcesContent":["export { DebugSymbolicator } from './debugsymbolicator';\nexport { DeviceContext } from './devicecontext';\nexport { ReactNativeErrorHandlers } from './reactnativeerrorhandlers';\nexport { Release } from './release';\nexport { EventOrigin } from './eventorigin';\nexport { SdkInfo } from './sdkinfo';\nexport { ReactNativeInfo } from './reactnativeinfo';\nexport { ModulesLoader } from './modulesloader';\nexport { HermesProfiling } from '../profiling/integration';\nexport { Spotlight } from './spotlight';\nexport { mobileReplayIntegration } from './mobilereplay';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/js/integrations/index.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC","sourcesContent":["// THESE EXPORTS WILL BE REMOVED IN THE NEXT MAJOR RELEASE\n\nexport { DebugSymbolicator } from './debugsymbolicator';\nexport { DeviceContext } from './devicecontext';\nexport { ReactNativeErrorHandlers } from './reactnativeerrorhandlers';\nexport { NativeLinkedErrors } from './nativelinkederrors';\nexport { Release } from './release';\nexport { EventOrigin } from './eventorigin';\nexport { SdkInfo } from './sdkinfo';\nexport { ReactNativeInfo } from './reactnativeinfo';\nexport { ModulesLoader } from './modulesloader';\nexport { HermesProfiling } from '../profiling/integration';\nexport { Screenshot } from './screenshot';\nexport { ViewHierarchy } from './viewhierarchy';\nexport { ExpoContext } from './expocontext';\nexport { Spotlight } from './spotlight';\n"]}
@@ -1,17 +1,10 @@
1
- import type { EventProcessor, Integration } from '@sentry/types';
1
+ import type { Integration, IntegrationClass, IntegrationFnResult } from '@sentry/types';
2
2
  /** Loads runtime JS modules from prepared file. */
3
- export declare class ModulesLoader implements Integration {
4
- /**
5
- * @inheritDoc
6
- */
7
- static id: string;
8
- /**
9
- * @inheritDoc
10
- */
11
- name: string;
12
- /**
13
- * @inheritDoc
14
- */
15
- setupOnce(addGlobalEventProcessor: (e: EventProcessor) => void): void;
16
- }
3
+ export declare const modulesLoaderIntegration: () => IntegrationFnResult;
4
+ /**
5
+ * Loads runtime JS modules from prepared file.
6
+ *
7
+ * @deprecated Use `modulesLoaderIntegration()` instead.
8
+ */
9
+ export declare const ModulesLoader: IntegrationClass<Integration>;
17
10
  //# sourceMappingURL=modulesloader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"modulesloader.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/modulesloader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAS,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAKxE,mDAAmD;AACnD,qBAAa,aAAc,YAAW,WAAW;IAC/C;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAmB;IAE3C;;OAEG;IACI,IAAI,EAAE,MAAM,CAAoB;IAEvC;;OAEG;IACI,SAAS,CAAC,uBAAuB,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;CAsB7E"}
1
+ {"version":3,"file":"modulesloader.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/modulesloader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAS,WAAW,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAO/F,mDAAmD;AACnD,eAAO,MAAM,wBAAwB,QAAO,mBAQ3C,CAAC;AAEF;;;;GAIG;AAEH,eAAO,MAAM,aAAa,+BAGQ,CAAC"}
@@ -1,39 +1,42 @@
1
1
  import { __awaiter } from "tslib";
2
+ import { convertIntegrationFnToClass } from '@sentry/core';
2
3
  import { logger } from '@sentry/utils';
3
4
  import { NATIVE } from '../wrapper';
5
+ const INTEGRATION_NAME = 'ModulesLoader';
4
6
  /** Loads runtime JS modules from prepared file. */
5
- export class ModulesLoader {
6
- constructor() {
7
- /**
8
- * @inheritDoc
9
- */
10
- this.name = ModulesLoader.id;
11
- }
12
- /**
13
- * @inheritDoc
14
- */
15
- setupOnce(addGlobalEventProcessor) {
16
- let isSetup = false;
17
- let modules;
18
- addGlobalEventProcessor((event) => __awaiter(this, void 0, void 0, function* () {
19
- if (!isSetup) {
20
- try {
21
- modules = yield NATIVE.fetchModules();
22
- }
23
- catch (e) {
24
- logger.log(`Failed to get modules from native: ${e}`);
25
- }
26
- isSetup = true;
7
+ export const modulesLoaderIntegration = () => {
8
+ return {
9
+ name: INTEGRATION_NAME,
10
+ setupOnce: () => {
11
+ // noop
12
+ },
13
+ processEvent: createProcessEvent(),
14
+ };
15
+ };
16
+ /**
17
+ * Loads runtime JS modules from prepared file.
18
+ *
19
+ * @deprecated Use `modulesLoaderIntegration()` instead.
20
+ */
21
+ // eslint-disable-next-line deprecation/deprecation
22
+ export const ModulesLoader = convertIntegrationFnToClass(INTEGRATION_NAME, modulesLoaderIntegration);
23
+ function createProcessEvent() {
24
+ let isSetup = false;
25
+ let modules = null;
26
+ return (event) => __awaiter(this, void 0, void 0, function* () {
27
+ if (!isSetup) {
28
+ try {
29
+ modules = yield NATIVE.fetchModules();
27
30
  }
28
- if (modules) {
29
- event.modules = Object.assign(Object.assign({}, modules), event.modules);
31
+ catch (e) {
32
+ logger.log(`Failed to get modules from native: ${e}`);
30
33
  }
31
- return event;
32
- }));
33
- }
34
+ isSetup = true;
35
+ }
36
+ if (modules) {
37
+ event.modules = Object.assign(Object.assign({}, modules), event.modules);
38
+ }
39
+ return event;
40
+ });
34
41
  }
35
- /**
36
- * @inheritDoc
37
- */
38
- ModulesLoader.id = 'ModulesLoader';
39
42
  //# sourceMappingURL=modulesloader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"modulesloader.js","sourceRoot":"","sources":["../../../src/js/integrations/modulesloader.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,mDAAmD;AACnD,MAAM,OAAO,aAAa;IAA1B;QAME;;WAEG;QACI,SAAI,GAAW,aAAa,CAAC,EAAE,CAAC;IA2BzC,CAAC;IAzBC;;OAEG;IACI,SAAS,CAAC,uBAAoD;QACnE,IAAI,OAAO,GAAG,KAAK,CAAC;QACpB,IAAI,OAAsC,CAAC;QAE3C,uBAAuB,CAAC,CAAO,KAAY,EAAE,EAAE;YAC7C,IAAI,CAAC,OAAO,EAAE;gBACZ,IAAI;oBACF,OAAO,GAAG,MAAM,MAAM,CAAC,YAAY,EAAE,CAAC;iBACvC;gBAAC,OAAO,CAAC,EAAE;oBACV,MAAM,CAAC,GAAG,CAAC,sCAAsC,CAAC,EAAE,CAAC,CAAC;iBACvD;gBACD,OAAO,GAAG,IAAI,CAAC;aAChB;YACD,IAAI,OAAO,EAAE;gBACX,KAAK,CAAC,OAAO,mCACR,OAAO,GACP,KAAK,CAAC,OAAO,CACjB,CAAC;aACH;YACD,OAAO,KAAK,CAAC;QACf,CAAC,CAAA,CAAC,CAAC;IACL,CAAC;;AAlCD;;GAEG;AACW,gBAAE,GAAW,eAAe,CAAC","sourcesContent":["import type { Event, EventProcessor, Integration } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { NATIVE } from '../wrapper';\n\n/** Loads runtime JS modules from prepared file. */\nexport class ModulesLoader implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'ModulesLoader';\n\n /**\n * @inheritDoc\n */\n public name: string = ModulesLoader.id;\n\n /**\n * @inheritDoc\n */\n public setupOnce(addGlobalEventProcessor: (e: EventProcessor) => void): void {\n let isSetup = false;\n let modules: Record<string, string> | null;\n\n addGlobalEventProcessor(async (event: Event) => {\n if (!isSetup) {\n try {\n modules = await NATIVE.fetchModules();\n } catch (e) {\n logger.log(`Failed to get modules from native: ${e}`);\n }\n isSetup = true;\n }\n if (modules) {\n event.modules = {\n ...modules,\n ...event.modules,\n };\n }\n return event;\n });\n }\n}\n"]}
1
+ {"version":3,"file":"modulesloader.js","sourceRoot":"","sources":["../../../src/js/integrations/modulesloader.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAEzC,mDAAmD;AACnD,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAwB,EAAE;IAChE,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,GAAG,EAAE;YACd,OAAO;QACT,CAAC;QACD,YAAY,EAAE,kBAAkB,EAAE;KACnC,CAAC;AACJ,CAAC,CAAC;AAEF;;;;GAIG;AACH,mDAAmD;AACnD,MAAM,CAAC,MAAM,aAAa,GAAG,2BAA2B,CACtD,gBAAgB,EAChB,wBAAwB,CACQ,CAAC;AAEnC,SAAS,kBAAkB;IACzB,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,IAAI,OAAO,GAAkC,IAAI,CAAC;IAElD,OAAO,CAAO,KAAY,EAAE,EAAE;QAC5B,IAAI,CAAC,OAAO,EAAE;YACZ,IAAI;gBACF,OAAO,GAAG,MAAM,MAAM,CAAC,YAAY,EAAE,CAAC;aACvC;YAAC,OAAO,CAAC,EAAE;gBACV,MAAM,CAAC,GAAG,CAAC,sCAAsC,CAAC,EAAE,CAAC,CAAC;aACvD;YACD,OAAO,GAAG,IAAI,CAAC;SAChB;QACD,IAAI,OAAO,EAAE;YACX,KAAK,CAAC,OAAO,mCACR,OAAO,GACP,KAAK,CAAC,OAAO,CACjB,CAAC;SACH;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAA,CAAC;AACJ,CAAC","sourcesContent":["import { convertIntegrationFnToClass } from '@sentry/core';\nimport type { Event, Integration, IntegrationClass, IntegrationFnResult } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { NATIVE } from '../wrapper';\n\nconst INTEGRATION_NAME = 'ModulesLoader';\n\n/** Loads runtime JS modules from prepared file. */\nexport const modulesLoaderIntegration = (): IntegrationFnResult => {\n return {\n name: INTEGRATION_NAME,\n setupOnce: () => {\n // noop\n },\n processEvent: createProcessEvent(),\n };\n};\n\n/**\n * Loads runtime JS modules from prepared file.\n *\n * @deprecated Use `modulesLoaderIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const ModulesLoader = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n modulesLoaderIntegration,\n) as IntegrationClass<Integration>;\n\nfunction createProcessEvent(): (event: Event) => Promise<Event> {\n let isSetup = false;\n let modules: Record<string, string> | null = null;\n\n return async (event: Event) => {\n if (!isSetup) {\n try {\n modules = await NATIVE.fetchModules();\n } catch (e) {\n logger.log(`Failed to get modules from native: ${e}`);\n }\n isSetup = true;\n }\n if (modules) {\n event.modules = {\n ...modules,\n ...event.modules,\n };\n }\n return event;\n };\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { Client, Event, EventHint, EventProcessor, Hub, Integration } from '@sentry/types';
1
+ import type { Integration, IntegrationClass, IntegrationFnResult } from '@sentry/types';
2
2
  interface LinkedErrorsOptions {
3
3
  key: string;
4
4
  limit: number;
@@ -6,55 +6,12 @@ interface LinkedErrorsOptions {
6
6
  /**
7
7
  * Processes JS and RN native linked errors.
8
8
  */
9
- export declare class NativeLinkedErrors implements Integration {
10
- /**
11
- * @inheritDoc
12
- */
13
- static id: string;
14
- /**
15
- * @inheritDoc
16
- */
17
- name: string;
18
- private readonly _key;
19
- private readonly _limit;
20
- private _nativePackage;
21
- /**
22
- * @inheritDoc
23
- */
24
- constructor(options?: Partial<LinkedErrorsOptions>);
25
- /**
26
- * @inheritDoc
27
- */
28
- setupOnce(_addGlobalEventProcessor: (callback: EventProcessor) => void, _getCurrentHub: () => Hub): void;
29
- /**
30
- * @inheritDoc
31
- */
32
- preprocessEvent(event: Event, hint: EventHint | undefined, client: Client): void;
33
- /**
34
- * Enriches passed event with linked exceptions and native debug meta images.
35
- */
36
- private _handler;
37
- /**
38
- * Walks linked errors and created Sentry exceptions chain.
39
- * Collects debug images from native errors stack frames.
40
- */
41
- private _walkErrorTree;
42
- /**
43
- * Converts a Java Throwable to an SentryException
44
- */
45
- private _exceptionFromJavaStackElements;
46
- /**
47
- * Converts StackAddresses to a SentryException with DebugMetaImages
48
- */
49
- private _exceptionFromAppleStackReturnAddresses;
50
- /**
51
- * Fetches the native package/image name from the native layer
52
- */
53
- private _fetchNativePackage;
54
- /**
55
- * Fetches native debug image information on iOS
56
- */
57
- private _fetchNativeStackFrames;
58
- }
9
+ export declare const nativeLinkedErrorsIntegration: (options?: Partial<LinkedErrorsOptions>) => IntegrationFnResult;
10
+ /**
11
+ * Processes JS and RN native linked errors.
12
+ *
13
+ * @deprecated Use `nativeLinkedErrorsIntegration()` instead.
14
+ */
15
+ export declare const NativeLinkedErrors: IntegrationClass<Integration> & (new (options?: Partial<LinkedErrorsOptions>) => Integration);
59
16
  export {};
60
17
  //# sourceMappingURL=nativelinkederrors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"nativelinkederrors.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/nativelinkederrors.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,MAAM,EAEN,KAAK,EACL,SAAS,EACT,cAAc,EAGd,GAAG,EACH,WAAW,EAGZ,MAAM,eAAe,CAAC;AASvB,UAAU,mBAAmB;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,qBAAa,kBAAmB,YAAW,WAAW;IACpD;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAwB;IAEhD;;OAEG;IACI,IAAI,EAAE,MAAM,CAAyB;IAE5C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA6B;IAClD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA+B;IACtD,OAAO,CAAC,cAAc,CAAuB;IAE7C;;OAEG;gBACgB,OAAO,GAAE,OAAO,CAAC,mBAAmB,CAAM;IAK7D;;OAEG;IACI,SAAS,CAAC,wBAAwB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,EAAE,cAAc,EAAE,MAAM,GAAG,GAAG,IAAI;IAI/G;;OAEG;IACI,eAAe,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAQvF;;OAEG;IACH,OAAO,CAAC,QAAQ;IAiBhB;;;OAGG;IACH,OAAO,CAAC,cAAc;IAqDtB;;OAEG;IACH,OAAO,CAAC,+BAA+B;IAkCvC;;OAEG;IACH,OAAO,CAAC,uCAAuC;IAsB/C;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAI3B;;OAEG;IACH,OAAO,CAAC,uBAAuB;CAGhC"}
1
+ {"version":3,"file":"nativelinkederrors.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/nativelinkederrors.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAOV,WAAW,EACX,gBAAgB,EAChB,mBAAmB,EAGpB,MAAM,eAAe,CAAC;AAWvB,UAAU,mBAAmB;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,eAAO,MAAM,6BAA6B,aAAa,QAAQ,mBAAmB,CAAC,KAAQ,mBAY1F,CAAC;AAEF;;;;GAIG;AAEH,eAAO,MAAM,kBAAkB,kDAId,QAAQ,mBAAmB,CAAC,KAAG,WAAW,CAC1D,CAAC"}
@@ -1,147 +1,135 @@
1
1
  import { exceptionFromError } from '@sentry/browser';
2
+ import { convertIntegrationFnToClass } from '@sentry/core';
2
3
  import { isInstanceOf, isPlainObject } from '@sentry/utils';
3
4
  import { NATIVE } from '../wrapper';
5
+ const INTEGRATION_NAME = 'NativeLinkedErrors';
4
6
  const DEFAULT_KEY = 'cause';
5
7
  const DEFAULT_LIMIT = 5;
6
8
  /**
7
9
  * Processes JS and RN native linked errors.
8
10
  */
9
- export class NativeLinkedErrors {
10
- /**
11
- * @inheritDoc
12
- */
13
- constructor(options = {}) {
14
- /**
15
- * @inheritDoc
16
- */
17
- this.name = NativeLinkedErrors.id;
18
- this._nativePackage = null;
19
- this._key = options.key || DEFAULT_KEY;
20
- this._limit = options.limit || DEFAULT_LIMIT;
11
+ export const nativeLinkedErrorsIntegration = (options = {}) => {
12
+ const key = options.key || DEFAULT_KEY;
13
+ const limit = options.limit || DEFAULT_LIMIT;
14
+ return {
15
+ name: INTEGRATION_NAME,
16
+ setupOnce: () => {
17
+ // noop
18
+ },
19
+ preprocessEvent: (event, hint, client) => preprocessEvent(event, hint, client, limit, key),
20
+ };
21
+ };
22
+ /**
23
+ * Processes JS and RN native linked errors.
24
+ *
25
+ * @deprecated Use `nativeLinkedErrorsIntegration()` instead.
26
+ */
27
+ // eslint-disable-next-line deprecation/deprecation
28
+ export const NativeLinkedErrors = convertIntegrationFnToClass(INTEGRATION_NAME, nativeLinkedErrorsIntegration);
29
+ function preprocessEvent(event, hint, client, limit, key) {
30
+ if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) {
31
+ return;
21
32
  }
22
- /**
23
- * @inheritDoc
24
- */
25
- setupOnce(_addGlobalEventProcessor, _getCurrentHub) {
26
- /* noop */
33
+ const parser = client.getOptions().stackParser;
34
+ const { exceptions: linkedErrors, debugImages } = walkErrorTree(parser, limit, hint.originalException, key);
35
+ event.exception.values = [...event.exception.values, ...linkedErrors];
36
+ event.debug_meta = event.debug_meta || {};
37
+ event.debug_meta.images = event.debug_meta.images || [];
38
+ event.debug_meta.images.push(...(debugImages || []));
39
+ }
40
+ /**
41
+ * Walks linked errors and created Sentry exceptions chain.
42
+ * Collects debug images from native errors stack frames.
43
+ */
44
+ function walkErrorTree(parser, limit, error, key, exceptions = [], debugImages = []) {
45
+ const linkedError = error[key];
46
+ if (!linkedError || exceptions.length + 1 >= limit) {
47
+ return {
48
+ exceptions,
49
+ debugImages,
50
+ };
27
51
  }
28
- /**
29
- * @inheritDoc
30
- */
31
- preprocessEvent(event, hint, client) {
32
- if (this._nativePackage === null) {
33
- this._nativePackage = this._fetchNativePackage();
34
- }
35
- this._handler(client.getOptions().stackParser, this._key, this._limit, event, hint);
52
+ let exception;
53
+ let exceptionDebugImages;
54
+ if ('stackElements' in linkedError) {
55
+ // isJavaException
56
+ exception = exceptionFromJavaStackElements(linkedError);
36
57
  }
37
- /**
38
- * Enriches passed event with linked exceptions and native debug meta images.
39
- */
40
- _handler(parser, key, limit, event, hint) {
41
- if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) {
42
- return;
43
- }
44
- const { exceptions: linkedErrors, debugImages } = this._walkErrorTree(parser, limit, hint.originalException, key);
45
- event.exception.values = [...event.exception.values, ...linkedErrors];
46
- event.debug_meta = event.debug_meta || {};
47
- event.debug_meta.images = event.debug_meta.images || [];
48
- event.debug_meta.images.push(...(debugImages || []));
58
+ else if ('stackReturnAddresses' in linkedError) {
59
+ // isObjCException
60
+ const { appleException, appleDebugImages } = exceptionFromAppleStackReturnAddresses(linkedError);
61
+ exception = appleException;
62
+ exceptionDebugImages = appleDebugImages;
49
63
  }
50
- /**
51
- * Walks linked errors and created Sentry exceptions chain.
52
- * Collects debug images from native errors stack frames.
53
- */
54
- _walkErrorTree(parser, limit, error, key, exceptions = [], debugImages = []) {
55
- const linkedError = error[key];
56
- if (!linkedError || exceptions.length + 1 >= limit) {
57
- return {
58
- exceptions,
59
- debugImages,
60
- };
61
- }
62
- let exception;
63
- let exceptionDebugImages;
64
- if ('stackElements' in linkedError) {
65
- // isJavaException
66
- exception = this._exceptionFromJavaStackElements(linkedError);
67
- }
68
- else if ('stackReturnAddresses' in linkedError) {
69
- // isObjCException
70
- const { appleException, appleDebugImages } = this._exceptionFromAppleStackReturnAddresses(linkedError);
71
- exception = appleException;
72
- exceptionDebugImages = appleDebugImages;
73
- }
74
- else if (isInstanceOf(linkedError, Error)) {
75
- exception = exceptionFromError(parser, error[key]);
76
- }
77
- else if (isPlainObject(linkedError)) {
78
- exception = {
79
- type: typeof linkedError.name === 'string' ? linkedError.name : undefined,
80
- value: typeof linkedError.message === 'string' ? linkedError.message : undefined,
81
- };
82
- }
83
- else {
84
- return {
85
- exceptions,
86
- debugImages,
87
- };
88
- }
89
- return this._walkErrorTree(parser, limit, linkedError, key, [...exceptions, exception], [...debugImages, ...(exceptionDebugImages || [])]);
64
+ else if (isInstanceOf(linkedError, Error)) {
65
+ exception = exceptionFromError(parser, error[key]);
90
66
  }
91
- /**
92
- * Converts a Java Throwable to an SentryException
93
- */
94
- _exceptionFromJavaStackElements(javaThrowable) {
95
- return {
96
- type: javaThrowable.name,
97
- value: javaThrowable.message,
98
- stacktrace: {
99
- frames: javaThrowable.stackElements
100
- .map(stackElement => ({
101
- platform: 'java',
102
- module: stackElement.className,
103
- filename: stackElement.fileName,
104
- lineno: stackElement.lineNumber >= 0 ? stackElement.lineNumber : undefined,
105
- function: stackElement.methodName,
106
- in_app: this._nativePackage !== null && stackElement.className.startsWith(this._nativePackage)
107
- ? true
108
- : undefined,
109
- }))
110
- .reverse(),
111
- },
67
+ else if (isPlainObject(linkedError)) {
68
+ exception = {
69
+ type: typeof linkedError.name === 'string' ? linkedError.name : undefined,
70
+ value: typeof linkedError.message === 'string' ? linkedError.message : undefined,
112
71
  };
113
72
  }
114
- /**
115
- * Converts StackAddresses to a SentryException with DebugMetaImages
116
- */
117
- _exceptionFromAppleStackReturnAddresses(objCException) {
118
- const nativeStackFrames = this._fetchNativeStackFrames(objCException.stackReturnAddresses);
73
+ else {
119
74
  return {
120
- appleException: {
121
- type: objCException.name,
122
- value: objCException.message,
123
- stacktrace: {
124
- frames: (nativeStackFrames && nativeStackFrames.frames.reverse()) || [],
125
- },
126
- },
127
- appleDebugImages: (nativeStackFrames && nativeStackFrames.debugMetaImages) || [],
75
+ exceptions,
76
+ debugImages,
128
77
  };
129
78
  }
130
- /**
131
- * Fetches the native package/image name from the native layer
132
- */
133
- _fetchNativePackage() {
134
- return NATIVE.fetchNativePackageName();
135
- }
136
- /**
137
- * Fetches native debug image information on iOS
138
- */
139
- _fetchNativeStackFrames(instructionsAddr) {
140
- return NATIVE.fetchNativeStackFramesBy(instructionsAddr);
79
+ return walkErrorTree(parser, limit, linkedError, key, [...exceptions, exception], [...debugImages, ...(exceptionDebugImages || [])]);
80
+ }
81
+ /**
82
+ * Converts a Java Throwable to an SentryException
83
+ */
84
+ function exceptionFromJavaStackElements(javaThrowable) {
85
+ const nativePackage = fetchNativePackage();
86
+ return {
87
+ type: javaThrowable.name,
88
+ value: javaThrowable.message,
89
+ stacktrace: {
90
+ frames: javaThrowable.stackElements
91
+ .map(stackElement => ({
92
+ platform: 'java',
93
+ module: stackElement.className,
94
+ filename: stackElement.fileName,
95
+ lineno: stackElement.lineNumber >= 0 ? stackElement.lineNumber : undefined,
96
+ function: stackElement.methodName,
97
+ in_app: nativePackage !== null && stackElement.className.startsWith(nativePackage) ? true : undefined,
98
+ }))
99
+ .reverse(),
100
+ },
101
+ };
102
+ }
103
+ /**
104
+ * Converts StackAddresses to a SentryException with DebugMetaImages
105
+ */
106
+ function exceptionFromAppleStackReturnAddresses(objCException) {
107
+ const nativeStackFrames = fetchNativeStackFrames(objCException.stackReturnAddresses);
108
+ return {
109
+ appleException: {
110
+ type: objCException.name,
111
+ value: objCException.message,
112
+ stacktrace: {
113
+ frames: (nativeStackFrames && nativeStackFrames.frames.reverse()) || [],
114
+ },
115
+ },
116
+ appleDebugImages: (nativeStackFrames && nativeStackFrames.debugMetaImages) || [],
117
+ };
118
+ }
119
+ let nativePackage = null;
120
+ /**
121
+ * Fetches the native package/image name from the native layer
122
+ */
123
+ function fetchNativePackage() {
124
+ if (nativePackage === null) {
125
+ nativePackage = NATIVE.fetchNativePackageName();
141
126
  }
127
+ return nativePackage;
142
128
  }
143
129
  /**
144
- * @inheritDoc
130
+ * Fetches native debug image information on iOS
145
131
  */
146
- NativeLinkedErrors.id = 'NativeLinkedErrors';
132
+ function fetchNativeStackFrames(instructionsAddr) {
133
+ return NATIVE.fetchNativeStackFramesBy(instructionsAddr);
134
+ }
147
135
  //# sourceMappingURL=nativelinkederrors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nativelinkederrors.js","sourceRoot":"","sources":["../../../src/js/integrations/nativelinkederrors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAcrD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAG5D,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,WAAW,GAAG,OAAO,CAAC;AAC5B,MAAM,aAAa,GAAG,CAAC,CAAC;AAOxB;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAe7B;;OAEG;IACH,YAAmB,UAAwC,EAAE;QAZ7D;;WAEG;QACI,SAAI,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Ac,EAAE;gBACd,IAAI,EAAE,aAAa,CAAC,IAAI;gBACxB,KAAK,EAAE,aAAa,CAAC,OAAO;gBAC5B,UAAU,EAAE;oBACV,MAAM,EAAE,CAAC,iBAAiB,IAAI,iBAAiB,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE;iBACxE;aACF;YACD,gBAAgB,EAAE,CAAC,iBAAiB,IAAK,iBAAiB,CAAC,eAAgC,CAAC,IAAI,EAAE;SACnG,CAAC;IACJ,CAAC;IAED;;OAEG;IACK,mBAAmB;QACzB,OAAO,MAAM,CAAC,sBAAsB,EAAE,CAAC;IACzC,CAAC;IAED;;OAEG;IACK,uBAAuB,CAAC,gBAA0B;QACxD,OAAO,MAAM,CAAC,wBAAwB,CAAC,gBAAgB,CAAC,CAAC;IAC3D,CAAC;;AA/LD;;GAEG;AACW,qBAAE,GAAW,oBAAoB,CAAC","sourcesContent":["import { exceptionFromError } from '@sentry/browser';\nimport type {\n Client,\n DebugImage,\n Event,\n EventHint,\n EventProcessor,\n Exception,\n ExtendedError,\n Hub,\n Integration,\n StackFrame,\n StackParser,\n} from '@sentry/types';\nimport { isInstanceOf, isPlainObject } from '@sentry/utils';\n\nimport type { NativeStackFrames } from '../NativeRNSentry';\nimport { NATIVE } from '../wrapper';\n\nconst DEFAULT_KEY = 'cause';\nconst DEFAULT_LIMIT = 5;\n\ninterface LinkedErrorsOptions {\n key: string;\n limit: number;\n}\n\n/**\n * Processes JS and RN native linked errors.\n */\nexport class NativeLinkedErrors implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'NativeLinkedErrors';\n\n /**\n * @inheritDoc\n */\n public name: string = NativeLinkedErrors.id;\n\n private readonly _key: LinkedErrorsOptions['key'];\n private readonly _limit: LinkedErrorsOptions['limit'];\n private _nativePackage: string | null = null;\n\n /**\n * @inheritDoc\n */\n public constructor(options: Partial<LinkedErrorsOptions> = {}) {\n this._key = options.key || DEFAULT_KEY;\n this._limit = options.limit || DEFAULT_LIMIT;\n }\n\n /**\n * @inheritDoc\n */\n public setupOnce(_addGlobalEventProcessor: (callback: EventProcessor) => void, _getCurrentHub: () => Hub): void {\n /* noop */\n }\n\n /**\n * @inheritDoc\n */\n public preprocessEvent(event: Event, hint: EventHint | undefined, client: Client): void {\n if (this._nativePackage === null) {\n this._nativePackage = this._fetchNativePackage();\n }\n\n this._handler(client.getOptions().stackParser, this._key, this._limit, event, hint);\n }\n\n /**\n * Enriches passed event with linked exceptions and native debug meta images.\n */\n private _handler(parser: StackParser, key: string, limit: number, event: Event, hint?: EventHint): void {\n if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) {\n return;\n }\n const { exceptions: linkedErrors, debugImages } = this._walkErrorTree(\n parser,\n limit,\n hint.originalException as ExtendedError,\n key,\n );\n event.exception.values = [...event.exception.values, ...linkedErrors];\n\n event.debug_meta = event.debug_meta || {};\n event.debug_meta.images = event.debug_meta.images || [];\n event.debug_meta.images.push(...(debugImages || []));\n }\n\n /**\n * Walks linked errors and created Sentry exceptions chain.\n * Collects debug images from native errors stack frames.\n */\n private _walkErrorTree(\n parser: StackParser,\n limit: number,\n error: ExtendedError,\n key: string,\n exceptions: Exception[] = [],\n debugImages: DebugImage[] = [],\n ): {\n exceptions: Exception[];\n debugImages?: DebugImage[];\n } {\n const linkedError = error[key];\n if (!linkedError || exceptions.length + 1 >= limit) {\n return {\n exceptions,\n debugImages,\n };\n }\n\n let exception: Exception;\n let exceptionDebugImages: DebugImage[] | undefined;\n if ('stackElements' in linkedError) {\n // isJavaException\n exception = this._exceptionFromJavaStackElements(linkedError);\n } else if ('stackReturnAddresses' in linkedError) {\n // isObjCException\n const { appleException, appleDebugImages } = this._exceptionFromAppleStackReturnAddresses(linkedError);\n exception = appleException;\n exceptionDebugImages = appleDebugImages;\n } else if (isInstanceOf(linkedError, Error)) {\n exception = exceptionFromError(parser, error[key]);\n } else if (isPlainObject(linkedError)) {\n exception = {\n type: typeof linkedError.name === 'string' ? linkedError.name : undefined,\n value: typeof linkedError.message === 'string' ? linkedError.message : undefined,\n };\n } else {\n return {\n exceptions,\n debugImages,\n };\n }\n\n return this._walkErrorTree(\n parser,\n limit,\n linkedError,\n key,\n [...exceptions, exception],\n [...debugImages, ...(exceptionDebugImages || [])],\n );\n }\n\n /**\n * Converts a Java Throwable to an SentryException\n */\n private _exceptionFromJavaStackElements(javaThrowable: {\n name: string;\n message: string;\n stackElements: {\n className: string;\n fileName: string;\n methodName: string;\n lineNumber: number;\n }[];\n }): Exception {\n return {\n type: javaThrowable.name,\n value: javaThrowable.message,\n stacktrace: {\n frames: javaThrowable.stackElements\n .map(\n stackElement =>\n <StackFrame>{\n platform: 'java',\n module: stackElement.className,\n filename: stackElement.fileName,\n lineno: stackElement.lineNumber >= 0 ? stackElement.lineNumber : undefined,\n function: stackElement.methodName,\n in_app:\n this._nativePackage !== null && stackElement.className.startsWith(this._nativePackage)\n ? true\n : undefined,\n },\n )\n .reverse(),\n },\n };\n }\n\n /**\n * Converts StackAddresses to a SentryException with DebugMetaImages\n */\n private _exceptionFromAppleStackReturnAddresses(objCException: {\n name: string;\n message: string;\n stackReturnAddresses: number[];\n }): {\n appleException: Exception;\n appleDebugImages: DebugImage[];\n } {\n const nativeStackFrames = this._fetchNativeStackFrames(objCException.stackReturnAddresses);\n\n return {\n appleException: {\n type: objCException.name,\n value: objCException.message,\n stacktrace: {\n frames: (nativeStackFrames && nativeStackFrames.frames.reverse()) || [],\n },\n },\n appleDebugImages: (nativeStackFrames && (nativeStackFrames.debugMetaImages as DebugImage[])) || [],\n };\n }\n\n /**\n * Fetches the native package/image name from the native layer\n */\n private _fetchNativePackage(): string | null {\n return NATIVE.fetchNativePackageName();\n }\n\n /**\n * Fetches native debug image information on iOS\n */\n private _fetchNativeStackFrames(instructionsAddr: number[]): NativeStackFrames | null {\n return NATIVE.fetchNativeStackFramesBy(instructionsAddr);\n }\n}\n"]}
1
+ {"version":3,"file":"nativelinkederrors.js","sourceRoot":"","sources":["../../../src/js/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Y,CAAC,UAAU;gBACjC,MAAM,EAAE,aAAa,KAAK,IAAI,IAAI,YAAY,CAAC,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;aACtG,CAAA,CACJ;iBACA,OAAO,EAAE;SACb;KACF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,sCAAsC,CAAC,aAI/C;IAIC,MAAM,iBAAiB,GAAG,sBAAsB,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAAC;IAErF,OAAO;QACL,cAAc,EAAE;YACd,IAAI,EAAE,aAAa,CAAC,IAAI;YACxB,KAAK,EAAE,aAAa,CAAC,OAAO;YAC5B,UAAU,EAAE;gBACV,MAAM,EAAE,CAAC,iBAAiB,IAAI,iBAAiB,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE;aACxE;SACF;QACD,gBAAgB,EAAE,CAAC,iBAAiB,IAAK,iBAAiB,CAAC,eAAgC,CAAC,IAAI,EAAE;KACnG,CAAC;AACJ,CAAC;AAED,IAAI,aAAa,GAAkB,IAAI,CAAC;AACxC;;GAEG;AACH,SAAS,kBAAkB;IACzB,IAAI,aAAa,KAAK,IAAI,EAAE;QAC1B,aAAa,GAAG,MAAM,CAAC,sBAAsB,EAAE,CAAC;KACjD;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAED;;GAEG;AACH,SAAS,sBAAsB,CAAC,gBAA0B;IACxD,OAAO,MAAM,CAAC,wBAAwB,CAAC,gBAAgB,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["import { exceptionFromError } from '@sentry/browser';\nimport { convertIntegrationFnToClass } from '@sentry/core';\nimport type {\n Client,\n DebugImage,\n Event,\n EventHint,\n Exception,\n ExtendedError,\n Integration,\n IntegrationClass,\n IntegrationFnResult,\n StackFrame,\n StackParser,\n} from '@sentry/types';\nimport { isInstanceOf, isPlainObject } from '@sentry/utils';\n\nimport type { NativeStackFrames } from '../NativeRNSentry';\nimport { NATIVE } from '../wrapper';\n\nconst INTEGRATION_NAME = 'NativeLinkedErrors';\n\nconst DEFAULT_KEY = 'cause';\nconst DEFAULT_LIMIT = 5;\n\ninterface LinkedErrorsOptions {\n key: string;\n limit: number;\n}\n\n/**\n * Processes JS and RN native linked errors.\n */\nexport const nativeLinkedErrorsIntegration = (options: Partial<LinkedErrorsOptions> = {}): IntegrationFnResult => {\n const key = options.key || DEFAULT_KEY;\n const limit = options.limit || DEFAULT_LIMIT;\n\n return {\n name: INTEGRATION_NAME,\n setupOnce: (): void => {\n // noop\n },\n preprocessEvent: (event: Event, hint: EventHint, client: Client): void =>\n preprocessEvent(event, hint, client, limit, key),\n };\n};\n\n/**\n * Processes JS and RN native linked errors.\n *\n * @deprecated Use `nativeLinkedErrorsIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const NativeLinkedErrors = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n nativeLinkedErrorsIntegration,\n) as IntegrationClass<Integration> & {\n new (options?: Partial<LinkedErrorsOptions>): Integration;\n};\n\nfunction preprocessEvent(event: Event, hint: EventHint | undefined, client: Client, limit: number, key: string): void {\n if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) {\n return;\n }\n\n const parser = client.getOptions().stackParser;\n\n const { exceptions: linkedErrors, debugImages } = walkErrorTree(\n parser,\n limit,\n hint.originalException as ExtendedError,\n key,\n );\n event.exception.values = [...event.exception.values, ...linkedErrors];\n\n event.debug_meta = event.debug_meta || {};\n event.debug_meta.images = event.debug_meta.images || [];\n event.debug_meta.images.push(...(debugImages || []));\n}\n\n/**\n * Walks linked errors and created Sentry exceptions chain.\n * Collects debug images from native errors stack frames.\n */\nfunction walkErrorTree(\n parser: StackParser,\n limit: number,\n error: ExtendedError,\n key: string,\n exceptions: Exception[] = [],\n debugImages: DebugImage[] = [],\n): {\n exceptions: Exception[];\n debugImages?: DebugImage[];\n} {\n const linkedError = error[key];\n if (!linkedError || exceptions.length + 1 >= limit) {\n return {\n exceptions,\n debugImages,\n };\n }\n\n let exception: Exception;\n let exceptionDebugImages: DebugImage[] | undefined;\n if ('stackElements' in linkedError) {\n // isJavaException\n exception = exceptionFromJavaStackElements(linkedError);\n } else if ('stackReturnAddresses' in linkedError) {\n // isObjCException\n const { appleException, appleDebugImages } = exceptionFromAppleStackReturnAddresses(linkedError);\n exception = appleException;\n exceptionDebugImages = appleDebugImages;\n } else if (isInstanceOf(linkedError, Error)) {\n exception = exceptionFromError(parser, error[key]);\n } else if (isPlainObject(linkedError)) {\n exception = {\n type: typeof linkedError.name === 'string' ? linkedError.name : undefined,\n value: typeof linkedError.message === 'string' ? linkedError.message : undefined,\n };\n } else {\n return {\n exceptions,\n debugImages,\n };\n }\n\n return walkErrorTree(\n parser,\n limit,\n linkedError,\n key,\n [...exceptions, exception],\n [...debugImages, ...(exceptionDebugImages || [])],\n );\n}\n\n/**\n * Converts a Java Throwable to an SentryException\n */\nfunction exceptionFromJavaStackElements(javaThrowable: {\n name: string;\n message: string;\n stackElements: {\n className: string;\n fileName: string;\n methodName: string;\n lineNumber: number;\n }[];\n}): Exception {\n const nativePackage = fetchNativePackage();\n return {\n type: javaThrowable.name,\n value: javaThrowable.message,\n stacktrace: {\n frames: javaThrowable.stackElements\n .map(\n stackElement =>\n <StackFrame>{\n platform: 'java',\n module: stackElement.className,\n filename: stackElement.fileName,\n lineno: stackElement.lineNumber >= 0 ? stackElement.lineNumber : undefined,\n function: stackElement.methodName,\n in_app: nativePackage !== null && stackElement.className.startsWith(nativePackage) ? true : undefined,\n },\n )\n .reverse(),\n },\n };\n}\n\n/**\n * Converts StackAddresses to a SentryException with DebugMetaImages\n */\nfunction exceptionFromAppleStackReturnAddresses(objCException: {\n name: string;\n message: string;\n stackReturnAddresses: number[];\n}): {\n appleException: Exception;\n appleDebugImages: DebugImage[];\n} {\n const nativeStackFrames = fetchNativeStackFrames(objCException.stackReturnAddresses);\n\n return {\n appleException: {\n type: objCException.name,\n value: objCException.message,\n stacktrace: {\n frames: (nativeStackFrames && nativeStackFrames.frames.reverse()) || [],\n },\n },\n appleDebugImages: (nativeStackFrames && (nativeStackFrames.debugMetaImages as DebugImage[])) || [],\n };\n}\n\nlet nativePackage: string | null = null;\n/**\n * Fetches the native package/image name from the native layer\n */\nfunction fetchNativePackage(): string | null {\n if (nativePackage === null) {\n nativePackage = NATIVE.fetchNativePackageName();\n }\n return nativePackage;\n}\n\n/**\n * Fetches native debug image information on iOS\n */\nfunction fetchNativeStackFrames(instructionsAddr: number[]): NativeStackFrames | null {\n return NATIVE.fetchNativeStackFramesBy(instructionsAddr);\n}\n"]}