@datadog/mobile-react-native 2.4.0 → 2.4.2
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 +7 -7
- package/android/build.gradle +1 -0
- package/android/src/main/kotlin/com/datadog/reactnative/DdRumImplementation.kt +6 -0
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkImplementation.kt +31 -24
- package/android/src/main/kotlin/com/datadog/reactnative/FrameRateProvider.kt +63 -0
- package/android/src/main/kotlin/com/datadog/reactnative/SdkVersion.kt +1 -1
- package/android/src/main/kotlin/com/datadog/reactnative/UiThreadExecutor.kt +25 -0
- package/android/src/newarch/kotlin/com/datadog/reactnative/DdRum.kt +10 -1
- package/android/src/oldarch/kotlin/com/datadog/reactnative/DdRum.kt +10 -1
- package/android/src/test/kotlin/com/datadog/reactnative/DdRumTest.kt +29 -0
- package/android/src/test/kotlin/com/datadog/reactnative/DdSdkTest.kt +34 -14
- package/android/src/test/kotlin/com/datadog/tools/unit/TestUiThreadExecutor.kt +16 -0
- package/datadog-sourcemaps.gradle +3 -5
- package/ios/Sources/DdRum.mm +4 -3
- package/ios/Sources/DdRumImplementation.swift +15 -2
- package/ios/Sources/SdkVersion.swift +1 -1
- package/lib/commonjs/DdSdkReactNative.js +105 -150
- package/lib/commonjs/DdSdkReactNative.js.map +1 -1
- package/lib/commonjs/DdSdkReactNativeConfiguration.js +54 -119
- package/lib/commonjs/DdSdkReactNativeConfiguration.js.map +1 -1
- package/lib/commonjs/InternalLog.js +8 -19
- package/lib/commonjs/InternalLog.js.map +1 -1
- package/lib/commonjs/ProxyConfiguration.js +3 -15
- package/lib/commonjs/ProxyConfiguration.js.map +1 -1
- package/lib/commonjs/SdkVerbosity.js +3 -7
- package/lib/commonjs/SdkVerbosity.js.map +1 -1
- package/lib/commonjs/TrackingConsent.js +3 -7
- package/lib/commonjs/TrackingConsent.js.map +1 -1
- package/lib/commonjs/index.js +51 -65
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/logs/DdLogs.js +103 -123
- package/lib/commonjs/logs/DdLogs.js.map +1 -1
- package/lib/commonjs/logs/eventMapper.js +4 -11
- package/lib/commonjs/logs/eventMapper.js.map +1 -1
- package/lib/commonjs/logs/types.js +4 -0
- package/lib/commonjs/logs/types.js.map +1 -1
- package/lib/commonjs/nativeModulesTypes.js +4 -3
- package/lib/commonjs/nativeModulesTypes.js.map +1 -1
- package/lib/commonjs/polyfills.js +28 -0
- package/lib/commonjs/polyfills.js.map +1 -0
- package/lib/commonjs/rum/DdAttributes.js +26 -0
- package/lib/commonjs/rum/DdAttributes.js.map +1 -0
- package/lib/commonjs/rum/DdRum.js +145 -210
- package/lib/commonjs/rum/DdRum.js.map +1 -1
- package/lib/commonjs/rum/eventMappers/actionEventMapper.js +5 -8
- package/lib/commonjs/rum/eventMappers/actionEventMapper.js.map +1 -1
- package/lib/commonjs/rum/eventMappers/errorEventMapper.js +3 -7
- package/lib/commonjs/rum/eventMappers/errorEventMapper.js.map +1 -1
- package/lib/commonjs/rum/eventMappers/resourceEventMapper.js +5 -8
- package/lib/commonjs/rum/eventMappers/resourceEventMapper.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js +68 -89
- package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdEventsInterceptor.js +13 -46
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdEventsInterceptor.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js +52 -66
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/interactionTracking/EventsInterceptor.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/interactionTracking/NoOpEventsInterceptor.js +3 -4
- package/lib/commonjs/rum/instrumentation/interactionTracking/NoOpEventsInterceptor.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/interactionTracking/ShallowObjectEqualityChecker.js +0 -6
- package/lib/commonjs/rum/instrumentation/interactionTracking/ShallowObjectEqualityChecker.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/interactionTracking/getJsxRuntime.js +18 -19
- package/lib/commonjs/rum/instrumentation/interactionTracking/getJsxRuntime.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/DdRumResourceTracking.js +6 -21
- package/lib/commonjs/rum/instrumentation/resourceTracking/DdRumResourceTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js +32 -55
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js +1 -9
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js +15 -41
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js +3 -13
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/graphql/graphqlHeaders.js +5 -10
- package/lib/commonjs/rum/instrumentation/resourceTracking/graphql/graphqlHeaders.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/ResourceReporter.js +16 -35
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/ResourceReporter.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/internalDevResourceBlocklist.js +2 -5
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/internalDevResourceBlocklist.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/resourceTiming.js +4 -7
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/resourceTiming.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.js +4 -10
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js +25 -58
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.js +4 -26
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.js +1 -11
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.js +4 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.js.map +1 -1
- package/lib/commonjs/rum/types.js +15 -27
- package/lib/commonjs/rum/types.js.map +1 -1
- package/lib/commonjs/sdk/AttributesSingleton/AttributesSingleton.js +20 -30
- package/lib/commonjs/sdk/AttributesSingleton/AttributesSingleton.js.map +1 -1
- package/lib/commonjs/sdk/AttributesSingleton/types.js.map +1 -1
- package/lib/commonjs/sdk/DatadogProvider/Buffer/BoundedBuffer.js +112 -144
- package/lib/commonjs/sdk/DatadogProvider/Buffer/BoundedBuffer.js.map +1 -1
- package/lib/commonjs/sdk/DatadogProvider/Buffer/BufferSingleton.js +19 -22
- package/lib/commonjs/sdk/DatadogProvider/Buffer/BufferSingleton.js.map +1 -1
- package/lib/commonjs/sdk/DatadogProvider/Buffer/DatadogBuffer.js +1 -15
- package/lib/commonjs/sdk/DatadogProvider/Buffer/DatadogBuffer.js.map +1 -1
- package/lib/commonjs/sdk/DatadogProvider/Buffer/PassThroughBuffer.js +9 -16
- package/lib/commonjs/sdk/DatadogProvider/Buffer/PassThroughBuffer.js.map +1 -1
- package/lib/commonjs/sdk/DatadogProvider/Buffer/bufferNativeCall.js +2 -8
- package/lib/commonjs/sdk/DatadogProvider/Buffer/bufferNativeCall.js.map +1 -1
- package/lib/commonjs/sdk/DatadogProvider/DatadogProvider.js +8 -25
- package/lib/commonjs/sdk/DatadogProvider/DatadogProvider.js.map +1 -1
- package/lib/commonjs/sdk/DdSdk.js +2 -4
- package/lib/commonjs/sdk/DdSdk.js.map +1 -1
- package/lib/commonjs/sdk/EventMappers/EventMapper.js +31 -51
- package/lib/commonjs/sdk/EventMappers/EventMapper.js.map +1 -1
- package/lib/commonjs/sdk/EventMappers/utils/deepClone.js +9 -24
- package/lib/commonjs/sdk/EventMappers/utils/deepClone.js.map +1 -1
- package/lib/commonjs/sdk/FileBasedConfiguration/FileBasedConfiguration.js +6 -38
- package/lib/commonjs/sdk/FileBasedConfiguration/FileBasedConfiguration.js.map +1 -1
- package/lib/commonjs/sdk/GlobalState/GlobalState.js +33 -0
- package/lib/commonjs/sdk/GlobalState/GlobalState.js.map +1 -0
- package/lib/commonjs/sdk/UserInfoSingleton/UserInfoSingleton.js +17 -28
- package/lib/commonjs/sdk/UserInfoSingleton/UserInfoSingleton.js.map +1 -1
- package/lib/commonjs/sdk/UserInfoSingleton/types.js.map +1 -1
- package/lib/commonjs/specs/NativeDdLogs.js +5 -6
- package/lib/commonjs/specs/NativeDdLogs.js.map +1 -1
- package/lib/commonjs/specs/NativeDdRum.js +5 -6
- package/lib/commonjs/specs/NativeDdRum.js.map +1 -1
- package/lib/commonjs/specs/NativeDdSdk.js +5 -6
- package/lib/commonjs/specs/NativeDdSdk.js.map +1 -1
- package/lib/commonjs/specs/NativeDdTrace.js +5 -6
- package/lib/commonjs/specs/NativeDdTrace.js.map +1 -1
- package/lib/commonjs/trace/DdTrace.js +17 -29
- package/lib/commonjs/trace/DdTrace.js.map +1 -1
- package/lib/commonjs/types.js +4 -3
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/Timer.js +7 -22
- package/lib/commonjs/utils/Timer.js.map +1 -1
- package/lib/commonjs/utils/argsUtils.js +3 -11
- package/lib/commonjs/utils/argsUtils.js.map +1 -1
- package/lib/commonjs/utils/errorUtils.js +9 -22
- package/lib/commonjs/utils/errorUtils.js.map +1 -1
- package/lib/commonjs/utils/jsUtils.js +1 -2
- package/lib/commonjs/utils/jsUtils.js.map +1 -1
- package/lib/commonjs/utils/longTasksUtils.js +2 -7
- package/lib/commonjs/utils/longTasksUtils.js.map +1 -1
- package/lib/commonjs/utils/time-provider/DefaultTimeProvider.js +9 -15
- package/lib/commonjs/utils/time-provider/DefaultTimeProvider.js.map +1 -1
- package/lib/commonjs/utils/time-provider/TimeProvider.js +1 -11
- package/lib/commonjs/utils/time-provider/TimeProvider.js.map +1 -1
- package/lib/commonjs/version.js +1 -2
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/DdSdkReactNative.js +102 -122
- package/lib/module/DdSdkReactNative.js.map +1 -1
- package/lib/module/DdSdkReactNativeConfiguration.js +49 -101
- package/lib/module/DdSdkReactNativeConfiguration.js.map +1 -1
- package/lib/module/InternalLog.js +4 -15
- package/lib/module/InternalLog.js.map +1 -1
- package/lib/module/ProxyConfiguration.js +3 -14
- package/lib/module/ProxyConfiguration.js.map +1 -1
- package/lib/module/SdkVerbosity.js +3 -4
- package/lib/module/SdkVerbosity.js.map +1 -1
- package/lib/module/TrackingConsent.js +3 -4
- package/lib/module/TrackingConsent.js.map +1 -1
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/logs/DdLogs.js +98 -117
- package/lib/module/logs/DdLogs.js.map +1 -1
- package/lib/module/logs/eventMapper.js +3 -1
- package/lib/module/logs/eventMapper.js.map +1 -1
- package/lib/module/logs/types.js +1 -1
- package/lib/module/logs/types.js.map +1 -1
- package/lib/module/nativeModulesTypes.js +5 -1
- package/lib/module/nativeModulesTypes.js.map +1 -1
- package/lib/module/polyfills.js +26 -0
- package/lib/module/polyfills.js.map +1 -0
- package/lib/module/rum/DdAttributes.js +20 -0
- package/lib/module/rum/DdAttributes.js.map +1 -0
- package/lib/module/rum/DdRum.js +140 -187
- package/lib/module/rum/DdRum.js.map +1 -1
- package/lib/module/rum/eventMappers/actionEventMapper.js +5 -5
- package/lib/module/rum/eventMappers/actionEventMapper.js.map +1 -1
- package/lib/module/rum/eventMappers/errorEventMapper.js +3 -4
- package/lib/module/rum/eventMappers/errorEventMapper.js.map +1 -1
- package/lib/module/rum/eventMappers/resourceEventMapper.js +5 -5
- package/lib/module/rum/eventMappers/resourceEventMapper.js.map +1 -1
- package/lib/module/rum/instrumentation/DdRumErrorTracking.js +64 -79
- package/lib/module/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdEventsInterceptor.js +7 -36
- package/lib/module/rum/instrumentation/interactionTracking/DdEventsInterceptor.js.map +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js +49 -54
- package/lib/module/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/EventsInterceptor.js.map +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/NoOpEventsInterceptor.js +3 -2
- package/lib/module/rum/instrumentation/interactionTracking/NoOpEventsInterceptor.js.map +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/ShallowObjectEqualityChecker.js +0 -4
- package/lib/module/rum/instrumentation/interactionTracking/ShallowObjectEqualityChecker.js.map +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/getJsxRuntime.js +16 -14
- package/lib/module/rum/instrumentation/interactionTracking/getJsxRuntime.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/DdRumResourceTracking.js +2 -12
- package/lib/module/rum/instrumentation/resourceTracking/DdRumResourceTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js +33 -45
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js +1 -4
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js +2 -10
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js +3 -5
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/graphql/graphqlHeaders.js +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/graphql/graphqlHeaders.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/ResourceReporter.js +12 -30
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/ResourceReporter.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/internalDevResourceBlocklist.js +2 -3
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/internalDevResourceBlocklist.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/resourceTiming.js +4 -4
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/resourceTiming.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.js +4 -5
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js +20 -48
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.js +2 -20
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.js +1 -9
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.js +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.js.map +1 -1
- package/lib/module/rum/types.js +14 -18
- package/lib/module/rum/types.js.map +1 -1
- package/lib/module/sdk/AttributesSingleton/AttributesSingleton.js +20 -28
- package/lib/module/sdk/AttributesSingleton/AttributesSingleton.js.map +1 -1
- package/lib/module/sdk/AttributesSingleton/types.js.map +1 -1
- package/lib/module/sdk/DatadogProvider/Buffer/BoundedBuffer.js +108 -137
- package/lib/module/sdk/DatadogProvider/Buffer/BoundedBuffer.js.map +1 -1
- package/lib/module/sdk/DatadogProvider/Buffer/BufferSingleton.js +14 -18
- package/lib/module/sdk/DatadogProvider/Buffer/BufferSingleton.js.map +1 -1
- package/lib/module/sdk/DatadogProvider/Buffer/DatadogBuffer.js +1 -13
- package/lib/module/sdk/DatadogProvider/Buffer/DatadogBuffer.js.map +1 -1
- package/lib/module/sdk/DatadogProvider/Buffer/PassThroughBuffer.js +5 -14
- package/lib/module/sdk/DatadogProvider/Buffer/PassThroughBuffer.js.map +1 -1
- package/lib/module/sdk/DatadogProvider/Buffer/bufferNativeCall.js +1 -0
- package/lib/module/sdk/DatadogProvider/Buffer/bufferNativeCall.js.map +1 -1
- package/lib/module/sdk/DatadogProvider/DatadogProvider.js +6 -14
- package/lib/module/sdk/DatadogProvider/DatadogProvider.js.map +1 -1
- package/lib/module/sdk/DdSdk.js +1 -1
- package/lib/module/sdk/DdSdk.js.map +1 -1
- package/lib/module/sdk/EventMappers/EventMapper.js +27 -41
- package/lib/module/sdk/EventMappers/EventMapper.js.map +1 -1
- package/lib/module/sdk/EventMappers/utils/deepClone.js +9 -22
- package/lib/module/sdk/EventMappers/utils/deepClone.js.map +1 -1
- package/lib/module/sdk/FileBasedConfiguration/FileBasedConfiguration.js +5 -29
- package/lib/module/sdk/FileBasedConfiguration/FileBasedConfiguration.js.map +1 -1
- package/lib/module/sdk/GlobalState/GlobalState.js +26 -0
- package/lib/module/sdk/GlobalState/GlobalState.js.map +1 -0
- package/lib/module/sdk/UserInfoSingleton/UserInfoSingleton.js +17 -26
- package/lib/module/sdk/UserInfoSingleton/UserInfoSingleton.js.map +1 -1
- package/lib/module/sdk/UserInfoSingleton/types.js.map +1 -1
- package/lib/module/specs/NativeDdLogs.js +3 -0
- package/lib/module/specs/NativeDdLogs.js.map +1 -1
- package/lib/module/specs/NativeDdRum.js +3 -0
- package/lib/module/specs/NativeDdRum.js.map +1 -1
- package/lib/module/specs/NativeDdSdk.js +3 -0
- package/lib/module/specs/NativeDdSdk.js.map +1 -1
- package/lib/module/specs/NativeDdTrace.js +3 -0
- package/lib/module/specs/NativeDdTrace.js.map +1 -1
- package/lib/module/trace/DdTrace.js +12 -19
- package/lib/module/trace/DdTrace.js.map +1 -1
- package/lib/module/types.js +5 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/Timer.js +3 -20
- package/lib/module/utils/Timer.js.map +1 -1
- package/lib/module/utils/argsUtils.js +3 -5
- package/lib/module/utils/argsUtils.js.map +1 -1
- package/lib/module/utils/errorUtils.js +6 -9
- package/lib/module/utils/errorUtils.js.map +1 -1
- package/lib/module/utils/jsUtils.js +1 -0
- package/lib/module/utils/jsUtils.js.map +1 -1
- package/lib/module/utils/longTasksUtils.js +2 -5
- package/lib/module/utils/longTasksUtils.js.map +1 -1
- package/lib/module/utils/time-provider/DefaultTimeProvider.js +5 -13
- package/lib/module/utils/time-provider/DefaultTimeProvider.js.map +1 -1
- package/lib/module/utils/time-provider/TimeProvider.js +1 -9
- package/lib/module/utils/time-provider/TimeProvider.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/DdSdkReactNative.d.ts +1 -5
- package/lib/typescript/DdSdkReactNative.d.ts.map +1 -0
- package/lib/typescript/DdSdkReactNativeConfiguration.d.ts +1 -0
- package/lib/typescript/DdSdkReactNativeConfiguration.d.ts.map +1 -0
- package/lib/typescript/InternalLog.d.ts +1 -0
- package/lib/typescript/InternalLog.d.ts.map +1 -0
- package/lib/typescript/ProxyConfiguration.d.ts +1 -0
- package/lib/typescript/ProxyConfiguration.d.ts.map +1 -0
- package/lib/typescript/SdkVerbosity.d.ts +1 -0
- package/lib/typescript/SdkVerbosity.d.ts.map +1 -0
- package/lib/typescript/TrackingConsent.d.ts +1 -0
- package/lib/typescript/TrackingConsent.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +2 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/logs/DdLogs.d.ts +1 -0
- package/lib/typescript/logs/DdLogs.d.ts.map +1 -0
- package/lib/typescript/logs/eventMapper.d.ts +1 -0
- package/lib/typescript/logs/eventMapper.d.ts.map +1 -0
- package/lib/typescript/logs/types.d.ts +6 -1
- package/lib/typescript/logs/types.d.ts.map +1 -0
- package/lib/typescript/nativeModulesTypes.d.ts +3 -1
- package/lib/typescript/nativeModulesTypes.d.ts.map +1 -0
- package/lib/typescript/rum/DdAttributes.d.ts +14 -0
- package/lib/typescript/rum/DdAttributes.d.ts.map +1 -0
- package/lib/typescript/rum/DdRum.d.ts +3 -2
- package/lib/typescript/rum/DdRum.d.ts.map +1 -0
- package/lib/typescript/rum/eventMappers/actionEventMapper.d.ts +1 -0
- package/lib/typescript/rum/eventMappers/actionEventMapper.d.ts.map +1 -0
- package/lib/typescript/rum/eventMappers/errorEventMapper.d.ts +3 -0
- package/lib/typescript/rum/eventMappers/errorEventMapper.d.ts.map +1 -0
- package/lib/typescript/rum/eventMappers/resourceEventMapper.d.ts +1 -0
- package/lib/typescript/rum/eventMappers/resourceEventMapper.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/DdRumErrorTracking.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/DdRumErrorTracking.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/interactionTracking/DdEventsInterceptor.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/interactionTracking/DdEventsInterceptor.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.d.ts +2 -0
- package/lib/typescript/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/interactionTracking/EventsInterceptor.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/interactionTracking/EventsInterceptor.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/interactionTracking/NoOpEventsInterceptor.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/interactionTracking/NoOpEventsInterceptor.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/interactionTracking/ShallowObjectEqualityChecker.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/interactionTracking/ShallowObjectEqualityChecker.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/interactionTracking/getJsxRuntime.d.ts +2 -1
- package/lib/typescript/rum/instrumentation/interactionTracking/getJsxRuntime.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/graphql/graphqlHeaders.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/graphql/graphqlHeaders.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/ResourceReporter.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/ResourceReporter.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/internalDevResourceBlocklist.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/internalDevResourceBlocklist.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/resourceTiming.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/resourceTiming.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/URLHostParser.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/responseSize.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts.map +1 -0
- package/lib/typescript/rum/types.d.ts +1 -0
- package/lib/typescript/rum/types.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesSingleton/AttributesSingleton.d.ts +1 -0
- package/lib/typescript/sdk/AttributesSingleton/AttributesSingleton.d.ts.map +1 -0
- package/lib/typescript/sdk/AttributesSingleton/types.d.ts +1 -0
- package/lib/typescript/sdk/AttributesSingleton/types.d.ts.map +1 -0
- package/lib/typescript/sdk/DatadogProvider/Buffer/BoundedBuffer.d.ts +1 -0
- package/lib/typescript/sdk/DatadogProvider/Buffer/BoundedBuffer.d.ts.map +1 -0
- package/lib/typescript/sdk/DatadogProvider/Buffer/BufferSingleton.d.ts +1 -0
- package/lib/typescript/sdk/DatadogProvider/Buffer/BufferSingleton.d.ts.map +1 -0
- package/lib/typescript/sdk/DatadogProvider/Buffer/DatadogBuffer.d.ts +1 -0
- package/lib/typescript/sdk/DatadogProvider/Buffer/DatadogBuffer.d.ts.map +1 -0
- package/lib/typescript/sdk/DatadogProvider/Buffer/PassThroughBuffer.d.ts +1 -0
- package/lib/typescript/sdk/DatadogProvider/Buffer/PassThroughBuffer.d.ts.map +1 -0
- package/lib/typescript/sdk/DatadogProvider/Buffer/bufferNativeCall.d.ts +1 -0
- package/lib/typescript/sdk/DatadogProvider/Buffer/bufferNativeCall.d.ts.map +1 -0
- package/lib/typescript/sdk/DatadogProvider/DatadogProvider.d.ts +1 -0
- package/lib/typescript/sdk/DatadogProvider/DatadogProvider.d.ts.map +1 -0
- package/lib/typescript/sdk/DdSdk.d.ts +1 -0
- package/lib/typescript/sdk/DdSdk.d.ts.map +1 -0
- package/lib/typescript/sdk/EventMappers/EventMapper.d.ts +1 -0
- package/lib/typescript/sdk/EventMappers/EventMapper.d.ts.map +1 -0
- package/lib/typescript/sdk/EventMappers/utils/deepClone.d.ts +1 -0
- package/lib/typescript/sdk/EventMappers/utils/deepClone.d.ts.map +1 -0
- package/lib/typescript/sdk/FileBasedConfiguration/FileBasedConfiguration.d.ts +1 -0
- package/lib/typescript/sdk/FileBasedConfiguration/FileBasedConfiguration.d.ts.map +1 -0
- package/lib/typescript/sdk/GlobalState/GlobalState.d.ts +13 -0
- package/lib/typescript/sdk/GlobalState/GlobalState.d.ts.map +1 -0
- package/lib/typescript/sdk/UserInfoSingleton/UserInfoSingleton.d.ts +1 -0
- package/lib/typescript/sdk/UserInfoSingleton/UserInfoSingleton.d.ts.map +1 -0
- package/lib/typescript/sdk/UserInfoSingleton/types.d.ts +1 -0
- package/lib/typescript/sdk/UserInfoSingleton/types.d.ts.map +1 -0
- package/lib/typescript/specs/NativeDdLogs.d.ts +1 -0
- package/lib/typescript/specs/NativeDdLogs.d.ts.map +1 -0
- package/lib/typescript/specs/NativeDdRum.d.ts +3 -1
- package/lib/typescript/specs/NativeDdRum.d.ts.map +1 -0
- package/lib/typescript/specs/NativeDdSdk.d.ts +1 -0
- package/lib/typescript/specs/NativeDdSdk.d.ts.map +1 -0
- package/lib/typescript/specs/NativeDdTrace.d.ts +1 -0
- package/lib/typescript/specs/NativeDdTrace.d.ts.map +1 -0
- package/lib/typescript/trace/DdTrace.d.ts +1 -0
- package/lib/typescript/trace/DdTrace.d.ts.map +1 -0
- package/lib/typescript/types.d.ts +1 -0
- package/lib/typescript/types.d.ts.map +1 -0
- package/lib/typescript/utils/Timer.d.ts +1 -0
- package/lib/typescript/utils/Timer.d.ts.map +1 -0
- package/lib/typescript/utils/argsUtils.d.ts +1 -0
- package/lib/typescript/utils/argsUtils.d.ts.map +1 -0
- package/lib/typescript/utils/errorUtils.d.ts +1 -0
- package/lib/typescript/utils/errorUtils.d.ts.map +1 -0
- package/lib/typescript/utils/jsUtils.d.ts +1 -0
- package/lib/typescript/utils/jsUtils.d.ts.map +1 -0
- package/lib/typescript/utils/longTasksUtils.d.ts +1 -0
- package/lib/typescript/utils/longTasksUtils.d.ts.map +1 -0
- package/lib/typescript/utils/time-provider/DefaultTimeProvider.d.ts +1 -0
- package/lib/typescript/utils/time-provider/DefaultTimeProvider.d.ts.map +1 -0
- package/lib/typescript/utils/time-provider/TimeProvider.d.ts +1 -0
- package/lib/typescript/utils/time-provider/TimeProvider.d.ts.map +1 -0
- package/lib/typescript/version.d.ts +2 -1
- package/lib/typescript/version.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/DdSdkReactNative.tsx +3 -10
- package/src/__tests__/DdSdkReactNative.test.tsx +5 -3
- package/src/__tests__/mock.test.ts +0 -1
- package/src/__tests__/rum/instrumentation/DdRumErrorTracking.test.tsx +32 -16
- package/src/__tests__/rum/instrumentation/DdRumUserInteractionTracking.test.tsx +17 -15
- package/src/index.tsx +4 -0
- package/src/logs/DdLogs.ts +25 -8
- package/src/logs/__tests__/DdLogs.test.ts +122 -0
- package/src/logs/types.ts +5 -1
- package/src/nativeModulesTypes.ts +3 -1
- package/src/polyfills.js +37 -0
- package/src/rum/DdAttributes.ts +20 -0
- package/src/rum/DdRum.ts +13 -8
- package/src/rum/__tests__/DdRum.test.ts +43 -7
- package/src/rum/eventMappers/errorEventMapper.ts +2 -0
- package/src/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.tsx +33 -10
- package/src/rum/instrumentation/interactionTracking/getJsxRuntime.ts +10 -3
- package/src/rum/instrumentation/resourceTracking/__tests__/__utils__/XMLHttpRequestMock.ts +1 -0
- package/src/rum/instrumentation/resourceTracking/distributedTracing/__tests__/__utils__/TracingIdentifierUtils.ts +1 -1
- package/src/rum/instrumentation/resourceTracking/distributedTracing/__tests__/distributedTracing.test.ts +1 -1
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/__tests__/XHRProxy.test.ts +1 -1
- package/src/sdk/DatadogProvider/__tests__/initialization.test.tsx +3 -3
- package/src/sdk/DatadogProvider/__tests__/initializationModes.test.tsx +3 -2
- package/src/sdk/GlobalState/GlobalState.tsx +26 -0
- package/src/specs/NativeDdLogs.ts +1 -0
- package/src/specs/NativeDdRum.ts +4 -1
- package/src/specs/NativeDdSdk.ts +1 -0
- package/src/specs/NativeDdTrace.ts +1 -0
- package/src/version.ts +1 -1
- package/android/src/main/kotlin/com/datadog/reactnative/VitalFrameCallback.kt +0 -41
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["DdSdkConfiguration","constructor","clientToken","env","applicationId","nativeCrashReportEnabled","nativeLongTaskThresholdMs","longTaskThresholdMs","sampleRate","site","trackingConsent","additionalConfiguration","telemetrySampleRate","vitalsUpdateFrequency","uploadFrequency","batchSize","trackFrustrations","trackBackgroundEvents","customEndpoints","configurationForTelemetry","nativeViewTracking","nativeInteractionTracking","verbosity","proxyConfig","serviceName","firstPartyHosts","bundleLogsWithRum","bundleLogsWithTraces","exports"],"sourceRoot":"../../src","sources":["types.tsx"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACO,MAAMA,kBAAkB,CAAC;EAC5BC,WAAWA,CACEC,WAAmB,EACnBC,GAAW,EACXC,aAAqB,EACrBC,wBAAiC,EACjCC,yBAAiC,EACjCC,mBAA2B,EAC3BC,UAAkB,EAClBC,IAAY,EACZC,eAAuB,EACvBC,uBAA+B,EAC/BC,mBAA2B,EAC3BC,qBAA6B,EAC7BC,eAAuB,EACvBC,SAAiB,EACjBC,iBAA0B,EAC1BC,qBAA8B,EAC9BC,eAIR,EACQC,yBAOR,EACQC,kBAA2B,EAC3BC,yBAAkC,EAClCC,SAA6B,EAC7BC,WAQM,EACNC,WAA+B,EAC/BC,eAGN,EACMC,iBAA0B,EAC1BC,oBAA6B,EACxC;IAAA,KAhDWzB,WAAmB,GAAnBA,WAAmB;IAAA,KACnBC,GAAW,GAAXA,GAAW;IAAA,KACXC,aAAqB,GAArBA,aAAqB;IAAA,KACrBC,wBAAiC,GAAjCA,wBAAiC;IAAA,KACjCC,yBAAiC,GAAjCA,yBAAiC;IAAA,KACjCC,mBAA2B,GAA3BA,mBAA2B;IAAA,KAC3BC,UAAkB,GAAlBA,UAAkB;IAAA,KAClBC,IAAY,GAAZA,IAAY;IAAA,KACZC,eAAuB,GAAvBA,eAAuB;IAAA,KACvBC,uBAA+B,GAA/BA,uBAA+B;IAAA,KAC/BC,mBAA2B,GAA3BA,mBAA2B;IAAA,KAC3BC,qBAA6B,GAA7BA,qBAA6B;IAAA,KAC7BC,eAAuB,GAAvBA,eAAuB;IAAA,KACvBC,SAAiB,GAAjBA,SAAiB;IAAA,KACjBC,iBAA0B,GAA1BA,iBAA0B;IAAA,KAC1BC,qBAA8B,GAA9BA,qBAA8B;IAAA,KAC9BC,eAIR,GAJQA,eAIR;IAAA,KACQC,yBAOR,GAPQA,yBAOR;IAAA,KACQC,kBAA2B,GAA3BA,kBAA2B;IAAA,KAC3BC,yBAAkC,GAAlCA,yBAAkC;IAAA,KAClCC,SAA6B,GAA7BA,SAA6B;IAAA,KAC7BC,WAQM,GARNA,WAQM;IAAA,KACNC,WAA+B,GAA/BA,WAA+B;IAAA,KAC/BC,eAGN,GAHMA,eAGN;IAAA,KACMC,iBAA0B,GAA1BA,iBAA0B;IAAA,KAC1BC,oBAA6B,GAA7BA,oBAA6B;EACvC;AACP;;AAEA;AACA;AACA;;AA2BA;AACA;AACA;AAFAC,OAAA,CAAA5B,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -4,51 +4,43 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _DefaultTimeProvider = require("./time-provider/DefaultTimeProvider");
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
/*
|
|
9
|
+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
10
|
+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
11
|
+
* Copyright 2016-Present Datadog, Inc.
|
|
12
|
+
*/
|
|
11
13
|
|
|
12
14
|
const START_LABEL = '__start';
|
|
13
15
|
const STOP_LABEL = '__stop';
|
|
16
|
+
|
|
14
17
|
/**
|
|
15
18
|
* Simple timer which records time ticks. Shouldn't be re-used once stopped.
|
|
16
19
|
* All timestamps/durations returned are in milliseconds.
|
|
17
20
|
*/
|
|
18
|
-
|
|
19
21
|
class Timer {
|
|
22
|
+
times = {};
|
|
20
23
|
constructor(timeProvider = new _DefaultTimeProvider.DefaultTimeProvider()) {
|
|
21
|
-
_defineProperty(this, "timeProvider", void 0);
|
|
22
|
-
|
|
23
|
-
_defineProperty(this, "times", {});
|
|
24
|
-
|
|
25
24
|
this.timeProvider = timeProvider;
|
|
26
25
|
}
|
|
27
|
-
|
|
28
26
|
get startTime() {
|
|
29
27
|
return this.times[START_LABEL].unix;
|
|
30
28
|
}
|
|
31
|
-
|
|
32
29
|
get stopTime() {
|
|
33
30
|
return this.startTime + this.durationBetween(START_LABEL, STOP_LABEL);
|
|
34
31
|
}
|
|
35
|
-
|
|
36
32
|
start() {
|
|
37
33
|
this.recordTick(START_LABEL);
|
|
38
34
|
}
|
|
39
|
-
|
|
40
35
|
stop() {
|
|
41
36
|
this.recordTick(STOP_LABEL);
|
|
42
37
|
}
|
|
43
|
-
|
|
44
38
|
recordTick(label) {
|
|
45
39
|
this.times[label] = this.timeProvider.getTimestamp();
|
|
46
40
|
}
|
|
47
|
-
|
|
48
41
|
hasTickFor(label) {
|
|
49
42
|
return label in this.times;
|
|
50
43
|
}
|
|
51
|
-
|
|
52
44
|
durationBetween(startLabel, endLabel) {
|
|
53
45
|
this.checkLabelExists(startLabel);
|
|
54
46
|
this.checkLabelExists(endLabel);
|
|
@@ -56,31 +48,24 @@ class Timer {
|
|
|
56
48
|
const endTick = this.times[endLabel];
|
|
57
49
|
return this.durationBetweenTicks(startTick, endTick);
|
|
58
50
|
}
|
|
59
|
-
|
|
60
51
|
timeAt(label) {
|
|
61
52
|
this.checkLabelExists(label);
|
|
62
53
|
return this.startTime + this.durationBetween(START_LABEL, label);
|
|
63
54
|
}
|
|
64
|
-
|
|
65
55
|
reset() {
|
|
66
56
|
this.times = {};
|
|
67
57
|
}
|
|
68
|
-
|
|
69
58
|
durationBetweenTicks(start, end) {
|
|
70
59
|
if (start.reactNative != null && end.reactNative != null) {
|
|
71
60
|
return end.reactNative - start.reactNative;
|
|
72
61
|
}
|
|
73
|
-
|
|
74
62
|
return end.unix - start.unix;
|
|
75
63
|
}
|
|
76
|
-
|
|
77
64
|
checkLabelExists(label) {
|
|
78
65
|
if (!this.hasTickFor(label)) {
|
|
79
66
|
throw new Error(`Label ${label} is not registered`);
|
|
80
67
|
}
|
|
81
68
|
}
|
|
82
|
-
|
|
83
69
|
}
|
|
84
|
-
|
|
85
70
|
exports.default = Timer;
|
|
86
71
|
//# sourceMappingURL=Timer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_DefaultTimeProvider","require","START_LABEL","STOP_LABEL","Timer","times","constructor","timeProvider","DefaultTimeProvider","startTime","unix","stopTime","durationBetween","start","recordTick","stop","label","getTimestamp","hasTickFor","startLabel","endLabel","checkLabelExists","startTick","endTick","durationBetweenTicks","timeAt","reset","end","reactNative","Error","exports","default"],"sourceRoot":"../../../src","sources":["utils/Timer.ts"],"mappings":";;;;;;AAMA,IAAAA,oBAAA,GAAAC,OAAA;AANA;AACA;AACA;AACA;AACA;;AAKA,MAAMC,WAAW,GAAG,SAAS;AAC7B,MAAMC,UAAU,GAAG,QAAQ;;AAE3B;AACA;AACA;AACA;AACe,MAAMC,KAAK,CAAC;EAEfC,KAAK,GAA8B,CAAC,CAAC;EAE7CC,WAAWA,CAACC,YAA0B,GAAG,IAAIC,wCAAmB,CAAC,CAAC,EAAE;IAChE,IAAI,CAACD,YAAY,GAAGA,YAAY;EACpC;EAEA,IAAIE,SAASA,CAAA,EAAW;IACpB,OAAO,IAAI,CAACJ,KAAK,CAACH,WAAW,CAAC,CAACQ,IAAI;EACvC;EAEA,IAAIC,QAAQA,CAAA,EAAW;IACnB,OAAO,IAAI,CAACF,SAAS,GAAG,IAAI,CAACG,eAAe,CAACV,WAAW,EAAEC,UAAU,CAAC;EACzE;EAEAU,KAAKA,CAAA,EAAS;IACV,IAAI,CAACC,UAAU,CAACZ,WAAW,CAAC;EAChC;EAEAa,IAAIA,CAAA,EAAS;IACT,IAAI,CAACD,UAAU,CAACX,UAAU,CAAC;EAC/B;EAEAW,UAAUA,CAACE,KAAa,EAAQ;IAC5B,IAAI,CAACX,KAAK,CAACW,KAAK,CAAC,GAAG,IAAI,CAACT,YAAY,CAACU,YAAY,CAAC,CAAC;EACxD;EAEAC,UAAUA,CAACF,KAAa,EAAW;IAC/B,OAAOA,KAAK,IAAI,IAAI,CAACX,KAAK;EAC9B;EAEAO,eAAeA,CAACO,UAAkB,EAAEC,QAAgB,EAAU;IAC1D,IAAI,CAACC,gBAAgB,CAACF,UAAU,CAAC;IACjC,IAAI,CAACE,gBAAgB,CAACD,QAAQ,CAAC;IAE/B,MAAME,SAAS,GAAG,IAAI,CAACjB,KAAK,CAACc,UAAU,CAAC;IACxC,MAAMI,OAAO,GAAG,IAAI,CAAClB,KAAK,CAACe,QAAQ,CAAC;IAEpC,OAAO,IAAI,CAACI,oBAAoB,CAACF,SAAS,EAAEC,OAAO,CAAC;EACxD;EAEAE,MAAMA,CAACT,KAAa,EAAU;IAC1B,IAAI,CAACK,gBAAgB,CAACL,KAAK,CAAC;IAE5B,OAAO,IAAI,CAACP,SAAS,GAAG,IAAI,CAACG,eAAe,CAACV,WAAW,EAAEc,KAAK,CAAC;EACpE;EAEAU,KAAKA,CAAA,EAAS;IACV,IAAI,CAACrB,KAAK,GAAG,CAAC,CAAC;EACnB;EAEQmB,oBAAoBA,CAACX,KAAgB,EAAEc,GAAc,EAAU;IACnE,IAAId,KAAK,CAACe,WAAW,IAAI,IAAI,IAAID,GAAG,CAACC,WAAW,IAAI,IAAI,EAAE;MACtD,OAAOD,GAAG,CAACC,WAAW,GAAGf,KAAK,CAACe,WAAW;IAC9C;IACA,OAAOD,GAAG,CAACjB,IAAI,GAAGG,KAAK,CAACH,IAAI;EAChC;EAEQW,gBAAgBA,CAACL,KAAa,EAAE;IACpC,IAAI,CAAC,IAAI,CAACE,UAAU,CAACF,KAAK,CAAC,EAAE;MACzB,MAAM,IAAIa,KAAK,CAAC,SAASb,KAAK,oBAAoB,CAAC;IACvD;EACJ;AACJ;AAACc,OAAA,CAAAC,OAAA,GAAA3B,KAAA","ignoreList":[]}
|
|
@@ -4,40 +4,32 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.validateContext = void 0;
|
|
7
|
-
|
|
8
7
|
var _InternalLog = require("../InternalLog");
|
|
9
|
-
|
|
10
8
|
var _SdkVerbosity = require("../SdkVerbosity");
|
|
11
|
-
|
|
12
9
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
13
|
-
|
|
14
10
|
/*
|
|
15
11
|
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
16
12
|
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
17
13
|
* Copyright 2016-Present Datadog, Inc.
|
|
18
14
|
*/
|
|
15
|
+
|
|
19
16
|
const validateContext = context => {
|
|
20
17
|
if (!context) {
|
|
21
18
|
return {};
|
|
22
|
-
}
|
|
23
|
-
|
|
19
|
+
}
|
|
24
20
|
|
|
21
|
+
// eslint-disable-next-line eqeqeq
|
|
25
22
|
if (context.constructor == Object) {
|
|
26
23
|
return context;
|
|
27
24
|
}
|
|
28
|
-
|
|
29
25
|
if (Array.isArray(context)) {
|
|
30
26
|
_InternalLog.InternalLog.log("The given context is an array, it will be nested in 'context' property inside a new object.", _SdkVerbosity.SdkVerbosity.WARN);
|
|
31
|
-
|
|
32
27
|
return {
|
|
33
28
|
context
|
|
34
29
|
};
|
|
35
30
|
}
|
|
36
|
-
|
|
37
31
|
_InternalLog.InternalLog.log(`The given context (${context}) is invalid - it must be an object. Context will be empty.`, _SdkVerbosity.SdkVerbosity.ERROR);
|
|
38
|
-
|
|
39
32
|
return {};
|
|
40
33
|
};
|
|
41
|
-
|
|
42
34
|
exports.validateContext = validateContext;
|
|
43
35
|
//# sourceMappingURL=argsUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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;;AAKO,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":[]}
|
|
@@ -3,23 +3,18 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
|
|
6
|
+
exports.getErrorStackTrace = exports.getErrorName = exports.getErrorMessage = exports.EMPTY_STACK_TRACE = exports.EMPTY_MESSAGE = exports.DEFAULT_ERROR_NAME = void 0;
|
|
8
7
|
/*
|
|
9
8
|
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
10
9
|
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
11
10
|
* Copyright 2016-Present Datadog, Inc.
|
|
12
11
|
*/
|
|
13
|
-
const EMPTY_MESSAGE = 'Unknown Error';
|
|
14
|
-
exports.EMPTY_MESSAGE = EMPTY_MESSAGE;
|
|
15
|
-
const EMPTY_STACK_TRACE = '';
|
|
16
|
-
exports.EMPTY_STACK_TRACE = EMPTY_STACK_TRACE;
|
|
17
|
-
const DEFAULT_ERROR_NAME = 'Error';
|
|
18
|
-
exports.DEFAULT_ERROR_NAME = DEFAULT_ERROR_NAME;
|
|
19
12
|
|
|
13
|
+
const EMPTY_MESSAGE = exports.EMPTY_MESSAGE = 'Unknown Error';
|
|
14
|
+
const EMPTY_STACK_TRACE = exports.EMPTY_STACK_TRACE = '';
|
|
15
|
+
const DEFAULT_ERROR_NAME = exports.DEFAULT_ERROR_NAME = 'Error';
|
|
20
16
|
const getErrorMessage = error => {
|
|
21
17
|
let message = EMPTY_MESSAGE;
|
|
22
|
-
|
|
23
18
|
if (error === undefined || error === null) {
|
|
24
19
|
message = EMPTY_MESSAGE;
|
|
25
20
|
} else if (typeof error === 'object' && 'message' in error) {
|
|
@@ -27,9 +22,9 @@ const getErrorMessage = error => {
|
|
|
27
22
|
} else {
|
|
28
23
|
message = String(error);
|
|
29
24
|
}
|
|
30
|
-
|
|
31
25
|
return message;
|
|
32
26
|
};
|
|
27
|
+
|
|
33
28
|
/**
|
|
34
29
|
* Will extract the stack from the error, taking the first key found among:
|
|
35
30
|
* `stacktrace`, `stack`, `componentStack` (component tree for component errors,
|
|
@@ -38,13 +33,9 @@ const getErrorMessage = error => {
|
|
|
38
33
|
* In last resort and if `sourceURL`, `line` and `column` are present, it will
|
|
39
34
|
* generate a stack from this information.
|
|
40
35
|
*/
|
|
41
|
-
|
|
42
|
-
|
|
43
36
|
exports.getErrorMessage = getErrorMessage;
|
|
44
|
-
|
|
45
37
|
const getErrorStackTrace = error => {
|
|
46
38
|
let stack = EMPTY_STACK_TRACE;
|
|
47
|
-
|
|
48
39
|
try {
|
|
49
40
|
if (error === undefined || error === null) {
|
|
50
41
|
stack = EMPTY_STACK_TRACE;
|
|
@@ -61,28 +52,24 @@ const getErrorStackTrace = error => {
|
|
|
61
52
|
stack = `at ${error.sourceURL}:${error.line}:${error.column}`;
|
|
62
53
|
}
|
|
63
54
|
}
|
|
64
|
-
} catch (e) {
|
|
55
|
+
} catch (e) {
|
|
56
|
+
// Do nothing
|
|
65
57
|
}
|
|
66
|
-
|
|
67
58
|
return stack;
|
|
68
59
|
};
|
|
69
|
-
|
|
70
60
|
exports.getErrorStackTrace = getErrorStackTrace;
|
|
71
|
-
|
|
72
61
|
const getErrorName = error => {
|
|
73
62
|
try {
|
|
74
63
|
if (typeof error !== 'object' || error === null) {
|
|
75
64
|
return DEFAULT_ERROR_NAME;
|
|
76
65
|
}
|
|
77
|
-
|
|
78
66
|
if (typeof error.name === 'string') {
|
|
79
67
|
return error.name;
|
|
80
68
|
}
|
|
81
|
-
} catch (e) {
|
|
69
|
+
} catch (e) {
|
|
70
|
+
// Do nothing
|
|
82
71
|
}
|
|
83
|
-
|
|
84
72
|
return DEFAULT_ERROR_NAME;
|
|
85
73
|
};
|
|
86
|
-
|
|
87
74
|
exports.getErrorName = getErrorName;
|
|
88
75
|
//# sourceMappingURL=errorUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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":[]}
|
|
@@ -4,12 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.executeWithDelay = void 0;
|
|
7
|
-
|
|
8
7
|
/*
|
|
9
8
|
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
10
9
|
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
11
10
|
* Copyright 2016-Present Datadog, Inc.
|
|
12
11
|
*/
|
|
12
|
+
|
|
13
13
|
const executeWithDelay = async (callback, delay) => {
|
|
14
14
|
return new Promise((resolve, reject) => {
|
|
15
15
|
setTimeout(() => {
|
|
@@ -21,6 +21,5 @@ const executeWithDelay = async (callback, delay) => {
|
|
|
21
21
|
}, delay);
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
|
-
|
|
25
24
|
exports.executeWithDelay = executeWithDelay;
|
|
26
25
|
//# sourceMappingURL=jsUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["executeWithDelay","callback","delay","Promise","resolve","reject","setTimeout","e","exports"],"sourceRoot":"../../../src","sources":["utils/jsUtils.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;;AAEO,MAAMA,gBAAgB,GAAG,MAAAA,CAC5BC,QAAiB,EACjBC,KAAa,KACA;EACb,OAAO,IAAIC,OAAO,CAAI,CAACC,OAAO,EAAEC,MAAM,KAAK;IACvCC,UAAU,CAAC,MAAM;MACb,IAAI;QACAF,OAAO,CAACH,QAAQ,CAAC,CAAC,CAAC;MACvB,CAAC,CAAC,OAAOM,CAAC,EAAE;QACRF,MAAM,CAACE,CAAC,CAAC;MACb;IACJ,CAAC,EAAEL,KAAK,CAAC;EACb,CAAC,CAAC;AACN,CAAC;AAACM,OAAA,CAAAR,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -4,37 +4,32 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.adaptLongTaskThreshold = void 0;
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* 100ms is the lower bound for a noticeable long task event.
|
|
10
9
|
*/
|
|
11
10
|
const MIN_LONG_TASK_THRESHOLD_MS = 100;
|
|
11
|
+
|
|
12
12
|
/**
|
|
13
13
|
* 5000ms is considered an Application Not Responding (ANR) event.
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
15
|
const MAX_LONG_TASK_THRESHOLD_MS = 5000;
|
|
16
|
+
|
|
17
17
|
/**
|
|
18
18
|
* Makes sure the long task threshold value is above 100 and below 5000.
|
|
19
19
|
* Also makes sure it is a number, passing `0` if it is `false`, as the React Native
|
|
20
20
|
* bridge cannot handle values with dual types.
|
|
21
21
|
*/
|
|
22
|
-
|
|
23
22
|
const adaptLongTaskThreshold = longTaskThreshold => {
|
|
24
23
|
if (!longTaskThreshold) {
|
|
25
24
|
return 0;
|
|
26
25
|
}
|
|
27
|
-
|
|
28
26
|
if (longTaskThreshold < MIN_LONG_TASK_THRESHOLD_MS) {
|
|
29
27
|
return MIN_LONG_TASK_THRESHOLD_MS;
|
|
30
28
|
}
|
|
31
|
-
|
|
32
29
|
if (longTaskThreshold > MAX_LONG_TASK_THRESHOLD_MS) {
|
|
33
30
|
return MAX_LONG_TASK_THRESHOLD_MS;
|
|
34
31
|
}
|
|
35
|
-
|
|
36
32
|
return longTaskThreshold;
|
|
37
33
|
};
|
|
38
|
-
|
|
39
34
|
exports.adaptLongTaskThreshold = adaptLongTaskThreshold;
|
|
40
35
|
//# sourceMappingURL=longTasksUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["MIN_LONG_TASK_THRESHOLD_MS","MAX_LONG_TASK_THRESHOLD_MS","adaptLongTaskThreshold","longTaskThreshold","exports"],"sourceRoot":"../../../src","sources":["utils/longTasksUtils.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA,MAAMA,0BAA0B,GAAG,GAAG;;AAEtC;AACA;AACA;AACA,MAAMC,0BAA0B,GAAG,IAAI;;AAEvC;AACA;AACA;AACA;AACA;AACO,MAAMC,sBAAsB,GAC/BC,iBAAiC,IACxB;EACT,IAAI,CAACA,iBAAiB,EAAE;IACpB,OAAO,CAAC;EACZ;EACA,IAAIA,iBAAiB,GAAGH,0BAA0B,EAAE;IAChD,OAAOA,0BAA0B;EACrC;EACA,IAAIG,iBAAiB,GAAGF,0BAA0B,EAAE;IAChD,OAAOA,0BAA0B;EACrC;EAEA,OAAOE,iBAAiB;AAC5B,CAAC;AAACC,OAAA,CAAAF,sBAAA,GAAAA,sBAAA","ignoreList":[]}
|
|
@@ -4,38 +4,32 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.DefaultTimeProvider = void 0;
|
|
7
|
-
|
|
8
7
|
var _TimeProvider = require("./TimeProvider");
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
/*
|
|
9
|
+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
10
|
+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
11
|
+
* Copyright 2016-Present Datadog, Inc.
|
|
12
|
+
*/
|
|
11
13
|
|
|
12
14
|
class DefaultTimeProvider extends _TimeProvider.TimeProvider {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
// @ts-ignore
|
|
18
|
-
global.performance && typeof performance.now === 'function');
|
|
19
|
-
}
|
|
20
|
-
|
|
15
|
+
canUsePerformanceNow =
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
global.performance && typeof performance.now === 'function';
|
|
21
19
|
getTimestamp() {
|
|
22
20
|
return {
|
|
23
21
|
unix: Date.now(),
|
|
24
22
|
reactNative: this.performanceNow()
|
|
25
23
|
};
|
|
26
24
|
}
|
|
27
|
-
|
|
28
25
|
performanceNow() {
|
|
29
26
|
if (this.canUsePerformanceNow) {
|
|
30
27
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
31
28
|
// @ts-ignore
|
|
32
29
|
return performance.now();
|
|
33
30
|
}
|
|
34
|
-
|
|
35
31
|
return null;
|
|
36
32
|
}
|
|
37
|
-
|
|
38
33
|
}
|
|
39
|
-
|
|
40
34
|
exports.DefaultTimeProvider = DefaultTimeProvider;
|
|
41
35
|
//# sourceMappingURL=DefaultTimeProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_TimeProvider","require","DefaultTimeProvider","TimeProvider","canUsePerformanceNow","global","performance","now","getTimestamp","unix","Date","reactNative","performanceNow","exports"],"sourceRoot":"../../../../src","sources":["utils/time-provider/DefaultTimeProvider.tsx"],"mappings":";;;;;;AAMA,IAAAA,aAAA,GAAAC,OAAA;AANA;AACA;AACA;AACA;AACA;;AAKO,MAAMC,mBAAmB,SAASC,0BAAY,CAAC;EAC1CC,oBAAoB;EACxB;EACA;EACAC,MAAM,CAACC,WAAW,IAAI,OAAOA,WAAW,CAACC,GAAG,KAAK,UAAU;EAE/DC,YAAYA,CAAA,EAAc;IACtB,OAAO;MACHC,IAAI,EAAEC,IAAI,CAACH,GAAG,CAAC,CAAC;MAChBI,WAAW,EAAE,IAAI,CAACC,cAAc,CAAC;IACrC,CAAC;EACL;EAEQA,cAAcA,CAAA,EAAkB;IACpC,IAAI,IAAI,CAACR,oBAAoB,EAAE;MAC3B;MACA;MACA,OAAOE,WAAW,CAACC,GAAG,CAAC,CAAC;IAC5B;IACA,OAAO,IAAI;EACf;AACJ;AAACM,OAAA,CAAAX,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -4,9 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.TimeProvider = void 0;
|
|
7
|
-
|
|
8
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
-
|
|
10
7
|
/*
|
|
11
8
|
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
12
9
|
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
@@ -23,33 +20,26 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
23
20
|
*/
|
|
24
21
|
class TimeProvider {
|
|
25
22
|
/** Keeps an average offset between the unix time and the provided timestamp. */
|
|
26
|
-
constructor() {
|
|
27
|
-
_defineProperty(this, "baseOffset", void 0);
|
|
28
23
|
|
|
24
|
+
constructor() {
|
|
29
25
|
const timestamp = this.getTimestamp();
|
|
30
|
-
|
|
31
26
|
if (timestamp.reactNative == null) {
|
|
32
27
|
this.baseOffset = 0;
|
|
33
28
|
} else {
|
|
34
29
|
this.baseOffset = timestamp.unix - timestamp.reactNative;
|
|
35
30
|
}
|
|
36
31
|
}
|
|
37
|
-
|
|
38
32
|
now() {
|
|
39
33
|
const timestamp = this.getTimestamp();
|
|
40
|
-
|
|
41
34
|
if (timestamp.reactNative != null && this.baseOffset === 0) {
|
|
42
35
|
this.baseOffset = timestamp.unix - timestamp.reactNative;
|
|
43
36
|
}
|
|
44
|
-
|
|
45
37
|
if (timestamp.reactNative == null || this.baseOffset === 0) {
|
|
46
38
|
return timestamp.unix;
|
|
47
39
|
} else {
|
|
48
40
|
return this.baseOffset + timestamp.reactNative;
|
|
49
41
|
}
|
|
50
42
|
}
|
|
51
|
-
|
|
52
43
|
}
|
|
53
|
-
|
|
54
44
|
exports.TimeProvider = TimeProvider;
|
|
55
45
|
//# sourceMappingURL=TimeProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["TimeProvider","constructor","timestamp","getTimestamp","reactNative","baseOffset","unix","now","exports"],"sourceRoot":"../../../../src","sources":["utils/time-provider/TimeProvider.tsx"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AASA;AACA;AACA;AACA;AACO,MAAeA,YAAY,CAAC;EAC/B;;EAGAC,WAAWA,CAAA,EAAG;IACV,MAAMC,SAAS,GAAG,IAAI,CAACC,YAAY,CAAC,CAAC;IACrC,IAAID,SAAS,CAACE,WAAW,IAAI,IAAI,EAAE;MAC/B,IAAI,CAACC,UAAU,GAAG,CAAC;IACvB,CAAC,MAAM;MACH,IAAI,CAACA,UAAU,GAAGH,SAAS,CAACI,IAAI,GAAGJ,SAAS,CAACE,WAAW;IAC5D;EACJ;EAIAG,GAAGA,CAAA,EAAW;IACV,MAAML,SAAS,GAAG,IAAI,CAACC,YAAY,CAAC,CAAC;IAErC,IAAID,SAAS,CAACE,WAAW,IAAI,IAAI,IAAI,IAAI,CAACC,UAAU,KAAK,CAAC,EAAE;MACxD,IAAI,CAACA,UAAU,GAAGH,SAAS,CAACI,IAAI,GAAGJ,SAAS,CAACE,WAAW;IAC5D;IAEA,IAAIF,SAAS,CAACE,WAAW,IAAI,IAAI,IAAI,IAAI,CAACC,UAAU,KAAK,CAAC,EAAE;MACxD,OAAOH,SAAS,CAACI,IAAI;IACzB,CAAC,MAAM;MACH,OAAO,IAAI,CAACD,UAAU,GAAGH,SAAS,CAACE,WAAW;IAClD;EACJ;AACJ;AAACI,OAAA,CAAAR,YAAA,GAAAA,YAAA","ignoreList":[]}
|
package/lib/commonjs/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["version","exports"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":";;;;;;AAAA;AACO,MAAMA,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,OAAO","ignoreList":[]}
|