@datadog/mobile-react-native-navigation 1.2.1 → 1.3.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 +2 -0
- package/lib/commonjs/rum/instrumentation/DdRumReactNativeNavigationTracking.js +52 -32
- package/lib/commonjs/rum/instrumentation/DdRumReactNativeNavigationTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/DdRumReactNativeNavigationTracking.js +53 -30
- package/lib/module/rum/instrumentation/DdRumReactNativeNavigationTracking.js.map +1 -1
- package/lib/typescript/core/src/DdSdkReactNative.d.ts +7 -3
- package/lib/typescript/core/src/DdSdkReactNativeConfiguration.d.ts +22 -0
- package/lib/typescript/core/src/foundation.d.ts +2 -4
- package/lib/typescript/core/src/index.d.ts +5 -3
- package/lib/typescript/core/src/logs/DdLogs.d.ts +14 -0
- package/lib/typescript/core/src/logs/eventMapper.d.ts +11 -0
- package/lib/typescript/core/src/logs/types.d.ts +54 -0
- package/lib/typescript/core/src/nativeModulesTypes.d.ts +1 -1
- package/lib/typescript/core/src/rum/DdRum.d.ts +36 -0
- package/lib/typescript/core/src/rum/eventMappers/actionEventMapper.d.ts +21 -0
- package/lib/typescript/core/src/rum/eventMappers/errorEventMapper.d.ts +21 -0
- package/lib/typescript/core/src/rum/eventMappers/resourceEventMapper.d.ts +24 -0
- package/lib/typescript/core/src/rum/instrumentation/{DdEventsInterceptor.d.ts → interactionTracking/DdEventsInterceptor.d.ts} +0 -0
- package/lib/typescript/core/src/rum/instrumentation/{DdRumUserInteractionTracking.d.ts → interactionTracking/DdRumUserInteractionTracking.d.ts} +1 -0
- package/lib/typescript/core/src/rum/instrumentation/{EventsInterceptor.d.ts → interactionTracking/EventsInterceptor.d.ts} +0 -0
- package/lib/typescript/core/src/rum/instrumentation/{NoOpEventsInterceptor.d.ts → interactionTracking/NoOpEventsInterceptor.d.ts} +0 -0
- package/lib/typescript/core/src/rum/instrumentation/{ShallowObjectEqualityChecker.d.ts → interactionTracking/ShallowObjectEqualityChecker.d.ts} +0 -0
- package/lib/typescript/core/src/rum/instrumentation/{getJsxRuntime.d.ts → interactionTracking/getJsxRuntime.d.ts} +0 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/domain/interfaces/RumResource.d.ts +2 -1
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/implementation/XHRProxy.d.ts +0 -1
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/implementation/responseSize.d.ts +0 -1
- package/lib/typescript/core/src/rum/types.d.ts +110 -0
- package/lib/typescript/core/src/sdk/AttributesSingleton/AttributesSingleton.d.ts +12 -0
- package/lib/typescript/core/src/sdk/AttributesSingleton/types.d.ts +3 -0
- package/lib/typescript/core/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/BoundedBuffer.d.ts +0 -0
- package/lib/typescript/core/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/BufferSingleton.d.ts +0 -0
- package/lib/typescript/core/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/DatadogBuffer.d.ts +0 -0
- package/lib/typescript/core/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/PassThroughBuffer.d.ts +0 -0
- package/lib/typescript/core/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/bufferNativeCall.d.ts +0 -0
- package/lib/typescript/core/src/{DatadogProvider → sdk/DatadogProvider}/DatadogProvider.d.ts +2 -2
- package/lib/typescript/core/src/sdk/EventMappers/EventMapper.d.ts +24 -0
- package/lib/typescript/core/src/sdk/EventMappers/utils/deepClone.d.ts +10 -0
- package/lib/typescript/core/src/sdk/UserInfoSingleton/UserInfoSingleton.d.ts +12 -0
- package/lib/typescript/core/src/sdk/UserInfoSingleton/types.d.ts +6 -0
- package/lib/typescript/core/src/types.d.ts +0 -139
- package/lib/typescript/core/src/version.d.ts +1 -1
- package/lib/typescript/react-native-navigation/src/rum/instrumentation/DdRumReactNativeNavigationTracking.d.ts +5 -3
- package/package.json +6 -4
- package/src/__tests__/rum/instrumentation/DdRumReactNativeNavigationTracking.test.tsx +182 -109
- package/src/__tests__/rum/instrumentation/__utils__/AppStateMock.ts +75 -0
- package/src/__tests__/rum/instrumentation/__utils__/AppStateMockLegacy.ts +61 -0
- package/src/rum/instrumentation/DdRumReactNativeNavigationTracking.tsx +89 -54
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { AdditionalEventDataForMapper } from '../../sdk/EventMappers/EventMapper';
|
|
2
|
+
import { EventMapper } from '../../sdk/EventMappers/EventMapper';
|
|
3
|
+
import type { ErrorSource } from '../types';
|
|
4
|
+
declare type RawError = {
|
|
5
|
+
message: string;
|
|
6
|
+
source: ErrorSource;
|
|
7
|
+
stacktrace: string;
|
|
8
|
+
context?: object;
|
|
9
|
+
timestampMs?: number;
|
|
10
|
+
};
|
|
11
|
+
declare type ErrorEvent = RawError & AdditionalEventDataForMapper;
|
|
12
|
+
declare type NativeError = {
|
|
13
|
+
message: string;
|
|
14
|
+
source: ErrorSource;
|
|
15
|
+
stacktrace: string;
|
|
16
|
+
context?: object;
|
|
17
|
+
timestampMs?: number;
|
|
18
|
+
};
|
|
19
|
+
export declare type ErrorEventMapper = (event: ErrorEvent) => ErrorEvent | null;
|
|
20
|
+
export declare const generateErrorEventMapper: (eventMapper: ErrorEventMapper | undefined) => EventMapper<RawError, ErrorEvent, NativeError>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { AdditionalEventDataForMapper } from '../../sdk/EventMappers/EventMapper';
|
|
2
|
+
import { EventMapper } from '../../sdk/EventMappers/EventMapper';
|
|
3
|
+
import type { ResourceKind } from '../types';
|
|
4
|
+
declare type RawResource = {
|
|
5
|
+
readonly key: string;
|
|
6
|
+
readonly statusCode: number;
|
|
7
|
+
readonly kind: ResourceKind;
|
|
8
|
+
readonly size: number;
|
|
9
|
+
context: object;
|
|
10
|
+
readonly timestampMs: number;
|
|
11
|
+
resourceContext: XMLHttpRequest | undefined;
|
|
12
|
+
};
|
|
13
|
+
declare type ResourceEvent = RawResource & AdditionalEventDataForMapper;
|
|
14
|
+
declare type NativeResource = {
|
|
15
|
+
key: string;
|
|
16
|
+
statusCode: number;
|
|
17
|
+
kind: ResourceKind;
|
|
18
|
+
size: number;
|
|
19
|
+
context: object;
|
|
20
|
+
timestampMs: number;
|
|
21
|
+
};
|
|
22
|
+
export declare type ResourceEventMapper = (event: ResourceEvent) => ResourceEvent | null;
|
|
23
|
+
export declare const generateResourceEventMapper: (eventMapper: ResourceEventMapper | undefined) => EventMapper<RawResource, ResourceEvent, NativeResource>;
|
|
24
|
+
export {};
|
|
File without changes
|
|
@@ -7,6 +7,7 @@ export declare class DdRumUserInteractionTracking {
|
|
|
7
7
|
private static eventsInterceptor;
|
|
8
8
|
private static originalCreateElement;
|
|
9
9
|
private static originalMemo;
|
|
10
|
+
private static originalJsx;
|
|
10
11
|
private static patchCreateElementFunction;
|
|
11
12
|
/**
|
|
12
13
|
* Starts tracking user interactions and sends a RUM Action event every time a new interaction was detected.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ResourceKind } from '
|
|
1
|
+
import type { ResourceKind } from '../../../../types';
|
|
2
2
|
import type { DdRumResourceTracingAttributes } from '../distributedTracing';
|
|
3
3
|
export interface RUMResource {
|
|
4
4
|
key: string;
|
|
@@ -17,4 +17,5 @@ export interface RUMResource {
|
|
|
17
17
|
stopTime: number;
|
|
18
18
|
responseStartTime?: number;
|
|
19
19
|
};
|
|
20
|
+
resourceContext?: XMLHttpRequest;
|
|
20
21
|
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The entry point to use Datadog's RUM feature.
|
|
3
|
+
*/
|
|
4
|
+
export declare type DdRumType = {
|
|
5
|
+
/**
|
|
6
|
+
* Start tracking a RUM View.
|
|
7
|
+
* @param key: The view unique key identifier.
|
|
8
|
+
* @param name: The view name.
|
|
9
|
+
* @param context: The additional context to send.
|
|
10
|
+
* @param timestampMs: The timestamp when the view started (in milliseconds). If not provided, current timestamp will be used.
|
|
11
|
+
*/
|
|
12
|
+
startView(key: string, name: string, context?: object, timestampMs?: number): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Stop tracking a RUM View.
|
|
15
|
+
* @param key: The view unique key identifier.
|
|
16
|
+
* @param context: The additional context to send.
|
|
17
|
+
* @param timestampMs: The timestamp when the view stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
18
|
+
*/
|
|
19
|
+
stopView(key: string, context?: object, timestampMs?: number): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Start tracking a RUM Action.
|
|
22
|
+
* @param type: The action type (tap, scroll, swipe, back, custom).
|
|
23
|
+
* @param name: The action name.
|
|
24
|
+
* @param context: The additional context to send.
|
|
25
|
+
* @param timestampMs: The timestamp when the action started (in milliseconds). If not provided, current timestamp will be used.
|
|
26
|
+
*/
|
|
27
|
+
startAction(type: RumActionType, name: string, context?: object, timestampMs?: number): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Stop tracking the ongoing RUM Action.
|
|
30
|
+
* @param type: The action type (tap, scroll, swipe, back, custom).
|
|
31
|
+
* @param name: The action name.
|
|
32
|
+
* @param context: The additional context to send.
|
|
33
|
+
* @param timestampMs: The timestamp when the action stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
34
|
+
*/
|
|
35
|
+
stopAction(type: RumActionType, name: string, context?: object, timestampMs?: number): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Stop tracking the ongoing RUM Action.
|
|
38
|
+
*
|
|
39
|
+
* Warning: using this function signature can lead to inconsistent behaviors on iOS and Android when multiple actions are started in parallel.
|
|
40
|
+
*
|
|
41
|
+
* @deprecated add the `type` and `name` of the action as first two arguments.
|
|
42
|
+
* @param context: The additional context to send.
|
|
43
|
+
* @param timestampMs: The timestamp when the action stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
44
|
+
*/
|
|
45
|
+
stopAction(context?: object, timestampMs?: number): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Add a RUM Action.
|
|
48
|
+
* @param type: The action type (tap, scroll, swipe, back, custom).
|
|
49
|
+
* @param name: The action name.
|
|
50
|
+
* @param context: The additional context to send.
|
|
51
|
+
* @param timestampMs: The timestamp when the action occurred (in milliseconds). If not provided, current timestamp will be used.
|
|
52
|
+
*/
|
|
53
|
+
addAction(type: RumActionType, name: string, context?: object, timestampMs?: number): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Start tracking a RUM Resource.
|
|
56
|
+
* @param key: The resource unique key identifier.
|
|
57
|
+
* @param method: The resource method (GET, POST, …).
|
|
58
|
+
* @param url: The resource url.
|
|
59
|
+
* @param context: The additional context to send.
|
|
60
|
+
* @param timestampMs: The timestamp when the resource started (in milliseconds). If not provided, current timestamp will be used.
|
|
61
|
+
*/
|
|
62
|
+
startResource(key: string, method: string, url: string, context?: object, timestampMs?: number): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Stop tracking a RUM Resource.
|
|
65
|
+
* @param key: The resource unique key identifier.
|
|
66
|
+
* @param statusCode: The resource status code.
|
|
67
|
+
* @param kind: The resource's kind (xhr, document, image, css, font, …).
|
|
68
|
+
* @param size: The resource size in bytes. If size is unknown, use -1.
|
|
69
|
+
* @param context: The additional context to send.
|
|
70
|
+
* @param timestampMs: The timestamp when the resource stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
71
|
+
*/
|
|
72
|
+
stopResource(key: string, statusCode: number, kind: ResourceKind, size?: number, context?: object, timestampMs?: number): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* Add a RUM Error.
|
|
75
|
+
* @param message: The error message.
|
|
76
|
+
* @param source: The error source (network, source, console, webview, custom).
|
|
77
|
+
* @param stacktrace: The error stacktrace.
|
|
78
|
+
* @param context: The additional context to send.
|
|
79
|
+
* @param timestampMs: The timestamp when the error occurred (in milliseconds). If not provided, current timestamp will be used.
|
|
80
|
+
*/
|
|
81
|
+
addError(message: string, source: ErrorSource, stacktrace: string, context?: object, timestampMs?: number): Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* Adds a specific timing in the active View. The timing duration will be computed as the difference between the time the View was started and the time this function was called.
|
|
84
|
+
* @param name: The name of the new custom timing attribute. Timings can be nested up to 8 levels deep. Names using more than 8 levels will be sanitized by SDK.
|
|
85
|
+
*/
|
|
86
|
+
addTiming(name: string): Promise<void>;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Describe the type of a RUM Action.
|
|
90
|
+
*/
|
|
91
|
+
export declare enum RumActionType {
|
|
92
|
+
/** User tapped on a widget. */
|
|
93
|
+
TAP = "TAP",
|
|
94
|
+
/** User scrolled a view. */
|
|
95
|
+
SCROLL = "SCROLL",
|
|
96
|
+
/** User swiped on a view. */
|
|
97
|
+
SWIPE = "SWIPE",
|
|
98
|
+
/** User pressed hardware back button (Android only). */
|
|
99
|
+
BACK = "BACK",
|
|
100
|
+
/** A custom action. */
|
|
101
|
+
CUSTOM = "CUSTOM"
|
|
102
|
+
}
|
|
103
|
+
export declare type ResourceKind = 'image' | 'xhr' | 'beacon' | 'css' | 'document' | 'fetch' | 'font' | 'js' | 'media' | 'other' | 'native';
|
|
104
|
+
export declare enum ErrorSource {
|
|
105
|
+
NETWORK = "NETWORK",
|
|
106
|
+
SOURCE = "SOURCE",
|
|
107
|
+
CONSOLE = "CONSOLE",
|
|
108
|
+
WEBVIEW = "WEBVIEW",
|
|
109
|
+
CUSTOM = "CUSTOM"
|
|
110
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Attributes } from './types';
|
|
2
|
+
declare class AttributesProvider {
|
|
3
|
+
private attributes;
|
|
4
|
+
setAttributes: (attributes: Attributes) => void;
|
|
5
|
+
getAttributes: () => Attributes;
|
|
6
|
+
}
|
|
7
|
+
export declare class AttributesSingleton {
|
|
8
|
+
private static attributesProvider;
|
|
9
|
+
static getInstance: () => AttributesProvider;
|
|
10
|
+
static reset: () => void;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
package/lib/typescript/core/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/BoundedBuffer.d.ts
RENAMED
|
File without changes
|
package/lib/typescript/core/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/BufferSingleton.d.ts
RENAMED
|
File without changes
|
package/lib/typescript/core/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/DatadogBuffer.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
package/lib/typescript/core/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/bufferNativeCall.d.ts
RENAMED
|
File without changes
|
package/lib/typescript/core/src/{DatadogProvider → sdk/DatadogProvider}/DatadogProvider.d.ts
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PropsWithChildren } from 'react';
|
|
3
|
-
import { DatadogProviderConfiguration } from '
|
|
4
|
-
import type { PartialInitializationConfiguration, AutoInstrumentationConfiguration } from '
|
|
3
|
+
import { DatadogProviderConfiguration } from '../../DdSdkReactNativeConfiguration';
|
|
4
|
+
import type { PartialInitializationConfiguration, AutoInstrumentationConfiguration } from '../../DdSdkReactNativeConfiguration';
|
|
5
5
|
declare type Props = PropsWithChildren<{
|
|
6
6
|
/**
|
|
7
7
|
* If a `DatadogProviderConfiguration` instance is passed, the SDK will start tracking errors, resources and actions and sending events.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Attributes } from '../AttributesSingleton/types';
|
|
2
|
+
import type { UserInfo } from '../UserInfoSingleton/types';
|
|
3
|
+
export declare type AdditionalEventDataForMapper = {
|
|
4
|
+
userInfo: UserInfo;
|
|
5
|
+
attributes: Attributes;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Generic class for applying event mappers.
|
|
9
|
+
*
|
|
10
|
+
* Calls params in this order: formatRawEventForMapper, eventMapper, formatMapperEventForNative.
|
|
11
|
+
*
|
|
12
|
+
* @param eventMapper the user-registered event mapper
|
|
13
|
+
* @param formatRawEventForMapper formatter that gets the raw event (from javascript call) and returns the input given to the mapper
|
|
14
|
+
* @param formatMapperEventForNative formatter that gets the ouput of the mapper, and returns the input given to the native SDKs
|
|
15
|
+
* @param formatRawEventForNative called when no event mapper is registered
|
|
16
|
+
*/
|
|
17
|
+
export declare class EventMapper<RawEvent, MapperEvent, NativeEvent> {
|
|
18
|
+
private eventMapper?;
|
|
19
|
+
private formatRawEventForMapper;
|
|
20
|
+
private formatMapperEventForNative;
|
|
21
|
+
private formatRawEventForNative;
|
|
22
|
+
constructor(eventMapper: ((event: MapperEvent) => MapperEvent | null) | undefined, formatRawEventForMapper: (event: RawEvent, additionalData: AdditionalEventDataForMapper) => MapperEvent, formatMapperEventForNative: (event: MapperEvent, originalEvent: MapperEvent) => NativeEvent, formatRawEventForNative: (event: RawEvent) => NativeEvent);
|
|
23
|
+
applyEventMapper: (rawEvent: RawEvent) => NativeEvent | null;
|
|
24
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple deep clone inspired from https://github.com/angus-c/just/blob/master/packages/collection-clone/index.cjs
|
|
3
|
+
* Functions and RegExp will be returned as they are.
|
|
4
|
+
* Maps and Sets are cloned even though they won't be accepted by React Native, just in case they are mutated by the user to avoid side effects.
|
|
5
|
+
*
|
|
6
|
+
* We added support for circular references by limiting the number of depth levels to 8.
|
|
7
|
+
* @param originalObject
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
export declare const deepClone: <T>(originalObject: T, depth?: number) => T;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { UserInfo } from './types';
|
|
2
|
+
declare class UserInfoProvider {
|
|
3
|
+
private userInfo;
|
|
4
|
+
setUserInfo: (userInfo: UserInfo) => void;
|
|
5
|
+
getUserInfo: () => UserInfo;
|
|
6
|
+
}
|
|
7
|
+
export declare class UserInfoSingleton {
|
|
8
|
+
private static userInfoProvider;
|
|
9
|
+
static getInstance: () => UserInfoProvider;
|
|
10
|
+
static reset: () => void;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -52,35 +52,6 @@ export declare type DdSdkType = {
|
|
|
52
52
|
*/
|
|
53
53
|
setTrackingConsent(trackingConsent: string): Promise<void>;
|
|
54
54
|
};
|
|
55
|
-
/**
|
|
56
|
-
* The entry point to use Datadog's Logs feature.
|
|
57
|
-
*/
|
|
58
|
-
export declare type DdLogsType = {
|
|
59
|
-
/**
|
|
60
|
-
* Send a log with level debug.
|
|
61
|
-
* @param message: The message to send.
|
|
62
|
-
* @param context: The additional context to send.
|
|
63
|
-
*/
|
|
64
|
-
debug(message: string, context?: object): Promise<void>;
|
|
65
|
-
/**
|
|
66
|
-
* Send a log with level info.
|
|
67
|
-
* @param message: The message to send.
|
|
68
|
-
* @param context: The additional context to send.
|
|
69
|
-
*/
|
|
70
|
-
info(message: string, context?: object): Promise<void>;
|
|
71
|
-
/**
|
|
72
|
-
* Send a log with level warn.
|
|
73
|
-
* @param message: The message to send.
|
|
74
|
-
* @param context: The additional context to send.
|
|
75
|
-
*/
|
|
76
|
-
warn(message: string, context?: object): Promise<void>;
|
|
77
|
-
/**
|
|
78
|
-
* Send a log with level error.
|
|
79
|
-
* @param message: The message to send.
|
|
80
|
-
* @param context: The additional context to send.
|
|
81
|
-
*/
|
|
82
|
-
error(message: string, context?: object): Promise<void>;
|
|
83
|
-
};
|
|
84
55
|
/**
|
|
85
56
|
* The entry point to use Datadog's Trace feature.
|
|
86
57
|
*/
|
|
@@ -100,113 +71,3 @@ export declare type DdTraceType = {
|
|
|
100
71
|
*/
|
|
101
72
|
finishSpan(spanId: string, context?: object, timestampMs?: number): Promise<void>;
|
|
102
73
|
};
|
|
103
|
-
/**
|
|
104
|
-
* The entry point to use Datadog's RUM feature.
|
|
105
|
-
*/
|
|
106
|
-
export declare type DdRumType = {
|
|
107
|
-
/**
|
|
108
|
-
* Start tracking a RUM View.
|
|
109
|
-
* @param key: The view unique key identifier.
|
|
110
|
-
* @param name: The view name.
|
|
111
|
-
* @param context: The additional context to send.
|
|
112
|
-
* @param timestampMs: The timestamp when the view started (in milliseconds). If not provided, current timestamp will be used.
|
|
113
|
-
*/
|
|
114
|
-
startView(key: string, name: string, context?: object, timestampMs?: number): Promise<void>;
|
|
115
|
-
/**
|
|
116
|
-
* Stop tracking a RUM View.
|
|
117
|
-
* @param key: The view unique key identifier.
|
|
118
|
-
* @param context: The additional context to send.
|
|
119
|
-
* @param timestampMs: The timestamp when the view stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
120
|
-
*/
|
|
121
|
-
stopView(key: string, context?: object, timestampMs?: number): Promise<void>;
|
|
122
|
-
/**
|
|
123
|
-
* Start tracking a RUM Action.
|
|
124
|
-
* @param type: The action type (tap, scroll, swipe, back, custom).
|
|
125
|
-
* @param name: The action name.
|
|
126
|
-
* @param context: The additional context to send.
|
|
127
|
-
* @param timestampMs: The timestamp when the action started (in milliseconds). If not provided, current timestamp will be used.
|
|
128
|
-
*/
|
|
129
|
-
startAction(type: RumActionType, name: string, context?: object, timestampMs?: number): Promise<void>;
|
|
130
|
-
/**
|
|
131
|
-
* Stop tracking the ongoing RUM Action.
|
|
132
|
-
* @param type: The action type (tap, scroll, swipe, back, custom).
|
|
133
|
-
* @param name: The action name.
|
|
134
|
-
* @param context: The additional context to send.
|
|
135
|
-
* @param timestampMs: The timestamp when the action stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
136
|
-
*/
|
|
137
|
-
stopAction(type: RumActionType, name: string, context?: object, timestampMs?: number): Promise<void>;
|
|
138
|
-
/**
|
|
139
|
-
* Stop tracking the ongoing RUM Action.
|
|
140
|
-
*
|
|
141
|
-
* Warning: using this function signature can lead to inconsistent behaviors on iOS and Android when multiple actions are started in parallel.
|
|
142
|
-
*
|
|
143
|
-
* @deprecated add the `type` and `name` of the action as first two arguments.
|
|
144
|
-
* @param context: The additional context to send.
|
|
145
|
-
* @param timestampMs: The timestamp when the action stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
146
|
-
*/
|
|
147
|
-
stopAction(context?: object, timestampMs?: number): Promise<void>;
|
|
148
|
-
/**
|
|
149
|
-
* Add a RUM Action.
|
|
150
|
-
* @param type: The action type (tap, scroll, swipe, back, custom).
|
|
151
|
-
* @param name: The action name.
|
|
152
|
-
* @param context: The additional context to send.
|
|
153
|
-
* @param timestampMs: The timestamp when the action occurred (in milliseconds). If not provided, current timestamp will be used.
|
|
154
|
-
*/
|
|
155
|
-
addAction(type: RumActionType, name: string, context?: object, timestampMs?: number): Promise<void>;
|
|
156
|
-
/**
|
|
157
|
-
* Start tracking a RUM Resource.
|
|
158
|
-
* @param key: The resource unique key identifier.
|
|
159
|
-
* @param method: The resource method (GET, POST, …).
|
|
160
|
-
* @param url: The resource url.
|
|
161
|
-
* @param context: The additional context to send.
|
|
162
|
-
* @param timestampMs: The timestamp when the resource started (in milliseconds). If not provided, current timestamp will be used.
|
|
163
|
-
*/
|
|
164
|
-
startResource(key: string, method: string, url: string, context?: object, timestampMs?: number): Promise<void>;
|
|
165
|
-
/**
|
|
166
|
-
* Stop tracking a RUM Resource.
|
|
167
|
-
* @param key: The resource unique key identifier.
|
|
168
|
-
* @param statusCode: The resource status code.
|
|
169
|
-
* @param kind: The resource's kind (xhr, document, image, css, font, …).
|
|
170
|
-
* @param size: The resource size in bytes. If size is unknown, use -1.
|
|
171
|
-
* @param context: The additional context to send.
|
|
172
|
-
* @param timestampMs: The timestamp when the resource stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
173
|
-
*/
|
|
174
|
-
stopResource(key: string, statusCode: number, kind: ResourceKind, size?: number, context?: object, timestampMs?: number): Promise<void>;
|
|
175
|
-
/**
|
|
176
|
-
* Add a RUM Error.
|
|
177
|
-
* @param message: The error message.
|
|
178
|
-
* @param source: The error source (network, source, console, webview, custom).
|
|
179
|
-
* @param stacktrace: The error stacktrace.
|
|
180
|
-
* @param context: The additional context to send.
|
|
181
|
-
* @param timestampMs: The timestamp when the error occurred (in milliseconds). If not provided, current timestamp will be used.
|
|
182
|
-
*/
|
|
183
|
-
addError(message: string, source: ErrorSource, stacktrace: string, context?: object, timestampMs?: number): Promise<void>;
|
|
184
|
-
/**
|
|
185
|
-
* Adds a specific timing in the active View. The timing duration will be computed as the difference between the time the View was started and the time this function was called.
|
|
186
|
-
* @param name: The name of the new custom timing attribute. Timings can be nested up to 8 levels deep. Names using more than 8 levels will be sanitized by SDK.
|
|
187
|
-
*/
|
|
188
|
-
addTiming(name: string): Promise<void>;
|
|
189
|
-
};
|
|
190
|
-
/**
|
|
191
|
-
* Describe the type of a RUM Action.
|
|
192
|
-
*/
|
|
193
|
-
export declare enum RumActionType {
|
|
194
|
-
/** User tapped on a widget. */
|
|
195
|
-
TAP = "TAP",
|
|
196
|
-
/** User scrolled a view. */
|
|
197
|
-
SCROLL = "SCROLL",
|
|
198
|
-
/** User swiped on a view. */
|
|
199
|
-
SWIPE = "SWIPE",
|
|
200
|
-
/** User pressed hardware back button (Android only). */
|
|
201
|
-
BACK = "BACK",
|
|
202
|
-
/** A custom action. */
|
|
203
|
-
CUSTOM = "CUSTOM"
|
|
204
|
-
}
|
|
205
|
-
export declare type ResourceKind = 'image' | 'xhr' | 'beacon' | 'css' | 'document' | 'fetch' | 'font' | 'js' | 'media' | 'other' | 'native';
|
|
206
|
-
export declare enum ErrorSource {
|
|
207
|
-
NETWORK = "NETWORK",
|
|
208
|
-
SOURCE = "SOURCE",
|
|
209
|
-
CONSOLE = "CONSOLE",
|
|
210
|
-
WEBVIEW = "WEBVIEW",
|
|
211
|
-
CUSTOM = "CUSTOM"
|
|
212
|
-
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.
|
|
1
|
+
export declare const version = "1.3.1";
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { ComponentDidAppearEvent } from 'react-native-navigation';
|
|
2
|
-
export declare type ViewNamePredicate = (event: ComponentDidAppearEvent, trackedName: string) => string;
|
|
2
|
+
export declare type ViewNamePredicate = (event: ComponentDidAppearEvent, trackedName: string) => string | null;
|
|
3
3
|
/**
|
|
4
4
|
* Provides RUM integration for the [React Native Navigation](https://wix.github.io/react-native-navigation) API.
|
|
5
5
|
*/
|
|
6
6
|
export declare class DdRumReactNativeNavigationTracking {
|
|
7
7
|
private static isTracking;
|
|
8
|
-
private static
|
|
9
|
-
private static
|
|
8
|
+
private static eventSubscription;
|
|
9
|
+
private static appStateSubscription?;
|
|
10
10
|
private static viewNamePredicate;
|
|
11
|
+
private static lastView?;
|
|
11
12
|
/**
|
|
12
13
|
* Starts tracking the Navigation and sends a RUM View event every time a root View component appear/disappear.
|
|
13
14
|
*/
|
|
@@ -16,4 +17,5 @@ export declare class DdRumReactNativeNavigationTracking {
|
|
|
16
17
|
* Stops tracking Navigation.
|
|
17
18
|
*/
|
|
18
19
|
static stopTracking(): void;
|
|
20
|
+
private static appStateListener;
|
|
19
21
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datadog/mobile-react-native-navigation",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "A client-side React Native module to interact with Datadog",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"datadog",
|
|
@@ -36,9 +36,11 @@
|
|
|
36
36
|
"prepare": "rm -rf lib && yarn bob build"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@datadog/mobile-react-native": "^1.
|
|
39
|
+
"@datadog/mobile-react-native": "^1.3.1",
|
|
40
|
+
"@testing-library/react-native": "7.0.2",
|
|
40
41
|
"react-native-gesture-handler": "1.10.3",
|
|
41
|
-
"react-native-navigation": "7.
|
|
42
|
+
"react-native-navigation": "7.31.1",
|
|
43
|
+
"remx": "3.x.x"
|
|
42
44
|
},
|
|
43
45
|
"peerDependencies": {
|
|
44
46
|
"@datadog/mobile-react-native": "^1.0.0-beta4",
|
|
@@ -70,5 +72,5 @@
|
|
|
70
72
|
]
|
|
71
73
|
]
|
|
72
74
|
},
|
|
73
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "c70d62caff28da6111c8e526de4dfbb82bb9bf2d"
|
|
74
76
|
}
|