@datadog/mobile-react-native-openfeature 3.10.0 → 3.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/typescript/core/src/DdSdkReactNative.d.ts.map +1 -1
- package/lib/typescript/core/src/config/FileBasedConfiguration.d.ts.map +1 -1
- package/lib/typescript/core/src/config/FileBasedConfiguration.type.d.ts +2 -0
- package/lib/typescript/core/src/config/FileBasedConfiguration.type.d.ts.map +1 -1
- package/lib/typescript/core/src/config/async/AutoInstrumentationConfiguration.d.ts +3 -0
- package/lib/typescript/core/src/config/async/AutoInstrumentationConfiguration.d.ts.map +1 -1
- package/lib/typescript/core/src/config/features/RumConfiguration.d.ts +3 -1
- package/lib/typescript/core/src/config/features/RumConfiguration.d.ts.map +1 -1
- package/lib/typescript/core/src/config/features/RumConfiguration.type.d.ts +107 -0
- package/lib/typescript/core/src/config/features/RumConfiguration.type.d.ts.map +1 -1
- package/lib/typescript/core/src/flags/DdFlags.d.ts.map +1 -1
- package/lib/typescript/core/src/flags/FlagsClient.d.ts +1 -1
- package/lib/typescript/core/src/flags/FlagsClient.d.ts.map +1 -1
- package/lib/typescript/core/src/index.d.ts +1 -0
- package/lib/typescript/core/src/index.d.ts.map +1 -1
- package/lib/typescript/core/src/logs/DdLogs.d.ts +1 -1
- package/lib/typescript/core/src/logs/DdLogs.d.ts.map +1 -1
- package/lib/typescript/core/src/rum/DdRum.d.ts +2 -1
- package/lib/typescript/core/src/rum/DdRum.d.ts.map +1 -1
- package/lib/typescript/core/src/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.d.ts.map +1 -1
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts +3 -1
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts.map +1 -1
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.d.ts +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.d.ts.map +1 -1
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/captureHeaders.d.ts +85 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/captureHeaders.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/compileHeaderConfig.d.ts +18 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/compileHeaderConfig.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/enforceSizeLimits.d.ts +24 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/enforceSizeLimits.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/isHeaderAllowed.d.ts +12 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/isHeaderAllowed.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/normalizeUrlForMatching.d.ts +28 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/normalizeUrlForMatching.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/parseResponseHeaders.d.ts +16 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/parseResponseHeaders.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/sensitiveHeaderBlocklist.d.ts +13 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/sensitiveHeaderBlocklist.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/tracingHeaderExclusion.d.ts +13 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/tracingHeaderExclusion.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/types.d.ts +27 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/types.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/FetchProxy/FetchProxy.d.ts.map +1 -1
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.d.ts.map +1 -1
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.d.ts.map +1 -1
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/common/RequestContext.d.ts +4 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/common/RequestContext.d.ts.map +1 -1
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/common/headerCapture.d.ts +43 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/common/headerCapture.d.ts.map +1 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.d.ts +2 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.d.ts.map +1 -1
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts +2 -0
- package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts.map +1 -1
- package/lib/typescript/core/src/rum/types.d.ts +6 -0
- package/lib/typescript/core/src/rum/types.d.ts.map +1 -1
- package/lib/typescript/core/src/sdk/AccountInfoSingleton/AccountInfoSingleton.d.ts.map +1 -1
- package/lib/typescript/core/src/sdk/DatadogEventEmitter/DatadogDefaultEventEmitter.d.ts.map +1 -1
- package/lib/typescript/core/src/sdk/DdSdkInternal.d.ts +1 -0
- package/lib/typescript/core/src/sdk/DdSdkInternal.d.ts.map +1 -1
- package/lib/typescript/core/src/sdk/UserInfoSingleton/UserInfoSingleton.d.ts.map +1 -1
- package/lib/typescript/core/src/specs/NativeDdFlags.d.ts +7 -2
- package/lib/typescript/core/src/specs/NativeDdFlags.d.ts.map +1 -1
- package/lib/typescript/core/src/specs/NativeDdLogs.d.ts +7 -2
- package/lib/typescript/core/src/specs/NativeDdLogs.d.ts.map +1 -1
- package/lib/typescript/core/src/specs/NativeDdRum.d.ts +13 -2
- package/lib/typescript/core/src/specs/NativeDdRum.d.ts.map +1 -1
- package/lib/typescript/core/src/specs/NativeDdSdk.d.ts +7 -2
- package/lib/typescript/core/src/specs/NativeDdSdk.d.ts.map +1 -1
- package/lib/typescript/core/src/specs/NativeDdTrace.d.ts +7 -2
- package/lib/typescript/core/src/specs/NativeDdTrace.d.ts.map +1 -1
- package/lib/typescript/core/src/trace/DdTrace.d.ts.map +1 -1
- package/lib/typescript/core/src/utils/stringUtils.d.ts +12 -0
- package/lib/typescript/core/src/utils/stringUtils.d.ts.map +1 -0
- package/lib/typescript/core/src/version.d.ts +1 -1
- package/package.json +3 -3
- package/src/__tests__/entrypoints.test.ts +2 -2
- package/src/__tests__/offlineProvider.delegation.test.ts +4 -4
- package/src/__tests__/offlineProvider.integration.test.ts +2 -2
- package/src/__tests__/rumContext.integration.test.ts +29 -35
|
@@ -10,13 +10,13 @@ import { InMemoryProvider, OpenFeature } from '@openfeature/web-sdk';
|
|
|
10
10
|
import { InternalLog } from '../../../core/src/InternalLog';
|
|
11
11
|
import { SdkVerbosity } from '../../../core/src/config/types/SdkVerbosity';
|
|
12
12
|
import { UserInfoSingleton } from '../../../core/src/sdk/UserInfoSingleton/UserInfoSingleton';
|
|
13
|
-
import
|
|
13
|
+
import { getNativeDdFlags } from '../../../core/src/specs/NativeDdFlags';
|
|
14
14
|
import { DatadogOpenFeatureProvider } from '../provider';
|
|
15
15
|
import { enrichWithRumUser } from '../rumContext';
|
|
16
16
|
|
|
17
17
|
jest.mock('../../../core/src/specs/NativeDdFlags', () => ({
|
|
18
18
|
__esModule: true,
|
|
19
|
-
|
|
19
|
+
getNativeDdFlags: jest.fn().mockReturnValue({
|
|
20
20
|
enable: jest.fn(() => Promise.resolve()),
|
|
21
21
|
setEvaluationContext: jest.fn(() =>
|
|
22
22
|
Promise.resolve({
|
|
@@ -34,15 +34,15 @@ jest.mock('../../../core/src/specs/NativeDdFlags', () => ({
|
|
|
34
34
|
})
|
|
35
35
|
),
|
|
36
36
|
trackEvaluation: jest.fn(() => Promise.resolve())
|
|
37
|
-
}
|
|
37
|
+
})
|
|
38
38
|
}));
|
|
39
39
|
|
|
40
40
|
jest.mock('../../../core/src/specs/NativeDdSdk', () => ({
|
|
41
41
|
__esModule: true,
|
|
42
|
-
|
|
42
|
+
getNativeDdSdk: jest.fn().mockReturnValue({
|
|
43
43
|
setUserInfo: jest.fn(() => Promise.resolve()),
|
|
44
44
|
clearUserInfo: jest.fn(() => Promise.resolve())
|
|
45
|
-
}
|
|
45
|
+
})
|
|
46
46
|
}));
|
|
47
47
|
|
|
48
48
|
let testSequence = 0;
|
|
@@ -87,7 +87,7 @@ describe('explicit RUM context enrichment', () => {
|
|
|
87
87
|
|
|
88
88
|
const { clientName } = await setupProvider({});
|
|
89
89
|
|
|
90
|
-
expect(
|
|
90
|
+
expect(getNativeDdFlags()?.setEvaluationContext).toHaveBeenCalledWith(
|
|
91
91
|
clientName,
|
|
92
92
|
'',
|
|
93
93
|
{}
|
|
@@ -119,12 +119,12 @@ describe('explicit RUM context enrichment', () => {
|
|
|
119
119
|
company_name: 'Example, Inc.'
|
|
120
120
|
};
|
|
121
121
|
expect(OpenFeature.getContext(domain)).toStrictEqual(enrichedContext);
|
|
122
|
-
expect(
|
|
122
|
+
expect(getNativeDdFlags()?.setEvaluationContext).toHaveBeenCalledWith(
|
|
123
123
|
clientName,
|
|
124
124
|
'rum-user',
|
|
125
125
|
expectedAttributes
|
|
126
126
|
);
|
|
127
|
-
expect(
|
|
127
|
+
expect(getNativeDdFlags()?.trackEvaluation).toHaveBeenCalledWith(
|
|
128
128
|
clientName,
|
|
129
129
|
'test-flag',
|
|
130
130
|
expect.any(Object),
|
|
@@ -185,12 +185,10 @@ describe('explicit RUM context enrichment', () => {
|
|
|
185
185
|
"The evaluation context targetingKey is not a string. Using the anonymous subject ('') instead.",
|
|
186
186
|
SdkVerbosity.WARN
|
|
187
187
|
);
|
|
188
|
-
expect(
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
);
|
|
193
|
-
expect(NativeDdFlags.trackEvaluation).toHaveBeenCalledWith(
|
|
188
|
+
expect(
|
|
189
|
+
getNativeDdFlags()?.setEvaluationContext
|
|
190
|
+
).toHaveBeenCalledWith(clientName, '', expectedAttributes);
|
|
191
|
+
expect(getNativeDdFlags()?.trackEvaluation).toHaveBeenCalledWith(
|
|
194
192
|
clientName,
|
|
195
193
|
'test-flag',
|
|
196
194
|
expect.any(Object),
|
|
@@ -220,12 +218,12 @@ describe('explicit RUM context enrichment', () => {
|
|
|
220
218
|
targetingKey: 'rum-user',
|
|
221
219
|
...expectedAttributes
|
|
222
220
|
});
|
|
223
|
-
expect(
|
|
221
|
+
expect(getNativeDdFlags()?.setEvaluationContext).toHaveBeenCalledWith(
|
|
224
222
|
clientName,
|
|
225
223
|
'rum-user',
|
|
226
224
|
expectedAttributes
|
|
227
225
|
);
|
|
228
|
-
expect(
|
|
226
|
+
expect(getNativeDdFlags()?.trackEvaluation).toHaveBeenCalledWith(
|
|
229
227
|
clientName,
|
|
230
228
|
'test-flag',
|
|
231
229
|
expect.any(Object),
|
|
@@ -262,17 +260,15 @@ describe('explicit RUM context enrichment', () => {
|
|
|
262
260
|
region: 'us'
|
|
263
261
|
};
|
|
264
262
|
expect(OpenFeature.getContext(domain)).toStrictEqual(expectedContext);
|
|
265
|
-
expect(NativeDdFlags.setEvaluationContext).toHaveBeenLastCalledWith(
|
|
266
|
-
clientName,
|
|
267
|
-
'rum-user-b',
|
|
268
|
-
{
|
|
269
|
-
email: 'b@example.com',
|
|
270
|
-
plan: 'pro',
|
|
271
|
-
region: 'us'
|
|
272
|
-
}
|
|
273
|
-
);
|
|
274
263
|
expect(
|
|
275
|
-
|
|
264
|
+
getNativeDdFlags()?.setEvaluationContext
|
|
265
|
+
).toHaveBeenLastCalledWith(clientName, 'rum-user-b', {
|
|
266
|
+
email: 'b@example.com',
|
|
267
|
+
plan: 'pro',
|
|
268
|
+
region: 'us'
|
|
269
|
+
});
|
|
270
|
+
expect(
|
|
271
|
+
getNativeDdFlags()?.trackEvaluation
|
|
276
272
|
).toHaveBeenLastCalledWith(
|
|
277
273
|
clientName,
|
|
278
274
|
'test-flag',
|
|
@@ -313,10 +309,10 @@ describe('explicit RUM context enrichment', () => {
|
|
|
313
309
|
applicationContext
|
|
314
310
|
);
|
|
315
311
|
expect(
|
|
316
|
-
|
|
312
|
+
getNativeDdFlags()?.setEvaluationContext
|
|
317
313
|
).toHaveBeenLastCalledWith(clientName, '', { region: 'us' });
|
|
318
314
|
expect(
|
|
319
|
-
|
|
315
|
+
getNativeDdFlags()?.trackEvaluation
|
|
320
316
|
).toHaveBeenLastCalledWith(
|
|
321
317
|
clientName,
|
|
322
318
|
'test-flag',
|
|
@@ -376,11 +372,9 @@ describe('explicit RUM context enrichment', () => {
|
|
|
376
372
|
|
|
377
373
|
const { clientName } = await setupProvider(enrichWithRumUser({}));
|
|
378
374
|
|
|
379
|
-
expect(
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
{}
|
|
383
|
-
);
|
|
375
|
+
expect(
|
|
376
|
+
getNativeDdFlags()?.setEvaluationContext
|
|
377
|
+
).toHaveBeenLastCalledWith(clientName, 'rum-user', {});
|
|
384
378
|
});
|
|
385
379
|
|
|
386
380
|
it('uses undefined application fields as tombstones for RUM attributes', async () => {
|
|
@@ -398,12 +392,12 @@ describe('explicit RUM context enrichment', () => {
|
|
|
398
392
|
expect(OpenFeature.getContext(domain)).toStrictEqual({
|
|
399
393
|
targetingKey: 'rum-user'
|
|
400
394
|
});
|
|
401
|
-
expect(
|
|
395
|
+
expect(getNativeDdFlags()?.setEvaluationContext).toHaveBeenCalledWith(
|
|
402
396
|
clientName,
|
|
403
397
|
'rum-user',
|
|
404
398
|
{}
|
|
405
399
|
);
|
|
406
|
-
expect(
|
|
400
|
+
expect(getNativeDdFlags()?.trackEvaluation).toHaveBeenCalledWith(
|
|
407
401
|
clientName,
|
|
408
402
|
'test-flag',
|
|
409
403
|
expect.any(Object),
|