@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
@@ -1,24 +1,7 @@
1
- /* eslint-disable complexity */
2
- import { HttpClient } from '@sentry/integrations';
3
- import { Integrations as BrowserReactIntegrations, replayIntegration as browserReplayIntegration } from '@sentry/react';
4
- import { HermesProfiling } from '../profiling/integration';
5
1
  import { ReactNativeTracing } from '../tracing';
6
2
  import { isExpoGo, notWeb } from '../utils/environment';
7
- import { DebugSymbolicator } from './debugsymbolicator';
8
- import { DeviceContext } from './devicecontext';
9
- import { EventOrigin } from './eventorigin';
10
- import { ExpoContext } from './expocontext';
11
- import { mobileReplayIntegration } from './mobilereplay';
12
- import { ModulesLoader } from './modulesloader';
13
- import { NativeLinkedErrors } from './nativelinkederrors';
14
- import { ReactNativeErrorHandlers } from './reactnativeerrorhandlers';
15
- import { ReactNativeInfo } from './reactnativeinfo';
16
- import { Release } from './release';
3
+ import { breadcrumbsIntegration, browserApiErrorsIntegration, browserGlobalHandlersIntegration, browserLinkedErrorsIntegration, debugSymbolicatorIntegration, dedupeIntegration, deviceContextIntegration, eventOriginIntegration, expoContextIntegration, functionToStringIntegration, hermesProfilingIntegration, httpClientIntegration, httpContextIntegration, inboundFiltersIntegration, modulesLoaderIntegration, nativeLinkedErrorsIntegration, nativeReleaseIntegration, reactNativeErrorHandlersIntegration, reactNativeInfoIntegration, screenshotIntegration, sdkInfoIntegration, spotlightIntegration, viewHierarchyIntegration, } from './exports';
17
4
  import { createReactNativeRewriteFrames } from './rewriteframes';
