@dynatrace/react-native-plugin 2.323.1 → 2.325.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.
Files changed (45) hide show
  1. package/README.md +33 -9
  2. package/android/build.gradle +3 -3
  3. package/files/plugin-runtime.gradle +8 -1
  4. package/files/plugin.gradle +1 -1
  5. package/index.js +18 -10
  6. package/instrumentation/DynatraceInstrumentation.js +1 -1
  7. package/instrumentation/jsx/CreateElement.js +10 -7
  8. package/instrumentation/jsx/ElementHelper.js +0 -5
  9. package/instrumentation/libs/react-native/Switch.js +55 -12
  10. package/instrumentation/libs/withOnPressMonitoring.js +1 -1
  11. package/instrumentation/model/Types.js +0 -1
  12. package/internal.js +7 -0
  13. package/lib/core/Dynatrace.js +4 -1
  14. package/lib/core/DynatraceAction.js +3 -2
  15. package/lib/core/DynatraceWebRequestTiming.js +5 -5
  16. package/lib/core/ErrorHandler.js +18 -34
  17. package/lib/core/NullWebRequestTiming.js +1 -0
  18. package/lib/core/configuration/Configuration.js +2 -2
  19. package/lib/core/configuration/ConfigurationBuilder.js +3 -2
  20. package/lib/core/configuration/ManualStartupConfiguration.js +6 -3
  21. package/lib/core/interface/IWebRequestTiming.js +1 -0
  22. package/lib/core/logging/LogLevel.js +1 -10
  23. package/lib/core/logging/LogLevelUtil.js +13 -0
  24. package/lib/next/Dynatrace.js +29 -19
  25. package/lib/next/appstart/AppStartObserver.js +1 -1
  26. package/lib/next/events/EventCreator.js +2 -1
  27. package/lib/next/events/EventPipeline.js +14 -6
  28. package/lib/next/events/HttpRequestEventBuilder.js +196 -0
  29. package/lib/next/events/IHttpRequestEventBuilder.js +2 -0
  30. package/lib/next/events/ViewInfoCreator.js +1 -1
  31. package/lib/next/events/modifier/BaseDataEventModifier.js +6 -0
  32. package/lib/next/events/modifier/EventModifierUtil.js +34 -1
  33. package/lib/next/events/modifier/ModifyEventValidation.js +18 -5
  34. package/lib/next/events/modifier/SendEventValidation.js +23 -10
  35. package/lib/next/events/spec/EventSpecContstants.js +2 -1
  36. package/package.json +12 -6
  37. package/public.js +22 -0
  38. package/react-augmentation.js +3 -0
  39. package/react-native-dynatrace.podspec +1 -1
  40. package/scripts/core/LineOffsetAnalyzeCall.js +3 -3
  41. package/types.d.ts +1969 -0
  42. package/instrumentation/jsx/components/Switch.js +0 -57
  43. package/instrumentation/model/TypesUtil.js +0 -21
  44. package/src/instrumentation/jsx/IDynatraceProperties.ts +0 -15
  45. package/typings/react-native-dynatrace.d.ts +0 -1729
@@ -1,57 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SwitchHelper = void 0;
4
- const ComponentUtil_1 = require("./ComponentUtil");
5
- const ConfigurationHandler_1 = require("../../../lib/core/configuration/ConfigurationHandler");
6
- const SwitchHelper = (Dynatrace) => ({
7
- attachOnValueChange: (switchProps) => {
8
- if ((0, ComponentUtil_1.isDynatraceIgnored)(switchProps)) {
9
- return;
10
- }
11
- const origOnValueChange = switchProps.onValueChange;
12
- const nameOfAction = _findActionName(switchProps);
13
- if (origOnValueChange != null) {
14
- switchProps.onValueChange = (value) => {
15
- const useGenericName = nameOfAction == null ||
16
- (!(0, ComponentUtil_1.isDynatraceNaming)(switchProps) &&
17
- ConfigurationHandler_1.ConfigurationHandler.isActionNamePrivacyEnabled());
18
- const finalNameOfAction = useGenericName
19
- ? `Touch on Switch to ${value}`
20
- : `Touch on ${nameOfAction} to ${value}`;
21
- const action = Dynatrace.enterAutoAction(finalNameOfAction);
22
- let isSyncError = true;
23
- try {
24
- const returnValue = origOnValueChange(value);
25
- if (_isPromise(returnValue)) {
26
- isSyncError = false;
27
- return returnValue.finally(() => {
28
- action.leaveAction();
29
- });
30
- }
31
- else {
32
- action.leaveAction();
33
- }
34
- isSyncError = false;
35
- }
36
- finally {
37
- if (isSyncError) {
38
- action.leaveAction();
39
- }
40
- }
41
- };
42
- }
43
- },
44
- });
45
- exports.SwitchHelper = SwitchHelper;
46
- const _findActionName = (switchProps) => {
47
- if ((0, ComponentUtil_1.isDynatraceNaming)(switchProps)) {
48
- return switchProps.dtActionName;
49
- }
50
- else if (switchProps.accessibilityLabel != null) {
51
- return switchProps.accessibilityLabel;
52
- }
53
- return null;
54
- };
55
- const _isPromise = (object) => object != null &&
56
- typeof object.then === 'function' &&
57
- typeof object.catch === 'function';
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getNameForType = void 0;
4
- const Types_1 = require("./Types");
5
- const getNameForType = (type) => {
6
- switch (type) {
7
- case Types_1.Types.FunctionalComponent:
8
- return 'Functional Component';
9
- case Types_1.Types.ClassComponent:
10
- return 'Class Component';
11
- case Types_1.Types.Picker:
12
- return 'Picker';
13
- case Types_1.Types.RefreshControl:
14
- return 'Refresh Control';
15
- case Types_1.Types.Switch:
16
- return 'Switch';
17
- default:
18
- return 'Undefined';
19
- }
20
- };
21
- exports.getNameForType = getNameForType;
@@ -1,15 +0,0 @@
1
- /**
2
- * Interface which is containing the additional properties available for instrumentation.
3
- */
4
- export interface IDynatraceProperties {
5
- /**
6
- * This string is changing the name of the action. So it is possible to override the action naming.
7
- */
8
- dtActionName?: string;
9
-
10
- /**
11
- * If true is passed the auto instrumentation will skip the action creation. We allow both string
12
- * and boolean.
13
- */
14
- dtActionIgnore?: boolean | 'true' | 'false';
15
- }