@datadog/mobile-react-native 2.14.1 → 3.0.1

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 (670) hide show
  1. package/DatadogSDKReactNative.podspec +6 -6
  2. package/README.md +23 -13
  3. package/android/build.gradle +10 -11
  4. package/android/gradle.properties +1 -1
  5. package/android/src/main/kotlin/com/datadog/reactnative/DatadogSDKWrapper.kt +36 -93
  6. package/android/src/main/kotlin/com/datadog/reactnative/DatadogWrapper.kt +46 -59
  7. package/android/src/main/kotlin/com/datadog/reactnative/DdLogsImplementation.kt +2 -1
  8. package/android/src/main/kotlin/com/datadog/reactnative/DdRumImplementation.kt +98 -0
  9. package/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfiguration.kt +125 -75
  10. package/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfigurationExt.kt +199 -90
  11. package/android/src/main/kotlin/com/datadog/reactnative/DdSdkImplementation.kt +151 -24
  12. package/android/src/main/kotlin/com/datadog/reactnative/DdSdkNativeInitialization.kt +57 -33
  13. package/android/src/main/kotlin/com/datadog/reactnative/DdSdkReactNativePackage.kt +2 -1
  14. package/android/src/main/kotlin/com/datadog/reactnative/DdTelemetry.kt +96 -0
  15. package/android/src/main/kotlin/com/datadog/reactnative/DdTraceImplementation.kt +20 -19
  16. package/android/src/main/kotlin/com/datadog/reactnative/SdkVersion.kt +1 -1
  17. package/android/src/newarch/kotlin/com/datadog/reactnative/DdRum.kt +100 -1
  18. package/android/src/newarch/kotlin/com/datadog/reactnative/DdSdk.kt +68 -14
  19. package/android/src/oldarch/kotlin/com/datadog/reactnative/DdRum.kt +94 -0
  20. package/android/src/oldarch/kotlin/com/datadog/reactnative/DdSdk.kt +70 -11
  21. package/android/src/test/kotlin/com/datadog/reactnative/DdRumTest.kt +58 -0
  22. package/android/src/test/kotlin/com/datadog/reactnative/DdSdkNativeInitializationTest.kt +63 -43
  23. package/android/src/test/kotlin/com/datadog/reactnative/DdSdkTest.kt +2024 -1199
  24. package/android/src/test/kotlin/com/datadog/reactnative/DdTraceTest.kt +44 -40
  25. package/android/src/test/kotlin/com/datadog/tools/unit/DdSdkConfigurationExt.kt +60 -91
  26. package/android/src/test/kotlin/com/datadog/tools/unit/MockRumMonitor.kt +34 -14
  27. package/android/src/test/kotlin/com/datadog/tools/unit/forge/DdSdkConfigurationForgeryFactory.kt +47 -43
  28. package/android/src/test/kotlin/com/datadog/tools/unit/forge/TelemetryConfigurationEventForgeryFactory.kt +0 -1
  29. package/android/src/test/resources/input/complete-configuration.json +32 -28
  30. package/android/src/test/resources/input/malformed-configuration.json +1 -1
  31. package/android/src/test/resources/input/minimal-configuration.json +4 -2
  32. package/datadog-configuration.schema.json +187 -139
  33. package/ios/Sources/AnyEncodable.swift +14 -7
  34. package/ios/Sources/Attributes.swift +0 -7
  35. package/ios/Sources/DatadogSDKWrapper.swift +12 -128
  36. package/ios/Sources/DdLogsImplementation.swift +9 -39
  37. package/ios/Sources/DdRum.mm +89 -1
  38. package/ios/Sources/DdRumImplementation.swift +79 -0
  39. package/ios/Sources/DdSdk.mm +76 -11
  40. package/ios/Sources/DdSdkConfiguration.swift +159 -117
  41. package/ios/Sources/DdSdkImplementation.swift +235 -82
  42. package/ios/Sources/DdSdkNativeInitialization.swift +116 -80
  43. package/ios/Sources/DdTelemetry.swift +49 -0
  44. package/ios/Sources/GlobalState.swift +1 -1
  45. package/ios/Sources/RNDdSdkConfiguration.swift +334 -172
  46. package/ios/Sources/SdkVersion.swift +1 -1
  47. package/jest/mock.js +43 -4
  48. package/lib/commonjs/DdAttributes.js.map +1 -0
  49. package/lib/commonjs/DdSdkReactNative.js +159 -56
  50. package/lib/commonjs/DdSdkReactNative.js.map +1 -1
  51. package/lib/commonjs/InternalLog.js +1 -1
  52. package/lib/commonjs/config/DatadogProviderConfiguration.js +25 -0
  53. package/lib/commonjs/config/DatadogProviderConfiguration.js.map +1 -0
  54. package/lib/commonjs/config/FileBasedConfiguration.js +349 -0
  55. package/lib/commonjs/config/FileBasedConfiguration.js.map +1 -0
  56. package/lib/commonjs/config/FileBasedConfiguration.type.js +6 -0
  57. package/lib/commonjs/config/FileBasedConfiguration.type.js.map +1 -0
  58. package/lib/commonjs/config/async/AutoInstrumentationConfiguration.js +51 -0
  59. package/lib/commonjs/config/async/AutoInstrumentationConfiguration.js.map +1 -0
  60. package/lib/commonjs/config/async/PartialInitializationConfiguration.js +6 -0
  61. package/lib/commonjs/config/async/PartialInitializationConfiguration.js.map +1 -0
  62. package/lib/commonjs/config/async/asyncInitializationHelper.js +44 -0
  63. package/lib/commonjs/config/async/asyncInitializationHelper.js.map +1 -0
  64. package/lib/commonjs/config/features/CoreConfiguration.js +104 -0
  65. package/lib/commonjs/config/features/CoreConfiguration.js.map +1 -0
  66. package/lib/commonjs/config/features/CoreConfiguration.type.js +6 -0
  67. package/lib/commonjs/config/features/CoreConfiguration.type.js.map +1 -0
  68. package/lib/commonjs/config/features/CoreConfigurationNative.js +38 -0
  69. package/lib/commonjs/config/features/CoreConfigurationNative.js.map +1 -0
  70. package/lib/commonjs/config/features/LogsConfiguration.js +36 -0
  71. package/lib/commonjs/config/features/LogsConfiguration.js.map +1 -0
  72. package/lib/commonjs/config/features/LogsConfiguration.type.js +6 -0
  73. package/lib/commonjs/config/features/LogsConfiguration.type.js.map +1 -0
  74. package/lib/commonjs/config/features/LogsConfigurationNative.js +2 -0
  75. package/lib/commonjs/config/features/LogsConfigurationNative.js.map +1 -0
  76. package/lib/commonjs/config/features/RumConfiguration.js +120 -0
  77. package/lib/commonjs/config/features/RumConfiguration.js.map +1 -0
  78. package/lib/commonjs/config/features/RumConfiguration.type.js +6 -0
  79. package/lib/commonjs/config/features/RumConfiguration.type.js.map +1 -0
  80. package/lib/commonjs/config/features/RumConfigurationNative.js +2 -0
  81. package/lib/commonjs/config/features/RumConfigurationNative.js.map +1 -0
  82. package/lib/commonjs/config/features/TraceConfiguration.js +24 -0
  83. package/lib/commonjs/config/features/TraceConfiguration.js.map +1 -0
  84. package/lib/commonjs/config/features/TraceConfiguration.type.js +2 -0
  85. package/lib/commonjs/config/features/TraceConfiguration.type.js.map +1 -0
  86. package/lib/commonjs/config/features/TraceConfigurationNative.js +2 -0
  87. package/lib/commonjs/config/features/TraceConfigurationNative.js.map +1 -0
  88. package/lib/commonjs/config/types/BatchProcessingLevel.js +30 -0
  89. package/lib/commonjs/config/types/BatchProcessingLevel.js.map +1 -0
  90. package/lib/commonjs/config/types/BatchSize.js +31 -0
  91. package/lib/commonjs/config/types/BatchSize.js.map +1 -0
  92. package/lib/commonjs/config/types/InitializationMode.js +17 -0
  93. package/lib/commonjs/config/types/InitializationMode.js.map +1 -0
  94. package/lib/commonjs/config/types/InitializationModeForTelemetry.js +2 -0
  95. package/lib/commonjs/config/types/InitializationModeForTelemetry.js.map +1 -0
  96. package/lib/commonjs/{ProxyConfiguration.js → config/types/ProxyConfiguration.js} +6 -0
  97. package/lib/commonjs/config/types/ProxyConfiguration.js.map +1 -0
  98. package/lib/commonjs/config/types/SdkVerbosity.js.map +1 -0
  99. package/lib/commonjs/config/types/TrackingConsent.js.map +1 -0
  100. package/lib/commonjs/config/types/UploadFrequency.js +30 -0
  101. package/lib/commonjs/config/types/UploadFrequency.js.map +1 -0
  102. package/lib/commonjs/config/types/VitalsUpdateFrequency.js +19 -0
  103. package/lib/commonjs/config/types/VitalsUpdateFrequency.js.map +1 -0
  104. package/lib/commonjs/config/types/index.js +68 -0
  105. package/lib/commonjs/config/types/index.js.map +1 -0
  106. package/lib/commonjs/index.js +51 -21
  107. package/lib/commonjs/index.js.map +1 -1
  108. package/lib/commonjs/logs/DdLogs.js +13 -9
  109. package/lib/commonjs/logs/DdLogs.js.map +1 -1
  110. package/lib/commonjs/logs/eventMapper.js +4 -1
  111. package/lib/commonjs/logs/eventMapper.js.map +1 -1
  112. package/lib/commonjs/nativeModulesTypes.js +0 -45
  113. package/lib/commonjs/nativeModulesTypes.js.map +1 -1
  114. package/lib/commonjs/rum/DdRum.js +56 -28
  115. package/lib/commonjs/rum/DdRum.js.map +1 -1
  116. package/lib/commonjs/rum/helper.js +63 -0
  117. package/lib/commonjs/rum/helper.js.map +1 -0
  118. package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js +14 -18
  119. package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
  120. package/lib/commonjs/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js +15 -25
  121. package/lib/commonjs/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js.map +1 -1
  122. package/lib/commonjs/rum/instrumentation/interactionTracking/DdEventsInterceptor.js +1 -1
  123. package/lib/commonjs/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js +15 -5
  124. package/lib/commonjs/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -1
  125. package/lib/commonjs/rum/instrumentation/resourceTracking/DdRumResourceTracking.js +34 -22
  126. package/lib/commonjs/rum/instrumentation/resourceTracking/DdRumResourceTracking.js.map +1 -1
  127. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js +21 -1
  128. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js.map +1 -1
  129. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js +16 -3
  130. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js.map +1 -1
  131. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js +10 -12
  132. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js.map +1 -1
  133. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.js +6 -0
  134. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.js.map +1 -0
  135. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js +41 -47
  136. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js.map +1 -1
  137. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.js +62 -0
  138. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.js.map +1 -0
  139. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js +1 -1
  140. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/headers.js +36 -0
  141. package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/headers.js.map +1 -0
  142. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.js +1 -1
  143. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js +19 -8
  144. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js.map +1 -1
  145. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js +90 -48
  146. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js.map +1 -1
  147. package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.js +1 -1
  148. package/lib/commonjs/rum/types.js +1 -9
  149. package/lib/commonjs/rum/types.js.map +1 -1
  150. package/lib/commonjs/sdk/AccountInfoSingleton/AccountInfoSingleton.js +46 -0
  151. package/lib/commonjs/sdk/AccountInfoSingleton/AccountInfoSingleton.js.map +1 -0
  152. package/lib/commonjs/sdk/AccountInfoSingleton/types.js +2 -0
  153. package/lib/commonjs/sdk/AccountInfoSingleton/types.js.map +1 -0
  154. package/lib/commonjs/sdk/AttributesEncoding/attributesEncoding.js +51 -0
  155. package/lib/commonjs/sdk/AttributesEncoding/attributesEncoding.js.map +1 -0
  156. package/lib/commonjs/sdk/AttributesEncoding/defaultEncoders.js +140 -0
  157. package/lib/commonjs/sdk/AttributesEncoding/defaultEncoders.js.map +1 -0
  158. package/lib/commonjs/{utils → sdk/AttributesEncoding}/errorUtils.js +39 -22
  159. package/lib/commonjs/sdk/AttributesEncoding/errorUtils.js.map +1 -0
  160. package/lib/commonjs/sdk/AttributesEncoding/helpers.js +123 -0
  161. package/lib/commonjs/sdk/AttributesEncoding/helpers.js.map +1 -0
  162. package/lib/commonjs/sdk/AttributesEncoding/types.js +2 -0
  163. package/lib/commonjs/sdk/AttributesEncoding/types.js.map +1 -0
  164. package/lib/commonjs/sdk/AttributesEncoding/utils.js +36 -0
  165. package/lib/commonjs/sdk/AttributesEncoding/utils.js.map +1 -0
  166. package/lib/commonjs/sdk/AttributesSingleton/AttributesSingleton.js +27 -1
  167. package/lib/commonjs/sdk/AttributesSingleton/AttributesSingleton.js.map +1 -1
  168. package/lib/commonjs/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.js +3 -3
  169. package/lib/commonjs/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.js.map +1 -1
  170. package/lib/commonjs/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.js +1 -1
  171. package/lib/commonjs/sdk/DatadogProvider/Buffer/BoundedBuffer.js +4 -4
  172. package/lib/commonjs/sdk/DatadogProvider/Buffer/BoundedBuffer.js.map +1 -1
  173. package/lib/commonjs/sdk/DatadogProvider/DatadogProvider.js +10 -9
  174. package/lib/commonjs/sdk/DatadogProvider/DatadogProvider.js.map +1 -1
  175. package/lib/commonjs/sdk/DatadogProvider/DatadogProviderState.js +28 -0
  176. package/lib/commonjs/sdk/DatadogProvider/DatadogProviderState.js.map +1 -0
  177. package/lib/commonjs/sdk/DdSdk.js +4 -2
  178. package/lib/commonjs/sdk/DdSdk.js.map +1 -1
  179. package/lib/commonjs/sdk/DdSdkInternal.js +86 -0
  180. package/lib/commonjs/sdk/DdSdkInternal.js.map +1 -0
  181. package/lib/commonjs/sdk/EventMappers/EventMapper.js +6 -3
  182. package/lib/commonjs/sdk/EventMappers/EventMapper.js.map +1 -1
  183. package/lib/commonjs/sdk/GlobalState/GlobalState.js +5 -11
  184. package/lib/commonjs/sdk/GlobalState/GlobalState.js.map +1 -1
  185. package/lib/commonjs/sdk/UserInfoSingleton/UserInfoSingleton.js +6 -1
  186. package/lib/commonjs/sdk/UserInfoSingleton/UserInfoSingleton.js.map +1 -1
  187. package/lib/commonjs/specs/NativeDdRum.js.map +1 -1
  188. package/lib/commonjs/specs/NativeDdSdk.js.map +1 -1
  189. package/lib/commonjs/trace/DdTrace.js +7 -5
  190. package/lib/commonjs/trace/DdTrace.js.map +1 -1
  191. package/lib/commonjs/types.js +19 -46
  192. package/lib/commonjs/types.js.map +1 -1
  193. package/lib/commonjs/utils/longTasksUtils.js.map +1 -1
  194. package/lib/commonjs/utils/singletonUtils.js +21 -0
  195. package/lib/commonjs/utils/singletonUtils.js.map +1 -0
  196. package/lib/commonjs/version.js +1 -1
  197. package/lib/commonjs/version.js.map +1 -1
  198. package/lib/module/DdAttributes.js.map +1 -0
  199. package/lib/module/DdSdkReactNative.js +155 -52
  200. package/lib/module/DdSdkReactNative.js.map +1 -1
  201. package/lib/module/InternalLog.js +1 -1
  202. package/lib/module/InternalLog.js.map +1 -1
  203. package/lib/module/config/DatadogProviderConfiguration.js +18 -0
  204. package/lib/module/config/DatadogProviderConfiguration.js.map +1 -0
  205. package/lib/module/config/FileBasedConfiguration.js +341 -0
  206. package/lib/module/config/FileBasedConfiguration.js.map +1 -0
  207. package/lib/module/config/FileBasedConfiguration.type.js +2 -0
  208. package/lib/module/config/FileBasedConfiguration.type.js.map +1 -0
  209. package/lib/module/config/async/AutoInstrumentationConfiguration.js +45 -0
  210. package/lib/module/config/async/AutoInstrumentationConfiguration.js.map +1 -0
  211. package/lib/module/config/async/PartialInitializationConfiguration.js +2 -0
  212. package/lib/module/config/async/PartialInitializationConfiguration.js.map +1 -0
  213. package/lib/module/config/async/asyncInitializationHelper.js +36 -0
  214. package/lib/module/config/async/asyncInitializationHelper.js.map +1 -0
  215. package/lib/module/config/features/CoreConfiguration.js +98 -0
  216. package/lib/module/config/features/CoreConfiguration.js.map +1 -0
  217. package/lib/module/config/features/CoreConfiguration.type.js +2 -0
  218. package/lib/module/config/features/CoreConfiguration.type.js.map +1 -0
  219. package/lib/module/config/features/CoreConfigurationNative.js +31 -0
  220. package/lib/module/config/features/CoreConfigurationNative.js.map +1 -0
  221. package/lib/module/config/features/LogsConfiguration.js +30 -0
  222. package/lib/module/config/features/LogsConfiguration.js.map +1 -0
  223. package/lib/module/config/features/LogsConfiguration.type.js +2 -0
  224. package/lib/module/config/features/LogsConfiguration.type.js.map +1 -0
  225. package/lib/module/config/features/LogsConfigurationNative.js +2 -0
  226. package/lib/module/config/features/LogsConfigurationNative.js.map +1 -0
  227. package/lib/module/config/features/RumConfiguration.js +114 -0
  228. package/lib/module/config/features/RumConfiguration.js.map +1 -0
  229. package/lib/module/config/features/RumConfiguration.type.js +2 -0
  230. package/lib/module/config/features/RumConfiguration.type.js.map +1 -0
  231. package/lib/module/config/features/RumConfigurationNative.js +2 -0
  232. package/lib/module/config/features/RumConfigurationNative.js.map +1 -0
  233. package/lib/module/config/features/TraceConfiguration.js +18 -0
  234. package/lib/module/config/features/TraceConfiguration.js.map +1 -0
  235. package/lib/module/config/features/TraceConfiguration.type.js +2 -0
  236. package/lib/module/config/features/TraceConfiguration.type.js.map +1 -0
  237. package/lib/module/config/features/TraceConfigurationNative.js +2 -0
  238. package/lib/module/config/features/TraceConfigurationNative.js.map +1 -0
  239. package/lib/module/config/types/BatchProcessingLevel.js +25 -0
  240. package/lib/module/config/types/BatchProcessingLevel.js.map +1 -0
  241. package/lib/module/config/types/BatchSize.js +26 -0
  242. package/lib/module/config/types/BatchSize.js.map +1 -0
  243. package/lib/module/config/types/InitializationMode.js +11 -0
  244. package/lib/module/config/types/InitializationMode.js.map +1 -0
  245. package/lib/module/config/types/InitializationModeForTelemetry.js +2 -0
  246. package/lib/module/config/types/InitializationModeForTelemetry.js.map +1 -0
  247. package/lib/module/{ProxyConfiguration.js → config/types/ProxyConfiguration.js} +6 -0
  248. package/lib/module/config/types/ProxyConfiguration.js.map +1 -0
  249. package/lib/module/config/types/SdkVerbosity.js.map +1 -0
  250. package/lib/module/config/types/TrackingConsent.js.map +1 -0
  251. package/lib/module/config/types/UploadFrequency.js +25 -0
  252. package/lib/module/config/types/UploadFrequency.js.map +1 -0
  253. package/lib/module/config/types/VitalsUpdateFrequency.js +13 -0
  254. package/lib/module/config/types/VitalsUpdateFrequency.js.map +1 -0
  255. package/lib/module/config/types/index.js +15 -0
  256. package/lib/module/config/types/index.js.map +1 -0
  257. package/lib/module/index.js +13 -7
  258. package/lib/module/index.js.map +1 -1
  259. package/lib/module/logs/DdLogs.js +13 -9
  260. package/lib/module/logs/DdLogs.js.map +1 -1
  261. package/lib/module/logs/eventMapper.js +4 -1
  262. package/lib/module/logs/eventMapper.js.map +1 -1
  263. package/lib/module/nativeModulesTypes.js +1 -43
  264. package/lib/module/nativeModulesTypes.js.map +1 -1
  265. package/lib/module/rum/DdRum.js +54 -26
  266. package/lib/module/rum/DdRum.js.map +1 -1
  267. package/lib/module/rum/helper.js +49 -0
  268. package/lib/module/rum/helper.js.map +1 -0
  269. package/lib/module/rum/instrumentation/DdRumErrorTracking.js +14 -18
  270. package/lib/module/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
  271. package/lib/module/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js +15 -24
  272. package/lib/module/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js.map +1 -1
  273. package/lib/module/rum/instrumentation/interactionTracking/DdEventsInterceptor.js +1 -1
  274. package/lib/module/rum/instrumentation/interactionTracking/DdEventsInterceptor.js.map +1 -1
  275. package/lib/module/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js +15 -5
  276. package/lib/module/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -1
  277. package/lib/module/rum/instrumentation/resourceTracking/DdRumResourceTracking.js +33 -21
  278. package/lib/module/rum/instrumentation/resourceTracking/DdRumResourceTracking.js.map +1 -1
  279. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js +22 -1
  280. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js.map +1 -1
  281. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js +13 -2
  282. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js.map +1 -1
  283. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js +10 -11
  284. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js.map +1 -1
  285. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.js +2 -0
  286. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.js.map +1 -0
  287. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js +27 -33
  288. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js.map +1 -1
  289. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.js +54 -0
  290. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.js.map +1 -0
  291. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js +1 -1
  292. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js.map +1 -1
  293. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/headers.js +30 -0
  294. package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/headers.js.map +1 -0
  295. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.js +1 -1
  296. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.js.map +1 -1
  297. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js +14 -3
  298. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js.map +1 -1
  299. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js +90 -48
  300. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js.map +1 -1
  301. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.js +1 -1
  302. package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.js.map +1 -1
  303. package/lib/module/rum/types.js +0 -9
  304. package/lib/module/rum/types.js.map +1 -1
  305. package/lib/module/sdk/AccountInfoSingleton/AccountInfoSingleton.js +39 -0
  306. package/lib/module/sdk/AccountInfoSingleton/AccountInfoSingleton.js.map +1 -0
  307. package/lib/module/sdk/AccountInfoSingleton/types.js +2 -0
  308. package/lib/module/sdk/AccountInfoSingleton/types.js.map +1 -0
  309. package/lib/module/sdk/AttributesEncoding/attributesEncoding.js +46 -0
  310. package/lib/module/sdk/AttributesEncoding/attributesEncoding.js.map +1 -0
  311. package/lib/module/sdk/AttributesEncoding/defaultEncoders.js +134 -0
  312. package/lib/module/sdk/AttributesEncoding/defaultEncoders.js.map +1 -0
  313. package/lib/module/{utils → sdk/AttributesEncoding}/errorUtils.js +37 -20
  314. package/lib/module/sdk/AttributesEncoding/errorUtils.js.map +1 -0
  315. package/lib/module/sdk/AttributesEncoding/helpers.js +115 -0
  316. package/lib/module/sdk/AttributesEncoding/helpers.js.map +1 -0
  317. package/lib/module/sdk/AttributesEncoding/types.js +2 -0
  318. package/lib/module/sdk/AttributesEncoding/types.js.map +1 -0
  319. package/lib/module/sdk/AttributesEncoding/utils.js +28 -0
  320. package/lib/module/sdk/AttributesEncoding/utils.js.map +1 -0
  321. package/lib/module/sdk/AttributesSingleton/AttributesSingleton.js +27 -1
  322. package/lib/module/sdk/AttributesSingleton/AttributesSingleton.js.map +1 -1
  323. package/lib/module/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.js +2 -2
  324. package/lib/module/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.js.map +1 -1
  325. package/lib/module/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.js +1 -1
  326. package/lib/module/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.js.map +1 -1
  327. package/lib/module/sdk/DatadogProvider/Buffer/BoundedBuffer.js +4 -4
  328. package/lib/module/sdk/DatadogProvider/Buffer/BoundedBuffer.js.map +1 -1
  329. package/lib/module/sdk/DatadogProvider/DatadogProvider.js +9 -8
  330. package/lib/module/sdk/DatadogProvider/DatadogProvider.js.map +1 -1
  331. package/lib/module/sdk/DatadogProvider/DatadogProviderState.js +21 -0
  332. package/lib/module/sdk/DatadogProvider/DatadogProviderState.js.map +1 -0
  333. package/lib/module/sdk/DdSdk.js +4 -4
  334. package/lib/module/sdk/DdSdk.js.map +1 -1
  335. package/lib/module/sdk/DdSdkInternal.js +80 -0
  336. package/lib/module/sdk/DdSdkInternal.js.map +1 -0
  337. package/lib/module/sdk/EventMappers/EventMapper.js +6 -3
  338. package/lib/module/sdk/EventMappers/EventMapper.js.map +1 -1
  339. package/lib/module/sdk/GlobalState/GlobalState.js +5 -10
  340. package/lib/module/sdk/GlobalState/GlobalState.js.map +1 -1
  341. package/lib/module/sdk/UserInfoSingleton/UserInfoSingleton.js +6 -1
  342. package/lib/module/sdk/UserInfoSingleton/UserInfoSingleton.js.map +1 -1
  343. package/lib/module/specs/NativeDdRum.js.map +1 -1
  344. package/lib/module/specs/NativeDdSdk.js.map +1 -1
  345. package/lib/module/trace/DdTrace.js +7 -6
  346. package/lib/module/trace/DdTrace.js.map +1 -1
  347. package/lib/module/types.js +22 -42
  348. package/lib/module/types.js.map +1 -1
  349. package/lib/module/utils/longTasksUtils.js.map +1 -1
  350. package/lib/module/utils/singletonUtils.js +14 -0
  351. package/lib/module/utils/singletonUtils.js.map +1 -0
  352. package/lib/module/version.js +1 -1
  353. package/lib/module/version.js.map +1 -1
  354. package/lib/typescript/DdAttributes.d.ts.map +1 -0
  355. package/lib/typescript/DdSdkReactNative.d.ts +49 -12
  356. package/lib/typescript/DdSdkReactNative.d.ts.map +1 -1
  357. package/lib/typescript/InternalLog.d.ts +1 -1
  358. package/lib/typescript/InternalLog.d.ts.map +1 -1
  359. package/lib/typescript/config/DatadogProviderConfiguration.d.ts +12 -0
  360. package/lib/typescript/config/DatadogProviderConfiguration.d.ts.map +1 -0
  361. package/lib/typescript/config/FileBasedConfiguration.d.ts +17 -0
  362. package/lib/typescript/config/FileBasedConfiguration.d.ts.map +1 -0
  363. package/lib/typescript/config/FileBasedConfiguration.type.d.ts +52 -0
  364. package/lib/typescript/config/FileBasedConfiguration.type.d.ts.map +1 -0
  365. package/lib/typescript/config/async/AutoInstrumentationConfiguration.d.ts +60 -0
  366. package/lib/typescript/config/async/AutoInstrumentationConfiguration.d.ts.map +1 -0
  367. package/lib/typescript/config/async/PartialInitializationConfiguration.d.ts +47 -0
  368. package/lib/typescript/config/async/PartialInitializationConfiguration.d.ts.map +1 -0
  369. package/lib/typescript/config/async/asyncInitializationHelper.d.ts +5 -0
  370. package/lib/typescript/config/async/asyncInitializationHelper.d.ts.map +1 -0
  371. package/lib/typescript/config/features/CoreConfiguration.d.ts +52 -0
  372. package/lib/typescript/config/features/CoreConfiguration.d.ts.map +1 -0
  373. package/lib/typescript/config/features/CoreConfiguration.type.d.ts +90 -0
  374. package/lib/typescript/config/features/CoreConfiguration.type.d.ts.map +1 -0
  375. package/lib/typescript/config/features/CoreConfigurationNative.d.ts +54 -0
  376. package/lib/typescript/config/features/CoreConfigurationNative.d.ts.map +1 -0
  377. package/lib/typescript/config/features/LogsConfiguration.d.ts +17 -0
  378. package/lib/typescript/config/features/LogsConfiguration.d.ts.map +1 -0
  379. package/lib/typescript/config/features/LogsConfiguration.type.d.ts +24 -0
  380. package/lib/typescript/config/features/LogsConfiguration.type.d.ts.map +1 -0
  381. package/lib/typescript/config/features/LogsConfigurationNative.d.ts +6 -0
  382. package/lib/typescript/config/features/LogsConfigurationNative.d.ts.map +1 -0
  383. package/lib/typescript/config/features/RumConfiguration.d.ts +66 -0
  384. package/lib/typescript/config/features/RumConfiguration.d.ts.map +1 -0
  385. package/lib/typescript/config/features/RumConfiguration.type.d.ts +131 -0
  386. package/lib/typescript/config/features/RumConfiguration.type.d.ts.map +1 -0
  387. package/lib/typescript/config/features/RumConfigurationNative.d.ts +25 -0
  388. package/lib/typescript/config/features/RumConfigurationNative.d.ts.map +1 -0
  389. package/lib/typescript/config/features/TraceConfiguration.d.ts +10 -0
  390. package/lib/typescript/config/features/TraceConfiguration.d.ts.map +1 -0
  391. package/lib/typescript/config/features/TraceConfiguration.type.d.ts +11 -0
  392. package/lib/typescript/config/features/TraceConfiguration.type.d.ts.map +1 -0
  393. package/lib/typescript/config/features/TraceConfigurationNative.d.ts +4 -0
  394. package/lib/typescript/config/features/TraceConfigurationNative.d.ts.map +1 -0
  395. package/lib/typescript/config/types/BatchProcessingLevel.d.ts +18 -0
  396. package/lib/typescript/config/types/BatchProcessingLevel.d.ts.map +1 -0
  397. package/lib/typescript/config/types/BatchSize.d.ts +19 -0
  398. package/lib/typescript/config/types/BatchSize.d.ts.map +1 -0
  399. package/lib/typescript/config/types/InitializationMode.d.ts +5 -0
  400. package/lib/typescript/config/types/InitializationMode.d.ts.map +1 -0
  401. package/lib/typescript/config/types/InitializationModeForTelemetry.d.ts +2 -0
  402. package/lib/typescript/config/types/InitializationModeForTelemetry.d.ts.map +1 -0
  403. package/lib/typescript/config/types/ProxyConfiguration.d.ts.map +1 -0
  404. package/lib/typescript/config/types/SdkVerbosity.d.ts.map +1 -0
  405. package/lib/typescript/config/types/TrackingConsent.d.ts.map +1 -0
  406. package/lib/typescript/config/types/UploadFrequency.d.ts +18 -0
  407. package/lib/typescript/config/types/UploadFrequency.d.ts.map +1 -0
  408. package/lib/typescript/config/types/VitalsUpdateFrequency.d.ts +7 -0
  409. package/lib/typescript/config/types/VitalsUpdateFrequency.d.ts.map +1 -0
  410. package/lib/typescript/config/types/index.d.ts +10 -0
  411. package/lib/typescript/config/types/index.d.ts.map +1 -0
  412. package/lib/typescript/index.d.ts +20 -9
  413. package/lib/typescript/index.d.ts.map +1 -1
  414. package/lib/typescript/logs/DdLogs.d.ts +2 -1
  415. package/lib/typescript/logs/DdLogs.d.ts.map +1 -1
  416. package/lib/typescript/logs/eventMapper.d.ts +3 -2
  417. package/lib/typescript/logs/eventMapper.d.ts.map +1 -1
  418. package/lib/typescript/logs/types.d.ts +1 -16
  419. package/lib/typescript/logs/types.d.ts.map +1 -1
  420. package/lib/typescript/nativeModulesTypes.d.ts +2 -15
  421. package/lib/typescript/nativeModulesTypes.d.ts.map +1 -1
  422. package/lib/typescript/rum/DdRum.d.ts +10 -1
  423. package/lib/typescript/rum/DdRum.d.ts.map +1 -1
  424. package/lib/typescript/rum/eventMappers/errorEventMapper.d.ts +1 -1
  425. package/lib/typescript/rum/eventMappers/errorEventMapper.d.ts.map +1 -1
  426. package/lib/typescript/rum/helper.d.ts +10 -0
  427. package/lib/typescript/rum/helper.d.ts.map +1 -0
  428. package/lib/typescript/rum/instrumentation/DdRumErrorTracking.d.ts.map +1 -1
  429. package/lib/typescript/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.d.ts +6 -6
  430. package/lib/typescript/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.d.ts.map +1 -1
  431. package/lib/typescript/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.d.ts +7 -0
  432. package/lib/typescript/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.d.ts.map +1 -1
  433. package/lib/typescript/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts +12 -6
  434. package/lib/typescript/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts.map +1 -1
  435. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.d.ts +1 -0
  436. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.d.ts.map +1 -1
  437. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.d.ts +8 -0
  438. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.d.ts.map +1 -1
  439. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.d.ts +5 -17
  440. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.d.ts.map +1 -1
  441. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.d.ts +20 -0
  442. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.d.ts.map +1 -0
  443. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.d.ts +3 -24
  444. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.d.ts.map +1 -1
  445. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.d.ts +12 -0
  446. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.d.ts.map +1 -0
  447. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/headers.d.ts +24 -0
  448. package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/headers.d.ts.map +1 -0
  449. package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.d.ts +2 -1
  450. package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.d.ts.map +1 -1
  451. package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.d.ts.map +1 -1
  452. package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts +1 -1
  453. package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts.map +1 -1
  454. package/lib/typescript/rum/types.d.ts +47 -7
  455. package/lib/typescript/rum/types.d.ts.map +1 -1
  456. package/lib/typescript/sdk/AccountInfoSingleton/AccountInfoSingleton.d.ts +15 -0
  457. package/lib/typescript/sdk/AccountInfoSingleton/AccountInfoSingleton.d.ts.map +1 -0
  458. package/lib/typescript/sdk/AccountInfoSingleton/types.d.ts +6 -0
  459. package/lib/typescript/sdk/AccountInfoSingleton/types.d.ts.map +1 -0
  460. package/lib/typescript/sdk/AttributesEncoding/attributesEncoding.d.ts +13 -0
  461. package/lib/typescript/sdk/AttributesEncoding/attributesEncoding.d.ts.map +1 -0
  462. package/lib/typescript/sdk/AttributesEncoding/defaultEncoders.d.ts +33 -0
  463. package/lib/typescript/sdk/AttributesEncoding/defaultEncoders.d.ts.map +1 -0
  464. package/lib/typescript/{utils → sdk/AttributesEncoding}/errorUtils.d.ts +4 -4
  465. package/lib/typescript/sdk/AttributesEncoding/errorUtils.d.ts.map +1 -0
  466. package/lib/typescript/sdk/AttributesEncoding/helpers.d.ts +17 -0
  467. package/lib/typescript/sdk/AttributesEncoding/helpers.d.ts.map +1 -0
  468. package/lib/typescript/sdk/AttributesEncoding/types.d.ts +21 -0
  469. package/lib/typescript/sdk/AttributesEncoding/types.d.ts.map +1 -0
  470. package/lib/typescript/sdk/AttributesEncoding/utils.d.ts +7 -0
  471. package/lib/typescript/sdk/AttributesEncoding/utils.d.ts.map +1 -0
  472. package/lib/typescript/sdk/AttributesSingleton/AttributesSingleton.d.ts +5 -1
  473. package/lib/typescript/sdk/AttributesSingleton/AttributesSingleton.d.ts.map +1 -1
  474. package/lib/typescript/sdk/DatadogProvider/DatadogProvider.d.ts +4 -3
  475. package/lib/typescript/sdk/DatadogProvider/DatadogProvider.d.ts.map +1 -1
  476. package/lib/typescript/sdk/DatadogProvider/DatadogProviderState.d.ts +9 -0
  477. package/lib/typescript/sdk/DatadogProvider/DatadogProviderState.d.ts.map +1 -0
  478. package/lib/typescript/sdk/DdSdk.d.ts +2 -3
  479. package/lib/typescript/sdk/DdSdk.d.ts.map +1 -1
  480. package/lib/typescript/sdk/DdSdkInternal.d.ts +39 -0
  481. package/lib/typescript/sdk/DdSdkInternal.d.ts.map +1 -0
  482. package/lib/typescript/sdk/EventMappers/EventMapper.d.ts +3 -1
  483. package/lib/typescript/sdk/EventMappers/EventMapper.d.ts.map +1 -1
  484. package/lib/typescript/sdk/GlobalState/GlobalState.d.ts +3 -3
  485. package/lib/typescript/sdk/GlobalState/GlobalState.d.ts.map +1 -1
  486. package/lib/typescript/sdk/UserInfoSingleton/UserInfoSingleton.d.ts +2 -1
  487. package/lib/typescript/sdk/UserInfoSingleton/UserInfoSingleton.d.ts.map +1 -1
  488. package/lib/typescript/sdk/UserInfoSingleton/types.d.ts +1 -2
  489. package/lib/typescript/sdk/UserInfoSingleton/types.d.ts.map +1 -1
  490. package/lib/typescript/specs/NativeDdRum.d.ts +45 -0
  491. package/lib/typescript/specs/NativeDdRum.d.ts.map +1 -1
  492. package/lib/typescript/specs/NativeDdSdk.d.ts +34 -6
  493. package/lib/typescript/specs/NativeDdSdk.d.ts.map +1 -1
  494. package/lib/typescript/trace/DdTrace.d.ts +1 -2
  495. package/lib/typescript/trace/DdTrace.d.ts.map +1 -1
  496. package/lib/typescript/types.d.ts +74 -92
  497. package/lib/typescript/types.d.ts.map +1 -1
  498. package/lib/typescript/utils/longTasksUtils.d.ts +1 -1
  499. package/lib/typescript/utils/longTasksUtils.d.ts.map +1 -1
  500. package/lib/typescript/utils/singletonUtils.d.ts +2 -0
  501. package/lib/typescript/utils/singletonUtils.d.ts.map +1 -0
  502. package/lib/typescript/version.d.ts +1 -1
  503. package/lib/typescript/version.d.ts.map +1 -1
  504. package/package.json +2 -2
  505. package/src/DdSdkReactNative.tsx +246 -104
  506. package/src/InternalLog.tsx +1 -1
  507. package/src/__tests__/DdSdkReactNative.test.tsx +415 -207
  508. package/src/__tests__/DdSdkReactNativeConfiguration.test.ts +237 -153
  509. package/src/__tests__/InternalLog.test.tsx +1 -1
  510. package/src/__tests__/rum/instrumentation/DdEventsInterceptor.test.tsx +2 -2
  511. package/src/__tests__/rum/instrumentation/DdRumErrorTracking.test.tsx +139 -216
  512. package/src/__tests__/rum/instrumentation/DdRumUserInteractionTracking.test.tsx +10 -7
  513. package/src/config/DatadogProviderConfiguration.ts +17 -0
  514. package/src/config/FileBasedConfiguration.ts +464 -0
  515. package/src/config/FileBasedConfiguration.type.ts +66 -0
  516. package/src/config/__tests__/FileBasedConfiguration.test.ts +334 -0
  517. package/src/config/__tests__/__fixtures__/configuration-all-fields.json +57 -0
  518. package/src/config/__tests__/__fixtures__/malformed-configuration.json +4 -0
  519. package/src/config/async/AutoInstrumentationConfiguration.ts +126 -0
  520. package/src/config/async/PartialInitializationConfiguration.ts +58 -0
  521. package/src/config/async/asyncInitializationHelper.tsx +51 -0
  522. package/src/config/features/CoreConfiguration.ts +130 -0
  523. package/src/config/features/CoreConfiguration.type.ts +119 -0
  524. package/src/config/features/CoreConfigurationNative.ts +50 -0
  525. package/src/config/features/LogsConfiguration.ts +38 -0
  526. package/src/config/features/LogsConfiguration.type.ts +33 -0
  527. package/src/config/features/LogsConfigurationNative.ts +10 -0
  528. package/src/config/features/RumConfiguration.ts +137 -0
  529. package/src/config/features/RumConfiguration.type.ts +164 -0
  530. package/src/config/features/RumConfigurationNative.ts +26 -0
  531. package/src/config/features/TraceConfiguration.ts +24 -0
  532. package/src/config/features/TraceConfiguration.type.ts +17 -0
  533. package/src/config/features/TraceConfigurationNative.ts +8 -0
  534. package/src/config/types/BatchProcessingLevel.ts +23 -0
  535. package/src/config/types/BatchSize.ts +24 -0
  536. package/src/config/types/InitializationMode.ts +9 -0
  537. package/src/config/types/InitializationModeForTelemetry.ts +11 -0
  538. package/src/{ProxyConfiguration.tsx → config/types/ProxyConfiguration.ts} +6 -0
  539. package/src/config/types/UploadFrequency.tsx +23 -0
  540. package/src/config/types/VitalsUpdateFrequency.ts +11 -0
  541. package/src/config/types/index.ts +15 -0
  542. package/src/index.tsx +33 -16
  543. package/src/logs/DdLogs.ts +14 -13
  544. package/src/logs/__tests__/DdLogs.test.ts +60 -107
  545. package/src/logs/__tests__/eventMapper.test.ts +1 -1
  546. package/src/logs/eventMapper.ts +5 -4
  547. package/src/logs/types.ts +1 -20
  548. package/src/nativeModulesTypes.ts +2 -17
  549. package/src/rum/DdRum.ts +139 -42
  550. package/src/rum/__tests__/DdRum.test.ts +217 -47
  551. package/src/rum/eventMappers/errorEventMapper.ts +1 -1
  552. package/src/rum/helper.ts +62 -0
  553. package/src/rum/instrumentation/DdRumErrorTracking.tsx +20 -38
  554. package/src/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.ts +20 -32
  555. package/src/rum/instrumentation/interactionTracking/DdEventsInterceptor.tsx +1 -1
  556. package/src/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.tsx +18 -5
  557. package/src/rum/instrumentation/resourceTracking/DdRumResourceTracking.tsx +44 -23
  558. package/src/rum/instrumentation/resourceTracking/__tests__/DdRumResourceTracking.test.ts +2 -2
  559. package/src/rum/instrumentation/resourceTracking/__tests__/__utils__/XMLHttpRequestMock.ts +44 -23
  560. package/src/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.ts +24 -1
  561. package/src/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.tsx +17 -2
  562. package/src/rum/instrumentation/resourceTracking/distributedTracing/__tests__/distributedTracing.test.ts +327 -1
  563. package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.tsx +22 -31
  564. package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.ts +29 -0
  565. package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.ts +54 -35
  566. package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.ts +80 -0
  567. package/src/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.ts +1 -1
  568. package/src/rum/instrumentation/resourceTracking/distributedTracing/headers.ts +29 -0
  569. package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.ts +1 -1
  570. package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.ts +19 -7
  571. package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/__tests__/XHRProxy.test.ts +177 -119
  572. package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/__tests__/baggageHeaderUtils.test.ts +85 -13
  573. package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.ts +110 -52
  574. package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.ts +1 -1
  575. package/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.ts +1 -1
  576. package/src/rum/types.ts +68 -8
  577. package/src/sdk/AccountInfoSingleton/AccountInfoSingleton.ts +49 -0
  578. package/src/sdk/AccountInfoSingleton/__tests__/AccountInfoSingleton.test.ts +90 -0
  579. package/src/sdk/AccountInfoSingleton/types.ts +11 -0
  580. package/src/sdk/AttributesEncoding/__tests__/attributesEncoding.test.ts +518 -0
  581. package/src/sdk/AttributesEncoding/__tests__/defaultEncoders.test.ts +198 -0
  582. package/src/sdk/AttributesEncoding/attributesEncoding.ts +56 -0
  583. package/src/sdk/AttributesEncoding/defaultEncoders.ts +175 -0
  584. package/src/{utils → sdk/AttributesEncoding}/errorUtils.ts +50 -22
  585. package/src/sdk/AttributesEncoding/helpers.ts +176 -0
  586. package/src/sdk/AttributesEncoding/types.ts +33 -0
  587. package/src/sdk/AttributesEncoding/utils.ts +31 -0
  588. package/src/sdk/AttributesSingleton/AttributesSingleton.ts +25 -1
  589. package/src/sdk/AttributesSingleton/__tests__/AttributesSingleton.test.ts +52 -8
  590. package/src/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.tsx +2 -2
  591. package/src/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.tsx +1 -1
  592. package/src/sdk/DatadogInternalBridge/__tests__/DdSdkNativeBridge.test.tsx +1 -1
  593. package/src/sdk/DatadogProvider/Buffer/BoundedBuffer.ts +4 -4
  594. package/src/sdk/DatadogProvider/Buffer/__tests__/BoundedBuffer.test.ts +5 -5
  595. package/src/sdk/DatadogProvider/DatadogProvider.tsx +12 -16
  596. package/src/sdk/DatadogProvider/DatadogProviderState.ts +30 -0
  597. package/src/sdk/DatadogProvider/__tests__/__utils__/renderWithProvider.tsx +18 -7
  598. package/src/sdk/DatadogProvider/__tests__/initialization.test.tsx +59 -33
  599. package/src/sdk/DatadogProvider/__tests__/initializationModes.test.tsx +26 -10
  600. package/src/sdk/DdSdk.ts +8 -5
  601. package/src/sdk/DdSdkInternal.ts +121 -0
  602. package/src/sdk/EventMappers/EventMapper.ts +9 -4
  603. package/src/sdk/EventMappers/__tests__/EventMapper.test.ts +3 -3
  604. package/src/sdk/GlobalState/GlobalState.tsx +10 -11
  605. package/src/sdk/UserInfoSingleton/UserInfoSingleton.ts +9 -2
  606. package/src/sdk/UserInfoSingleton/__tests__/UserInfoSingleton.test.ts +46 -9
  607. package/src/sdk/UserInfoSingleton/types.ts +1 -4
  608. package/src/specs/NativeDdRum.ts +65 -0
  609. package/src/specs/NativeDdSdk.ts +40 -6
  610. package/src/trace/DdTrace.ts +11 -7
  611. package/src/trace/__tests__/DdTrace.test.ts +7 -8
  612. package/src/types.tsx +97 -76
  613. package/src/utils/__tests__/errorUtils.test.ts +1 -1
  614. package/src/utils/__tests__/singletonUtils.test.ts +75 -0
  615. package/src/utils/longTasksUtils.ts +1 -3
  616. package/src/utils/singletonUtils.ts +17 -0
  617. package/src/version.ts +1 -1
  618. package/lib/commonjs/DdSdkReactNativeConfiguration.js +0 -412
  619. package/lib/commonjs/DdSdkReactNativeConfiguration.js.map +0 -1
  620. package/lib/commonjs/ProxyConfiguration.js.map +0 -1
  621. package/lib/commonjs/SdkVerbosity.js.map +0 -1
  622. package/lib/commonjs/TrackingConsent.js.map +0 -1
  623. package/lib/commonjs/rum/DdAttributes.js.map +0 -1
  624. package/lib/commonjs/sdk/FileBasedConfiguration/FileBasedConfiguration.js +0 -185
  625. package/lib/commonjs/sdk/FileBasedConfiguration/FileBasedConfiguration.js.map +0 -1
  626. package/lib/commonjs/utils/argsUtils.js +0 -41
  627. package/lib/commonjs/utils/argsUtils.js.map +0 -1
  628. package/lib/commonjs/utils/errorUtils.js.map +0 -1
  629. package/lib/module/DdSdkReactNativeConfiguration.js +0 -403
  630. package/lib/module/DdSdkReactNativeConfiguration.js.map +0 -1
  631. package/lib/module/ProxyConfiguration.js.map +0 -1
  632. package/lib/module/SdkVerbosity.js.map +0 -1
  633. package/lib/module/TrackingConsent.js.map +0 -1
  634. package/lib/module/rum/DdAttributes.js.map +0 -1
  635. package/lib/module/sdk/FileBasedConfiguration/FileBasedConfiguration.js +0 -176
  636. package/lib/module/sdk/FileBasedConfiguration/FileBasedConfiguration.js.map +0 -1
  637. package/lib/module/utils/argsUtils.js +0 -35
  638. package/lib/module/utils/argsUtils.js.map +0 -1
  639. package/lib/module/utils/errorUtils.js.map +0 -1
  640. package/lib/typescript/DdSdkReactNativeConfiguration.d.ts +0 -376
  641. package/lib/typescript/DdSdkReactNativeConfiguration.d.ts.map +0 -1
  642. package/lib/typescript/ProxyConfiguration.d.ts.map +0 -1
  643. package/lib/typescript/SdkVerbosity.d.ts.map +0 -1
  644. package/lib/typescript/TrackingConsent.d.ts.map +0 -1
  645. package/lib/typescript/rum/DdAttributes.d.ts.map +0 -1
  646. package/lib/typescript/sdk/FileBasedConfiguration/FileBasedConfiguration.d.ts +0 -34
  647. package/lib/typescript/sdk/FileBasedConfiguration/FileBasedConfiguration.d.ts.map +0 -1
  648. package/lib/typescript/utils/argsUtils.d.ts +0 -8
  649. package/lib/typescript/utils/argsUtils.d.ts.map +0 -1
  650. package/lib/typescript/utils/errorUtils.d.ts.map +0 -1
  651. package/src/DdSdkReactNativeConfiguration.tsx +0 -582
  652. package/src/sdk/FileBasedConfiguration/FileBasedConfiguration.ts +0 -241
  653. package/src/sdk/FileBasedConfiguration/__tests__/FileBasedConfiguration.test.ts +0 -255
  654. package/src/sdk/FileBasedConfiguration/__tests__/__fixtures__/configuration-all-fields.json +0 -27
  655. package/src/sdk/FileBasedConfiguration/__tests__/__fixtures__/malformed-configuration.json +0 -5
  656. package/src/utils/__tests__/argsUtils.test.ts +0 -66
  657. package/src/utils/argsUtils.ts +0 -41
  658. /package/lib/commonjs/{rum/DdAttributes.js → DdAttributes.js} +0 -0
  659. /package/lib/commonjs/{SdkVerbosity.js → config/types/SdkVerbosity.js} +0 -0
  660. /package/lib/commonjs/{TrackingConsent.js → config/types/TrackingConsent.js} +0 -0
  661. /package/lib/module/{rum/DdAttributes.js → DdAttributes.js} +0 -0
  662. /package/lib/module/{SdkVerbosity.js → config/types/SdkVerbosity.js} +0 -0
  663. /package/lib/module/{TrackingConsent.js → config/types/TrackingConsent.js} +0 -0
  664. /package/lib/typescript/{rum/DdAttributes.d.ts → DdAttributes.d.ts} +0 -0
  665. /package/lib/typescript/{ProxyConfiguration.d.ts → config/types/ProxyConfiguration.d.ts} +0 -0
  666. /package/lib/typescript/{SdkVerbosity.d.ts → config/types/SdkVerbosity.d.ts} +0 -0
  667. /package/lib/typescript/{TrackingConsent.d.ts → config/types/TrackingConsent.d.ts} +0 -0
  668. /package/src/{rum/DdAttributes.ts → DdAttributes.ts} +0 -0
  669. /package/src/{SdkVerbosity.tsx → config/types/SdkVerbosity.ts} +0 -0
  670. /package/src/{TrackingConsent.tsx → config/types/TrackingConsent.ts} +0 -0
