@datadog/mobile-react-native 1.2.1 → 1.3.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 (255) hide show
  1. package/android/src/main/kotlin/com/datadog/reactnative/DdSdk.kt +31 -1
  2. package/android/src/test/kotlin/com/datadog/reactnative/DdSdkTest.kt +222 -0
  3. package/android/src/test/kotlin/com/datadog/tools/unit/GenericAssert.kt +6 -0
  4. package/android/src/test/kotlin/com/datadog/tools/unit/forge/ActionEventForgeryFactory.kt +106 -0
  5. package/android/src/test/kotlin/com/datadog/tools/unit/forge/BaseConfigurator.kt +2 -0
  6. package/android/src/test/kotlin/com/datadog/tools/unit/forge/ResourceEventForgeryFactory.kt +116 -0
  7. package/ios/Sources/Attributes.swift +14 -0
  8. package/ios/Sources/DdSdk.swift +18 -0
  9. package/lib/commonjs/DdSdkReactNative.js +40 -8
  10. package/lib/commonjs/DdSdkReactNative.js.map +1 -1
  11. package/lib/commonjs/DdSdkReactNativeConfiguration.js +42 -2
  12. package/lib/commonjs/DdSdkReactNativeConfiguration.js.map +1 -1
  13. package/lib/commonjs/foundation.js +2 -139
  14. package/lib/commonjs/foundation.js.map +1 -1
  15. package/lib/commonjs/index.js +18 -14
  16. package/lib/commonjs/index.js.map +1 -1
  17. package/lib/commonjs/logs/DdLogs.js +71 -0
  18. package/lib/commonjs/logs/DdLogs.js.map +1 -0
  19. package/lib/commonjs/logs/eventMapper.js +39 -0
  20. package/lib/commonjs/logs/eventMapper.js.map +1 -0
  21. package/lib/commonjs/logs/types.js +2 -0
  22. package/lib/commonjs/{rum/instrumentation/EventsInterceptor.js.map → logs/types.js.map} +0 -0
  23. package/lib/commonjs/nativeModulesTypes.js.map +1 -1
  24. package/lib/commonjs/rum/DdRum.js +234 -0
  25. package/lib/commonjs/rum/DdRum.js.map +1 -0
  26. package/lib/commonjs/rum/eventMappers/actionEventMapper.js +36 -0
  27. package/lib/commonjs/rum/eventMappers/actionEventMapper.js.map +1 -0
  28. package/lib/commonjs/rum/eventMappers/errorEventMapper.js +32 -0
  29. package/lib/commonjs/rum/eventMappers/errorEventMapper.js.map +1 -0
  30. package/lib/commonjs/rum/eventMappers/resourceEventMapper.js +38 -0
  31. package/lib/commonjs/rum/eventMappers/resourceEventMapper.js.map +1 -0
  32. package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js +4 -4
  33. package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
  34. package/lib/commonjs/rum/instrumentation/{DdEventsInterceptor.js → interactionTracking/DdEventsInterceptor.js} +6 -6
  35. package/lib/commonjs/rum/instrumentation/interactionTracking/DdEventsInterceptor.js.map +1 -0
  36. package/lib/commonjs/rum/instrumentation/{DdRumUserInteractionTracking.js → interactionTracking/DdRumUserInteractionTracking.js} +4 -4
  37. package/lib/commonjs/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -0
  38. package/lib/commonjs/rum/instrumentation/{EventsInterceptor.js → interactionTracking/EventsInterceptor.js} +0 -0
  39. package/lib/{module/rum/instrumentation → commonjs/rum/instrumentation/interactionTracking}/EventsInterceptor.js.map +0 -0
  40. package/lib/commonjs/rum/instrumentation/{NoOpEventsInterceptor.js → interactionTracking/NoOpEventsInterceptor.js} +0 -0
  41. package/lib/commonjs/rum/instrumentation/{NoOpEventsInterceptor.js.map → interactionTracking/NoOpEventsInterceptor.js.map} +0 -0
  42. package/lib/commonjs/rum/instrumentation/{ShallowObjectEqualityChecker.js → interactionTracking/ShallowObjectEqualityChecker.js} +0 -0
  43. package/lib/commonjs/rum/instrumentation/{ShallowObjectEqualityChecker.js.map → interactionTracking/ShallowObjectEqualityChecker.js.map} +0 -0
  44. package/lib/commonjs/rum/instrumentation/{getJsxRuntime.js → interactionTracking/getJsxRuntime.js} +0 -0
  45. package/lib/commonjs/rum/instrumentation/{getJsxRuntime.js.map → interactionTracking/getJsxRuntime.js.map} +0 -0
  46. package/lib/commonjs/rum/instrumentation/resourceTracking/implementation/DatadogRumResource/ResourceReporter.js +3 -3
  47. package/lib/commonjs/rum/instrumentation/resourceTracking/implementation/DatadogRumResource/ResourceReporter.js.map +1 -1
  48. package/lib/commonjs/rum/instrumentation/resourceTracking/implementation/XHRProxy.js +2 -1
  49. package/lib/commonjs/rum/instrumentation/resourceTracking/implementation/XHRProxy.js.map +1 -1
  50. package/lib/commonjs/rum/types.js +42 -0
  51. package/lib/commonjs/rum/types.js.map +1 -0
  52. package/lib/commonjs/sdk/AttributesSingleton/AttributesSingleton.js +45 -0
  53. package/lib/commonjs/sdk/AttributesSingleton/AttributesSingleton.js.map +1 -0
  54. package/lib/commonjs/sdk/AttributesSingleton/types.js +2 -0
  55. package/lib/commonjs/sdk/AttributesSingleton/types.js.map +1 -0
  56. package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/Buffer/BoundedBuffer.js +4 -4
  57. package/lib/commonjs/sdk/DatadogProvider/Buffer/BoundedBuffer.js.map +1 -0
  58. package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/Buffer/BufferSingleton.js +0 -0
  59. package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/Buffer/BufferSingleton.js.map +0 -0
  60. package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/Buffer/DatadogBuffer.js +0 -0
  61. package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/Buffer/DatadogBuffer.js.map +0 -0
  62. package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/Buffer/PassThroughBuffer.js +0 -0
  63. package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/Buffer/PassThroughBuffer.js.map +0 -0
  64. package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/Buffer/bufferNativeCall.js +0 -0
  65. package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/Buffer/bufferNativeCall.js.map +0 -0
  66. package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/DatadogProvider.js +4 -4
  67. package/lib/commonjs/sdk/DatadogProvider/DatadogProvider.js.map +1 -0
  68. package/lib/commonjs/sdk/EventMappers/EventMapper.js +85 -0
  69. package/lib/commonjs/sdk/EventMappers/EventMapper.js.map +1 -0
  70. package/lib/commonjs/sdk/EventMappers/utils/deepClone.js +98 -0
  71. package/lib/commonjs/sdk/EventMappers/utils/deepClone.js.map +1 -0
  72. package/lib/commonjs/sdk/UserInfoSingleton/UserInfoSingleton.js +43 -0
  73. package/lib/commonjs/sdk/UserInfoSingleton/UserInfoSingleton.js.map +1 -0
  74. package/lib/commonjs/sdk/UserInfoSingleton/types.js +2 -0
  75. package/lib/commonjs/sdk/UserInfoSingleton/types.js.map +1 -0
  76. package/lib/commonjs/types.js +1 -26
  77. package/lib/commonjs/types.js.map +1 -1
  78. package/lib/commonjs/version.js +1 -1
  79. package/lib/commonjs/version.js.map +1 -1
  80. package/lib/module/DdSdkReactNative.js +33 -7
  81. package/lib/module/DdSdkReactNative.js.map +1 -1
  82. package/lib/module/DdSdkReactNativeConfiguration.js +42 -2
  83. package/lib/module/DdSdkReactNativeConfiguration.js.map +1 -1
  84. package/lib/module/foundation.js +2 -124
  85. package/lib/module/foundation.js.map +1 -1
  86. package/lib/module/index.js +5 -3
  87. package/lib/module/index.js.map +1 -1
  88. package/lib/module/logs/DdLogs.js +64 -0
  89. package/lib/module/logs/DdLogs.js.map +1 -0
  90. package/lib/module/logs/eventMapper.js +20 -0
  91. package/lib/module/logs/eventMapper.js.map +1 -0
  92. package/lib/module/logs/types.js +2 -0
  93. package/lib/module/logs/types.js.map +1 -0
  94. package/lib/module/nativeModulesTypes.js.map +1 -1
  95. package/lib/module/rum/DdRum.js +212 -0
  96. package/lib/module/rum/DdRum.js.map +1 -0
  97. package/lib/module/rum/eventMappers/actionEventMapper.js +26 -0
  98. package/lib/module/rum/eventMappers/actionEventMapper.js.map +1 -0
  99. package/lib/module/rum/eventMappers/errorEventMapper.js +22 -0
  100. package/lib/module/rum/eventMappers/errorEventMapper.js.map +1 -0
  101. package/lib/module/rum/eventMappers/resourceEventMapper.js +28 -0
  102. package/lib/module/rum/eventMappers/resourceEventMapper.js.map +1 -0
  103. package/lib/module/rum/instrumentation/DdRumErrorTracking.js +2 -2
  104. package/lib/module/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
  105. package/lib/module/rum/instrumentation/{DdEventsInterceptor.js → interactionTracking/DdEventsInterceptor.js} +6 -6
  106. package/lib/module/rum/instrumentation/interactionTracking/DdEventsInterceptor.js.map +1 -0
  107. package/lib/module/rum/instrumentation/{DdRumUserInteractionTracking.js → interactionTracking/DdRumUserInteractionTracking.js} +4 -4
  108. package/lib/module/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -0
  109. package/lib/module/rum/instrumentation/{EventsInterceptor.js → interactionTracking/EventsInterceptor.js} +0 -0
  110. package/lib/module/rum/instrumentation/interactionTracking/EventsInterceptor.js.map +1 -0
  111. package/lib/module/rum/instrumentation/{NoOpEventsInterceptor.js → interactionTracking/NoOpEventsInterceptor.js} +0 -0
  112. package/lib/module/rum/instrumentation/{NoOpEventsInterceptor.js.map → interactionTracking/NoOpEventsInterceptor.js.map} +0 -0
  113. package/lib/module/rum/instrumentation/{ShallowObjectEqualityChecker.js → interactionTracking/ShallowObjectEqualityChecker.js} +0 -0
  114. package/lib/module/rum/instrumentation/{ShallowObjectEqualityChecker.js.map → interactionTracking/ShallowObjectEqualityChecker.js.map} +0 -0
  115. package/lib/module/rum/instrumentation/{getJsxRuntime.js → interactionTracking/getJsxRuntime.js} +0 -0
  116. package/lib/module/rum/instrumentation/{getJsxRuntime.js.map → interactionTracking/getJsxRuntime.js.map} +0 -0
  117. package/lib/module/rum/instrumentation/resourceTracking/implementation/DatadogRumResource/ResourceReporter.js +2 -2
  118. package/lib/module/rum/instrumentation/resourceTracking/implementation/DatadogRumResource/ResourceReporter.js.map +1 -1
  119. package/lib/module/rum/instrumentation/resourceTracking/implementation/XHRProxy.js +2 -1
  120. package/lib/module/rum/instrumentation/resourceTracking/implementation/XHRProxy.js.map +1 -1
  121. package/lib/module/rum/types.js +33 -0
  122. package/lib/module/rum/types.js.map +1 -0
  123. package/lib/module/sdk/AttributesSingleton/AttributesSingleton.js +36 -0
  124. package/lib/module/sdk/AttributesSingleton/AttributesSingleton.js.map +1 -0
  125. package/lib/module/sdk/AttributesSingleton/types.js +2 -0
  126. package/lib/module/sdk/AttributesSingleton/types.js.map +1 -0
  127. package/lib/module/{DatadogProvider → sdk/DatadogProvider}/Buffer/BoundedBuffer.js +4 -4
  128. package/lib/module/sdk/DatadogProvider/Buffer/BoundedBuffer.js.map +1 -0
  129. package/lib/module/{DatadogProvider → sdk/DatadogProvider}/Buffer/BufferSingleton.js +0 -0
  130. package/lib/module/{DatadogProvider → sdk/DatadogProvider}/Buffer/BufferSingleton.js.map +0 -0
  131. package/lib/module/{DatadogProvider → sdk/DatadogProvider}/Buffer/DatadogBuffer.js +0 -0
  132. package/lib/module/{DatadogProvider → sdk/DatadogProvider}/Buffer/DatadogBuffer.js.map +0 -0
  133. package/lib/module/{DatadogProvider → sdk/DatadogProvider}/Buffer/PassThroughBuffer.js +0 -0
  134. package/lib/module/{DatadogProvider → sdk/DatadogProvider}/Buffer/PassThroughBuffer.js.map +0 -0
  135. package/lib/module/{DatadogProvider → sdk/DatadogProvider}/Buffer/bufferNativeCall.js +0 -0
  136. package/lib/module/{DatadogProvider → sdk/DatadogProvider}/Buffer/bufferNativeCall.js.map +0 -0
  137. package/lib/module/{DatadogProvider → sdk/DatadogProvider}/DatadogProvider.js +4 -4
  138. package/lib/module/sdk/DatadogProvider/DatadogProvider.js.map +1 -0
  139. package/lib/module/sdk/EventMappers/EventMapper.js +72 -0
  140. package/lib/module/sdk/EventMappers/EventMapper.js.map +1 -0
  141. package/lib/module/sdk/EventMappers/utils/deepClone.js +89 -0
  142. package/lib/module/sdk/EventMappers/utils/deepClone.js.map +1 -0
  143. package/lib/module/sdk/UserInfoSingleton/UserInfoSingleton.js +34 -0
  144. package/lib/module/sdk/UserInfoSingleton/UserInfoSingleton.js.map +1 -0
  145. package/lib/module/sdk/UserInfoSingleton/types.js +2 -0
  146. package/lib/module/sdk/UserInfoSingleton/types.js.map +1 -0
  147. package/lib/module/types.js +0 -23
  148. package/lib/module/types.js.map +1 -1
  149. package/lib/module/version.js +1 -1
  150. package/lib/module/version.js.map +1 -1
  151. package/lib/typescript/DdSdkReactNative.d.ts +7 -3
  152. package/lib/typescript/DdSdkReactNativeConfiguration.d.ts +22 -0
  153. package/lib/typescript/foundation.d.ts +2 -4
  154. package/lib/typescript/index.d.ts +5 -3
  155. package/lib/typescript/logs/DdLogs.d.ts +14 -0
  156. package/lib/typescript/logs/eventMapper.d.ts +11 -0
  157. package/lib/typescript/logs/types.d.ts +54 -0
  158. package/lib/typescript/nativeModulesTypes.d.ts +1 -1
  159. package/lib/typescript/rum/DdRum.d.ts +36 -0
  160. package/lib/typescript/rum/eventMappers/actionEventMapper.d.ts +21 -0
  161. package/lib/typescript/rum/eventMappers/errorEventMapper.d.ts +21 -0
  162. package/lib/typescript/rum/eventMappers/resourceEventMapper.d.ts +25 -0
  163. package/lib/typescript/rum/instrumentation/{DdEventsInterceptor.d.ts → interactionTracking/DdEventsInterceptor.d.ts} +0 -0
  164. package/lib/typescript/rum/instrumentation/{DdRumUserInteractionTracking.d.ts → interactionTracking/DdRumUserInteractionTracking.d.ts} +0 -0
  165. package/lib/typescript/rum/instrumentation/{EventsInterceptor.d.ts → interactionTracking/EventsInterceptor.d.ts} +0 -0
  166. package/lib/typescript/rum/instrumentation/{NoOpEventsInterceptor.d.ts → interactionTracking/NoOpEventsInterceptor.d.ts} +0 -0
  167. package/lib/typescript/rum/instrumentation/{ShallowObjectEqualityChecker.d.ts → interactionTracking/ShallowObjectEqualityChecker.d.ts} +0 -0
  168. package/lib/typescript/rum/instrumentation/{getJsxRuntime.d.ts → interactionTracking/getJsxRuntime.d.ts} +0 -0
  169. package/lib/typescript/rum/instrumentation/resourceTracking/domain/interfaces/RumResource.d.ts +3 -1
  170. package/lib/typescript/rum/types.d.ts +110 -0
  171. package/lib/typescript/sdk/AttributesSingleton/AttributesSingleton.d.ts +12 -0
  172. package/lib/typescript/sdk/AttributesSingleton/types.d.ts +3 -0
  173. package/lib/typescript/{DatadogProvider → sdk/DatadogProvider}/Buffer/BoundedBuffer.d.ts +0 -0
  174. package/lib/typescript/{DatadogProvider → sdk/DatadogProvider}/Buffer/BufferSingleton.d.ts +0 -0
  175. package/lib/typescript/{DatadogProvider → sdk/DatadogProvider}/Buffer/DatadogBuffer.d.ts +0 -0
  176. package/lib/typescript/{DatadogProvider → sdk/DatadogProvider}/Buffer/PassThroughBuffer.d.ts +0 -0
  177. package/lib/typescript/{DatadogProvider → sdk/DatadogProvider}/Buffer/bufferNativeCall.d.ts +0 -0
  178. package/lib/typescript/{DatadogProvider → sdk/DatadogProvider}/DatadogProvider.d.ts +2 -2
  179. package/lib/typescript/sdk/EventMappers/EventMapper.d.ts +24 -0
  180. package/lib/typescript/sdk/EventMappers/utils/deepClone.d.ts +10 -0
  181. package/lib/typescript/sdk/UserInfoSingleton/UserInfoSingleton.d.ts +12 -0
  182. package/lib/typescript/sdk/UserInfoSingleton/types.d.ts +6 -0
  183. package/lib/typescript/types.d.ts +0 -139
  184. package/lib/typescript/version.d.ts +1 -1
  185. package/package.json +2 -2
  186. package/scripts/replace-react-require.js +3 -2
  187. package/src/DdSdkReactNative.tsx +41 -7
  188. package/src/DdSdkReactNativeConfiguration.tsx +83 -3
  189. package/src/__tests__/DdSdkReactNative.test.tsx +244 -13
  190. package/src/__tests__/DdSdkReactNativeConfiguration.test.ts +22 -1
  191. package/src/__tests__/{longTasksUtils.ts → longTasksUtils.test.ts} +0 -0
  192. package/src/__tests__/rum/instrumentation/DdEventsInterceptor.test.tsx +4 -3
  193. package/src/__tests__/rum/instrumentation/DdRumErrorTracking.test.tsx +1 -1
  194. package/src/__tests__/rum/instrumentation/DdRumUserInteractionTracking.test.tsx +5 -3
  195. package/src/__tests__/rum/instrumentation/ShallowObjectEqualityChecker.test.ts +1 -1
  196. package/src/foundation.tsx +4 -114
  197. package/src/index.tsx +5 -3
  198. package/src/logs/DdLogs.ts +67 -0
  199. package/src/logs/__tests__/DdLogs.test.ts +51 -0
  200. package/src/logs/__tests__/eventMapper.test.ts +53 -0
  201. package/src/logs/eventMapper.ts +43 -0
  202. package/src/logs/types.ts +70 -0
  203. package/src/nativeModulesTypes.ts +1 -1
  204. package/src/rum/DdRum.ts +387 -0
  205. package/src/rum/__tests__/DdRum.test.ts +386 -0
  206. package/src/rum/eventMappers/actionEventMapper.ts +66 -0
  207. package/src/rum/eventMappers/errorEventMapper.ts +57 -0
  208. package/src/rum/eventMappers/resourceEventMapper.ts +74 -0
  209. package/src/rum/instrumentation/DdRumErrorTracking.tsx +2 -2
  210. package/src/rum/instrumentation/{DdEventsInterceptor.tsx → interactionTracking/DdEventsInterceptor.tsx} +14 -6
  211. package/src/rum/instrumentation/{DdRumUserInteractionTracking.tsx → interactionTracking/DdRumUserInteractionTracking.tsx} +4 -4
  212. package/src/rum/instrumentation/{EventsInterceptor.tsx → interactionTracking/EventsInterceptor.tsx} +0 -0
  213. package/src/rum/instrumentation/{NoOpEventsInterceptor.tsx → interactionTracking/NoOpEventsInterceptor.tsx} +0 -0
  214. package/src/rum/instrumentation/{ShallowObjectEqualityChecker.ts → interactionTracking/ShallowObjectEqualityChecker.ts} +0 -0
  215. package/src/rum/instrumentation/{getJsxRuntime.ts → interactionTracking/getJsxRuntime.ts} +0 -0
  216. package/src/rum/instrumentation/resourceTracking/__tests__/DdRumResourceTracking.test.ts +1 -1
  217. package/src/rum/instrumentation/resourceTracking/domain/interfaces/RumResource.ts +2 -1
  218. package/src/rum/instrumentation/resourceTracking/implementation/DatadogRumResource/ResourceReporter.ts +3 -2
  219. package/src/rum/instrumentation/resourceTracking/implementation/DatadogRumResource/__tests__/ResourceReporter.test.ts +1 -1
  220. package/src/rum/instrumentation/resourceTracking/implementation/XHRProxy.ts +2 -1
  221. package/src/rum/instrumentation/resourceTracking/implementation/__tests__/XHRProxy.test.ts +83 -39
  222. package/src/rum/types.ts +182 -0
  223. package/src/sdk/AttributesSingleton/AttributesSingleton.ts +34 -0
  224. package/src/sdk/AttributesSingleton/__tests__/AttributesSingleton.test.ts +44 -0
  225. package/src/sdk/AttributesSingleton/types.ts +9 -0
  226. package/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/BoundedBuffer.ts +4 -4
  227. package/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/BufferSingleton.ts +0 -0
  228. package/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/DatadogBuffer.ts +0 -0
  229. package/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/PassThroughBuffer.ts +0 -0
  230. package/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/__tests__/BoundedBuffer.test.ts +2 -2
  231. package/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/__tests__/BufferSingleton.test.ts +0 -0
  232. package/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/bufferNativeCall.ts +0 -0
  233. package/src/{DatadogProvider → sdk/DatadogProvider}/DatadogProvider.tsx +5 -5
  234. package/src/{DatadogProvider → sdk/DatadogProvider}/__tests__/__utils__/renderWithProvider.tsx +2 -2
  235. package/src/{DatadogProvider → sdk/DatadogProvider}/__tests__/initialization.test.tsx +8 -6
  236. package/src/{DatadogProvider → sdk/DatadogProvider}/__tests__/initializationModes.test.tsx +5 -5
  237. package/src/sdk/EventMappers/EventMapper.ts +94 -0
  238. package/src/sdk/EventMappers/__tests__/EventMapper.test.ts +50 -0
  239. package/src/sdk/EventMappers/utils/__tests__/deepClone.test.ts +79 -0
  240. package/src/sdk/EventMappers/utils/deepClone.ts +86 -0
  241. package/src/sdk/UserInfoSingleton/UserInfoSingleton.ts +31 -0
  242. package/src/sdk/UserInfoSingleton/__tests__/UserInfoSingleton.test.ts +29 -0
  243. package/src/sdk/UserInfoSingleton/types.ts +12 -0
  244. package/src/types.tsx +0 -210
  245. package/src/version.ts +1 -1
  246. package/lib/commonjs/DatadogProvider/Buffer/BoundedBuffer.js.map +0 -1
  247. package/lib/commonjs/DatadogProvider/DatadogProvider.js.map +0 -1
  248. package/lib/commonjs/rum/instrumentation/DdEventsInterceptor.js.map +0 -1
  249. package/lib/commonjs/rum/instrumentation/DdRumUserInteractionTracking.js.map +0 -1
  250. package/lib/module/DatadogProvider/Buffer/BoundedBuffer.js.map +0 -1
  251. package/lib/module/DatadogProvider/DatadogProvider.js.map +0 -1
  252. package/lib/module/rum/instrumentation/DdEventsInterceptor.js.map +0 -1
  253. package/lib/module/rum/instrumentation/DdRumUserInteractionTracking.js.map +0 -1
  254. package/src/__tests__/DdRumWrapper.test.tsx +0 -74
  255. package/src/__tests__/foundation.test.ts +0 -88
