@datadog/mobile-react-native 2.4.1 → 2.4.3

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 (434) hide show
  1. package/DatadogSDKReactNative.podspec +6 -6
  2. package/android/build.gradle +1 -0
  3. package/android/src/main/kotlin/com/datadog/reactnative/DdRumImplementation.kt +6 -0
  4. package/android/src/main/kotlin/com/datadog/reactnative/DdSdkImplementation.kt +31 -24
  5. package/android/src/main/kotlin/com/datadog/reactnative/FrameRateProvider.kt +63 -0
  6. package/android/src/main/kotlin/com/datadog/reactnative/SdkVersion.kt +1 -1
  7. package/android/src/main/kotlin/com/datadog/reactnative/UiThreadExecutor.kt +25 -0
  8. package/android/src/newarch/kotlin/com/datadog/reactnative/DdRum.kt +10 -1
  9. package/android/src/oldarch/kotlin/com/datadog/reactnative/DdRum.kt +10 -1
  10. package/android/src/test/kotlin/com/datadog/reactnative/DdRumTest.kt +29 -0
  11. package/android/src/test/kotlin/com/datadog/reactnative/DdSdkTest.kt +12 -4
  12. package/android/src/test/kotlin/com/datadog/tools/unit/TestUiThreadExecutor.kt +16 -0
  13. package/datadog-sourcemaps.gradle +3 -5
  14. package/ios/Sources/DdRum.mm +4 -3
  15. package/ios/Sources/DdRumImplementation.swift +15 -2
  16. package/ios/Sources/SdkVersion.swift +1 -1
  17. package/lib/commonjs/DdSdkReactNative.js +107 -145
  18. package/lib/commonjs/DdSdkReactNative.js.map +1 -1
  19. package/lib/commonjs/DdSdkReactNativeConfiguration.js +54 -119
  20. package/lib/commonjs/DdSdkReactNativeConfiguration.js.map +1 -1
  21. package/lib/commonjs/InternalLog.js +8 -19
  22. package/lib/commonjs/InternalLog.js.map +1 -1
  23. package/lib/commonjs/ProxyConfiguration.js +3 -15
  24. package/lib/commonjs/ProxyConfiguration.js.map +1 -1
  25. package/lib/commonjs/SdkVerbosity.js +3 -7
  26. package/lib/commonjs/SdkVerbosity.js.map +1 -1
  27. package/lib/commonjs/TrackingConsent.js +3 -7
  28. package/lib/commonjs/TrackingConsent.js.map +1 -1
  29. package/lib/commonjs/index.js +50 -66
  30. package/lib/commonjs/index.js.map +1 -1
  31. package/lib/commonjs/logs/DdLogs.js +103 -123
  32. package/lib/commonjs/logs/DdLogs.js.map +1 -1
  33. package/lib/commonjs/logs/eventMapper.js +4 -11
  34. package/lib/commonjs/logs/eventMapper.js.map +1 -1
  35. package/lib/commonjs/logs/types.js +4 -0
  36. package/lib/commonjs/logs/types.js.map +1 -1
  37. package/lib/commonjs/nativeModulesTypes.js +4 -3
  38. package/lib/commonjs/nativeModulesTypes.js.map +1 -1
  39. package/lib/commonjs/polyfills.js +1 -4
  40. package/lib/commonjs/polyfills.js.map +1 -1
  41. package/lib/commonjs/rum/DdAttributes.js +26 -0
  42. package/lib/commonjs/rum/DdAttributes.js.map +1 -0
  43. package/lib/commonjs/rum/DdRum.js +143 -208
  44. package/lib/commonjs/rum/DdRum.js.map +1 -1
  45. package/lib/commonjs/rum/eventMappers/actionEventMapper.js +5 -8
  46. package/lib/commonjs/rum/eventMappers/actionEventMapper.js.map +1 -1
  47. package/lib/commonjs/rum/eventMappers/errorEventMapper.js +3 -7
  48. package/lib/commonjs/rum/eventMappers/errorEventMapper.js.map +1 -1
  49. package/lib/commonjs/rum/eventMappers/resourceEventMapper.js +5 -8
  50. package/lib/commonjs/rum/eventMappers/resourceEventMapper.js.map +1 -1
  51. package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js +68 -89
  52. package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
  53. package/lib/commonjs/rum/instrumentation/interactionTracking/DdEventsInterceptor.js +13 -46
  54. package/lib/commonjs/rum/instrumentation/interactionTracking/DdEventsInterceptor.js.map +1 -1
  55. package/lib/commonjs/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js +52 -66
  56. package/lib/commonjs/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -1
  57. package/lib/commonjs/rum/instrumentation/interactionTracking/EventsInterceptor.js.map +1 -1
  58. package/lib/commonjs/rum/instrumentation/interactionTracking/NoOpEventsInterceptor.js +3 -4
  59. package/lib/commonjs/rum/instrumentation/interactionTracking/NoOpEventsInterceptor.js.map +1 -1
  60. package/lib/commonjs/rum/instrumentation/interactionTracking/ShallowObjectEqualityChecker.js +0 -6
  61. package/lib/commonjs/rum/instrumentation/interactionTracking/ShallowObjectEqualityChecker.js.map +1 -1
  62. package/lib/commonjs/rum/instrumentation/interactionTracking/getJsxRuntime.js +18 -19
  63. package/lib/commonjs/rum/instrumentation/interactionTracking/getJsxRuntime.js.map +1 -1
  64. package/lib/commonjs/rum/instrumentation/resourceTracking/DdRumResourceTracking.js +6 -21
  65. package/lib/commonjs/rum/instrumentation/resourceTracking/DdRumResourceTracking.js.map +1 -1
  66. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js +32 -55
  67. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js.map +1 -1
  68. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js +1 -9
  69. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js.map +1 -1
  70. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js +15 -41
  71. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js.map +1 -1
  72. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js +3 -13
  73. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js.map +1 -1
  74. package/lib/commonjs/rum/instrumentation/resourceTracking/graphql/graphqlHeaders.js +5 -10
  75. package/lib/commonjs/rum/instrumentation/resourceTracking/graphql/graphqlHeaders.js.map +1 -1
  76. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/ResourceReporter.js +16 -35
  77. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/ResourceReporter.js.map +1 -1
  78. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/internalDevResourceBlocklist.js +2 -5
  79. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/internalDevResourceBlocklist.js.map +1 -1
  80. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/resourceTiming.js +4 -7
  81. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/resourceTiming.js.map +1 -1
  82. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.js +4 -10
  83. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.js.map +1 -1
  84. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js +25 -58
  85. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js.map +1 -1
  86. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.js +4 -26
  87. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.js.map +1 -1
  88. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.js +1 -11
  89. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.js.map +1 -1
  90. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.js +4 -0
  91. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.js.map +1 -1
  92. package/lib/commonjs/rum/types.js +15 -27
  93. package/lib/commonjs/rum/types.js.map +1 -1
  94. package/lib/commonjs/sdk/AttributesSingleton/AttributesSingleton.js +20 -30
  95. package/lib/commonjs/sdk/AttributesSingleton/AttributesSingleton.js.map +1 -1
  96. package/lib/commonjs/sdk/AttributesSingleton/types.js.map +1 -1
  97. package/lib/commonjs/sdk/DatadogProvider/Buffer/BoundedBuffer.js +112 -144
  98. package/lib/commonjs/sdk/DatadogProvider/Buffer/BoundedBuffer.js.map +1 -1
  99. package/lib/commonjs/sdk/DatadogProvider/Buffer/BufferSingleton.js +19 -22
  100. package/lib/commonjs/sdk/DatadogProvider/Buffer/BufferSingleton.js.map +1 -1
  101. package/lib/commonjs/sdk/DatadogProvider/Buffer/DatadogBuffer.js +1 -15
  102. package/lib/commonjs/sdk/DatadogProvider/Buffer/DatadogBuffer.js.map +1 -1
  103. package/lib/commonjs/sdk/DatadogProvider/Buffer/PassThroughBuffer.js +9 -16
  104. package/lib/commonjs/sdk/DatadogProvider/Buffer/PassThroughBuffer.js.map +1 -1
  105. package/lib/commonjs/sdk/DatadogProvider/Buffer/bufferNativeCall.js +2 -8
  106. package/lib/commonjs/sdk/DatadogProvider/Buffer/bufferNativeCall.js.map +1 -1
  107. package/lib/commonjs/sdk/DatadogProvider/DatadogProvider.js +8 -25
  108. package/lib/commonjs/sdk/DatadogProvider/DatadogProvider.js.map +1 -1
  109. package/lib/commonjs/sdk/DdSdk.js +2 -4
  110. package/lib/commonjs/sdk/DdSdk.js.map +1 -1
  111. package/lib/commonjs/sdk/EventMappers/EventMapper.js +31 -51
  112. package/lib/commonjs/sdk/EventMappers/EventMapper.js.map +1 -1
  113. package/lib/commonjs/sdk/EventMappers/utils/deepClone.js +9 -24
  114. package/lib/commonjs/sdk/EventMappers/utils/deepClone.js.map +1 -1
  115. package/lib/commonjs/sdk/FileBasedConfiguration/FileBasedConfiguration.js +6 -38
  116. package/lib/commonjs/sdk/FileBasedConfiguration/FileBasedConfiguration.js.map +1 -1
  117. package/lib/commonjs/sdk/GlobalState/GlobalState.js +6 -11
  118. package/lib/commonjs/sdk/GlobalState/GlobalState.js.map +1 -1
  119. package/lib/commonjs/sdk/UserInfoSingleton/UserInfoSingleton.js +17 -28
  120. package/lib/commonjs/sdk/UserInfoSingleton/UserInfoSingleton.js.map +1 -1
  121. package/lib/commonjs/sdk/UserInfoSingleton/types.js.map +1 -1
  122. package/lib/commonjs/specs/NativeDdLogs.js +4 -6
  123. package/lib/commonjs/specs/NativeDdLogs.js.map +1 -1
  124. package/lib/commonjs/specs/NativeDdRum.js +4 -6
  125. package/lib/commonjs/specs/NativeDdRum.js.map +1 -1
  126. package/lib/commonjs/specs/NativeDdSdk.js +4 -6
  127. package/lib/commonjs/specs/NativeDdSdk.js.map +1 -1
  128. package/lib/commonjs/specs/NativeDdTrace.js +4 -6
  129. package/lib/commonjs/specs/NativeDdTrace.js.map +1 -1
  130. package/lib/commonjs/trace/DdTrace.js +17 -29
  131. package/lib/commonjs/trace/DdTrace.js.map +1 -1
  132. package/lib/commonjs/types.js +4 -3
  133. package/lib/commonjs/types.js.map +1 -1
  134. package/lib/commonjs/utils/Timer.js +7 -22
  135. package/lib/commonjs/utils/Timer.js.map +1 -1
  136. package/lib/commonjs/utils/argsUtils.js +3 -11
  137. package/lib/commonjs/utils/argsUtils.js.map +1 -1
  138. package/lib/commonjs/utils/errorUtils.js +9 -22
  139. package/lib/commonjs/utils/errorUtils.js.map +1 -1
  140. package/lib/commonjs/utils/jsUtils.js +1 -2
  141. package/lib/commonjs/utils/jsUtils.js.map +1 -1
  142. package/lib/commonjs/utils/longTasksUtils.js +2 -7
  143. package/lib/commonjs/utils/longTasksUtils.js.map +1 -1
  144. package/lib/commonjs/utils/time-provider/DefaultTimeProvider.js +9 -15
  145. package/lib/commonjs/utils/time-provider/DefaultTimeProvider.js.map +1 -1
  146. package/lib/commonjs/utils/time-provider/TimeProvider.js +1 -11
  147. package/lib/commonjs/utils/time-provider/TimeProvider.js.map +1 -1
  148. package/lib/commonjs/version.js +1 -2
  149. package/lib/commonjs/version.js.map +1 -1
  150. package/lib/module/DdSdkReactNative.js +104 -116
  151. package/lib/module/DdSdkReactNative.js.map +1 -1
  152. package/lib/module/DdSdkReactNativeConfiguration.js +49 -101
  153. package/lib/module/DdSdkReactNativeConfiguration.js.map +1 -1
  154. package/lib/module/InternalLog.js +4 -15
  155. package/lib/module/InternalLog.js.map +1 -1
  156. package/lib/module/ProxyConfiguration.js +3 -14
  157. package/lib/module/ProxyConfiguration.js.map +1 -1
  158. package/lib/module/SdkVerbosity.js +3 -4
  159. package/lib/module/SdkVerbosity.js.map +1 -1
  160. package/lib/module/TrackingConsent.js +3 -4
  161. package/lib/module/TrackingConsent.js.map +1 -1
  162. package/lib/module/index.js +2 -2
  163. package/lib/module/index.js.map +1 -1
  164. package/lib/module/logs/DdLogs.js +98 -117
  165. package/lib/module/logs/DdLogs.js.map +1 -1
  166. package/lib/module/logs/eventMapper.js +3 -1
  167. package/lib/module/logs/eventMapper.js.map +1 -1
  168. package/lib/module/logs/types.js +1 -1
  169. package/lib/module/logs/types.js.map +1 -1
  170. package/lib/module/nativeModulesTypes.js +5 -1
  171. package/lib/module/nativeModulesTypes.js.map +1 -1
  172. package/lib/module/polyfills.js +1 -3
  173. package/lib/module/polyfills.js.map +1 -1
  174. package/lib/module/rum/DdAttributes.js +20 -0
  175. package/lib/module/rum/DdAttributes.js.map +1 -0
  176. package/lib/module/rum/DdRum.js +138 -185
  177. package/lib/module/rum/DdRum.js.map +1 -1
  178. package/lib/module/rum/eventMappers/actionEventMapper.js +5 -5
  179. package/lib/module/rum/eventMappers/actionEventMapper.js.map +1 -1
  180. package/lib/module/rum/eventMappers/errorEventMapper.js +3 -4
  181. package/lib/module/rum/eventMappers/errorEventMapper.js.map +1 -1
  182. package/lib/module/rum/eventMappers/resourceEventMapper.js +5 -5
  183. package/lib/module/rum/eventMappers/resourceEventMapper.js.map +1 -1
  184. package/lib/module/rum/instrumentation/DdRumErrorTracking.js +64 -79
  185. package/lib/module/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
  186. package/lib/module/rum/instrumentation/interactionTracking/DdEventsInterceptor.js +7 -36
  187. package/lib/module/rum/instrumentation/interactionTracking/DdEventsInterceptor.js.map +1 -1
  188. package/lib/module/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js +49 -54
  189. package/lib/module/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -1
  190. package/lib/module/rum/instrumentation/interactionTracking/EventsInterceptor.js.map +1 -1
  191. package/lib/module/rum/instrumentation/interactionTracking/NoOpEventsInterceptor.js +3 -2
  192. package/lib/module/rum/instrumentation/interactionTracking/NoOpEventsInterceptor.js.map +1 -1
  193. package/lib/module/rum/instrumentation/interactionTracking/ShallowObjectEqualityChecker.js +0 -4
  194. package/lib/module/rum/instrumentation/interactionTracking/ShallowObjectEqualityChecker.js.map +1 -1
  195. package/lib/module/rum/instrumentation/interactionTracking/getJsxRuntime.js +16 -14
  196. package/lib/module/rum/instrumentation/interactionTracking/getJsxRuntime.js.map +1 -1
  197. package/lib/module/rum/instrumentation/resourceTracking/DdRumResourceTracking.js +2 -12
  198. package/lib/module/rum/instrumentation/resourceTracking/DdRumResourceTracking.js.map +1 -1
  199. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js +33 -45
  200. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js.map +1 -1
  201. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js +1 -4
  202. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js.map +1 -1
  203. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js +2 -10
  204. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js.map +1 -1
  205. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js +3 -5
  206. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js.map +1 -1
  207. package/lib/module/rum/instrumentation/resourceTracking/graphql/graphqlHeaders.js +1 -0
  208. package/lib/module/rum/instrumentation/resourceTracking/graphql/graphqlHeaders.js.map +1 -1
  209. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/ResourceReporter.js +12 -30
  210. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/ResourceReporter.js.map +1 -1
  211. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/internalDevResourceBlocklist.js +2 -3
  212. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/internalDevResourceBlocklist.js.map +1 -1
  213. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/resourceTiming.js +4 -4
  214. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/resourceTiming.js.map +1 -1
  215. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.js +4 -5
  216. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.js.map +1 -1
  217. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js +20 -48
  218. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js.map +1 -1
  219. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.js +2 -20
  220. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.js.map +1 -1
  221. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.js +1 -9
  222. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.js.map +1 -1
  223. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.js +1 -1
  224. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.js.map +1 -1
  225. package/lib/module/rum/types.js +14 -18
  226. package/lib/module/rum/types.js.map +1 -1
  227. package/lib/module/sdk/AttributesSingleton/AttributesSingleton.js +20 -28
  228. package/lib/module/sdk/AttributesSingleton/AttributesSingleton.js.map +1 -1
  229. package/lib/module/sdk/AttributesSingleton/types.js.map +1 -1
  230. package/lib/module/sdk/DatadogProvider/Buffer/BoundedBuffer.js +108 -137
  231. package/lib/module/sdk/DatadogProvider/Buffer/BoundedBuffer.js.map +1 -1
  232. package/lib/module/sdk/DatadogProvider/Buffer/BufferSingleton.js +14 -18
  233. package/lib/module/sdk/DatadogProvider/Buffer/BufferSingleton.js.map +1 -1
  234. package/lib/module/sdk/DatadogProvider/Buffer/DatadogBuffer.js +1 -13
  235. package/lib/module/sdk/DatadogProvider/Buffer/DatadogBuffer.js.map +1 -1
  236. package/lib/module/sdk/DatadogProvider/Buffer/PassThroughBuffer.js +5 -14
  237. package/lib/module/sdk/DatadogProvider/Buffer/PassThroughBuffer.js.map +1 -1
  238. package/lib/module/sdk/DatadogProvider/Buffer/bufferNativeCall.js +1 -0
  239. package/lib/module/sdk/DatadogProvider/Buffer/bufferNativeCall.js.map +1 -1
  240. package/lib/module/sdk/DatadogProvider/DatadogProvider.js +6 -14
  241. package/lib/module/sdk/DatadogProvider/DatadogProvider.js.map +1 -1
  242. package/lib/module/sdk/DdSdk.js +1 -1
  243. package/lib/module/sdk/DdSdk.js.map +1 -1
  244. package/lib/module/sdk/EventMappers/EventMapper.js +27 -41
  245. package/lib/module/sdk/EventMappers/EventMapper.js.map +1 -1
  246. package/lib/module/sdk/EventMappers/utils/deepClone.js +9 -22
  247. package/lib/module/sdk/EventMappers/utils/deepClone.js.map +1 -1
  248. package/lib/module/sdk/FileBasedConfiguration/FileBasedConfiguration.js +5 -29
  249. package/lib/module/sdk/FileBasedConfiguration/FileBasedConfiguration.js.map +1 -1
  250. package/lib/module/sdk/GlobalState/GlobalState.js +6 -9
  251. package/lib/module/sdk/GlobalState/GlobalState.js.map +1 -1
  252. package/lib/module/sdk/UserInfoSingleton/UserInfoSingleton.js +17 -26
  253. package/lib/module/sdk/UserInfoSingleton/UserInfoSingleton.js.map +1 -1
  254. package/lib/module/sdk/UserInfoSingleton/types.js.map +1 -1
  255. package/lib/module/specs/NativeDdLogs.js +2 -0
  256. package/lib/module/specs/NativeDdLogs.js.map +1 -1
  257. package/lib/module/specs/NativeDdRum.js +2 -0
  258. package/lib/module/specs/NativeDdRum.js.map +1 -1
  259. package/lib/module/specs/NativeDdSdk.js +2 -0
  260. package/lib/module/specs/NativeDdSdk.js.map +1 -1
  261. package/lib/module/specs/NativeDdTrace.js +2 -0
  262. package/lib/module/specs/NativeDdTrace.js.map +1 -1
  263. package/lib/module/trace/DdTrace.js +12 -19
  264. package/lib/module/trace/DdTrace.js.map +1 -1
  265. package/lib/module/types.js +5 -1
  266. package/lib/module/types.js.map +1 -1
  267. package/lib/module/utils/Timer.js +3 -20
  268. package/lib/module/utils/Timer.js.map +1 -1
  269. package/lib/module/utils/argsUtils.js +3 -5
  270. package/lib/module/utils/argsUtils.js.map +1 -1
  271. package/lib/module/utils/errorUtils.js +6 -9
  272. package/lib/module/utils/errorUtils.js.map +1 -1
  273. package/lib/module/utils/jsUtils.js +1 -0
  274. package/lib/module/utils/jsUtils.js.map +1 -1
  275. package/lib/module/utils/longTasksUtils.js +2 -5
  276. package/lib/module/utils/longTasksUtils.js.map +1 -1
  277. package/lib/module/utils/time-provider/DefaultTimeProvider.js +5 -13
  278. package/lib/module/utils/time-provider/DefaultTimeProvider.js.map +1 -1
  279. package/lib/module/utils/time-provider/TimeProvider.js +1 -9
  280. package/lib/module/utils/time-provider/TimeProvider.js.map +1 -1
  281. package/lib/module/version.js +1 -1
  282. package/lib/module/version.js.map +1 -1
  283. package/lib/typescript/DdSdkReactNative.d.ts +1 -0
  284. package/lib/typescript/DdSdkReactNative.d.ts.map +1 -0
  285. package/lib/typescript/DdSdkReactNativeConfiguration.d.ts +1 -0
  286. package/lib/typescript/DdSdkReactNativeConfiguration.d.ts.map +1 -0
  287. package/lib/typescript/InternalLog.d.ts +1 -0
  288. package/lib/typescript/InternalLog.d.ts.map +1 -0
  289. package/lib/typescript/ProxyConfiguration.d.ts +1 -0
  290. package/lib/typescript/ProxyConfiguration.d.ts.map +1 -0
  291. package/lib/typescript/SdkVerbosity.d.ts +1 -0
  292. package/lib/typescript/SdkVerbosity.d.ts.map +1 -0
  293. package/lib/typescript/TrackingConsent.d.ts +1 -0
  294. package/lib/typescript/TrackingConsent.d.ts.map +1 -0
  295. package/lib/typescript/index.d.ts +1 -0
  296. package/lib/typescript/index.d.ts.map +1 -0
  297. package/lib/typescript/logs/DdLogs.d.ts +1 -0
  298. package/lib/typescript/logs/DdLogs.d.ts.map +1 -0
  299. package/lib/typescript/logs/eventMapper.d.ts +1 -0
  300. package/lib/typescript/logs/eventMapper.d.ts.map +1 -0
  301. package/lib/typescript/logs/types.d.ts +6 -1
  302. package/lib/typescript/logs/types.d.ts.map +1 -0
  303. package/lib/typescript/nativeModulesTypes.d.ts +3 -1
  304. package/lib/typescript/nativeModulesTypes.d.ts.map +1 -0
  305. package/lib/typescript/rum/DdAttributes.d.ts +14 -0
  306. package/lib/typescript/rum/DdAttributes.d.ts.map +1 -0
  307. package/lib/typescript/rum/DdRum.d.ts +3 -2
  308. package/lib/typescript/rum/DdRum.d.ts.map +1 -0
  309. package/lib/typescript/rum/eventMappers/actionEventMapper.d.ts +1 -0
  310. package/lib/typescript/rum/eventMappers/actionEventMapper.d.ts.map +1 -0
  311. package/lib/typescript/rum/eventMappers/errorEventMapper.d.ts +3 -0
  312. package/lib/typescript/rum/eventMappers/errorEventMapper.d.ts.map +1 -0
  313. package/lib/typescript/rum/eventMappers/resourceEventMapper.d.ts +1 -0
  314. package/lib/typescript/rum/eventMappers/resourceEventMapper.d.ts.map +1 -0
  315. package/lib/typescript/rum/instrumentation/DdRumErrorTracking.d.ts +1 -0
  316. package/lib/typescript/rum/instrumentation/DdRumErrorTracking.d.ts.map +1 -0
  317. package/lib/typescript/rum/instrumentation/interactionTracking/DdEventsInterceptor.d.ts +1 -0
  318. package/lib/typescript/rum/instrumentation/interactionTracking/DdEventsInterceptor.d.ts.map +1 -0
  319. package/lib/typescript/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.d.ts +2 -0
  320. package/lib/typescript/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.d.ts.map +1 -0
  321. package/lib/typescript/rum/instrumentation/interactionTracking/EventsInterceptor.d.ts +1 -0
  322. package/lib/typescript/rum/instrumentation/interactionTracking/EventsInterceptor.d.ts.map +1 -0
  323. package/lib/typescript/rum/instrumentation/interactionTracking/NoOpEventsInterceptor.d.ts +1 -0
  324. package/lib/typescript/rum/instrumentation/interactionTracking/NoOpEventsInterceptor.d.ts.map +1 -0
  325. package/lib/typescript/rum/instrumentation/interactionTracking/ShallowObjectEqualityChecker.d.ts +1 -0
  326. package/lib/typescript/rum/instrumentation/interactionTracking/ShallowObjectEqualityChecker.d.ts.map +1 -0
  327. package/lib/typescript/rum/instrumentation/interactionTracking/getJsxRuntime.d.ts +2 -1
  328. package/lib/typescript/rum/instrumentation/interactionTracking/getJsxRuntime.d.ts.map +1 -0
  329. package/lib/typescript/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts +1 -0
  330. package/lib/typescript/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts.map +1 -0
  331. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.d.ts +1 -0
  332. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.d.ts.map +1 -0
  333. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.d.ts +1 -0
  334. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.d.ts.map +1 -0
  335. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.d.ts +1 -0
  336. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.d.ts.map +1 -0
  337. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.d.ts +1 -0
  338. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.d.ts.map +1 -0
  339. package/lib/typescript/rum/instrumentation/resourceTracking/graphql/graphqlHeaders.d.ts +1 -0
  340. package/lib/typescript/rum/instrumentation/resourceTracking/graphql/graphqlHeaders.d.ts.map +1 -0
  341. package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/ResourceReporter.d.ts +1 -0
  342. package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/ResourceReporter.d.ts.map +1 -0
  343. package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/internalDevResourceBlocklist.d.ts +1 -0
  344. package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/internalDevResourceBlocklist.d.ts.map +1 -0
  345. package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/resourceTiming.d.ts +1 -0
  346. package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/resourceTiming.d.ts.map +1 -0
  347. package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.d.ts +1 -0
  348. package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.d.ts.map +1 -0
  349. package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.d.ts +1 -0
  350. package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.d.ts.map +1 -0
  351. package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.d.ts +1 -0
  352. package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.d.ts.map +1 -0
  353. package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.d.ts +1 -0
  354. package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.d.ts.map +1 -0
  355. package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts +1 -0
  356. package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts.map +1 -0
  357. package/lib/typescript/rum/types.d.ts +1 -0
  358. package/lib/typescript/rum/types.d.ts.map +1 -0
  359. package/lib/typescript/sdk/AttributesSingleton/AttributesSingleton.d.ts +1 -0
  360. package/lib/typescript/sdk/AttributesSingleton/AttributesSingleton.d.ts.map +1 -0
  361. package/lib/typescript/sdk/AttributesSingleton/types.d.ts +1 -0
  362. package/lib/typescript/sdk/AttributesSingleton/types.d.ts.map +1 -0
  363. package/lib/typescript/sdk/DatadogProvider/Buffer/BoundedBuffer.d.ts +1 -0
  364. package/lib/typescript/sdk/DatadogProvider/Buffer/BoundedBuffer.d.ts.map +1 -0
  365. package/lib/typescript/sdk/DatadogProvider/Buffer/BufferSingleton.d.ts +1 -0
  366. package/lib/typescript/sdk/DatadogProvider/Buffer/BufferSingleton.d.ts.map +1 -0
  367. package/lib/typescript/sdk/DatadogProvider/Buffer/DatadogBuffer.d.ts +1 -0
  368. package/lib/typescript/sdk/DatadogProvider/Buffer/DatadogBuffer.d.ts.map +1 -0
  369. package/lib/typescript/sdk/DatadogProvider/Buffer/PassThroughBuffer.d.ts +1 -0
  370. package/lib/typescript/sdk/DatadogProvider/Buffer/PassThroughBuffer.d.ts.map +1 -0
  371. package/lib/typescript/sdk/DatadogProvider/Buffer/bufferNativeCall.d.ts +1 -0
  372. package/lib/typescript/sdk/DatadogProvider/Buffer/bufferNativeCall.d.ts.map +1 -0
  373. package/lib/typescript/sdk/DatadogProvider/DatadogProvider.d.ts +1 -0
  374. package/lib/typescript/sdk/DatadogProvider/DatadogProvider.d.ts.map +1 -0
  375. package/lib/typescript/sdk/DdSdk.d.ts +1 -0
  376. package/lib/typescript/sdk/DdSdk.d.ts.map +1 -0
  377. package/lib/typescript/sdk/EventMappers/EventMapper.d.ts +1 -0
  378. package/lib/typescript/sdk/EventMappers/EventMapper.d.ts.map +1 -0
  379. package/lib/typescript/sdk/EventMappers/utils/deepClone.d.ts +1 -0
  380. package/lib/typescript/sdk/EventMappers/utils/deepClone.d.ts.map +1 -0
  381. package/lib/typescript/sdk/FileBasedConfiguration/FileBasedConfiguration.d.ts +1 -0
  382. package/lib/typescript/sdk/FileBasedConfiguration/FileBasedConfiguration.d.ts.map +1 -0
  383. package/lib/typescript/sdk/GlobalState/GlobalState.d.ts +1 -0
  384. package/lib/typescript/sdk/GlobalState/GlobalState.d.ts.map +1 -0
  385. package/lib/typescript/sdk/UserInfoSingleton/UserInfoSingleton.d.ts +1 -0
  386. package/lib/typescript/sdk/UserInfoSingleton/UserInfoSingleton.d.ts.map +1 -0
  387. package/lib/typescript/sdk/UserInfoSingleton/types.d.ts +1 -0
  388. package/lib/typescript/sdk/UserInfoSingleton/types.d.ts.map +1 -0
  389. package/lib/typescript/specs/NativeDdLogs.d.ts +1 -0
  390. package/lib/typescript/specs/NativeDdLogs.d.ts.map +1 -0
  391. package/lib/typescript/specs/NativeDdRum.d.ts +3 -1
  392. package/lib/typescript/specs/NativeDdRum.d.ts.map +1 -0
  393. package/lib/typescript/specs/NativeDdSdk.d.ts +1 -0
  394. package/lib/typescript/specs/NativeDdSdk.d.ts.map +1 -0
  395. package/lib/typescript/specs/NativeDdTrace.d.ts +1 -0
  396. package/lib/typescript/specs/NativeDdTrace.d.ts.map +1 -0
  397. package/lib/typescript/trace/DdTrace.d.ts +1 -0
  398. package/lib/typescript/trace/DdTrace.d.ts.map +1 -0
  399. package/lib/typescript/types.d.ts +1 -0
  400. package/lib/typescript/types.d.ts.map +1 -0
  401. package/lib/typescript/utils/Timer.d.ts +1 -0
  402. package/lib/typescript/utils/Timer.d.ts.map +1 -0
  403. package/lib/typescript/utils/argsUtils.d.ts +1 -0
  404. package/lib/typescript/utils/argsUtils.d.ts.map +1 -0
  405. package/lib/typescript/utils/errorUtils.d.ts +1 -0
  406. package/lib/typescript/utils/errorUtils.d.ts.map +1 -0
  407. package/lib/typescript/utils/jsUtils.d.ts +1 -0
  408. package/lib/typescript/utils/jsUtils.d.ts.map +1 -0
  409. package/lib/typescript/utils/longTasksUtils.d.ts +1 -0
  410. package/lib/typescript/utils/longTasksUtils.d.ts.map +1 -0
  411. package/lib/typescript/utils/time-provider/DefaultTimeProvider.d.ts +1 -0
  412. package/lib/typescript/utils/time-provider/DefaultTimeProvider.d.ts.map +1 -0
  413. package/lib/typescript/utils/time-provider/TimeProvider.d.ts +1 -0
  414. package/lib/typescript/utils/time-provider/TimeProvider.d.ts.map +1 -0
  415. package/lib/typescript/version.d.ts +2 -1
  416. package/lib/typescript/version.d.ts.map +1 -0
  417. package/package.json +3 -3
  418. package/src/__tests__/DdSdkReactNative.test.tsx +2 -1
  419. package/src/__tests__/rum/instrumentation/DdRumErrorTracking.test.tsx +32 -16
  420. package/src/__tests__/rum/instrumentation/DdRumUserInteractionTracking.test.tsx +17 -15
  421. package/src/logs/DdLogs.ts +25 -8
  422. package/src/logs/__tests__/DdLogs.test.ts +122 -0
  423. package/src/logs/types.ts +5 -1
  424. package/src/nativeModulesTypes.ts +3 -1
  425. package/src/rum/DdAttributes.ts +20 -0
  426. package/src/rum/DdRum.ts +11 -6
  427. package/src/rum/__tests__/DdRum.test.ts +40 -4
  428. package/src/rum/eventMappers/errorEventMapper.ts +2 -0
  429. package/src/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.tsx +33 -10
  430. package/src/rum/instrumentation/interactionTracking/getJsxRuntime.ts +10 -3
  431. package/src/sdk/DatadogProvider/__tests__/initialization.test.tsx +1 -1
  432. package/src/specs/NativeDdRum.ts +3 -1
  433. package/src/version.ts +1 -1
  434. package/android/src/main/kotlin/com/datadog/reactnative/VitalFrameCallback.kt +0 -41
