@datadog/mobile-react-navigation 3.11.0 → 3.13.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 (85) 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 +4 -1
  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 +6 -0
  6. package/lib/typescript/core/src/config/async/AutoInstrumentationConfiguration.d.ts.map +1 -1
  7. package/lib/typescript/core/src/config/async/PartialInitializationConfiguration.d.ts +2 -1
  8. package/lib/typescript/core/src/config/async/PartialInitializationConfiguration.d.ts.map +1 -1
  9. package/lib/typescript/core/src/config/features/RumConfiguration.d.ts +6 -1
  10. package/lib/typescript/core/src/config/features/RumConfiguration.d.ts.map +1 -1
  11. package/lib/typescript/core/src/config/features/RumConfiguration.type.d.ts +116 -1
  12. package/lib/typescript/core/src/config/features/RumConfiguration.type.d.ts.map +1 -1
  13. package/lib/typescript/core/src/config/features/RumConfigurationNative.d.ts +2 -0
  14. package/lib/typescript/core/src/config/features/RumConfigurationNative.d.ts.map +1 -1
  15. package/lib/typescript/core/src/config/types/TimeseriesConfiguration.d.ts +19 -0
  16. package/lib/typescript/core/src/config/types/TimeseriesConfiguration.d.ts.map +1 -0
  17. package/lib/typescript/core/src/config/types/index.d.ts +2 -0
  18. package/lib/typescript/core/src/config/types/index.d.ts.map +1 -1
  19. package/lib/typescript/core/src/flags/DdFlags.d.ts.map +1 -1
  20. package/lib/typescript/core/src/flags/FlagsClient.d.ts +1 -1
  21. package/lib/typescript/core/src/flags/FlagsClient.d.ts.map +1 -1
  22. package/lib/typescript/core/src/index.d.ts +5 -2
  23. package/lib/typescript/core/src/index.d.ts.map +1 -1
  24. package/lib/typescript/core/src/logs/DdLogs.d.ts +1 -1
  25. package/lib/typescript/core/src/logs/DdLogs.d.ts.map +1 -1
  26. package/lib/typescript/core/src/rum/DdRum.d.ts +1 -1
  27. package/lib/typescript/core/src/rum/DdRum.d.ts.map +1 -1
  28. package/lib/typescript/core/src/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.d.ts.map +1 -1
  29. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts +3 -1
  30. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts.map +1 -1
  31. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.d.ts +1 -0
  32. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.d.ts.map +1 -1
  33. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/captureHeaders.d.ts +85 -0
  34. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/captureHeaders.d.ts.map +1 -0
  35. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/compileHeaderConfig.d.ts +18 -0
  36. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/compileHeaderConfig.d.ts.map +1 -0
  37. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/enforceSizeLimits.d.ts +24 -0
  38. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/enforceSizeLimits.d.ts.map +1 -0
  39. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/isHeaderAllowed.d.ts +12 -0
  40. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/isHeaderAllowed.d.ts.map +1 -0
  41. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/normalizeUrlForMatching.d.ts +28 -0
  42. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/normalizeUrlForMatching.d.ts.map +1 -0
  43. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/parseResponseHeaders.d.ts +16 -0
  44. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/parseResponseHeaders.d.ts.map +1 -0
  45. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/sensitiveHeaderBlocklist.d.ts +13 -0
  46. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/sensitiveHeaderBlocklist.d.ts.map +1 -0
  47. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/tracingHeaderExclusion.d.ts +13 -0
  48. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/tracingHeaderExclusion.d.ts.map +1 -0
  49. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/types.d.ts +27 -0
  50. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/headerCapture/types.d.ts.map +1 -0
  51. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/FetchProxy/FetchProxy.d.ts.map +1 -1
  52. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.d.ts.map +1 -1
  53. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.d.ts.map +1 -1
  54. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/common/RequestContext.d.ts +2 -0
  55. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/common/RequestContext.d.ts.map +1 -1
  56. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/common/headerCapture.d.ts +43 -0
  57. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/common/headerCapture.d.ts.map +1 -0
  58. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.d.ts +2 -0
  59. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.d.ts.map +1 -1
  60. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts +2 -0
  61. package/lib/typescript/core/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts.map +1 -1
  62. package/lib/typescript/core/src/sdk/DatadogEventEmitter/DatadogDefaultEventEmitter.d.ts.map +1 -1
  63. package/lib/typescript/core/src/sdk/DdSdkInternal.d.ts +1 -0
  64. package/lib/typescript/core/src/sdk/DdSdkInternal.d.ts.map +1 -1
  65. package/lib/typescript/core/src/specs/NativeDdFlags.d.ts +7 -2
  66. package/lib/typescript/core/src/specs/NativeDdFlags.d.ts.map +1 -1
  67. package/lib/typescript/core/src/specs/NativeDdLogs.d.ts +7 -2
  68. package/lib/typescript/core/src/specs/NativeDdLogs.d.ts.map +1 -1
  69. package/lib/typescript/core/src/specs/NativeDdRum.d.ts +7 -2
  70. package/lib/typescript/core/src/specs/NativeDdRum.d.ts.map +1 -1
  71. package/lib/typescript/core/src/specs/NativeDdSdk.d.ts +7 -2
  72. package/lib/typescript/core/src/specs/NativeDdSdk.d.ts.map +1 -1
  73. package/lib/typescript/core/src/specs/NativeDdTrace.d.ts +7 -2
  74. package/lib/typescript/core/src/specs/NativeDdTrace.d.ts.map +1 -1
  75. package/lib/typescript/core/src/trace/DdTrace.d.ts.map +1 -1
  76. package/lib/typescript/core/src/utils/stringUtils.d.ts +12 -0
  77. package/lib/typescript/core/src/utils/stringUtils.d.ts.map +1 -0
  78. package/lib/typescript/core/src/version.d.ts +1 -1
  79. package/lib/typescript/react-navigation/src/rum/instrumentation/react-navigation.d.ts +1 -1
  80. package/lib/typescript/react-navigation/src/rum/instrumentation/react-navigation.d.ts.map +1 -1
  81. package/package.json +4 -4
  82. package/src/__tests__/__utils__/navigationContainerRef.types.ts +60 -0
  83. package/src/__tests__/__utils__/tsconfig.json +9 -0
  84. package/src/__tests__/navigationContainerRef.types.test.ts +27 -0
  85. package/src/rum/instrumentation/react-navigation.ts +4 -1
