@datadog/mobile-react-native 3.0.3 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DatadogSDKReactNative.podspec +10 -9
- package/android/build.gradle +10 -8
- package/android/src/main/kotlin/com/datadog/reactnative/DdFlagsImplementation.kt +237 -0
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkBridgeExt.kt +262 -78
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfiguration.kt +3 -3
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfigurationExt.kt +18 -18
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkNativeInitialization.kt +3 -2
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkReactNativePackage.kt +3 -1
- package/android/src/main/kotlin/com/datadog/reactnative/SdkVersion.kt +1 -1
- package/android/src/newarch/kotlin/com/datadog/reactnative/DdFlags.kt +66 -0
- package/android/src/oldarch/kotlin/com/datadog/reactnative/DdFlags.kt +63 -0
- package/android/src/test/kotlin/com/datadog/reactnative/DdSdkBridgeExtTest.kt +242 -0
- package/android/src/test/kotlin/com/datadog/reactnative/DdSdkNativeInitializationTest.kt +4 -2
- package/android/src/test/kotlin/com/datadog/reactnative/DdSdkTest.kt +6 -3
- package/android/src/test/kotlin/com/datadog/tools/unit/DdSdkConfigurationExt.kt +3 -4
- package/android/src/test/kotlin/com/datadog/tools/unit/MapExt.kt +38 -0
- package/android/src/test/kotlin/com/datadog/tools/unit/MockRumMonitor.kt +3 -0
- package/android/src/test/kotlin/com/datadog/tools/unit/forge/DdSdkConfigurationForgeryFactory.kt +1 -1
- package/android/src/test/resources/input/complete-configuration.json +10 -10
- package/ios/Sources/DatadogSDKReactNative.h +2 -0
- package/ios/Sources/DdFlags.h +24 -0
- package/ios/Sources/DdFlags.mm +83 -0
- package/ios/Sources/DdFlagsImplementation.swift +263 -0
- package/ios/Sources/DdSdkConfiguration.swift +4 -4
- package/ios/Sources/DdSdkNativeInitialization.swift +2 -2
- package/ios/Sources/RNDdSdkConfiguration.swift +11 -9
- package/ios/Sources/SdkVersion.swift +1 -1
- package/lib/commonjs/InternalLog.js +9 -7
- package/lib/commonjs/InternalLog.js.map +1 -1
- package/lib/commonjs/flags/DdFlags.js +51 -0
- package/lib/commonjs/flags/DdFlags.js.map +1 -0
- package/lib/commonjs/flags/FlagsClient.js +218 -0
- package/lib/commonjs/flags/FlagsClient.js.map +1 -0
- package/lib/commonjs/flags/internal.js +40 -0
- package/lib/commonjs/flags/internal.js.map +1 -0
- package/lib/commonjs/flags/types.js +6 -0
- package/lib/commonjs/flags/types.js.map +1 -0
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/sdk/DatadogProvider/Buffer/BufferSingleton.js +10 -8
- package/lib/commonjs/sdk/DatadogProvider/Buffer/BufferSingleton.js.map +1 -1
- package/lib/commonjs/specs/NativeDdFlags.js +19 -0
- package/lib/commonjs/specs/NativeDdFlags.js.map +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/module/InternalLog.js +9 -6
- package/lib/module/InternalLog.js.map +1 -1
- package/lib/module/flags/DdFlags.js +45 -0
- package/lib/module/flags/DdFlags.js.map +1 -0
- package/lib/module/flags/FlagsClient.js +211 -0
- package/lib/module/flags/FlagsClient.js.map +1 -0
- package/lib/module/flags/internal.js +33 -0
- package/lib/module/flags/internal.js.map +1 -0
- package/lib/module/flags/types.js +2 -0
- package/lib/module/flags/types.js.map +1 -0
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/sdk/DatadogProvider/Buffer/BufferSingleton.js +10 -7
- package/lib/module/sdk/DatadogProvider/Buffer/BufferSingleton.js.map +1 -1
- package/lib/module/specs/NativeDdFlags.js +17 -0
- package/lib/module/specs/NativeDdFlags.js.map +1 -0
- package/lib/module/version.js +1 -1
- package/lib/typescript/InternalLog.d.ts +6 -4
- package/lib/typescript/InternalLog.d.ts.map +1 -1
- package/lib/typescript/flags/DdFlags.d.ts +3 -0
- package/lib/typescript/flags/DdFlags.d.ts.map +1 -0
- package/lib/typescript/flags/FlagsClient.d.ts +114 -0
- package/lib/typescript/flags/FlagsClient.d.ts.map +1 -0
- package/lib/typescript/flags/internal.d.ts +14 -0
- package/lib/typescript/flags/internal.d.ts.map +1 -0
- package/lib/typescript/flags/types.d.ts +202 -0
- package/lib/typescript/flags/types.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +5 -2
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/nativeModulesTypes.d.ts +5 -0
- package/lib/typescript/nativeModulesTypes.d.ts.map +1 -1
- package/lib/typescript/sdk/DatadogProvider/Buffer/BufferSingleton.d.ts +7 -5
- package/lib/typescript/sdk/DatadogProvider/Buffer/BufferSingleton.d.ts.map +1 -1
- package/lib/typescript/specs/NativeDdFlags.d.ts +15 -0
- package/lib/typescript/specs/NativeDdFlags.d.ts.map +1 -0
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/InternalLog.tsx +14 -6
- package/src/flags/DdFlags.ts +59 -0
- package/src/flags/FlagsClient.ts +266 -0
- package/src/flags/__tests__/DdFlags.test.ts +65 -0
- package/src/flags/__tests__/FlagsClient.test.ts +320 -0
- package/src/flags/internal.ts +63 -0
- package/src/flags/types.ts +215 -0
- package/src/index.tsx +15 -1
- package/src/nativeModulesTypes.ts +6 -0
- package/src/sdk/DatadogProvider/Buffer/BufferSingleton.ts +16 -7
- package/src/specs/NativeDdFlags.ts +35 -0
- package/src/version.ts +1 -1
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import type { FlagsClient } from './FlagsClient';
|
|
2
|
+
export interface DdFlagsType {
|
|
3
|
+
/**
|
|
4
|
+
* Enables the Datadog Flags feature in your application.
|
|
5
|
+
*
|
|
6
|
+
* Call this method after initializing the Datadog SDK to enable feature flag evaluation.
|
|
7
|
+
* This method must be called before creating any `FlagsClient` instances via `DdFlags.getClient()`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { DdSdkReactNativeConfiguration, DdSdkReactNative, DdFlags } from '@datadog/mobile-react-native';
|
|
12
|
+
*
|
|
13
|
+
* // Initialize the Datadog SDK.
|
|
14
|
+
* await DdSdkReactNative.initialize(...);
|
|
15
|
+
*
|
|
16
|
+
* // Optinal flags configuration object.
|
|
17
|
+
* const flagsConfig = {
|
|
18
|
+
* customFlagsEndpoint: 'https://flags.example.com'
|
|
19
|
+
* };
|
|
20
|
+
*
|
|
21
|
+
* // Enable the feature.
|
|
22
|
+
* await DdFlags.enable(flagsConfig);
|
|
23
|
+
*
|
|
24
|
+
* // Retrieve the client and access feature flags.
|
|
25
|
+
* const flagsClient = DdFlags.getClient();
|
|
26
|
+
* const flagValue = await flagsClient.getBooleanValue('new-feature', false);
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @param configuration Configuration options for the Datadog Flags feature.
|
|
30
|
+
*/
|
|
31
|
+
enable: (configuration?: FlagsConfiguration) => Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Returns a `FlagsClient` instance for further feature flag evaluation.
|
|
34
|
+
*
|
|
35
|
+
* For most applications, you would need only one client. If you need multiple clients,
|
|
36
|
+
* you can retrieve a couple of clients with different names.
|
|
37
|
+
*
|
|
38
|
+
* @param clientName An optional name of the client to retrieve. Defaults to `'default'`.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const flagsClient = DdFlags.getClient();
|
|
43
|
+
*
|
|
44
|
+
* // Set the evaluation context.
|
|
45
|
+
* await flagsClient.setEvaluationContext({
|
|
46
|
+
* targetingKey: 'user-123',
|
|
47
|
+
* attributes: {
|
|
48
|
+
* favoriteFruit: 'apple'
|
|
49
|
+
* }
|
|
50
|
+
* });
|
|
51
|
+
*
|
|
52
|
+
* const flagValue = flagsClient.getBooleanValue('new-feature', false);
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
getClient: (clientName?: string) => FlagsClient;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Configuration options for the Datadog Flags feature.
|
|
59
|
+
*/
|
|
60
|
+
export interface FlagsConfiguration {
|
|
61
|
+
/**
|
|
62
|
+
* Custom server URL for retrieving flag assignments.
|
|
63
|
+
*
|
|
64
|
+
* The provided value should only include the base URL, and the endpoint will be appended automatically.
|
|
65
|
+
* For example, if you provide 'https://flags.example.com', the SDK will use 'https://flags.example.com/precompute-assignments'.
|
|
66
|
+
*
|
|
67
|
+
* If not set, the SDK uses the default Datadog Flags endpoint for the configured site.
|
|
68
|
+
*
|
|
69
|
+
* @default undefined
|
|
70
|
+
*/
|
|
71
|
+
customFlagsEndpoint?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Custom server URL for sending Flags exposure data.
|
|
74
|
+
*
|
|
75
|
+
* The provided value should only include the base URL, and the endpoint will be appended automatically.
|
|
76
|
+
* For example, if you provide 'https://flags.example.com', the SDK will use 'https://flags.example.com/api/v2/exposures'.
|
|
77
|
+
*
|
|
78
|
+
* If not set, the SDK uses the default Datadog Flags exposure endpoint.
|
|
79
|
+
*
|
|
80
|
+
* @default undefined
|
|
81
|
+
*/
|
|
82
|
+
customExposureEndpoint?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Enables exposure logging via the dedicated exposures intake endpoint.
|
|
85
|
+
*
|
|
86
|
+
* When enabled, flag evaluation events are sent to the exposures endpoint for analytics and monitoring.
|
|
87
|
+
*
|
|
88
|
+
* @default true
|
|
89
|
+
*/
|
|
90
|
+
trackExposures?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Enables the RUM integration.
|
|
93
|
+
*
|
|
94
|
+
* When enabled, flag evaluation events are sent to RUM for correlation with user sessions.
|
|
95
|
+
*
|
|
96
|
+
* @default true
|
|
97
|
+
*/
|
|
98
|
+
rumIntegrationEnabled?: boolean;
|
|
99
|
+
}
|
|
100
|
+
export type PrimitiveValue = null | boolean | string | number;
|
|
101
|
+
type JsonObject = {
|
|
102
|
+
[key: string]: JsonValue;
|
|
103
|
+
};
|
|
104
|
+
type JsonArray = JsonValue[];
|
|
105
|
+
/**
|
|
106
|
+
* Represents a JSON node value.
|
|
107
|
+
*/
|
|
108
|
+
export type JsonValue = PrimitiveValue | JsonObject | JsonArray;
|
|
109
|
+
/**
|
|
110
|
+
* Context information used for feature flag targeting and evaluation.
|
|
111
|
+
*
|
|
112
|
+
* Contains user or session information that determines which flag variations are returned.
|
|
113
|
+
* This typically includes a unique identifier (targeting key) and optional custom attributes
|
|
114
|
+
* for granular targeting.
|
|
115
|
+
*
|
|
116
|
+
* Note: Evaluation context should be set before flag evaluations.
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```ts
|
|
120
|
+
* const context: EvaluationContext = {
|
|
121
|
+
* targetingKey: "user-123",
|
|
122
|
+
* attributes: {
|
|
123
|
+
* "region": "US",
|
|
124
|
+
* "plan": "premium",
|
|
125
|
+
* "age": 25,
|
|
126
|
+
* "beta_tester": true
|
|
127
|
+
* }
|
|
128
|
+
* };
|
|
129
|
+
*
|
|
130
|
+
* await client.setEvaluationContext(context);
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
export interface EvaluationContext {
|
|
134
|
+
/**
|
|
135
|
+
* The unique identifier used for targeting this user or session.
|
|
136
|
+
*
|
|
137
|
+
* This is typically a user ID, session ID, or device ID. The targeting key is used
|
|
138
|
+
* by the feature flag service to determine which variation to serve.
|
|
139
|
+
*
|
|
140
|
+
* Pass an empty string if you don't have such an identifier.
|
|
141
|
+
*/
|
|
142
|
+
targetingKey: string;
|
|
143
|
+
/**
|
|
144
|
+
* Custom attributes for more granular targeting.
|
|
145
|
+
*
|
|
146
|
+
* Attributes can include user properties, session data, or any other contextual information
|
|
147
|
+
* needed for flag evaluation rules.
|
|
148
|
+
*
|
|
149
|
+
* NOTE: Nested object values are not supported and will be dropped from the evaluation context.
|
|
150
|
+
*/
|
|
151
|
+
attributes?: Record<string, PrimitiveValue>;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* An error that occurs during feature flag evaluation.
|
|
155
|
+
*
|
|
156
|
+
* Indicates why a flag evaluation may have failed or returned a default value.
|
|
157
|
+
*/
|
|
158
|
+
type FlagErrorCode = 'PROVIDER_NOT_READY' | 'FLAG_NOT_FOUND' | 'PARSE_ERROR' | 'TYPE_MISMATCH';
|
|
159
|
+
/**
|
|
160
|
+
* Detailed information about a feature flag evaluation.
|
|
161
|
+
*
|
|
162
|
+
* Contains both the evaluated flag value and metadata about the evaluation,
|
|
163
|
+
* including the variant served, evaluation reason, and any errors that occurred.
|
|
164
|
+
*/
|
|
165
|
+
export interface FlagDetails<T> {
|
|
166
|
+
/**
|
|
167
|
+
* The feature flag key that was evaluated.
|
|
168
|
+
*/
|
|
169
|
+
key: string;
|
|
170
|
+
/**
|
|
171
|
+
* The evaluated flag value.
|
|
172
|
+
*
|
|
173
|
+
* Falls back to the default value if evaluation failed.
|
|
174
|
+
*/
|
|
175
|
+
value: T;
|
|
176
|
+
/**
|
|
177
|
+
* The reason why this evaluation result was returned.
|
|
178
|
+
*/
|
|
179
|
+
reason: string;
|
|
180
|
+
/**
|
|
181
|
+
* The variant key for the evaluated flag.
|
|
182
|
+
*
|
|
183
|
+
* Variants identify which version of the flag was served.
|
|
184
|
+
*/
|
|
185
|
+
variant?: string;
|
|
186
|
+
/**
|
|
187
|
+
* The allocation key for the evaluated flag.
|
|
188
|
+
*
|
|
189
|
+
* Useful for debugging targeting rules.
|
|
190
|
+
*/
|
|
191
|
+
allocationKey?: string;
|
|
192
|
+
/**
|
|
193
|
+
* Code of the error that occurred during evaluation, if any.
|
|
194
|
+
*/
|
|
195
|
+
errorCode?: FlagErrorCode;
|
|
196
|
+
/**
|
|
197
|
+
* Detailed explanation of the occurred error, if any.
|
|
198
|
+
*/
|
|
199
|
+
errorMessage?: string;
|
|
200
|
+
}
|
|
201
|
+
export {};
|
|
202
|
+
//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aAAa,GACZ,oBAAoB,GACpB,gBAAgB,GAChB,aAAa,GACb,eAAe,CAAC;AAEtB;;;;;GAKG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC;IAC1B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,KAAK,EAAE,CAAC,CAAC;IACT;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB"}
|
|
@@ -16,6 +16,9 @@ import { ProxyConfiguration, ProxyType } from './config/types/ProxyConfiguration
|
|
|
16
16
|
import { SdkVerbosity } from './config/types/SdkVerbosity';
|
|
17
17
|
import { TrackingConsent } from './config/types/TrackingConsent';
|
|
18
18
|
import { BatchProcessingLevel, BatchSize, InitializationMode, UploadFrequency, VitalsUpdateFrequency } from './config/types';
|
|
19
|
+
import { DdFlags } from './flags/DdFlags';
|
|
20
|
+
import type { FlagsClient } from './flags/FlagsClient';
|
|
21
|
+
import type { FlagsConfiguration, FlagDetails, EvaluationContext, PrimitiveValue } from './flags/types';
|
|
19
22
|
import { DdLogs } from './logs/DdLogs';
|
|
20
23
|
import { DdRum } from './rum/DdRum';
|
|
21
24
|
import { DdBabelInteractionTracking } from './rum/instrumentation/interactionTracking/DdBabelInteractionTracking';
|
|
@@ -33,6 +36,6 @@ import { ErrorSource, FeatureOperationFailure } from './types';
|
|
|
33
36
|
import { DefaultTimeProvider } from './utils/time-provider/DefaultTimeProvider';
|
|
34
37
|
import type { Timestamp } from './utils/time-provider/TimeProvider';
|
|
35
38
|
import { TimeProvider } from './utils/time-provider/TimeProvider';
|
|
36
|
-
export { DatadogProvider, DatadogProviderConfiguration, FileBasedConfiguration, InitializationMode, DdLogs, DdTrace, DdRum, RumActionType, ErrorSource, FeatureOperationFailure, CoreConfiguration, RumConfiguration, LogsConfiguration, TraceConfiguration, DdSdkReactNative, DdSdk, InternalLog, ProxyConfiguration, ProxyType, TrackingConsent, SdkVerbosity, VitalsUpdateFrequency, PropagatorType, UploadFrequency, BatchSize, BatchProcessingLevel, TimeProvider, DefaultTimeProvider, DATADOG_GRAPH_QL_OPERATION_TYPE_HEADER, DATADOG_GRAPH_QL_OPERATION_NAME_HEADER, DATADOG_GRAPH_QL_VARIABLES_HEADER, TracingIdType, TracingIdFormat, DatadogTracingIdentifier, DatadogTracingContext, DdBabelInteractionTracking, __ddExtractText };
|
|
37
|
-
export type { Timestamp, FirstPartyHost, AutoInstrumentationConfiguration, PartialInitializationConfiguration, CoreConfigurationOptions, RumConfigurationOptions, LogsConfigurationOptions, TraceConfigurationOptions };
|
|
39
|
+
export { DatadogProvider, DatadogProviderConfiguration, FileBasedConfiguration, InitializationMode, DdLogs, DdFlags, DdTrace, DdRum, RumActionType, ErrorSource, FeatureOperationFailure, CoreConfiguration, RumConfiguration, LogsConfiguration, TraceConfiguration, DdSdkReactNative, DdSdk, InternalLog, ProxyConfiguration, ProxyType, TrackingConsent, SdkVerbosity, VitalsUpdateFrequency, PropagatorType, UploadFrequency, BatchSize, BatchProcessingLevel, TimeProvider, DefaultTimeProvider, DATADOG_GRAPH_QL_OPERATION_TYPE_HEADER, DATADOG_GRAPH_QL_OPERATION_NAME_HEADER, DATADOG_GRAPH_QL_VARIABLES_HEADER, TracingIdType, TracingIdFormat, DatadogTracingIdentifier, DatadogTracingContext, DdBabelInteractionTracking, __ddExtractText };
|
|
40
|
+
export type { Timestamp, FirstPartyHost, AutoInstrumentationConfiguration, PartialInitializationConfiguration, CoreConfigurationOptions, RumConfigurationOptions, LogsConfigurationOptions, TraceConfigurationOptions, FlagsConfiguration, FlagsClient, EvaluationContext, PrimitiveValue, FlagDetails };
|
|
38
41
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1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AM,oCAAoC,CAAC;AAElE,OAAO,EACH,eAAe,EACf,4BAA4B,EAC5B,sBAAsB,EACtB,kBAAkB,EAClB,MAAM,EACN,OAAO,EACP,OAAO,EACP,KAAK,EACL,aAAa,EACb,WAAW,EACX,uBAAuB,EACvB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,EACL,WAAW,EACX,kBAAkB,EAClB,SAAS,EACT,eAAe,EACf,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACd,eAAe,EACf,SAAS,EACT,oBAAoB,EACpB,YAAY,EACZ,mBAAmB,EACnB,sCAAsC,EACtC,sCAAsC,EACtC,iCAAiC,EACjC,aAAa,EACb,eAAe,EACf,wBAAwB,EACxB,qBAAqB,EACrB,0BAA0B,EAC1B,eAAe,EAClB,CAAC;AACF,YAAY,EACR,SAAS,EACT,cAAc,EACd,gCAAgC,EAChC,kCAAkC,EAClC,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EACzB,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,WAAW,EACd,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { DdSdkNativeConfiguration } from './config/features/CoreConfigurationNative';
|
|
2
|
+
import type { Spec as NativeDdFlags } from './specs/NativeDdFlags';
|
|
2
3
|
import type { Spec as NativeDdLogs } from './specs/NativeDdLogs';
|
|
3
4
|
import type { Spec as NativeDdRum } from './specs/NativeDdRum';
|
|
4
5
|
import type { Spec as NativeDdSdk } from './specs/NativeDdSdk';
|
|
@@ -15,6 +16,10 @@ export type DdNativeLogsType = NativeDdLogs;
|
|
|
15
16
|
* The entry point to use Datadog's Trace feature.
|
|
16
17
|
*/
|
|
17
18
|
export type DdNativeTraceType = NativeDdTrace;
|
|
19
|
+
/**
|
|
20
|
+
* The entry point to use Datadog's Flags feature.
|
|
21
|
+
*/
|
|
22
|
+
export type DdNativeFlagsType = NativeDdFlags;
|
|
18
23
|
/**
|
|
19
24
|
* The entry point to initialize Datadog's features.
|
|
20
25
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativeModulesTypes.d.ts","sourceRoot":"","sources":["../../src/nativeModulesTypes.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAC1F,OAAO,KAAK,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEnE;;;GAGG;AAEH;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAE5C;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAChD;;;OAGG;IACH,UAAU,CAAC,aAAa,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtE;AAED,KAAK,UAAU,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEjE,KAAK,YAAY,GACX,OAAO,GACP,KAAK,GACL,QAAQ,GACR,KAAK,GACL,UAAU,GACV,OAAO,GACP,MAAM,GACN,IAAI,GACJ,OAAO,GACP,OAAO,GACP,QAAQ,CAAC;AAEf,KAAK,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE3E;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAChD;;;;;;OAMG;IACH,WAAW,CACP,IAAI,EAAE,UAAU,EAChB,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Z,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB;;;;;;;;OAQG;IACH,YAAY,CACR,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB;;;;;;;;OAQG;IACH,QAAQ,CACJ,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAAG,SAAS,GAChC,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { DatadogBuffer } from './DatadogBuffer';
|
|
2
|
-
|
|
3
|
-
private
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
declare class _BufferSingleton {
|
|
3
|
+
private bufferInstance;
|
|
4
|
+
getInstance: () => DatadogBuffer;
|
|
5
|
+
onInitialization: () => void;
|
|
6
|
+
reset: () => void;
|
|
7
7
|
}
|
|
8
|
+
export declare const BufferSingleton: _BufferSingleton;
|
|
9
|
+
export {};
|
|
8
10
|
//# sourceMappingURL=BufferSingleton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BufferSingleton.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/DatadogProvider/Buffer/BufferSingleton.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BufferSingleton.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/DatadogProvider/Buffer/BufferSingleton.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAKrD,cAAM,gBAAgB;IAClB,OAAO,CAAC,cAAc,CAAsC;IAE5D,WAAW,QAAO,aAAa,CAE7B;IAEF,gBAAgB,aAGd;IAEF,KAAK,aAEH;CACL;AAED,eAAO,MAAM,eAAe,kBAG3B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
import type { FlagCacheEntry } from '../flags/internal';
|
|
3
|
+
/**
|
|
4
|
+
* Do not import this Spec directly, use DdNativeFlagsType instead.
|
|
5
|
+
*/
|
|
6
|
+
export interface Spec extends TurboModule {
|
|
7
|
+
readonly enable: (configuration: Object) => Promise<void>;
|
|
8
|
+
readonly setEvaluationContext: (clientName: string, targetingKey: string, attributes: Object) => Promise<{
|
|
9
|
+
[key: string]: FlagCacheEntry;
|
|
10
|
+
}>;
|
|
11
|
+
readonly trackEvaluation: (clientName: string, key: string, rawFlag: Object, targetingKey: string, attributes: Object) => Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
declare const _default: Spec | null;
|
|
14
|
+
export default _default;
|
|
15
|
+
//# sourceMappingURL=NativeDdFlags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeDdFlags.d.ts","sourceRoot":"","sources":["../../../src/specs/NativeDdFlags.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,IAAK,SAAQ,WAAW;IACrC,QAAQ,CAAC,MAAM,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1D,QAAQ,CAAC,oBAAoB,EAAE,CAC3B,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,KACjB,OAAO,CAAC;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;KAAE,CAAC,CAAC;IAEhD,QAAQ,CAAC,eAAe,EAAE,CACtB,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,KACjB,OAAO,CAAC,IAAI,CAAC,CAAC;CACtB;;AAGD,wBAAwD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "3.
|
|
1
|
+
export declare const version = "3.1.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datadog/mobile-react-native",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "A client-side React Native module to interact with Datadog",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"datadog",
|
|
@@ -118,5 +118,5 @@
|
|
|
118
118
|
"dependencies": {
|
|
119
119
|
"big-integer": "^1.6.52"
|
|
120
120
|
},
|
|
121
|
-
"gitHead": "
|
|
121
|
+
"gitHead": "5d7701cabda497319391937073b2456dc83a0e62"
|
|
122
122
|
}
|
package/src/InternalLog.tsx
CHANGED
|
@@ -5,30 +5,33 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { SdkVerbosity } from './config/types/SdkVerbosity';
|
|
8
|
+
import { getGlobalInstance } from './utils/singletonUtils';
|
|
8
9
|
|
|
9
10
|
export const DATADOG_MESSAGE_PREFIX = 'DATADOG:';
|
|
10
11
|
|
|
12
|
+
const INTERNAL_LOG_MODULE = 'com.datadog.reactnative.internal_log';
|
|
13
|
+
|
|
11
14
|
/**
|
|
12
15
|
* /!\ DO NOT USE THIS IN YOUR APP /!\\
|
|
13
16
|
*
|
|
14
17
|
* This logger is only for debugging the Datadog SDK.
|
|
15
18
|
*/
|
|
16
|
-
|
|
17
|
-
private
|
|
19
|
+
class _InternalLog {
|
|
20
|
+
private levelMap = new Map<SdkVerbosity, number>([
|
|
18
21
|
[SdkVerbosity.DEBUG, 1],
|
|
19
22
|
[SdkVerbosity.INFO, 2],
|
|
20
23
|
[SdkVerbosity.WARN, 3],
|
|
21
24
|
[SdkVerbosity.ERROR, 4]
|
|
22
25
|
]);
|
|
23
26
|
|
|
24
|
-
public
|
|
27
|
+
public verbosity: SdkVerbosity | undefined = undefined;
|
|
25
28
|
|
|
26
|
-
public
|
|
27
|
-
if (
|
|
29
|
+
public log(message: string, verbosity: SdkVerbosity): void {
|
|
30
|
+
if (this.verbosity === undefined) {
|
|
28
31
|
return;
|
|
29
32
|
}
|
|
30
33
|
const requiredLevel = InternalLog.levelMap.get(verbosity);
|
|
31
|
-
const allowedLevel = InternalLog.levelMap.get(
|
|
34
|
+
const allowedLevel = InternalLog.levelMap.get(this.verbosity);
|
|
32
35
|
if (allowedLevel === undefined || requiredLevel === undefined) {
|
|
33
36
|
return;
|
|
34
37
|
}
|
|
@@ -50,3 +53,8 @@ export class InternalLog {
|
|
|
50
53
|
}
|
|
51
54
|
}
|
|
52
55
|
}
|
|
56
|
+
|
|
57
|
+
export const InternalLog = getGlobalInstance(
|
|
58
|
+
INTERNAL_LOG_MODULE,
|
|
59
|
+
() => new _InternalLog()
|
|
60
|
+
);
|
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
import { InternalLog } from '../InternalLog';
|
|
8
|
+
import { SdkVerbosity } from '../config/types/SdkVerbosity';
|
|
9
|
+
import type { DdNativeFlagsType } from '../nativeModulesTypes';
|
|
10
|
+
import { getGlobalInstance } from '../utils/singletonUtils';
|
|
11
|
+
|
|
12
|
+
import { FlagsClient } from './FlagsClient';
|
|
13
|
+
import type { DdFlagsType, FlagsConfiguration } from './types';
|
|
14
|
+
|
|
15
|
+
const FLAGS_MODULE = 'com.datadog.reactnative.flags';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Implementation class for {@link DdFlagsType}. Please see the interface for documentation.
|
|
19
|
+
*/
|
|
20
|
+
class DdFlagsWrapper implements DdFlagsType {
|
|
21
|
+
// eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
|
|
22
|
+
private nativeFlags: DdNativeFlagsType = require('../specs/NativeDdFlags')
|
|
23
|
+
.default;
|
|
24
|
+
|
|
25
|
+
private isFeatureEnabled = false;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A map of client names to their corresponding {@link FlagsClient} instances.
|
|
29
|
+
*
|
|
30
|
+
* Each of these clients hold their own context and flags state.
|
|
31
|
+
*/
|
|
32
|
+
private clients: Record<string, FlagsClient> = {};
|
|
33
|
+
|
|
34
|
+
enable = async (configuration: FlagsConfiguration = {}): Promise<void> => {
|
|
35
|
+
await this.nativeFlags.enable({ enabled: true, ...configuration });
|
|
36
|
+
|
|
37
|
+
this.isFeatureEnabled = true;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
getClient = (clientName: string = 'default'): FlagsClient => {
|
|
41
|
+
if (!this.isFeatureEnabled) {
|
|
42
|
+
InternalLog.log(
|
|
43
|
+
'`DdFlags.getClient()` called before Datadog Flags feature have been enabled. Client will fall back to serving default flag values.',
|
|
44
|
+
SdkVerbosity.ERROR
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (!this.clients[clientName]) {
|
|
49
|
+
this.clients[clientName] = new FlagsClient(clientName);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return this.clients[clientName];
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export const DdFlags: DdFlagsType = getGlobalInstance(
|
|
57
|
+
FLAGS_MODULE,
|
|
58
|
+
() => new DdFlagsWrapper()
|
|
59
|
+
);
|