@datadog/mobile-react-navigation 2.14.1 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -5
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/DdRumReactNavigationTracking.js +128 -65
- package/lib/commonjs/rum/instrumentation/DdRumReactNavigationTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/utils.js +31 -0
- package/lib/commonjs/rum/instrumentation/utils.js.map +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/rum/instrumentation/DdRumReactNavigationTracking.js +127 -64
- package/lib/module/rum/instrumentation/DdRumReactNavigationTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/utils.js +25 -0
- package/lib/module/rum/instrumentation/utils.js.map +1 -0
- package/lib/typescript/core/src/DdAttributes.d.ts.map +1 -0
- package/lib/typescript/core/src/DdSdkReactNative.d.ts +49 -12
- package/lib/typescript/core/src/DdSdkReactNative.d.ts.map +1 -1
- package/lib/typescript/core/src/InternalLog.d.ts +1 -1
- package/lib/typescript/core/src/InternalLog.d.ts.map +1 -1
- package/lib/typescript/core/src/config/DatadogProviderConfiguration.d.ts +12 -0
- package/lib/typescript/core/src/config/DatadogProviderConfiguration.d.ts.map +1 -0
- package/lib/typescript/core/src/config/FileBasedConfiguration.d.ts +17 -0
- package/lib/typescript/core/src/config/FileBasedConfiguration.d.ts.map +1 -0
- package/lib/typescript/core/src/config/FileBasedConfiguration.type.d.ts +52 -0
- package/lib/typescript/core/src/config/FileBasedConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/core/src/config/async/AutoInstrumentationConfiguration.d.ts +60 -0
- package/lib/typescript/core/src/config/async/AutoInstrumentationConfiguration.d.ts.map +1 -0
- package/lib/typescript/core/src/config/async/PartialInitializationConfiguration.d.ts +47 -0
- package/lib/typescript/core/src/config/async/PartialInitializationConfiguration.d.ts.map +1 -0
- package/lib/typescript/core/src/config/async/asyncInitializationHelper.d.ts +5 -0
- package/lib/typescript/core/src/config/async/asyncInitializationHelper.d.ts.map +1 -0
- package/lib/typescript/core/src/config/features/CoreConfiguration.d.ts +52 -0
- package/lib/typescript/core/src/config/features/CoreConfiguration.d.ts.map +1 -0
- package/lib/typescript/core/src/config/features/CoreConfiguration.type.d.ts +90 -0
- package/lib/typescript/core/src/config/features/CoreConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/core/src/config/features/CoreConfigurationNative.d.ts +54 -0
- package/lib/typescript/core/src/config/features/CoreConfigurationNative.d.ts.map +1 -0
- package/lib/typescript/core/src/config/features/LogsConfiguration.d.ts +17 -0
- package/lib/typescript/core/src/config/features/LogsConfiguration.d.ts.map +1 -0
- package/lib/typescript/core/src/config/features/LogsConfiguration.type.d.ts +24 -0
- package/lib/typescript/core/src/config/features/LogsConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/core/src/config/features/LogsConfigurationNative.d.ts +6 -0
- package/lib/typescript/core/src/config/features/LogsConfigurationNative.d.ts.map +1 -0
- package/lib/typescript/core/src/config/features/RumConfiguration.d.ts +66 -0
- package/lib/typescript/core/src/config/features/RumConfiguration.d.ts.map +1 -0
- package/lib/typescript/core/src/config/features/RumConfiguration.type.d.ts +131 -0
- package/lib/typescript/core/src/config/features/RumConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/core/src/config/features/RumConfigurationNative.d.ts +25 -0
- package/lib/typescript/core/src/config/features/RumConfigurationNative.d.ts.map +1 -0
- package/lib/typescript/core/src/config/features/TraceConfiguration.d.ts +10 -0
- package/lib/typescript/core/src/config/features/TraceConfiguration.d.ts.map +1 -0
- package/lib/typescript/core/src/config/features/TraceConfiguration.type.d.ts +11 -0
- package/lib/typescript/core/src/config/features/TraceConfiguration.type.d.ts.map +1 -0
- package/lib/typescript/core/src/config/features/TraceConfigurationNative.d.ts +4 -0
- package/lib/typescript/core/src/config/features/TraceConfigurationNative.d.ts.map +1 -0
- package/lib/typescript/core/src/config/types/BatchProcessingLevel.d.ts +18 -0
- package/lib/typescript/core/src/config/types/BatchProcessingLevel.d.ts.map +1 -0
- package/lib/typescript/core/src/config/types/BatchSize.d.ts +19 -0
- package/lib/typescript/core/src/config/types/BatchSize.d.ts.map +1 -0
- package/lib/typescript/core/src/config/types/InitializationMode.d.ts +5 -0
- package/lib/typescript/core/src/config/types/InitializationMode.d.ts.map +1 -0
- package/lib/typescript/core/src/config/types/InitializationModeForTelemetry.d.ts +2 -0
- package/lib/typescript/core/src/config/types/InitializationModeForTelemetry.d.ts.map +1 -0
- package/lib/typescript/core/src/config/types/ProxyConfiguration.d.ts.map +1 -0
- package/lib/typescript/core/src/config/types/SdkVerbosity.d.ts.map +1 -0
- package/lib/typescript/core/src/config/types/TrackingConsent.d.ts.map +1 -0
- package/lib/typescript/core/src/config/types/UploadFrequency.d.ts +18 -0
- package/lib/typescript/core/src/config/types/UploadFrequency.d.ts.map +1 -0
- package/lib/typescript/core/src/config/types/VitalsUpdateFrequency.d.ts +7 -0
- package/lib/typescript/core/src/config/types/VitalsUpdateFrequency.d.ts.map +1 -0
- package/lib/typescript/core/src/config/types/index.d.ts +10 -0
- package/lib/typescript/core/src/config/types/index.d.ts.map +1 -0
- package/lib/typescript/core/src/index.d.ts +20 -9
- package/lib/typescript/core/src/index.d.ts.map +1 -1
- package/lib/typescript/core/src/logs/DdLogs.d.ts +2 -1
- package/lib/typescript/core/src/logs/DdLogs.d.ts.map +1 -1
- package/lib/typescript/core/src/logs/eventMapper.d.ts +3 -2
- package/lib/typescript/core/src/logs/eventMapper.d.ts.map +1 -1
- package/lib/typescript/core/src/logs/types.d.ts +1 -16
- package/lib/typescript/core/src/logs/types.d.ts.map +1 -1
- package/lib/typescript/core/src/nativeModulesTypes.d.ts +2 -15
- package/lib/typescript/core/src/nativeModulesTypes.d.ts.map +1 -1
- package/lib/typescript/core/src/rum/DdRum.d.ts +10 -1
- package/lib/typescript/core/src/rum/DdRum.d.ts.map +1 -1
- package/lib/typescript/core/src/rum/eventMappers/errorEventMapper.d.ts +1 -1
- package/lib/typescript/core/src/rum/eventMappers/errorEventMapper.d.ts.map +1 -1
- package/lib/typescript/core/src/rum/helper.d.ts +10 -0
- package/lib/typescript/core/src/rum/helper.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/DdRumErrorTracking.d.ts.map +1 -1
- package/lib/typescript/core/src/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.d.ts +6 -6
- package/lib/typescript/core/src/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.d.ts.map +1 -1
- package/lib/typescript/core/src/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.d.ts +7 -0
- package/lib/typescript/core/src/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.d.ts.map +1 -1
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts +12 -6
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts.map +1 -1
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.d.ts +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/DatadogTracingContext.d.ts.map +1 -1
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.d.ts +8 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/TracingIdentifier.d.ts.map +1 -1
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.d.ts +5 -17
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.d.ts.map +1 -1
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.d.ts +20 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingAttributes.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.d.ts +3 -24
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingHeaders.d.ts.map +1 -1
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.d.ts +12 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/distributedTracingSampling.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/headers.d.ts +24 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/headers.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.d.ts +2 -1
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.d.ts.map +1 -1
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.d.ts.map +1 -1
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts +1 -1
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts.map +1 -1
- package/lib/typescript/core/src/rum/types.d.ts +47 -7
- package/lib/typescript/core/src/rum/types.d.ts.map +1 -1
- package/lib/typescript/core/src/sdk/AccountInfoSingleton/AccountInfoSingleton.d.ts +15 -0
- package/lib/typescript/core/src/sdk/AccountInfoSingleton/AccountInfoSingleton.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/AccountInfoSingleton/types.d.ts +6 -0
- package/lib/typescript/core/src/sdk/AccountInfoSingleton/types.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/AttributesEncoding/attributesEncoding.d.ts +13 -0
- package/lib/typescript/core/src/sdk/AttributesEncoding/attributesEncoding.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/AttributesEncoding/defaultEncoders.d.ts +33 -0
- package/lib/typescript/core/src/sdk/AttributesEncoding/defaultEncoders.d.ts.map +1 -0
- package/lib/typescript/core/src/{utils → sdk/AttributesEncoding}/errorUtils.d.ts +4 -4
- package/lib/typescript/core/src/sdk/AttributesEncoding/errorUtils.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/AttributesEncoding/helpers.d.ts +17 -0
- package/lib/typescript/core/src/sdk/AttributesEncoding/helpers.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/AttributesEncoding/types.d.ts +21 -0
- package/lib/typescript/core/src/sdk/AttributesEncoding/types.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/AttributesEncoding/utils.d.ts +7 -0
- package/lib/typescript/core/src/sdk/AttributesEncoding/utils.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/AttributesSingleton/AttributesSingleton.d.ts +5 -1
- package/lib/typescript/core/src/sdk/AttributesSingleton/AttributesSingleton.d.ts.map +1 -1
- package/lib/typescript/core/src/sdk/DatadogProvider/DatadogProvider.d.ts +4 -3
- package/lib/typescript/core/src/sdk/DatadogProvider/DatadogProvider.d.ts.map +1 -1
- package/lib/typescript/core/src/sdk/DatadogProvider/DatadogProviderState.d.ts +9 -0
- package/lib/typescript/core/src/sdk/DatadogProvider/DatadogProviderState.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/DdSdk.d.ts +2 -3
- package/lib/typescript/core/src/sdk/DdSdk.d.ts.map +1 -1
- package/lib/typescript/core/src/sdk/DdSdkInternal.d.ts +39 -0
- package/lib/typescript/core/src/sdk/DdSdkInternal.d.ts.map +1 -0
- package/lib/typescript/core/src/sdk/EventMappers/EventMapper.d.ts +3 -1
- package/lib/typescript/core/src/sdk/EventMappers/EventMapper.d.ts.map +1 -1
- package/lib/typescript/core/src/sdk/GlobalState/GlobalState.d.ts +3 -3
- package/lib/typescript/core/src/sdk/GlobalState/GlobalState.d.ts.map +1 -1
- package/lib/typescript/core/src/sdk/UserInfoSingleton/UserInfoSingleton.d.ts +2 -1
- package/lib/typescript/core/src/sdk/UserInfoSingleton/UserInfoSingleton.d.ts.map +1 -1
- package/lib/typescript/core/src/sdk/UserInfoSingleton/types.d.ts +1 -2
- package/lib/typescript/core/src/sdk/UserInfoSingleton/types.d.ts.map +1 -1
- package/lib/typescript/core/src/specs/NativeDdRum.d.ts +45 -0
- package/lib/typescript/core/src/specs/NativeDdRum.d.ts.map +1 -1
- package/lib/typescript/core/src/specs/NativeDdSdk.d.ts +34 -6
- package/lib/typescript/core/src/specs/NativeDdSdk.d.ts.map +1 -1
- package/lib/typescript/core/src/trace/DdTrace.d.ts +1 -2
- package/lib/typescript/core/src/trace/DdTrace.d.ts.map +1 -1
- package/lib/typescript/core/src/types.d.ts +74 -92
- package/lib/typescript/core/src/types.d.ts.map +1 -1
- package/lib/typescript/core/src/utils/longTasksUtils.d.ts +1 -1
- package/lib/typescript/core/src/utils/longTasksUtils.d.ts.map +1 -1
- package/lib/typescript/core/src/utils/singletonUtils.d.ts +2 -0
- package/lib/typescript/core/src/utils/singletonUtils.d.ts.map +1 -0
- package/lib/typescript/core/src/version.d.ts +1 -1
- package/lib/typescript/core/src/version.d.ts.map +1 -1
- package/lib/typescript/react-navigation/src/index.d.ts +2 -2
- package/lib/typescript/react-navigation/src/index.d.ts.map +1 -1
- package/lib/typescript/react-navigation/src/rum/instrumentation/DdRumReactNavigationTracking.d.ts +41 -24
- package/lib/typescript/react-navigation/src/rum/instrumentation/DdRumReactNavigationTracking.d.ts.map +1 -1
- package/lib/typescript/react-navigation/src/rum/instrumentation/utils.d.ts +13 -0
- package/lib/typescript/react-navigation/src/rum/instrumentation/utils.d.ts.map +1 -0
- package/package.json +4 -4
- package/src/__tests__/rum/instrumentation/DdRumReactNavigationTracking.test.tsx +147 -14
- package/src/index.tsx +12 -2
- package/src/rum/instrumentation/DdRumReactNavigationTracking.tsx +168 -101
- package/src/rum/instrumentation/utils.ts +28 -0
- package/lib/typescript/core/src/DdSdkReactNativeConfiguration.d.ts +0 -376
- package/lib/typescript/core/src/DdSdkReactNativeConfiguration.d.ts.map +0 -1
- package/lib/typescript/core/src/ProxyConfiguration.d.ts.map +0 -1
- package/lib/typescript/core/src/SdkVerbosity.d.ts.map +0 -1
- package/lib/typescript/core/src/TrackingConsent.d.ts.map +0 -1
- package/lib/typescript/core/src/rum/DdAttributes.d.ts.map +0 -1
- package/lib/typescript/core/src/rum/sessionId/sessionIdHelper.d.ts +0 -4
- package/lib/typescript/core/src/rum/sessionId/sessionIdHelper.d.ts.map +0 -1
- package/lib/typescript/core/src/sdk/FileBasedConfiguration/FileBasedConfiguration.d.ts +0 -34
- package/lib/typescript/core/src/sdk/FileBasedConfiguration/FileBasedConfiguration.d.ts.map +0 -1
- package/lib/typescript/core/src/utils/argsUtils.d.ts +0 -8
- package/lib/typescript/core/src/utils/argsUtils.d.ts.map +0 -1
- package/lib/typescript/core/src/utils/errorUtils.d.ts.map +0 -1
- /package/lib/typescript/core/src/{rum/DdAttributes.d.ts → DdAttributes.d.ts} +0 -0
- /package/lib/typescript/core/src/{ProxyConfiguration.d.ts → config/types/ProxyConfiguration.d.ts} +0 -0
- /package/lib/typescript/core/src/{SdkVerbosity.d.ts → config/types/SdkVerbosity.d.ts} +0 -0
- /package/lib/typescript/core/src/{TrackingConsent.d.ts → config/types/TrackingConsent.d.ts} +0 -0
|
@@ -7,6 +7,16 @@
|
|
|
7
7
|
import { DdRum, SdkVerbosity, InternalLog } from '@datadog/mobile-react-native';
|
|
8
8
|
import { AppState, BackHandler } from 'react-native';
|
|
9
9
|
import { NavigationTimeline } from './NavigationTimeline';
|
|
10
|
+
import { transformViewKey } from './utils';
|
|
11
|
+
const REACT_NAVIGATION_TRACKING_MODULE = 'com.datadog.reactnative.rum.react_navigation_tracking';
|
|
12
|
+
function getGlobalInstance(key, objectConstructor) {
|
|
13
|
+
const symbol = Symbol.for(key);
|
|
14
|
+
const g = globalThis;
|
|
15
|
+
if (!(symbol in g)) {
|
|
16
|
+
g[symbol] = objectConstructor();
|
|
17
|
+
}
|
|
18
|
+
return g[symbol];
|
|
19
|
+
}
|
|
10
20
|
|
|
11
21
|
// AppStateStatus can have values:
|
|
12
22
|
// 'active' - The app is running in the foreground
|
|
@@ -15,11 +25,24 @@ import { NavigationTimeline } from './NavigationTimeline';
|
|
|
15
25
|
// 'unknown' [iOS] - Initial value until the current app state is determined
|
|
16
26
|
// 'extension' [iOS] - The app is running as an app extension
|
|
17
27
|
|
|
28
|
+
function defaultViewNamePredicate(_route, trackedName) {
|
|
29
|
+
return trackedName;
|
|
30
|
+
}
|
|
31
|
+
function defaultParamsPredicate(_route) {
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
function defaultViewTrackingPredicate(_route) {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
18
38
|
/**
|
|
19
39
|
* Provides RUM integration for the [ReactNavigation](https://reactnavigation.org/) API.
|
|
20
40
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
41
|
+
class RumReactNavigationTracking {
|
|
42
|
+
ROUTE_UNDEFINED_NAVIGATION_WARNING_MESSAGE = 'A navigation change was detected but the RUM ViewEvent was dropped as the route was undefined.';
|
|
43
|
+
NULL_NAVIGATION_REF_ERROR_MESSAGE = 'Cannot track views with a null navigationRef.';
|
|
44
|
+
NAVIGATION_REF_IN_USE_ERROR_MESSAGE = 'Cannot track new navigation container while another one is still tracked. Please call `DdRumReactNavigationTracking.stopTrackingViews` on the previous container reference.';
|
|
45
|
+
get navigationTimeline() {
|
|
23
46
|
if (!this.__INTERNAL._enableNavigationTimeline) {
|
|
24
47
|
return undefined;
|
|
25
48
|
}
|
|
@@ -28,18 +51,20 @@ export class DdRumReactNavigationTracking {
|
|
|
28
51
|
}
|
|
29
52
|
return this._navigationTimeline;
|
|
30
53
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
54
|
+
registeredContainer = null;
|
|
55
|
+
navigationStateChangeListener = null;
|
|
56
|
+
previousRoute = undefined;
|
|
57
|
+
viewNamePredicate = defaultViewNamePredicate;
|
|
58
|
+
viewTrackingPredicate = defaultViewTrackingPredicate;
|
|
59
|
+
paramsTrackingPredicate = defaultParamsPredicate;
|
|
60
|
+
backHandler = null;
|
|
61
|
+
trackingState = 'NOT_TRACKING';
|
|
37
62
|
|
|
38
63
|
/**
|
|
39
64
|
* @internal
|
|
40
65
|
* DO NOT USE: This API is for internal testing only.
|
|
41
66
|
*/
|
|
42
|
-
|
|
67
|
+
__INTERNAL = {
|
|
43
68
|
/**
|
|
44
69
|
* @internal
|
|
45
70
|
* DO NOT USE: This API is for internal testing only.
|
|
@@ -53,18 +78,18 @@ export class DdRumReactNavigationTracking {
|
|
|
53
78
|
return [...(this.navigationTimeline?.events ?? [])];
|
|
54
79
|
}
|
|
55
80
|
};
|
|
56
|
-
|
|
57
|
-
if (
|
|
81
|
+
isAppExitingOnBackPress = () => {
|
|
82
|
+
if (this.registeredContainer === null) {
|
|
58
83
|
return false;
|
|
59
84
|
}
|
|
60
|
-
if (
|
|
85
|
+
if (this.registeredContainer.canGoBack()) {
|
|
61
86
|
return false;
|
|
62
87
|
}
|
|
63
88
|
return true;
|
|
64
89
|
};
|
|
65
|
-
|
|
66
|
-
if (
|
|
67
|
-
|
|
90
|
+
onBackPress = () => {
|
|
91
|
+
if (this.isAppExitingOnBackPress()) {
|
|
92
|
+
this.stopTrackingViews(this.registeredContainer);
|
|
68
93
|
}
|
|
69
94
|
// We always return false so we make sure the react-navigation callback is called.
|
|
70
95
|
// See https://reactnative.dev/docs/backhandler
|
|
@@ -74,26 +99,39 @@ export class DdRumReactNavigationTracking {
|
|
|
74
99
|
/**
|
|
75
100
|
* Starts tracking the NavigationContainer and sends a RUM View event every time the navigation route changed.
|
|
76
101
|
* @param navigationRef the reference to the real NavigationContainer.
|
|
102
|
+
* @param trackingOptions the options object defining how views will be tracked. It contains:
|
|
103
|
+
* viewNamePredicate: the predicate to rename views.
|
|
104
|
+
* viewTrackingPredicate: the predicate to determine if a view should be tracked or not.
|
|
105
|
+
* paramsTrackingPredicate: the predicate to determine which parameters should be tracked for a given view.
|
|
77
106
|
*/
|
|
78
|
-
|
|
79
|
-
// eslint-disable-next-line func-names
|
|
80
|
-
viewNamePredicate = function (_route, trackedName) {
|
|
81
|
-
return trackedName;
|
|
82
|
-
}) {
|
|
107
|
+
startTrackingViews(navigationRef, trackingOptions) {
|
|
83
108
|
this.navigationTimeline?.addStartTrackingEvent();
|
|
109
|
+
const {
|
|
110
|
+
viewNamePredicate = defaultViewNamePredicate,
|
|
111
|
+
viewTrackingPredicate = defaultViewTrackingPredicate,
|
|
112
|
+
paramsTrackingPredicate = defaultParamsPredicate
|
|
113
|
+
} = trackingOptions ?? {};
|
|
84
114
|
if (navigationRef == null) {
|
|
85
|
-
InternalLog.log(
|
|
115
|
+
InternalLog.log(this.NULL_NAVIGATION_REF_ERROR_MESSAGE, SdkVerbosity.ERROR);
|
|
86
116
|
return;
|
|
87
117
|
}
|
|
88
|
-
if (
|
|
89
|
-
InternalLog.log(
|
|
90
|
-
} else if (
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
118
|
+
if (this.registeredContainer != null && this.registeredContainer !== navigationRef) {
|
|
119
|
+
InternalLog.log(this.NAVIGATION_REF_IN_USE_ERROR_MESSAGE, SdkVerbosity.ERROR);
|
|
120
|
+
} else if (this.registeredContainer == null) {
|
|
121
|
+
if (viewNamePredicate) {
|
|
122
|
+
this.viewNamePredicate = viewNamePredicate;
|
|
123
|
+
}
|
|
124
|
+
if (viewTrackingPredicate) {
|
|
125
|
+
this.viewTrackingPredicate = viewTrackingPredicate;
|
|
126
|
+
}
|
|
127
|
+
if (paramsTrackingPredicate) {
|
|
128
|
+
this.paramsTrackingPredicate = paramsTrackingPredicate;
|
|
129
|
+
}
|
|
130
|
+
this.registeredContainer = navigationRef;
|
|
131
|
+
const listener = this.resolveNavigationStateChangeListener();
|
|
94
132
|
navigationRef.addListener('state', listener);
|
|
95
|
-
|
|
96
|
-
this.appStateSubscription = AppState.addEventListener('change',
|
|
133
|
+
this.backHandler = BackHandler.addEventListener('hardwareBackPress', this.onBackPress);
|
|
134
|
+
this.appStateSubscription = AppState.addEventListener('change', this.appStateListener);
|
|
97
135
|
}
|
|
98
136
|
}
|
|
99
137
|
|
|
@@ -101,22 +139,18 @@ export class DdRumReactNavigationTracking {
|
|
|
101
139
|
* Stops tracking the NavigationContainer.
|
|
102
140
|
* @param navigationRef the reference to the real NavigationContainer.
|
|
103
141
|
*/
|
|
104
|
-
|
|
142
|
+
stopTrackingViews(navigationRef) {
|
|
105
143
|
this.navigationTimeline?.addStopTrackingEvent();
|
|
106
144
|
this.previousRoute = undefined;
|
|
107
145
|
if (navigationRef != null) {
|
|
108
|
-
if (
|
|
109
|
-
navigationRef.removeListener('state',
|
|
146
|
+
if (this.navigationStateChangeListener) {
|
|
147
|
+
navigationRef.removeListener('state', this.navigationStateChangeListener);
|
|
110
148
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
// eslint-disable-next-line func-names
|
|
117
|
-
DdRumReactNavigationTracking.viewNamePredicate = function (_route, trackedName) {
|
|
118
|
-
return trackedName;
|
|
119
|
-
};
|
|
149
|
+
this.backHandler?.remove();
|
|
150
|
+
this.backHandler = null;
|
|
151
|
+
this.registeredContainer = null;
|
|
152
|
+
this.navigationStateChangeListener = null;
|
|
153
|
+
this.resetPredicates();
|
|
120
154
|
}
|
|
121
155
|
|
|
122
156
|
// For versions of React Native below 0.65, addEventListener does not return a subscription.
|
|
@@ -131,60 +165,88 @@ export class DdRumReactNavigationTracking {
|
|
|
131
165
|
} else if (AppState.removeEventListener) {
|
|
132
166
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
133
167
|
// @ts-ignore
|
|
134
|
-
AppState.removeEventListener('change',
|
|
168
|
+
AppState.removeEventListener('change', this.appStateListener);
|
|
135
169
|
}
|
|
136
170
|
}
|
|
137
|
-
|
|
171
|
+
_resetInternalStateForTesting() {
|
|
172
|
+
this._navigationTimeline = undefined;
|
|
173
|
+
this.registeredContainer = null;
|
|
174
|
+
this.navigationStateChangeListener = null;
|
|
175
|
+
this.previousRoute = undefined;
|
|
176
|
+
this.backHandler = null;
|
|
177
|
+
this.appStateSubscription = undefined;
|
|
178
|
+
this.previousAppState = undefined;
|
|
179
|
+
this.previousRouteKey = undefined;
|
|
180
|
+
this.trackingState = 'NOT_TRACKING';
|
|
181
|
+
this.resetPredicates();
|
|
182
|
+
}
|
|
183
|
+
resetPredicates() {
|
|
184
|
+
this.paramsTrackingPredicate = defaultParamsPredicate;
|
|
185
|
+
this.viewNamePredicate = defaultViewNamePredicate;
|
|
186
|
+
this.viewTrackingPredicate = defaultViewTrackingPredicate;
|
|
187
|
+
}
|
|
188
|
+
handleRouteNavigation(route, appStateStatus, stateEvent) {
|
|
138
189
|
if (route === undefined || route === null) {
|
|
139
|
-
InternalLog.log(
|
|
190
|
+
InternalLog.log(this.ROUTE_UNDEFINED_NAVIGATION_WARNING_MESSAGE, SdkVerbosity.WARN);
|
|
140
191
|
// RUMM-1400 in some cases the route seem to be undefined
|
|
141
192
|
return;
|
|
142
193
|
}
|
|
143
194
|
const key = route.key;
|
|
144
|
-
const screenName =
|
|
195
|
+
const screenName = this.viewNamePredicate(route, route.name);
|
|
196
|
+
const customKey = transformViewKey(key, screenName);
|
|
145
197
|
if (key != null && screenName != null) {
|
|
146
198
|
// On iOS, the app can start in either "active", "background" or "unknown" state
|
|
147
199
|
if (appStateStatus !== 'background') {
|
|
148
200
|
this.previousRoute = route;
|
|
149
|
-
|
|
201
|
+
this.trackingState = 'TRACKING';
|
|
150
202
|
this.navigationTimeline?.addNavigationStateEvent('START_VIEW', key, stateEvent, {
|
|
151
203
|
activeView: undefined,
|
|
152
204
|
trackingState: this.trackingState
|
|
153
205
|
});
|
|
154
|
-
|
|
206
|
+
if (this.viewTrackingPredicate(route)) {
|
|
207
|
+
const params = this.paramsTrackingPredicate(route);
|
|
208
|
+
if (params) {
|
|
209
|
+
DdRum.startView(customKey, screenName, {
|
|
210
|
+
params
|
|
211
|
+
});
|
|
212
|
+
} else {
|
|
213
|
+
DdRum.startView(customKey, screenName);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
155
216
|
}
|
|
156
217
|
}
|
|
157
218
|
this.previousRouteKey = route.key;
|
|
158
219
|
}
|
|
159
|
-
|
|
220
|
+
handleAppStateChanged(route, appStateStatus) {
|
|
160
221
|
const appStateChangeEvent = this.navigationTimeline?.addAppStateChangeEvent(this.previousAppState, appStateStatus);
|
|
161
222
|
const key = route.key;
|
|
162
|
-
const screenName =
|
|
223
|
+
const screenName = this.viewNamePredicate(route, route.name);
|
|
224
|
+
const customKey = transformViewKey(key, screenName);
|
|
163
225
|
if (key != null && screenName != null) {
|
|
164
226
|
if (appStateStatus === 'background') {
|
|
165
|
-
|
|
227
|
+
this.trackingState = 'NOT_TRACKING';
|
|
166
228
|
this.navigationTimeline?.addNavigationStateEvent('STOP_VIEW', key, appStateChangeEvent, {
|
|
167
229
|
activeView: undefined,
|
|
168
230
|
trackingState: this.trackingState
|
|
169
231
|
});
|
|
170
|
-
DdRum.stopView(
|
|
232
|
+
DdRum.stopView(customKey);
|
|
171
233
|
this.previousRoute = undefined;
|
|
172
|
-
} else if (appStateStatus === 'active' &&
|
|
234
|
+
} else if (appStateStatus === 'active' && this.trackingState === 'NOT_TRACKING') {
|
|
173
235
|
// case when app goes into foreground,
|
|
174
236
|
// in that case navigation listener won't be called
|
|
175
|
-
|
|
237
|
+
this.handleRouteNavigation(route, AppState.currentState, appStateChangeEvent);
|
|
176
238
|
}
|
|
177
239
|
}
|
|
178
240
|
this.previousRouteKey = key;
|
|
179
241
|
this.previousAppState = appStateStatus;
|
|
180
242
|
}
|
|
181
|
-
|
|
182
|
-
if (
|
|
183
|
-
|
|
184
|
-
const route =
|
|
243
|
+
resolveNavigationStateChangeListener() {
|
|
244
|
+
if (this.navigationStateChangeListener == null) {
|
|
245
|
+
this.navigationStateChangeListener = () => {
|
|
246
|
+
const route = this.registeredContainer?.getCurrentRoute();
|
|
185
247
|
const newRouteStateEvent = this.navigationTimeline?.addNewRouteEvent(this.previousRouteKey, route?.key);
|
|
186
248
|
if (route === undefined) {
|
|
187
|
-
InternalLog.log(
|
|
249
|
+
InternalLog.log(this.ROUTE_UNDEFINED_NAVIGATION_WARNING_MESSAGE, SdkVerbosity.WARN);
|
|
188
250
|
return;
|
|
189
251
|
}
|
|
190
252
|
|
|
@@ -196,19 +258,20 @@ export class DdRumReactNavigationTracking {
|
|
|
196
258
|
});
|
|
197
259
|
return;
|
|
198
260
|
}
|
|
199
|
-
|
|
261
|
+
this.handleRouteNavigation(route, AppState.currentState, newRouteStateEvent);
|
|
200
262
|
};
|
|
201
|
-
|
|
263
|
+
this.navigationStateChangeListener({});
|
|
202
264
|
}
|
|
203
|
-
return
|
|
265
|
+
return this.navigationStateChangeListener;
|
|
204
266
|
}
|
|
205
|
-
|
|
206
|
-
const currentRoute =
|
|
267
|
+
appStateListener = appStateStatus => {
|
|
268
|
+
const currentRoute = this.registeredContainer?.getCurrentRoute();
|
|
207
269
|
if (currentRoute === undefined || currentRoute === null) {
|
|
208
270
|
InternalLog.log(`We could not determine the route when changing the application state to: ${appStateStatus}. No RUM View event will be sent in this case.`, SdkVerbosity.ERROR);
|
|
209
271
|
return;
|
|
210
272
|
}
|
|
211
|
-
|
|
273
|
+
this.handleAppStateChanged(currentRoute, appStateStatus);
|
|
212
274
|
};
|
|
213
275
|
}
|
|
276
|
+
export const DdRumReactNavigationTracking = getGlobalInstance(REACT_NAVIGATION_TRACKING_MODULE, () => new RumReactNavigationTracking());
|
|
214
277
|
//# sourceMappingURL=DdRumReactNavigationTracking.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DdRum","SdkVerbosity","InternalLog","AppState","BackHandler","NavigationTimeline","
|
|
1
|
+
{"version":3,"names":["DdRum","SdkVerbosity","InternalLog","AppState","BackHandler","NavigationTimeline","transformViewKey","REACT_NAVIGATION_TRACKING_MODULE","getGlobalInstance","key","objectConstructor","symbol","Symbol","for","g","globalThis","defaultViewNamePredicate","_route","trackedName","defaultParamsPredicate","undefined","defaultViewTrackingPredicate","RumReactNavigationTracking","ROUTE_UNDEFINED_NAVIGATION_WARNING_MESSAGE","NULL_NAVIGATION_REF_ERROR_MESSAGE","NAVIGATION_REF_IN_USE_ERROR_MESSAGE","navigationTimeline","__INTERNAL","_enableNavigationTimeline","_navigationTimeline","registeredContainer","navigationStateChangeListener","previousRoute","viewNamePredicate","viewTrackingPredicate","paramsTrackingPredicate","backHandler","trackingState","_getNavigationTimeline","events","isAppExitingOnBackPress","canGoBack","onBackPress","stopTrackingViews","startTrackingViews","navigationRef","trackingOptions","addStartTrackingEvent","log","ERROR","listener","resolveNavigationStateChangeListener","addListener","addEventListener","appStateSubscription","appStateListener","addStopTrackingEvent","removeListener","remove","resetPredicates","removeEventListener","_resetInternalStateForTesting","previousAppState","previousRouteKey","handleRouteNavigation","route","appStateStatus","stateEvent","WARN","screenName","name","customKey","addNavigationStateEvent","activeView","params","startView","handleAppStateChanged","appStateChangeEvent","addAppStateChangeEvent","stopView","currentState","getCurrentRoute","newRouteStateEvent","addNewRouteEvent","currentRoute","DdRumReactNavigationTracking"],"sourceRoot":"../../../../src","sources":["rum/instrumentation/DdRumReactNavigationTracking.tsx"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA,SAASA,KAAK,EAAEC,YAAY,EAAEC,WAAW,QAAQ,8BAA8B;AAE/E,SAASC,QAAQ,EAAEC,WAAW,QAAQ,cAAc;AAEpD,SAASC,kBAAkB,QAAQ,sBAAsB;AAOzD,SAASC,gBAAgB,QAAQ,SAAS;AAE1C,MAAMC,gCAAgC,GAClC,uDAAuD;AAE3D,SAASC,iBAAiBA,CAAIC,GAAW,EAAEC,iBAA0B,EAAK;EACtE,MAAMC,MAAM,GAAGC,MAAM,CAACC,GAAG,CAACJ,GAAG,CAAC;EAC9B,MAAMK,CAAC,GAAIC,UAAsD;EAEjE,IAAI,EAAEJ,MAAM,IAAIG,CAAC,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Q,CAAC6E,YAAY,EACrBE,kBACJ,CAAC;MACL,CAAC;MAED,IAAI,CAACnD,6BAA6B,CAAC,CAAC,CAAC,CAAC;IAC1C;IACA,OAAO,IAAI,CAACA,6BAA6B;EAC7C;EAEQwB,gBAAgB,GACpBW,cAA8B,IAC7B;IACD,MAAMkB,YAAY,GAAG,IAAI,CAACtD,mBAAmB,EAAEmD,eAAe,CAAC,CAAC;IAChE,IAAIG,YAAY,KAAKhE,SAAS,IAAIgE,YAAY,KAAK,IAAI,EAAE;MACrDlF,WAAW,CAAC8C,GAAG,CACX,4EAA4EkB,cAAc,gDAAgD,EAC1IjE,YAAY,CAACgD,KACjB,CAAC;MACD;IACJ;IAEA,IAAI,CAAC2B,qBAAqB,CAACQ,YAAY,EAAElB,cAAc,CAAC;EAC5D,CAAC;AACL;AAEA,OAAO,MAAMmB,4BAA4B,GAAG7E,iBAAiB,CACzDD,gCAAgC,EAChC,MAAM,IAAIe,0BAA0B,CAAC,CACzC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transforms the view key format from 'ScreenName-uniqueId' to 'ScreenName/uniqueId'.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* // Input: key='Elements-lUQ9cId5lwk1o94euVh2B', screenName='Elements'
|
|
6
|
+
* // Output: 'Elements/lUQ9cId5lwk1o94euVh2B'
|
|
7
|
+
*
|
|
8
|
+
* @param key - The route key (e.g., 'Elements-lUQ9cId5lwk1o94euVh2B')
|
|
9
|
+
* @param screenName - The screen name (e.g., 'Elements')
|
|
10
|
+
* @returns The transformed key, or the original key if not in expected format
|
|
11
|
+
*/
|
|
12
|
+
export function transformViewKey(key, screenName) {
|
|
13
|
+
if (!screenName || !key) {
|
|
14
|
+
return key;
|
|
15
|
+
}
|
|
16
|
+
const expectedPrefix = `${screenName}-`;
|
|
17
|
+
if (key.startsWith(expectedPrefix)) {
|
|
18
|
+
const uniqueId = key.slice(expectedPrefix.length);
|
|
19
|
+
return `${screenName}/${uniqueId}`;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Key is not in the expected format, use original
|
|
23
|
+
return key;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["transformViewKey","key","screenName","expectedPrefix","startsWith","uniqueId","slice","length"],"sourceRoot":"../../../../src","sources":["rum/instrumentation/utils.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,gBAAgBA,CAC5BC,GAAW,EACXC,UAAyB,EACnB;EACN,IAAI,CAACA,UAAU,IAAI,CAACD,GAAG,EAAE;IACrB,OAAOA,GAAG;EACd;EAEA,MAAME,cAAc,GAAG,GAAGD,UAAU,GAAG;EACvC,IAAID,GAAG,CAACG,UAAU,CAACD,cAAc,CAAC,EAAE;IAChC,MAAME,QAAQ,GAAGJ,GAAG,CAACK,KAAK,CAACH,cAAc,CAACI,MAAM,CAAC;IACjD,OAAO,GAAGL,UAAU,IAAIG,QAAQ,EAAE;EACtC;;EAEA;EACA,OAAOJ,GAAG;AACd","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DdAttributes.d.ts","sourceRoot":"","sources":["../../../../../core/src/DdAttributes.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY;IACrB;;;;OAIG;;IAGH;;;OAGG;;IAGH;;;;OAIG;;CAEN,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
3
|
-
import type {
|
|
1
|
+
import type { DatadogProviderConfiguration } from './config/DatadogProviderConfiguration';
|
|
2
|
+
import type { AutoInstrumentationConfiguration } from './config/async/AutoInstrumentationConfiguration';
|
|
3
|
+
import type { PartialInitializationConfiguration } from './config/async/PartialInitializationConfiguration';
|
|
4
|
+
import { CoreConfiguration } from './config/features/CoreConfiguration';
|
|
5
|
+
import type { TrackingConsent } from './config/types/TrackingConsent';
|
|
4
6
|
import type { Attributes } from './sdk/AttributesSingleton/types';
|
|
5
|
-
import type { UserInfo } from './sdk/UserInfoSingleton/types';
|
|
6
7
|
/**
|
|
7
8
|
* This class initializes the Datadog SDK, and sets up communication with the server.
|
|
8
9
|
*/
|
|
@@ -19,7 +20,7 @@ export declare class DdSdkReactNative {
|
|
|
19
20
|
* @param configuration the configuration for the SDK library
|
|
20
21
|
* @returns a Promise.
|
|
21
22
|
*/
|
|
22
|
-
static initialize: (configuration:
|
|
23
|
+
static initialize: (configuration: CoreConfiguration) => Promise<void>;
|
|
23
24
|
private static initializeNativeSDK;
|
|
24
25
|
/**
|
|
25
26
|
* FOR INTERNAL USE ONLY.
|
|
@@ -34,20 +35,28 @@ export declare class DdSdkReactNative {
|
|
|
34
35
|
* FOR INTERNAL USE ONLY.
|
|
35
36
|
*/
|
|
36
37
|
static _initializeFromDatadogProviderWithConfigurationAsync: (configuration: PartialInitializationConfiguration) => Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Adds a specific attribute to the global context attached with all future Logs, Spans and RUM.
|
|
40
|
+
* @param key: Key that identifies the attribute.
|
|
41
|
+
* @param value: Value linked to the attribute.
|
|
42
|
+
*/
|
|
43
|
+
static addAttribute: (key: string, value: unknown) => Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Removes an attribute from the context attached with all future Logs, Spans and RUM events.
|
|
46
|
+
* @param key: They key associated with the attribute to be removed.
|
|
47
|
+
*/
|
|
48
|
+
static removeAttribute: (key: string) => Promise<void>;
|
|
37
49
|
/**
|
|
38
50
|
* Adds a set of attributes to the global context attached with all future Logs, Spans and RUM events.
|
|
39
|
-
* To remove an attribute, set it to `undefined` in a call to `setAttributes`.
|
|
40
51
|
* @param attributes: The global context attributes.
|
|
41
52
|
* @returns a Promise.
|
|
42
53
|
*/
|
|
43
|
-
static
|
|
54
|
+
static addAttributes: (attributes: Attributes) => Promise<void>;
|
|
44
55
|
/**
|
|
45
|
-
*
|
|
46
|
-
* @
|
|
47
|
-
* @param user: The user object (use builtin attributes: 'id', 'email', 'name', and/or any custom attribute).
|
|
48
|
-
* @returns a Promise.
|
|
56
|
+
* Removes a set of attributes from the context attached with all future Logs, Spans and RUM events.
|
|
57
|
+
* @param keys: They keys associated with the attributes to be removed.
|
|
49
58
|
*/
|
|
50
|
-
static
|
|
59
|
+
static removeAttributes: (keys: string[]) => Promise<void>;
|
|
51
60
|
/**
|
|
52
61
|
* Sets the user information.
|
|
53
62
|
* @param id: A mandatory unique user identifier (relevant to your business domain).
|
|
@@ -62,12 +71,40 @@ export declare class DdSdkReactNative {
|
|
|
62
71
|
email?: string;
|
|
63
72
|
extraInfo?: Record<string, unknown>;
|
|
64
73
|
}) => Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* Clears the user information.
|
|
76
|
+
* @returns a Promise.
|
|
77
|
+
*/
|
|
78
|
+
static clearUserInfo: () => Promise<void>;
|
|
65
79
|
/**
|
|
66
80
|
* Set the user information.
|
|
67
81
|
* @param extraUserInfo: The additional information. (To set the id, name or email please user setUserInfo).
|
|
68
82
|
* @returns a Promise.
|
|
69
83
|
*/
|
|
70
84
|
static addUserExtraInfo: (extraUserInfo: Record<string, unknown>) => Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Sets the account information.
|
|
87
|
+
* @param id: A mandatory unique account identifier (relevant to your business domain).
|
|
88
|
+
* @param name: The account name.
|
|
89
|
+
* @param extraInfo: Additional information.
|
|
90
|
+
* @returns a Promise.
|
|
91
|
+
*/
|
|
92
|
+
static setAccountInfo: (accountInfo: {
|
|
93
|
+
id: string;
|
|
94
|
+
name?: string;
|
|
95
|
+
extraInfo?: Record<string, unknown>;
|
|
96
|
+
}) => Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Clears the account information.
|
|
99
|
+
* @returns a Promise.
|
|
100
|
+
*/
|
|
101
|
+
static clearAccountInfo: () => Promise<void>;
|
|
102
|
+
/**
|
|
103
|
+
* Set the account information.
|
|
104
|
+
* @param extraAccountInfo: The additional information. (To set the id or name please use setAccountInfo).
|
|
105
|
+
* @returns a Promise.
|
|
106
|
+
*/
|
|
107
|
+
static addAccountExtraInfo: (extraAccountInfo: Record<string, unknown>) => Promise<void>;
|
|
71
108
|
/**
|
|
72
109
|
* Set the tracking consent regarding the data collection.
|
|
73
110
|
* @param trackingConsent: One of TrackingConsent values.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DdSdkReactNative.d.ts","sourceRoot":"","sources":["../../../../../core/src/DdSdkReactNative.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DdSdkReactNative.d.ts","sourceRoot":"","sources":["../../../../../core/src/DdSdkReactNative.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AAE1F,OAAO,KAAK,EACR,gCAAgC,EAEnC,MAAM,iDAAiD,CAAC;AAEzD,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,mDAAmD,CAAC;AAG5G,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAOxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAUtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AASlE;;GAEG;AACH,qBAAa,gBAAgB;IACzB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAgB;IACrD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAqB;IAC3D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAiB;IACnD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAwB;IACjE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,uBAAuB,CAChB;IAE/B,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAS;IAC3C,OA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AAC,KACvC,QAAQ,IAAI,CAAC,CAyBd;IAEF;;;;;;OAMG;IACH,MAAM,CAAC,cAAc,gBAAuB;QACxC,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,OAAO,MAAM,EAAE,OAAO,CAAC,CAAC;KACvC,KAAG,QAAQ,IAAI,CAAC,CAQf;IAEF;;;OAGG;IACH,MAAM,CAAC,gBAAgB,QAAa,QAAQ,IAAI,CAAC,CAI/C;IAEF;;;;OAIG;IACH,MAAM,CAAC,mBAAmB,qBACJ,OAAO,MAAM,EAAE,OAAO,CAAC,KAC1C,QAAQ,IAAI,CAAC,CAyBd;IAEF;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,YAAa,eAAe,KAAG,QAAQ,IAAI,CAAC,CAGnE;IAEF;;;OAGG;IACH,MAAM,CAAC,YAAY,QAAO,QAAQ,IAAI,CAAC,CAGrC;IAEF,OAAO,CAAC,MAAM,CAAC,kBAAkB,CA6F/B;IAEF,OAAO,CAAC,MAAM,CAAC,cAAc;CAoFhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalLog.d.ts","sourceRoot":"","sources":["../../../../../core/src/InternalLog.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"InternalLog.d.ts","sourceRoot":"","sources":["../../../../../core/src/InternalLog.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,eAAO,MAAM,sBAAsB,aAAa,CAAC;AAEjD;;;;GAIG;AACH,qBAAa,WAAW;IACpB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAKpB;IAEH,OAAc,SAAS,EAAE,YAAY,GAAG,SAAS,CAAa;WAEhD,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,GAAG,IAAI;CA0BpE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CoreConfiguration } from './features/CoreConfiguration';
|
|
2
|
+
import { InitializationMode } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* SDK Initialization configuration for `DatadogProvider`.
|
|
5
|
+
*/
|
|
6
|
+
export declare class DatadogProviderConfiguration extends CoreConfiguration {
|
|
7
|
+
/**
|
|
8
|
+
* If set to ASYNC, the initialization will be delayed until all animations are completed.
|
|
9
|
+
*/
|
|
10
|
+
initializationMode: InitializationMode;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=DatadogProviderConfiguration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatadogProviderConfiguration.d.ts","sourceRoot":"","sources":["../../../../../../core/src/config/DatadogProviderConfiguration.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C;;GAEG;AACH,qBAAa,4BAA6B,SAAQ,iBAAiB;IAC/D;;OAEG;IACI,kBAAkB,EAAE,kBAAkB,CAA2B;CAC3E"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ActionEventMapper } from '../rum/eventMappers/actionEventMapper';
|
|
2
|
+
import type { ErrorEventMapper } from '../rum/eventMappers/errorEventMapper';
|
|
3
|
+
import type { ResourceEventMapper } from '../rum/eventMappers/resourceEventMapper';
|
|
4
|
+
import { PropagatorType } from '../rum/types';
|
|
5
|
+
import { DatadogProviderConfiguration } from './DatadogProviderConfiguration';
|
|
6
|
+
import type { JsonConfiguration } from './FileBasedConfiguration.type';
|
|
7
|
+
export declare class FileBasedConfiguration extends DatadogProviderConfiguration {
|
|
8
|
+
constructor(params?: {
|
|
9
|
+
configuration?: unknown;
|
|
10
|
+
errorEventMapper?: ErrorEventMapper;
|
|
11
|
+
resourceEventMapper?: ResourceEventMapper;
|
|
12
|
+
actionEventMapper?: ActionEventMapper;
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
export declare const getJSONConfiguration: (userSpecifiedConfiguration: unknown) => JsonConfiguration;
|
|
16
|
+
export declare const formatPropagatorType: (propagatorType: string) => PropagatorType;
|
|
17
|
+
//# sourceMappingURL=FileBasedConfiguration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileBasedConfiguration.d.ts","sourceRoot":"","sources":["../../../../../../core/src/config/FileBasedConfiguration.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAEnF,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AA8BvE,qBAAa,sBAAuB,SAAQ,4BAA4B;gBACxD,MAAM,CAAC,EAAE;QACjB,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;QACpC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;QAC1C,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;KACzC;CAqEJ;AAmBD,eAAO,MAAM,oBAAoB,+BACD,OAAO,KACpC,iBAuFF,CAAC;AAuBF,eAAO,MAAM,oBAAoB,mBACb,MAAM,KACvB,cAoBF,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { FirstPartyHost } from '../rum/types';
|
|
2
|
+
import type { CoreConfigurationOptions } from './features/CoreConfiguration.type';
|
|
3
|
+
import type { BatchProcessingLevel, BatchSize, ProxyConfiguration, SdkVerbosity, TrackingConsent, UploadFrequency, VitalsUpdateFrequency } from './types';
|
|
4
|
+
export interface JsonConfiguration extends CoreConfigurationOptions {
|
|
5
|
+
clientToken: string;
|
|
6
|
+
env: string;
|
|
7
|
+
trackingConsent?: TrackingConsent;
|
|
8
|
+
verbosity?: SdkVerbosity;
|
|
9
|
+
service?: string;
|
|
10
|
+
site?: string;
|
|
11
|
+
batchSize?: BatchSize;
|
|
12
|
+
batchProcessingLevel?: BatchProcessingLevel;
|
|
13
|
+
proxyConfiguration?: ProxyConfiguration;
|
|
14
|
+
uploadFrequency?: UploadFrequency;
|
|
15
|
+
version?: string;
|
|
16
|
+
versionSuffix?: string;
|
|
17
|
+
rumConfiguration?: {
|
|
18
|
+
applicationId: string;
|
|
19
|
+
useAccessibilityLabel?: boolean;
|
|
20
|
+
trackInteractions?: boolean;
|
|
21
|
+
trackResources?: boolean;
|
|
22
|
+
trackErrors?: boolean;
|
|
23
|
+
longTaskThresholdMs?: number;
|
|
24
|
+
actionNameAttribute?: string;
|
|
25
|
+
appHangThreshold?: number;
|
|
26
|
+
firstPartyHosts?: FirstPartyHost[];
|
|
27
|
+
initialResourceThreshold?: number;
|
|
28
|
+
trackMemoryWarnings?: boolean;
|
|
29
|
+
nativeCrashReportEnabled?: boolean;
|
|
30
|
+
nativeLongTaskThresholdMs?: number;
|
|
31
|
+
nativeViewTracking?: boolean;
|
|
32
|
+
nativeInteractionTracking?: boolean;
|
|
33
|
+
customEndpoint?: string;
|
|
34
|
+
sessionSampleRate?: number;
|
|
35
|
+
resourceTraceSampleRate?: number;
|
|
36
|
+
trackBackgroundEvents?: boolean;
|
|
37
|
+
trackFrustrations?: boolean;
|
|
38
|
+
trackNonFatalAnrs?: boolean;
|
|
39
|
+
trackWatchdogTerminations?: boolean;
|
|
40
|
+
vitalsUpdateFrequency?: VitalsUpdateFrequency;
|
|
41
|
+
telemetrySampleRate?: number;
|
|
42
|
+
};
|
|
43
|
+
traceConfiguration?: {
|
|
44
|
+
customEndpoint?: string;
|
|
45
|
+
};
|
|
46
|
+
logsConfiguration?: {
|
|
47
|
+
bundleLogsWithRum?: boolean;
|
|
48
|
+
bundleLogsWithTraces?: boolean;
|
|
49
|
+
customEndpoint?: string;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=FileBasedConfiguration.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileBasedConfiguration.type.d.ts","sourceRoot":"","sources":["../../../../../../core/src/config/FileBasedConfiguration.type.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,KAAK,EACR,oBAAoB,EACpB,SAAS,EACT,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,eAAe,EACf,qBAAqB,EACxB,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,iBAAkB,SAAQ,wBAAwB;IAC/D,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE;QACf,aAAa,EAAE,MAAM,CAAC;QACtB,qBAAqB,CAAC,EAAE,OAAO,CAAC;QAChC,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,WAAW,CAAC,EAAE,OAAO,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