@@ -4,7 +4,7 @@
4
4
  * Copyright 2016-Present Datadog, Inc.
5
5
  */
6
6
 
7
- import { DdRum } from '../../../../../foundation';
7
+ import { DdRum } from '../../../../DdRum';
8
8
  import type { RUMResource } from '../../domain/interfaces/RumResource';
9
9
 
10
10
  import { createTimings } from './resourceTiming';
@@ -74,6 +74,7 @@ const reportResource = async (resource: RUMResource) => {
74
74
  resource.request.kind,
75
75
  resource.response.size,
76
76
  formatResourceStopContext(resource.timings),
77
- resource.timings.stopTime
77
+ resource.timings.stopTime,
78
+ resource.resourceContext
78
79
  );
79
80
  };
@@ -6,7 +6,7 @@
6
6
 
7
7
  import { NativeModules } from 'react-native';
8
8
 
9
- import { BufferSingleton } from '../../../../../../DatadogProvider/Buffer/BufferSingleton';
9
+ import { BufferSingleton } from '../../../../../../sdk/DatadogProvider/Buffer/BufferSingleton';
10
10
  import type { RUMResource } from '../../../domain/interfaces/RumResource';
11
11
  import { ResourceReporter } from '../ResourceReporter';
12
12
 
@@ -192,6 +192,7 @@ const reportXhr = async (
192
192
  responseStartTime: context.timer.hasTickFor(RESPONSE_START_LABEL)
193
193
  ? context.timer.timeAt(RESPONSE_START_LABEL)
194
194
  : undefined
195
- }
195
+ },
196
+ resourceContext: xhrProxy
196
197
  });
