@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.
Files changed (79) hide show
  1. package/lib/typescript/core/src/DdSdkReactNative.d.ts.map +1 -1
  2. package/lib/typescript/core/src/config/FileBasedConfiguration.d.ts.map +1 -1
  3. package/lib/typescript/core/src/config/FileBasedConfiguration.type.d.ts +2 -0
  4. package/lib/typescript/core/src/config/FileBasedConfiguration.type.d.ts.map +1 -1
  5. package/lib/typescript/core/src/config/async/AutoInstrumentationConfiguration.d.ts +3 -0
  6. package/lib/typescript/core/src/config/async/AutoInstrumentationConfiguration.d.ts.map +1 -1
  7. package/lib/typescript/core/src/config/features/RumConfiguration.d.ts +3 -1
  8. package/lib/typescript/core/src/config/features/RumConfiguration.d.ts.map +1 -1
  9. package/lib/typescript/core/src/config/features/RumConfiguration.type.d.ts +107 -0
  10. package/lib/typescript/core/src/config/features/RumConfiguration.type.d.ts.map +1 -1
  11. package/lib/typescript/core/src/flags/DdFlags.d.ts.map +1 -1
  12. package/lib/typescript/core/src/flags/FlagsClient.d.ts +1 -1
  13. package/lib/typescript/core/src/flags/FlagsClient.d.ts.map +1 -1
  14. package/lib/typescript/core/src/index.d.ts +1 -0
  15. package/lib/typescript/core/src/index.d.ts.map +1 -1
  16. package/lib/typescript/core/src/logs/DdLogs.d.ts +1 -1
  17. package/lib/typescript/core/src/logs/DdLogs.d.ts.map +1 -1
  18. package/lib/typescript/core/src/rum/DdRum.d.ts +2 -1
  19. package/lib/typescript/core/src/rum/DdRum.d.ts.map +1 -1
  20. package/lib/typescript/core/src/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.d.ts.map +1 -1
  21. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts +3 -1
  22. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts.map +1 -1
  23. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.d.ts +1 -0
  24. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.d.ts.map +1 -1
  25. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/captureHeaders.d.ts +85 -0
  26. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/captureHeaders.d.ts.map +1 -0
  27. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/compileHeaderConfig.d.ts +18 -0
  28. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/compileHeaderConfig.d.ts.map +1 -0
  29. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/enforceSizeLimits.d.ts +24 -0
  30. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/enforceSizeLimits.d.ts.map +1 -0
  31. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/isHeaderAllowed.d.ts +12 -0
  32. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/isHeaderAllowed.d.ts.map +1 -0
  33. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/normalizeUrlForMatching.d.ts +28 -0
  34. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/normalizeUrlForMatching.d.ts.map +1 -0
  35. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/parseResponseHeaders.d.ts +16 -0
  36. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/parseResponseHeaders.d.ts.map +1 -0
  37. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/sensitiveHeaderBlocklist.d.ts +13 -0
  38. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/sensitiveHeaderBlocklist.d.ts.map +1 -0
  39. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/tracingHeaderExclusion.d.ts +13 -0
  40. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/tracingHeaderExclusion.d.ts.map +1 -0
  41. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/types.d.ts +27 -0
  42. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/types.d.ts.map +1 -0
  43. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/FetchProxy/FetchProxy.d.ts.map +1 -1
  44. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.d.ts.map +1 -1
  45. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.d.ts.map +1 -1
  46. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/common/RequestContext.d.ts +4 -0
  47. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/common/RequestContext.d.ts.map +1 -1
  48. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/common/headerCapture.d.ts +43 -0
  49. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/common/headerCapture.d.ts.map +1 -0
  50. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.d.ts +2 -0
  51. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.d.ts.map +1 -1
  52. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts +2 -0
  53. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts.map +1 -1
  54. package/lib/typescript/core/src/rum/types.d.ts +6 -0
  55. package/lib/typescript/core/src/rum/types.d.ts.map +1 -1
  56. package/lib/typescript/core/src/sdk/AccountInfoSingleton/AccountInfoSingleton.d.ts.map +1 -1
  57. package/lib/typescript/core/src/sdk/DatadogEventEmitter/DatadogDefaultEventEmitter.d.ts.map +1 -1
  58. package/lib/typescript/core/src/sdk/DdSdkInternal.d.ts +1 -0
  59. package/lib/typescript/core/src/sdk/DdSdkInternal.d.ts.map +1 -1
  60. package/lib/typescript/core/src/sdk/UserInfoSingleton/UserInfoSingleton.d.ts.map +1 -1
  61. package/lib/typescript/core/src/specs/NativeDdFlags.d.ts +7 -2
  62. package/lib/typescript/core/src/specs/NativeDdFlags.d.ts.map +1 -1
  63. package/lib/typescript/core/src/specs/NativeDdLogs.d.ts +7 -2
  64. package/lib/typescript/core/src/specs/NativeDdLogs.d.ts.map +1 -1
  65. package/lib/typescript/core/src/specs/NativeDdRum.d.ts +13 -2
  66. package/lib/typescript/core/src/specs/NativeDdRum.d.ts.map +1 -1
  67. package/lib/typescript/core/src/specs/NativeDdSdk.d.ts +7 -2
  68. package/lib/typescript/core/src/specs/NativeDdSdk.d.ts.map +1 -1
  69. package/lib/typescript/core/src/specs/NativeDdTrace.d.ts +7 -2
  70. package/lib/typescript/core/src/specs/NativeDdTrace.d.ts.map +1 -1
  71. package/lib/typescript/core/src/trace/DdTrace.d.ts.map +1 -1
  72. package/lib/typescript/core/src/utils/stringUtils.d.ts +12 -0
  73. package/lib/typescript/core/src/utils/stringUtils.d.ts.map +1 -0
  74. package/lib/typescript/core/src/version.d.ts +1 -1
  75. package/package.json +3 -3
  76. package/src/__tests__/entrypoints.test.ts +2 -2
  77. package/src/__tests__/offlineProvider.delegation.test.ts +4 -4
  78. package/src/__tests__/offlineProvider.integration.test.ts +2 -2
  79. 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 NativeDdFlags from '../../../core/src/specs/NativeDdFlags';
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
- default: {
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
- default: {
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(NativeDdFlags.setEvaluationContext).toHaveBeenCalledWith(
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(NativeDdFlags.setEvaluationContext).toHaveBeenCalledWith(
122
+ expect(getNativeDdFlags()?.setEvaluationContext).toHaveBeenCalledWith(
123
123
  clientName,
124
124
  'rum-user',
125
125
  expectedAttributes
126
126
  );
127
- expect(NativeDdFlags.trackEvaluation).toHaveBeenCalledWith(
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(NativeDdFlags.setEvaluationContext).toHaveBeenCalledWith(
189
- clientName,
190
- '',
191
- expectedAttributes
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(NativeDdFlags.setEvaluationContext).toHaveBeenCalledWith(
221
+ expect(getNativeDdFlags()?.setEvaluationContext).toHaveBeenCalledWith(
224
222
  clientName,
225
223
  'rum-user',
226
224
  expectedAttributes
227
225
  );
228
- expect(NativeDdFlags.trackEvaluation).toHaveBeenCalledWith(
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
- NativeDdFlags.trackEvaluation
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
- NativeDdFlags.setEvaluationContext
312
+ getNativeDdFlags()?.setEvaluationContext
317
313
  ).toHaveBeenLastCalledWith(clientName, '', { region: 'us' });
318
314
  expect(
319
- NativeDdFlags.trackEvaluation
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(NativeDdFlags.setEvaluationContext).toHaveBeenLastCalledWith(
380
- clientName,
381
- 'rum-user',
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(NativeDdFlags.setEvaluationContext).toHaveBeenCalledWith(
395
+ expect(getNativeDdFlags()?.setEvaluationContext).toHaveBeenCalledWith(
402
396
  clientName,
403
397
  'rum-user',
404
398
  {}
405
399
  );
406
- expect(NativeDdFlags.trackEvaluation).toHaveBeenCalledWith(
400
+ expect(getNativeDdFlags()?.trackEvaluation).toHaveBeenCalledWith(
407
401
  clientName,
408
402
  'test-flag',
409
403
  expect.any(Object),