@datadog/mobile-react-native 2.3.2 → 2.3.3
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 -0
- package/android/build.gradle +2 -0
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkBridgeExt.kt +13 -2
- package/android/src/main/kotlin/com/datadog/reactnative/SdkVersion.kt +1 -1
- package/android/src/newarch/kotlin/com/datadog/reactnative/DdLogs.kt +3 -2
- package/android/src/newarch/kotlin/com/datadog/reactnative/DdRum.kt +28 -13
- package/android/src/newarch/kotlin/com/datadog/reactnative/DdSdk.kt +3 -2
- package/android/src/newarch/kotlin/com/datadog/reactnative/DdTrace.kt +4 -2
- package/android/src/oldarch/kotlin/com/datadog/reactnative/DdLogs.kt +1 -1
- package/android/src/oldarch/kotlin/com/datadog/reactnative/DdRum.kt +3 -2
- package/android/src/oldarch/kotlin/com/datadog/reactnative/DdTrace.kt +4 -2
- package/ios/Sources/SdkVersion.swift +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/DdSdkReactNativeConfiguration.d.ts +7 -7
- package/lib/typescript/logs/types.d.ts +10 -10
- package/lib/typescript/nativeModulesTypes.d.ts +5 -5
- package/lib/typescript/rum/eventMappers/actionEventMapper.d.ts +4 -4
- package/lib/typescript/rum/eventMappers/errorEventMapper.d.ts +4 -4
- package/lib/typescript/rum/eventMappers/resourceEventMapper.d.ts +4 -4
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/distributedTracing.d.ts +3 -3
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.d.ts +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/ResourceReporter.d.ts +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.d.ts +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts +1 -1
- package/lib/typescript/rum/types.d.ts +3 -3
- package/lib/typescript/sdk/AttributesSingleton/types.d.ts +1 -1
- package/lib/typescript/sdk/DatadogProvider/DatadogProvider.d.ts +2 -2
- package/lib/typescript/sdk/EventMappers/EventMapper.d.ts +1 -1
- package/lib/typescript/sdk/UserInfoSingleton/types.d.ts +1 -1
- package/lib/typescript/types.d.ts +2 -2
- package/lib/typescript/utils/TimeProvider.d.ts +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/sdk/DatadogProvider/__tests__/initialization.test.tsx +1 -1
- package/src/version.ts +1 -1
package/android/build.gradle
CHANGED
|
@@ -18,6 +18,8 @@ buildscript {
|
|
|
18
18
|
classpath "org.jlleitschuh.gradle:ktlint-gradle:11.5.1"
|
|
19
19
|
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.18.0"
|
|
20
20
|
classpath 'com.github.bjoernq:unmockplugin:0.7.9'
|
|
21
|
+
// Uncomment here and in settings.gradle for getting rid of IDE errors for new architecture:
|
|
22
|
+
// classpath "com.facebook.react:react-native-gradle-plugin"
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
package com.datadog.reactnative
|
|
8
8
|
|
|
9
9
|
import android.util.Log
|
|
10
|
+
import com.facebook.react.bridge.Arguments
|
|
10
11
|
import com.facebook.react.bridge.ReadableArray
|
|
11
12
|
import com.facebook.react.bridge.ReadableMap
|
|
12
13
|
import com.facebook.react.bridge.ReadableType
|
|
@@ -186,8 +187,18 @@ internal fun ReadableArray.toList(): List<*> {
|
|
|
186
187
|
ReadableType.Boolean -> list.add(getBoolean(i))
|
|
187
188
|
ReadableType.Number -> list.add(getDouble(i))
|
|
188
189
|
ReadableType.String -> list.add(getString(i))
|
|
189
|
-
ReadableType.Map ->
|
|
190
|
-
|
|
190
|
+
ReadableType.Map -> {
|
|
191
|
+
// getMap() return type is nullable in previous RN versions
|
|
192
|
+
@Suppress("USELESS_ELVIS")
|
|
193
|
+
val readableMap = getMap(i) ?: Arguments.createMap()
|
|
194
|
+
list.add(readableMap.toMap())
|
|
195
|
+
}
|
|
196
|
+
ReadableType.Array -> {
|
|
197
|
+
// getArray() return type is nullable in previous RN versions
|
|
198
|
+
@Suppress("USELESS_ELVIS")
|
|
199
|
+
val readableArray = getArray(i) ?: Arguments.createArray()
|
|
200
|
+
list.add(readableArray.toList())
|
|
201
|
+
}
|
|
191
202
|
else -> Log.e(
|
|
192
203
|
javaClass.simpleName,
|
|
193
204
|
"toList(): Unhandled ReadableType: ${type.name}."
|
|
@@ -15,10 +15,11 @@ import com.facebook.react.bridge.ReadableMap
|
|
|
15
15
|
* The entry point to use Datadog's Logs feature.
|
|
16
16
|
*/
|
|
17
17
|
class DdLogs(
|
|
18
|
-
reactContext: ReactApplicationContext
|
|
18
|
+
reactContext: ReactApplicationContext,
|
|
19
|
+
datadogWrapper: DatadogWrapper = DatadogSDKWrapper()
|
|
19
20
|
) : NativeDdLogsSpec(reactContext) {
|
|
20
21
|
|
|
21
|
-
private val implementation = DdLogsImplementation()
|
|
22
|
+
private val implementation = DdLogsImplementation(datadog = datadogWrapper)
|
|
22
23
|
|
|
23
24
|
override fun getName(): String = DdLogsImplementation.NAME
|
|
24
25
|
|
|
@@ -15,9 +15,12 @@ import com.facebook.react.bridge.ReadableMap
|
|
|
15
15
|
* The entry point to use Datadog's RUM feature.
|
|
16
16
|
*/
|
|
17
17
|
@Suppress("TooManyFunctions")
|
|
18
|
-
class DdRum(
|
|
18
|
+
class DdRum(
|
|
19
|
+
reactContext: ReactApplicationContext,
|
|
20
|
+
datadogWrapper: DatadogWrapper = DatadogSDKWrapper()
|
|
21
|
+
) : NativeDdRumSpec(reactContext) {
|
|
19
22
|
|
|
20
|
-
private val implementation = DdRumImplementation()
|
|
23
|
+
private val implementation = DdRumImplementation(datadog = datadogWrapper)
|
|
21
24
|
|
|
22
25
|
override fun getName(): String = DdRumImplementation.NAME
|
|
23
26
|
|
|
@@ -26,7 +29,8 @@ class DdRum(reactContext: ReactApplicationContext) : NativeDdRumSpec(reactContex
|
|
|
26
29
|
* @param key The view unique key identifier.
|
|
27
30
|
* @param name The view name.
|
|
28
31
|
* @param context The additional context to send.
|
|
29
|
-
* @param timestampMs The timestamp when the view started (in milliseconds). If not provided,
|
|
32
|
+
* @param timestampMs The timestamp when the view started (in milliseconds). If not provided,
|
|
33
|
+
* current timestamp will be used.
|
|
30
34
|
*/
|
|
31
35
|
@ReactMethod
|
|
32
36
|
override fun startView(
|
|
@@ -43,7 +47,8 @@ class DdRum(reactContext: ReactApplicationContext) : NativeDdRumSpec(reactContex
|
|
|
43
47
|
* Stop tracking a RUM View.
|
|
44
48
|
* @param key The view unique key identifier.
|
|
45
49
|
* @param context The additional context to send.
|
|
46
|
-
* @param timestampMs The timestamp when the view stopped (in milliseconds).
|
|
50
|
+
* @param timestampMs The timestamp when the view stopped (in milliseconds).
|
|
51
|
+
* If not provided, current timestamp will be used.
|
|
47
52
|
*/
|
|
48
53
|
@ReactMethod
|
|
49
54
|
override fun stopView(key: String, context: ReadableMap, timestampMs: Double, promise: Promise) {
|
|
@@ -55,7 +60,8 @@ class DdRum(reactContext: ReactApplicationContext) : NativeDdRumSpec(reactContex
|
|
|
55
60
|
* @param type The action type (tap, scroll, swipe, click, custom).
|
|
56
61
|
* @param name The action name.
|
|
57
62
|
* @param context The additional context to send.
|
|
58
|
-
* @param timestampMs The timestamp when the action started (in milliseconds).
|
|
63
|
+
* @param timestampMs The timestamp when the action started (in milliseconds).
|
|
64
|
+
* If not provided, current timestamp will be used.
|
|
59
65
|
*/
|
|
60
66
|
@ReactMethod
|
|
61
67
|
override fun startAction(
|
|
@@ -73,7 +79,8 @@ class DdRum(reactContext: ReactApplicationContext) : NativeDdRumSpec(reactContex
|
|
|
73
79
|
* @param type The action type (tap, scroll, swipe, click, custom).
|
|
74
80
|
* @param name The action name.
|
|
75
81
|
* @param context The additional context to send.
|
|
76
|
-
* @param timestampMs The timestamp when the action stopped (in milliseconds).
|
|
82
|
+
* @param timestampMs The timestamp when the action stopped (in milliseconds).
|
|
83
|
+
* If not provided, current timestamp will be used.
|
|
77
84
|
*/
|
|
78
85
|
@ReactMethod
|
|
79
86
|
override fun stopAction(
|
|
@@ -91,7 +98,8 @@ class DdRum(reactContext: ReactApplicationContext) : NativeDdRumSpec(reactContex
|
|
|
91
98
|
* @param type The action type (tap, scroll, swipe, click, custom).
|
|
92
99
|
* @param name The action name.
|
|
93
100
|
* @param context The additional context to send.
|
|
94
|
-
* @param timestampMs The timestamp when the action occurred (in milliseconds).
|
|
101
|
+
* @param timestampMs The timestamp when the action occurred (in milliseconds).
|
|
102
|
+
* If not provided, current timestamp will be used.
|
|
95
103
|
*/
|
|
96
104
|
@ReactMethod
|
|
97
105
|
override fun addAction(
|
|
@@ -110,7 +118,8 @@ class DdRum(reactContext: ReactApplicationContext) : NativeDdRumSpec(reactContex
|
|
|
110
118
|
* @param method The resource method (GET, POST, …).
|
|
111
119
|
* @param url The resource url.
|
|
112
120
|
* @param context The additional context to send.
|
|
113
|
-
* @param timestampMs The timestamp when the resource started (in milliseconds).
|
|
121
|
+
* @param timestampMs The timestamp when the resource started (in milliseconds).
|
|
122
|
+
* If not provided, current timestamp will be used.
|
|
114
123
|
*/
|
|
115
124
|
@Suppress("LongParameterList")
|
|
116
125
|
@ReactMethod
|
|
@@ -132,7 +141,8 @@ class DdRum(reactContext: ReactApplicationContext) : NativeDdRumSpec(reactContex
|
|
|
132
141
|
* @param kind The resource's kind (xhr, document, image, css, font, …).
|
|
133
142
|
* @param size The resource size in bytes.
|
|
134
143
|
* @param context The additional context to send.
|
|
135
|
-
* @param timestampMs The timestamp when the resource stopped (in milliseconds).
|
|
144
|
+
* @param timestampMs The timestamp when the resource stopped (in milliseconds).
|
|
145
|
+
* If not provided, current timestamp will be used.
|
|
136
146
|
*/
|
|
137
147
|
@Suppress("LongParameterList")
|
|
138
148
|
@ReactMethod
|
|
@@ -154,7 +164,8 @@ class DdRum(reactContext: ReactApplicationContext) : NativeDdRumSpec(reactContex
|
|
|
154
164
|
* @param source The error source (network, source, console, logger, …).
|
|
155
165
|
* @param stacktrace The error stacktrace.
|
|
156
166
|
* @param context The additional context to send.
|
|
157
|
-
* @param timestampMs The timestamp when the error occurred (in milliseconds).
|
|
167
|
+
* @param timestampMs The timestamp when the error occurred (in milliseconds).
|
|
168
|
+
* If not provided, current timestamp will be used.
|
|
158
169
|
*/
|
|
159
170
|
@Suppress("LongParameterList")
|
|
160
171
|
@ReactMethod
|
|
@@ -170,8 +181,11 @@ class DdRum(reactContext: ReactApplicationContext) : NativeDdRumSpec(reactContex
|
|
|
170
181
|
}
|
|
171
182
|
|
|
172
183
|
/**
|
|
173
|
-
* Adds a specific timing in the active View. The timing duration will be computed as the
|
|
174
|
-
*
|
|
184
|
+
* Adds a specific timing in the active View. The timing duration will be computed as the
|
|
185
|
+
* 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.
|
|
187
|
+
* Timings can be nested up to 8 levels deep.
|
|
188
|
+
* Names using more than 8 levels will be sanitized by SDK.
|
|
175
189
|
*/
|
|
176
190
|
@ReactMethod
|
|
177
191
|
override fun addTiming(name: String, promise: Promise) {
|
|
@@ -188,7 +202,8 @@ class DdRum(reactContext: ReactApplicationContext) : NativeDdRumSpec(reactContex
|
|
|
188
202
|
|
|
189
203
|
/**
|
|
190
204
|
* Adds result of evaluating a feature flag to the view.
|
|
191
|
-
* Feature flag evaluations are local to the active view and are cleared when the view
|
|
205
|
+
* Feature flag evaluations are local to the active view and are cleared when the view
|
|
206
|
+
* is stopped.
|
|
192
207
|
* @param name The name of the feature flag
|
|
193
208
|
* @param value The value the feature flag evaluated to, encapsulated in a Map
|
|
194
209
|
*/
|
|
@@ -13,10 +13,11 @@ import com.facebook.react.bridge.ReadableMap
|
|
|
13
13
|
|
|
14
14
|
/** The entry point to initialize Datadog's features. */
|
|
15
15
|
class DdSdk(
|
|
16
|
-
reactContext: ReactApplicationContext
|
|
16
|
+
reactContext: ReactApplicationContext,
|
|
17
|
+
datadogWrapper: DatadogWrapper = DatadogSDKWrapper()
|
|
17
18
|
) : NativeDdSdkSpec(reactContext) {
|
|
18
19
|
|
|
19
|
-
private val implementation = DdSdkImplementation(reactContext)
|
|
20
|
+
private val implementation = DdSdkImplementation(reactContext, datadog = datadogWrapper)
|
|
20
21
|
|
|
21
22
|
override fun getName(): String = DdSdkImplementation.NAME
|
|
22
23
|
|
|
@@ -26,7 +26,8 @@ class DdTrace(
|
|
|
26
26
|
* Start a span, and returns a unique identifier for the span.
|
|
27
27
|
* @param operation The operation name of the span.
|
|
28
28
|
* @param context The additional context to send.
|
|
29
|
-
* @param timestampMs The timestamp when the operation started (in milliseconds).
|
|
29
|
+
* @param timestampMs The timestamp when the operation started (in milliseconds).
|
|
30
|
+
* If not provided, current timestamp will be used.
|
|
30
31
|
*/
|
|
31
32
|
@ReactMethod
|
|
32
33
|
override fun startSpan(operation: String, context: ReadableMap, timestampMs: Double, promise: Promise) {
|
|
@@ -37,7 +38,8 @@ class DdTrace(
|
|
|
37
38
|
* Finish a started span.
|
|
38
39
|
* @param spanId The unique identifier of the span.
|
|
39
40
|
* @param context The additional context to send.
|
|
40
|
-
* @param timestampMs The timestamp when the operation stopped (in milliseconds).
|
|
41
|
+
* @param timestampMs The timestamp when the operation stopped (in milliseconds).
|
|
42
|
+
* If not provided, current timestamp will be used.
|
|
41
43
|
*/
|
|
42
44
|
@ReactMethod
|
|
43
45
|
override fun finishSpan(spanId: String, context: ReadableMap, timestampMs: Double, promise: Promise) {
|
|
@@ -17,7 +17,7 @@ import com.facebook.react.bridge.ReadableMap
|
|
|
17
17
|
*/
|
|
18
18
|
class DdLogs(
|
|
19
19
|
reactContext: ReactApplicationContext,
|
|
20
|
-
datadogWrapper: DatadogWrapper
|
|
20
|
+
datadogWrapper: DatadogWrapper = DatadogSDKWrapper()
|
|
21
21
|
) : ReactContextBaseJavaModule(reactContext) {
|
|
22
22
|
|
|
23
23
|
private val implementation = DdLogsImplementation(datadog = datadogWrapper)
|
|
@@ -18,7 +18,7 @@ import com.facebook.react.bridge.ReadableMap
|
|
|
18
18
|
@Suppress("TooManyFunctions")
|
|
19
19
|
class DdRum(
|
|
20
20
|
reactContext: ReactApplicationContext,
|
|
21
|
-
datadogWrapper: DatadogWrapper
|
|
21
|
+
datadogWrapper: DatadogWrapper = DatadogSDKWrapper()
|
|
22
22
|
) : ReactContextBaseJavaModule(reactContext) {
|
|
23
23
|
|
|
24
24
|
private val implementation = DdRumImplementation(datadog = datadogWrapper)
|
|
@@ -30,7 +30,8 @@ class DdRum(
|
|
|
30
30
|
* @param key The view unique key identifier.
|
|
31
31
|
* @param name The view name.
|
|
32
32
|
* @param context The additional context to send.
|
|
33
|
-
* @param timestampMs The timestamp when the view started (in milliseconds).
|
|
33
|
+
* @param timestampMs The timestamp when the view started (in milliseconds).
|
|
34
|
+
* If not provided, current timestamp will be used.
|
|
34
35
|
*/
|
|
35
36
|
@ReactMethod
|
|
36
37
|
fun startView(
|
|
@@ -27,7 +27,8 @@ class DdTrace(
|
|
|
27
27
|
* Start a span, and returns a unique identifier for the span.
|
|
28
28
|
* @param operation The operation name of the span.
|
|
29
29
|
* @param context The additional context to send.
|
|
30
|
-
* @param timestampMs The timestamp when the operation started (in milliseconds).
|
|
30
|
+
* @param timestampMs The timestamp when the operation started (in milliseconds).
|
|
31
|
+
* If not provided, current timestamp will be used.
|
|
31
32
|
*/
|
|
32
33
|
@ReactMethod
|
|
33
34
|
fun startSpan(operation: String, context: ReadableMap, timestampMs: Double, promise: Promise) {
|
|
@@ -38,7 +39,8 @@ class DdTrace(
|
|
|
38
39
|
* Finish a started span.
|
|
39
40
|
* @param spanId The unique identifier of the span.
|
|
40
41
|
* @param context The additional context to send.
|
|
41
|
-
* @param timestampMs The timestamp when the operation stopped (in milliseconds).
|
|
42
|
+
* @param timestampMs The timestamp when the operation stopped (in milliseconds).
|
|
43
|
+
* If not provided, current timestamp will be used.
|
|
42
44
|
*/
|
|
43
45
|
@ReactMethod
|
|
44
46
|
fun finishSpan(spanId: String, context: ReadableMap, timestampMs: Double, promise: Promise) {
|
package/lib/commonjs/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["version.ts"],"names":["version"],"mappings":";;;;;;AAAA;AACO,MAAMA,OAAO,GAAG,OAAhB","sourcesContent":["// generated by genversion\nexport const version = '2.3.
|
|
1
|
+
{"version":3,"sources":["version.ts"],"names":["version"],"mappings":";;;;;;AAAA;AACO,MAAMA,OAAO,GAAG,OAAhB","sourcesContent":["// generated by genversion\nexport const version = '2.3.3';\n"]}
|
package/lib/module/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["version.ts"],"names":["version"],"mappings":"AAAA;AACA,OAAO,MAAMA,OAAO,GAAG,OAAhB","sourcesContent":["// generated by genversion\nexport const version = '2.3.
|
|
1
|
+
{"version":3,"sources":["version.ts"],"names":["version"],"mappings":"AAAA;AACA,OAAO,MAAMA,OAAO,GAAG,OAAhB","sourcesContent":["// generated by genversion\nexport const version = '2.3.3';\n"]}
|
|
@@ -40,9 +40,9 @@ export declare enum BatchSize {
|
|
|
40
40
|
*/
|
|
41
41
|
SMALL = "SMALL"
|
|
42
42
|
}
|
|
43
|
-
export
|
|
44
|
-
export
|
|
45
|
-
export
|
|
43
|
+
export type FirstPartyHostsConfiguration = (FirstPartyHost | LegacyFirstPartyHost)[];
|
|
44
|
+
export type LegacyFirstPartyHost = string;
|
|
45
|
+
export type CustomEndpoints = {
|
|
46
46
|
rum?: string;
|
|
47
47
|
logs?: string;
|
|
48
48
|
trace?: string;
|
|
@@ -243,7 +243,7 @@ export declare class DdSdkReactNativeConfiguration {
|
|
|
243
243
|
* Auto Instrumentation configuration passed to DatadogProvider.
|
|
244
244
|
* Does not include default values.
|
|
245
245
|
*/
|
|
246
|
-
export
|
|
246
|
+
export type AutoInstrumentationConfiguration = {
|
|
247
247
|
readonly trackInteractions: boolean;
|
|
248
248
|
readonly trackResources: boolean;
|
|
249
249
|
readonly firstPartyHosts?: FirstPartyHostsConfiguration;
|
|
@@ -258,7 +258,7 @@ export declare type AutoInstrumentationConfiguration = {
|
|
|
258
258
|
/**
|
|
259
259
|
* Parameters needed to start auto instrumentation. Includes default values.
|
|
260
260
|
*/
|
|
261
|
-
export
|
|
261
|
+
export type AutoInstrumentationParameters = {
|
|
262
262
|
readonly trackInteractions: boolean;
|
|
263
263
|
readonly trackResources: boolean;
|
|
264
264
|
readonly firstPartyHosts: FirstPartyHostsConfiguration;
|
|
@@ -275,7 +275,7 @@ export declare type AutoInstrumentationParameters = {
|
|
|
275
275
|
* the older android jsc that can still be used.
|
|
276
276
|
*/
|
|
277
277
|
export declare const addDefaultValuesToAutoInstrumentationConfiguration: (features: AutoInstrumentationConfiguration) => AutoInstrumentationParameters;
|
|
278
|
-
export
|
|
278
|
+
export type PartialInitializationConfiguration = {
|
|
279
279
|
readonly clientToken: string;
|
|
280
280
|
readonly env: string;
|
|
281
281
|
readonly applicationId: string;
|
|
@@ -313,4 +313,4 @@ export declare enum InitializationMode {
|
|
|
313
313
|
SYNC = "SYNC",
|
|
314
314
|
ASYNC = "ASYNC"
|
|
315
315
|
}
|
|
316
|
-
export
|
|
316
|
+
export type InitializationModeForTelemetry = 'LEGACY' | 'SYNC' | 'ASYNC' | 'PARTIAL' | 'FILE';
|
|
@@ -2,7 +2,7 @@ import type { UserInfo } from '../sdk/UserInfoSingleton/types';
|
|
|
2
2
|
/**
|
|
3
3
|
* The entry point to use Datadog's Logs feature.
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export type DdLogsType = {
|
|
6
6
|
/**
|
|
7
7
|
* Send a log with debug level.
|
|
8
8
|
* @param message: The message to send.
|
|
@@ -31,12 +31,12 @@ export declare type DdLogsType = {
|
|
|
31
31
|
/**
|
|
32
32
|
* Log input from developers
|
|
33
33
|
*/
|
|
34
|
-
export
|
|
34
|
+
export type RawLog = {
|
|
35
35
|
message: string;
|
|
36
36
|
context: object;
|
|
37
37
|
status: LogStatus;
|
|
38
38
|
};
|
|
39
|
-
export
|
|
39
|
+
export type RawLogWithError = {
|
|
40
40
|
message: string;
|
|
41
41
|
errorKind: string;
|
|
42
42
|
errorMessage: string;
|
|
@@ -47,19 +47,19 @@ export declare type RawLogWithError = {
|
|
|
47
47
|
/**
|
|
48
48
|
* Log input for native SDKs
|
|
49
49
|
*/
|
|
50
|
-
export
|
|
50
|
+
export type NativeLog = {
|
|
51
51
|
message: string;
|
|
52
52
|
context: object;
|
|
53
53
|
};
|
|
54
|
-
export
|
|
54
|
+
export type NativeLogWithError = {
|
|
55
55
|
message: string;
|
|
56
56
|
errorKind: string;
|
|
57
57
|
errorMessage: string;
|
|
58
58
|
stacktrace: string;
|
|
59
59
|
context: object;
|
|
60
60
|
};
|
|
61
|
-
export
|
|
62
|
-
export
|
|
61
|
+
export type LogStatus = 'debug' | 'info' | 'warn' | 'error';
|
|
62
|
+
export type LogEvent = {
|
|
63
63
|
message: string;
|
|
64
64
|
context: object;
|
|
65
65
|
errorKind?: string;
|
|
@@ -69,9 +69,9 @@ export declare type LogEvent = {
|
|
|
69
69
|
readonly userInfo: UserInfo;
|
|
70
70
|
readonly attributes?: object;
|
|
71
71
|
};
|
|
72
|
-
export
|
|
73
|
-
export
|
|
74
|
-
export
|
|
72
|
+
export type LogEventMapper = (logEvent: LogEvent) => LogEvent | null;
|
|
73
|
+
export type LogArguments = [message: string, context?: object];
|
|
74
|
+
export type LogWithErrorArguments = [
|
|
75
75
|
message: string,
|
|
76
76
|
errorKind?: string,
|
|
77
77
|
errorMessage?: string,
|
|
@@ -9,11 +9,11 @@ import type { Spec as NativeDdTrace } from './specs/NativeDdTrace';
|
|
|
9
9
|
/**
|
|
10
10
|
* The entry point to use Datadog's Logs feature.
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export type DdNativeLogsType = NativeDdLogs;
|
|
13
13
|
/**
|
|
14
14
|
* The entry point to use Datadog's Trace feature.
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export type DdNativeTraceType = NativeDdTrace;
|
|
17
17
|
/**
|
|
18
18
|
* A configuration object to initialize Datadog's features.
|
|
19
19
|
*/
|
|
@@ -38,9 +38,9 @@ export interface DdNativeSdkType extends NativeDdSdk {
|
|
|
38
38
|
*/
|
|
39
39
|
initialize(configuration: DdNativeSdkConfiguration): Promise<void>;
|
|
40
40
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
type ActionType = 'TAP' | 'SCROLL' | 'SWIPE' | 'BACK' | 'CUSTOM';
|
|
42
|
+
type ResourceKind = 'image' | 'xhr' | 'beacon' | 'css' | 'document' | 'fetch' | 'font' | 'js' | 'media' | 'other' | 'native';
|
|
43
|
+
type ErrorSource = 'NETWORK' | 'SOURCE' | 'CONSOLE' | 'WEBVIEW' | 'CUSTOM';
|
|
44
44
|
/**
|
|
45
45
|
* The entry point to use Datadog's RUM feature.
|
|
46
46
|
*/
|
|
@@ -2,20 +2,20 @@ import type { GestureResponderEvent } from 'react-native';
|
|
|
2
2
|
import type { AdditionalEventDataForMapper } from '../../sdk/EventMappers/EventMapper';
|
|
3
3
|
import { EventMapper } from '../../sdk/EventMappers/EventMapper';
|
|
4
4
|
import type { RumActionType } from '../types';
|
|
5
|
-
|
|
5
|
+
type RawAction = {
|
|
6
6
|
readonly type: RumActionType;
|
|
7
7
|
readonly name: string;
|
|
8
8
|
context: object;
|
|
9
9
|
readonly timestampMs: number;
|
|
10
10
|
actionContext?: GestureResponderEvent;
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
type ActionEvent = RawAction & AdditionalEventDataForMapper;
|
|
13
|
+
type NativeAction = {
|
|
14
14
|
type: RumActionType;
|
|
15
15
|
name: string;
|
|
16
16
|
context: object;
|
|
17
17
|
timestampMs: number;
|
|
18
18
|
};
|
|
19
|
-
export
|
|
19
|
+
export type ActionEventMapper = (event: ActionEvent) => ActionEvent | null;
|
|
20
20
|
export declare const generateActionEventMapper: (eventMapper: ActionEventMapper | undefined) => EventMapper<RawAction, ActionEvent, NativeAction>;
|
|
21
21
|
export {};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import type { AdditionalEventDataForMapper } from '../../sdk/EventMappers/EventMapper';
|
|
2
2
|
import { EventMapper } from '../../sdk/EventMappers/EventMapper';
|
|
3
3
|
import type { ErrorSource } from '../types';
|
|
4
|
-
|
|
4
|
+
type RawError = {
|
|
5
5
|
message: string;
|
|
6
6
|
source: ErrorSource;
|
|
7
7
|
stacktrace: string;
|
|
8
8
|
context: object;
|
|
9
9
|
timestampMs: number;
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
type ErrorEvent = RawError & AdditionalEventDataForMapper;
|
|
12
|
+
type NativeError = {
|
|
13
13
|
message: string;
|
|
14
14
|
source: ErrorSource;
|
|
15
15
|
stacktrace: string;
|
|
16
16
|
context: object;
|
|
17
17
|
timestampMs: number;
|
|
18
18
|
};
|
|
19
|
-
export
|
|
19
|
+
export type ErrorEventMapper = (event: ErrorEvent) => ErrorEvent | null;
|
|
20
20
|
export declare const generateErrorEventMapper: (eventMapper: ErrorEventMapper | undefined) => EventMapper<RawError, ErrorEvent, NativeError>;
|
|
21
21
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AdditionalEventDataForMapper } from '../../sdk/EventMappers/EventMapper';
|
|
2
2
|
import { EventMapper } from '../../sdk/EventMappers/EventMapper';
|
|
3
3
|
import type { ResourceKind } from '../types';
|
|
4
|
-
|
|
4
|
+
type RawResource = {
|
|
5
5
|
readonly key: string;
|
|
6
6
|
readonly statusCode: number;
|
|
7
7
|
readonly kind: ResourceKind;
|
|
@@ -10,8 +10,8 @@ declare type RawResource = {
|
|
|
10
10
|
readonly timestampMs: number;
|
|
11
11
|
resourceContext: XMLHttpRequest | undefined;
|
|
12
12
|
};
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
type ResourceEvent = RawResource & AdditionalEventDataForMapper;
|
|
14
|
+
type NativeResource = {
|
|
15
15
|
key: string;
|
|
16
16
|
statusCode: number;
|
|
17
17
|
kind: ResourceKind;
|
|
@@ -19,6 +19,6 @@ declare type NativeResource = {
|
|
|
19
19
|
context: object;
|
|
20
20
|
timestampMs: number;
|
|
21
21
|
};
|
|
22
|
-
export
|
|
22
|
+
export type ResourceEventMapper = (event: ResourceEvent) => ResourceEvent | null;
|
|
23
23
|
export declare const generateResourceEventMapper: (eventMapper: ResourceEventMapper | undefined) => EventMapper<RawResource, ResourceEvent, NativeResource>;
|
|
24
24
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PropagatorType } from '../../../types';
|
|
2
2
|
import type { RegexMap } from '../requestProxy/interfaces/RequestProxy';
|
|
3
3
|
import type { Hostname } from './firstPartyHosts';
|
|
4
|
-
export
|
|
4
|
+
export type DdRumResourceTracingAttributes = {
|
|
5
5
|
tracingStrategy: 'KEEP';
|
|
6
6
|
traceId: TraceId;
|
|
7
7
|
spanId: SpanId;
|
|
@@ -23,10 +23,10 @@ export declare const getTracingAttributes: ({ hostname, firstPartyHostsRegexMap,
|
|
|
23
23
|
* Using branded types will ensure we don't accidentally use
|
|
24
24
|
* traceId for spanId when generating headers.
|
|
25
25
|
*/
|
|
26
|
-
export
|
|
26
|
+
export type TraceId = TraceIdentifier & {
|
|
27
27
|
_brand: 'traceId';
|
|
28
28
|
};
|
|
29
|
-
export
|
|
29
|
+
export type SpanId = TraceIdentifier & {
|
|
30
30
|
_brand: 'spanId';
|
|
31
31
|
};
|
|
32
32
|
export declare class TraceIdentifier {
|
package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FirstPartyHost, PropagatorType } from '../../../types';
|
|
2
2
|
import type { RegexMap } from '../requestProxy/interfaces/RequestProxy';
|
|
3
|
-
export
|
|
3
|
+
export type Hostname = {
|
|
4
4
|
_type: 'Hostname';
|
|
5
5
|
} & string;
|
|
6
6
|
export declare const NO_MATCH_REGEX: RegExp;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RUMResource } from '../../interfaces/RumResource';
|
|
2
|
-
|
|
2
|
+
type ResourceMapper = (resource: RUMResource) => RUMResource | null;
|
|
3
3
|
export declare class ResourceReporter {
|
|
4
4
|
private mappers;
|
|
5
5
|
constructor(resourceMappers: ResourceMapper[]);
|
package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export interface RUMResource {
|
|
|
20
20
|
};
|
|
21
21
|
resourceContext?: XMLHttpRequest;
|
|
22
22
|
}
|
|
23
|
-
export
|
|
23
|
+
export type DdRumResourceGraphqlAttributes = {
|
|
24
24
|
operationType?: string;
|
|
25
25
|
operationName?: string;
|
|
26
26
|
variables?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The entry point to use Datadog's RUM feature.
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export type DdRumType = {
|
|
5
5
|
/**
|
|
6
6
|
* Start tracking a RUM View.
|
|
7
7
|
* @param key: The view unique key identifier.
|
|
@@ -104,7 +104,7 @@ export declare enum RumActionType {
|
|
|
104
104
|
/** A custom action. */
|
|
105
105
|
CUSTOM = "CUSTOM"
|
|
106
106
|
}
|
|
107
|
-
export
|
|
107
|
+
export type ResourceKind = 'image' | 'xhr' | 'beacon' | 'css' | 'document' | 'fetch' | 'font' | 'js' | 'media' | 'other' | 'native';
|
|
108
108
|
export declare enum ErrorSource {
|
|
109
109
|
NETWORK = "NETWORK",
|
|
110
110
|
SOURCE = "SOURCE",
|
|
@@ -125,7 +125,7 @@ export declare enum PropagatorType {
|
|
|
125
125
|
B3 = "b3",
|
|
126
126
|
B3MULTI = "b3multi"
|
|
127
127
|
}
|
|
128
|
-
export
|
|
128
|
+
export type FirstPartyHost = {
|
|
129
129
|
match: string;
|
|
130
130
|
propagatorTypes: PropagatorType[];
|
|
131
131
|
};
|
|
@@ -3,7 +3,7 @@ import type { PropsWithChildren } from 'react';
|
|
|
3
3
|
import { DatadogProviderConfiguration } from '../../DdSdkReactNativeConfiguration';
|
|
4
4
|
import type { PartialInitializationConfiguration, AutoInstrumentationConfiguration } from '../../DdSdkReactNativeConfiguration';
|
|
5
5
|
import type { FileBasedConfiguration } from '../FileBasedConfiguration/FileBasedConfiguration';
|
|
6
|
-
|
|
6
|
+
type Props = PropsWithChildren<{
|
|
7
7
|
/**
|
|
8
8
|
* If a `DatadogProviderConfiguration` instance is passed, the SDK will start tracking errors, resources and actions and sending events.
|
|
9
9
|
*
|
|
@@ -15,7 +15,7 @@ declare type Props = PropsWithChildren<{
|
|
|
15
15
|
*/
|
|
16
16
|
onInitialization?: () => void;
|
|
17
17
|
}>;
|
|
18
|
-
|
|
18
|
+
type StaticProperties = {
|
|
19
19
|
initialize: (configuration: PartialInitializationConfiguration) => Promise<void>;
|
|
20
20
|
onInitialization?: () => void;
|
|
21
21
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Attributes } from '../AttributesSingleton/types';
|
|
2
2
|
import type { UserInfo } from '../UserInfoSingleton/types';
|
|
3
|
-
export
|
|
3
|
+
export type AdditionalEventDataForMapper = {
|
|
4
4
|
userInfo: UserInfo;
|
|
5
5
|
attributes: Attributes;
|
|
6
6
|
};
|
|
@@ -73,7 +73,7 @@ export declare class DdSdkConfiguration {
|
|
|
73
73
|
/**
|
|
74
74
|
* The entry point to initialize Datadog's features.
|
|
75
75
|
*/
|
|
76
|
-
export
|
|
76
|
+
export type DdSdkType = {
|
|
77
77
|
/**
|
|
78
78
|
* Initializes Datadog's features.
|
|
79
79
|
* @param configuration: The configuration to use.
|
|
@@ -98,7 +98,7 @@ export declare type DdSdkType = {
|
|
|
98
98
|
/**
|
|
99
99
|
* The entry point to use Datadog's Trace feature.
|
|
100
100
|
*/
|
|
101
|
-
export
|
|
101
|
+
export type DdTraceType = {
|
|
102
102
|
/**
|
|
103
103
|
* Start a span, and returns a unique identifier for the span.
|
|
104
104
|
* @param operation: The operation name of the span.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "2.3.
|
|
1
|
+
export declare const version = "2.3.3";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datadog/mobile-react-native",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.3",
|
|
4
4
|
"description": "A client-side React Native module to interact with Datadog",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"datadog",
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
"javaPackageName": "com.datadog.reactnative"
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "f9db01676449a1e3e31ad32ba20d1bcf360556e5"
|
|
101
101
|
}
|
|
@@ -72,7 +72,7 @@ describe('DatadogProvider', () => {
|
|
|
72
72
|
"clientToken": "fakeToken",
|
|
73
73
|
"configurationForTelemetry": {
|
|
74
74
|
"initializationType": "SYNC",
|
|
75
|
-
"reactNativeVersion": "0.
|
|
75
|
+
"reactNativeVersion": "0.73.6",
|
|
76
76
|
"reactVersion": "18.2.0",
|
|
77
77
|
"trackErrors": true,
|
|
78
78
|
"trackInteractions": true,
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// generated by genversion
|
|
2
|
-
export const version = '2.3.
|
|
2
|
+
export const version = '2.3.3';
|