197
198
  };
@@ -6,9 +6,10 @@
6
6
 
7
7
  import { Platform, NativeModules } from 'react-native';
8
8
 
9
- import { BufferSingleton } from '../../../../../DatadogProvider/Buffer/BufferSingleton';
10
9
  import { InternalLog } from '../../../../../InternalLog';
11
10
  import { SdkVerbosity } from '../../../../../SdkVerbosity';
11
+ import { BufferSingleton } from '../../../../../sdk/DatadogProvider/Buffer/BufferSingleton';
12
+ import { DdRum } from '../../../../DdRum';
12
13
  import { XMLHttpRequestMock } from '../../__tests__/__utils__/XMLHttpRequestMock';
13
14
  import { firstPartyHostsRegexBuilder } from '../../domain/firstPartyHosts';
14
15
  import { ResourceReporter } from '../DatadogRumResource/ResourceReporter';
@@ -32,7 +33,7 @@ const mockedInternalLog = (InternalLog as unknown) as {
32
33
  };
33
34
  jest.spyOn(global.Math, 'random');
34
35
 
35
- const DdRum = NativeModules.DdRum;
36
+ const DdNativeRum = NativeModules.DdRum;
36
37
 
37
38
  function randomInt(max: number): number {
38
39
  return Math.floor(Math.random() * max);
@@ -42,8 +43,8 @@ const flushPromises = () => new Promise(setImmediate);
42
43
  let xhrProxy;
43
44
 
44
45
  beforeEach(() => {
45
- DdRum.startResource.mockClear();
46
- DdRum.stopResource.mockClear();
46
+ DdNativeRum.startResource.mockClear();
47
+ DdNativeRum.stopResource.mockClear();
47
48
  BufferSingleton.onInitialization();
48
49
 
49
50
  xhrProxy = new XHRProxy({
@@ -66,6 +67,7 @@ afterEach(() => {
66
67
  xhrProxy.onTrackingStop();
67
68
  (Date.now as jest.MockedFunction<typeof Date.now>).mockClear();
68
69
  jest.spyOn(global.Math, 'random').mockRestore();
70
+ DdRum.unregisterResourceEventMapper();
69
71
  });
70
72
 
71
73
  describe('XHRPr', () => {
@@ -88,17 +90,19 @@ describe('XHRPr', () => {
88
90
  await flushPromises();
89
91
 
90
92
  // THEN
91
- expect(DdRum.startResource.mock.calls.length).toBe(1);
92
- expect(DdRum.startResource.mock.calls[0][1]).toBe(method);
93
- expect(DdRum.startResource.mock.calls[0][2]).toBe(url);
93
+ expect(DdNativeRum.startResource.mock.calls.length).toBe(1);
94
+ expect(DdNativeRum.startResource.mock.calls[0][1]).toBe(method);
95
+ expect(DdNativeRum.startResource.mock.calls[0][2]).toBe(url);
94
96
 
95
- expect(DdRum.stopResource.mock.calls.length).toBe(1);
96
- expect(DdRum.stopResource.mock.calls[0][0]).toBe(
97
- DdRum.startResource.mock.calls[0][0]
97
+ expect(DdNativeRum.stopResource.mock.calls.length).toBe(1);
98
+ expect(DdNativeRum.stopResource.mock.calls[0][0]).toBe(
99
+ DdNativeRum.startResource.mock.calls[0][0]
100
+ );
101
+ expect(DdNativeRum.stopResource.mock.calls[0][1]).toBe(200);
102
+ expect(DdNativeRum.stopResource.mock.calls[0][2]).toBe('xhr');
103
+ expect(DdNativeRum.stopResource.mock.calls[0][3]).toBeGreaterThan(
104
+ 0
98
105
  );
99
- expect(DdRum.stopResource.mock.calls[0][1]).toBe(200);
100
- expect(DdRum.stopResource.mock.calls[0][2]).toBe('xhr');
101
- expect(DdRum.stopResource.mock.calls[0][3]).toBeGreaterThan(0);
102
106
 
103
107
  expect(xhr.originalOpenCalled).toBe(true);
104
108
  expect(xhr.originalSendCalled).toBe(true);
@@ -123,17 +127,19 @@ describe('XHRPr', () => {
123
127
  await flushPromises();
124
128
 
125
129
  // THEN
126
- expect(DdRum.startResource.mock.calls.length).toBe(1);
127
- expect(DdRum.startResource.mock.calls[0][1]).toBe(method);
128
- expect(DdRum.startResource.mock.calls[0][2]).toBe(url);
130
+ expect(DdNativeRum.startResource.mock.calls.length).toBe(1);
131
+ expect(DdNativeRum.startResource.mock.calls[0][1]).toBe(method);
132
+ expect(DdNativeRum.startResource.mock.calls[0][2]).toBe(url);
129
133
 
130
- expect(DdRum.stopResource.mock.calls.length).toBe(1);
131
- expect(DdRum.stopResource.mock.calls[0][0]).toBe(
132
- DdRum.startResource.mock.calls[0][0]
134
+ expect(DdNativeRum.stopResource.mock.calls.length).toBe(1);
135
+ expect(DdNativeRum.stopResource.mock.calls[0][0]).toBe(
136
+ DdNativeRum.startResource.mock.calls[0][0]
137
+ );
138
+ expect(DdNativeRum.stopResource.mock.calls[0][1]).toBe(500);
139
+ expect(DdNativeRum.stopResource.mock.calls[0][2]).toBe('xhr');
140
+ expect(DdNativeRum.stopResource.mock.calls[0][3]).toBeGreaterThan(
141
+ 0
133
142
  );
134
- expect(DdRum.stopResource.mock.calls[0][1]).toBe(500);
135
- expect(DdRum.stopResource.mock.calls[0][2]).toBe('xhr');
136
- expect(DdRum.stopResource.mock.calls[0][3]).toBeGreaterThan(0);
137
143
 
138
144
  expect(xhr.originalOpenCalled).toBe(true);
139
145
  expect(xhr.originalSendCalled).toBe(true);
@@ -158,17 +164,17 @@ describe('XHRPr', () => {
158
164
  await flushPromises();
159
165
 
160
166
  // THEN
161
- expect(DdRum.startResource.mock.calls.length).toBe(1);
162
- expect(DdRum.startResource.mock.calls[0][1]).toBe(method);
163
- expect(DdRum.startResource.mock.calls[0][2]).toBe(url);
167
+ expect(DdNativeRum.startResource.mock.calls.length).toBe(1);
168
+ expect(DdNativeRum.startResource.mock.calls[0][1]).toBe(method);
169
+ expect(DdNativeRum.startResource.mock.calls[0][2]).toBe(url);
164
170
 
165
- expect(DdRum.stopResource.mock.calls.length).toBe(1);
166
- expect(DdRum.stopResource.mock.calls[0][0]).toBe(
167
- DdRum.startResource.mock.calls[0][0]
171
+ expect(DdNativeRum.stopResource.mock.calls.length).toBe(1);
172
+ expect(DdNativeRum.stopResource.mock.calls[0][0]).toBe(
173
+ DdNativeRum.startResource.mock.calls[0][0]
168
174
  );
169
- expect(DdRum.stopResource.mock.calls[0][1]).toBe(0);
170
- expect(DdRum.stopResource.mock.calls[0][2]).toBe('xhr');
171
- expect(DdRum.stopResource.mock.calls[0][3]).toBe(-1);
175
+ expect(DdNativeRum.stopResource.mock.calls[0][1]).toBe(0);
176
+ expect(DdNativeRum.stopResource.mock.calls[0][2]).toBe('xhr');
177
+ expect(DdNativeRum.stopResource.mock.calls[0][3]).toBe(-1);
172
178
 
173
179
  expect(xhr.originalOpenCalled).toBe(true);
174
180
  expect(xhr.originalSendCalled).toBe(true);
@@ -439,17 +445,18 @@ describe('XHRPr', () => {
439
445
  await flushPromises();
440
446
 
441
447
  // THEN
442
- const spanId = DdRum.startResource.mock.calls[0][3]['_dd.span_id'];
448
+ const spanId =
449
+ DdNativeRum.startResource.mock.calls[0][3]['_dd.span_id'];
443
450
  expect(spanId).toBeDefined();
444
451
  expect(spanId).toMatch(/[1-9].+/);
445
452
 
446
453
  const traceId =
447
- DdRum.startResource.mock.calls[0][3]['_dd.trace_id'];
454
+ DdNativeRum.startResource.mock.calls[0][3]['_dd.trace_id'];
448
455
  expect(traceId).toBeDefined();
449
456
  expect(traceId).toMatch(/[1-9].+/);
450
457
 
451
458
  const rulePsr =
452
- DdRum.startResource.mock.calls[0][3]['_dd.rule_psr'];
459
+ DdNativeRum.startResource.mock.calls[0][3]['_dd.rule_psr'];
453
460
  expect(rulePsr).toBe(1);
454
461
 
455
462
  // Check traceId and spanId are different
@@ -477,7 +484,7 @@ describe('XHRPr', () => {
477
484
  await flushPromises();
478
485
 
479
486
  // THEN
480
- expect(DdRum.startResource).not.toHaveBeenCalledWith(
487
+ expect(DdNativeRum.startResource).not.toHaveBeenCalledWith(
481
488
  expect.anything(),
482
489
  expect.anything(),
483
490
  expect.anything(),
@@ -488,7 +495,9 @@ describe('XHRPr', () => {
488
495
  }),
489
496
  expect.anything()
490
497
  );
491
- expect(DdRum.startResource.mock.calls[0][3]).toStrictEqual({});
498
+ expect(DdNativeRum.startResource.mock.calls[0][3]).toStrictEqual(
499
+ {}
500
+ );
492
501
  });
493
502
  });
494
503
 
@@ -516,7 +525,9 @@ describe('XHRPr', () => {
516
525
 
517
526
  // THEN
518
527
  const timings =
519
- DdRum.stopResource.mock.calls[0][4]['_dd.resource_timings'];
528
+ DdNativeRum.stopResource.mock.calls[0][4][
529
+ '_dd.resource_timings'
530
+ ];
520
531
 
521
532
  if (Platform.OS === 'ios') {
522
533
  expect(timings['firstByte']['startTime']).toBeGreaterThan(0);
@@ -560,7 +571,9 @@ describe('XHRPr', () => {
560
571
 
561
572
  // THEN
562
573
  const timings =
563
- DdRum.stopResource.mock.calls[0][4]['_dd.resource_timings'];
574
+ DdNativeRum.stopResource.mock.calls[0][4][
575
+ '_dd.resource_timings'
576
+ ];
564
577
 
565
578
  if (Platform.OS === 'ios') {
566
579
  expect(timings['firstByte']['startTime']).toBeGreaterThan(0);
@@ -600,10 +613,41 @@ describe('XHRPr', () => {
600
613
  await flushPromises();
601
614
 
602
615
  // THEN
603
- const attributes = DdRum.stopResource.mock.calls[0][4];
616
+ const attributes = DdNativeRum.stopResource.mock.calls[0][4];
604
617
 
605
618
  expect(attributes['_dd.resource_timings']).toBeNull();
606
619
  });
620
+
621
+ it('attaches the XMLHttpRequest object containing response to the event mapper', async () => {
622
+ // GIVEN
623
+ const method = 'GET';
624
+ const url = 'https://api.example.com/v2/user';
625
+ xhrProxy.onTrackingStart({
626
+ tracingSamplingRate: 100,
627
+ firstPartyHostsRegex: firstPartyHostsRegexBuilder([])
628
+ });
629
+ DdRum.registerResourceEventMapper(event => {
630
+ event.context['body'] = JSON.parse(
631
+ event.resourceContext?.response
632
+ );
633
+ return event;
634
+ });
635
+
636
+ // WHEN
637
+ const xhr = new XMLHttpRequestMock();
638
+ xhr.open(method, url);
639
+ xhr.send();
640
+ xhr.abort();
641
+ xhr.complete(200, JSON.stringify({ body: 'content' }));
642
+ await flushPromises();
643
+
644
+ // THEN
645
+ const attributes = DdNativeRum.stopResource.mock.calls[0][4];
646
+
647
+ expect(attributes['body']).toEqual({
648
+ body: 'content'
649
+ });
650
+ });
607
651
  });
608
652
 
609
653
  describe.each(
@@ -0,0 +1,182 @@
1
+ /*
2
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
3
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
4
+ * Copyright 2016-Present Datadog, Inc.
5
+ */
6
+
7
+ /**
8
+ * The entry point to use Datadog's RUM feature.
9
+ */
10
+ export type DdRumType = {
11
+ /**
12
+ * Start tracking a RUM View.
13
+ * @param key: The view unique key identifier.
14
+ * @param name: The view name.
15
+ * @param context: The additional context to send.
16
+ * @param timestampMs: The timestamp when the view started (in milliseconds). If not provided, current timestamp will be used.
17
+ */
18
+ startView(
19
+ key: string,
20
+ name: string,
21
+ context?: object,
22
+ timestampMs?: number
23
+ ): Promise<void>;
24
+
25
+ /**
26
+ * Stop tracking a RUM View.
27
+ * @param key: The view unique key identifier.
28
+ * @param context: The additional context to send.
29
+ * @param timestampMs: The timestamp when the view stopped (in milliseconds). If not provided, current timestamp will be used.
30
+ */
31
+ stopView(
32
+ key: string,
33
+ context?: object,
34
+ timestampMs?: number
35
+ ): Promise<void>;
36
+
37
+ /**
38
+ * Start tracking a RUM Action.
39
+ * @param type: The action type (tap, scroll, swipe, back, custom).
40
+ * @param name: The action name.
41
+ * @param context: The additional context to send.
42
+ * @param timestampMs: The timestamp when the action started (in milliseconds). If not provided, current timestamp will be used.
43
+ */
44
+ startAction(
45
+ type: RumActionType,
46
+ name: string,
47
+ context?: object,
48
+ timestampMs?: number
49
+ ): Promise<void>;
50
+
51
+ /**
52
+ * Stop tracking the ongoing RUM Action.
53
+ * @param type: The action type (tap, scroll, swipe, back, custom).
54
+ * @param name: The action name.
55
+ * @param context: The additional context to send.
56
+ * @param timestampMs: The timestamp when the action stopped (in milliseconds). If not provided, current timestamp will be used.
57
+ */
58
+ stopAction(
59
+ type: RumActionType,
60
+ name: string,
61
+ context?: object,
62
+ timestampMs?: number
63
+ ): Promise<void>;
64
+
65
+ /**
66
+ * Stop tracking the ongoing RUM Action.
67
+ *
68
+ * Warning: using this function signature can lead to inconsistent behaviors on iOS and Android when multiple actions are started in parallel.
69
+ *
70
+ * @deprecated add the `type` and `name` of the action as first two arguments.
71
+ * @param context: The additional context to send.
72
+ * @param timestampMs: The timestamp when the action stopped (in milliseconds). If not provided, current timestamp will be used.
73
+ */
74
+ stopAction(context?: object, timestampMs?: number): Promise<void>;
75
+
76
+ /**
77
+ * Add a RUM Action.
78
+ * @param type: The action type (tap, scroll, swipe, back, custom).
79
+ * @param name: The action name.
80
+ * @param context: The additional context to send.
81
+ * @param timestampMs: The timestamp when the action occurred (in milliseconds). If not provided, current timestamp will be used.
82
+ */
83
+ addAction(
84
+ type: RumActionType,
85
+ name: string,
86
+ context?: object,
87
+ timestampMs?: number
88
+ ): Promise<void>;
89
+
90
+ /**
91
+ * Start tracking a RUM Resource.
92
+ * @param key: The resource unique key identifier.
93
+ * @param method: The resource method (GET, POST, …).
94
+ * @param url: The resource url.
95
+ * @param context: The additional context to send.
96
+ * @param timestampMs: The timestamp when the resource started (in milliseconds). If not provided, current timestamp will be used.
97
+ */
98
+ startResource(
99
+ key: string,
100
+ method: string,
101
+ url: string,
102
+ context?: object,
103
+ timestampMs?: number
104
+ ): Promise<void>;
105
+
106
+ /**
107
+ * Stop tracking a RUM Resource.
108
+ * @param key: The resource unique key identifier.
109
+ * @param statusCode: The resource status code.
110
+ * @param kind: The resource's kind (xhr, document, image, css, font, …).
111
+ * @param size: The resource size in bytes. If size is unknown, use -1.
112
+ * @param context: The additional context to send.
113
+ * @param timestampMs: The timestamp when the resource stopped (in milliseconds). If not provided, current timestamp will be used.
114
+ */
115
+ stopResource(
116
+ key: string,
117
+ statusCode: number,
118
+ kind: ResourceKind,
119
+ size?: number,
120
+ context?: object,
121
+ timestampMs?: number
122
+ ): Promise<void>;
123
+
124
+ /**
125
+ * Add a RUM Error.
126
+ * @param message: The error message.
127
+ * @param source: The error source (network, source, console, webview, custom).
128
+ * @param stacktrace: The error stacktrace.
129
+ * @param context: The additional context to send.
130
+ * @param timestampMs: The timestamp when the error occurred (in milliseconds). If not provided, current timestamp will be used.
131
+ */
132
+ addError(
133
+ message: string,
134
+ source: ErrorSource,
135
+ stacktrace: string,
136
+ context?: object,
137
+ timestampMs?: number
138
+ ): Promise<void>;
139
+
140
+ /**
141
+ * Adds a specific timing in the active View. The timing duration will be computed as the difference between the time the View was started and the time this function was called.
142
+ * @param name: The name of the new custom timing attribute. Timings can be nested up to 8 levels deep. Names using more than 8 levels will be sanitized by SDK.
143
+ */
144
+ addTiming(name: string): Promise<void>;
145
+ };
146
+
147
+ /**
148
+ * Describe the type of a RUM Action.
149
+ */
150
+ export enum RumActionType {
151
+ /** User tapped on a widget. */
152
+ TAP = 'TAP',
153
+ /** User scrolled a view. */
154
+ SCROLL = 'SCROLL',
155
+ /** User swiped on a view. */
156
+ SWIPE = 'SWIPE',
157
+ /** User pressed hardware back button (Android only). */
158
+ BACK = 'BACK',
159
+ /** A custom action. */
160
+ CUSTOM = 'CUSTOM'
161
+ }
162
+
163
+ export type ResourceKind =
164
+ | 'image'
165
+ | 'xhr'
166
+ | 'beacon'
167
+ | 'css'
168
+ | 'document'
169
+ | 'fetch'
170
+ | 'font'
171
+ | 'js'
172
+ | 'media'
173
+ | 'other'
174
+ | 'native';
175
+
176
+ export enum ErrorSource {
177
+ NETWORK = 'NETWORK',
178
+ SOURCE = 'SOURCE',
179
+ CONSOLE = 'CONSOLE',
180
+ WEBVIEW = 'WEBVIEW',
181
+ CUSTOM = 'CUSTOM'
182
+ }
@@ -0,0 +1,34 @@
1
+ /*
2
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
3
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
4
+ * Copyright 2016-Present Datadog, Inc.
5
+ */
6
+
7
+ import type { Attributes } from './types';
8
+
9
+ class AttributesProvider {
10
+ private attributes: Attributes = {};
11
+
12
+ setAttributes = (attributes: Attributes) => {
13
+ this.attributes = {
14
+ ...this.attributes,
15
+ ...attributes
16
+ };
17
+ };
18
+
19
+ getAttributes = (): Attributes => {
20
+ return this.attributes;
21
+ };
22
+ }
23
+
24
+ export class AttributesSingleton {
25
+ private static attributesProvider = new AttributesProvider();
26
+
27
+ static getInstance = (): AttributesProvider => {
28
+ return AttributesSingleton.attributesProvider;
29
+ };
30
+
31
+ static reset = () => {
32
+ AttributesSingleton.attributesProvider = new AttributesProvider();
33
+ };
34
+ }
@@ -0,0 +1,44 @@
1
+ /*
2
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
3
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
4
+ * Copyright 2016-Present Datadog, Inc.
5
+ */
6
+
7
+ import { AttributesSingleton } from '../AttributesSingleton';
8
+
9
+ describe('AttributesSingleton', () => {
10
+ it('adds, returns and resets the user info', () => {
11
+ // Adding first attributes
12
+ AttributesSingleton.getInstance().setAttributes({
13
+ appType: 'student',
14
+ extraInfo: {
15
+ loggedIn: true
16
+ }
17
+ });
18
+
19
+ expect(AttributesSingleton.getInstance().getAttributes()).toEqual({
20
+ appType: 'student',
21
+ extraInfo: {
22
+ loggedIn: true
23
+ }
24
+ });
25
+
26
+ // Removing and adding new attributes
27
+ AttributesSingleton.getInstance().setAttributes({
28
+ appType: undefined,
29
+ newAttribute: false
30
+ });
31
+
32
+ expect(AttributesSingleton.getInstance().getAttributes()).toEqual({
33
+ newAttribute: false,
34
+ extraInfo: {
35
+ loggedIn: true
36
+ }
37
+ });
38
+
39
+ // Resetting attributes
40
+ AttributesSingleton.reset();
41
+
42
+ expect(AttributesSingleton.getInstance().getAttributes()).toEqual({});
43
+ });
44
+ });
@@ -0,0 +1,9 @@
1
+ /*
2
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
3
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
4
+ * Copyright 2016-Present Datadog, Inc.
5
+ */
6
+
7
+ export type Attributes = {
8
+ readonly [key: string]: unknown;
9
+ };
@@ -4,10 +4,10 @@
4
4
  * Copyright 2016-Present Datadog, Inc.
5
5
  */
6
6
 
7
- import { InternalLog } from '../../InternalLog';
8
- import { SdkVerbosity } from '../../SdkVerbosity';
9
- import { getErrorStackTrace } from '../../errorUtils';
10
- import { DdSdk } from '../../foundation';
7
+ import { InternalLog } from '../../../InternalLog';
8
+ import { SdkVerbosity } from '../../../SdkVerbosity';
9
+ import { getErrorStackTrace } from '../../../errorUtils';
10
+ import { DdSdk } from '../../../foundation';
11
11
 
12
12
  import { DatadogBuffer } from './DatadogBuffer';
13
13
 
@@ -4,8 +4,8 @@
4
4
  * Copyright 2016-Present Datadog, Inc.
5
5
  */
6
6
 
7
- import { InternalLog } from '../../../InternalLog';
8
- import { DdSdk } from '../../../foundation';
7
+ import { InternalLog } from '../../../../InternalLog';
8
+ import { DdSdk } from '../../../../foundation';
9
9
  import { BoundedBuffer } from '../BoundedBuffer';
10
10
 
11
11
  describe('BoundedBuffer', () => {
@@ -9,14 +9,14 @@ import type { PropsWithChildren } from 'react';
9
9
  import {
10
10
  DatadogProviderConfiguration,
11
11
  DdSdkReactNativeConfiguration
12
- } from '../DdSdkReactNativeConfiguration';
12
+ } from '../../DdSdkReactNativeConfiguration';
13
13
  import type {
14
14
  PartialInitializationConfiguration,
15
15
  AutoInstrumentationConfiguration
16
- } from '../DdSdkReactNativeConfiguration';
17
- import { DdSdkReactNative } from '../DdSdkReactNative';
18
- import { InternalLog } from '../InternalLog';
19
- import { SdkVerbosity } from '../SdkVerbosity';
16
+ } from '../../DdSdkReactNativeConfiguration';
17
+ import { DdSdkReactNative } from '../../DdSdkReactNative';
18
+ import { InternalLog } from '../../InternalLog';
19
+ import { SdkVerbosity } from '../../SdkVerbosity';
20
20
 
21
21
  let isInitialized = false;
22
22
 
@@ -8,8 +8,8 @@ import { render } from '@testing-library/react-native';
8
8
  import { Animated, Button, InteractionManager, Text, View } from 'react-native';
9
9
  import React, { useState } from 'react';
10
10
 
11
- import type { AutoInstrumentationConfiguration } from '../../../DdSdkReactNativeConfiguration';
12
- import { DatadogProviderConfiguration } from '../../../DdSdkReactNativeConfiguration';
11
+ import type { AutoInstrumentationConfiguration } from '../../../../DdSdkReactNativeConfiguration';
12
+ import { DatadogProviderConfiguration } from '../../../../DdSdkReactNativeConfiguration';
13
13
  import { DatadogProvider } from '../../DatadogProvider';
14
14
 
15
15
  const DefaultTestApp = () => {
@@ -6,11 +6,12 @@
6
6
 
7
7
  import { NativeModules } from 'react-native';
8
8
 
9
- import { InitializationMode } from '../../DdSdkReactNativeConfiguration';
10
- import { DdSdkReactNative } from '../../DdSdkReactNative';
11
- import { TimeProvider } from '../../TimeProvider';
12
- import { DdRum, DdTrace } from '../../foundation';
13
- import { RumActionType } from '../../types';
9
+ import { InitializationMode } from '../../../DdSdkReactNativeConfiguration';
10
+ import { DdSdkReactNative } from '../../../DdSdkReactNative';
11
+ import { TimeProvider } from '../../../TimeProvider';
12
+ import { DdTrace } from '../../../foundation';
13
+ import { DdRum } from '../../../rum/DdRum';
14
+ import { RumActionType } from '../../../rum/types';
14
15
  import { BufferSingleton } from '../Buffer/BufferSingleton';
15
16
  import {
16
17
  DatadogProvider,
@@ -23,7 +24,7 @@ import {
23
24
  renderWithProvider
24
25
  } from './__utils__/renderWithProvider';
25
26
 
26
- jest.mock('../../TimeProvider', () => {
27
+ jest.mock('../../../TimeProvider', () => {
27
28
  const now = jest.fn();
28
29
  return {
29
30
  TimeProvider: jest.fn().mockImplementation(() => {
@@ -60,6 +61,7 @@ describe('DatadogProvider', () => {
60
61
  DdSdkConfiguration {
61
62
  "additionalConfig": Object {
62
63
  "_dd.first_party_hosts": Array [],
64
+ "_dd.native_interaction_tracking": false,
63
65
  "_dd.native_view_tracking": false,
64
66
  "_dd.source": "react-native",
65
67
  },