@datadog/mobile-react-native 2.14.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DatadogSDKReactNative.podspec +6 -6
- package/README.md +23 -13
- package/android/build.gradle +10 -11
- package/android/gradle.properties +1 -1
- package/android/src/main/kotlin/com/datadog/reactnative/DatadogSDKWrapper.kt +36 -93
- package/android/src/main/kotlin/com/datadog/reactnative/DatadogWrapper.kt +46 -59
- package/android/src/main/kotlin/com/datadog/reactnative/DdLogsImplementation.kt +2 -1
- package/android/src/main/kotlin/com/datadog/reactnative/DdRumImplementation.kt +98 -0
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfiguration.kt +125 -75
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfigurationExt.kt +199 -90
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkImplementation.kt +151 -24
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkNativeInitialization.kt +57 -33
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkReactNativePackage.kt +2 -1
- package/android/src/main/kotlin/com/datadog/reactnative/DdTelemetry.kt +96 -0
- package/android/src/main/kotlin/com/datadog/reactnative/DdTraceImplementation.kt +20 -19
- package/android/src/main/kotlin/com/datadog/reactnative/SdkVersion.kt +1 -1
- package/android/src/newarch/kotlin/com/datadog/reactnative/DdRum.kt +100 -1
- package/android/src/newarch/kotlin/com/datadog/reactnative/DdSdk.kt +68 -14
- package/android/src/oldarch/kotlin/com/datadog/reactnative/DdRum.kt +94 -0
- package/android/src/oldarch/kotlin/com/datadog/reactnative/DdSdk.kt +70 -11
- package/android/src/test/kotlin/com/datadog/reactnative/DdRumTest.kt +58 -0
- package/android/src/test/kotlin/com/datadog/reactnative/DdSdkNativeInitializationTest.kt +63 -43
- package/android/src/test/kotlin/com/datadog/reactnative/DdSdkTest.kt +2024 -1199
- package/android/src/test/kotlin/com/datadog/reactnative/DdTraceTest.kt +44 -40
- package/android/src/test/kotlin/com/datadog/tools/unit/DdSdkConfigurationExt.kt +60 -91
- package/android/src/test/kotlin/com/datadog/tools/unit/MockRumMonitor.kt +34 -14
- package/android/src/test/kotlin/com/datadog/tools/unit/forge/DdSdkConfigurationForgeryFactory.kt +47 -43
- package/android/src/test/kotlin/com/datadog/tools/unit/forge/TelemetryConfigurationEventForgeryFactory.kt +0 -1
- package/android/src/test/resources/input/complete-configuration.json +32 -28
- package/android/src/test/resources/input/malformed-configuration.json +1 -1
- package/android/src/test/resources/input/minimal-configuration.json +4 -2
- package/datadog-configuration.schema.json +187 -139
- package/datadog-sourcemaps.gradle +2 -1
- package/ios/Sources/AnyEncodable.swift +14 -7
- package/ios/Sources/Attributes.swift +0 -7
- package/ios/Sources/DatadogSDKWrapper.swift +12 -128
- package/ios/Sources/DdLogsImplementation.swift +9 -39
- package/ios/Sources/DdRum.mm +89 -1
- package/ios/Sources/DdRumImplementation.swift +79 -0
- package/ios/Sources/DdSdk.mm +76 -11
- package/ios/Sources/DdSdkConfiguration.swift +159 -117
- package/ios/Sources/DdSdkImplementation.swift +235 -82
- package/ios/Sources/DdSdkNativeInitialization.swift +116 -80
- package/ios/Sources/DdTelemetry.swift +49 -0
- package/ios/Sources/GlobalState.swift +1 -1
- package/ios/Sources/RNDdSdkConfiguration.swift +334 -172
- package/ios/Sources/SdkVersion.swift +1 -1
- package/jest/mock.js +43 -4
- package/lib/commonjs/DdAttributes.js.map +1 -0
- package/lib/commonjs/DdSdkReactNative.js +159 -56
- package/lib/commonjs/DdSdkReactNative.js.map +1 -1
- package/lib/commonjs/InternalLog.js +1 -1
- package/lib/commonjs/config/DatadogProviderConfiguration.js +25 -0
- package/lib/commonjs/config/DatadogProviderConfiguration.js.map +1 -0
- package/lib/commonjs/config/FileBasedConfiguration.js +349 -0
- package/lib/commonjs/config/FileBasedConfiguration.js.map +1 -0
- package/lib/commonjs/config/FileBasedConfiguration.type.js +6 -0
- package/lib/commonjs/config/FileBasedConfiguration.type.js.map +1 -0
- package/lib/commonjs/config/async/AutoInstrumentationConfiguration.js +51 -0
- package/lib/commonjs/config/async/AutoInstrumentationConfiguration.js.map +1 -0
- package/lib/commonjs/config/async/PartialInitializationConfiguration.js +6 -0
- package/lib/commonjs/config/async/PartialInitializationConfiguration.js.map +1 -0
- package/lib/commonjs/config/async/asyncInitializationHelper.js +44 -0
- package/lib/commonjs/config/async/asyncInitializationHelper.js.map +1 -0
- package/lib/commonjs/config/features/CoreConfiguration.js +104 -0
- package/lib/commonjs/config/features/CoreConfiguration.js.map +1 -0
- package/lib/commonjs/config/features/CoreConfiguration.type.js +6 -0
- package/lib/commonjs/config/features/CoreConfiguration.type.js.map +1 -0
- package/lib/commonjs/config/features/CoreConfigurationNative.js +38 -0
- package/lib/commonjs/config/features/CoreConfigurationNative.js.map +1 -0
- package/lib/commonjs/config/features/LogsConfiguration.js +36 -0
- package/lib/commonjs/config/features/LogsConfiguration.js.map +1 -0
- package/lib/commonjs/config/features/LogsConfiguration.type.js +6 -0
- package/lib/commonjs/config/features/LogsConfiguration.type.js.map +1 -0
- package/lib/commonjs/config/features/LogsConfigurationNative.js +2 -0
- package/lib/commonjs/config/features/LogsConfigurationNative.js.map +1 -0
- package/lib/commonjs/config/features/RumConfiguration.js +120 -0
- package/lib/commonjs/config/features/RumConfiguration.js.map +1 -0
- package/lib/commonjs/config/features/RumConfiguration.type.js +6 -0
- package/lib/commonjs/config/features/RumConfiguration.type.js.map +1 -0
- package/lib/commonjs/config/features/RumConfigurationNative.js +2 -0
- package/lib/commonjs/config/features/RumConfigurationNative.js.map +1 -0
- package/lib/commonjs/config/features/TraceConfiguration.js +24 -0
- package/lib/commonjs/config/features/TraceConfiguration.js.map +1 -0
- package/lib/commonjs/config/features/TraceConfiguration.type.js +2 -0
- package/lib/commonjs/config/features/TraceConfiguration.type.js.map +1 -0
- package/lib/commonjs/config/features/TraceConfigurationNative.js +2 -0
- package/lib/commonjs/config/features/TraceConfigurationNative.js.map +1 -0
- package/lib/commonjs/config/types/BatchProcessingLevel.js +30 -0
- package/lib/commonjs/config/types/BatchProcessingLevel.js.map +1 -0
- package/lib/commonjs/config/types/BatchSize.js +31 -0
- package/lib/commonjs/config/types/BatchSize.js.map +1 -0
- package/lib/commonjs/config/types/InitializationMode.js +17 -0
- package/lib/commonjs/config/types/InitializationMode.js.map +1 -0
- package/lib/commonjs/config/types/InitializationModeForTelemetry.js +2 -0
- package/lib/commonjs/config/types/InitializationModeForTelemetry.js.map +1 -0
- package/lib/commonjs/{ProxyConfiguration.js → config/types/ProxyConfiguration.js} +6 -0
- package/lib/commonjs/config/types/ProxyConfiguration.js.map +1 -0
- package/lib/commonjs/config/types/SdkVerbosity.js.map +1 -0
- package/lib/commonjs/config/types/TrackingConsent.js.map +1 -0
- package/lib/commonjs/config/types/UploadFrequency.js +30 -0
- package/lib/commonjs/config/types/UploadFrequency.js.map +1 -0
- package/lib/commonjs/config/types/VitalsUpdateFrequency.js +19 -0
- package/lib/commonjs/config/types/VitalsUpdateFrequency.js.map +1 -0
- package/lib/commonjs/config/types/index.js +68 -0
- package/lib/commonjs/config/types/index.js.map +1 -0
- package/lib/commonjs/index.js +51 -21
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/logs/DdLogs.js +13 -9
- package/lib/commonjs/logs/DdLogs.js.map +1 -1
- package/lib/commonjs/logs/eventMapper.js +4 -1
- package/lib/commonjs/logs/eventMapper.js.map +1 -1
- package/lib/commonjs/metro/plugin/metroSerializer.js.map +1 -1
- package/lib/commonjs/nativeModulesTypes.js +0 -45
- package/lib/commonjs/nativeModulesTypes.js.map +1 -1
- package/lib/commonjs/rum/DdRum.js +56 -28
- package/lib/commonjs/rum/DdRum.js.map +1 -1
- package/lib/commonjs/rum/helper.js +63 -0
- package/lib/commonjs/rum/helper.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js +14 -18
- package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js +16 -27
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdEventsInterceptor.js +1 -1
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js +15 -5
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/DdRumResourceTracking.js +34 -22
- package/lib/commonjs/rum/instrumentation/resourceTracking/DdRumResourceTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js +21 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js +16 -3
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js +10 -12
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.js +6 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js +41 -47
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.js +62 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/headers.js +36 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/headers.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.js +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js +19 -8
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js +90 -48
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.js +1 -1
- package/lib/commonjs/rum/types.js +1 -9
- package/lib/commonjs/rum/types.js.map +1 -1
- package/lib/commonjs/sdk/AccountInfoSingleton/AccountInfoSingleton.js +46 -0
- package/lib/commonjs/sdk/AccountInfoSingleton/AccountInfoSingleton.js.map +1 -0
- package/lib/commonjs/sdk/AccountInfoSingleton/types.js +2 -0
- package/lib/commonjs/sdk/AccountInfoSingleton/types.js.map +1 -0
- package/lib/commonjs/sdk/AttributesEncoding/attributesEncoding.js +51 -0
- package/lib/commonjs/sdk/AttributesEncoding/attributesEncoding.js.map +1 -0
- package/lib/commonjs/sdk/AttributesEncoding/defaultEncoders.js +140 -0
- package/lib/commonjs/sdk/AttributesEncoding/defaultEncoders.js.map +1 -0
- package/lib/commonjs/{utils → sdk/AttributesEncoding}/errorUtils.js +39 -22
- package/lib/commonjs/sdk/AttributesEncoding/errorUtils.js.map +1 -0
- package/lib/commonjs/sdk/AttributesEncoding/helpers.js +123 -0
- package/lib/commonjs/sdk/AttributesEncoding/helpers.js.map +1 -0
- package/lib/commonjs/sdk/AttributesEncoding/types.js +2 -0
- package/lib/commonjs/sdk/AttributesEncoding/types.js.map +1 -0
- package/lib/commonjs/sdk/AttributesEncoding/utils.js +36 -0
- package/lib/commonjs/sdk/AttributesEncoding/utils.js.map +1 -0
- package/lib/commonjs/sdk/AttributesSingleton/AttributesSingleton.js +27 -1
- package/lib/commonjs/sdk/AttributesSingleton/AttributesSingleton.js.map +1 -1
- package/lib/commonjs/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.js +3 -3
- package/lib/commonjs/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.js.map +1 -1
- package/lib/commonjs/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.js +1 -1
- package/lib/commonjs/sdk/DatadogProvider/Buffer/BoundedBuffer.js +4 -4
- package/lib/commonjs/sdk/DatadogProvider/Buffer/BoundedBuffer.js.map +1 -1
- package/lib/commonjs/sdk/DatadogProvider/DatadogProvider.js +10 -9
- package/lib/commonjs/sdk/DatadogProvider/DatadogProvider.js.map +1 -1
- package/lib/commonjs/sdk/DatadogProvider/DatadogProviderState.js +28 -0
- package/lib/commonjs/sdk/DatadogProvider/DatadogProviderState.js.map +1 -0
- package/lib/commonjs/sdk/DdSdk.js +4 -2
- package/lib/commonjs/sdk/DdSdk.js.map +1 -1
- package/lib/commonjs/sdk/DdSdkInternal.js +86 -0
- package/lib/commonjs/sdk/DdSdkInternal.js.map +1 -0
- package/lib/commonjs/sdk/EventMappers/EventMapper.js +6 -3
- package/lib/commonjs/sdk/EventMappers/EventMapper.js.map +1 -1
- package/lib/commonjs/sdk/GlobalState/GlobalState.js +5 -11
- package/lib/commonjs/sdk/GlobalState/GlobalState.js.map +1 -1
- package/lib/commonjs/sdk/UserInfoSingleton/UserInfoSingleton.js +6 -1
- package/lib/commonjs/sdk/UserInfoSingleton/UserInfoSingleton.js.map +1 -1
- package/lib/commonjs/specs/NativeDdRum.js.map +1 -1
- package/lib/commonjs/specs/NativeDdSdk.js.map +1 -1
- package/lib/commonjs/trace/DdTrace.js +7 -5
- package/lib/commonjs/trace/DdTrace.js.map +1 -1
- package/lib/commonjs/types.js +19 -46
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/longTasksUtils.js.map +1 -1
- package/lib/commonjs/utils/singletonUtils.js +21 -0
- package/lib/commonjs/utils/singletonUtils.js.map +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/DdAttributes.js.map +1 -0
- package/lib/module/DdSdkReactNative.js +155 -52
- package/lib/module/DdSdkReactNative.js.map +1 -1
- package/lib/module/InternalLog.js +1 -1
- package/lib/module/InternalLog.js.map +1 -1
- package/lib/module/config/DatadogProviderConfiguration.js +18 -0
- package/lib/module/config/DatadogProviderConfiguration.js.map +1 -0
- package/lib/module/config/FileBasedConfiguration.js +341 -0
- package/lib/module/config/FileBasedConfiguration.js.map +1 -0
- package/lib/module/config/FileBasedConfiguration.type.js +2 -0
- package/lib/module/config/FileBasedConfiguration.type.js.map +1 -0
- package/lib/module/config/async/AutoInstrumentationConfiguration.js +45 -0
- package/lib/module/config/async/AutoInstrumentationConfiguration.js.map +1 -0
- package/lib/module/config/async/PartialInitializationConfiguration.js +2 -0
- package/lib/module/config/async/PartialInitializationConfiguration.js.map +1 -0
- package/lib/module/config/async/asyncInitializationHelper.js +36 -0
- package/lib/module/config/async/asyncInitializationHelper.js.map +1 -0
- package/lib/module/config/features/CoreConfiguration.js +98 -0
- package/lib/module/config/features/CoreConfiguration.js.map +1 -0
- package/lib/module/config/features/CoreConfiguration.type.js +2 -0
- package/lib/module/config/features/CoreConfiguration.type.js.map +1 -0
- package/lib/module/config/features/CoreConfigurationNative.js +31 -0
- package/lib/module/config/features/CoreConfigurationNative.js.map +1 -0
- package/lib/module/config/features/LogsConfiguration.js +30 -0
- package/lib/module/config/features/LogsConfiguration.js.map +1 -0
- package/lib/module/config/features/LogsConfiguration.type.js +2 -0
- package/lib/module/config/features/LogsConfiguration.type.js.map +1 -0
- package/lib/module/config/features/LogsConfigurationNative.js +2 -0
- package/lib/module/config/features/LogsConfigurationNative.js.map +1 -0
- package/lib/module/config/features/RumConfiguration.js +114 -0
- package/lib/module/config/features/RumConfiguration.js.map +1 -0
- package/lib/module/config/features/RumConfiguration.type.js +2 -0
- package/lib/module/config/features/RumConfiguration.type.js.map +1 -0
- package/lib/module/config/features/RumConfigurationNative.js +2 -0
- package/lib/module/config/features/RumConfigurationNative.js.map +1 -0
- package/lib/module/config/features/TraceConfiguration.js +18 -0
- package/lib/module/config/features/TraceConfiguration.js.map +1 -0
- package/lib/module/config/features/TraceConfiguration.type.js +2 -0
- package/lib/module/config/features/TraceConfiguration.type.js.map +1 -0
- package/lib/module/config/features/TraceConfigurationNative.js +2 -0
- package/lib/module/config/features/TraceConfigurationNative.js.map +1 -0
- package/lib/module/config/types/BatchProcessingLevel.js +25 -0
- package/lib/module/config/types/BatchProcessingLevel.js.map +1 -0
- package/lib/module/config/types/BatchSize.js +26 -0
- package/lib/module/config/types/BatchSize.js.map +1 -0
- package/lib/module/config/types/InitializationMode.js +11 -0
- package/lib/module/config/types/InitializationMode.js.map +1 -0
- package/lib/module/config/types/InitializationModeForTelemetry.js +2 -0
- package/lib/module/config/types/InitializationModeForTelemetry.js.map +1 -0
- package/lib/module/{ProxyConfiguration.js → config/types/ProxyConfiguration.js} +6 -0
- package/lib/module/config/types/ProxyConfiguration.js.map +1 -0
- package/lib/module/config/types/SdkVerbosity.js.map +1 -0
- package/lib/module/config/types/TrackingConsent.js.map +1 -0
- package/lib/module/config/types/UploadFrequency.js +25 -0
- package/lib/module/config/types/UploadFrequency.js.map +1 -0
- package/lib/module/config/types/VitalsUpdateFrequency.js +13 -0
- package/lib/module/config/types/VitalsUpdateFrequency.js.map +1 -0
- package/lib/module/config/types/index.js +15 -0
- package/lib/module/config/types/index.js.map +1 -0
- package/lib/module/index.js +13 -7
- package/lib/module/index.js.map +1 -1
- package/lib/module/logs/DdLogs.js +13 -9
- package/lib/module/logs/DdLogs.js.map +1 -1
- package/lib/module/logs/eventMapper.js +4 -1
- package/lib/module/logs/eventMapper.js.map +1 -1
- package/lib/module/metro/plugin/metroSerializer.js.map +1 -1
- package/lib/module/nativeModulesTypes.js +1 -43
- package/lib/module/nativeModulesTypes.js.map +1 -1
- package/lib/module/rum/DdRum.js +54 -26
- package/lib/module/rum/DdRum.js.map +1 -1
- package/lib/module/rum/helper.js +49 -0
- package/lib/module/rum/helper.js.map +1 -0
- package/lib/module/rum/instrumentation/DdRumErrorTracking.js +14 -18
- package/lib/module/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js +16 -26
- package/lib/module/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdEventsInterceptor.js +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdEventsInterceptor.js.map +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js +15 -5
- package/lib/module/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/DdRumResourceTracking.js +33 -21
- package/lib/module/rum/instrumentation/resourceTracking/DdRumResourceTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js +22 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js +13 -2
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js +10 -11
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.js +2 -0
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js +27 -33
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.js +54 -0
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/headers.js +30 -0
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/headers.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.js +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js +14 -3
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js +90 -48
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.js +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.js.map +1 -1
- package/lib/module/rum/types.js +0 -9
- package/lib/module/rum/types.js.map +1 -1
- package/lib/module/sdk/AccountInfoSingleton/AccountInfoSingleton.js +39 -0
- package/lib/module/sdk/AccountInfoSingleton/AccountInfoSingleton.js.map +1 -0
- package/lib/module/sdk/AccountInfoSingleton/types.js +2 -0
- package/lib/module/sdk/AccountInfoSingleton/types.js.map +1 -0
- package/lib/module/sdk/AttributesEncoding/attributesEncoding.js +46 -0
- package/lib/module/sdk/AttributesEncoding/attributesEncoding.js.map +1 -0
- package/lib/module/sdk/AttributesEncoding/defaultEncoders.js +134 -0
- package/lib/module/sdk/AttributesEncoding/defaultEncoders.js.map +1 -0
- package/lib/module/{utils → sdk/AttributesEncoding}/errorUtils.js +37 -20
- package/lib/module/sdk/AttributesEncoding/errorUtils.js.map +1 -0
- package/lib/module/sdk/AttributesEncoding/helpers.js +115 -0
- package/lib/module/sdk/AttributesEncoding/helpers.js.map +1 -0
- package/lib/module/sdk/AttributesEncoding/types.js +2 -0
- package/lib/module/sdk/AttributesEncoding/types.js.map +1 -0
- package/lib/module/sdk/AttributesEncoding/utils.js +28 -0
- package/lib/module/sdk/AttributesEncoding/utils.js.map +1 -0
- package/lib/module/sdk/AttributesSingleton/AttributesSingleton.js +27 -1
- package/lib/module/sdk/AttributesSingleton/AttributesSingleton.js.map +1 -1
- package/lib/module/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.js +2 -2
- package/lib/module/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.js.map +1 -1
- package/lib/module/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.js +1 -1
- package/lib/module/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.js.map +1 -1
- package/lib/module/sdk/DatadogProvider/Buffer/BoundedBuffer.js +4 -4
- package/lib/module/sdk/DatadogProvider/Buffer/BoundedBuffer.js.map +1 -1
- package/lib/module/sdk/DatadogProvider/DatadogProvider.js +9 -8
- package/lib/module/sdk/DatadogProvider/DatadogProvider.js.map +1 -1
- package/lib/module/sdk/DatadogProvider/DatadogProviderState.js +21 -0
- package/lib/module/sdk/DatadogProvider/DatadogProviderState.js.map +1 -0
- package/lib/module/sdk/DdSdk.js +4 -4
- package/lib/module/sdk/DdSdk.js.map +1 -1
- package/lib/module/sdk/DdSdkInternal.js +80 -0
- package/lib/module/sdk/DdSdkInternal.js.map +1 -0
- package/lib/module/sdk/EventMappers/EventMapper.js +6 -3
- package/lib/module/sdk/EventMappers/EventMapper.js.map +1 -1
- package/lib/module/sdk/GlobalState/GlobalState.js +5 -10
- package/lib/module/sdk/GlobalState/GlobalState.js.map +1 -1
- package/lib/module/sdk/UserInfoSingleton/UserInfoSingleton.js +6 -1
- package/lib/module/sdk/UserInfoSingleton/UserInfoSingleton.js.map +1 -1
- package/lib/module/specs/NativeDdRum.js.map +1 -1
- package/lib/module/specs/NativeDdSdk.js.map +1 -1
- package/lib/module/trace/DdTrace.js +7 -6
- package/lib/module/trace/DdTrace.js.map +1 -1
- package/lib/module/types.js +22 -42
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/longTasksUtils.js.map +1 -1
- package/lib/module/utils/singletonUtils.js +14 -0
- package/lib/module/utils/singletonUtils.js.map +1 -0
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/DdAttributes.d.ts.map +1 -0
- package/lib/typescript/DdSdkReactNative.d.ts +49 -12
- package/lib/typescript/DdSdkReactNative.d.ts.map +1 -1
- package/lib/typescript/InternalLog.d.ts +1 -1
- package/lib/typescript/InternalLog.d.ts.map +1 -1
- package/lib/typescript/config/DatadogProviderConfiguration.d.ts +12 -0
- package/lib/typescript/config/DatadogProviderConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/FileBasedConfiguration.d.ts +17 -0
- package/lib/typescript/config/FileBasedConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/FileBasedConfiguration.type.d.ts +52 -0
- package/lib/typescript/config/FileBasedConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/config/async/AutoInstrumentationConfiguration.d.ts +60 -0
- package/lib/typescript/config/async/AutoInstrumentationConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/async/PartialInitializationConfiguration.d.ts +47 -0
- package/lib/typescript/config/async/PartialInitializationConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/async/asyncInitializationHelper.d.ts +5 -0
- package/lib/typescript/config/async/asyncInitializationHelper.d.ts.map +1 -0
- package/lib/typescript/config/features/CoreConfiguration.d.ts +52 -0
- package/lib/typescript/config/features/CoreConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/features/CoreConfiguration.type.d.ts +90 -0
- package/lib/typescript/config/features/CoreConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/config/features/CoreConfigurationNative.d.ts +54 -0
- package/lib/typescript/config/features/CoreConfigurationNative.d.ts.map +1 -0
- package/lib/typescript/config/features/LogsConfiguration.d.ts +17 -0
- package/lib/typescript/config/features/LogsConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/features/LogsConfiguration.type.d.ts +24 -0
- package/lib/typescript/config/features/LogsConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/config/features/LogsConfigurationNative.d.ts +6 -0
- package/lib/typescript/config/features/LogsConfigurationNative.d.ts.map +1 -0
- package/lib/typescript/config/features/RumConfiguration.d.ts +66 -0
- package/lib/typescript/config/features/RumConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/features/RumConfiguration.type.d.ts +131 -0
- package/lib/typescript/config/features/RumConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/config/features/RumConfigurationNative.d.ts +25 -0
- package/lib/typescript/config/features/RumConfigurationNative.d.ts.map +1 -0
- package/lib/typescript/config/features/TraceConfiguration.d.ts +10 -0
- package/lib/typescript/config/features/TraceConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/features/TraceConfiguration.type.d.ts +11 -0
- package/lib/typescript/config/features/TraceConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/config/features/TraceConfigurationNative.d.ts +4 -0
- package/lib/typescript/config/features/TraceConfigurationNative.d.ts.map +1 -0
- package/lib/typescript/config/types/BatchProcessingLevel.d.ts +18 -0
- package/lib/typescript/config/types/BatchProcessingLevel.d.ts.map +1 -0
- package/lib/typescript/config/types/BatchSize.d.ts +19 -0
- package/lib/typescript/config/types/BatchSize.d.ts.map +1 -0
- package/lib/typescript/config/types/InitializationMode.d.ts +5 -0
- package/lib/typescript/config/types/InitializationMode.d.ts.map +1 -0
- package/lib/typescript/config/types/InitializationModeForTelemetry.d.ts +2 -0
- package/lib/typescript/config/types/InitializationModeForTelemetry.d.ts.map +1 -0
- package/lib/typescript/config/types/ProxyConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/types/SdkVerbosity.d.ts.map +1 -0
- package/lib/typescript/config/types/TrackingConsent.d.ts.map +1 -0
- package/lib/typescript/config/types/UploadFrequency.d.ts +18 -0
- package/lib/typescript/config/types/UploadFrequency.d.ts.map +1 -0
- package/lib/typescript/config/types/VitalsUpdateFrequency.d.ts +7 -0
- package/lib/typescript/config/types/VitalsUpdateFrequency.d.ts.map +1 -0
- package/lib/typescript/config/types/index.d.ts +10 -0
- package/lib/typescript/config/types/index.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +20 -9
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/logs/DdLogs.d.ts +2 -1
- package/lib/typescript/logs/DdLogs.d.ts.map +1 -1
- package/lib/typescript/logs/eventMapper.d.ts +3 -2
- package/lib/typescript/logs/eventMapper.d.ts.map +1 -1
- package/lib/typescript/logs/types.d.ts +1 -16
- package/lib/typescript/logs/types.d.ts.map +1 -1
- package/lib/typescript/nativeModulesTypes.d.ts +2 -15
- package/lib/typescript/nativeModulesTypes.d.ts.map +1 -1
- package/lib/typescript/rum/DdRum.d.ts +10 -1
- package/lib/typescript/rum/DdRum.d.ts.map +1 -1
- package/lib/typescript/rum/eventMappers/errorEventMapper.d.ts +1 -1
- package/lib/typescript/rum/eventMappers/errorEventMapper.d.ts.map +1 -1
- package/lib/typescript/rum/helper.d.ts +10 -0
- package/lib/typescript/rum/helper.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/DdRumErrorTracking.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.d.ts +6 -6
- package/lib/typescript/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.d.ts +7 -0
- package/lib/typescript/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts +12 -6
- package/lib/typescript/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.d.ts +8 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.d.ts +5 -17
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.d.ts +20 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.d.ts +3 -24
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.d.ts +12 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/headers.d.ts +24 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/headers.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.d.ts +2 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts.map +1 -1
- package/lib/typescript/rum/types.d.ts +47 -7
- package/lib/typescript/rum/types.d.ts.map +1 -1
- package/lib/typescript/sdk/AccountInfoSingleton/AccountInfoSingleton.d.ts +15 -0
- package/lib/typescript/sdk/AccountInfoSingleton/AccountInfoSingleton.d.ts.map +1 -0
- package/lib/typescript/sdk/AccountInfoSingleton/types.d.ts +6 -0
- package/lib/typescript/sdk/AccountInfoSingleton/types.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesEncoding/attributesEncoding.d.ts +13 -0
- package/lib/typescript/sdk/AttributesEncoding/attributesEncoding.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesEncoding/defaultEncoders.d.ts +33 -0
- package/lib/typescript/sdk/AttributesEncoding/defaultEncoders.d.ts.map +1 -0
- package/lib/typescript/{utils → sdk/AttributesEncoding}/errorUtils.d.ts +4 -4
- package/lib/typescript/sdk/AttributesEncoding/errorUtils.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesEncoding/helpers.d.ts +17 -0
- package/lib/typescript/sdk/AttributesEncoding/helpers.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesEncoding/types.d.ts +21 -0
- package/lib/typescript/sdk/AttributesEncoding/types.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesEncoding/utils.d.ts +7 -0
- package/lib/typescript/sdk/AttributesEncoding/utils.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesSingleton/AttributesSingleton.d.ts +5 -1
- package/lib/typescript/sdk/AttributesSingleton/AttributesSingleton.d.ts.map +1 -1
- package/lib/typescript/sdk/DatadogProvider/DatadogProvider.d.ts +4 -3
- package/lib/typescript/sdk/DatadogProvider/DatadogProvider.d.ts.map +1 -1
- package/lib/typescript/sdk/DatadogProvider/DatadogProviderState.d.ts +9 -0
- package/lib/typescript/sdk/DatadogProvider/DatadogProviderState.d.ts.map +1 -0
- package/lib/typescript/sdk/DdSdk.d.ts +2 -3
- package/lib/typescript/sdk/DdSdk.d.ts.map +1 -1
- package/lib/typescript/sdk/DdSdkInternal.d.ts +39 -0
- package/lib/typescript/sdk/DdSdkInternal.d.ts.map +1 -0
- package/lib/typescript/sdk/EventMappers/EventMapper.d.ts +3 -1
- package/lib/typescript/sdk/EventMappers/EventMapper.d.ts.map +1 -1
- package/lib/typescript/sdk/GlobalState/GlobalState.d.ts +3 -3
- package/lib/typescript/sdk/GlobalState/GlobalState.d.ts.map +1 -1
- package/lib/typescript/sdk/UserInfoSingleton/UserInfoSingleton.d.ts +2 -1
- package/lib/typescript/sdk/UserInfoSingleton/UserInfoSingleton.d.ts.map +1 -1
- package/lib/typescript/sdk/UserInfoSingleton/types.d.ts +1 -2
- package/lib/typescript/sdk/UserInfoSingleton/types.d.ts.map +1 -1
- package/lib/typescript/specs/NativeDdRum.d.ts +45 -0
- package/lib/typescript/specs/NativeDdRum.d.ts.map +1 -1
- package/lib/typescript/specs/NativeDdSdk.d.ts +34 -6
- package/lib/typescript/specs/NativeDdSdk.d.ts.map +1 -1
- package/lib/typescript/trace/DdTrace.d.ts +1 -2
- package/lib/typescript/trace/DdTrace.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +74 -92
- package/lib/typescript/types.d.ts.map +1 -1
- package/lib/typescript/utils/longTasksUtils.d.ts +1 -1
- package/lib/typescript/utils/longTasksUtils.d.ts.map +1 -1
- package/lib/typescript/utils/singletonUtils.d.ts +2 -0
- package/lib/typescript/utils/singletonUtils.d.ts.map +1 -0
- package/lib/typescript/version.d.ts +1 -1
- package/lib/typescript/version.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/DdSdkReactNative.tsx +246 -104
- package/src/InternalLog.tsx +1 -1
- package/src/__tests__/DdSdkReactNative.test.tsx +415 -207
- package/src/__tests__/DdSdkReactNativeConfiguration.test.ts +237 -153
- package/src/__tests__/InternalLog.test.tsx +1 -1
- package/src/__tests__/rum/instrumentation/DdEventsInterceptor.test.tsx +2 -2
- package/src/__tests__/rum/instrumentation/DdRumErrorTracking.test.tsx +139 -216
- package/src/__tests__/rum/instrumentation/DdRumUserInteractionTracking.test.tsx +10 -7
- package/src/config/DatadogProviderConfiguration.ts +17 -0
- package/src/config/FileBasedConfiguration.ts +464 -0
- package/src/config/FileBasedConfiguration.type.ts +66 -0
- package/src/config/__tests__/FileBasedConfiguration.test.ts +334 -0
- package/src/config/__tests__/__fixtures__/configuration-all-fields.json +57 -0
- package/src/config/__tests__/__fixtures__/malformed-configuration.json +4 -0
- package/src/config/async/AutoInstrumentationConfiguration.ts +126 -0
- package/src/config/async/PartialInitializationConfiguration.ts +58 -0
- package/src/config/async/asyncInitializationHelper.tsx +51 -0
- package/src/config/features/CoreConfiguration.ts +130 -0
- package/src/config/features/CoreConfiguration.type.ts +119 -0
- package/src/config/features/CoreConfigurationNative.ts +50 -0
- package/src/config/features/LogsConfiguration.ts +38 -0
- package/src/config/features/LogsConfiguration.type.ts +33 -0
- package/src/config/features/LogsConfigurationNative.ts +10 -0
- package/src/config/features/RumConfiguration.ts +137 -0
- package/src/config/features/RumConfiguration.type.ts +164 -0
- package/src/config/features/RumConfigurationNative.ts +26 -0
- package/src/config/features/TraceConfiguration.ts +24 -0
- package/src/config/features/TraceConfiguration.type.ts +17 -0
- package/src/config/features/TraceConfigurationNative.ts +8 -0
- package/src/config/types/BatchProcessingLevel.ts +23 -0
- package/src/config/types/BatchSize.ts +24 -0
- package/src/config/types/InitializationMode.ts +9 -0
- package/src/config/types/InitializationModeForTelemetry.ts +11 -0
- package/src/{ProxyConfiguration.tsx → config/types/ProxyConfiguration.ts} +6 -0
- package/src/config/types/UploadFrequency.tsx +23 -0
- package/src/config/types/VitalsUpdateFrequency.ts +11 -0
- package/src/config/types/index.ts +15 -0
- package/src/index.tsx +33 -16
- package/src/logs/DdLogs.ts +14 -13
- package/src/logs/__tests__/DdLogs.test.ts +60 -107
- package/src/logs/__tests__/eventMapper.test.ts +1 -1
- package/src/logs/eventMapper.ts +5 -4
- package/src/logs/types.ts +1 -20
- package/src/metro/plugin/metroSerializer.ts +3 -3
- package/src/nativeModulesTypes.ts +2 -17
- package/src/rum/DdRum.ts +139 -42
- package/src/rum/__tests__/DdRum.test.ts +217 -47
- package/src/rum/eventMappers/errorEventMapper.ts +1 -1
- package/src/rum/helper.ts +62 -0
- package/src/rum/instrumentation/DdRumErrorTracking.tsx +20 -38
- package/src/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.ts +21 -35
- package/src/rum/instrumentation/interactionTracking/DdEventsInterceptor.tsx +1 -1
- package/src/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.tsx +18 -5
- package/src/rum/instrumentation/resourceTracking/DdRumResourceTracking.tsx +44 -23
- package/src/rum/instrumentation/resourceTracking/__tests__/DdRumResourceTracking.test.ts +2 -2
- package/src/rum/instrumentation/resourceTracking/__tests__/__utils__/XMLHttpRequestMock.ts +44 -23
- package/src/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.ts +24 -1
- package/src/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.tsx +17 -2
- package/src/rum/instrumentation/resourceTracking/distributedTracing/__tests__/distributedTracing.test.ts +327 -1
- package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.tsx +22 -31
- package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.ts +29 -0
- package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.ts +54 -35
- package/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.ts +80 -0
- package/src/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.ts +1 -1
- package/src/rum/instrumentation/resourceTracking/distributedTracing/headers.ts +29 -0
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.ts +1 -1
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.ts +19 -7
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/__tests__/XHRProxy.test.ts +177 -119
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/__tests__/baggageHeaderUtils.test.ts +85 -13
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.ts +110 -52
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.ts +1 -1
- package/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.ts +1 -1
- package/src/rum/types.ts +68 -8
- package/src/sdk/AccountInfoSingleton/AccountInfoSingleton.ts +49 -0
- package/src/sdk/AccountInfoSingleton/__tests__/AccountInfoSingleton.test.ts +90 -0
- package/src/sdk/AccountInfoSingleton/types.ts +11 -0
- package/src/sdk/AttributesEncoding/__tests__/attributesEncoding.test.ts +518 -0
- package/src/sdk/AttributesEncoding/__tests__/defaultEncoders.test.ts +198 -0
- package/src/sdk/AttributesEncoding/attributesEncoding.ts +56 -0
- package/src/sdk/AttributesEncoding/defaultEncoders.ts +175 -0
- package/src/{utils → sdk/AttributesEncoding}/errorUtils.ts +50 -22
- package/src/sdk/AttributesEncoding/helpers.ts +176 -0
- package/src/sdk/AttributesEncoding/types.ts +33 -0
- package/src/sdk/AttributesEncoding/utils.ts +31 -0
- package/src/sdk/AttributesSingleton/AttributesSingleton.ts +25 -1
- package/src/sdk/AttributesSingleton/__tests__/AttributesSingleton.test.ts +52 -8
- package/src/sdk/DatadogInternalBridge/DdSdkInternalNativeBridge.tsx +2 -2
- package/src/sdk/DatadogInternalBridge/DdSdkInternalNativeBridgeEvent.tsx +1 -1
- package/src/sdk/DatadogInternalBridge/__tests__/DdSdkNativeBridge.test.tsx +1 -1
- package/src/sdk/DatadogProvider/Buffer/BoundedBuffer.ts +4 -4
- package/src/sdk/DatadogProvider/Buffer/__tests__/BoundedBuffer.test.ts +5 -5
- package/src/sdk/DatadogProvider/DatadogProvider.tsx +12 -16
- package/src/sdk/DatadogProvider/DatadogProviderState.ts +30 -0
- package/src/sdk/DatadogProvider/__tests__/__utils__/renderWithProvider.tsx +18 -7
- package/src/sdk/DatadogProvider/__tests__/initialization.test.tsx +59 -33
- package/src/sdk/DatadogProvider/__tests__/initializationModes.test.tsx +26 -10
- package/src/sdk/DdSdk.ts +8 -5
- package/src/sdk/DdSdkInternal.ts +121 -0
- package/src/sdk/EventMappers/EventMapper.ts +9 -4
- package/src/sdk/EventMappers/__tests__/EventMapper.test.ts +3 -3
- package/src/sdk/GlobalState/GlobalState.tsx +10 -11
- package/src/sdk/UserInfoSingleton/UserInfoSingleton.ts +9 -2
- package/src/sdk/UserInfoSingleton/__tests__/UserInfoSingleton.test.ts +46 -9
- package/src/sdk/UserInfoSingleton/types.ts +1 -4
- package/src/specs/NativeDdRum.ts +65 -0
- package/src/specs/NativeDdSdk.ts +40 -6
- package/src/trace/DdTrace.ts +11 -7
- package/src/trace/__tests__/DdTrace.test.ts +7 -8
- package/src/types.tsx +97 -76
- package/src/utils/__tests__/errorUtils.test.ts +1 -1
- package/src/utils/__tests__/singletonUtils.test.ts +75 -0
- package/src/utils/longTasksUtils.ts +1 -3
- package/src/utils/singletonUtils.ts +17 -0
- package/src/version.ts +1 -1
- package/lib/commonjs/DdSdkReactNativeConfiguration.js +0 -412
- package/lib/commonjs/DdSdkReactNativeConfiguration.js.map +0 -1
- package/lib/commonjs/ProxyConfiguration.js.map +0 -1
- package/lib/commonjs/SdkVerbosity.js.map +0 -1
- package/lib/commonjs/TrackingConsent.js.map +0 -1
- package/lib/commonjs/rum/DdAttributes.js.map +0 -1
- package/lib/commonjs/sdk/FileBasedConfiguration/FileBasedConfiguration.js +0 -185
- package/lib/commonjs/sdk/FileBasedConfiguration/FileBasedConfiguration.js.map +0 -1
- package/lib/commonjs/utils/argsUtils.js +0 -41
- package/lib/commonjs/utils/argsUtils.js.map +0 -1
- package/lib/commonjs/utils/errorUtils.js.map +0 -1
- package/lib/module/DdSdkReactNativeConfiguration.js +0 -403
- package/lib/module/DdSdkReactNativeConfiguration.js.map +0 -1
- package/lib/module/ProxyConfiguration.js.map +0 -1
- package/lib/module/SdkVerbosity.js.map +0 -1
- package/lib/module/TrackingConsent.js.map +0 -1
- package/lib/module/rum/DdAttributes.js.map +0 -1
- package/lib/module/sdk/FileBasedConfiguration/FileBasedConfiguration.js +0 -176
- package/lib/module/sdk/FileBasedConfiguration/FileBasedConfiguration.js.map +0 -1
- package/lib/module/utils/argsUtils.js +0 -35
- package/lib/module/utils/argsUtils.js.map +0 -1
- package/lib/module/utils/errorUtils.js.map +0 -1
- package/lib/typescript/DdSdkReactNativeConfiguration.d.ts +0 -376
- package/lib/typescript/DdSdkReactNativeConfiguration.d.ts.map +0 -1
- package/lib/typescript/ProxyConfiguration.d.ts.map +0 -1
- package/lib/typescript/SdkVerbosity.d.ts.map +0 -1
- package/lib/typescript/TrackingConsent.d.ts.map +0 -1
- package/lib/typescript/rum/DdAttributes.d.ts.map +0 -1
- package/lib/typescript/sdk/FileBasedConfiguration/FileBasedConfiguration.d.ts +0 -34
- package/lib/typescript/sdk/FileBasedConfiguration/FileBasedConfiguration.d.ts.map +0 -1
- package/lib/typescript/utils/argsUtils.d.ts +0 -8
- package/lib/typescript/utils/argsUtils.d.ts.map +0 -1
- package/lib/typescript/utils/errorUtils.d.ts.map +0 -1
- package/src/DdSdkReactNativeConfiguration.tsx +0 -582
- package/src/sdk/FileBasedConfiguration/FileBasedConfiguration.ts +0 -241
- package/src/sdk/FileBasedConfiguration/__tests__/FileBasedConfiguration.test.ts +0 -255
- package/src/sdk/FileBasedConfiguration/__tests__/__fixtures__/configuration-all-fields.json +0 -27
- package/src/sdk/FileBasedConfiguration/__tests__/__fixtures__/malformed-configuration.json +0 -5
- package/src/utils/__tests__/argsUtils.test.ts +0 -66
- package/src/utils/argsUtils.ts +0 -41
- /package/lib/commonjs/{rum/DdAttributes.js → DdAttributes.js} +0 -0
- /package/lib/commonjs/{SdkVerbosity.js → config/types/SdkVerbosity.js} +0 -0
- /package/lib/commonjs/{TrackingConsent.js → config/types/TrackingConsent.js} +0 -0
- /package/lib/module/{rum/DdAttributes.js → DdAttributes.js} +0 -0
- /package/lib/module/{SdkVerbosity.js → config/types/SdkVerbosity.js} +0 -0
- /package/lib/module/{TrackingConsent.js → config/types/TrackingConsent.js} +0 -0
- /package/lib/typescript/{rum/DdAttributes.d.ts → DdAttributes.d.ts} +0 -0
- /package/lib/typescript/{ProxyConfiguration.d.ts → config/types/ProxyConfiguration.d.ts} +0 -0
- /package/lib/typescript/{SdkVerbosity.d.ts → config/types/SdkVerbosity.d.ts} +0 -0
- /package/lib/typescript/{TrackingConsent.d.ts → config/types/TrackingConsent.d.ts} +0 -0
- /package/src/{rum/DdAttributes.ts → DdAttributes.ts} +0 -0
- /package/src/{SdkVerbosity.tsx → config/types/SdkVerbosity.ts} +0 -0
- /package/src/{TrackingConsent.tsx → config/types/TrackingConsent.ts} +0 -0
|
@@ -6,14 +6,16 @@
|
|
|
6
6
|
|
|
7
7
|
import { NativeModules } from 'react-native';
|
|
8
8
|
|
|
9
|
-
import { DdSdkReactNativeConfiguration } from '../../DdSdkReactNativeConfiguration';
|
|
10
9
|
import { DdSdkReactNative } from '../../DdSdkReactNative';
|
|
11
10
|
import { InternalLog } from '../../InternalLog';
|
|
12
|
-
import {
|
|
11
|
+
import { CoreConfiguration } from '../../config/features/CoreConfiguration';
|
|
12
|
+
import { LogsConfiguration } from '../../config/features/LogsConfiguration';
|
|
13
|
+
import { RumConfiguration } from '../../config/features/RumConfiguration';
|
|
14
|
+
import { SdkVerbosity } from '../../config/types';
|
|
13
15
|
import type { DdNativeLogsType } from '../../nativeModulesTypes';
|
|
14
|
-
import { ErrorSource } from '../../
|
|
16
|
+
import { ErrorSource } from '../../types';
|
|
17
|
+
import type { LogEventMapper, LogEvent } from '../../types';
|
|
15
18
|
import { DdLogs } from '../DdLogs';
|
|
16
|
-
import type { LogEventMapper } from '../types';
|
|
17
19
|
|
|
18
20
|
jest.mock('../../InternalLog', () => {
|
|
19
21
|
return {
|
|
@@ -38,7 +40,7 @@ describe('DdLogs', () => {
|
|
|
38
40
|
context: { newContext: 'context' },
|
|
39
41
|
status: 'info',
|
|
40
42
|
userInfo: {}
|
|
41
|
-
};
|
|
43
|
+
} as LogEvent;
|
|
42
44
|
};
|
|
43
45
|
DdLogs.registerLogEventMapper(logEventMapper);
|
|
44
46
|
|
|
@@ -199,23 +201,27 @@ describe('DdLogs', () => {
|
|
|
199
201
|
const fakeAppId = '1';
|
|
200
202
|
const fakeClientToken = '2';
|
|
201
203
|
const fakeEnvName = 'env';
|
|
202
|
-
const configuration = new
|
|
204
|
+
const configuration = new CoreConfiguration(
|
|
203
205
|
fakeClientToken,
|
|
204
|
-
fakeEnvName
|
|
206
|
+
fakeEnvName
|
|
207
|
+
);
|
|
208
|
+
configuration.rumConfiguration = new RumConfiguration(
|
|
205
209
|
fakeAppId,
|
|
206
210
|
false,
|
|
207
211
|
false,
|
|
208
|
-
true
|
|
212
|
+
true
|
|
209
213
|
);
|
|
210
214
|
|
|
211
215
|
// Register log event mapper to filter console log events
|
|
212
|
-
configuration.
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
+
configuration.logsConfiguration = new LogsConfiguration({
|
|
217
|
+
logEventMapper: logEvent => {
|
|
218
|
+
if (logEvent.source === ErrorSource.CONSOLE) {
|
|
219
|
+
return null;
|
|
220
|
+
}
|
|
216
221
|
|
|
217
|
-
|
|
218
|
-
|
|
222
|
+
return logEvent;
|
|
223
|
+
}
|
|
224
|
+
});
|
|
219
225
|
|
|
220
226
|
NativeModules.DdSdk.initialize.mockResolvedValue(null);
|
|
221
227
|
|
|
@@ -225,7 +231,7 @@ describe('DdLogs', () => {
|
|
|
225
231
|
console.error('console-error-message');
|
|
226
232
|
expect(NativeModules.DdLogs.error).not.toHaveBeenCalled();
|
|
227
233
|
expect(InternalLog.log).toHaveBeenCalledWith(
|
|
228
|
-
'
|
|
234
|
+
'Adding RUM Error “console-error-message”',
|
|
229
235
|
'debug'
|
|
230
236
|
);
|
|
231
237
|
|
|
@@ -261,13 +267,16 @@ describe('DdLogs', () => {
|
|
|
261
267
|
const fakeAppId = '1';
|
|
262
268
|
const fakeClientToken = '2';
|
|
263
269
|
const fakeEnvName = 'env';
|
|
264
|
-
const configuration = new
|
|
270
|
+
const configuration = new CoreConfiguration(
|
|
265
271
|
fakeClientToken,
|
|
266
|
-
fakeEnvName
|
|
272
|
+
fakeEnvName
|
|
273
|
+
);
|
|
274
|
+
|
|
275
|
+
configuration.rumConfiguration = new RumConfiguration(
|
|
267
276
|
fakeAppId,
|
|
268
277
|
false,
|
|
269
278
|
false,
|
|
270
|
-
true
|
|
279
|
+
true
|
|
271
280
|
);
|
|
272
281
|
|
|
273
282
|
NativeModules.DdSdk.initialize.mockResolvedValue(null);
|
|
@@ -278,7 +287,7 @@ describe('DdLogs', () => {
|
|
|
278
287
|
console.error('console-error-message');
|
|
279
288
|
expect(NativeModules.DdLogs.error).not.toHaveBeenCalled();
|
|
280
289
|
expect(InternalLog.log).toHaveBeenCalledWith(
|
|
281
|
-
'
|
|
290
|
+
'Adding RUM Error “console-error-message”',
|
|
282
291
|
'debug'
|
|
283
292
|
);
|
|
284
293
|
});
|
|
@@ -506,7 +515,7 @@ describe('DdLogs', () => {
|
|
|
506
515
|
it('native context is an object with nested property W context is an array', async () => {
|
|
507
516
|
await DdLogs.debug('message', [1, 2, 3]);
|
|
508
517
|
expect(InternalLog.log).toHaveBeenNthCalledWith(
|
|
509
|
-
|
|
518
|
+
2,
|
|
510
519
|
expect.anything(),
|
|
511
520
|
SdkVerbosity.WARN
|
|
512
521
|
);
|
|
@@ -516,12 +525,12 @@ describe('DdLogs', () => {
|
|
|
516
525
|
});
|
|
517
526
|
|
|
518
527
|
it('native context is empty W context is raw type', async () => {
|
|
519
|
-
const obj: any =
|
|
528
|
+
const obj: any = Symbol('invalid-context');
|
|
520
529
|
await DdLogs.debug('message', obj);
|
|
521
530
|
expect(InternalLog.log).toHaveBeenNthCalledWith(
|
|
522
|
-
|
|
531
|
+
2,
|
|
523
532
|
expect.anything(),
|
|
524
|
-
SdkVerbosity.
|
|
533
|
+
SdkVerbosity.WARN
|
|
525
534
|
);
|
|
526
535
|
expect(NativeModules.DdLogs.debug).toHaveBeenCalledWith(
|
|
527
536
|
'message',
|
|
@@ -549,7 +558,7 @@ describe('DdLogs', () => {
|
|
|
549
558
|
it('native context is an object with nested property W context is an array', async () => {
|
|
550
559
|
await DdLogs.warn('message', [1, 2, 3]);
|
|
551
560
|
expect(InternalLog.log).toHaveBeenNthCalledWith(
|
|
552
|
-
|
|
561
|
+
2,
|
|
553
562
|
expect.anything(),
|
|
554
563
|
SdkVerbosity.WARN
|
|
555
564
|
);
|
|
@@ -559,12 +568,12 @@ describe('DdLogs', () => {
|
|
|
559
568
|
});
|
|
560
569
|
|
|
561
570
|
it('native context is empty W context is raw type', async () => {
|
|
562
|
-
const obj: any =
|
|
571
|
+
const obj: any = Symbol('invalid-context');
|
|
563
572
|
await DdLogs.warn('message', obj);
|
|
564
573
|
expect(InternalLog.log).toHaveBeenNthCalledWith(
|
|
565
|
-
|
|
574
|
+
2,
|
|
566
575
|
expect.anything(),
|
|
567
|
-
SdkVerbosity.
|
|
576
|
+
SdkVerbosity.WARN
|
|
568
577
|
);
|
|
569
578
|
expect(NativeModules.DdLogs.warn).toHaveBeenCalledWith(
|
|
570
579
|
'message',
|
|
@@ -592,7 +601,7 @@ describe('DdLogs', () => {
|
|
|
592
601
|
it('native context is an object with nested property W context is an array', async () => {
|
|
593
602
|
await DdLogs.info('message', [1, 2, 3]);
|
|
594
603
|
expect(InternalLog.log).toHaveBeenNthCalledWith(
|
|
595
|
-
|
|
604
|
+
2,
|
|
596
605
|
expect.anything(),
|
|
597
606
|
SdkVerbosity.WARN
|
|
598
607
|
);
|
|
@@ -602,12 +611,12 @@ describe('DdLogs', () => {
|
|
|
602
611
|
});
|
|
603
612
|
|
|
604
613
|
it('native context is empty W context is raw type', async () => {
|
|
605
|
-
const obj: any =
|
|
614
|
+
const obj: any = Symbol('invalid-context');
|
|
606
615
|
await DdLogs.info('message', obj);
|
|
607
616
|
expect(InternalLog.log).toHaveBeenNthCalledWith(
|
|
608
|
-
|
|
617
|
+
2,
|
|
609
618
|
expect.anything(),
|
|
610
|
-
SdkVerbosity.
|
|
619
|
+
SdkVerbosity.WARN
|
|
611
620
|
);
|
|
612
621
|
expect(NativeModules.DdLogs.info).toHaveBeenCalledWith(
|
|
613
622
|
'message',
|
|
@@ -635,7 +644,7 @@ describe('DdLogs', () => {
|
|
|
635
644
|
it('native context is an object with nested property W context is an array', async () => {
|
|
636
645
|
await DdLogs.error('message', [1, 2, 3]);
|
|
637
646
|
expect(InternalLog.log).toHaveBeenNthCalledWith(
|
|
638
|
-
|
|
647
|
+
2,
|
|
639
648
|
expect.anything(),
|
|
640
649
|
SdkVerbosity.WARN
|
|
641
650
|
);
|
|
@@ -645,12 +654,12 @@ describe('DdLogs', () => {
|
|
|
645
654
|
});
|
|
646
655
|
|
|
647
656
|
it('native context is empty W context is raw type', async () => {
|
|
648
|
-
const obj: any =
|
|
657
|
+
const obj: any = Symbol('invalid-context');
|
|
649
658
|
await DdLogs.error('message', obj);
|
|
650
659
|
expect(InternalLog.log).toHaveBeenNthCalledWith(
|
|
651
|
-
|
|
660
|
+
2,
|
|
652
661
|
expect.anything(),
|
|
653
|
-
SdkVerbosity.
|
|
662
|
+
SdkVerbosity.WARN
|
|
654
663
|
);
|
|
655
664
|
expect(NativeModules.DdLogs.error).toHaveBeenCalledWith(
|
|
656
665
|
'message',
|
|
@@ -700,17 +709,9 @@ describe('DdLogs', () => {
|
|
|
700
709
|
3
|
|
701
710
|
]);
|
|
702
711
|
|
|
703
|
-
expect(InternalLog.log).toHaveBeenNthCalledWith(
|
|
704
|
-
1,
|
|
705
|
-
expect.stringContaining('Tracking debug log'),
|
|
706
|
-
SdkVerbosity.DEBUG
|
|
707
|
-
);
|
|
708
|
-
|
|
709
712
|
expect(InternalLog.log).toHaveBeenNthCalledWith(
|
|
710
713
|
2,
|
|
711
|
-
expect.
|
|
712
|
-
'The given context is an array, it will be nested'
|
|
713
|
-
),
|
|
714
|
+
expect.anything(),
|
|
714
715
|
SdkVerbosity.WARN
|
|
715
716
|
);
|
|
716
717
|
|
|
@@ -729,7 +730,7 @@ describe('DdLogs', () => {
|
|
|
729
730
|
});
|
|
730
731
|
|
|
731
732
|
it('native context is empty W context is raw type', async () => {
|
|
732
|
-
const obj: any =
|
|
733
|
+
const obj: any = Symbol('invalid-context');
|
|
733
734
|
await DdLogs.debug(
|
|
734
735
|
'message',
|
|
735
736
|
'kind',
|
|
@@ -738,16 +739,10 @@ describe('DdLogs', () => {
|
|
|
738
739
|
obj
|
|
739
740
|
);
|
|
740
741
|
|
|
741
|
-
expect(InternalLog.log).toHaveBeenNthCalledWith(
|
|
742
|
-
1,
|
|
743
|
-
expect.stringContaining('Tracking debug log'),
|
|
744
|
-
SdkVerbosity.DEBUG
|
|
745
|
-
);
|
|
746
|
-
|
|
747
742
|
expect(InternalLog.log).toHaveBeenNthCalledWith(
|
|
748
743
|
2,
|
|
749
|
-
expect.
|
|
750
|
-
SdkVerbosity.
|
|
744
|
+
expect.anything(),
|
|
745
|
+
SdkVerbosity.WARN
|
|
751
746
|
);
|
|
752
747
|
|
|
753
748
|
expect(
|
|
@@ -804,17 +799,9 @@ describe('DdLogs', () => {
|
|
|
804
799
|
3
|
|
805
800
|
]);
|
|
806
801
|
|
|
807
|
-
expect(InternalLog.log).toHaveBeenNthCalledWith(
|
|
808
|
-
1,
|
|
809
|
-
expect.stringContaining('Tracking warn log'),
|
|
810
|
-
SdkVerbosity.DEBUG
|
|
811
|
-
);
|
|
812
|
-
|
|
813
802
|
expect(InternalLog.log).toHaveBeenNthCalledWith(
|
|
814
803
|
2,
|
|
815
|
-
expect.
|
|
816
|
-
'The given context is an array, it will be nested'
|
|
817
|
-
),
|
|
804
|
+
expect.anything(),
|
|
818
805
|
SdkVerbosity.WARN
|
|
819
806
|
);
|
|
820
807
|
|
|
@@ -831,7 +818,7 @@ describe('DdLogs', () => {
|
|
|
831
818
|
});
|
|
832
819
|
|
|
833
820
|
it('native context is empty W context is raw type', async () => {
|
|
834
|
-
const obj: any =
|
|
821
|
+
const obj: any = Symbol('invalid-context');
|
|
835
822
|
await DdLogs.warn(
|
|
836
823
|
'message',
|
|
837
824
|
'kind',
|
|
@@ -840,16 +827,10 @@ describe('DdLogs', () => {
|
|
|
840
827
|
obj
|
|
841
828
|
);
|
|
842
829
|
|
|
843
|
-
expect(InternalLog.log).toHaveBeenNthCalledWith(
|
|
844
|
-
1,
|
|
845
|
-
expect.stringContaining('Tracking warn log'),
|
|
846
|
-
SdkVerbosity.DEBUG
|
|
847
|
-
);
|
|
848
|
-
|
|
849
830
|
expect(InternalLog.log).toHaveBeenNthCalledWith(
|
|
850
831
|
2,
|
|
851
|
-
expect.
|
|
852
|
-
SdkVerbosity.
|
|
832
|
+
expect.anything(),
|
|
833
|
+
SdkVerbosity.WARN
|
|
853
834
|
);
|
|
854
835
|
|
|
855
836
|
expect(
|
|
@@ -906,17 +887,9 @@ describe('DdLogs', () => {
|
|
|
906
887
|
3
|
|
907
888
|
]);
|
|
908
889
|
|
|
909
|
-
expect(InternalLog.log).toHaveBeenNthCalledWith(
|
|
910
|
-
1,
|
|
911
|
-
expect.stringContaining('Tracking info log'),
|
|
912
|
-
SdkVerbosity.DEBUG
|
|
913
|
-
);
|
|
914
|
-
|
|
915
890
|
expect(InternalLog.log).toHaveBeenNthCalledWith(
|
|
916
891
|
2,
|
|
917
|
-
expect.
|
|
918
|
-
'The given context is an array, it will be nested'
|
|
919
|
-
),
|
|
892
|
+
expect.anything(),
|
|
920
893
|
SdkVerbosity.WARN
|
|
921
894
|
);
|
|
922
895
|
|
|
@@ -933,7 +906,7 @@ describe('DdLogs', () => {
|
|
|
933
906
|
});
|
|
934
907
|
|
|
935
908
|
it('native context is empty W context is raw type', async () => {
|
|
936
|
-
const obj: any =
|
|
909
|
+
const obj: any = Symbol('invalid-context');
|
|
937
910
|
await DdLogs.info(
|
|
938
911
|
'message',
|
|
939
912
|
'kind',
|
|
@@ -942,16 +915,10 @@ describe('DdLogs', () => {
|
|
|
942
915
|
obj
|
|
943
916
|
);
|
|
944
917
|
|
|
945
|
-
expect(InternalLog.log).toHaveBeenNthCalledWith(
|
|
946
|
-
1,
|
|
947
|
-
expect.stringContaining('Tracking info log'),
|
|
948
|
-
SdkVerbosity.DEBUG
|
|
949
|
-
);
|
|
950
|
-
|
|
951
918
|
expect(InternalLog.log).toHaveBeenNthCalledWith(
|
|
952
919
|
2,
|
|
953
|
-
expect.
|
|
954
|
-
SdkVerbosity.
|
|
920
|
+
expect.anything(),
|
|
921
|
+
SdkVerbosity.WARN
|
|
955
922
|
);
|
|
956
923
|
|
|
957
924
|
expect(
|
|
@@ -1008,17 +975,9 @@ describe('DdLogs', () => {
|
|
|
1008
975
|
3
|
|
1009
976
|
]);
|
|
1010
977
|
|
|
1011
|
-
expect(InternalLog.log).toHaveBeenNthCalledWith(
|
|
1012
|
-
1,
|
|
1013
|
-
expect.stringContaining('Tracking error log'),
|
|
1014
|
-
SdkVerbosity.DEBUG
|
|
1015
|
-
);
|
|
1016
|
-
|
|
1017
978
|
expect(InternalLog.log).toHaveBeenNthCalledWith(
|
|
1018
979
|
2,
|
|
1019
|
-
expect.
|
|
1020
|
-
'The given context is an array, it will be nested'
|
|
1021
|
-
),
|
|
980
|
+
expect.anything(),
|
|
1022
981
|
SdkVerbosity.WARN
|
|
1023
982
|
);
|
|
1024
983
|
|
|
@@ -1037,7 +996,7 @@ describe('DdLogs', () => {
|
|
|
1037
996
|
});
|
|
1038
997
|
|
|
1039
998
|
it('native context is empty W context is raw type', async () => {
|
|
1040
|
-
const obj: any =
|
|
999
|
+
const obj: any = Symbol('invalid-context');
|
|
1041
1000
|
await DdLogs.error(
|
|
1042
1001
|
'message',
|
|
1043
1002
|
'kind',
|
|
@@ -1046,16 +1005,10 @@ describe('DdLogs', () => {
|
|
|
1046
1005
|
obj
|
|
1047
1006
|
);
|
|
1048
1007
|
|
|
1049
|
-
expect(InternalLog.log).toHaveBeenNthCalledWith(
|
|
1050
|
-
1,
|
|
1051
|
-
expect.stringContaining('Tracking error log'),
|
|
1052
|
-
SdkVerbosity.DEBUG
|
|
1053
|
-
);
|
|
1054
|
-
|
|
1055
1008
|
expect(InternalLog.log).toHaveBeenNthCalledWith(
|
|
1056
1009
|
2,
|
|
1057
|
-
expect.
|
|
1058
|
-
SdkVerbosity.
|
|
1010
|
+
expect.anything(),
|
|
1011
|
+
SdkVerbosity.WARN
|
|
1059
1012
|
);
|
|
1060
1013
|
|
|
1061
1014
|
expect(
|
package/src/logs/eventMapper.ts
CHANGED
|
@@ -7,10 +7,9 @@
|
|
|
7
7
|
import type { Attributes } from '../sdk/AttributesSingleton/types';
|
|
8
8
|
import { EventMapper } from '../sdk/EventMappers/EventMapper';
|
|
9
9
|
import type { UserInfo } from '../sdk/UserInfoSingleton/types';
|
|
10
|
+
import type { LogEvent, LogEventMapper } from '../types';
|
|
10
11
|
|
|
11
12
|
import type {
|
|
12
|
-
LogEvent,
|
|
13
|
-
LogEventMapper,
|
|
14
13
|
NativeLog,
|
|
15
14
|
NativeLogWithError,
|
|
16
15
|
RawLog,
|
|
@@ -32,13 +31,15 @@ export const formatRawLogToNativeEvent = (
|
|
|
32
31
|
export const formatRawLogToLogEvent = (
|
|
33
32
|
rawLog: RawLog | RawLogWithError,
|
|
34
33
|
additionalInformation: {
|
|
35
|
-
userInfo
|
|
34
|
+
userInfo?: UserInfo;
|
|
36
35
|
attributes: Attributes;
|
|
37
36
|
}
|
|
38
37
|
): LogEvent => {
|
|
38
|
+
const userInfo = additionalInformation?.userInfo;
|
|
39
|
+
|
|
39
40
|
return {
|
|
40
41
|
...rawLog,
|
|
41
|
-
userInfo:
|
|
42
|
+
...(userInfo !== undefined ? { userInfo } : {}),
|
|
42
43
|
attributes: additionalInformation.attributes
|
|
43
44
|
};
|
|
44
45
|
};
|
package/src/logs/types.ts
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
* Copyright 2016-Present Datadog, Inc.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import type { ErrorSource } from '../
|
|
8
|
-
import type { UserInfo } from '../sdk/UserInfoSingleton/types';
|
|
7
|
+
import type { LogStatus, ErrorSource } from '../types';
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* The entry point to use Datadog's Logs feature.
|
|
@@ -75,24 +74,6 @@ export type NativeLogWithError = {
|
|
|
75
74
|
fingerprint?: string;
|
|
76
75
|
};
|
|
77
76
|
|
|
78
|
-
export type LogStatus = 'debug' | 'info' | 'warn' | 'error';
|
|
79
|
-
|
|
80
|
-
export type LogEvent = {
|
|
81
|
-
message: string;
|
|
82
|
-
context: object;
|
|
83
|
-
errorKind?: string;
|
|
84
|
-
errorMessage?: string;
|
|
85
|
-
stacktrace?: string;
|
|
86
|
-
fingerprint?: string;
|
|
87
|
-
readonly source?: ErrorSource;
|
|
88
|
-
// readonly date: number; // TODO: RUMM-2446 & RUMM-2447
|
|
89
|
-
readonly status: LogStatus;
|
|
90
|
-
readonly userInfo: UserInfo;
|
|
91
|
-
readonly attributes?: object;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
export type LogEventMapper = (logEvent: LogEvent) => LogEvent | null;
|
|
95
|
-
|
|
96
77
|
export type LogArguments = [message: string, context?: object];
|
|
97
78
|
|
|
98
79
|
export type LogWithErrorArguments = [
|
|
@@ -46,7 +46,7 @@ export const createDatadogMetroSerializer = (
|
|
|
46
46
|
const serializer = customSerializer || createDefaultMetroSerializer();
|
|
47
47
|
return async (entryPoint, preModules, graph, options) => {
|
|
48
48
|
// Skip for hot reload mode
|
|
49
|
-
if (graph.transformOptions.hot) {
|
|
49
|
+
if ((graph.transformOptions as any).hot) {
|
|
50
50
|
return serializer(entryPoint, preModules, graph, options);
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -109,7 +109,7 @@ export const createDefaultMetroSerializer = (): MetroSerializer => {
|
|
|
109
109
|
// Modify the bundle through the datadogBundleCallback, if we are not in hot-reload mode
|
|
110
110
|
if (
|
|
111
111
|
(options as any).datadogBundleCallback &&
|
|
112
|
-
!graph.transformOptions.hot
|
|
112
|
+
!(graph.transformOptions as any).hot
|
|
113
113
|
) {
|
|
114
114
|
bundle = (options as any).datadogBundleCallback(bundle);
|
|
115
115
|
}
|
|
@@ -119,7 +119,7 @@ export const createDefaultMetroSerializer = (): MetroSerializer => {
|
|
|
119
119
|
const { code } = bundleToString(bundle);
|
|
120
120
|
|
|
121
121
|
// If we are in hot-reload mode, we skip sourcemaps generation, and only return the code.
|
|
122
|
-
if (graph.transformOptions.hot) {
|
|
122
|
+
if ((graph.transformOptions as any).hot) {
|
|
123
123
|
return code;
|
|
124
124
|
}
|
|
125
125
|
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Copyright 2016-Present Datadog, Inc.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import type { DdSdkNativeConfiguration } from './config/features/CoreConfigurationNative';
|
|
7
8
|
import type { Spec as NativeDdLogs } from './specs/NativeDdLogs';
|
|
8
9
|
import type { Spec as NativeDdRum } from './specs/NativeDdRum';
|
|
9
10
|
import type { Spec as NativeDdSdk } from './specs/NativeDdSdk';
|
|
@@ -24,22 +25,6 @@ export type DdNativeLogsType = NativeDdLogs;
|
|
|
24
25
|
*/
|
|
25
26
|
export type DdNativeTraceType = NativeDdTrace;
|
|
26
27
|
|
|
27
|
-
/**
|
|
28
|
-
* A configuration object to initialize Datadog's features.
|
|
29
|
-
*/
|
|
30
|
-
export class DdNativeSdkConfiguration {
|
|
31
|
-
constructor(
|
|
32
|
-
readonly clientToken: string,
|
|
33
|
-
readonly env: string,
|
|
34
|
-
readonly applicationId: string,
|
|
35
|
-
readonly nativeCrashReportEnabled: boolean,
|
|
36
|
-
readonly sampleRate: number,
|
|
37
|
-
readonly site: string,
|
|
38
|
-
readonly trackingConsent: string,
|
|
39
|
-
readonly additionalConfiguration: object // eslint-disable-next-line no-empty-function
|
|
40
|
-
) {}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
28
|
/**
|
|
44
29
|
* The entry point to initialize Datadog's features.
|
|
45
30
|
*/
|
|
@@ -48,7 +33,7 @@ export interface DdNativeSdkType extends NativeDdSdk {
|
|
|
48
33
|
* Initializes Datadog's features.
|
|
49
34
|
* @param configuration: The configuration to use.
|
|
50
35
|
*/
|
|
51
|
-
initialize(configuration:
|
|
36
|
+
initialize(configuration: DdSdkNativeConfiguration): Promise<void>;
|
|
52
37
|
}
|
|
53
38
|
|
|
54
39
|
type ActionType = 'TAP' | 'SCROLL' | 'SWIPE' | 'BACK' | 'CUSTOM';
|