@datadog/mobile-react-native-code-push 1.7.1 → 1.8.0-rc1
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/lib/typescript/core/src/DdSdkReactNative.d.ts +4 -4
- package/lib/typescript/core/src/DdSdkReactNativeConfiguration.d.ts +14 -0
- package/lib/typescript/core/src/logs/DdLogs.d.ts +4 -4
- package/lib/typescript/core/src/nativeModulesTypes.d.ts +28 -168
- package/lib/typescript/core/src/rum/DdRum.d.ts +12 -12
- package/lib/typescript/core/src/rum/eventMappers/errorEventMapper.d.ts +4 -4
- package/lib/typescript/core/src/rum/instrumentation/interactionTracking/DdEventsInterceptor.d.ts +4 -0
- package/lib/typescript/core/src/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.d.ts +3 -1
- package/lib/typescript/core/src/specs/NativeDdLogs.d.ts +69 -0
- package/lib/typescript/core/src/specs/NativeDdRum.d.ts +92 -0
- package/lib/typescript/core/src/specs/NativeDdSdk.d.ts +46 -0
- package/lib/typescript/core/src/specs/NativeDdTrace.d.ts +23 -0
- package/lib/typescript/core/src/version.d.ts +1 -1
- package/package.json +6 -5
|
@@ -28,7 +28,7 @@ export declare class DdSdkReactNative {
|
|
|
28
28
|
* @param configuration the configuration for the SDK library
|
|
29
29
|
* @returns a Promise.
|
|
30
30
|
*/
|
|
31
|
-
static initialize(configuration: DdSdkReactNativeConfiguration)
|
|
31
|
+
static initialize: (configuration: DdSdkReactNativeConfiguration) => Promise<void>;
|
|
32
32
|
private static initializeNativeSDK;
|
|
33
33
|
/**
|
|
34
34
|
* FOR INTERNAL USE ONLY.
|
|
@@ -48,19 +48,19 @@ export declare class DdSdkReactNative {
|
|
|
48
48
|
* @param attributes: The global context attributes.
|
|
49
49
|
* @returns a Promise.
|
|
50
50
|
*/
|
|
51
|
-
static setAttributes(attributes: Attributes)
|
|
51
|
+
static setAttributes: (attributes: Attributes) => Promise<void>;
|
|
52
52
|
/**
|
|
53
53
|
* Set the user information.
|
|
54
54
|
* @param user: The user object (use builtin attributes: 'id', 'email', 'name', and/or any custom attribute).
|
|
55
55
|
* @returns a Promise.
|
|
56
56
|
*/
|
|
57
|
-
static setUser(user: UserInfo)
|
|
57
|
+
static setUser: (user: UserInfo) => Promise<void>;
|
|
58
58
|
/**
|
|
59
59
|
* Set the tracking consent regarding the data collection.
|
|
60
60
|
* @param trackingConsent: One of TrackingConsent values.
|
|
61
61
|
* @returns a Promise.
|
|
62
62
|
*/
|
|
63
|
-
static setTrackingConsent(consent: TrackingConsent)
|
|
63
|
+
static setTrackingConsent: (consent: TrackingConsent) => Promise<void>;
|
|
64
64
|
private static buildConfiguration;
|
|
65
65
|
private static enableFeatures;
|
|
66
66
|
}
|
|
@@ -174,6 +174,18 @@ export declare class DdSdkReactNativeConfiguration {
|
|
|
174
174
|
* number of sessions tracked and impact your billing.
|
|
175
175
|
*/
|
|
176
176
|
trackBackgroundEvents: boolean;
|
|
177
|
+
/**
|
|
178
|
+
* Specifies a custom prop to name RUM actions on elements having an `onPress` prop.
|
|
179
|
+
*
|
|
180
|
+
* For example if you set it to `testID`, the value of the `testID` prop is used as a custom action name:
|
|
181
|
+
*
|
|
182
|
+
* ```js
|
|
183
|
+
* <TouchableOpacity testID="Dismiss notification" onPress={() => dismiss()}>
|
|
184
|
+
* ```
|
|
185
|
+
*
|
|
186
|
+
* `dd-action-name` is favored when both attributes are present on an element.
|
|
187
|
+
*/
|
|
188
|
+
actionNameAttribute?: string;
|
|
177
189
|
logEventMapper: LogEventMapper | null;
|
|
178
190
|
errorEventMapper: ErrorEventMapper | null;
|
|
179
191
|
resourceEventMapper: ResourceEventMapper | null;
|
|
@@ -197,6 +209,7 @@ export declare type AutoInstrumentationConfiguration = {
|
|
|
197
209
|
readonly errorEventMapper?: ErrorEventMapper | null;
|
|
198
210
|
readonly resourceEventMapper?: ResourceEventMapper | null;
|
|
199
211
|
readonly actionEventMapper?: ActionEventMapper | null;
|
|
212
|
+
readonly actionNameAttribute?: string;
|
|
200
213
|
};
|
|
201
214
|
/**
|
|
202
215
|
* Parameters needed to start auto instrumentation. Includes default values.
|
|
@@ -211,6 +224,7 @@ export declare type AutoInstrumentationParameters = {
|
|
|
211
224
|
readonly errorEventMapper: ErrorEventMapper | null;
|
|
212
225
|
readonly resourceEventMapper: ResourceEventMapper | null;
|
|
213
226
|
readonly actionEventMapper: ActionEventMapper | null;
|
|
227
|
+
readonly actionNameAttribute?: string;
|
|
214
228
|
};
|
|
215
229
|
/**
|
|
216
230
|
* We could use `Proxy` instead of this function, but `Proxy` is not available on
|
|
@@ -2,10 +2,10 @@ import type { DdLogsType, LogArguments, LogEventMapper, LogWithErrorArguments }
|
|
|
2
2
|
declare class DdLogsWrapper implements DdLogsType {
|
|
3
3
|
private nativeLogs;
|
|
4
4
|
private logEventMapper;
|
|
5
|
-
debug(...args: LogArguments | LogWithErrorArguments)
|
|
6
|
-
info(...args: LogArguments | LogWithErrorArguments)
|
|
7
|
-
warn(...args: LogArguments | LogWithErrorArguments)
|
|
8
|
-
error(...args: LogArguments | LogWithErrorArguments)
|
|
5
|
+
debug: (...args: LogArguments | LogWithErrorArguments) => Promise<void>;
|
|
6
|
+
info: (...args: LogArguments | LogWithErrorArguments) => Promise<void>;
|
|
7
|
+
warn: (...args: LogArguments | LogWithErrorArguments) => Promise<void>;
|
|
8
|
+
error: (...args: LogArguments | LogWithErrorArguments) => Promise<void>;
|
|
9
9
|
/**
|
|
10
10
|
* Since the InternalLog does not have a verbosity set yet in this case,
|
|
11
11
|
* we use console.warn to warn the user in dev mode.
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
import type { Spec as NativeDdLogs } from './specs/NativeDdLogs';
|
|
2
|
+
import type { Spec as NativeDdRum } from './specs/NativeDdRum';
|
|
3
|
+
import type { Spec as NativeDdSdk } from './specs/NativeDdSdk';
|
|
4
|
+
import type { Spec as NativeDdTrace } from './specs/NativeDdTrace';
|
|
5
|
+
/**
|
|
6
|
+
* In this file, native modules types extend the specs for TurboModules.
|
|
7
|
+
* As we cannot use enums or classes in the specs, we override methods using them here.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* The entry point to use Datadog's Logs feature.
|
|
11
|
+
*/
|
|
12
|
+
export declare type DdNativeLogsType = NativeDdLogs;
|
|
13
|
+
/**
|
|
14
|
+
* The entry point to use Datadog's Trace feature.
|
|
15
|
+
*/
|
|
16
|
+
export declare type DdNativeTraceType = NativeDdTrace;
|
|
1
17
|
/**
|
|
2
18
|
* A configuration object to initialize Datadog's features.
|
|
3
19
|
*/
|
|
@@ -15,148 +31,20 @@ export declare class DdNativeSdkConfiguration {
|
|
|
15
31
|
/**
|
|
16
32
|
* The entry point to initialize Datadog's features.
|
|
17
33
|
*/
|
|
18
|
-
export
|
|
34
|
+
export interface DdNativeSdkType extends NativeDdSdk {
|
|
19
35
|
/**
|
|
20
36
|
* Initializes Datadog's features.
|
|
21
37
|
* @param configuration: The configuration to use.
|
|
22
38
|
*/
|
|
23
39
|
initialize(configuration: DdNativeSdkConfiguration): Promise<void>;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
setAttributes(attributes: object): Promise<void>;
|
|
29
|
-
/**
|
|
30
|
-
* Set the user information.
|
|
31
|
-
* @param user: The user object (use builtin attributes: 'id', 'email', 'name', and/or any custom attribute).
|
|
32
|
-
*/
|
|
33
|
-
setUser(user: object): Promise<object>;
|
|
34
|
-
/**
|
|
35
|
-
* Set the tracking consent regarding the data collection.
|
|
36
|
-
* @param trackingConsent: Consent, which can take one of the following values: 'pending', 'granted', 'not_granted'.
|
|
37
|
-
*/
|
|
38
|
-
setTrackingConsent(trackingConsent: string): Promise<void>;
|
|
39
|
-
/**
|
|
40
|
-
* Sends internal telemetry debug message
|
|
41
|
-
* @param message debug message
|
|
42
|
-
*/
|
|
43
|
-
telemetryDebug(message: string): Promise<void>;
|
|
44
|
-
/**
|
|
45
|
-
* Sends internal telemetry error
|
|
46
|
-
* @param message error message
|
|
47
|
-
* @param stack error stack
|
|
48
|
-
* @param kind error kind
|
|
49
|
-
*/
|
|
50
|
-
telemetryError(message: string, stack: string, kind: string): Promise<void>;
|
|
51
|
-
/**
|
|
52
|
-
* Send webview telemetry logs
|
|
53
|
-
* @param message event description
|
|
54
|
-
*/
|
|
55
|
-
consumeWebviewEvent(message: string): Promise<void>;
|
|
56
|
-
};
|
|
57
|
-
/**
|
|
58
|
-
* The entry point to use Datadog's Logs feature.
|
|
59
|
-
*/
|
|
60
|
-
export declare type DdNativeLogsType = {
|
|
61
|
-
/**
|
|
62
|
-
* Send a log with DEBUG level.
|
|
63
|
-
* @param message: The message to send.
|
|
64
|
-
* @param context: The additional context to send.
|
|
65
|
-
*/
|
|
66
|
-
debug(message: string, context?: object): Promise<void>;
|
|
67
|
-
/**
|
|
68
|
-
* Send a log with INFO level.
|
|
69
|
-
* @param message: The message to send.
|
|
70
|
-
* @param context: The additional context to send.
|
|
71
|
-
*/
|
|
72
|
-
info(message: string, context?: object): Promise<void>;
|
|
73
|
-
/**
|
|
74
|
-
* Send a log with WARN level.
|
|
75
|
-
* @param message: The message to send.
|
|
76
|
-
* @param context: The additional context to send.
|
|
77
|
-
*/
|
|
78
|
-
warn(message: string, context?: object): Promise<void>;
|
|
79
|
-
/**
|
|
80
|
-
* Send a log with ERROR level.
|
|
81
|
-
* @param message: The message to send.
|
|
82
|
-
* @param context: The additional context to send.
|
|
83
|
-
*/
|
|
84
|
-
error(message: string, context?: object): Promise<void>;
|
|
85
|
-
/**
|
|
86
|
-
* Send a log containing an error with DEBUG level.
|
|
87
|
-
* @param message: The message to send.
|
|
88
|
-
* @param errorKind: The error kind to send.
|
|
89
|
-
* @param errorMessage: The error message to send.
|
|
90
|
-
* @param stacktrace: The stack trace to send.
|
|
91
|
-
* @param context: The additional context to send.
|
|
92
|
-
*/
|
|
93
|
-
debugWithError(message: string, errorKind?: string, errorMessage?: string, stacktrace?: string, context?: object): Promise<void>;
|
|
94
|
-
/**
|
|
95
|
-
* Send a log containing an error with INDO level.
|
|
96
|
-
* @param message: The message to send.
|
|
97
|
-
* @param errorKind: The error kind to send.
|
|
98
|
-
* @param errorMessage: The error message to send.
|
|
99
|
-
* @param stacktrace: The stack trace to send.
|
|
100
|
-
* @param context: The additional context to send.
|
|
101
|
-
*/
|
|
102
|
-
infoWithError(message: string, errorKind?: string, errorMessage?: string, stacktrace?: string, context?: object): Promise<void>;
|
|
103
|
-
/**
|
|
104
|
-
* Send a log containing an error with WARN level.
|
|
105
|
-
* @param message: The message to send.
|
|
106
|
-
* @param errorKind: The error kind to send.
|
|
107
|
-
* @param errorMessage: The error message to send.
|
|
108
|
-
* @param stacktrace: The stack trace to send.
|
|
109
|
-
* @param context: The additional context to send.
|
|
110
|
-
*/
|
|
111
|
-
warnWithError(message: string, errorKind?: string, errorMessage?: string, stacktrace?: string, context?: object): Promise<void>;
|
|
112
|
-
/**
|
|
113
|
-
* Send a log containing an error with ERROR level.
|
|
114
|
-
* @param message: The message to send.
|
|
115
|
-
* @param errorKind: The error kind to send.
|
|
116
|
-
* @param errorMessage: The error message to send.
|
|
117
|
-
* @param stacktrace: The stack trace to send.
|
|
118
|
-
* @param context: The additional context to send.
|
|
119
|
-
*/
|
|
120
|
-
errorWithError(message: string, errorKind?: string, errorMessage?: string, stacktrace?: string, context?: object): Promise<void>;
|
|
121
|
-
};
|
|
122
|
-
/**
|
|
123
|
-
* The entry point to use Datadog's Trace feature.
|
|
124
|
-
*/
|
|
125
|
-
export declare type DdNativeTraceType = {
|
|
126
|
-
/**
|
|
127
|
-
* Start a span, and returns a unique identifier for the span.
|
|
128
|
-
* @param operation: The operation name of the span.
|
|
129
|
-
* @param context: The additional context to send.
|
|
130
|
-
* @param timestampMs: The timestamp when the operation started (in milliseconds). If not provided, current timestamp will be used.
|
|
131
|
-
*/
|
|
132
|
-
startSpan(operation: string, context?: object, timestampMs?: number): Promise<string>;
|
|
133
|
-
/**
|
|
134
|
-
* Finish a started span.
|
|
135
|
-
* @param spanId: The unique identifier of the span.
|
|
136
|
-
* @param context: The additional context to send.
|
|
137
|
-
* @param timestampMs: The timestamp when the operation stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
138
|
-
*/
|
|
139
|
-
finishSpan(spanId: string, context?: object, timestampMs?: number): Promise<void>;
|
|
140
|
-
};
|
|
40
|
+
}
|
|
41
|
+
declare type ActionType = 'TAP' | 'SCROLL' | 'SWIPE' | 'BACK' | 'CUSTOM';
|
|
42
|
+
declare type ResourceKind = 'image' | 'xhr' | 'beacon' | 'css' | 'document' | 'fetch' | 'font' | 'js' | 'media' | 'other' | 'native';
|
|
43
|
+
declare type ErrorSource = 'NETWORK' | 'SOURCE' | 'CONSOLE' | 'WEBVIEW' | 'CUSTOM';
|
|
141
44
|
/**
|
|
142
45
|
* The entry point to use Datadog's RUM feature.
|
|
143
46
|
*/
|
|
144
|
-
export
|
|
145
|
-
/**
|
|
146
|
-
* Start tracking a RUM View.
|
|
147
|
-
* @param key: The view unique key identifier.
|
|
148
|
-
* @param name: The view name.
|
|
149
|
-
* @param context: The additional context to send.
|
|
150
|
-
* @param timestampMs: The timestamp when the view started (in milliseconds). If not provided, current timestamp will be used.
|
|
151
|
-
*/
|
|
152
|
-
startView(key: string, name: string, context?: object, timestampMs?: number): Promise<void>;
|
|
153
|
-
/**
|
|
154
|
-
* Stop tracking a RUM View.
|
|
155
|
-
* @param key: The view unique key identifier.
|
|
156
|
-
* @param context: The additional context to send.
|
|
157
|
-
* @param timestampMs: The timestamp when the view stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
158
|
-
*/
|
|
159
|
-
stopView(key: string, context?: object, timestampMs?: number): Promise<void>;
|
|
47
|
+
export interface DdNativeRumType extends NativeDdRum {
|
|
160
48
|
/**
|
|
161
49
|
* Start tracking a RUM Action.
|
|
162
50
|
* @param type: The action type (tap, scroll, swipe, back, custom).
|
|
@@ -164,7 +52,7 @@ export declare type DdNativeRumType = {
|
|
|
164
52
|
* @param context: The additional context to send.
|
|
165
53
|
* @param timestampMs: The timestamp when the action started (in milliseconds). If not provided, current timestamp will be used.
|
|
166
54
|
*/
|
|
167
|
-
startAction(type: ActionType, name: string, context
|
|
55
|
+
startAction(type: ActionType, name: string, context: object, timestampMs: number): Promise<void>;
|
|
168
56
|
/**
|
|
169
57
|
* Stop tracking the ongoing RUM Action.
|
|
170
58
|
* @param type: The action type (tap, scroll, swipe, back, custom).
|
|
@@ -172,7 +60,7 @@ export declare type DdNativeRumType = {
|
|
|
172
60
|
* @param context: The additional context to send.
|
|
173
61
|
* @param timestampMs: The timestamp when the action stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
174
62
|
*/
|
|
175
|
-
stopAction(type: ActionType, name: string, context
|
|
63
|
+
stopAction(type: ActionType, name: string, context: object, timestampMs: number): Promise<void>;
|
|
176
64
|
/**
|
|
177
65
|
* Add a RUM Action.
|
|
178
66
|
* @param type: The action type (tap, scroll, swipe, back, custom).
|
|
@@ -180,16 +68,7 @@ export declare type DdNativeRumType = {
|
|
|
180
68
|
* @param context: The additional context to send.
|
|
181
69
|
* @param timestampMs: The timestamp when the action occurred (in milliseconds). If not provided, current timestamp will be used.
|
|
182
70
|
*/
|
|
183
|
-
addAction(type: ActionType, name: string, context
|
|
184
|
-
/**
|
|
185
|
-
* Start tracking a RUM Resource.
|
|
186
|
-
* @param key: The resource unique key identifier.
|
|
187
|
-
* @param method: The resource method (GET, POST, …).
|
|
188
|
-
* @param url: The resource url.
|
|
189
|
-
* @param context: The additional context to send.
|
|
190
|
-
* @param timestampMs: The timestamp when the resource started (in milliseconds). If not provided, current timestamp will be used.
|
|
191
|
-
*/
|
|
192
|
-
startResource(key: string, method: string, url: string, context?: object, timestampMs?: number): Promise<void>;
|
|
71
|
+
addAction(type: ActionType, name: string, context: object, timestampMs: number): Promise<void>;
|
|
193
72
|
/**
|
|
194
73
|
* Stop tracking a RUM Resource.
|
|
195
74
|
* @param key: The resource unique key identifier.
|
|
@@ -199,7 +78,7 @@ export declare type DdNativeRumType = {
|
|
|
199
78
|
* @param context: The additional context to send.
|
|
200
79
|
* @param timestampMs: The timestamp when the resource stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
201
80
|
*/
|
|
202
|
-
stopResource(key: string, statusCode: number, kind: ResourceKind, size
|
|
81
|
+
stopResource(key: string, statusCode: number, kind: ResourceKind, size: number, context: object, timestampMs: number): Promise<void>;
|
|
203
82
|
/**
|
|
204
83
|
* Add a RUM Error.
|
|
205
84
|
* @param message: The error message.
|
|
@@ -208,25 +87,6 @@ export declare type DdNativeRumType = {
|
|
|
208
87
|
* @param context: The additional context to send.
|
|
209
88
|
* @param timestampMs: The timestamp when the error occurred (in milliseconds). If not provided, current timestamp will be used.
|
|
210
89
|
*/
|
|
211
|
-
addError(message: string, source: ErrorSource, stacktrace: string, context
|
|
212
|
-
|
|
213
|
-
* 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.
|
|
214
|
-
* @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.
|
|
215
|
-
*/
|
|
216
|
-
addTiming(name: string): Promise<void>;
|
|
217
|
-
/**
|
|
218
|
-
* Stops the current RUM Session.
|
|
219
|
-
*/
|
|
220
|
-
stopSession(): Promise<void>;
|
|
221
|
-
/**
|
|
222
|
-
* Adds the result of evaluating a feature flag with a given name and value to the view.
|
|
223
|
-
* Feature flag evaluations are local to the active view and are cleared when the view is stopped.
|
|
224
|
-
* @param name: The name of the feature flag
|
|
225
|
-
* @param value: The value of the feature flag, encapsulated in an object to accept all types
|
|
226
|
-
*/
|
|
227
|
-
addFeatureFlagEvaluation(name: string, value: object): Promise<void>;
|
|
228
|
-
};
|
|
229
|
-
declare type ActionType = 'TAP' | 'SCROLL' | 'SWIPE' | 'BACK' | 'CUSTOM';
|
|
230
|
-
declare type ResourceKind = 'image' | 'xhr' | 'beacon' | 'css' | 'document' | 'fetch' | 'font' | 'js' | 'media' | 'other' | 'native';
|
|
231
|
-
declare type ErrorSource = 'NETWORK' | 'SOURCE' | 'CONSOLE' | 'WEBVIEW' | 'CUSTOM';
|
|
90
|
+
addError(message: string, source: ErrorSource, stacktrace: string, context: object, timestampMs: number): Promise<void>;
|
|
91
|
+
}
|
|
232
92
|
export {};
|
|
@@ -9,24 +9,24 @@ declare class DdRumWrapper implements DdRumType {
|
|
|
9
9
|
private errorEventMapper;
|
|
10
10
|
private resourceEventMapper;
|
|
11
11
|
private actionEventMapper;
|
|
12
|
-
startView(key: string, name: string, context?: object, timestampMs?: number)
|
|
13
|
-
stopView(key: string, context?: object, timestampMs?: number)
|
|
14
|
-
startAction(type: RumActionType, name: string, context?: object, timestampMs?: number)
|
|
15
|
-
stopAction(...args: [
|
|
12
|
+
startView: (key: string, name: string, context?: object, timestampMs?: number) => Promise<void>;
|
|
13
|
+
stopView: (key: string, context?: object, timestampMs?: number) => Promise<void>;
|
|
14
|
+
startAction: (type: RumActionType, name: string, context?: object, timestampMs?: number) => Promise<void>;
|
|
15
|
+
stopAction: (...args: [
|
|
16
16
|
type: RumActionType,
|
|
17
17
|
name: string,
|
|
18
18
|
context?: object,
|
|
19
19
|
timestampMs?: number
|
|
20
|
-
] | [context?: object, timestampMs?: number])
|
|
20
|
+
] | [context?: object, timestampMs?: number]) => Promise<void>;
|
|
21
21
|
private callNativeStopAction;
|
|
22
22
|
private getStopActionNativeCallArgs;
|
|
23
|
-
addAction(type: RumActionType, name: string, context?: object, timestampMs?: number, actionContext?: GestureResponderEvent)
|
|
24
|
-
startResource(key: string, method: string, url: string, context?: object, timestampMs?: number)
|
|
25
|
-
stopResource(key: string, statusCode: number, kind: ResourceKind, size?: number, context?: object, timestampMs?: number, resourceContext?: XMLHttpRequest)
|
|
26
|
-
addError(message: string, source: ErrorSource, stacktrace: string, context?: object, timestampMs?: number)
|
|
27
|
-
addTiming(name: string)
|
|
28
|
-
stopSession()
|
|
29
|
-
addFeatureFlagEvaluation(name: string, value: unknown)
|
|
23
|
+
addAction: (type: RumActionType, name: string, context?: object, timestampMs?: number, actionContext?: GestureResponderEvent) => Promise<void>;
|
|
24
|
+
startResource: (key: string, method: string, url: string, context?: object, timestampMs?: number) => Promise<void>;
|
|
25
|
+
stopResource: (key: string, statusCode: number, kind: ResourceKind, size?: number, context?: object, timestampMs?: number, resourceContext?: XMLHttpRequest) => Promise<void>;
|
|
26
|
+
addError: (message: string, source: ErrorSource, stacktrace: string, context?: object, timestampMs?: number) => Promise<void>;
|
|
27
|
+
addTiming: (name: string) => Promise<void>;
|
|
28
|
+
stopSession: () => Promise<void>;
|
|
29
|
+
addFeatureFlagEvaluation: (name: string, value: unknown) => Promise<void>;
|
|
30
30
|
registerErrorEventMapper(errorEventMapper: ErrorEventMapper): void;
|
|
31
31
|
unregisterErrorEventMapper(): void;
|
|
32
32
|
registerResourceEventMapper(resourceEventMapper: ResourceEventMapper): void;
|
|
@@ -5,16 +5,16 @@ declare type RawError = {
|
|
|
5
5
|
message: string;
|
|
6
6
|
source: ErrorSource;
|
|
7
7
|
stacktrace: string;
|
|
8
|
-
context
|
|
9
|
-
timestampMs
|
|
8
|
+
context: object;
|
|
9
|
+
timestampMs: number;
|
|
10
10
|
};
|
|
11
11
|
declare type ErrorEvent = RawError & AdditionalEventDataForMapper;
|
|
12
12
|
declare type NativeError = {
|
|
13
13
|
message: string;
|
|
14
14
|
source: ErrorSource;
|
|
15
15
|
stacktrace: string;
|
|
16
|
-
context
|
|
17
|
-
timestampMs
|
|
16
|
+
context: object;
|
|
17
|
+
timestampMs: number;
|
|
18
18
|
};
|
|
19
19
|
export declare type ErrorEventMapper = (event: ErrorEvent) => ErrorEvent | null;
|
|
20
20
|
export declare const generateErrorEventMapper: (eventMapper: ErrorEventMapper | undefined) => EventMapper<RawError, ErrorEvent, NativeError>;
|
package/lib/typescript/core/src/rum/instrumentation/interactionTracking/DdEventsInterceptor.d.ts
CHANGED
|
@@ -3,6 +3,10 @@ export declare const UNKNOWN_TARGET_NAME = "unknown_target";
|
|
|
3
3
|
export declare class DdEventsInterceptor implements EventsInterceptor {
|
|
4
4
|
static ACTION_EVENT_DROPPED_DEBUG_MESSAGE: string;
|
|
5
5
|
private debouncingStartedTimestamp;
|
|
6
|
+
private actionNameAttribute?;
|
|
7
|
+
constructor({ actionNameAttribute }?: {
|
|
8
|
+
actionNameAttribute?: string;
|
|
9
|
+
});
|
|
6
10
|
interceptOnPress(...args: any[]): void;
|
|
7
11
|
private handleTargetEvent;
|
|
8
12
|
private resolveTargetName;
|
|
@@ -14,6 +14,8 @@ export declare class DdRumUserInteractionTracking {
|
|
|
14
14
|
* Please note that we are only considering as valid - for - tracking only the user interactions that have
|
|
15
15
|
* a visible output (either an UI state change or a Resource request)
|
|
16
16
|
*/
|
|
17
|
-
static startTracking(
|
|
17
|
+
static startTracking({ actionNameAttribute }?: {
|
|
18
|
+
actionNameAttribute?: string;
|
|
19
|
+
}): void;
|
|
18
20
|
static stopTracking(): void;
|
|
19
21
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Do not import this Spec directly, use DdNativeLogsType instead.
|
|
4
|
+
*/
|
|
5
|
+
export interface Spec extends TurboModule {
|
|
6
|
+
readonly getConstants: () => {};
|
|
7
|
+
/**
|
|
8
|
+
* Send a log with DEBUG level.
|
|
9
|
+
* @param message: The message to send.
|
|
10
|
+
* @param context: The additional context to send.
|
|
11
|
+
*/
|
|
12
|
+
readonly debug: (message: string, context?: Object) => Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Send a log with INFO level.
|
|
15
|
+
* @param message: The message to send.
|
|
16
|
+
* @param context: The additional context to send.
|
|
17
|
+
*/
|
|
18
|
+
readonly info: (message: string, context?: Object) => Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Send a log with WARN level.
|
|
21
|
+
* @param message: The message to send.
|
|
22
|
+
* @param context: The additional context to send.
|
|
23
|
+
*/
|
|
24
|
+
readonly warn: (message: string, context?: Object) => Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Send a log with ERROR level.
|
|
27
|
+
* @param message: The message to send.
|
|
28
|
+
* @param context: The additional context to send.
|
|
29
|
+
*/
|
|
30
|
+
readonly error: (message: string, context?: Object) => Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Send a log containing an error with DEBUG level.
|
|
33
|
+
* @param message: The message to send.
|
|
34
|
+
* @param errorKind: The error kind to send.
|
|
35
|
+
* @param errorMessage: The error message to send.
|
|
36
|
+
* @param stacktrace: The stack trace to send.
|
|
37
|
+
* @param context: The additional context to send.
|
|
38
|
+
*/
|
|
39
|
+
readonly debugWithError: (message: string, errorKind?: string, errorMessage?: string, stacktrace?: string, context?: Object) => Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* Send a log containing an error with INDO level.
|
|
42
|
+
* @param message: The message to send.
|
|
43
|
+
* @param errorKind: The error kind to send.
|
|
44
|
+
* @param errorMessage: The error message to send.
|
|
45
|
+
* @param stacktrace: The stack trace to send.
|
|
46
|
+
* @param context: The additional context to send.
|
|
47
|
+
*/
|
|
48
|
+
readonly infoWithError: (message: string, errorKind?: string, errorMessage?: string, stacktrace?: string, context?: Object) => Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Send a log containing an error with WARN level.
|
|
51
|
+
* @param message: The message to send.
|
|
52
|
+
* @param errorKind: The error kind to send.
|
|
53
|
+
* @param errorMessage: The error message to send.
|
|
54
|
+
* @param stacktrace: The stack trace to send.
|
|
55
|
+
* @param context: The additional context to send.
|
|
56
|
+
*/
|
|
57
|
+
readonly warnWithError: (message: string, errorKind?: string, errorMessage?: string, stacktrace?: string, context?: Object) => Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Send a log containing an error with ERROR level.
|
|
60
|
+
* @param message: The message to send.
|
|
61
|
+
* @param errorKind: The error kind to send.
|
|
62
|
+
* @param errorMessage: The error message to send.
|
|
63
|
+
* @param stacktrace: The stack trace to send.
|
|
64
|
+
* @param context: The additional context to send.
|
|
65
|
+
*/
|
|
66
|
+
readonly errorWithError: (message: string, errorKind?: string, errorMessage?: string, stacktrace?: string, context?: Object) => Promise<void>;
|
|
67
|
+
}
|
|
68
|
+
declare const _default: Spec | null;
|
|
69
|
+
export default _default;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Do not import this Spec directly, use DdNativeRumType instead.
|
|
4
|
+
*/
|
|
5
|
+
export interface Spec extends TurboModule {
|
|
6
|
+
readonly getConstants: () => {};
|
|
7
|
+
/**
|
|
8
|
+
* Start tracking a RUM View.
|
|
9
|
+
* @param key: The view unique key identifier.
|
|
10
|
+
* @param name: The view name.
|
|
11
|
+
* @param context: The additional context to send.
|
|
12
|
+
* @param timestampMs: The timestamp when the view started (in milliseconds). If not provided, current timestamp will be used.
|
|
13
|
+
*/
|
|
14
|
+
startView(key: string, name: string, context: Object, timestampMs: number): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Stop tracking a RUM View.
|
|
17
|
+
* @param key: The view unique key identifier.
|
|
18
|
+
* @param context: The additional context to send.
|
|
19
|
+
* @param timestampMs: The timestamp when the view stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
20
|
+
*/
|
|
21
|
+
stopView(key: string, context: Object, timestampMs: number): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Start tracking a RUM Action.
|
|
24
|
+
* @param type: The action type (tap, scroll, swipe, back, custom).
|
|
25
|
+
* @param name: The action name.
|
|
26
|
+
* @param context: The additional context to send.
|
|
27
|
+
* @param timestampMs: The timestamp when the action started (in milliseconds). If not provided, current timestamp will be used.
|
|
28
|
+
*/
|
|
29
|
+
startAction(type: string, name: string, context: Object, timestampMs: number): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Stop tracking the ongoing RUM Action.
|
|
32
|
+
* @param type: The action type (tap, scroll, swipe, back, custom).
|
|
33
|
+
* @param name: The action name.
|
|
34
|
+
* @param context: The additional context to send.
|
|
35
|
+
* @param timestampMs: The timestamp when the action stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
36
|
+
*/
|
|
37
|
+
stopAction(type: string, name: string, context: Object, timestampMs: number): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Add a RUM Action.
|
|
40
|
+
* @param type: The action type (tap, scroll, swipe, back, custom).
|
|
41
|
+
* @param name: The action name.
|
|
42
|
+
* @param context: The additional context to send.
|
|
43
|
+
* @param timestampMs: The timestamp when the action occurred (in milliseconds). If not provided, current timestamp will be used.
|
|
44
|
+
*/
|
|
45
|
+
addAction(type: string, name: string, context: Object, timestampMs: number): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Start tracking a RUM Resource.
|
|
48
|
+
* @param key: The resource unique key identifier.
|
|
49
|
+
* @param method: The resource method (GET, POST, …).
|
|
50
|
+
* @param url: The resource url.
|
|
51
|
+
* @param context: The additional context to send.
|
|
52
|
+
* @param timestampMs: The timestamp when the resource started (in milliseconds). If not provided, current timestamp will be used.
|
|
53
|
+
*/
|
|
54
|
+
startResource(key: string, method: string, url: string, context: Object, timestampMs: number): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Stop tracking a RUM Resource.
|
|
57
|
+
* @param key: The resource unique key identifier.
|
|
58
|
+
* @param statusCode: The resource status code.
|
|
59
|
+
* @param kind: The resource's kind (xhr, document, image, css, font, …).
|
|
60
|
+
* @param size: The resource size in bytes. If size is unknown, use -1.
|
|
61
|
+
* @param context: The additional context to send.
|
|
62
|
+
* @param timestampMs: The timestamp when the resource stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
63
|
+
*/
|
|
64
|
+
stopResource(key: string, statusCode: number, kind: string, size: number, context: Object, timestampMs: number): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* Add a RUM Error.
|
|
67
|
+
* @param message: The error message.
|
|
68
|
+
* @param source: The error source (network, source, console, webview, custom).
|
|
69
|
+
* @param stacktrace: The error stacktrace.
|
|
70
|
+
* @param context: The additional context to send.
|
|
71
|
+
* @param timestampMs: The timestamp when the error occurred (in milliseconds). If not provided, current timestamp will be used.
|
|
72
|
+
*/
|
|
73
|
+
addError(message: string, source: string, stacktrace: string, context: Object, timestampMs: number): Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* 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.
|
|
76
|
+
* @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.
|
|
77
|
+
*/
|
|
78
|
+
addTiming(name: string): Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Stops the current RUM Session.
|
|
81
|
+
*/
|
|
82
|
+
stopSession(): Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* Adds the result of evaluating a feature flag with a given name and value to the view.
|
|
85
|
+
* Feature flag evaluations are local to the active view and are cleared when the view is stopped.
|
|
86
|
+
* @param name: The name of the feature flag
|
|
87
|
+
* @param value: The value of the feature flag, encapsulated in an Object to accept all types
|
|
88
|
+
*/
|
|
89
|
+
addFeatureFlagEvaluation(name: string, value: Object): Promise<void>;
|
|
90
|
+
}
|
|
91
|
+
declare const _default: Spec | null;
|
|
92
|
+
export default _default;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Do not import this Spec directly, use DdNativeSdkType instead.
|
|
4
|
+
*/
|
|
5
|
+
export interface Spec extends TurboModule {
|
|
6
|
+
readonly getConstants: () => {};
|
|
7
|
+
/**
|
|
8
|
+
* Initializes Datadog's features.
|
|
9
|
+
* @param configuration: The configuration to use.
|
|
10
|
+
*/
|
|
11
|
+
initialize(configuration: Object): Promise<void>;
|
|
12
|
+
/**
|
|
13
|
+
* Sets the global context (set of attributes) attached with all future Logs, Spans and RUM events.
|
|
14
|
+
* @param attributes: The global context attributes.
|
|
15
|
+
*/
|
|
16
|
+
setAttributes(attributes: Object): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Set the user information.
|
|
19
|
+
* @param user: The user object (use builtin attributes: 'id', 'email', 'name', and/or any custom attribute).
|
|
20
|
+
*/
|
|
21
|
+
setUser(user: Object): Promise<Object>;
|
|
22
|
+
/**
|
|
23
|
+
* Set the tracking consent regarding the data collection.
|
|
24
|
+
* @param trackingConsent: Consent, which can take one of the following values: 'pending', 'granted', 'not_granted'.
|
|
25
|
+
*/
|
|
26
|
+
setTrackingConsent(trackingConsent: string): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Sends internal telemetry debug message
|
|
29
|
+
* @param message debug message
|
|
30
|
+
*/
|
|
31
|
+
telemetryDebug(message: string): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Sends internal telemetry error
|
|
34
|
+
* @param message error message
|
|
35
|
+
* @param stack error stack
|
|
36
|
+
* @param kind error kind
|
|
37
|
+
*/
|
|
38
|
+
telemetryError(message: string, stack: string, kind: string): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Send webview telemetry logs
|
|
41
|
+
* @param message event description
|
|
42
|
+
*/
|
|
43
|
+
consumeWebviewEvent(message: string): Promise<void>;
|
|
44
|
+
}
|
|
45
|
+
declare const _default: Spec | null;
|
|
46
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Do not import this Spec directly, use DdNativeTraceType instead.
|
|
4
|
+
*/
|
|
5
|
+
export interface Spec extends TurboModule {
|
|
6
|
+
readonly getConstants: () => {};
|
|
7
|
+
/**
|
|
8
|
+
* Start a span, and returns a unique identifier for the span.
|
|
9
|
+
* @param operation: The operation name of the span.
|
|
10
|
+
* @param context: The additional context to send.
|
|
11
|
+
* @param timestampMs: The timestamp when the operation started (in milliseconds). If not provided, current timestamp will be used.
|
|
12
|
+
*/
|
|
13
|
+
startSpan(operation: string, context: Object, timestampMs: number): Promise<string>;
|
|
14
|
+
/**
|
|
15
|
+
* Finish a started span.
|
|
16
|
+
* @param spanId: The unique identifier of the span.
|
|
17
|
+
* @param context: The additional context to send.
|
|
18
|
+
* @param timestampMs: The timestamp when the operation stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
19
|
+
*/
|
|
20
|
+
finishSpan(spanId: string, context: Object, timestampMs: number): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
declare const _default: Spec | null;
|
|
23
|
+
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.
|
|
1
|
+
export declare const version = "1.8.0-rc1";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datadog/mobile-react-native-code-push",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0-rc1",
|
|
4
4
|
"description": "A client-side React Native module to interact with Appcenter Codepush and Datadog",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"datadog",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"license": "Apache-2.0",
|
|
23
23
|
"main": "lib/commonjs/index",
|
|
24
24
|
"files": [
|
|
25
|
-
"src",
|
|
26
|
-
"lib"
|
|
25
|
+
"src/**",
|
|
26
|
+
"lib/**"
|
|
27
27
|
],
|
|
28
28
|
"types": "lib/typescript/codepush/src/index.d.ts",
|
|
29
29
|
"react-native": "src/index",
|
|
@@ -38,8 +38,9 @@
|
|
|
38
38
|
"prepare": "rm -rf lib && yarn bob build"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@datadog/mobile-react-native": "^1.
|
|
41
|
+
"@datadog/mobile-react-native": "^1.8.0-rc1",
|
|
42
42
|
"@testing-library/react-native": "7.0.2",
|
|
43
|
+
"react-native-builder-bob": "0.17.1",
|
|
43
44
|
"react-native-code-push": "7.0.5"
|
|
44
45
|
},
|
|
45
46
|
"peerDependencies": {
|
|
@@ -72,5 +73,5 @@
|
|
|
72
73
|
]
|
|
73
74
|
]
|
|
74
75
|
},
|
|
75
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "4fd80f04ddfde8becbe3a76fb94f3122091f0107"
|
|
76
77
|
}
|