18
- import { Screenshot } from './screenshot';
19
- import { SdkInfo } from './sdkinfo';
20
- import { Spotlight } from './spotlight';
21
- import { ViewHierarchy } from './viewhierarchy';
22
5
  /**
23
6
  * Returns the default ReactNative integrations based on the current environment.
24
7
  *
@@ -29,42 +12,42 @@ import { ViewHierarchy } from './viewhierarchy';
29
12
  export function getDefaultIntegrations(options) {
30
13
  const integrations = [];
31
14
  if (notWeb()) {
32
- integrations.push(new ReactNativeErrorHandlers({
15
+ integrations.push(reactNativeErrorHandlersIntegration({
33
16
  patchGlobalPromise: options.patchGlobalPromise,
34
17
  }));
35
- integrations.push(new NativeLinkedErrors());
18
+ integrations.push(nativeLinkedErrorsIntegration());
36
19
  }
37
20
  else {
38
- integrations.push(new BrowserReactIntegrations.TryCatch());
39
- integrations.push(new BrowserReactIntegrations.GlobalHandlers());
40
- integrations.push(new BrowserReactIntegrations.LinkedErrors());
21
+ integrations.push(browserApiErrorsIntegration());
22
+ integrations.push(browserGlobalHandlersIntegration());
23
+ integrations.push(browserLinkedErrorsIntegration());
41
24
  }
42
25
  // @sentry/react default integrations
43
- integrations.push(new BrowserReactIntegrations.InboundFilters());
44
- integrations.push(new BrowserReactIntegrations.FunctionToString());
45
- integrations.push(new BrowserReactIntegrations.Breadcrumbs());
46
- integrations.push(new BrowserReactIntegrations.Dedupe());
47
- integrations.push(new BrowserReactIntegrations.HttpContext());
26
+ integrations.push(inboundFiltersIntegration());
27
+ integrations.push(functionToStringIntegration());
28
+ integrations.push(breadcrumbsIntegration());
29
+ integrations.push(dedupeIntegration());
30
+ integrations.push(httpContextIntegration());
48
31
  // end @sentry/react-native default integrations
49
- integrations.push(new Release());
50
- integrations.push(new EventOrigin());
51
- integrations.push(new SdkInfo());
52
- integrations.push(new ReactNativeInfo());
32
+ integrations.push(nativeReleaseIntegration());
33
+ integrations.push(eventOriginIntegration());
34
+ integrations.push(sdkInfoIntegration());
35
+ integrations.push(reactNativeInfoIntegration());
53
36
  if (__DEV__ && notWeb()) {
54
- integrations.push(new DebugSymbolicator());
37
+ integrations.push(debugSymbolicatorIntegration());
55
38
  }
56
39
  integrations.push(createReactNativeRewriteFrames());
57
40
  if (options.enableNative) {
58
- integrations.push(new DeviceContext());
59
- integrations.push(new ModulesLoader());
41
+ integrations.push(deviceContextIntegration());
42
+ integrations.push(modulesLoaderIntegration());
60
43
  if (options.attachScreenshot) {
61
- integrations.push(new Screenshot());
44
+ integrations.push(screenshotIntegration());
62
45
  }
63
46
  if (options.attachViewHierarchy) {
64
- integrations.push(new ViewHierarchy());
47
+ integrations.push(viewHierarchyIntegration());
65
48
  }
66
49
  if (options._experiments && typeof options._experiments.profilesSampleRate === 'number') {
67
- integrations.push(new HermesProfiling());
50
+ integrations.push(hermesProfilingIntegration());
68
51
  }
69
52
  }
70
53
  // hasTracingEnabled from `@sentry/core` only check if tracesSampler or tracesSampleRate keys are present
@@ -77,24 +60,16 @@ export function getDefaultIntegrations(options) {
77
60
  integrations.push(new ReactNativeTracing());
78
61
  }
79
62
  if (options.enableCaptureFailedRequests) {
80
- integrations.push(new HttpClient());
63
+ integrations.push(httpClientIntegration());
81
64
  }
82
65
  if (isExpoGo()) {
83
- integrations.push(new ExpoContext());
66
+ integrations.push(expoContextIntegration());
84
67
  }
85
68
  if (options.enableSpotlight) {
86
- integrations.push(Spotlight({
69
+ integrations.push(spotlightIntegration({
87
70
  sidecarUrl: options.spotlightSidecarUrl,
88
71
  }));
89
72
  }
90
- if ((options._experiments && typeof options._experiments.replaysOnErrorSampleRate === 'number') ||
91
- (options._experiments && typeof options._experiments.replaysSessionSampleRate === 'number')) {
92
- integrations.push(notWeb() ? mobileReplayIntegration() : browserReplayIntegration());
93
- if (!notWeb()) {
94
- options.replaysOnErrorSampleRate = options._experiments.replaysOnErrorSampleRate;
95
- options.replaysSessionSampleRate = options._experiments.replaysSessionSampleRate;
96
- }
97
- }
98
73
  return integrations;
99
74
  }
100
75
  //# sourceMappingURL=default.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"default.js","sourceRoot":"","sources":["../../../src/js/integrations/default.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,YAAY,IAAI,wBAAwB,EAAE,iBAAiB,IAAI,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAIxH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,aAAa,E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QACrB,OAAO,OAAO,CAAC,gBAAgB,KAAK,QAAQ;QAC5C,OAAO,OAAO,CAAC,aAAa,KAAK,UAAU,CAAC;IAC9C,IAAI,iBAAiB,IAAI,OAAO,CAAC,4BAA4B,EAAE;QAC7D,YAAY,CAAC,IAAI,CAAC,IAAI,kBAAkB,EAAE,CAAC,CAAC;KAC7C;IACD,IAAI,OAAO,CAAC,2BAA2B,EAAE;QACvC,YAAY,CAAC,IAAI,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC;KACrC;IAED,IAAI,QAAQ,EAAE,EAAE;QACd,YAAY,CAAC,IAAI,CAAC,IAAI,WAAW,EAAE,CAAC,CAAC;KACtC;IAED,IAAI,OAAO,CAAC,eAAe,EAAE;QAC3B,YAAY,CAAC,IAAI,CACf,SAAS,CAAC;YACR,UAAU,EAAE,OAAO,CAAC,mBAAmB;SACxC,CAAC,CACH,CAAC;KACH;IAED,IACE,CAAC,OAAO,CAAC,YAAY,IAAI,OAAO,OAAO,CAAC,YAAY,CAAC,wBAAwB,KAAK,QAAQ,CAAC;QAC3F,CAAC,OAAO,CAAC,YAAY,IAAI,OAAO,OAAO,CAAC,YAAY,CAAC,wBAAwB,KAAK,QAAQ,CAAC,EAC3F;QACA,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,uBAAuB,EAAE,CAAC,CAAC,CAAC,wBAAwB,EAAE,CAAC,CAAC;QACrF,IAAI,CAAC,MAAM,EAAE,EAAE;YACZ,OAA0B,CAAC,wBAAwB,GAAG,OAAO,CAAC,YAAY,CAAC,wBAAwB,CAAC;YACpG,OAA0B,CAAC,wBAAwB,GAAG,OAAO,CAAC,YAAY,CAAC,wBAAwB,CAAC;SACtG;KACF;IAED,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["/* eslint-disable complexity */\nimport { HttpClient } from '@sentry/integrations';\nimport type { BrowserOptions } from '@sentry/react';\nimport { Integrations as BrowserReactIntegrations, replayIntegration as browserReplayIntegration } from '@sentry/react';\nimport type { Integration } from '@sentry/types';\n\nimport type { ReactNativeClientOptions } from '../options';\nimport { HermesProfiling } from '../profiling/integration';\nimport { ReactNativeTracing } from '../tracing';\nimport { isExpoGo, notWeb } from '../utils/environment';\nimport { DebugSymbolicator } from './debugsymbolicator';\nimport { DeviceContext } from './devicecontext';\nimport { EventOrigin } from './eventorigin';\nimport { ExpoContext } from './expocontext';\nimport { mobileReplayIntegration } from './mobilereplay';\nimport { ModulesLoader } from './modulesloader';\nimport { NativeLinkedErrors } from './nativelinkederrors';\nimport { ReactNativeErrorHandlers } from './reactnativeerrorhandlers';\nimport { ReactNativeInfo } from './reactnativeinfo';\nimport { Release } from './release';\nimport { createReactNativeRewriteFrames } from './rewriteframes';\nimport { Screenshot } from './screenshot';\nimport { SdkInfo } from './sdkinfo';\nimport { Spotlight } from './spotlight';\nimport { ViewHierarchy } from './viewhierarchy';\n\n/**\n * Returns the default ReactNative integrations based on the current environment.\n *\n * Native integrations are only returned when native is enabled.\n *\n * Web integrations are only returned when running on web.\n */\nexport function getDefaultIntegrations(options: ReactNativeClientOptions): Integration[] {\n const integrations: Integration[] = [];\n\n if (notWeb()) {\n integrations.push(\n new ReactNativeErrorHandlers({\n patchGlobalPromise: options.patchGlobalPromise,\n }),\n );\n integrations.push(new NativeLinkedErrors());\n } else {\n integrations.push(new BrowserReactIntegrations.TryCatch());\n integrations.push(new BrowserReactIntegrations.GlobalHandlers());\n integrations.push(new BrowserReactIntegrations.LinkedErrors());\n }\n\n // @sentry/react default integrations\n integrations.push(new BrowserReactIntegrations.InboundFilters());\n integrations.push(new BrowserReactIntegrations.FunctionToString());\n integrations.push(new BrowserReactIntegrations.Breadcrumbs());\n integrations.push(new BrowserReactIntegrations.Dedupe());\n integrations.push(new BrowserReactIntegrations.HttpContext());\n // end @sentry/react-native default integrations\n\n integrations.push(new Release());\n integrations.push(new EventOrigin());\n integrations.push(new SdkInfo());\n integrations.push(new ReactNativeInfo());\n\n if (__DEV__ && notWeb()) {\n integrations.push(new DebugSymbolicator());\n }\n\n integrations.push(createReactNativeRewriteFrames());\n\n if (options.enableNative) {\n integrations.push(new DeviceContext());\n integrations.push(new ModulesLoader());\n if (options.attachScreenshot) {\n integrations.push(new Screenshot());\n }\n if (options.attachViewHierarchy) {\n integrations.push(new ViewHierarchy());\n }\n if (options._experiments && typeof options._experiments.profilesSampleRate === 'number') {\n integrations.push(new HermesProfiling());\n }\n }\n\n // hasTracingEnabled from `@sentry/core` only check if tracesSampler or tracesSampleRate keys are present\n // that's different from prev imp here and might lead misconfiguration\n // `tracesSampleRate: undefined` should not enable tracing\n const hasTracingEnabled =\n options.enableTracing ||\n typeof options.tracesSampleRate === 'number' ||\n typeof options.tracesSampler === 'function';\n if (hasTracingEnabled && options.enableAutoPerformanceTracing) {\n integrations.push(new ReactNativeTracing());\n }\n if (options.enableCaptureFailedRequests) {\n integrations.push(new HttpClient());\n }\n\n if (isExpoGo()) {\n integrations.push(new ExpoContext());\n }\n\n if (options.enableSpotlight) {\n integrations.push(\n Spotlight({\n sidecarUrl: options.spotlightSidecarUrl,\n }),\n );\n }\n\n if (\n (options._experiments && typeof options._experiments.replaysOnErrorSampleRate === 'number') ||\n (options._experiments && typeof options._experiments.replaysSessionSampleRate === 'number')\n ) {\n integrations.push(notWeb() ? mobileReplayIntegration() : browserReplayIntegration());\n if (!notWeb()) {\n (options as BrowserOptions).replaysOnErrorSampleRate = options._experiments.replaysOnErrorSampleRate;\n (options as BrowserOptions).replaysSessionSampleRate = options._experiments.replaysSessionSampleRate;\n }\n }\n\n return integrations;\n}\n"]}
1
+ {"version":3,"file":"default.js","sourceRoot":"","sources":["../../../src/js/integrations/default.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,gCAAgC,EAChC,8BAA8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AC5C;IAED,IAAI,QAAQ,EAAE,EAAE;QACd,YAAY,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC,CAAC;KAC7C;IAED,IAAI,OAAO,CAAC,eAAe,EAAE;QAC3B,YAAY,CAAC,IAAI,CACf,oBAAoB,CAAC;YACnB,UAAU,EAAE,OAAO,CAAC,mBAAmB;SACxC,CAAC,CACH,CAAC;KACH;IAED,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["import type { Integration } from '@sentry/types';\n\nimport type { ReactNativeClientOptions } from '../options';\nimport { ReactNativeTracing } from '../tracing';\nimport { isExpoGo, notWeb } from '../utils/environment';\nimport {\n breadcrumbsIntegration,\n browserApiErrorsIntegration,\n browserGlobalHandlersIntegration,\n browserLinkedErrorsIntegration,\n debugSymbolicatorIntegration,\n dedupeIntegration,\n deviceContextIntegration,\n eventOriginIntegration,\n expoContextIntegration,\n functionToStringIntegration,\n hermesProfilingIntegration,\n httpClientIntegration,\n httpContextIntegration,\n inboundFiltersIntegration,\n modulesLoaderIntegration,\n nativeLinkedErrorsIntegration,\n nativeReleaseIntegration,\n reactNativeErrorHandlersIntegration,\n reactNativeInfoIntegration,\n screenshotIntegration,\n sdkInfoIntegration,\n spotlightIntegration,\n viewHierarchyIntegration,\n} from './exports';\nimport { createReactNativeRewriteFrames } from './rewriteframes';\n\n/**\n * Returns the default ReactNative integrations based on the current environment.\n *\n * Native integrations are only returned when native is enabled.\n *\n * Web integrations are only returned when running on web.\n */\nexport function getDefaultIntegrations(options: ReactNativeClientOptions): Integration[] {\n const integrations: Integration[] = [];\n\n if (notWeb()) {\n integrations.push(\n reactNativeErrorHandlersIntegration({\n patchGlobalPromise: options.patchGlobalPromise,\n }),\n );\n integrations.push(nativeLinkedErrorsIntegration());\n } else {\n integrations.push(browserApiErrorsIntegration());\n integrations.push(browserGlobalHandlersIntegration());\n integrations.push(browserLinkedErrorsIntegration());\n }\n\n // @sentry/react default integrations\n integrations.push(inboundFiltersIntegration());\n integrations.push(functionToStringIntegration());\n integrations.push(breadcrumbsIntegration());\n integrations.push(dedupeIntegration());\n integrations.push(httpContextIntegration());\n // end @sentry/react-native default integrations\n\n integrations.push(nativeReleaseIntegration());\n integrations.push(eventOriginIntegration());\n integrations.push(sdkInfoIntegration());\n integrations.push(reactNativeInfoIntegration());\n\n if (__DEV__ && notWeb()) {\n integrations.push(debugSymbolicatorIntegration());\n }\n\n integrations.push(createReactNativeRewriteFrames());\n\n if (options.enableNative) {\n integrations.push(deviceContextIntegration());\n integrations.push(modulesLoaderIntegration());\n if (options.attachScreenshot) {\n integrations.push(screenshotIntegration());\n }\n if (options.attachViewHierarchy) {\n integrations.push(viewHierarchyIntegration());\n }\n if (options._experiments && typeof options._experiments.profilesSampleRate === 'number') {\n integrations.push(hermesProfilingIntegration());\n }\n }\n\n // hasTracingEnabled from `@sentry/core` only check if tracesSampler or tracesSampleRate keys are present\n // that's different from prev imp here and might lead misconfiguration\n // `tracesSampleRate: undefined` should not enable tracing\n const hasTracingEnabled =\n options.enableTracing ||\n typeof options.tracesSampleRate === 'number' ||\n typeof options.tracesSampler === 'function';\n if (hasTracingEnabled && options.enableAutoPerformanceTracing) {\n integrations.push(new ReactNativeTracing());\n }\n if (options.enableCaptureFailedRequests) {\n integrations.push(httpClientIntegration());\n }\n\n if (isExpoGo()) {\n integrations.push(expoContextIntegration());\n }\n\n if (options.enableSpotlight) {\n integrations.push(\n spotlightIntegration({\n sidecarUrl: options.spotlightSidecarUrl,\n }),\n );\n }\n\n return integrations;\n}\n"]}
@@ -1,17 +1,10 @@
1
- import type { EventProcessor, Hub, Integration } from '@sentry/types';
1
+ import type { Integration, IntegrationClass, IntegrationFnResult } from '@sentry/types';
2
2
  /** Load device context from native. */
3
- export declare class DeviceContext implements Integration {
4
- /**
5
- * @inheritDoc
6
- */
7
- static id: string;
8
- /**
9
- * @inheritDoc
10
- */
11
- name: string;
12
- /**
13
- * @inheritDoc
14
- */
15
- setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void;
16
- }
3
+ export declare const deviceContextIntegration: () => IntegrationFnResult;
4
+ /**
5
+ * Load device context from native.
6
+ *
7
+ * @deprecated Use `deviceContextIntegration()` instead.
8
+ */
9
+ export declare const DeviceContext: IntegrationClass<Integration>;
17
10
  //# sourceMappingURL=devicecontext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"devicecontext.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/devicecontext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAS,cAAc,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAQ7E,uCAAuC;AACvC,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,QAAQ,EAAE,cAAc,KAAK,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,GAAG,IAAI;CA2E9G"}
1
+ {"version":3,"file":"devicecontext.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/devicecontext.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAS,WAAW,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAU/F,uCAAuC;AACvC,eAAO,MAAM,wBAAwB,QAAO,mBAQ3C,CAAC;AAEF;;;;GAIG;AAEH,eAAO,MAAM,aAAa,+BAGQ,CAAC"}
@@ -1,83 +1,83 @@
1
1
  import { __awaiter } from "tslib";
2
+ /* eslint-disable complexity */
3
+ import { convertIntegrationFnToClass } from '@sentry/core';
2
4
  import { logger, severityLevelFromString } from '@sentry/utils';
3
5
  import { AppState } from 'react-native';
4
6
  import { breadcrumbFromObject } from '../breadcrumb';
5
7
  import { NATIVE } from '../wrapper';
8
+ const INTEGRATION_NAME = 'DeviceContext';
6
9
  /** Load device context from native. */
7
- export class DeviceContext {
8
- constructor() {
9
- /**
10
- * @inheritDoc
11
- */
12
- this.name = DeviceContext.id;
13
- }
14
- /**
15
- * @inheritDoc
16
- */
17
- setupOnce(addGlobalEventProcessor, getCurrentHub) {
18
- addGlobalEventProcessor((event) => __awaiter(this, void 0, void 0, function* () {
19
- var _a;
20
- const self = getCurrentHub().getIntegration(DeviceContext);
21
- if (!self) {
22
- return event;
23
- }
24
- let native = null;
25
- try {
26
- native = yield NATIVE.fetchNativeDeviceContexts();
27
- }
28
- catch (e) {
29
- logger.log(`Failed to get device context from native: ${e}`);
30
- }
31
- if (!native) {
32
- return event;
33
- }
34
- const nativeUser = native.user;
35
- if (!event.user && nativeUser) {
36
- event.user = nativeUser;
37
- }
38
- let nativeContexts = native.contexts;
39
- if (AppState.currentState !== 'unknown') {
40
- nativeContexts = nativeContexts || {};
41
- nativeContexts.app = Object.assign(Object.assign({}, nativeContexts.app), { in_foreground: AppState.currentState === 'active' });
42
- }
43
- if (nativeContexts) {
44
- event.contexts = Object.assign(Object.assign({}, nativeContexts), event.contexts);
45
- if (nativeContexts.app) {
46
- event.contexts.app = Object.assign(Object.assign({}, nativeContexts.app), event.contexts.app);
47
- }
48
- }
49
- const nativeTags = native.tags;
50
- if (nativeTags) {
51
- event.tags = Object.assign(Object.assign({}, nativeTags), event.tags);
52
- }
53
- const nativeExtra = native.extra;
54
- if (nativeExtra) {
55
- event.extra = Object.assign(Object.assign({}, nativeExtra), event.extra);
56
- }
57
- const nativeFingerprint = native.fingerprint;
58
- if (nativeFingerprint) {
59
- event.fingerprint = ((_a = event.fingerprint) !== null && _a !== void 0 ? _a : []).concat(nativeFingerprint.filter(item => { var _a; return ((_a = event.fingerprint) !== null && _a !== void 0 ? _a : []).indexOf(item) < 0; }));
60
- }
61
- const nativeLevel = typeof native['level'] === 'string' ? severityLevelFromString(native['level']) : undefined;
62
- if (!event.level && nativeLevel) {
63
- event.level = nativeLevel;
64
- }
65
- const nativeEnvironment = native['environment'];
66
- if (!event.environment && nativeEnvironment) {
67
- event.environment = nativeEnvironment;
68
- }
69
- const nativeBreadcrumbs = Array.isArray(native['breadcrumbs'])
70
- ? native['breadcrumbs'].map(breadcrumbFromObject)
71
- : undefined;
72
- if (nativeBreadcrumbs) {
73
- event.breadcrumbs = nativeBreadcrumbs;
74
- }
75
- return event;
76
- }));
77
- }
78
- }
10
+ export const deviceContextIntegration = () => {
11
+ return {
12
+ name: INTEGRATION_NAME,
13
+ setupOnce: () => {
14
+ /* noop */
15
+ },
16
+ processEvent,
17
+ };
18
+ };
79
19
  /**
80
- * @inheritDoc
20
+ * Load device context from native.
21
+ *
22
+ * @deprecated Use `deviceContextIntegration()` instead.
81
23
  */
82
- DeviceContext.id = 'DeviceContext';
24
+ // eslint-disable-next-line deprecation/deprecation
25
+ export const DeviceContext = convertIntegrationFnToClass(INTEGRATION_NAME, deviceContextIntegration);
26
+ function processEvent(event) {
27
+ var _a;
28
+ return __awaiter(this, void 0, void 0, function* () {
29
+ let native = null;
30
+ try {
31
+ native = yield NATIVE.fetchNativeDeviceContexts();
32
+ }
33
+ catch (e) {
34
+ logger.log(`Failed to get device context from native: ${e}`);
35
+ }
36
+ if (!native) {
37
+ return event;
38
+ }
39
+ const nativeUser = native.user;
40
+ if (!event.user && nativeUser) {
41
+ event.user = nativeUser;
42
+ }
43
+ let nativeContexts = native.contexts;
44
+ if (AppState.currentState !== 'unknown') {
45
+ nativeContexts = nativeContexts || {};
46
+ nativeContexts.app = Object.assign(Object.assign({}, nativeContexts.app), { in_foreground: AppState.currentState === 'active' });
47
+ }
48
+ if (nativeContexts) {
49
+ event.contexts = Object.assign(Object.assign({}, nativeContexts), event.contexts);
50
+ if (nativeContexts.app) {
51
+ event.contexts.app = Object.assign(Object.assign({}, nativeContexts.app), event.contexts.app);
52
+ }
53
+ }
54
+ const nativeTags = native.tags;
55
+ if (nativeTags) {
56
+ event.tags = Object.assign(Object.assign({}, nativeTags), event.tags);
57
+ }
58
+ const nativeExtra = native.extra;
59
+ if (nativeExtra) {
60
+ event.extra = Object.assign(Object.assign({}, nativeExtra), event.extra);
61
+ }
62
+ const nativeFingerprint = native.fingerprint;
63
+ if (nativeFingerprint) {
64
+ event.fingerprint = ((_a = event.fingerprint) !== null && _a !== void 0 ? _a : []).concat(nativeFingerprint.filter(item => { var _a; return ((_a = event.fingerprint) !== null && _a !== void 0 ? _a : []).indexOf(item) < 0; }));
65
+ }
66
+ const nativeLevel = typeof native['level'] === 'string' ? severityLevelFromString(native['level']) : undefined;
67
+ if (!event.level && nativeLevel) {
68
+ event.level = nativeLevel;
69
+ }
70
+ const nativeEnvironment = native['environment'];
71
+ if (!event.environment && nativeEnvironment) {
72
+ event.environment = nativeEnvironment;
73
+ }
74
+ const nativeBreadcrumbs = Array.isArray(native['breadcrumbs'])
75
+ ? native['breadcrumbs'].map(breadcrumbFromObject)
76
+ : undefined;
77
+ if (nativeBreadcrumbs) {
78
+ event.breadcrumbs = nativeBreadcrumbs;
79
+ }
80
+ return event;
81
+ });
82
+ }
83
83
  //# sourceMappingURL=devicecontext.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"devicecontext.js","sourceRoot":"","sources":["../../../src/js/integrations/devicecontext.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,uCAAuC;AACvC,MAAM,OAAO,aAAa;IAA1B;QAME;;WAEG;QACI,SAAI,GAAW,aAAa,CAAC,EAAE,CAAC;IAgFzC,CAAC;IA9EC;;OAEG;IACI,SAAS,CAAC,uBAA2D,EAAE,aAAwB;QACpG,uBAAuB,CAAC,CAAO,KAAY,EAAE,EAAE;;YAC7C,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC,cAAc,CAAC,aAAa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AAW,eAAe,CAAC","sourcesContent":["/* eslint-disable complexity */\nimport type { Event, EventProcessor, Hub, Integration } from '@sentry/types';\nimport { logger, severityLevelFromString } from '@sentry/utils';\nimport { AppState } from 'react-native';\n\nimport { breadcrumbFromObject } from '../breadcrumb';\nimport type { NativeDeviceContextsResponse } from '../NativeRNSentry';\nimport { NATIVE } from '../wrapper';\n\n/** Load device context from native. */\nexport class DeviceContext implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'DeviceContext';\n\n /**\n * @inheritDoc\n */\n public name: string = DeviceContext.id;\n\n /**\n * @inheritDoc\n */\n public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n addGlobalEventProcessor(async (event: Event) => {\n const self = getCurrentHub().getIntegration(DeviceContext);\n if (!self) {\n return event;\n }\n\n let native: NativeDeviceContextsResponse | null = null;\n try {\n native = await NATIVE.fetchNativeDeviceContexts();\n } catch (e) {\n logger.log(`Failed to get device context from native: ${e}`);\n }\n\n if (!native) {\n return event;\n }\n\n const nativeUser = native.user;\n if (!event.user && nativeUser) {\n event.user = nativeUser;\n }\n\n let nativeContexts = native.contexts;\n if (AppState.currentState !== 'unknown') {\n nativeContexts = nativeContexts || {};\n nativeContexts.app = {\n ...nativeContexts.app,\n in_foreground: AppState.currentState === 'active',\n };\n }\n if (nativeContexts) {\n event.contexts = { ...nativeContexts, ...event.contexts };\n if (nativeContexts.app) {\n event.contexts.app = { ...nativeContexts.app, ...event.contexts.app };\n }\n }\n\n const nativeTags = native.tags;\n if (nativeTags) {\n event.tags = { ...nativeTags, ...event.tags };\n }\n\n const nativeExtra = native.extra;\n if (nativeExtra) {\n event.extra = { ...nativeExtra, ...event.extra };\n }\n\n const nativeFingerprint = native.fingerprint;\n if (nativeFingerprint) {\n event.fingerprint = (event.fingerprint ?? []).concat(\n nativeFingerprint.filter(item => (event.fingerprint ?? []).indexOf(item) < 0),\n );\n }\n\n const nativeLevel = typeof native['level'] === 'string' ? severityLevelFromString(native['level']) : undefined;\n if (!event.level && nativeLevel) {\n event.level = nativeLevel;\n }\n\n const nativeEnvironment = native['environment'];\n if (!event.environment && nativeEnvironment) {\n event.environment = nativeEnvironment;\n }\n\n const nativeBreadcrumbs = Array.isArray(native['breadcrumbs'])\n ? native['breadcrumbs'].map(breadcrumbFromObject)\n : undefined;\n if (nativeBreadcrumbs) {\n event.breadcrumbs = nativeBreadcrumbs;\n }\n\n return event;\n });\n }\n}\n"]}
1
+ {"version":3,"file":"devicecontext.js","sourceRoot":"","sources":["../../../src/js/integrations/devicecontext.ts"],"names":[],"mappings":";AAAA,+BAA+B;AAC/B,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAE,MAAM,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAEzC,uCAAuC;AACvC,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAwB,EAAE;IAChE,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,GAAG,EAAE;YACd,UAAU;QACZ,CAAC;QACD,YAAY;KACb,CAAC;AACJ,CAAC,CAAC;AAEF;;;;GAIG;AACH,mDAAmD;AACnD,MAAM,CAAC,MAAM,aAAa,GAAG,2BAA2B,CACtD,gBAAgB,EAChB,wBAAwB,CACQ,CAAC;AAEnC,SAAe,YAAY,CAAC,KAAY;;;QACtC,IAAI,MAAM,GAAwC,IAAI,CAAC;QACvD,IAAI;YACF,MAAM,GAAG,MAAM,MAAM,CAAC,yBAAyB,EAAE,CAAC;SACnD;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,CAAC,GAAG,CAAC,6CAA6C,CAAC,EAAE,CAAC,CAAC;S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AC,IAAI,CAAC,EAAE,WAAC,OAAA,CAAC,MAAA,KAAK,CAAC,WAAW,mCAAI,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA,EAAA,CAAC,CAC9E,CAAC;SACH;QAED,MAAM,WAAW,GAAG,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,uBAAuB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC/G,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,WAAW,EAAE;YAC/B,KAAK,CAAC,KAAK,GAAG,WAAW,CAAC;SAC3B;QAED,MAAM,iBAAiB,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;QAChD,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,iBAAiB,EAAE;YAC3C,KAAK,CAAC,WAAW,GAAG,iBAAiB,CAAC;SACvC;QAED,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;YAC5D,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,oBAAoB,CAAC;YACjD,CAAC,CAAC,SAAS,CAAC;QACd,IAAI,iBAAiB,EAAE;YACrB,KAAK,CAAC,WAAW,GAAG,iBAAiB,CAAC;SACvC;QAED,OAAO,KAAK,CAAC;;CACd","sourcesContent":["/* eslint-disable complexity */\nimport { convertIntegrationFnToClass } from '@sentry/core';\nimport type { Event, Integration, IntegrationClass, IntegrationFnResult } from '@sentry/types';\nimport { logger, severityLevelFromString } from '@sentry/utils';\nimport { AppState } from 'react-native';\n\nimport { breadcrumbFromObject } from '../breadcrumb';\nimport type { NativeDeviceContextsResponse } from '../NativeRNSentry';\nimport { NATIVE } from '../wrapper';\n\nconst INTEGRATION_NAME = 'DeviceContext';\n\n/** Load device context from native. */\nexport const deviceContextIntegration = (): IntegrationFnResult => {\n return {\n name: INTEGRATION_NAME,\n setupOnce: () => {\n /* noop */\n },\n processEvent,\n };\n};\n\n/**\n * Load device context from native.\n *\n * @deprecated Use `deviceContextIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const DeviceContext = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n deviceContextIntegration,\n) as IntegrationClass<Integration>;\n\nasync function processEvent(event: Event): Promise<Event> {\n let native: NativeDeviceContextsResponse | null = null;\n try {\n native = await NATIVE.fetchNativeDeviceContexts();\n } catch (e) {\n logger.log(`Failed to get device context from native: ${e}`);\n }\n\n if (!native) {\n return event;\n }\n\n const nativeUser = native.user;\n if (!event.user && nativeUser) {\n event.user = nativeUser;\n }\n\n let nativeContexts = native.contexts;\n if (AppState.currentState !== 'unknown') {\n nativeContexts = nativeContexts || {};\n nativeContexts.app = {\n ...nativeContexts.app,\n in_foreground: AppState.currentState === 'active',\n };\n }\n if (nativeContexts) {\n event.contexts = { ...nativeContexts, ...event.contexts };\n if (nativeContexts.app) {\n event.contexts.app = { ...nativeContexts.app, ...event.contexts.app };\n }\n }\n\n const nativeTags = native.tags;\n if (nativeTags) {\n event.tags = { ...nativeTags, ...event.tags };\n }\n\n const nativeExtra = native.extra;\n if (nativeExtra) {\n event.extra = { ...nativeExtra, ...event.extra };\n }\n\n const nativeFingerprint = native.fingerprint;\n if (nativeFingerprint) {\n event.fingerprint = (event.fingerprint ?? []).concat(\n nativeFingerprint.filter(item => (event.fingerprint ?? []).indexOf(item) < 0),\n );\n }\n\n const nativeLevel = typeof native['level'] === 'string' ? severityLevelFromString(native['level']) : undefined;\n if (!event.level && nativeLevel) {\n event.level = nativeLevel;\n }\n\n const nativeEnvironment = native['environment'];\n if (!event.environment && nativeEnvironment) {\n event.environment = nativeEnvironment;\n }\n\n const nativeBreadcrumbs = Array.isArray(native['breadcrumbs'])\n ? native['breadcrumbs'].map(breadcrumbFromObject)\n : undefined;\n if (nativeBreadcrumbs) {\n event.breadcrumbs = nativeBreadcrumbs;\n }\n\n return event;\n}\n"]}
@@ -1,17 +1,10 @@
1
- import type { EventProcessor, Integration } from '@sentry/types';
1
+ import type { Integration, IntegrationClass, IntegrationFnResult } from '@sentry/types';
2
2
  /** Default EventOrigin instrumentation */
3
- export declare class EventOrigin 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 eventOriginIntegration: () => IntegrationFnResult;
4
+ /**
5
+ * Default EventOrigin instrumentation
6
+ *
7
+ * @deprecated Use `eventOriginIntegration()` instead.
8
+ */
9
+ export declare const EventOrigin: IntegrationClass<Integration>;
17
10
  //# sourceMappingURL=eventorigin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"eventorigin.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/eventorigin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjE,0CAA0C;AAC1C,qBAAa,WAAY,YAAW,WAAW;IAC7C;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAiB;IAEzC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAkB;IAErC;;OAEG;IACI,SAAS,CAAC,uBAAuB,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;CAU7E"}
1
+ {"version":3,"file":"eventorigin.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/eventorigin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAS,WAAW,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAI/F,0CAA0C;AAC1C,eAAO,MAAM,sBAAsB,QAAO,mBAezC,CAAC;AAEF;;;;GAIG;AAEH,eAAO,MAAM,WAAW,+BAGU,CAAC"}
@@ -1,26 +1,26 @@
1
+ import { convertIntegrationFnToClass } from '@sentry/core';
2
+ const INTEGRATION_NAME = 'EventOrigin';
1
3
  /** Default EventOrigin instrumentation */
2
- export class EventOrigin {
3
- constructor() {
4
- /**
5
- * @inheritDoc
6
- */
7
- this.name = EventOrigin.id;
8
- }
9
- /**
10
- * @inheritDoc
11
- */
12
- setupOnce(addGlobalEventProcessor) {
13
- addGlobalEventProcessor(event => {
4
+ export const eventOriginIntegration = () => {
5
+ return {
6
+ name: INTEGRATION_NAME,
7
+ setupOnce: () => {
8
+ // noop
9
+ },
10
+ processEvent: (event) => {
14
11
  var _a;
15
12
  event.tags = (_a = event.tags) !== null && _a !== void 0 ? _a : {};
16
13
  event.tags['event.origin'] = 'javascript';
17
14
  event.tags['event.environment'] = 'javascript';
18
15
  return event;
19
- });
20
- }
21
- }
16
+ },
17
+ };
18
+ };
22
19
  /**
23
- * @inheritDoc
20
+ * Default EventOrigin instrumentation
21
+ *
22
+ * @deprecated Use `eventOriginIntegration()` instead.
24
23
  */
25
- EventOrigin.id = 'EventOrigin';
24
+ // eslint-disable-next-line deprecation/deprecation
25
+ export const EventOrigin = convertIntegrationFnToClass(INTEGRATION_NAME, eventOriginIntegration);
26
26
  //# sourceMappingURL=eventorigin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"eventorigin.js","sourceRoot":"","sources":["../../../src/js/integrations/eventorigin.ts"],"names":[],"mappings":"AAEA,0CAA0C;AAC1C,MAAM,OAAO,WAAW;IAAxB;QAME;;WAEG;QACI,SAAI,GAAW,WAAW,CAAC,EAAE,CAAC;IAevC,CAAC;IAbC;;OAEG;IACI,SAAS,CAAC,uBAAoD;QACnE,uBAAuB,CAAC,KAAK,CAAC,EAAE;;YAC9B,KAAK,CAAC,IAAI,GAAG,MAAA,KAAK,CAAC,IAAI,mCAAI,EAAE,CAAC;YAE9B,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,YAAY,CAAC;YAC1C,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,YAAY,CAAC;YAE/C,OAAO,KAAK,CAAC;QACf,CAAC,CAAC,CAAC;IACL,CAAC;;AAtBD;;GAEG;AACW,cAAE,GAAW,aAAa,CAAC","sourcesContent":["import type { EventProcessor, Integration } from '@sentry/types';\n\n/** Default EventOrigin instrumentation */\nexport class EventOrigin implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'EventOrigin';\n\n /**\n * @inheritDoc\n */\n public name: string = EventOrigin.id;\n\n /**\n * @inheritDoc\n */\n public setupOnce(addGlobalEventProcessor: (e: EventProcessor) => void): void {\n addGlobalEventProcessor(event => {\n event.tags = event.tags ?? {};\n\n event.tags['event.origin'] = 'javascript';\n event.tags['event.environment'] = 'javascript';\n\n return event;\n });\n }\n}\n"]}
1
+ {"version":3,"file":"eventorigin.js","sourceRoot":"","sources":["../../../src/js/integrations/eventorigin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAG3D,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAEvC,0CAA0C;AAC1C,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAwB,EAAE;IAC9D,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,GAAG,EAAE;YACd,OAAO;QACT,CAAC;QACD,YAAY,EAAE,CAAC,KAAY,EAAE,EAAE;;YAC7B,KAAK,CAAC,IAAI,GAAG,MAAA,KAAK,CAAC,IAAI,mCAAI,EAAE,CAAC;YAE9B,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,YAAY,CAAC;YAC1C,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,YAAY,CAAC;YAE/C,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAEF;;;;GAIG;AACH,mDAAmD;AACnD,MAAM,CAAC,MAAM,WAAW,GAAG,2BAA2B,CACpD,gBAAgB,EAChB,sBAAsB,CACU,CAAC","sourcesContent":["import { convertIntegrationFnToClass } from '@sentry/core';\nimport type { Event, Integration, IntegrationClass, IntegrationFnResult } from '@sentry/types';\n\nconst INTEGRATION_NAME = 'EventOrigin';\n\n/** Default EventOrigin instrumentation */\nexport const eventOriginIntegration = (): IntegrationFnResult => {\n return {\n name: INTEGRATION_NAME,\n setupOnce: () => {\n // noop\n },\n processEvent: (event: Event) => {\n event.tags = event.tags ?? {};\n\n event.tags['event.origin'] = 'javascript';\n event.tags['event.environment'] = 'javascript';\n\n return event;\n },\n };\n};\n\n/**\n * Default EventOrigin instrumentation\n *\n * @deprecated Use `eventOriginIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const EventOrigin = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n eventOriginIntegration,\n) as IntegrationClass<Integration>;\n"]}
@@ -1,17 +1,10 @@
1
- import type { EventProcessor, Hub, Integration } from '@sentry/types';
1
+ import type { Integration, IntegrationClass, IntegrationFnResult } from '@sentry/types';
2
2
  /** Load device context from expo modules. */
3
- export declare class ExpoContext implements Integration {
4
- /**
5
- * @inheritDoc
6
- */
7
- static id: string;
8
- /**
9
- * @inheritDoc
10
- */
11
- name: string;
12
- /**
13
- * @inheritDoc
14
- */
15
- setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void;
16
- }
3
+ export declare const expoContextIntegration: () => IntegrationFnResult;
4
+ /**
5
+ * Load device context from expo modules.
6
+ *
7
+ * @deprecated Use `expoContextIntegration()` instead.
8
+ */
9
+ export declare const ExpoContext: IntegrationClass<Integration>;
17
10
  //# sourceMappingURL=expocontext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"expocontext.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/expocontext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAwB,cAAc,EAAE,GAAG,EAAE,WAAW,EAAa,MAAM,eAAe,CAAC;AAIvG,6CAA6C;AAC7C,qBAAa,WAAY,YAAW,WAAW;IAC7C;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAiB;IAEzC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAkB;IAErC;;OAEG;IACI,SAAS,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,GAAG,IAAI;CAsB9G"}
1
+ {"version":3,"file":"expocontext.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/expocontext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAGV,WAAW,EACX,gBAAgB,EAChB,mBAAmB,EAEpB,MAAM,eAAe,CAAC;AAMvB,6CAA6C;AAC7C,eAAO,MAAM,sBAAsB,QAAO,mBAQzC,CAAC;AAEF;;;;GAIG;AAEH,eAAO,MAAM,WAAW,+BAGU,CAAC"}
@@ -1,40 +1,36 @@
1
- import { __awaiter } from "tslib";
1
+ import { convertIntegrationFnToClass } from '@sentry/core';
2
2
  import { getExpoDevice } from '../utils/expomodules';
3
+ const INTEGRATION_NAME = 'ExpoContext';
3
4
  /** Load device context from expo modules. */
4
- export class ExpoContext {
5
- constructor() {
6
- /**
7
- * @inheritDoc
8
- */
9
- this.name = ExpoContext.id;
5
+ export const expoContextIntegration = () => {
6
+ return {
7
+ name: INTEGRATION_NAME,
8
+ setupOnce: () => {
9
+ // noop
10
+ },
11
+ processEvent,
12
+ };
13
+ };
14
+ /**
15
+ * Load device context from expo modules.
16
+ *
17
+ * @deprecated Use `expoContextIntegration()` instead.
18
+ */
19
+ // eslint-disable-next-line deprecation/deprecation
20
+ export const ExpoContext = convertIntegrationFnToClass(INTEGRATION_NAME, expoContextIntegration);
21
+ function processEvent(event) {
22
+ const expoDeviceContext = getExpoDeviceContext();
23
+ if (expoDeviceContext) {
24
+ event.contexts = event.contexts || {};
25
+ event.contexts.device = Object.assign(Object.assign({}, expoDeviceContext), event.contexts.device);
10
26
  }
11
- /**
12
- * @inheritDoc
13
- */
14
- setupOnce(addGlobalEventProcessor, getCurrentHub) {
15
- addGlobalEventProcessor((event) => __awaiter(this, void 0, void 0, function* () {
16
- const self = getCurrentHub().getIntegration(ExpoContext);
17
- if (!self) {
18
- return event;
19
- }
20
- const expoDeviceContext = getExpoDeviceContext();
21
- if (expoDeviceContext) {
22
- event.contexts = event.contexts || {};
23
- event.contexts.device = Object.assign(Object.assign({}, expoDeviceContext), event.contexts.device);
24
- }
25
- const expoOsContext = getExpoOsContext();
26
- if (expoOsContext) {
27
- event.contexts = event.contexts || {};
28
- event.contexts.os = Object.assign(Object.assign({}, expoOsContext), event.contexts.os);
29
- }
30
- return event;
31
- }));
27
+ const expoOsContext = getExpoOsContext();
28
+ if (expoOsContext) {
29
+ event.contexts = event.contexts || {};
30
+ event.contexts.os = Object.assign(Object.assign({}, expoOsContext), event.contexts.os);
32
31
  }
32
+ return event;
33
33
  }
34
- /**
35
- * @inheritDoc
36
- */
37
- ExpoContext.id = 'ExpoContext';
38
34
  /**
39
35
  * Returns the Expo Device context if present
40
36
  */
@@ -1 +1 @@
1
- {"version":3,"file":"expocontext.js","sourceRoot":"","sources":["../../../src/js/integrations/expocontext.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,6CAA6C;AAC7C,MAAM,OAAO,WAAW;IAAxB;QAME;;WAEG;QACI,SAAI,GAAW,WAAW,CAAC,EAAE,CAAC;IA2BvC,CAAC;IAzBC;;OAEG;IACI,SAAS,CAAC,uBAA2D,EAAE,aAAwB;QACpG,uBAAuB,CAAC,CAAO,KAAY,EAAE,EAAE;YAC7C,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;YACzD,IAAI,CAAC,IAAI,EAAE;gBACT,OAAO,KAAK,CAAC;aACd;YAED,MAAM,iBAAiB,GAAG,oBAAoB,EAAE,CAAC;YACjD,IAAI,iBAAiB,EAAE;gBACrB,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC;gBACtC,KAAK,CAAC,QAAQ,CAAC,MAAM,mCAAQ,iBAAiB,GAAK,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAE,CAAC;aAC5E;YAED,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;YACzC,IAAI,aAAa,EAAE;gBACjB,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC;gBACtC,KAAK,CAAC,QAAQ,CAAC,EAAE,mCAAQ,aAAa,GAAK,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAE,CAAC;aAChE;YAED,OAAO,KAAK,CAAC;QACf,CAAC,CAAA,CAAC,CAAC;IACL,CAAC;;AAlCD;;GAEG;AACW,cAAE,GAAW,aAAa,CAAC;AAkC3C;;GAEG;AACH,SAAS,oBAAoB;IAC3B,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IAEnC,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,SAAS,CAAC;KAClB;IAED,OAAO;QACL,IAAI,EAAE,UAAU,CAAC,UAAU;QAC3B,SAAS,EAAE,CAAC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,QAAQ,CAAA;QAChC,KAAK,EAAE,UAAU,CAAC,SAAS;QAC3B,YAAY,EAAE,UAAU,CAAC,YAAY;QACrC,WAAW,EAAE,UAAU,CAAC,WAAW;KACpC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,gBAAgB;IACvB,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IAEnC,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,SAAS,CAAC;KAClB;IAED,OAAO;QACL,KAAK,EAAE,UAAU,CAAC,SAAS;QAC3B,OAAO,EAAE,UAAU,CAAC,SAAS;QAC7B,IAAI,EAAE,UAAU,CAAC,MAAM;KACxB,CAAC;AACJ,CAAC","sourcesContent":["import type { DeviceContext, Event, EventProcessor, Hub, Integration, OsContext } from '@sentry/types';\n\nimport { getExpoDevice } from '../utils/expomodules';\n\n/** Load device context from expo modules. */\nexport class ExpoContext implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'ExpoContext';\n\n /**\n * @inheritDoc\n */\n public name: string = ExpoContext.id;\n\n /**\n * @inheritDoc\n */\n public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n addGlobalEventProcessor(async (event: Event) => {\n const self = getCurrentHub().getIntegration(ExpoContext);\n if (!self) {\n return event;\n }\n\n const expoDeviceContext = getExpoDeviceContext();\n if (expoDeviceContext) {\n event.contexts = event.contexts || {};\n event.contexts.device = { ...expoDeviceContext, ...event.contexts.device };\n }\n\n const expoOsContext = getExpoOsContext();\n if (expoOsContext) {\n event.contexts = event.contexts || {};\n event.contexts.os = { ...expoOsContext, ...event.contexts.os };\n }\n\n return event;\n });\n }\n}\n\n/**\n * Returns the Expo Device context if present\n */\nfunction getExpoDeviceContext(): DeviceContext | undefined {\n const expoDevice = getExpoDevice();\n\n if (!expoDevice) {\n return undefined;\n }\n\n return {\n name: expoDevice.deviceName,\n simulator: !expoDevice?.isDevice,\n model: expoDevice.modelName,\n manufacturer: expoDevice.manufacturer,\n memory_size: expoDevice.totalMemory,\n };\n}\n\n/**\n * Returns the Expo OS context if present\n */\nfunction getExpoOsContext(): OsContext | undefined {\n const expoDevice = getExpoDevice();\n\n if (!expoDevice) {\n return undefined;\n }\n\n return {\n build: expoDevice.osBuildId,\n version: expoDevice.osVersion,\n name: expoDevice.osName,\n };\n}\n"]}
1
+ {"version":3,"file":"expocontext.js","sourceRoot":"","sources":["../../../src/js/integrations/expocontext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAU3D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAEvC,6CAA6C;AAC7C,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAwB,EAAE;IAC9D,OAAO;QACL,IAAI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aAAa,EAAE,CAAC;IAEnC,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,SAAS,CAAC;KAClB;IAED,OAAO;QACL,KAAK,EAAE,UAAU,CAAC,SAAS;QAC3B,OAAO,EAAE,UAAU,CAAC,SAAS;QAC7B,IAAI,EAAE,UAAU,CAAC,MAAM;KACxB,CAAC;AACJ,CAAC","sourcesContent":["import { convertIntegrationFnToClass } from '@sentry/core';\nimport type {\n DeviceContext,\n Event,\n Integration,\n IntegrationClass,\n IntegrationFnResult,\n OsContext,\n} from '@sentry/types';\n\nimport { getExpoDevice } from '../utils/expomodules';\n\nconst INTEGRATION_NAME = 'ExpoContext';\n\n/** Load device context from expo modules. */\nexport const expoContextIntegration = (): IntegrationFnResult => {\n return {\n name: INTEGRATION_NAME,\n setupOnce: () => {\n // noop\n },\n processEvent,\n };\n};\n\n/**\n * Load device context from expo modules.\n *\n * @deprecated Use `expoContextIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const ExpoContext = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n expoContextIntegration,\n) as IntegrationClass<Integration>;\n\nfunction processEvent(event: Event): Event {\n const expoDeviceContext = getExpoDeviceContext();\n if (expoDeviceContext) {\n event.contexts = event.contexts || {};\n event.contexts.device = { ...expoDeviceContext, ...event.contexts.device };\n }\n\n const expoOsContext = getExpoOsContext();\n if (expoOsContext) {\n event.contexts = event.contexts || {};\n event.contexts.os = { ...expoOsContext, ...event.contexts.os };\n }\n\n return event;\n}\n\n/**\n * Returns the Expo Device context if present\n */\nfunction getExpoDeviceContext(): DeviceContext | undefined {\n const expoDevice = getExpoDevice();\n\n if (!expoDevice) {\n return undefined;\n }\n\n return {\n name: expoDevice.deviceName,\n simulator: !expoDevice?.isDevice,\n model: expoDevice.modelName,\n manufacturer: expoDevice.manufacturer,\n memory_size: expoDevice.totalMemory,\n };\n}\n\n/**\n * Returns the Expo OS context if present\n */\nfunction getExpoOsContext(): OsContext | undefined {\n const expoDevice = getExpoDevice();\n\n if (!expoDevice) {\n return undefined;\n }\n\n return {\n build: expoDevice.osBuildId,\n version: expoDevice.osVersion,\n name: expoDevice.osName,\n };\n}\n"]}
@@ -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.d.ts.map