@@ -3,39 +3,32 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.formatPropagatorType = exports.getJSONConfiguration = exports.FileBasedConfiguration = void 0;
7
-
6
+ exports.getJSONConfiguration = exports.formatPropagatorType = exports.FileBasedConfiguration = void 0;
8
7
  var _DdSdkReactNativeConfiguration = require("../../DdSdkReactNativeConfiguration");
9
-
10
8
  var _SdkVerbosity = require("../../SdkVerbosity");
11
-
12
9
  var _TrackingConsent = require("../../TrackingConsent");
13
-
14
10
  var _types = require("../../rum/types");
15
-
16
11
  /*
17
12
  * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
18
13
  * This product includes software developed at Datadog (https://www.datadoghq.com/).
19
14
  * Copyright 2016-Present Datadog, Inc.
20
15
  */
16
+
21
17
  class FileBasedConfiguration extends _DdSdkReactNativeConfiguration.DatadogProviderConfiguration {
22
18
  constructor(params) {
23
- const configuration = getJSONConfiguration(params === null || params === void 0 ? void 0 : params.configuration);
19
+ const configuration = getJSONConfiguration(params?.configuration);
24
20
  super(configuration.clientToken, configuration.env, configuration.applicationId, configuration.trackInteractions, configuration.trackResources, configuration.trackErrors, configuration.trackingConsent);
25
21
  this.longTaskThresholdMs = configuration.longTaskThresholdMs || _DdSdkReactNativeConfiguration.DEFAULTS.longTaskThresholdMs;
26
22
  this.verbosity = configuration.verbosity;
27
23
  this.actionNameAttribute = configuration.actionNameAttribute;
28
24
  this.resourceTracingSamplingRate = configuration.resourceTracingSamplingRate || _DdSdkReactNativeConfiguration.DEFAULTS.resourceTracingSamplingRate;
29
25
  this.firstPartyHosts = configuration.firstPartyHosts || _DdSdkReactNativeConfiguration.DEFAULTS.getFirstPartyHosts();
30
- this.errorEventMapper = (params === null || params === void 0 ? void 0 : params.errorEventMapper) || _DdSdkReactNativeConfiguration.DEFAULTS.errorEventMapper;
31
- this.resourceEventMapper = (params === null || params === void 0 ? void 0 : params.resourceEventMapper) || _DdSdkReactNativeConfiguration.DEFAULTS.resourceEventMapper;
32
- this.actionEventMapper = (params === null || params === void 0 ? void 0 : params.actionEventMapper) || _DdSdkReactNativeConfiguration.DEFAULTS.actionEventMapper;
26
+ this.errorEventMapper = params?.errorEventMapper || _DdSdkReactNativeConfiguration.DEFAULTS.errorEventMapper;
27
+ this.resourceEventMapper = params?.resourceEventMapper || _DdSdkReactNativeConfiguration.DEFAULTS.resourceEventMapper;
28
+ this.actionEventMapper = params?.actionEventMapper || _DdSdkReactNativeConfiguration.DEFAULTS.actionEventMapper;
33
29
  }
34
-
35
30
  }