@@ -1,41 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.validateContext = void 0;
7
- var _InternalLog = require("../InternalLog");
8
- var _SdkVerbosity = require("../SdkVerbosity");
9
- /* eslint-disable @typescript-eslint/ban-ts-comment */
10
- /*
11
- * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
12
- * This product includes software developed at Datadog (https://www.datadoghq.com/).
13
- * Copyright 2016-Present Datadog, Inc.
14
- */
15
-
16
- /**
17
- * Validates the given context before passing it to the native SDKs.
18
- * @param context the original context
19
- * @returns the original context if it's a plain object, an object wrapping the context if it's an array,
20
- * or an empty object if the context is of any other type.
21
- */
22
- const validateContext = context => {
23
- if (!context) {
24
- return {};
25
- }
26
-
27
- // eslint-disable-next-line eqeqeq
28
- if (context.constructor == Object) {
29
- return context;
30
- }
31
- if (Array.isArray(context)) {
32
- _InternalLog.InternalLog.log("The given context is an array, it will be nested in 'context' property inside a new object.", _SdkVerbosity.SdkVerbosity.WARN);
33
- return {
34
- context
35
- };
36
- }
37
- _InternalLog.InternalLog.log(`The given context (${context}) is invalid - it must be an object. Context will be empty.`, _SdkVerbosity.SdkVerbosity.ERROR);
38
- return {};
39
- };
40
- exports.validateContext = validateContext;
41
- //# sourceMappingURL=argsUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_InternalLog","require","_SdkVerbosity","validateContext","context","constructor","Object","Array","isArray","InternalLog","log","SdkVerbosity","WARN","ERROR","exports"],"sourceRoot":"../../../src","sources":["utils/argsUtils.ts"],"mappings":";;;;;;AAOA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AARA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,eAAe,GAAIC,OAAY,IAAK;EAC7C,IAAI,CAACA,OAAO,EAAE;IACV,OAAO,CAAC,CAAC;EACb;;EAEA;EACA,IAAIA,OAAO,CAACC,WAAW,IAAIC,MAAM,EAAE;IAC/B,OAAOF,OAAO;EAClB;EAEA,IAAIG,KAAK,CAACC,OAAO,CAACJ,OAAO,CAAC,EAAE;IACxBK,wBAAW,CAACC,GAAG,CACX,6FAA6F,EAC7FC,0BAAY,CAACC,IACjB,CAAC;IACD,OAAO;MAAER;IAAQ,CAAC;EACtB;EAEAK,wBAAW,CAACC,GAAG,CACX,sBAAsBN,OAAO,6DAA6D,EAC1FO,0BAAY,CAACE,KACjB,CAAC;EAED,OAAO,CAAC,CAAC;AACb,CAAC;AAACC,OAAA,CAAAX,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["EMPTY_MESSAGE","exports","EMPTY_STACK_TRACE","DEFAULT_ERROR_NAME","getErrorMessage","error","message","undefined","String","getErrorStackTrace","stack","stacktrace","componentStack","sourceURL","line","column","e","getErrorName","name"],"sourceRoot":"../../../src","sources":["utils/errorUtils.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;;AAEO,MAAMA,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,eAAe;AACrC,MAAME,iBAAiB,GAAAD,OAAA,CAAAC,iBAAA,GAAG,EAAE;AAC5B,MAAMC,kBAAkB,GAAAF,OAAA,CAAAE,kBAAA,GAAG,OAAO;AAElC,MAAMC,eAAe,GAAIC,KAAsB,IAAa;EAC/D,IAAIC,OAAO,GAAGN,aAAa;EAC3B,IAAIK,KAAK,KAAKE,SAAS,IAAIF,KAAK,KAAK,IAAI,EAAE;IACvCC,OAAO,GAAGN,aAAa;EAC3B,CAAC,MAAM,IAAI,OAAOK,KAAK,KAAK,QAAQ,IAAI,SAAS,IAAIA,KAAK,EAAE;IACxDC,OAAO,GAAGE,MAAM,CAACH,KAAK,CAACC,OAAO,CAAC;EACnC,CAAC,MAAM;IACHA,OAAO,GAAGE,MAAM,CAACH,KAAK,CAAC;EAC3B;EAEA,OAAOC,OAAO;AAClB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPAL,OAAA,CAAAG,eAAA,GAAAA,eAAA;AAQO,MAAMK,kBAAkB,GAAIJ,KAAsB,IAAa;EAClE,IAAIK,KAAK,GAAGR,iBAAiB;EAE7B,IAAI;IACA,IAAIG,KAAK,KAAKE,SAAS,IAAIF,KAAK,KAAK,IAAI,EAAE;MACvCK,KAAK,GAAGR,iBAAiB;IAC7B,CAAC,MAAM,IAAI,OAAOG,KAAK,KAAK,QAAQ,EAAE;MAClCK,KAAK,GAAGR,iBAAiB;IAC7B,CAAC,MAAM,IAAI,OAAOG,KAAK,KAAK,QAAQ,EAAE;MAClC,IAAI,YAAY,IAAIA,KAAK,EAAE;QACvBK,KAAK,GAAGF,MAAM,CAACH,KAAK,CAACM,UAAU,CAAC;MACpC,CAAC,MAAM,IAAI,OAAO,IAAIN,KAAK,EAAE;QACzBK,KAAK,GAAGF,MAAM,CAACH,KAAK,CAACK,KAAK,CAAC;MAC/B,CAAC,MAAM,IAAI,gBAAgB,IAAIL,KAAK,EAAE;QAClCK,KAAK,GAAGF,MAAM,CAACH,KAAK,CAACO,cAAc,CAAC;MACxC,CAAC,MAAM,IACH,WAAW,IAAIP,KAAK,IACpB,MAAM,IAAIA,KAAK,IACf,QAAQ,IAAIA,KAAK,EACnB;QACEK,KAAK,GAAG,MAAML,KAAK,CAACQ,SAAS,IAAIR,KAAK,CAACS,IAAI,IAAIT,KAAK,CAACU,MAAM,EAAE;MACjE;IACJ;EACJ,CAAC,CAAC,OAAOC,CAAC,EAAE;IACR;EAAA;EAEJ,OAAON,KAAK;AAChB,CAAC;AAACT,OAAA,CAAAQ,kBAAA,GAAAA,kBAAA;AAEK,MAAMQ,YAAY,GAAIZ,KAAc,IAAa;EACpD,IAAI;IACA,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,KAAK,IAAI,EAAE;MAC7C,OAAOF,kBAAkB;IAC7B;IACA,IAAI,OAAQE,KAAK,CAASa,IAAI,KAAK,QAAQ,EAAE;MACzC,OAAQb,KAAK,CAASa,IAAI;IAC9B;EACJ,CAAC,CAAC,OAAOF,CAAC,EAAE;IACR;EAAA;EAEJ,OAAOb,kBAAkB;AAC7B,CAAC;AAACF,OAAA,CAAAgB,YAAA,GAAAA,YAAA","ignoreList":[]}
@@ -1,403 +0,0 @@
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 { TrackingConsent } from './TrackingConsent';
8
- import { PropagatorType } from './rum/types';
9
- export let VitalsUpdateFrequency = /*#__PURE__*/function (VitalsUpdateFrequency) {
10
- VitalsUpdateFrequency["FREQUENT"] = "FREQUENT";
11
- VitalsUpdateFrequency["AVERAGE"] = "AVERAGE";
12
- VitalsUpdateFrequency["RARE"] = "RARE";
13
- VitalsUpdateFrequency["NEVER"] = "NEVER";
14
- return VitalsUpdateFrequency;
15
- }({});
16
- export let UploadFrequency = /*#__PURE__*/function (UploadFrequency) {
17
- /**
18
- * Upload data every 1000ms.
19
- */
20
- UploadFrequency["FREQUENT"] = "FREQUENT";
21
- /**
22
- * Upload data every 5000ms.
23
- */
24
- UploadFrequency["AVERAGE"] = "AVERAGE";
25
- /**
26
- * Upload data every 10000ms.
27
- */
28
- UploadFrequency["RARE"] = "RARE";
29
- return UploadFrequency;
30
- }({});
31
- export let BatchSize = /*#__PURE__*/function (BatchSize) {
32
- /**
33
- * Upload less frequent, larger batches of data
34
- */
35
- BatchSize["LARGE"] = "LARGE";
36
- /**
37
- * Use default size for batches of data
38
- */
39
- BatchSize["MEDIUM"] = "MEDIUM";
40
- /**
41
- * Upload more frequent, smaller batches of data
42
- */
43
- BatchSize["SMALL"] = "SMALL";
44
- return BatchSize;
45
- }({});
46
- export let BatchProcessingLevel = /*#__PURE__*/function (BatchProcessingLevel) {
47
- /**
48
- * Only 1 batch will be sent in a single upload cycle.
49
- */
50
- BatchProcessingLevel["LOW"] = "LOW";
51
- /**
52
- * 10 batches will be sent in a single upload cycle
53
- */
54
- BatchProcessingLevel["MEDIUM"] = "MEDIUM";
55
- /**
56
- * 100 batches will be sent in a single upload cycle.
57
- */
58
- BatchProcessingLevel["HIGH"] = "HIGH";
59
- return BatchProcessingLevel;
60
- }({});
61
- const isLegacyFirstPartyHost = firstPartyHost => {
62
- return typeof firstPartyHost === 'string';
63
- };
64
- /**
65
- * Defaults legacy first party hosts format to Datadog first party hosts to keep
66
- * retro-compatibility before OTel support was introduced.
67
- */
68
- export const formatFirstPartyHosts = firstPartyHosts => {
69
- return firstPartyHosts.map(host => {
70
- if (isLegacyFirstPartyHost(host)) {
71
- return {
72
- match: host,
73
- propagatorTypes: [PropagatorType.DATADOG, PropagatorType.TRACECONTEXT]
74
- };
75
- }
76
- return host;
77
- });
78
- };
79
- export const DEFAULTS = {
80
- nativeCrashReportEnabled: false,
81
- sessionSamplingRate: 100.0,
82
- resourceTracingSamplingRate: 20.0,
83
- site: 'US1',
84
- longTaskThresholdMs: 0,
85
- nativeLongTaskThresholdMs: 200,
86
- nativeViewTracking: false,
87
- nativeInteractionTracking: false,
88
- getFirstPartyHosts: () => [],
89
- getAdditionalConfiguration: () => ({}),
90
- trackingConsent: TrackingConsent.GRANTED,
91
- telemetrySampleRate: 20.0,
92
- vitalsUpdateFrequency: VitalsUpdateFrequency.AVERAGE,
93
- logEventMapper: null,
94
- errorEventMapper: null,
95
- resourceEventMapper: null,
96
- actionEventMapper: null,
97
- trackFrustrations: true,
98
- uploadFrequency: UploadFrequency.AVERAGE,
99
- batchSize: BatchSize.MEDIUM,
100
- trackBackgroundEvents: false,
101
- getCustomEndpoints: () => ({}),
102
- bundleLogsWithRum: true,
103
- bundleLogsWithTraces: true,
104
- useAccessibilityLabel: true,
105
- trackWatchdogTerminations: false,
106
- batchProcessingLevel: BatchProcessingLevel.MEDIUM
107
- };
108
-
109
- /**
110
- * The SDK configuration class.
111
- * It will be used to configure the SDK functionality at initialization.
112
- */
113
- export class DdSdkReactNativeConfiguration {
114
- /**
115
- * Enables crash reporting for native platforms (iOS, Android). Default `false`.
116
- */
117
- nativeCrashReportEnabled = DEFAULTS.nativeCrashReportEnabled;
118
- /**
119
- * @deprecated `sampleRate` has been replaced by `sessionSamplingRate` to avoid confusion with `resourceTracingSamplingRate` and will be removed in a future release.
120
- */
121
-
122
- /**
123
- * Percentage of sampled RUM sessions. Range `0`-`100`.
124
- */
125
- sessionSamplingRate = DEFAULTS.sessionSamplingRate;
126
- /**
127
- * Percentage of tracing integrations for network calls between your app and your backend. Range `0`-`100`.
128
- */
129
- resourceTracingSamplingRate = DEFAULTS.resourceTracingSamplingRate;
130
- site = DEFAULTS.site;
131
- /**
132
- * Verbosity for internal SDK logging.
133
- * Set to `SdkVerbosity.DEBUG` to debug your SDK implementation.
134
- */
135
- verbosity = undefined;
136
- /**
137
- * Enables native views tracking.
138
- * Set to `true` if you use a custom navigation system relying on native views.
139
- */
140
- nativeViewTracking = DEFAULTS.nativeViewTracking;
141
- /**
142
- * Enables native interaction tracking.
143
- * Set to `true` if you want to track interactions on native screens.
144
- */
145
- nativeInteractionTracking = DEFAULTS.nativeInteractionTracking;
146
- proxyConfig = undefined;
147
- serviceName = undefined;
148
- /**
149
- * List of your backends hosts to enable tracing with.
150
- * Regular expressions are NOT supported.
151
- *
152
- * Matches domains and subdomains, e.g. `['example.com']` matches `example.com` and `api.example.com`.
153
- */
154
- firstPartyHosts = DEFAULTS.getFirstPartyHosts();
155
- /**
156
- * Overrides the reported version of the app.
157
- * Accepted characters are alphanumerics and `_`, `-`, `:`, `.`, `/`.
158
- * Other special characters are converted to underscores.
159
- *
160
- * See https://docs.datadoghq.com/getting_started/tagging/#define-tags for more information on the format.
161
- *
162
- * Make sure you set it correctly, as it will have to match the one specified during the upload of your source maps and other mapping files.
163
- */
164
-
165
- /**
166
- * Add a suffix to the reported version of the app.
167
- * Accepted characters are alphanumerics and `_`, `-`, `:`, `.`, `/`.
168
- * Other special characters are converted to underscores.
169
- *
170
- * See https://docs.datadoghq.com/getting_started/tagging/#define-tags for more information on the format.
171
- *
172
- * A dash (`-`) will be automatically added between the version and the suffix
173
- */
174
-
175
- /**
176
- * The sampling rate for Internal Telemetry (info related to the work of the
177
- * SDK internals).
178
- *
179
- * The sampling rate must be a value between 0 and 100. A value of 0 means no
180
- * telemetry will be sent, 100 means all telemetry will be sent. When
181
- * `telemetrySampleRate` is not set, the default value from the iOS and
182
- * Android SDK is used, which is 20.
183
- */
184
- telemetrySampleRate = DEFAULTS.telemetrySampleRate;
185
-
186
- /**
187
- * The threshold for native long tasks reporting in milliseconds.
188
- *
189
- * - Setting it to `0` or `false` disables native long task reporting.
190
- * - Values below `100` will be raised to `100`.
191
- * - Values above `5000` will be lowered to `5000`.
192
- *
193
- * Default value is `200`.
194
- */
195
- nativeLongTaskThresholdMs = DEFAULTS.nativeLongTaskThresholdMs;
196
-
197
- /**
198
- * The threshold for javascript long tasks reporting in milliseconds.
199
- *
200
- * - Setting it to `0` or `false` disables javascript long task reporting.
201
- * - Values below `100` will be raised to `100`.
202
- * - Values above `5000` will be lowered to `5000`.
203
- *
204
- * Default value is `0`
205
- */
206
- longTaskThresholdMs = DEFAULTS.longTaskThresholdMs;
207
-
208
- /**
209
- * Sets the preferred frequency for collecting mobile vitals.
210
- */
211
- vitalsUpdateFrequency = DEFAULTS.vitalsUpdateFrequency;
212
-
213
- /**
214
- * Enables tracking of frustration signals (error taps). Defaults to `true`.
215
- */
216
- trackFrustrations = DEFAULTS.trackFrustrations;
217
-
218
- /**
219
- * Sets the preferred frequency for uploading batches of data.
220
- */
221
- uploadFrequency = DEFAULTS.uploadFrequency;
222
-
223
- /**
224
- * Defines the Datadog SDK policy when batching data together before uploading it to Datadog servers.
225
- * Smaller batches mean smaller but more network requests, whereas larger batches mean fewer but larger network requests.
226
- */
227
- batchSize = DEFAULTS.batchSize;
228
-
229
- /**
230
- * Enables tracking of RUM event when no RUM View is active.
231
- *
232
- * By default, background events are not tracked. Enabling this feature might increase the
233
- * number of sessions tracked and impact your billing.
234
- */
235
- trackBackgroundEvents = DEFAULTS.trackBackgroundEvents;
236
-
237
- /**
238
- * Enables RUM correlation with logs.
239
- *
240
- * By default, RUM is enabled for logs.
241
- */
242
- bundleLogsWithRum = DEFAULTS.bundleLogsWithRum;
243
-
244
- /**
245
- * Enables Traces correlation with logs.
246
- *
247
- * By default, Traces is enabled for logs.
248
- */
249
- bundleLogsWithTraces = DEFAULTS.bundleLogsWithTraces;
250
-
251
- /**
252
- * Sets the preferred level for processing batches of data.
253
- */
254
- batchProcessingLevel = DEFAULTS.batchProcessingLevel;
255
-
256
- /**
257
- * Enables tracking of non-fatal ANRs on Android.
258
- * By default, the reporting of non-fatal ANRs on Android 30+ is disabled because it would
259
- * create too much noise over fatal ANRs. On Android 29 and below, however,
260
- * the reporting of non-fatal ANRs is enabled by default,
261
- * as fatal ANRs cannot be reported on those versions.
262
- */
263
-
264
- /**
265
- * The app hang threshold in seconds for non-fatal app hangs on iOS.
266
- *
267
- * App hangs are an iOS-specific type of error that happens when the application is unresponsive for too long.
268
- * By default, app hangs reporting is disabled, but you can enable it and set your
269
- * own threshold to monitor app hangs that last more than a specified
270
- * duration by using the this parameter.
271
- *
272
- * Set the `appHangThreshold` parameter to the minimal duration you want
273
- * app hangs to be reported. For example, enter 0.25 to report hangs lasting at least 250 ms.
274
- * See [Configure the app hang threshold](https://docs.datadoghq.com/real_user_monitoring/error_tracking/mobile/ios/?tab=cocoapods#configure-the-app-hang-threshold)
275
- * for more guidance on what to set this value to.
276
- */
277
-
278
- /**
279
- * The amount of time after a view starts where a Resource should be
280
- * considered when calculating Time to Network-Settled (TNS). TNS will be
281
- * calculated using all resources that start withing the specified threshold, in seconds.
282
- * Defaults to 0.1 seconds.
283
- */
284
-
285
- /**
286
- * Determines whether the SDK should track application termination by the watchdog on iOS. Default: `false`.
287
- */
288
- trackWatchdogTerminations = DEFAULTS.trackWatchdogTerminations;
289
-
290
- /**
291
- * Specifies a custom prop to name RUM actions on elements having an `onPress` prop.
292
- *
293
- * For example if you set it to `testID`, the value of the `testID` prop is used as a custom action name:
294
- *
295
- * ```js
296
- * <TouchableOpacity testID="Dismiss notification" onPress={() => dismiss()}>
297
- * ```
298
- *
299
- * `dd-action-name` is favored when both attributes are present on an element.
300
- */
301
-
302
- logEventMapper = DEFAULTS.logEventMapper;
303
- errorEventMapper = DEFAULTS.errorEventMapper;
304
- resourceEventMapper = DEFAULTS.resourceEventMapper;
305
- actionEventMapper = DEFAULTS.actionEventMapper;
306
- additionalConfiguration = DEFAULTS.getAdditionalConfiguration();
307
- customEndpoints = DEFAULTS.getCustomEndpoints();
308
- constructor(clientToken, env, applicationId, trackInteractions = false, trackResources = false, trackErrors = false, trackingConsent = DEFAULTS.trackingConsent, useAccessibilityLabel = DEFAULTS.useAccessibilityLabel // eslint-disable-next-line no-empty-function
309
- ) {
310
- this.clientToken = clientToken;
311
- this.env = env;
312
- this.applicationId = applicationId;
313
- this.trackInteractions = trackInteractions;
314
- this.trackResources = trackResources;
315
- this.trackErrors = trackErrors;
316
- this.trackingConsent = trackingConsent;
317
- this.useAccessibilityLabel = useAccessibilityLabel;
318
- }
319
- }
320
-
321
- /**
322
- * Auto Instrumentation configuration passed to DatadogProvider.
323
- * Does not include default values.
324
- */
325
-
326
- /**
327
- * Parameters needed to start auto instrumentation. Includes default values.
328
- */
329
-
330
- /**
331
- * We could use `Proxy` instead of this function, but `Proxy` is not available on
332
- * the older android jsc that can still be used.
333
- */
334
- export const addDefaultValuesToAutoInstrumentationConfiguration = features => {
335
- return {
336
- ...features,
337
- firstPartyHosts: features.firstPartyHosts || DEFAULTS.getFirstPartyHosts(),
338
- resourceTracingSamplingRate: features.resourceTracingSamplingRate === undefined ? DEFAULTS.resourceTracingSamplingRate : features.resourceTracingSamplingRate,
339
- logEventMapper: features.logEventMapper === undefined ? DEFAULTS.logEventMapper : features.logEventMapper,
340
- errorEventMapper: features.errorEventMapper === undefined ? DEFAULTS.errorEventMapper : features.errorEventMapper,
341
- resourceEventMapper: features.resourceEventMapper === undefined ? DEFAULTS.resourceEventMapper : features.resourceEventMapper,
342
- actionEventMapper: features.actionEventMapper === undefined ? DEFAULTS.actionEventMapper : features.actionEventMapper,
343
- useAccessibilityLabel: DEFAULTS.useAccessibilityLabel
344
- };
345
- };
346
- const setConfigurationAttribute = (attribute, configuration) => {
347
- if (attribute.value !== undefined) {
348
- configuration[attribute.name] = attribute.value;
349
- }
350
- };
351
- export const buildConfigurationFromPartialConfiguration = (features, configuration) => {
352
- const {
353
- clientToken,
354
- env,
355
- applicationId,
356
- ...remainingConfiguration
357
- } = configuration;
358
- const SdkConfiguration = new DdSdkReactNativeConfiguration(clientToken, env, applicationId, features.trackInteractions, features.trackResources, features.trackErrors, configuration.trackingConsent, features.useAccessibilityLabel);
359
- Object.keys(remainingConfiguration).forEach(name => {
360
- setConfigurationAttribute({
361
- value: remainingConfiguration[name],
362
- name
363
- }, SdkConfiguration);
364
- });
365
- setConfigurationAttribute({
366
- name: 'resourceTracingSamplingRate',
367
- value: features.resourceTracingSamplingRate
368
- }, SdkConfiguration);
369
- setConfigurationAttribute({
370
- name: 'firstPartyHosts',
371
- value: features.firstPartyHosts
372
- }, SdkConfiguration);
373
- setConfigurationAttribute({
374
- name: 'logEventMapper',
375
- value: features.logEventMapper
376
- }, SdkConfiguration);
377
- setConfigurationAttribute({
378
- name: 'errorEventMapper',
379
- value: features.errorEventMapper
380
- }, SdkConfiguration);
381
- setConfigurationAttribute({
382
- name: 'resourceEventMapper',
383
- value: features.resourceEventMapper
384
- }, SdkConfiguration);
385
- setConfigurationAttribute({
386
- name: 'actionEventMapper',
387
- value: features.actionEventMapper
388
- }, SdkConfiguration);
389
- setConfigurationAttribute({
390
- name: 'actionNameAttribute',
391
- value: features.actionNameAttribute
392
- }, SdkConfiguration);
393
- return SdkConfiguration;
394
- };
395
- export class DatadogProviderConfiguration extends DdSdkReactNativeConfiguration {
396
- initializationMode = InitializationMode.SYNC;
397
- }
398
- export let InitializationMode = /*#__PURE__*/function (InitializationMode) {
399
- InitializationMode["SYNC"] = "SYNC";
400
- InitializationMode["ASYNC"] = "ASYNC";
401
- return InitializationMode;
402
- }({});
403
- //# sourceMappingURL=DdSdkReactNativeConfiguration.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["TrackingConsent","PropagatorType","VitalsUpdateFrequency","UploadFrequency","BatchSize","BatchProcessingLevel","isLegacyFirstPartyHost","firstPartyHost","formatFirstPartyHosts","firstPartyHosts","map","host","match","propagatorTypes","DATADOG","TRACECONTEXT","DEFAULTS","nativeCrashReportEnabled","sessionSamplingRate","resourceTracingSamplingRate","site","longTaskThresholdMs","nativeLongTaskThresholdMs","nativeViewTracking","nativeInteractionTracking","getFirstPartyHosts","getAdditionalConfiguration","trackingConsent","GRANTED","telemetrySampleRate","vitalsUpdateFrequency","AVERAGE","logEventMapper","errorEventMapper","resourceEventMapper","actionEventMapper","trackFrustrations","uploadFrequency","batchSize","MEDIUM","trackBackgroundEvents","getCustomEndpoints","bundleLogsWithRum","bundleLogsWithTraces","useAccessibilityLabel","trackWatchdogTerminations","batchProcessingLevel","DdSdkReactNativeConfiguration","verbosity","undefined","proxyConfig","serviceName","additionalConfiguration","customEndpoints","constructor","clientToken","env","applicationId","trackInteractions","trackResources","trackErrors","addDefaultValuesToAutoInstrumentationConfiguration","features","setConfigurationAttribute","attribute","configuration","value","name","buildConfigurationFromPartialConfiguration","remainingConfiguration","SdkConfiguration","Object","keys","forEach","actionNameAttribute","DatadogProviderConfiguration","initializationMode","InitializationMode","SYNC"],"sourceRoot":"../../src","sources":["DdSdkReactNativeConfiguration.tsx"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAIA,SAASA,eAAe,QAAQ,mBAAmB;AAMnD,SAASC,cAAc,QAAQ,aAAa;AAE5C,WAAYC,qBAAqB,0BAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAAA,OAArBA,qBAAqB;AAAA;AAOjC,WAAYC,eAAe,0BAAfA,eAAe;EACvB;AACJ;AACA;EAHYA,eAAe;EAKvB;AACJ;AACA;EAPYA,eAAe;EASvB;AACJ;AACA;EAXYA,eAAe;EAAA,OAAfA,eAAe;AAAA;AAe3B,WAAYC,SAAS,0BAATA,SAAS;EACjB;AACJ;AACA;EAHYA,SAAS;EAKjB;AACJ;AACA;EAPYA,SAAS;EASjB;AACJ;AACA;EAXYA,SAAS;EAAA,OAATA,SAAS;AAAA;AAerB,WAAYC,oBAAoB,0BAApBA,oBAAoB;EAC5B;AACJ;AACA;EAHYA,oBAAoB;EAK5B;AACJ;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DP,yBAAyB,CACrB;IACII,IAAI,EAAE,kBAAkB;IACxBD,KAAK,EAAEJ,QAAQ,CAAC7B;EACpB,CAAC,EACDqC,gBACJ,CAAC;EACDP,yBAAyB,CACrB;IACII,IAAI,EAAE,qBAAqB;IAC3BD,KAAK,EAAEJ,QAAQ,CAAC5B;EACpB,CAAC,EACDoC,gBACJ,CAAC;EACDP,yBAAyB,CACrB;IACII,IAAI,EAAE,mBAAmB;IACzBD,KAAK,EAAEJ,QAAQ,CAAC3B;EACpB,CAAC,EACDmC,gBACJ,CAAC;EACDP,yBAAyB,CACrB;IACII,IAAI,EAAE,qBAAqB;IAC3BD,KAAK,EAAEJ,QAAQ,CAACY;EACpB,CAAC,EACDJ,gBACJ,CAAC;EAED,OAAOA,gBAAgB;AAC3B,CAAC;AAED,OAAO,MAAMK,4BAA4B,SAAS5B,6BAA6B,CAAC;EACrE6B,kBAAkB,GAAuBC,kBAAkB,CAACC,IAAI;AAC3E;AAEA,WAAYD,kBAAkB,0BAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["ProxyConfiguration","constructor","type","address","port","username","password","ProxyType","SOCKS","console","warn"],"sourceRoot":"../../src","sources":["ProxyConfiguration.tsx"],"mappings":"AAAA;AACA;AACA;AACA,MAAMA,kBAAkB,CAAC;EAIrBC,WAAWA;EACP;AACR;AACA;EACiBC,IAAe;EACxB;AACR;AACA;EACiBC,OAAe;EACxB;AACR;AACA;EACiBC,IAAY;EACrB;AACR;AACA;AACA;AACA;EACQC,QAAiB;EACjB;AACR;AACA;EACQC,QAAiB,EACnB;IAAA,KAnBWJ,IAAe,GAAfA,IAAe;IAAA,KAIfC,OAAe,GAAfA,OAAe;IAAA,KAIfC,IAAY,GAAZA,IAAY;IAYrB,IAAIC,QAAQ,IAAIC,QAAQ,EAAE;MACtB,IAAIJ,IAAI,KAAKK,SAAS,CAACC,KAAK,EAAE;QAC1BC,OAAO,CAACC,IAAI,CACR,iEACJ,CAAC;MACL,CAAC,MAAM;QACH,IAAI,CAACL,QAAQ,GAAGA,QAAQ;QACxB,IAAI,CAACC,QAAQ,GAAGA,QAAQ;MAC5B;IACJ;EACJ;AACJ;AAAC,IAEIC,SAAS,0BAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAAA,OAATA,SAAS;AAAA,EAATA,SAAS;AAMd,SAASP,kBAAkB,EAAEO,SAAS","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["SdkVerbosity"],"sourceRoot":"../../src","sources":["SdkVerbosity.tsx"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAYA,YAAY,0BAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["TrackingConsent"],"sourceRoot":"../../src","sources":["TrackingConsent.tsx"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAYA,eAAe,0BAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["DdAttributes","errorSourceType","errorFingerprint","debugId"],"sourceRoot":"../../../src","sources":["rum/DdAttributes.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,YAAY,GAAG;EACxB;AACJ;AACA;AACA;AACA;EACIC,eAAe,EAAE,uBAAuB;EAExC;AACJ;AACA;AACA;EACIC,gBAAgB,EAAE,uBAAuB;EAEzC;AACJ;AACA;AACA;AACA;EACIC,OAAO,EAAE;AACb,CAAC","ignoreList":[]}
@@ -1,176 +0,0 @@
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 { DatadogProviderConfiguration, DEFAULTS } from '../../DdSdkReactNativeConfiguration';
8
- import { SdkVerbosity } from '../../SdkVerbosity';
9
- import { TrackingConsent } from '../../TrackingConsent';
10
- import { PropagatorType } from '../../rum/types';
11
- export class FileBasedConfiguration extends DatadogProviderConfiguration {
12
- constructor(params) {
13
- const configuration = getJSONConfiguration(params?.configuration);
14
- super(configuration.clientToken, configuration.env, configuration.applicationId, configuration.trackInteractions, configuration.trackResources, configuration.trackErrors, configuration.trackingConsent, configuration.useAccessibilityLabel);
15
- this.longTaskThresholdMs = configuration.longTaskThresholdMs || DEFAULTS.longTaskThresholdMs;
16
- this.verbosity = configuration.verbosity;
17
- this.actionNameAttribute = configuration.actionNameAttribute;
18
- this.site = configuration.site || DEFAULTS.site;
19
- this.resourceTracingSamplingRate = configuration.resourceTracingSamplingRate || DEFAULTS.resourceTracingSamplingRate;
20
- this.firstPartyHosts = configuration.firstPartyHosts || DEFAULTS.getFirstPartyHosts();
21
- this.errorEventMapper = params?.errorEventMapper || DEFAULTS.errorEventMapper;
22
- this.resourceEventMapper = params?.resourceEventMapper || DEFAULTS.resourceEventMapper;
23
- this.actionEventMapper = params?.actionEventMapper || DEFAULTS.actionEventMapper;
24
- }
25
- }
26
- const resolveJSONConfiguration = userSpecifiedConfiguration => {
27
- if (userSpecifiedConfiguration === undefined || userSpecifiedConfiguration === null) {
28
- try {
29
- // This corresponds to a file located at the root of a RN project.
30
- // /!\ We have to write the require this way as dynamic requires are not supported by Hermes.
31
- // eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
32
- const jsonContent = require('../../../../../../datadog-configuration.json');
33
- if (typeof jsonContent !== 'object' || !jsonContent['configuration']) {
34
- console.error(`Failed to parse the Datadog configuration file located at the root of the project.
35
- Your configuration must validate the node_modules/@datadog/mobile-react-native/datadog-configuration.schema.json JSON schema.
36
- You can use VSCode to check your configuration by adding the following line to your JSON file:
37
- {
38
- "$schema": "./node_modules/@datadog/mobile-react-native/datadog-configuration.schema.json",
39
- }`);
40
- return {};
41
- }
42
- return jsonContent.configuration;
43
- } catch (error) {
44
- console.error(`Failed to read Datadog configuration file at the root of the project.
45
- If you don't have a datadog-configuration.json file at the same level as your node_modules directory,\
46
- please use the following syntax:\n
47
- new FileBasedConfiguration({configuration: require('./file/to/configuration-file.json')})
48
- `);
49
- return {};
50
- }
51
- }
52
- if (typeof userSpecifiedConfiguration !== 'object' || !userSpecifiedConfiguration['configuration']) {
53
- console.error(`Failed to parse the Datadog configuration file you provided.
54
- Your configuration must validate the node_modules/@datadog/mobile-react-native/datadog-configuration.schema.json JSON schema.
55
- You can use VSCode to check your configuration by adding the following line to your JSON file:
56
- {
57
- "$schema": "./node_modules/@datadog/mobile-react-native/datadog-configuration.schema.json",
58
- }`);
59
- return {};
60
- }
61
- return userSpecifiedConfiguration['configuration'];
62
- };
63
- export const getJSONConfiguration = userSpecifiedConfiguration => {
64
- const configuration = resolveJSONConfiguration(userSpecifiedConfiguration);
65
- return {
66
- clientToken: configuration.clientToken,
67
- env: configuration.env,
68
- applicationId: configuration.applicationId,
69
- trackInteractions: configuration.trackInteractions,
70
- trackResources: configuration.trackResources,
71
- trackErrors: configuration.trackErrors,
72
- trackingConsent: buildTrackingConsent(configuration.trackingConsent),
73
- longTaskThresholdMs: configuration.longTaskThresholdMs,
74
- verbosity: buildSdkVerbosity(configuration.verbosity),
75
- actionNameAttribute: configuration.actionNameAttribute,
76
- resourceTracingSamplingRate: configuration.resourceTracingSamplingRate,
77
- firstPartyHosts: buildFirstPartyHosts(configuration.firstPartyHosts),
78
- site: configuration.site,
79
- useAccessibilityLabel: configuration.useAccessibilityLabel
80
- };
81
- };
82
- const buildFirstPartyHosts = firstPartyHosts => {
83
- if (!firstPartyHosts) {
84
- return undefined;
85
- }
86
- try {
87
- return firstPartyHosts.map(({
88
- match,
89
- propagatorTypes
90
- }) => ({
91
- match,
92
- propagatorTypes: propagatorTypes.map(formatPropagatorType)
93
- }));
94
- } catch (error) {
95
- console.error(`Failed to parse the first party hosts from the Datadog configuration file you provided:
96
- ${error.message}
97
- The first party hosts will not be set for this session.
98
- `);
99
- return undefined;
100
- }
101
- };
102
- export const formatPropagatorType = propagatorType => {
103
- switch (propagatorType.toLowerCase()) {
104
- case 'b3':
105
- {
106
- return PropagatorType.B3;
107
- }
108
- case 'b3multi':
109
- {
110
- return PropagatorType.B3MULTI;
111
- }
112
- case 'datadog':
113
- {
114
- return PropagatorType.DATADOG;
115
- }
116
- case 'tracecontext':
117
- {
118
- return PropagatorType.TRACECONTEXT;
119
- }
120
- default:
121
- {
122
- throw new Error(`Failed to parse propagator type ${propagatorType}.`);
123
- }
124
- }
125
- };
126
- const buildTrackingConsent = trackingConsent => {
127
- if (trackingConsent === undefined) {
128
- return undefined;
129
- }
130
- switch (trackingConsent.toLowerCase()) {
131
- case 'granted':
132
- {
133
- return TrackingConsent.GRANTED;
134
- }
135
- case 'pending':
136
- {
137
- return TrackingConsent.PENDING;
138
- }
139
- case 'not_granted':
140
- {
141
- return TrackingConsent.NOT_GRANTED;
142
- }
143
- default:
144
- {
145
- return DEFAULTS.trackingConsent;
146
- }
147
- }
148
- };
149
- const buildSdkVerbosity = verbosity => {
150
- if (verbosity === undefined) {
151
- return undefined;
152
- }
153
- switch (verbosity.toLowerCase()) {
154
- case 'debug':
155
- {
156
- return SdkVerbosity.DEBUG;
157
- }
158
- case 'info':
159
- {
160
- return SdkVerbosity.INFO;
161
- }
162
- case 'warn':
163
- {
164
- return SdkVerbosity.WARN;
165
- }
166
- case 'error':
167
- {
168
- return SdkVerbosity.ERROR;
169
- }
170
- default:
171
- {
172
- return undefined;
173
- }
174
- }
175
- };
176
- //# sourceMappingURL=FileBasedConfiguration.js.map