@datadog/mobile-react-native-navigation 1.1.3 → 1.2.0-beta1
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/DatadogProvider/Buffer/BoundedBuffer.d.ts +15 -0
- package/lib/typescript/core/src/DatadogProvider/Buffer/BufferSingleton.d.ts +7 -0
- package/lib/typescript/core/src/DatadogProvider/Buffer/DatadogBuffer.d.ts +20 -0
- package/lib/typescript/core/src/DatadogProvider/Buffer/PassThroughBuffer.d.ts +7 -0
- package/lib/typescript/core/src/DatadogProvider/Buffer/bufferNativeCall.d.ts +3 -0
- package/lib/typescript/core/src/DatadogProvider/DatadogProvider.d.ts +26 -0
- package/lib/typescript/core/src/DdSdkReactNative.d.ts +23 -1
- package/lib/typescript/core/src/DdSdkReactNativeConfiguration.d.ts +63 -0
- package/lib/typescript/core/src/errorUtils.d.ts +4 -0
- package/lib/typescript/core/src/index.d.ts +3 -2
- package/lib/typescript/core/src/nativeModulesTypes.d.ts +12 -0
- package/lib/typescript/core/src/rum/instrumentation/DdRumErrorTracking.d.ts +0 -2
- package/lib/typescript/core/src/rum/instrumentation/DdRumUserInteractionTracking.d.ts +3 -0
- package/lib/typescript/core/src/rum/instrumentation/getJsxRuntime.d.ts +1 -0
- package/lib/typescript/core/src/types.d.ts +2 -1
- package/lib/typescript/core/src/version.d.ts +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DatadogBuffer } from './DatadogBuffer';
|
|
2
|
+
export declare class BoundedBuffer extends DatadogBuffer {
|
|
3
|
+
private bufferSize;
|
|
4
|
+
private buffer;
|
|
5
|
+
private idTable;
|
|
6
|
+
private telemetryBuffer;
|
|
7
|
+
constructor(bufferSize?: number);
|
|
8
|
+
addCallback: (callback: () => Promise<void>) => Promise<void>;
|
|
9
|
+
addCallbackReturningId: (callback: () => Promise<string>) => Promise<string>;
|
|
10
|
+
addCallbackWithId: (callback: (id: string) => Promise<void>, bufferId: string) => Promise<void>;
|
|
11
|
+
drain: () => Promise<void>;
|
|
12
|
+
private generateRandomBufferId;
|
|
13
|
+
private addTelemetryEvent;
|
|
14
|
+
private drainTelemetry;
|
|
15
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare abstract class DatadogBuffer {
|
|
2
|
+
/**
|
|
3
|
+
* Add a callback that takes no input and yields no output to the buffer.
|
|
4
|
+
*/
|
|
5
|
+
abstract addCallback: (callback: () => Promise<void>) => Promise<void>;
|
|
6
|
+
/**
|
|
7
|
+
* Add a callback that returns an id to the buffer.
|
|
8
|
+
* This method also returns an id (possibly different), to be passed to addCallbackWithId.
|
|
9
|
+
*/
|
|
10
|
+
abstract addCallbackReturningId: (callback: () => Promise<string>) => Promise<string>;
|
|
11
|
+
/**
|
|
12
|
+
* Add a callback that takes an id as input to the buffer.
|
|
13
|
+
* This id must be obtained by calling addCallbackReturningId.
|
|
14
|
+
*/
|
|
15
|
+
abstract addCallbackWithId: (callback: (id: string) => Promise<void>, id: string) => Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Execute all callbacks in the buffer.
|
|
18
|
+
*/
|
|
19
|
+
abstract drain: () => void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DatadogBuffer } from './DatadogBuffer';
|
|
2
|
+
export declare class PassThroughBuffer extends DatadogBuffer {
|
|
3
|
+
addCallback: (callback: () => any) => any;
|
|
4
|
+
addCallbackReturningId: (callback: () => any) => any;
|
|
5
|
+
addCallbackWithId: (callback: (id: string) => any, id: string) => any;
|
|
6
|
+
drain: () => undefined;
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const bufferVoidNativeCall: (callback: () => Promise<void>) => Promise<void>;
|
|
2
|
+
export declare const bufferNativeCallReturningId: (callback: () => Promise<string>) => Promise<string>;
|
|
3
|
+
export declare const bufferNativeCallWithId: (callback: (id: string) => Promise<void>, id: string) => Promise<void>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PropsWithChildren } from 'react';
|
|
3
|
+
import { DatadogProviderConfiguration } from '../DdSdkReactNativeConfiguration';
|
|
4
|
+
import type { PartialInitializationConfiguration, AutoInstrumentationConfiguration } from '../DdSdkReactNativeConfiguration';
|
|
5
|
+
declare type Props = PropsWithChildren<{
|
|
6
|
+
/**
|
|
7
|
+
* If a `DatadogProviderConfiguration` instance is passed, the SDK will start tracking errors, resources and actions and sending events.
|
|
8
|
+
*
|
|
9
|
+
* If a `AutoInstrumentationConfiguration` object is passed, the SDK will start tracking errors, resources and actions. To start sending events, call `DatadogProvider.initialize`.
|
|
10
|
+
*/
|
|
11
|
+
configuration: DatadogProviderConfiguration | AutoInstrumentationConfiguration;
|
|
12
|
+
/**
|
|
13
|
+
* Callback to be run once the SDK starts sending events.
|
|
14
|
+
*/
|
|
15
|
+
onInitialization?: () => void;
|
|
16
|
+
}>;
|
|
17
|
+
declare type StaticProperties = {
|
|
18
|
+
initialize: (configuration: PartialInitializationConfiguration) => Promise<void>;
|
|
19
|
+
onInitialization?: () => void;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Set up the Datadog React Native SDK.
|
|
23
|
+
*/
|
|
24
|
+
export declare const DatadogProvider: React.FC<Props> & StaticProperties;
|
|
25
|
+
export declare const __internalResetIsInitializedForTesting: () => void;
|
|
26
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { DdSdkReactNativeConfiguration } from './DdSdkReactNativeConfiguration';
|
|
2
|
+
import type { DatadogProviderConfiguration, PartialInitializationConfiguration, AutoInstrumentationConfiguration } from './DdSdkReactNativeConfiguration';
|
|
2
3
|
import type { TrackingConsent } from './TrackingConsent';
|
|
3
4
|
/**
|
|
4
5
|
* This class initializes the Datadog SDK, and sets up communication with the server.
|
|
@@ -19,12 +20,32 @@ export declare class DdSdkReactNative {
|
|
|
19
20
|
private static readonly DD_NATIVE_LONG_TASK_THRESHOLD_KEY;
|
|
20
21
|
private static readonly NATIVE_LONG_TASK_THRESHOLD_MS;
|
|
21
22
|
private static wasInitialized;
|
|
23
|
+
private static wasAutoInstrumented;
|
|
24
|
+
private static configuration?;
|
|
25
|
+
private static features?;
|
|
22
26
|
/**
|
|
23
27
|
* Initializes the Datadog SDK.
|
|
24
28
|
* @param configuration the configuration for the SDK library
|
|
25
29
|
* @returns a Promise.
|
|
26
30
|
*/
|
|
27
31
|
static initialize(configuration: DdSdkReactNativeConfiguration): Promise<void>;
|
|
32
|
+
private static initializeNativeSDK;
|
|
33
|
+
/**
|
|
34
|
+
* FOR INTERNAL USE ONLY.
|
|
35
|
+
*/
|
|
36
|
+
static _initializeFromDatadogProvider(configuration: DatadogProviderConfiguration): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* FOR INTERNAL USE ONLY.
|
|
39
|
+
*/
|
|
40
|
+
static _enableFeaturesFromDatadogProvider(features: AutoInstrumentationConfiguration): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* FOR INTERNAL USE ONLY.
|
|
43
|
+
*/
|
|
44
|
+
static _initializeFromDatadogProviderAsync: () => Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* FOR INTERNAL USE ONLY.
|
|
47
|
+
*/
|
|
48
|
+
static _initializeFromDatadogProviderWithConfigurationAsync: (configuration: PartialInitializationConfiguration) => Promise<void>;
|
|
28
49
|
/**
|
|
29
50
|
* Sets the global context (set of attributes) attached with all future Logs, Spans and RUM events.
|
|
30
51
|
* @param attributes: The global context attributes.
|
|
@@ -43,5 +64,6 @@ export declare class DdSdkReactNative {
|
|
|
43
64
|
* @returns a Promise.
|
|
44
65
|
*/
|
|
45
66
|
static setTrackingConsent(consent: TrackingConsent): Promise<void>;
|
|
67
|
+
private static buildConfiguration;
|
|
46
68
|
private static enableFeatures;
|
|
47
69
|
}
|
|
@@ -52,8 +52,71 @@ export declare class DdSdkReactNativeConfiguration {
|
|
|
52
52
|
* A dash (`-`) will be automatically added between the version and the suffix
|
|
53
53
|
*/
|
|
54
54
|
versionSuffix?: string;
|
|
55
|
+
/**
|
|
56
|
+
* The sampling rate for Internal Telemetry (info related to the work of the
|
|
57
|
+
* SDK internals).
|
|
58
|
+
*
|
|
59
|
+
* The sampling rate must be a value between 0 and 100. A value of 0 means no
|
|
60
|
+
* telemetry will be sent, 100 means all telemetry will be sent. When
|
|
61
|
+
* `telemetrySampleRate` is not set, the default value from the iOS and
|
|
62
|
+
* Android SDK is used, which is 20.
|
|
63
|
+
*/
|
|
64
|
+
telemetrySampleRate: number;
|
|
55
65
|
additionalConfig: {
|
|
56
66
|
[k: string]: any;
|
|
57
67
|
};
|
|
58
68
|
constructor(clientToken: string, env: string, applicationId: string, trackInteractions?: boolean, trackResources?: boolean, trackErrors?: boolean, trackingConsent?: TrackingConsent);
|
|
59
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Auto Instrumentation configuration passed to DatadogProvider.
|
|
72
|
+
* Does not include default values.
|
|
73
|
+
*/
|
|
74
|
+
export declare type AutoInstrumentationConfiguration = {
|
|
75
|
+
readonly trackInteractions: boolean;
|
|
76
|
+
readonly trackResources: boolean;
|
|
77
|
+
readonly firstPartyHosts?: string[];
|
|
78
|
+
readonly resourceTracingSamplingRate?: number;
|
|
79
|
+
readonly trackErrors: boolean;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Parameters needed to start auto instrumentation. Includes default values.
|
|
83
|
+
*/
|
|
84
|
+
export declare type AutoInstrumentationParameters = {
|
|
85
|
+
readonly trackInteractions: boolean;
|
|
86
|
+
readonly trackResources: boolean;
|
|
87
|
+
readonly firstPartyHosts: string[];
|
|
88
|
+
readonly resourceTracingSamplingRate: number;
|
|
89
|
+
readonly trackErrors: boolean;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* We could use `Proxy` instead of this function, but `Proxy` is not available on
|
|
93
|
+
* the older android jsc that can still be used.
|
|
94
|
+
*/
|
|
95
|
+
export declare const addDefaultValuesToAutoInstrumentationConfiguration: (features: AutoInstrumentationConfiguration) => AutoInstrumentationParameters;
|
|
96
|
+
export declare type PartialInitializationConfiguration = {
|
|
97
|
+
readonly clientToken: string;
|
|
98
|
+
readonly env: string;
|
|
99
|
+
readonly applicationId: string;
|
|
100
|
+
readonly sessionSamplingRate?: number;
|
|
101
|
+
readonly site?: string;
|
|
102
|
+
readonly verbosity?: SdkVerbosity | undefined;
|
|
103
|
+
readonly nativeViewTracking?: boolean;
|
|
104
|
+
readonly proxyConfig?: ProxyConfiguration;
|
|
105
|
+
readonly serviceName?: string;
|
|
106
|
+
readonly version?: string;
|
|
107
|
+
versionSuffix?: string;
|
|
108
|
+
readonly additionalConfig?: {
|
|
109
|
+
[k: string]: any;
|
|
110
|
+
};
|
|
111
|
+
readonly trackingConsent?: TrackingConsent;
|
|
112
|
+
readonly nativeCrashReportEnabled?: boolean;
|
|
113
|
+
readonly telemetrySampleRate?: number;
|
|
114
|
+
};
|
|
115
|
+
export declare const buildConfigurationFromPartialConfiguration: (features: AutoInstrumentationConfiguration, configuration: PartialInitializationConfiguration) => DdSdkReactNativeConfiguration;
|
|
116
|
+
export declare class DatadogProviderConfiguration extends DdSdkReactNativeConfiguration {
|
|
117
|
+
initializationMode: InitializationMode;
|
|
118
|
+
}
|
|
119
|
+
export declare enum InitializationMode {
|
|
120
|
+
SYNC = "SYNC",
|
|
121
|
+
ASYNC = "ASYNC"
|
|
122
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DatadogProvider } from './DatadogProvider/DatadogProvider';
|
|
2
|
+
import { DatadogProviderConfiguration, DdSdkReactNativeConfiguration, InitializationMode } from './DdSdkReactNativeConfiguration';
|
|
2
3
|
import { DdSdkReactNative } from './DdSdkReactNative';
|
|
3
4
|
import { InternalLog } from './InternalLog';
|
|
4
5
|
import { ProxyConfiguration, ProxyType } from './ProxyConfiguration';
|
|
@@ -6,4 +7,4 @@ import { SdkVerbosity } from './SdkVerbosity';
|
|
|
6
7
|
import { TrackingConsent } from './TrackingConsent';
|
|
7
8
|
import { DdLogs, DdTrace, DdRum } from './foundation';
|
|
8
9
|
import { RumActionType, ErrorSource } from './types';
|
|
9
|
-
export { DdLogs, DdTrace, DdRum, RumActionType, ErrorSource, DdSdkReactNativeConfiguration, DdSdkReactNative, InternalLog, ProxyConfiguration, ProxyType, TrackingConsent, SdkVerbosity };
|
|
10
|
+
export { DatadogProvider, DatadogProviderConfiguration, InitializationMode, DdLogs, DdTrace, DdRum, RumActionType, ErrorSource, DdSdkReactNativeConfiguration, DdSdkReactNative, InternalLog, ProxyConfiguration, ProxyType, TrackingConsent, SdkVerbosity };
|
|
@@ -36,6 +36,18 @@ export declare type DdNativeSdkType = {
|
|
|
36
36
|
* @param trackingConsent: Consent, which can take one of the following values: 'pending', 'granted', 'not_granted'.
|
|
37
37
|
*/
|
|
38
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>;
|
|
39
51
|
};
|
|
40
52
|
/**
|
|
41
53
|
* The entry point to use Datadog's Logs feature.
|
|
@@ -12,6 +12,4 @@ export declare class DdRumErrorTracking {
|
|
|
12
12
|
static startTracking(): void;
|
|
13
13
|
static onGlobalError(error: any, isFatal?: boolean): void;
|
|
14
14
|
static onConsoleError(...params: unknown[]): void;
|
|
15
|
-
private static getErrorMessage;
|
|
16
|
-
private static getErrorStackTrace;
|
|
17
15
|
}
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
export declare class DdRumUserInteractionTracking {
|
|
6
6
|
private static isTracking;
|
|
7
7
|
private static eventsInterceptor;
|
|
8
|
+
private static originalCreateElement;
|
|
9
|
+
private static originalMemo;
|
|
8
10
|
private static patchCreateElementFunction;
|
|
9
11
|
/**
|
|
10
12
|
* Starts tracking user interactions and sends a RUM Action event every time a new interaction was detected.
|
|
@@ -12,4 +14,5 @@ export declare class DdRumUserInteractionTracking {
|
|
|
12
14
|
* a visible output (either an UI state change or a Resource request)
|
|
13
15
|
*/
|
|
14
16
|
static startTracking(): void;
|
|
17
|
+
static stopTracking(): void;
|
|
15
18
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getJsxRuntime: () => any;
|
|
@@ -10,7 +10,8 @@ export declare class DdSdkConfiguration {
|
|
|
10
10
|
readonly site: string;
|
|
11
11
|
readonly trackingConsent: string;
|
|
12
12
|
readonly additionalConfig: object;
|
|
13
|
-
|
|
13
|
+
readonly telemetrySampleRate: number;
|
|
14
|
+
constructor(clientToken: string, env: string, applicationId: string, nativeCrashReportEnabled: boolean, sampleRate: number, site: string, trackingConsent: string, additionalConfig: object, telemetrySampleRate: number);
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
17
|
* The entry point to initialize Datadog's features.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.
|
|
1
|
+
export declare const version = "1.2.0-beta1";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datadog/mobile-react-native-navigation",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0-beta1",
|
|
4
4
|
"description": "A client-side React Native module to interact with Datadog",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"datadog",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"prepare": "rm -rf lib && yarn bob build"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@datadog/mobile-react-native": "^1.
|
|
39
|
+
"@datadog/mobile-react-native": "^1.2.0-beta1",
|
|
40
40
|
"react-native-gesture-handler": "1.10.3",
|
|
41
41
|
"react-native-navigation": "7.13.0"
|
|
42
42
|
},
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
]
|
|
71
71
|
]
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "c367071a477296075f9140771e4c01f19dd40377"
|
|
74
74
|
}
|