36
-
37
31
  exports.FileBasedConfiguration = FileBasedConfiguration;
38
-
39
32
  const resolveJSONConfiguration = userSpecifiedConfiguration => {
40
33
  if (userSpecifiedConfiguration === undefined || userSpecifiedConfiguration === null) {
41
34
  try {
@@ -43,7 +36,6 @@ const resolveJSONConfiguration = userSpecifiedConfiguration => {
43
36
  // /!\ We have to write the require this way as dynamic requires are not supported by Hermes.
44
37
  // eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
45
38
  const jsonContent = require('../../../../../../datadog-configuration.json');
46
-
47
39
  if (typeof jsonContent !== 'object' || !jsonContent['configuration']) {
48
40
  console.error(`Failed to parse the Datadog configuration file located at the root of the project.
49
41
  Your configuration must validate the node_modules/@datadog/mobile-react-native/datadog-configuration.schema.json JSON schema.
@@ -53,7 +45,6 @@ You can use VSCode to check your configuration by adding the following line to y
53
45
  }`);
54
46
  return {};
55
47
  }
56
-
57
48
  return jsonContent.configuration;
58
49
  } catch (error) {
59
50
  console.error(`Failed to read Datadog configuration file at the root of the project.
@@ -64,7 +55,6 @@ new FileBasedConfiguration({configuration: require('./file/to/configuration-file
64
55
  return {};
65
56
  }
66
57
  }
67
-
68
58
  if (typeof userSpecifiedConfiguration !== 'object' || !userSpecifiedConfiguration['configuration']) {
69
59
  console.error(`Failed to parse the Datadog configuration file you provided.
70
60
  Your configuration must validate the node_modules/@datadog/mobile-react-native/datadog-configuration.schema.json JSON schema.
@@ -74,10 +64,8 @@ You can use VSCode to check your configuration by adding the following line to y
74
64
  }`);
75
65
  return {};
76
66
  }
77
-
78
67
  return userSpecifiedConfiguration['configuration'];
79
68
  };
80
-
81
69
  const getJSONConfiguration = userSpecifiedConfiguration => {
82
70
  const configuration = resolveJSONConfiguration(userSpecifiedConfiguration);
83
71
  return {
@@ -95,14 +83,11 @@ const getJSONConfiguration = userSpecifiedConfiguration => {
95
83
  firstPartyHosts: buildFirstPartyHosts(configuration.firstPartyHosts)
96
84
  };
97
85
  };
98
-
99
86
  exports.getJSONConfiguration = getJSONConfiguration;
100
-
101
87
  const buildFirstPartyHosts = firstPartyHosts => {
102
88
  if (!firstPartyHosts) {
103
89
  return undefined;
104
90
  }
105
-
106
91
  try {
107
92
  return firstPartyHosts.map(({
108
93
  match,
@@ -119,92 +104,75 @@ The first party hosts will not be set for this session.
119
104
  return undefined;
120
105
  }
121
106
  };
122
-
123
107
  const formatPropagatorType = propagatorType => {
124
108
  switch (propagatorType.toLowerCase()) {
125
109
  case 'b3':
126
110
  {
127
111
  return _types.PropagatorType.B3;
128
112
  }
129
-
130
113
  case 'b3multi':
131
114
  {
132
115
  return _types.PropagatorType.B3MULTI;
133
116
  }
134
-
135
117
  case 'datadog':
136
118
  {
137
119
  return _types.PropagatorType.DATADOG;
138
120
  }
139
-
140
121
  case 'tracecontext':
141
122
  {
142
123
  return _types.PropagatorType.TRACECONTEXT;
143
124
  }
144
-
145
125
  default:
146
126
  {
147
127
  throw new Error(`Failed to parse propagator type ${propagatorType}.`);
148
128
  }
149
129
  }
150
130
  };
151
-
152
131
  exports.formatPropagatorType = formatPropagatorType;
153
-
154
132
  const buildTrackingConsent = trackingConsent => {
155
133
  if (trackingConsent === undefined) {
156
134
  return undefined;
157
135
  }
158
-
159
136
  switch (trackingConsent.toLowerCase()) {
160
137
  case 'granted':
161
138
  {
162
139
  return _TrackingConsent.TrackingConsent.GRANTED;
163
140
  }
164
-
165
141
  case 'pending':
166
142
  {
167
143
  return _TrackingConsent.TrackingConsent.PENDING;
168
144
  }
169
-
170
145
  case 'not_granted':
171
146
  {
172
147
  return _TrackingConsent.TrackingConsent.NOT_GRANTED;
173
148
  }
174
-
175
149
  default:
176
150
  {
177
151
  return _DdSdkReactNativeConfiguration.DEFAULTS.trackingConsent;
178
152
  }
179
153
  }
180
154
  };
181
-
182
155
  const buildSdkVerbosity = verbosity => {
183
156
  if (verbosity === undefined) {
184
157
  return undefined;
185
158
  }
186
-
187
159
  switch (verbosity.toLowerCase()) {
188
160
  case 'debug':
189
161
  {
190
162
  return _SdkVerbosity.SdkVerbosity.DEBUG;
191
163
  }
192
-
193
164
  case 'info':
194
165
  {
195
166
  return _SdkVerbosity.SdkVerbosity.INFO;
196
167
  }
197
-
198
168
  case 'warn':
199
169
  {
200
170
  return _SdkVerbosity.SdkVerbosity.WARN;
201
171
  }
202
-
203
172
  case 'error':
204
173
  {
205
174
  return _SdkVerbosity.SdkVerbosity.ERROR;
206
175
  }
207
-
208
176
  default:
209
177
  {
210
178
  return undefined;
@@ -1 +1 @@
1
- {"version":3,"sources":["FileBasedConfiguration.ts"],"names":["FileBasedConfiguration","DatadogProviderConfiguration","constructor","params","configuration","getJSONConfiguration","clientToken","env","applicationId","trackInteractions","trackResources","trackErrors","trackingConsent","longTaskThresholdMs","DEFAULTS","verbosity","actionNameAttribute","resourceTracingSamplingRate","firstPartyHosts","getFirstPartyHosts","errorEventMapper","resourceEventMapper","actionEventMapper","resolveJSONConfiguration","userSpecifiedConfiguration","undefined","jsonContent","require","console","error","buildTrackingConsent","buildSdkVerbosity","buildFirstPartyHosts","map","match","propagatorTypes","formatPropagatorType","message","propagatorType","toLowerCase","PropagatorType","B3","B3MULTI","DATADOG","TRACECONTEXT","Error","TrackingConsent","GRANTED","PENDING","NOT_GRANTED","SdkVerbosity","DEBUG","INFO","WARN","ERROR"],"mappings":";;;;;;;AAOA;;AAIA;;AACA;;AAIA;;AAhBA;AACA;AACA;AACA;AACA;AAcO,MAAMA,sBAAN,SAAqCC,2DAArC,CAAkE;AACrEC,EAAAA,WAAW,CAACC,MAAD,EAKR;AACC,UAAMC,aAAa,GAAGC,oBAAoB,CAACF,MAAD,aAACA,MAAD,uBAACA,MAAM,CAAEC,aAAT,CAA1C;AACA,UACIA,aAAa,CA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mB,iBAAiB,GACnBhB,SADsB,IAEK;AAC3B,MAAIA,SAAS,KAAKU,SAAlB,EAA6B;AACzB,WAAOA,SAAP;AACH;;AACD,UAAQV,SAAS,CAACwB,WAAV,EAAR;AACI,SAAK,OAAL;AAAc;AACV,eAAOW,2BAAaC,KAApB;AACH;;AACD,SAAK,MAAL;AAAa;AACT,eAAOD,2BAAaE,IAApB;AACH;;AACD,SAAK,MAAL;AAAa;AACT,eAAOF,2BAAaG,IAApB;AACH;;AACD,SAAK,OAAL;AAAc;AACV,eAAOH,2BAAaI,KAApB;AACH;;AACD;AAAS;AACL,eAAO7B,SAAP;AACH;AAfL;AAiBH,CAvBD","sourcesContent":["/*\n * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.\n * This product includes software developed at Datadog (https://www.datadoghq.com/).\n * Copyright 2016-Present Datadog, Inc.\n */\n\nimport type { FirstPartyHostsConfiguration } from '../../DdSdkReactNativeConfiguration';\nimport {\n DatadogProviderConfiguration,\n DEFAULTS\n} from '../../DdSdkReactNativeConfiguration';\nimport { SdkVerbosity } from '../../SdkVerbosity';\nimport { TrackingConsent } from '../../TrackingConsent';\nimport type { ActionEventMapper } from '../../rum/eventMappers/actionEventMapper';\nimport type { ErrorEventMapper } from '../../rum/eventMappers/errorEventMapper';\nimport type { ResourceEventMapper } from '../../rum/eventMappers/resourceEventMapper';\nimport { PropagatorType } from '../../rum/types';\n\nexport class FileBasedConfiguration extends DatadogProviderConfiguration {\n constructor(params?: {\n configuration?: unknown;\n errorEventMapper?: ErrorEventMapper;\n resourceEventMapper?: ResourceEventMapper;\n actionEventMapper?: ActionEventMapper;\n }) {\n const configuration = getJSONConfiguration(params?.configuration);\n super(\n configuration.clientToken,\n configuration.env,\n configuration.applicationId,\n configuration.trackInteractions,\n configuration.trackResources,\n configuration.trackErrors,\n configuration.trackingConsent\n );\n this.longTaskThresholdMs =\n configuration.longTaskThresholdMs || DEFAULTS.longTaskThresholdMs;\n this.verbosity = configuration.verbosity;\n this.actionNameAttribute = configuration.actionNameAttribute;\n this.resourceTracingSamplingRate =\n configuration.resourceTracingSamplingRate ||\n DEFAULTS.resourceTracingSamplingRate;\n this.firstPartyHosts =\n configuration.firstPartyHosts || DEFAULTS.getFirstPartyHosts();\n this.errorEventMapper =\n params?.errorEventMapper || DEFAULTS.errorEventMapper;\n this.resourceEventMapper =\n params?.resourceEventMapper || DEFAULTS.resourceEventMapper;\n this.actionEventMapper =\n params?.actionEventMapper || DEFAULTS.actionEventMapper;\n }\n}\n\nconst resolveJSONConfiguration = (\n userSpecifiedConfiguration: unknown\n): Record<string, any> => {\n if (\n userSpecifiedConfiguration === undefined ||\n userSpecifiedConfiguration === null\n ) {\n try {\n // This corresponds to a file located at the root of a RN project.\n // /!\\ We have to write the require this way as dynamic requires are not supported by Hermes.\n // eslint-disable-next-line global-require, @typescript-eslint/no-var-requires\n const jsonContent = require('../../../../../../datadog-configuration.json');\n\n if (\n typeof jsonContent !== 'object' ||\n !jsonContent['configuration']\n ) {\n console.error(`Failed to parse the Datadog configuration file located at the root of the project.\nYour configuration must validate the node_modules/@datadog/mobile-react-native/datadog-configuration.schema.json JSON schema.\nYou can use VSCode to check your configuration by adding the following line to your JSON file:\n{\n \"$schema\": \"./node_modules/@datadog/mobile-react-native/datadog-configuration.schema.json\",\n}`);\n\n return {};\n }\n\n return jsonContent.configuration as Record<string, any>;\n } catch (error) {\n console.error(`Failed to read Datadog configuration file at the root of the project.\nIf you don't have a datadog-configuration.json file at the same level as your node_modules directory,\\\nplease use the following syntax:\\n\nnew FileBasedConfiguration({configuration: require('./file/to/configuration-file.json')})\n`);\n return {};\n }\n }\n if (\n typeof userSpecifiedConfiguration !== 'object' ||\n !(userSpecifiedConfiguration as any)['configuration']\n ) {\n console.error(`Failed to parse the Datadog configuration file you provided.\nYour configuration must validate the node_modules/@datadog/mobile-react-native/datadog-configuration.schema.json JSON schema.\nYou can use VSCode to check your configuration by adding the following line to your JSON file:\n{\n \"$schema\": \"./node_modules/@datadog/mobile-react-native/datadog-configuration.schema.json\",\n}`);\n\n return {};\n }\n\n return (userSpecifiedConfiguration as any)['configuration'] as Record<\n string,\n any\n >;\n};\n\nexport const getJSONConfiguration = (\n userSpecifiedConfiguration: unknown\n): {\n clientToken: string;\n env: string;\n applicationId: string;\n trackInteractions: boolean | undefined;\n trackResources: boolean | undefined;\n trackErrors: boolean | undefined;\n trackingConsent: TrackingConsent | undefined;\n longTaskThresholdMs: number | undefined;\n verbosity: SdkVerbosity | undefined;\n actionNameAttribute: string | undefined;\n resourceTracingSamplingRate: number | undefined;\n firstPartyHosts: FirstPartyHostsConfiguration | undefined;\n} => {\n const configuration = resolveJSONConfiguration(userSpecifiedConfiguration);\n\n return {\n clientToken: configuration.clientToken,\n env: configuration.env,\n applicationId: configuration.applicationId,\n trackInteractions: configuration.trackInteractions,\n trackResources: configuration.trackResources,\n trackErrors: configuration.trackErrors,\n trackingConsent: buildTrackingConsent(configuration.trackingConsent),\n longTaskThresholdMs: configuration.longTaskThresholdMs,\n verbosity: buildSdkVerbosity(configuration.verbosity),\n actionNameAttribute: configuration.actionNameAttribute,\n resourceTracingSamplingRate: configuration.resourceTracingSamplingRate,\n firstPartyHosts: buildFirstPartyHosts(configuration.firstPartyHosts)\n };\n};\n\nconst buildFirstPartyHosts = (\n firstPartyHosts: { match: string; propagatorTypes: string[] }[] | undefined\n): FirstPartyHostsConfiguration | undefined => {\n if (!firstPartyHosts) {\n return undefined;\n }\n\n try {\n return firstPartyHosts.map(({ match, propagatorTypes }) => ({\n match,\n propagatorTypes: propagatorTypes.map(formatPropagatorType)\n }));\n } catch (error) {\n console.error(`Failed to parse the first party hosts from the Datadog configuration file you provided:\n${(error as any).message}\nThe first party hosts will not be set for this session.\n`);\n return undefined;\n }\n};\n\nexport const formatPropagatorType = (\n propagatorType: string\n): PropagatorType => {\n switch (propagatorType.toLowerCase()) {\n case 'b3': {\n return PropagatorType.B3;\n }\n case 'b3multi': {\n return PropagatorType.B3MULTI;\n }\n case 'datadog': {\n return PropagatorType.DATADOG;\n }\n case 'tracecontext': {\n return PropagatorType.TRACECONTEXT;\n }\n default: {\n throw new Error(\n `Failed to parse propagator type ${propagatorType}.`\n );\n }\n }\n};\n\nconst buildTrackingConsent = (\n trackingConsent: string | undefined\n): TrackingConsent | undefined => {\n if (trackingConsent === undefined) {\n return undefined;\n }\n switch (trackingConsent.toLowerCase()) {\n case 'granted': {\n return TrackingConsent.GRANTED;\n }\n case 'pending': {\n return TrackingConsent.PENDING;\n }\n case 'not_granted': {\n return TrackingConsent.NOT_GRANTED;\n }\n default: {\n return DEFAULTS.trackingConsent;\n }\n }\n};\n\nconst buildSdkVerbosity = (\n verbosity: string | undefined\n): SdkVerbosity | undefined => {\n if (verbosity === undefined) {\n return undefined;\n }\n switch (verbosity.toLowerCase()) {\n case 'debug': {\n return SdkVerbosity.DEBUG;\n }\n case 'info': {\n return SdkVerbosity.INFO;\n }\n case 'warn': {\n return SdkVerbosity.WARN;\n }\n case 'error': {\n return SdkVerbosity.ERROR;\n }\n default: {\n return undefined;\n }\n }\n};\n"]}
1
+ {"version":3,"names":["_DdSdkReactNativeConfiguration","require","_SdkVerbosity","_TrackingConsent","_types","FileBasedConfiguration","DatadogProviderConfiguration","constructor","params","configuration","getJSONConfiguration","clientToken","env","applicationId","trackInteractions","trackResources","trackErrors","trackingConsent","longTaskThresholdMs","DEFAULTS","verbosity","actionNameAttribute","resourceTracingSamplingRate","firstPartyHosts","getFirstPartyHosts","errorEventMapper","resourceEventMapper","actionEventMapper","exports","resolveJSONConfiguration","userSpecifiedConfiguration","undefined","jsonContent","console","error","buildTrackingConsent","buildSdkVerbosity","buildFirstPartyHosts","map","match","propagatorTypes","formatPropagatorType","message","propagatorType","toLowerCase","PropagatorType","B3","B3MULTI","DATADOG","TRACECONTEXT","Error","TrackingConsent","GRANTED","PENDING","NOT_GRANTED","SdkVerbosity","DEBUG","INFO","WARN","ERROR"],"sourceRoot":"../../../../src","sources":["sdk/FileBasedConfiguration/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,KAAKc,SAAS,EAAE;IAC/B,OAAOA,SAAS;EACpB;EACA,QAAQd,eAAe,CAAC2B,WAAW,CAAC,CAAC;IACjC,KAAK,SAAS;MAAE;QACZ,OAAOO,gCAAe,CAACC,OAAO;MAClC;IACA,KAAK,SAAS;MAAE;QACZ,OAAOD,gCAAe,CAACE,OAAO;MAClC;IACA,KAAK,aAAa;MAAE;QAChB,OAAOF,gCAAe,CAACG,WAAW;MACtC;IACA;MAAS;QACL,OAAOnC,uCAAQ,CAACF,eAAe;MACnC;EACJ;AACJ,CAAC;AAED,MAAMmB,iBAAiB,GACnBhB,SAA6B,IACF;EAC3B,IAAIA,SAAS,KAAKW,SAAS,EAAE;IACzB,OAAOA,SAAS;EACpB;EACA,QAAQX,SAAS,CAACwB,WAAW,CAAC,CAAC;IAC3B,KAAK,OAAO;MAAE;QACV,OAAOW,0BAAY,CAACC,KAAK;MAC7B;IACA,KAAK,MAAM;MAAE;QACT,OAAOD,0BAAY,CAACE,IAAI;MAC5B;IACA,KAAK,MAAM;MAAE;QACT,OAAOF,0BAAY,CAACG,IAAI;MAC5B;IACA,KAAK,OAAO;MAAE;QACV,OAAOH,0BAAY,CAACI,KAAK;MAC7B;IACA;MAAS;QACL,OAAO5B,SAAS;MACpB;EACJ;AACJ,CAAC","ignoreList":[]}
@@ -4,9 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.GlobalState = void 0;
7
-
8
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
-
10
7
  /*
11
8
  * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
12
9
  * This product includes software developed at Datadog (https://www.datadoghq.com/).
@@ -18,21 +15,19 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
18
15
  * the SDK classes.
19
16
  */
20
17
  class GlobalState {
21
- constructor() {
22
- _defineProperty(this, "isInitialized", false);
23
- }
18
+ /**
19
+ * `true` if the SDK is initialized, `false` otherwise.
20
+ */
21
+ isInitialized = false;
24
22
 
23
+ // Singleton implementation
24
+ static _instance = undefined;
25
25
  static get instance() {
26
26
  if (this._instance === undefined) {
27
27
  this._instance = new GlobalState();
28
28
  }
29
-
30
29
  return this._instance;
31
30
  }
32
-
33
31
  }
34
-
35
32
  exports.GlobalState = GlobalState;
36
-
37
- _defineProperty(GlobalState, "_instance", undefined);
38
33
  //# sourceMappingURL=GlobalState.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["GlobalState.tsx"],"names":["GlobalState","instance","_instance","undefined"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACO,MAAMA,WAAN,CAAkB;AAAA;AAAA,2CAIE,KAJF;AAAA;;AAQK,aAARC,QAAQ,GAAgB;AACtC,QAAI,KAAKC,SAAL,KAAmBC,SAAvB,EAAkC;AAC9B,WAAKD,SAAL,GAAiB,IAAIF,WAAJ,EAAjB;AACH;;AAED,WAAO,KAAKE,SAAZ;AACH;;AAdoB;;;;gBAAZF,W,eAO2CG,S","sourcesContent":["/*\n * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.\n * This product includes software developed at Datadog (https://www.datadoghq.com/).\n * Copyright 2016-Present Datadog, Inc.\n */\n\n/**\n * A singleton container for attributes that are shared internally across all\n * the SDK classes.\n */\nexport class GlobalState {\n /**\n * `true` if the SDK is initialized, `false` otherwise.\n */\n public isInitialized = false;\n\n // Singleton implementation\n private static _instance: GlobalState | undefined = undefined;\n public static get instance(): GlobalState {\n if (this._instance === undefined) {\n this._instance = new GlobalState();\n }\n\n return this._instance;\n }\n}\n"]}
1
+ {"version":3,"names":["GlobalState","isInitialized","_instance","undefined","instance","exports"],"sourceRoot":"../../../../src","sources":["sdk/GlobalState/GlobalState.tsx"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACO,MAAMA,WAAW,CAAC;EACrB;AACJ;AACA;EACWC,aAAa,GAAG,KAAK;;EAE5B;EACA,OAAeC,SAAS,GAA4BC,SAAS;EAC7D,WAAkBC,QAAQA,CAAA,EAAgB;IACtC,IAAI,IAAI,CAACF,SAAS,KAAKC,SAAS,EAAE;MAC9B,IAAI,CAACD,SAAS,GAAG,IAAIF,WAAW,CAAC,CAAC;IACtC;IAEA,OAAO,IAAI,CAACE,SAAS;EACzB;AACJ;AAACG,OAAA,CAAAL,WAAA,GAAAA,WAAA","ignoreList":[]}
@@ -4,40 +4,29 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.UserInfoSingleton = void 0;
7
-
8
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
-
10
7
  /*
11
8
  * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
12
9
  * This product includes software developed at Datadog (https://www.datadoghq.com/).
13
10
  * Copyright 2016-Present Datadog, Inc.
14
11
  */
15
- class UserInfoProvider {
16
- constructor() {
17
- _defineProperty(this, "userInfo", {});
18
-
19
- _defineProperty(this, "setUserInfo", userInfo => {
20
- this.userInfo = userInfo;
21
- });
22
-
23
- _defineProperty(this, "getUserInfo", () => {
24
- return this.userInfo;
25
- });
26
- }
27
12
 
13
+ class UserInfoProvider {
14
+ userInfo = {};
15
+ setUserInfo = userInfo => {
16
+ this.userInfo = userInfo;
17
+ };
18
+ getUserInfo = () => {
19
+ return this.userInfo;
20
+ };
21
+ }
22
+ class UserInfoSingleton {
23
+ static userInfoProvider = new UserInfoProvider();
24
+ static getInstance = () => {
25
+ return UserInfoSingleton.userInfoProvider;
26
+ };
27
+ static reset = () => {
28
+ UserInfoSingleton.userInfoProvider = new UserInfoProvider();
29
+ };
28
30
  }
29
-
30
- class UserInfoSingleton {}
31
-
32
31
  exports.UserInfoSingleton = UserInfoSingleton;
33
-
34
- _defineProperty(UserInfoSingleton, "userInfoProvider", new UserInfoProvider());
35
-
36
- _defineProperty(UserInfoSingleton, "getInstance", () => {
37
- return UserInfoSingleton.userInfoProvider;
38
- });
39
-
40
- _defineProperty(UserInfoSingleton, "reset", () => {
41
- UserInfoSingleton.userInfoProvider = new UserInfoProvider();
42
- });
43
32
  //# sourceMappingURL=UserInfoSingleton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["UserInfoSingleton.ts"],"names":["UserInfoProvider","userInfo","UserInfoSingleton","userInfoProvider"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAIA,MAAMA,gBAAN,CAAuB;AAAA;AAAA,sCACU,EADV;;AAAA,yCAGJC,QAAD,IAAwB;AAClC,WAAKA,QAAL,GAAgBA,QAAhB;AACH,KALkB;;AAAA,yCAOL,MAAgB;AAC1B,aAAO,KAAKA,QAAZ;AACH,KATkB;AAAA;;AAAA;;AAYhB,MAAMC,iBAAN,CAAwB;;;;gBAAlBA,iB,sBACyB,IAAIF,gBAAJ,E;;gBADzBE,iB,iBAGY,MAAwB;AACzC,SAAOA,iBAAiB,CAACC,gBAAzB;AACH,C;;gBALQD,iB,WAOM,MAAM;AACjBA,EAAAA,iBAAiB,CAACC,gBAAlB,GAAqC,IAAIH,gBAAJ,EAArC;AACH,C","sourcesContent":["/*\n * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.\n * This product includes software developed at Datadog (https://www.datadoghq.com/).\n * Copyright 2016-Present Datadog, Inc.\n */\n\nimport type { UserInfo } from './types';\n\nclass UserInfoProvider {\n private userInfo: UserInfo = {};\n\n setUserInfo = (userInfo: UserInfo) => {\n this.userInfo = userInfo;\n };\n\n getUserInfo = (): UserInfo => {\n return this.userInfo;\n };\n}\n\nexport class UserInfoSingleton {\n private static userInfoProvider = new UserInfoProvider();\n\n static getInstance = (): UserInfoProvider => {\n return UserInfoSingleton.userInfoProvider;\n };\n\n static reset = () => {\n UserInfoSingleton.userInfoProvider = new UserInfoProvider();\n };\n}\n"]}
1
+ {"version":3,"names":["UserInfoProvider","userInfo","setUserInfo","getUserInfo","UserInfoSingleton","userInfoProvider","getInstance","reset","exports"],"sourceRoot":"../../../../src","sources":["sdk/UserInfoSingleton/UserInfoSingleton.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;;AAIA,MAAMA,gBAAgB,CAAC;EACXC,QAAQ,GAAa,CAAC,CAAC;EAE/BC,WAAW,GAAID,QAAkB,IAAK;IAClC,IAAI,CAACA,QAAQ,GAAGA,QAAQ;EAC5B,CAAC;EAEDE,WAAW,GAAGA,CAAA,KAAgB;IAC1B,OAAO,IAAI,CAACF,QAAQ;EACxB,CAAC;AACL;AAEO,MAAMG,iBAAiB,CAAC;EAC3B,OAAeC,gBAAgB,GAAG,IAAIL,gBAAgB,CAAC,CAAC;EAExD,OAAOM,WAAW,GAAGA,CAAA,KAAwB;IACzC,OAAOF,iBAAiB,CAACC,gBAAgB;EAC7C,CAAC;EAED,OAAOE,KAAK,GAAGA,CAAA,KAAM;IACjBH,iBAAiB,CAACC,gBAAgB,GAAG,IAAIL,gBAAgB,CAAC,CAAC;EAC/D,CAAC;AACL;AAACQ,OAAA,CAAAJ,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["sdk/UserInfoSingleton/types.ts"],"mappings":"","ignoreList":[]}
@@ -4,18 +4,16 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _reactNative = require("react-native");
9
-
10
8
  /*
11
9
  * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
12
10
  * This product includes software developed at Datadog (https://www.datadoghq.com/).
13
11
  * Copyright 2016-Present Datadog, Inc.
14
12
  */
15
-
16
13
  /* eslint-disable @typescript-eslint/ban-types */
14
+ /**
15
+ * Do not import this Spec directly, use DdNativeLogsType instead.
16
+ */
17
17
  // eslint-disable-next-line import/no-default-export
18
- var _default = _reactNative.TurboModuleRegistry.get('DdLogs');
19
-
20
- exports.default = _default;
18
+ var _default = exports.default = _reactNative.TurboModuleRegistry.get('DdLogs');
21
19
  //# sourceMappingURL=NativeDdLogs.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["NativeDdLogs.ts"],"names":["TurboModuleRegistry","get"],"mappings":";;;;;;;AAQA;;AARA;AACA;AACA;AACA;AACA;;AAEA;AAuGA;eACeA,iCAAoBC,GAApB,CAA8B,QAA9B,C","sourcesContent":["/*\n * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.\n * This product includes software developed at Datadog (https://www.datadoghq.com/).\n * Copyright 2016-Present Datadog, Inc.\n */\n\n/* eslint-disable @typescript-eslint/ban-types */\nimport type { TurboModule } from 'react-native';\nimport { TurboModuleRegistry } from 'react-native';\n\n/**\n * Do not import this Spec directly, use DdNativeLogsType instead.\n */\nexport interface Spec extends TurboModule {\n readonly getConstants: () => {};\n\n /**\n * Send a log with DEBUG level.\n * @param message: The message to send.\n * @param context: The additional context to send.\n */\n readonly debug: (message: string, context: Object) => Promise<void>;\n\n /**\n * Send a log with INFO level.\n * @param message: The message to send.\n * @param context: The additional context to send.\n */\n readonly info: (message: string, context: Object) => Promise<void>;\n\n /**\n * Send a log with WARN level.\n * @param message: The message to send.\n * @param context: The additional context to send.\n */\n readonly warn: (message: string, context: Object) => Promise<void>;\n\n /**\n * Send a log with ERROR level.\n * @param message: The message to send.\n * @param context: The additional context to send.\n */\n readonly error: (message: string, context: Object) => Promise<void>;\n\n /**\n * Send a log containing an error with DEBUG level.\n * @param message: The message to send.\n * @param errorKind: The error kind to send.\n * @param errorMessage: The error message to send.\n * @param stacktrace: The stack trace to send.\n * @param context: The additional context to send.\n */\n readonly debugWithError: (\n message: string,\n errorKind: string,\n errorMessage: string,\n stacktrace: string,\n context: Object\n ) => Promise<void>;\n\n /**\n * Send a log containing an error with INFO level.\n * @param message: The message to send.\n * @param errorKind: The error kind to send.\n * @param errorMessage: The error message to send.\n * @param stacktrace: The stack trace to send.\n * @param context: The additional context to send.\n */\n readonly infoWithError: (\n message: string,\n errorKind: string,\n errorMessage: string,\n stacktrace: string,\n context: Object\n ) => Promise<void>;\n\n /**\n * Send a log containing an error with WARN level.\n * @param message: The message to send.\n * @param errorKind: The error kind to send.\n * @param errorMessage: The error message to send.\n * @param stacktrace: The stack trace to send.\n * @param context: The additional context to send.\n */\n readonly warnWithError: (\n message: string,\n errorKind: string,\n errorMessage: string,\n stacktrace: string,\n context: Object\n ) => Promise<void>;\n\n /**\n * Send a log containing an error with ERROR level.\n * @param message: The message to send.\n * @param errorKind: The error kind to send.\n * @param errorMessage: The error message to send.\n * @param stacktrace: The stack trace to send.\n * @param context: The additional context to send.\n */\n readonly errorWithError: (\n message: string,\n errorKind: string,\n errorMessage: string,\n stacktrace: string,\n context: Object\n ) => Promise<void>;\n}\n\n// eslint-disable-next-line import/no-default-export\nexport default TurboModuleRegistry.get<Spec>('DdLogs');\n"]}
1
+ {"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["specs/NativeDdLogs.ts"],"mappings":";;;;;;AAQA,IAAAA,YAAA,GAAAC,OAAA;AARA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AAiGA;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACeC,gCAAmB,CAACC,GAAG,CAAO,QAAQ,CAAC","ignoreList":[]}
@@ -4,18 +4,16 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _reactNative = require("react-native");
9
-
10
8
  /*
11
9
  * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
12
10
  * This product includes software developed at Datadog (https://www.datadoghq.com/).
13
11
  * Copyright 2016-Present Datadog, Inc.
14
12
  */
15
-
16
13
  /* eslint-disable @typescript-eslint/ban-types */
14
+ /**
15
+ * Do not import this Spec directly, use DdNativeRumType instead.
16
+ */
17
17
  // eslint-disable-next-line import/no-default-export
18
- var _default = _reactNative.TurboModuleRegistry.get('DdRum');
19
-
20
- exports.default = _default;
18
+ var _default = exports.default = _reactNative.TurboModuleRegistry.get('DdRum');
21
19
  //# sourceMappingURL=NativeDdRum.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["NativeDdRum.ts"],"names":["TurboModuleRegistry","get"],"mappings":";;;;;;;AAQA;;AARA;AACA;AACA;AACA;AACA;;AAEA;AAqJA;eACeA,iCAAoBC,GAApB,CAA8B,OAA9B,C","sourcesContent":["/*\n * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.\n * This product includes software developed at Datadog (https://www.datadoghq.com/).\n * Copyright 2016-Present Datadog, Inc.\n */\n\n/* eslint-disable @typescript-eslint/ban-types */\nimport type { TurboModule } from 'react-native';\nimport { TurboModuleRegistry } from 'react-native';\n\n/**\n * Do not import this Spec directly, use DdNativeRumType instead.\n */\nexport interface Spec extends TurboModule {\n readonly getConstants: () => {};\n\n /**\n * Start tracking a RUM View.\n * @param key: The view unique key identifier.\n * @param name: The view name.\n * @param context: The additional context to send.\n * @param timestampMs: The timestamp when the view started (in milliseconds). If not provided, current timestamp will be used.\n */\n startView(\n key: string,\n name: string,\n context: Object,\n timestampMs: number\n ): Promise<void>;\n\n /**\n * Stop tracking a RUM View.\n * @param key: The view unique key identifier.\n * @param context: The additional context to send.\n * @param timestampMs: The timestamp when the view stopped (in milliseconds). If not provided, current timestamp will be used.\n */\n stopView(key: string, context: Object, timestampMs: number): Promise<void>;\n\n /**\n * Start tracking a RUM Action.\n * @param type: The action type (tap, scroll, swipe, back, custom).\n * @param name: The action name.\n * @param context: The additional context to send.\n * @param timestampMs: The timestamp when the action started (in milliseconds). If not provided, current timestamp will be used.\n */\n startAction(\n type: string,\n name: string,\n context: Object,\n timestampMs: number\n ): Promise<void>;\n\n /**\n * Stop tracking the ongoing RUM Action.\n * @param type: The action type (tap, scroll, swipe, back, custom).\n * @param name: The action name.\n * @param context: The additional context to send.\n * @param timestampMs: The timestamp when the action stopped (in milliseconds). If not provided, current timestamp will be used.\n */\n stopAction(\n type: string,\n name: string,\n context: Object,\n timestampMs: number\n ): Promise<void>;\n\n /**\n * Add a RUM Action.\n * @param type: The action type (tap, scroll, swipe, back, custom).\n * @param name: The action name.\n * @param context: The additional context to send.\n * @param timestampMs: The timestamp when the action occurred (in milliseconds). If not provided, current timestamp will be used.\n */\n addAction(\n type: string,\n name: string,\n context: Object,\n timestampMs: number\n ): Promise<void>;\n\n /**\n * Start tracking a RUM Resource.\n * @param key: The resource unique key identifier.\n * @param method: The resource method (GET, POST, …).\n * @param url: The resource url.\n * @param context: The additional context to send.\n * @param timestampMs: The timestamp when the resource started (in milliseconds). If not provided, current timestamp will be used.\n */\n startResource(\n key: string,\n method: string,\n url: string,\n context: Object,\n timestampMs: number\n ): Promise<void>;\n\n /**\n * Stop tracking a RUM Resource.\n * @param key: The resource unique key identifier.\n * @param statusCode: The resource status code.\n * @param kind: The resource's kind (xhr, document, image, css, font, …).\n * @param size: The resource size in bytes. If size is unknown, use -1.\n * @param context: The additional context to send.\n * @param timestampMs: The timestamp when the resource stopped (in milliseconds). If not provided, current timestamp will be used.\n */\n stopResource(\n key: string,\n statusCode: number,\n kind: string,\n size: number,\n context: Object,\n timestampMs: number\n ): Promise<void>;\n\n /**\n * Add a RUM Error.\n * @param message: The error message.\n * @param source: The error source (network, source, console, webview, custom).\n * @param stacktrace: The error stacktrace.\n * @param context: The additional context to send.\n * @param timestampMs: The timestamp when the error occurred (in milliseconds). If not provided, current timestamp will be used.\n */\n addError(\n message: string,\n source: string,\n stacktrace: string,\n context: Object,\n timestampMs: number\n ): Promise<void>;\n\n /**\n * 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.\n * @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.\n */\n addTiming(name: string): Promise<void>;\n\n /**\n * Stops the current RUM Session.\n */\n stopSession(): Promise<void>;\n\n /**\n * Adds the result of evaluating a feature flag with a given name and value to the view.\n * Feature flag evaluations are local to the active view and are cleared when the view is stopped.\n * @param name: The name of the feature flag\n * @param value: The value of the feature flag, encapsulated in an Object to accept all types\n */\n addFeatureFlagEvaluation(name: string, value: Object): Promise<void>;\n\n /**\n * Get current Session ID, or `undefined` if not available.\n */\n getCurrentSessionId(): Promise<string | undefined>;\n}\n\n// eslint-disable-next-line import/no-default-export\nexport default TurboModuleRegistry.get<Spec>('DdRum');\n"]}
1
+ {"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["specs/NativeDdRum.ts"],"mappings":";;;;;;AAQA,IAAAA,YAAA,GAAAC,OAAA;AARA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AAiJA;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACeC,gCAAmB,CAACC,GAAG,CAAO,OAAO,CAAC","ignoreList":[]}
@@ -4,18 +4,16 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _reactNative = require("react-native");
9
-
10
8
  /*
11
9
  * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
12
10
  * This product includes software developed at Datadog (https://www.datadoghq.com/).
13
11
  * Copyright 2016-Present Datadog, Inc.
14
12
  */
15
-
16
13
  /* eslint-disable @typescript-eslint/ban-types */
14
+ /**
15
+ * Do not import this Spec directly, use DdNativeSdkType instead.
16
+ */
17
17
  // eslint-disable-next-line import/no-default-export
18
- var _default = _reactNative.TurboModuleRegistry.get('DdSdk');
19
-
20
- exports.default = _default;
18
+ var _default = exports.default = _reactNative.TurboModuleRegistry.get('DdSdk');
21
19
  //# sourceMappingURL=NativeDdSdk.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["NativeDdSdk.ts"],"names":["TurboModuleRegistry","get"],"mappings":";;;;;;;AAQA;;AARA;AACA;AACA;AACA;AACA;;AAEA;AA4DA;eACeA,iCAAoBC,GAApB,CAA8B,OAA9B,C","sourcesContent":["/*\n * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.\n * This product includes software developed at Datadog (https://www.datadoghq.com/).\n * Copyright 2016-Present Datadog, Inc.\n */\n\n/* eslint-disable @typescript-eslint/ban-types */\nimport type { TurboModule } from 'react-native';\nimport { TurboModuleRegistry } from 'react-native';\n\n/**\n * Do not import this Spec directly, use DdNativeSdkType instead.\n */\nexport interface Spec extends TurboModule {\n readonly getConstants: () => {};\n\n /**\n * Initializes Datadog's features.\n * @param configuration: The configuration to use.\n */\n initialize(configuration: Object): Promise<void>;\n\n /**\n * Sets the global context (set of attributes) attached with all future Logs, Spans and RUM events.\n * @param attributes: The global context attributes.\n */\n setAttributes(attributes: Object): Promise<void>;\n\n /**\n * Set the user information.\n * @param user: The user object (use builtin attributes: 'id', 'email', 'name', and/or any custom attribute).\n */\n setUser(user: Object): Promise<Object>;\n\n /**\n * Set the tracking consent regarding the data collection.\n * @param trackingConsent: Consent, which can take one of the following values: 'pending', 'granted', 'not_granted'.\n */\n setTrackingConsent(trackingConsent: string): Promise<void>;\n\n /**\n * Sends internal telemetry debug message\n * @param message debug message\n */\n telemetryDebug(message: string): Promise<void>;\n\n /**\n * Sends internal telemetry error\n * @param message error message\n * @param stack error stack\n * @param kind error kind\n */\n telemetryError(message: string, stack: string, kind: string): Promise<void>;\n\n /**\n * Send webview telemetry logs\n * @param message event description\n */\n consumeWebviewEvent(message: string): Promise<void>;\n\n /**\n * Clears all data that has not already been sent to Datadog servers\n */\n clearAllData(): Promise<void>;\n}\n\n// eslint-disable-next-line import/no-default-export\nexport default TurboModuleRegistry.get<Spec>('DdSdk');\n"]}
1
+ {"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["specs/NativeDdSdk.ts"],"mappings":";;;;;;AAQA,IAAAA,YAAA,GAAAC,OAAA;AARA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AAsDA;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACeC,gCAAmB,CAACC,GAAG,CAAO,OAAO,CAAC","ignoreList":[]}
@@ -4,18 +4,16 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _reactNative = require("react-native");
9
-
10
8
  /*
11
9
  * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
12
10
  * This product includes software developed at Datadog (https://www.datadoghq.com/).
13
11
  * Copyright 2016-Present Datadog, Inc.
14
12
  */
15
-
16
13
  /* eslint-disable @typescript-eslint/ban-types */
14
+ /**
15
+ * Do not import this Spec directly, use DdNativeTraceType instead.
16
+ */
17
17
  // eslint-disable-next-line import/no-default-export
18
- var _default = _reactNative.TurboModuleRegistry.get('DdTrace');
19
-
20
- exports.default = _default;
18
+ var _default = exports.default = _reactNative.TurboModuleRegistry.get('DdTrace');
21
19
  //# sourceMappingURL=NativeDdTrace.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["NativeDdTrace.ts"],"names":["TurboModuleRegistry","get"],"mappings":";;;;;;;AAQA;;AARA;AACA;AACA;AACA;AACA;;AAEA;AAmCA;eACeA,iCAAoBC,GAApB,CAA8B,SAA9B,C","sourcesContent":["/*\n * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.\n * This product includes software developed at Datadog (https://www.datadoghq.com/).\n * Copyright 2016-Present Datadog, Inc.\n */\n\n/* eslint-disable @typescript-eslint/ban-types */\nimport type { TurboModule } from 'react-native';\nimport { TurboModuleRegistry } from 'react-native';\n\n/**\n * Do not import this Spec directly, use DdNativeTraceType instead.\n */\nexport interface Spec extends TurboModule {\n readonly getConstants: () => {};\n\n /**\n * Start a span, and returns a unique identifier for the span.\n * @param operation: The operation name of the span.\n * @param context: The additional context to send.\n * @param timestampMs: The timestamp when the operation started (in milliseconds). If not provided, current timestamp will be used.\n */\n startSpan(\n operation: string,\n context: Object,\n timestampMs: number\n ): Promise<string>;\n\n /**\n * Finish a started span.\n * @param spanId: The unique identifier of the span.\n * @param context: The additional context to send.\n * @param timestampMs: The timestamp when the operation stopped (in milliseconds). If not provided, current timestamp will be used.\n */\n finishSpan(\n spanId: string,\n context: Object,\n timestampMs: number\n ): Promise<void>;\n}\n\n// eslint-disable-next-line import/no-default-export\nexport default TurboModuleRegistry.get<Spec>('DdTrace');\n"]}
1
+ {"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["specs/NativeDdTrace.ts"],"mappings":";;;;;;AAQA,IAAAA,YAAA,GAAAC,OAAA;AARA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AA6BA;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACeC,gCAAmB,CAACC,GAAG,CAAO,SAAS,CAAC","ignoreList":[]}
@@ -4,42 +4,30 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.DdTrace = void 0;
7
-
8
7
  var _InternalLog = require("../InternalLog");
9
-
10
8
  var _SdkVerbosity = require("../SdkVerbosity");
11
-
12
9
  var _bufferNativeCall = require("../sdk/DatadogProvider/Buffer/bufferNativeCall");
13
-
14
10
  var _argsUtils = require("../utils/argsUtils");
15
-
16
11
  var _DefaultTimeProvider = require("../utils/time-provider/DefaultTimeProvider");
17
-
18
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12
+ /*
13
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
14
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
15
+ * Copyright 2016-Present Datadog, Inc.
16
+ */
19
17
 
20
18
  const timeProvider = new _DefaultTimeProvider.DefaultTimeProvider();
21
-
22
19
  class DdTraceWrapper {
23
- constructor() {
24
- _defineProperty(this, "nativeTrace", require('../specs/NativeDdTrace').default);
25
-
26
- _defineProperty(this, "startSpan", (operation, context = {}, timestampMs = timeProvider.now()) => {
27
- const spanId = (0, _bufferNativeCall.bufferNativeCallReturningId)(() => this.nativeTrace.startSpan(operation, (0, _argsUtils.validateContext)(context), timestampMs));
28
-
29
- _InternalLog.InternalLog.log(`Starting span “${operation}” #${spanId}`, _SdkVerbosity.SdkVerbosity.DEBUG);
30
-
31
- return spanId;
32
- });
33
-
34
- _defineProperty(this, "finishSpan", (spanId, context = {}, timestampMs = timeProvider.now()) => {
35
- _InternalLog.InternalLog.log(`Finishing span #${spanId}`, _SdkVerbosity.SdkVerbosity.DEBUG);
36
-
37
- return (0, _bufferNativeCall.bufferNativeCallWithId)(id => this.nativeTrace.finishSpan(id, (0, _argsUtils.validateContext)(context), timestampMs), spanId);
38
- });
39
- }
40
-
20
+ // eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
21
+ nativeTrace = require('../specs/NativeDdTrace').default;
22
+ startSpan = (operation, context = {}, timestampMs = timeProvider.now()) => {
23
+ const spanId = (0, _bufferNativeCall.bufferNativeCallReturningId)(() => this.nativeTrace.startSpan(operation, (0, _argsUtils.validateContext)(context), timestampMs));
24
+ _InternalLog.InternalLog.log(`Starting span “${operation}” #${spanId}`, _SdkVerbosity.SdkVerbosity.DEBUG);
25
+ return spanId;
26
+ };
27
+ finishSpan = (spanId, context = {}, timestampMs = timeProvider.now()) => {
28
+ _InternalLog.InternalLog.log(`Finishing span #${spanId}`, _SdkVerbosity.SdkVerbosity.DEBUG);
29
+ return (0, _bufferNativeCall.bufferNativeCallWithId)(id => this.nativeTrace.finishSpan(id, (0, _argsUtils.validateContext)(context), timestampMs), spanId);
30
+ };
41
31
  }
42
-
43
- const DdTrace = new DdTraceWrapper();
44
- exports.DdTrace = DdTrace;
32
+ const DdTrace = exports.DdTrace = new DdTraceWrapper();
45
33
  //# sourceMappingURL=DdTrace.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["DdTrace.ts"],"names":["timeProvider","DefaultTimeProvider","DdTraceWrapper","require","default","operation","context","timestampMs","now","spanId","nativeTrace","startSpan","InternalLog","log","SdkVerbosity","DEBUG","id","finishSpan","DdTrace"],"mappings":";;;;;;;AAMA;;AACA;;AAEA;;AAKA;;AACA;;;;AAEA,MAAMA,YAAY,GAAG,IAAIC,wCAAJ,EAArB;;AAEA,MAAMC,cAAN,CAA4C;AAAA;AAAA,yCAECC,OAAO,CAAC,wBAAD,CAAP,CACpCC,OAHmC;;AAAA,uCAK5B,CACRC,SADQ,EAERC,OAAe,GAAG,EAFV,EAGRC,WAAmB,GAAGP,YAAY,CAACQ,GAAb,EAHd,KAIU;AAClB,YAAMC,MAAM,GAAG,mDAA4B,MACvC,KAAKC,WAAL,CAAiBC,SAAjB,CACIN,SADJ,EAEI,gCAAgBC,OAAhB,CAFJ,EAGIC,WAHJ,CADW,CAAf;;AAOAK,+BAAYC,GAAZ,CACK,kBAAiBR,SAAU,MAAKI,MAAO,EAD5C,EAEIK,2BAAaC,KAFjB;;AAIA,aAAON,MAAP;AACH,KAtBuC;;AAAA,wCAwB3B,CACTA,MADS,EAETH,OAAe,GAAG,EAFT,EAGTC,WAAmB,GAAGP,YAAY,CAACQ,GAAb,EAHb,KAIO;AAChBI,+BAAYC,GAAZ,CAAiB,mBAAkBJ,MAAO,EAA1C,EAA6CK,2BAAaC,KAA1D;;AACA,aAAO,8CACHC,EAAE,IACE,KAAKN,WAAL,CAAiBO,UAAjB,CACID,EADJ,EAEI,gCAAgBV,OAAhB,CAFJ,EAGIC,WAHJ,CAFD,EAOHE,MAPG,CAAP;AASH,KAvCuC;AAAA;;AAAA;;AA0C5C,MAAMS,OAAoB,GAAG,IAAIhB,cAAJ,EAA7B","sourcesContent":["/*\n * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.\n * This product includes software developed at Datadog (https://www.datadoghq.com/).\n * Copyright 2016-Present Datadog, Inc.\n */\n\nimport { InternalLog } from '../InternalLog';\nimport { SdkVerbosity } from '../SdkVerbosity';\nimport type { DdNativeTraceType } from '../nativeModulesTypes';\nimport {\n bufferNativeCallReturningId,\n bufferNativeCallWithId\n} from '../sdk/DatadogProvider/Buffer/bufferNativeCall';\nimport type { DdTraceType } from '../types';\nimport { validateContext } from '../utils/argsUtils';\nimport { DefaultTimeProvider } from '../utils/time-provider/DefaultTimeProvider';\n\nconst timeProvider = new DefaultTimeProvider();\n\nclass DdTraceWrapper implements DdTraceType {\n // eslint-disable-next-line global-require, @typescript-eslint/no-var-requires\n private nativeTrace: DdNativeTraceType = require('../specs/NativeDdTrace')\n .default;\n\n startSpan = (\n operation: string,\n context: object = {},\n timestampMs: number = timeProvider.now()\n ): Promise<string> => {\n const spanId = bufferNativeCallReturningId(() =>\n this.nativeTrace.startSpan(\n operation,\n validateContext(context),\n timestampMs\n )\n );\n InternalLog.log(\n `Starting span “${operation}” #${spanId}`,\n SdkVerbosity.DEBUG\n );\n return spanId;\n };\n\n finishSpan = (\n spanId: string,\n context: object = {},\n timestampMs: number = timeProvider.now()\n ): Promise<void> => {\n InternalLog.log(`Finishing span #${spanId}`, SdkVerbosity.DEBUG);\n return bufferNativeCallWithId(\n id =>\n this.nativeTrace.finishSpan(\n id,\n validateContext(context),\n timestampMs\n ),\n spanId\n );\n };\n}\n\nconst DdTrace: DdTraceType = new DdTraceWrapper();\n\nexport { DdTrace };\n"]}
1
+ {"version":3,"names":["_InternalLog","require","_SdkVerbosity","_bufferNativeCall","_argsUtils","_DefaultTimeProvider","timeProvider","DefaultTimeProvider","DdTraceWrapper","nativeTrace","default","startSpan","operation","context","timestampMs","now","spanId","bufferNativeCallReturningId","validateContext","InternalLog","log","SdkVerbosity","DEBUG","finishSpan","bufferNativeCallWithId","id","DdTrace","exports"],"sourceRoot":"../../../src","sources":["trace/DdTrace.ts"],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[]}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.DdSdkConfiguration = void 0;
7
-
8
7
  /*
9
8
  * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
10
9
  * This product includes software developed at Datadog (https://www.datadoghq.com/).
@@ -43,12 +42,14 @@ class DdSdkConfiguration {
43
42
  this.bundleLogsWithRum = bundleLogsWithRum;
44
43
  this.bundleLogsWithTraces = bundleLogsWithTraces;
45
44
  }
46
-
47
45
  }
46
+
48
47
  /**
49
48
  * The entry point to initialize Datadog's features.
50
49
  */
51
50
 
52
-
51
+ /**
52
+ * The entry point to use Datadog's Trace feature.
53
+ */
53
54
  exports.DdSdkConfiguration = DdSdkConfiguration;
54
55
  //# sourceMappingURL=types.js.map