@datadog/mobile-react-native 1.0.0-rc3 → 1.0.0-rc6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DatadogSDKReactNative.podspec +1 -1
- package/README.md +47 -16
- package/android/build.gradle +2 -3
- package/android/gradle.properties +4 -4
- package/android/src/main/java/com/datadog/reactnative/DdRum.kt +25 -24
- package/android/src/main/java/com/datadog/reactnative/DdTrace.kt +6 -6
- package/ios/Sources/DdRum.m +10 -9
- package/ios/Sources/DdRum.swift +24 -24
- package/ios/Sources/DdTrace.m +2 -2
- package/ios/Sources/DdTrace.swift +6 -6
- package/lib/commonjs/DdSdkReactNative.js +42 -22
- package/lib/commonjs/DdSdkReactNative.js.map +1 -1
- package/lib/commonjs/DdSdkReactNativeConfiguration.js +17 -2
- package/lib/commonjs/DdSdkReactNativeConfiguration.js.map +1 -1
- package/lib/commonjs/InternalLog.js +51 -0
- package/lib/commonjs/InternalLog.js.map +1 -0
- package/lib/commonjs/ProxyConfiguration.js.map +1 -1
- package/lib/commonjs/SdkVerbosity.js +26 -0
- package/lib/commonjs/SdkVerbosity.js.map +1 -0
- package/lib/commonjs/TimeProvider.js +72 -0
- package/lib/commonjs/TimeProvider.js.map +1 -0
- package/lib/commonjs/Timer.js +10 -23
- package/lib/commonjs/Timer.js.map +1 -1
- package/lib/commonjs/TrackingConsent.js.map +1 -1
- package/lib/commonjs/foundation.js +62 -40
- package/lib/commonjs/foundation.js.map +1 -1
- package/lib/commonjs/index.js +26 -18
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/internal.js +14 -0
- package/lib/commonjs/internal.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/DdEventsInterceptor.js +14 -5
- package/lib/commonjs/rum/instrumentation/DdEventsInterceptor.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js +51 -20
- package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/DdRumResourceTracking.js +141 -30
- package/lib/commonjs/rum/instrumentation/DdRumResourceTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/DdRumUserInteractionTracking.js +46 -7
- package/lib/commonjs/rum/instrumentation/DdRumUserInteractionTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/NoOpEventsInterceptor.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/ShallowObjectEqualityChecker.js +34 -0
- package/lib/commonjs/rum/instrumentation/ShallowObjectEqualityChecker.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/TraceIdentifier.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/version.js +10 -0
- package/lib/commonjs/version.js.map +1 -0
- package/lib/module/DdSdkReactNative.js +34 -22
- package/lib/module/DdSdkReactNative.js.map +1 -1
- package/lib/module/DdSdkReactNativeConfiguration.js +18 -3
- package/lib/module/DdSdkReactNativeConfiguration.js.map +1 -1
- package/lib/module/InternalLog.js +46 -0
- package/lib/module/InternalLog.js.map +1 -0
- package/lib/module/ProxyConfiguration.js.map +1 -1
- package/lib/module/SdkVerbosity.js +18 -0
- package/lib/module/SdkVerbosity.js.map +1 -0
- package/lib/module/TimeProvider.js +63 -0
- package/lib/module/TimeProvider.js.map +1 -0
- package/lib/module/Timer.js +14 -23
- package/lib/module/Timer.js.map +1 -1
- package/lib/module/TrackingConsent.js.map +1 -1
- package/lib/module/foundation.js +42 -40
- package/lib/module/foundation.js.map +1 -1
- package/lib/module/index.js +3 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/internal.js +2 -0
- package/lib/module/internal.js.map +1 -0
- package/lib/module/rum/instrumentation/DdEventsInterceptor.js +11 -5
- package/lib/module/rum/instrumentation/DdEventsInterceptor.js.map +1 -1
- package/lib/module/rum/instrumentation/DdRumErrorTracking.js +46 -20
- package/lib/module/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/DdRumResourceTracking.js +133 -29
- package/lib/module/rum/instrumentation/DdRumResourceTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/DdRumUserInteractionTracking.js +41 -6
- package/lib/module/rum/instrumentation/DdRumUserInteractionTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/NoOpEventsInterceptor.js.map +1 -1
- package/lib/module/rum/instrumentation/ShallowObjectEqualityChecker.js +25 -0
- package/lib/module/rum/instrumentation/ShallowObjectEqualityChecker.js.map +1 -0
- package/lib/module/rum/instrumentation/TraceIdentifier.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/version.js +3 -0
- package/lib/module/version.js.map +1 -0
- package/lib/typescript/DdSdkReactNative.d.ts +7 -6
- package/lib/typescript/DdSdkReactNativeConfiguration.d.ts +15 -4
- package/lib/typescript/InternalLog.d.ts +6 -0
- package/lib/typescript/SdkVerbosity.d.ts +9 -0
- package/lib/typescript/TimeProvider.d.ts +20 -0
- package/lib/typescript/Timer.d.ts +3 -2
- package/lib/typescript/index.d.ts +3 -2
- package/lib/typescript/internal.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/DdEventsInterceptor.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/DdRumErrorTracking.d.ts +3 -2
- package/lib/typescript/rum/instrumentation/DdRumResourceTracking.d.ts +13 -8
- package/lib/typescript/rum/instrumentation/DdRumUserInteractionTracking.d.ts +3 -3
- package/lib/typescript/rum/instrumentation/DdRumXhr.d.ts +13 -3
- package/lib/typescript/rum/instrumentation/ShallowObjectEqualityChecker.d.ts +4 -0
- package/lib/typescript/types.d.ts +12 -11
- package/lib/typescript/version.d.ts +1 -0
- package/package.json +7 -4
- package/src/DdSdkReactNative.tsx +112 -58
- package/src/DdSdkReactNativeConfiguration.tsx +22 -14
- package/src/InternalLog.tsx +45 -0
- package/src/ProxyConfiguration.tsx +5 -5
- package/src/{NativeSdkVerbosity.tsx → SdkVerbosity.tsx} +6 -6
- package/src/TimeProvider.tsx +64 -0
- package/src/Timer.ts +20 -35
- package/src/TrackingConsent.tsx +3 -3
- package/src/__mocks__/InternalLog.tsx +9 -0
- package/src/__tests__/DdRumWrapper.test.tsx +98 -0
- package/src/__tests__/DdSdkReactNative.test.tsx +699 -500
- package/src/__tests__/InternalLog.test.tsx +379 -0
- package/src/__tests__/TimeProvider.test.tsx +75 -0
- package/src/__tests__/Timer.test.ts +148 -57
- package/src/__tests__/rum/instrumentation/DdEventsInterceptor.test.tsx +151 -92
- package/src/__tests__/rum/instrumentation/DdRumErrorTracking.test.tsx +243 -76
- package/src/__tests__/rum/instrumentation/DdRumResourceTracking.test.tsx +723 -403
- package/src/__tests__/rum/instrumentation/DdRumUserInteractionTracking.test.tsx +239 -85
- package/src/__tests__/rum/instrumentation/ShallowObjectEqualityChecker.test.ts +31 -0
- package/src/__tests__/rum/instrumentation/TraceIdentifier.test.tsx +13 -15
- package/src/__tests__/rum/instrumentation/__utils__/XMLHttpRequestMock.ts +97 -0
- package/src/foundation.tsx +55 -42
- package/src/index.tsx +13 -3
- package/src/internal.tsx +1 -0
- package/src/rum/instrumentation/DdEventsInterceptor.tsx +51 -35
- package/src/rum/instrumentation/DdRumErrorTracking.tsx +75 -42
- package/src/rum/instrumentation/DdRumResourceTracking.tsx +312 -166
- package/src/rum/instrumentation/DdRumUserInteractionTracking.tsx +72 -25
- package/src/rum/instrumentation/DdRumXhr.tsx +21 -11
- package/src/rum/instrumentation/EventsInterceptor.tsx +3 -3
- package/src/rum/instrumentation/NoOpEventsInterceptor.tsx +2 -2
- package/src/rum/instrumentation/ShallowObjectEqualityChecker.ts +24 -0
- package/src/rum/instrumentation/TraceIdentifier.tsx +19 -19
- package/src/types.tsx +199 -157
- package/src/version.ts +2 -0
- package/lib/commonjs/NativeSdkVerbosity.js +0 -26
- package/lib/commonjs/NativeSdkVerbosity.js.map +0 -1
- package/lib/module/NativeSdkVerbosity.js +0 -18
- package/lib/module/NativeSdkVerbosity.js.map +0 -1
- package/lib/typescript/NativeSdkVerbosity.d.ts +0 -9
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
4
4
|
* Copyright 2016-Present Datadog, Inc.
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
export default interface EventsInterceptor {
|
|
8
|
-
interceptOnPress(...args: any[]): void
|
|
9
|
-
}
|
|
8
|
+
interceptOnPress(...args: any[]): void;
|
|
9
|
+
}
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
* Copyright 2016-Present Datadog, Inc.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import type EventsInterceptor from './EventsInterceptor'
|
|
7
|
+
import type EventsInterceptor from './EventsInterceptor';
|
|
8
8
|
|
|
9
9
|
export default class NoOpEventsInterceptor implements EventsInterceptor {
|
|
10
10
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11
11
|
interceptOnPress(..._args: any[]): void {
|
|
12
12
|
// NoOp
|
|
13
13
|
}
|
|
14
|
-
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
3
|
+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
4
|
+
* Copyright 2016-Present Datadog, Inc.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Does a shallow comparison between 2 objects
|
|
9
|
+
*/
|
|
10
|
+
export const areObjectShallowEqual = (
|
|
11
|
+
objectA: Record<string, unknown>,
|
|
12
|
+
objectB: Record<string, unknown>
|
|
13
|
+
): boolean => {
|
|
14
|
+
const keys = Object.keys(objectA);
|
|
15
|
+
if (keys.length !== Object.keys(objectB).length) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
for (const key of keys) {
|
|
19
|
+
if (objectA[key] !== objectB[key]) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return true;
|
|
24
|
+
};
|
|
@@ -9,26 +9,26 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
export function generateTraceId(): string {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
const radix = 10;
|
|
13
|
+
const MAX_32_BITS_NUMBER = 4294967295; // 2^32-1
|
|
14
|
+
let low: number = Math.floor(Math.random() * MAX_32_BITS_NUMBER);
|
|
15
|
+
let high: number = Math.floor(Math.random() * MAX_32_BITS_NUMBER);
|
|
16
|
+
let str = '';
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
while (high > 0 && low > 0) {
|
|
19
|
+
// Create an intermediate value with the same modulo as the combined high and low value
|
|
20
|
+
// but requiring 36 bits max (32 for the low value + 4 for the high part)
|
|
21
|
+
const modH = high % radix;
|
|
22
|
+
const temp = (modH << 32) + low;
|
|
23
|
+
const digit = temp % radix;
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
// update the high value
|
|
26
|
+
high = (high - modH) / radix; // we reuse the modH to avoid the need of a floor op
|
|
27
|
+
// the low value reuses the previous temp value to account for the "missing mod" in the high update
|
|
28
|
+
low = (temp - digit) / radix; // we reuse the digit to avoid the need of a floor op
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
// update the string from right to left
|
|
31
|
+
str = digit.toString() + str;
|
|
32
|
+
}
|
|
33
|
+
return str;
|
|
34
34
|
}
|
package/src/types.tsx
CHANGED
|
@@ -8,185 +8,227 @@
|
|
|
8
8
|
* A configuration object to initialize Datadog's features.
|
|
9
9
|
*/
|
|
10
10
|
export class DdSdkConfiguration {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
constructor(
|
|
12
|
+
readonly clientToken: string,
|
|
13
|
+
readonly env: string,
|
|
14
|
+
readonly applicationId: string,
|
|
15
|
+
readonly nativeCrashReportEnabled: boolean,
|
|
16
|
+
readonly sampleRate: number,
|
|
17
|
+
readonly site: string,
|
|
18
|
+
readonly trackingConsent: string,
|
|
19
|
+
readonly additionalConfig: object
|
|
20
|
+
) {}
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* The entry point to initialize Datadog's features.
|
|
25
25
|
*/
|
|
26
26
|
export type DdSdkType = {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Initializes Datadog's features.
|
|
29
|
+
* @param configuration: The configuration to use.
|
|
30
|
+
*/
|
|
31
|
+
initialize(configuration: DdSdkConfiguration): Promise<void>;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Sets the global context (set of attributes) attached with all future Logs, Spans and RUM events.
|
|
35
|
+
* @param attributes: The global context attributes.
|
|
36
|
+
*/
|
|
37
|
+
setAttributes(attributes: object): Promise<void>;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Set the user information.
|
|
41
|
+
* @param user: The user object (use builtin attributes: 'id', 'email', 'name', and/or any custom attribute).
|
|
42
|
+
*/
|
|
43
|
+
setUser(user: object): Promise<void>;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Set the tracking consent regarding the data collection.
|
|
47
|
+
* @param trackingConsent: Consent, which can take one of the following values: 'pending', 'granted', 'not_granted'.
|
|
48
|
+
*/
|
|
49
|
+
setTrackingConsent(trackingConsent: string): Promise<void>;
|
|
51
50
|
};
|
|
52
51
|
|
|
53
52
|
/**
|
|
54
53
|
* The entry point to use Datadog's Logs feature.
|
|
55
54
|
*/
|
|
56
55
|
export type DdLogsType = {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Send a log with level debug.
|
|
58
|
+
* @param message: The message to send.
|
|
59
|
+
* @param context: The additional context to send.
|
|
60
|
+
*/
|
|
61
|
+
debug(message: string, context?: object): Promise<void>;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Send a log with level info.
|
|
65
|
+
* @param message: The message to send.
|
|
66
|
+
* @param context: The additional context to send.
|
|
67
|
+
*/
|
|
68
|
+
info(message: string, context?: object): Promise<void>;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Send a log with level warn.
|
|
72
|
+
* @param message: The message to send.
|
|
73
|
+
* @param context: The additional context to send.
|
|
74
|
+
*/
|
|
75
|
+
warn(message: string, context?: object): Promise<void>;
|
|
76
|
+
|
|
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>;
|
|
85
83
|
};
|
|
86
84
|
|
|
87
85
|
/**
|
|
88
86
|
* The entry point to use Datadog's Trace feature.
|
|
89
87
|
*/
|
|
90
88
|
export type DdTraceType = {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
89
|
+
/**
|
|
90
|
+
* Start a span, and returns a unique identifier for the span.
|
|
91
|
+
* @param operation: The operation name of the span.
|
|
92
|
+
* @param context: The additional context to send.
|
|
93
|
+
* @param timestampMs: The timestamp when the operation started (in milliseconds). If not provided, current timestamp will be used.
|
|
94
|
+
*/
|
|
95
|
+
startSpan(
|
|
96
|
+
operation: string,
|
|
97
|
+
context?: object,
|
|
98
|
+
timestampMs?: number
|
|
99
|
+
): Promise<string>;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Finish a started span.
|
|
103
|
+
* @param spanId: The unique identifier of the span.
|
|
104
|
+
* @param context: The additional context to send.
|
|
105
|
+
* @param timestampMs: The timestamp when the operation stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
106
|
+
*/
|
|
107
|
+
finishSpan(
|
|
108
|
+
spanId: string,
|
|
109
|
+
context?: object,
|
|
110
|
+
timestampMs?: number
|
|
111
|
+
): Promise<void>;
|
|
107
112
|
};
|
|
108
113
|
|
|
109
114
|
/**
|
|
110
115
|
* The entry point to use Datadog's RUM feature.
|
|
111
116
|
*/
|
|
112
117
|
export type DdRumType = {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
118
|
+
/**
|
|
119
|
+
* Start tracking a RUM View.
|
|
120
|
+
* @param key: The view unique key identifier.
|
|
121
|
+
* @param name: The view name.
|
|
122
|
+
* @param context: The additional context to send.
|
|
123
|
+
* @param timestampMs: The timestamp when the view started (in milliseconds). If not provided, current timestamp will be used.
|
|
124
|
+
*/
|
|
125
|
+
startView(
|
|
126
|
+
key: string,
|
|
127
|
+
name: string,
|
|
128
|
+
context?: object,
|
|
129
|
+
timestampMs?: number
|
|
130
|
+
): Promise<void>;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Stop tracking a RUM View.
|
|
134
|
+
* @param key: The view unique key identifier.
|
|
135
|
+
* @param context: The additional context to send.
|
|
136
|
+
* @param timestampMs: The timestamp when the view stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
137
|
+
*/
|
|
138
|
+
stopView(
|
|
139
|
+
key: string,
|
|
140
|
+
context?: object,
|
|
141
|
+
timestampMs?: number
|
|
142
|
+
): Promise<void>;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Start tracking a RUM Action.
|
|
146
|
+
* @param type: The action type (tap, scroll, swipe, click, custom).
|
|
147
|
+
* @param name: The action name.
|
|
148
|
+
* @param context: The additional context to send.
|
|
149
|
+
* @param timestampMs: The timestamp when the action started (in milliseconds). If not provided, current timestamp will be used.
|
|
150
|
+
*/
|
|
151
|
+
startAction(
|
|
152
|
+
type: string,
|
|
153
|
+
name: string,
|
|
154
|
+
context?: object,
|
|
155
|
+
timestampMs?: number
|
|
156
|
+
): Promise<void>;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Stop tracking the ongoing RUM Action.
|
|
160
|
+
* @param context: The additional context to send.
|
|
161
|
+
* @param timestampMs: The timestamp when the action stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
162
|
+
*/
|
|
163
|
+
stopAction(context?: object, timestampMs?: number): Promise<void>;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Add a RUM Action.
|
|
167
|
+
* @param type: The action type (tap, scroll, swipe, click, custom).
|
|
168
|
+
* @param name: The action name.
|
|
169
|
+
* @param context: The additional context to send.
|
|
170
|
+
* @param timestampMs: The timestamp when the action occurred (in milliseconds). If not provided, current timestamp will be used.
|
|
171
|
+
*/
|
|
172
|
+
addAction(
|
|
173
|
+
type: string,
|
|
174
|
+
name: string,
|
|
175
|
+
context?: object,
|
|
176
|
+
timestampMs?: number
|
|
177
|
+
): Promise<void>;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Start tracking a RUM Resource.
|
|
181
|
+
* @param key: The resource unique key identifier.
|
|
182
|
+
* @param method: The resource method (GET, POST, …).
|
|
183
|
+
* @param url: The resource url.
|
|
184
|
+
* @param context: The additional context to send.
|
|
185
|
+
* @param timestampMs: The timestamp when the resource started (in milliseconds). If not provided, current timestamp will be used.
|
|
186
|
+
*/
|
|
187
|
+
startResource(
|
|
188
|
+
key: string,
|
|
189
|
+
method: string,
|
|
190
|
+
url: string,
|
|
191
|
+
context?: object,
|
|
192
|
+
timestampMs?: number
|
|
193
|
+
): Promise<void>;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Stop tracking a RUM Resource.
|
|
197
|
+
* @param key: The resource unique key identifier.
|
|
198
|
+
* @param statusCode: The resource status code.
|
|
199
|
+
* @param kind: The resource's kind (xhr, document, image, css, font, …).
|
|
200
|
+
* @param size: The resource size in bytes. If size is unknown, use -1.
|
|
201
|
+
* @param context: The additional context to send.
|
|
202
|
+
* @param timestampMs: The timestamp when the resource stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
203
|
+
*/
|
|
204
|
+
stopResource(
|
|
205
|
+
key: string,
|
|
206
|
+
statusCode: number,
|
|
207
|
+
kind: string,
|
|
208
|
+
size?: number,
|
|
209
|
+
context?: object,
|
|
210
|
+
timestampMs?: number
|
|
211
|
+
): Promise<void>;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Add a RUM Error.
|
|
215
|
+
* @param message: The error message.
|
|
216
|
+
* @param source: The error source (network, source, console, logger, …).
|
|
217
|
+
* @param stacktrace: The error stacktrace.
|
|
218
|
+
* @param context: The additional context to send.
|
|
219
|
+
* @param timestampMs: The timestamp when the error occurred (in milliseconds). If not provided, current timestamp will be used.
|
|
220
|
+
*/
|
|
221
|
+
addError(
|
|
222
|
+
message: string,
|
|
223
|
+
source: string,
|
|
224
|
+
stacktrace: string,
|
|
225
|
+
context?: object,
|
|
226
|
+
timestampMs?: number
|
|
227
|
+
): Promise<void>;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* 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.
|
|
231
|
+
* @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.
|
|
232
|
+
*/
|
|
233
|
+
addTiming(name: string): Promise<void>;
|
|
191
234
|
};
|
|
192
|
-
|
package/src/version.ts
ADDED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.NativeSdkVerbosity = void 0;
|
|
7
|
-
|
|
8
|
-
/*
|
|
9
|
-
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
10
|
-
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
11
|
-
* Copyright 2016-Present Datadog, Inc.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Enum specifying possible consent options for DD SDK.
|
|
16
|
-
*/
|
|
17
|
-
let NativeSdkVerbosity;
|
|
18
|
-
exports.NativeSdkVerbosity = NativeSdkVerbosity;
|
|
19
|
-
|
|
20
|
-
(function (NativeSdkVerbosity) {
|
|
21
|
-
NativeSdkVerbosity["DEBUG"] = "debug";
|
|
22
|
-
NativeSdkVerbosity["INFO"] = "info";
|
|
23
|
-
NativeSdkVerbosity["WARN"] = "warn";
|
|
24
|
-
NativeSdkVerbosity["ERROR"] = "error";
|
|
25
|
-
})(NativeSdkVerbosity || (exports.NativeSdkVerbosity = NativeSdkVerbosity = {}));
|
|
26
|
-
//# sourceMappingURL=NativeSdkVerbosity.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["NativeSdkVerbosity.tsx"],"names":["NativeSdkVerbosity"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;IACYA,kB;;;WAAAA,kB;AAAAA,EAAAA,kB;AAAAA,EAAAA,kB;AAAAA,EAAAA,kB;AAAAA,EAAAA,kB;GAAAA,kB,kCAAAA,kB","sourcesContent":["/*\n * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.\n * This product includes software developed at Datadog (https://www.datadoghq.com/).\n * Copyright 2016-Present Datadog, Inc.\n */\n\n/**\n * Enum specifying possible consent options for DD SDK.\n */\nexport enum NativeSdkVerbosity {\n DEBUG = \"debug\",\n INFO = \"info\",\n WARN = \"warn\",\n ERROR = \"error\"\n}\n"]}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
3
|
-
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
4
|
-
* Copyright 2016-Present Datadog, Inc.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Enum specifying possible consent options for DD SDK.
|
|
9
|
-
*/
|
|
10
|
-
export let NativeSdkVerbosity;
|
|
11
|
-
|
|
12
|
-
(function (NativeSdkVerbosity) {
|
|
13
|
-
NativeSdkVerbosity["DEBUG"] = "debug";
|
|
14
|
-
NativeSdkVerbosity["INFO"] = "info";
|
|
15
|
-
NativeSdkVerbosity["WARN"] = "warn";
|
|
16
|
-
NativeSdkVerbosity["ERROR"] = "error";
|
|
17
|
-
})(NativeSdkVerbosity || (NativeSdkVerbosity = {}));
|
|
18
|
-
//# sourceMappingURL=NativeSdkVerbosity.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["NativeSdkVerbosity.tsx"],"names":["NativeSdkVerbosity"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAYA,kBAAZ;;WAAYA,kB;AAAAA,EAAAA,kB;AAAAA,EAAAA,kB;AAAAA,EAAAA,kB;AAAAA,EAAAA,kB;GAAAA,kB,KAAAA,kB","sourcesContent":["/*\n * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.\n * This product includes software developed at Datadog (https://www.datadoghq.com/).\n * Copyright 2016-Present Datadog, Inc.\n */\n\n/**\n * Enum specifying possible consent options for DD SDK.\n */\nexport enum NativeSdkVerbosity {\n DEBUG = \"debug\",\n INFO = \"info\",\n WARN = \"warn\",\n ERROR = \"error\"\n}\n"]}
|