@@ -30,7 +30,7 @@ export declare type Route<RouteName extends string, Params extends object | unde
30
30
  /**
31
31
  * Navigation Container
32
32
  */
33
- export declare type NavigationContainerRef = EventConsumer<NavigationContainerEventMap> & {
33
+ export declare type NavigationContainerRef = EventConsumer<Pick<NavigationContainerEventMap, 'state'>> & {
34
34
  canGoBack(): boolean;
35
35
  getCurrentRoute(): Route<string> | undefined;
36
36
  };
@@ -1 +1 @@
1
- {"version":3,"file":"react-navigation.d.ts","sourceRoot":"","sources":["../../../../../../src/rum/instrumentation/react-navigation.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AAEH;;GAEG;AAEH,MAAM,CAAC,OAAO,MAAM,KAAK,CACrB,SAAS,SAAS,MAAM,EACxB,MAAM,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,IACtD,QAAQ,CAAC;IACT;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,IAAI,EAAE,SAAS,CAAC;CACnB,CAAC,GACE,CAAC,SAAS,SAAS,MAAM,GACnB,QAAQ,CAAC;IACL;;OAEG;IACH,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CAC7B,CAAC,GACF,QAAQ,CAAC;IACL;;OAEG;IACH,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CAC5B,CAAC,CAAC,CAAC;AAEd;;GAEG;AAEH,MAAM,CAAC,OAAO,MAAM,sBAAsB,GAAG,aAAa,CAAC,2BAA2B,CAAC,GAAG;IACtF,SAAS,IAAI,OAAO,CAAC;IACrB,eAAe,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;CAChD,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,2BAA2B,GAAG;IAC9C;;OAEG;IACH,KAAK,EAAE;QACH,IAAI,EAAE;YACF;;eAEG;YACH,KAAK,EAAE,GAAG,CAAC;SACd,CAAC;KACL,CAAC;IACF;;OAEG;IACH,OAAO,EAAE;QACL,IAAI,EAAE;YACF,OAAO,EAAE,MAAM,CAAC;SACn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,MAAM,CAAC,EAAE,MAAM,CAAC;CAC5B,GAAG,CAAC,iBAAiB,SAAS,IAAI,GAC7B;IACI;;OAEG;IACH,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC;;OAEG;IACH,cAAc,IAAI,IAAI,CAAC;CAC1B,GACD,GAAG,CAAC,GACN,CAAC,SAAS,SAAS,IAAI,GACjB;IACI,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;CAClC,GACD;IACI,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;CACjC,CAAC,CAAC"}
1
+ {"version":3,"file":"react-navigation.d.ts","sourceRoot":"","sources":["../../../../../../src/rum/instrumentation/react-navigation.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AAEH;;GAEG;AAEH,MAAM,CAAC,OAAO,MAAM,KAAK,CACrB,SAAS,SAAS,MAAM,EACxB,MAAM,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,IACtD,QAAQ,CAAC;IACT;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,IAAI,EAAE,SAAS,CAAC;CACnB,CAAC,GACE,CAAC,SAAS,SAAS,MAAM,GACnB,QAAQ,CAAC;IACL;;OAEG;IACH,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CAC7B,CAAC,GACF,QAAQ,CAAC;IACL;;OAEG;IACH,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CAC5B,CAAC,CAAC,CAAC;AAEd;;GAEG;AAGH,MAAM,CAAC,OAAO,MAAM,sBAAsB,GAAG,aAAa,CACtD,IAAI,CAAC,2BAA2B,EAAE,OAAO,CAAC,CAC7C,GAAG;IACA,SAAS,IAAI,OAAO,CAAC;IACrB,eAAe,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;CAChD,CAAC;AAEF,MAAM,CAAC,OAAO,MA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AAM,CAAC,OAAO,MAAM,QAAQ,CACxB,SAAS,SAAS,MAAM,EACxB,iBAAiB,SAAS,OAAO,GAAG,SAAS,GAAG,KAAK,EACrD,IAAI,GAAG,SAAS,IAChB;IACA;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC5B,GAAG,CAAC,iBAAiB,SAAS,IAAI,GAC7B;IACI;;OAEG;IACH,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC;;OAEG;IACH,cAAc,IAAI,IAAI,CAAC;CAC1B,GACD,GAAG,CAAC,GACN,CAAC,SAAS,SAAS,IAAI,GACjB;IACI,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;CAClC,GACD;IACI,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;CACjC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datadog/mobile-react-navigation",
3
- "version": "3.11.0",
3
+ "version": "3.13.0",
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": "^3.11.0",
39
+ "@datadog/mobile-react-native": "^3.13.0",
40
40
  "@react-navigation/native-v5": "npm:@react-navigation/native@5.9.8",
41
41
  "@react-navigation/native-v6": "npm:@react-navigation/native@6.1.2",
42
42
  "@react-navigation/stack-v5": "npm:@react-navigation/stack@5.14.2",
@@ -49,7 +49,7 @@
49
49
  "peerDependencies": {
50
50
  "@datadog/mobile-react-native": "^3.0.0",
51
51
  "react": ">=16.13.1",
52
- "react-native": ">=0.63.4 <1.0"
52
+ "react-native": ">=0.75.0 <1.0"
53
53
  },
54
54
  "jest": {
55
55
  "preset": "react-native",
@@ -83,5 +83,5 @@
83
83
  ]
84
84
  ]
85
85
  },
86
- "gitHead": "740f7bb57bf494788159bc5b6f7d9fd2673c3879"
86
+ "gitHead": "2d61c347c3e70597dcfd19d05a6e5473ad3bac13"
87
87
  }
@@ -0,0 +1,60 @@
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 type {
8
+ NavigationContainerEventMap,
9
+ NavigationContainerRef
10
+ } from '../../rum/instrumentation/react-navigation';
11
+
12
+ type ContainerMethods = {
13
+ canGoBack(): boolean;
14
+ getCurrentRoute():
15
+ | Readonly<{ key: string; name: string; params?: object }>
16
+ | undefined;
17
+ };
18
+
19
+ type ContainerRef<EventName extends string> = ContainerMethods & {
20
+ addListener<Name extends EventName>(
21
+ type: Name,
22
+ callback: (event: {
23
+ readonly type: Name;
24
+ readonly data: unknown;
25
+ }) => void
26
+ ): () => void;
27
+ removeListener<Name extends EventName>(
28
+ type: Name,
29
+ callback: (event: {
30
+ readonly type: Name;
31
+ readonly data: unknown;
32
+ }) => void
33
+ ): void;
34
+ };
35
+
36
+ type StateOnlyRef = ContainerRef<'state'>;
37
+
38
+ // Compiled, not executed: valid refs must compile, and invalid refs must stay rejected.
39
+ export const checkNavigationContainerRefTypes = (
40
+ stateOnlyRef: StateOnlyRef,
41
+ widerRef: ContainerRef<keyof NavigationContainerEventMap>,
42
+ missingCanGoBack: Omit<StateOnlyRef, 'canGoBack'>,
43
+ missingCurrentRoute: Omit<StateOnlyRef, 'getCurrentRoute'>,
44
+ optionsOnlyRef: ContainerRef<'options'>
45
+ ) => {
46
+ const refs: (NavigationContainerRef | null)[] = [
47
+ stateOnlyRef,
48
+ widerRef,
49
+ null
50
+ ];
51
+
52
+ // @ts-expect-error Android back handling requires canGoBack.
53
+ refs.push(missingCanGoBack);
54
+ // @ts-expect-error View tracking requires getCurrentRoute.
55
+ refs.push(missingCurrentRoute);
56
+ // @ts-expect-error Tracking requires state events, not just other events.
57
+ refs.push(optionsOnlyRef);
58
+
59
+ return refs;
60
+ };
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "../../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "noEmit": true,
5
+ "types": []
6
+ },
7
+ "include": ["navigationContainerRef.types.ts"],
8
+ "exclude": []
9
+ }
@@ -0,0 +1,27 @@
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 { spawnSync } from 'child_process';
8
+ import { resolve } from 'path';
9
+
10
+ it('accepts state-only navigation refs without relaxing required methods', () => {
11
+ // Run tsc separately so Jest's React Native transforms do not process the compiler itself.
12
+ const result = spawnSync(
13
+ process.execPath,
14
+ [
15
+ require.resolve('typescript/bin/tsc'),
16
+ '--project',
17
+ resolve(__dirname, '__utils__/tsconfig.json'),
18
+ '--pretty',
19
+ 'false'
20
+ ],
21
+ { encoding: 'utf8', timeout: 120000 }
22
+ );
23
+
24
+ expect(result.error).toBeUndefined();
25
+ expect(result.stdout + result.stderr).toBe('');
26
+ expect(result.status).toBe(0);
27
+ });
@@ -46,7 +46,10 @@ export declare type Route<
46
46
  * Navigation Container
47
47
  */
48
48
 
49
- export declare type NavigationContainerRef = EventConsumer<NavigationContainerEventMap> & {
49
+ // Tracking only consumes state events; other events vary between implementations.
50
+ export declare type NavigationContainerRef = EventConsumer<
51
+ Pick<NavigationContainerEventMap, 'state'>
52
+ > & {
50
53
  canGoBack(): boolean;
51
54
  getCurrentRoute(): Route<string> | undefined;
52
55
  };