@dynatrace/react-native-plugin 2.305.1 → 2.309.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 (130) hide show
  1. package/README.md +21 -10
  2. package/android/build.gradle +3 -1
  3. package/android/src/main/java/com/dynatrace/android/agent/DynatraceAppStartModule.kt +128 -0
  4. package/android/src/main/java/com/dynatrace/android/agent/DynatraceInternalModule.kt +22 -0
  5. package/android/src/main/java/com/dynatrace/android/agent/DynatraceRNBridgeImpl.kt +411 -0
  6. package/android/src/main/java/com/dynatrace/android/agent/DynatraceReactPackage.kt +54 -0
  7. package/android/src/main/java/com/dynatrace/android/agent/DynatraceUtils.kt +86 -0
  8. package/android/src/main/java/com/dynatrace/android/agent/model/AppStartMeasurement.kt +15 -0
  9. package/android/src/main/java/com/dynatrace/android/agent/model/AppStartMeasurementType.kt +18 -0
  10. package/android/src/new/java/com/dynatrace/android/agent/DynatraceRNBridge.kt +228 -0
  11. package/android/src/old/java/com/dynatrace/android/agent/DynatraceRNBridge.kt +258 -0
  12. package/files/plugin.gradle +1 -1
  13. package/index.js +10 -10
  14. package/instrumentation/DynatraceInstrumentation.js +1 -0
  15. package/{lib → instrumentation/jsx}/CreateElement.js +6 -5
  16. package/{lib/instrumentor/base → instrumentation/jsx}/ElementHelper.js +14 -12
  17. package/{lib/jsx-dev-runtime.js → instrumentation/jsx/JsxDevRuntime.js} +10 -19
  18. package/instrumentation/jsx/JsxRuntime.js +63 -0
  19. package/instrumentation/jsx/JsxRuntimeUtil.js +31 -0
  20. package/instrumentation/jsx/components/ClassComponent.js +49 -0
  21. package/instrumentation/jsx/components/ComponentUtil.js +33 -0
  22. package/instrumentation/jsx/components/FunctionalComponent.js +20 -0
  23. package/{lib/instrumentor/base → instrumentation/jsx/components}/Picker.js +1 -1
  24. package/{lib/instrumentor/base → instrumentation/jsx/components}/RefreshControl.js +1 -1
  25. package/{lib/instrumentor/base → instrumentation/jsx/components}/Switch.js +1 -1
  26. package/{lib/instrumentor/base → instrumentation/jsx/components}/Touchable.js +5 -5
  27. package/instrumentation/libs/community/Picker.InstrInfo.js +20 -0
  28. package/{lib → instrumentation/libs}/community/Picker.js +1 -1
  29. package/instrumentation/libs/community/gesture-handler/Touchables.InstrInfo.js +23 -0
  30. package/{lib → instrumentation/libs}/community/gesture-handler/Touchables.js +1 -1
  31. package/{lib → instrumentation/libs}/react-native/RefreshControl.InstrInfo.js +2 -2
  32. package/{lib → instrumentation/libs}/react-native/RefreshControl.js +5 -5
  33. package/{lib → instrumentation/libs}/react-native/Switch.InstrInfo.js +2 -2
  34. package/{lib → instrumentation/libs}/react-native/Switch.js +5 -5
  35. package/instrumentation/libs/react-native/Touchables.InstrInfo.js +25 -0
  36. package/{lib → instrumentation/libs}/react-native/Touchables.js +1 -1
  37. package/{lib → instrumentation/libs}/react-navigation/ReactNavigation.js +6 -5
  38. package/{lib/instrumentor → instrumentation}/model/Types.js +1 -14
  39. package/instrumentation/model/TypesUtil.js +17 -0
  40. package/ios/DynatraceRNBridge.h +10 -1
  41. package/ios/DynatraceRNBridge.mm +152 -0
  42. package/jsx-dev-runtime.js +1 -1
  43. package/jsx-runtime.js +1 -1
  44. package/lib/core/Application.js +20 -0
  45. package/lib/{instrumentor/base → core}/Dynatrace.js +57 -48
  46. package/lib/{instrumentor/base → core}/DynatraceAction.js +23 -22
  47. package/lib/core/DynatraceInternal.js +46 -0
  48. package/lib/{instrumentor/base → core}/DynatraceRootAction.js +5 -4
  49. package/lib/{instrumentor/base → core}/DynatraceWebRequestTiming.js +6 -5
  50. package/lib/{instrumentor/base → core}/ErrorHandler.js +6 -5
  51. package/lib/{instrumentor/base → core}/configuration/Configuration.js +1 -1
  52. package/lib/{instrumentor/base → core}/configuration/ConfigurationDefaults.js +1 -2
  53. package/lib/{instrumentor/base → core}/configuration/ConfigurationHandler.js +2 -2
  54. package/lib/{instrumentor/base → core}/configuration/ManualStartupConfiguration.js +1 -1
  55. package/lib/core/logging/ConsoleLogger.js +27 -0
  56. package/lib/core/logging/LogLevel.js +12 -0
  57. package/lib/dynatrace-transformer.js +1 -1
  58. package/lib/next/Dynatrace.js +86 -0
  59. package/lib/next/DynatraceSecondGenForwarder.js +17 -0
  60. package/lib/next/IDynatrace.js +2 -0
  61. package/lib/next/IDynatraceForwarder.js +2 -0
  62. package/lib/next/appstart/AppStartObserver.js +32 -0
  63. package/lib/next/appstart/AppStartType.js +38 -0
  64. package/lib/next/events/EventCreator.js +77 -0
  65. package/lib/next/events/EventPipeline.js +57 -0
  66. package/lib/next/events/EventTimestamp.js +24 -0
  67. package/lib/next/events/ViewInfoCreator.js +27 -0
  68. package/lib/next/events/modifier/BaseDataEventModifier.js +31 -0
  69. package/lib/next/events/modifier/EventLimitation.js +69 -0
  70. package/lib/next/events/modifier/EventModifierUtil.js +88 -0
  71. package/lib/next/events/modifier/IEventModifier.js +2 -0
  72. package/lib/next/events/modifier/ModifyEventValidation.js +187 -0
  73. package/lib/next/events/modifier/NonFiniteNumbersModifier.js +50 -0
  74. package/lib/next/events/modifier/SendEventValidation.js +84 -0
  75. package/lib/next/events/spec/EventFieldKeysEnum.js +2 -0
  76. package/lib/next/events/spec/EventSpecContstants.js +46 -0
  77. package/lib/next/events/spec/IAppStartEvent.js +2 -0
  78. package/lib/next/events/spec/ICrashEvent.js +2 -0
  79. package/lib/next/events/spec/IErrorCodeEvent.js +2 -0
  80. package/lib/next/events/spec/IErrorExceptionEvent.js +2 -0
  81. package/lib/next/events/spec/IReactNativeEvent.js +2 -0
  82. package/lib/next/events/spec/IRumEvent.js +2 -0
  83. package/lib/next/provider/ITimestampProvider.js +2 -0
  84. package/lib/next/provider/TimestampProvider.js +10 -0
  85. package/package.json +51 -40
  86. package/react-native-dynatrace.podspec +1 -1
  87. package/src/lib/{instrumentor/base → core}/interface/NativeDynatraceBridge.ts +10 -0
  88. package/typings/react-native-dynatrace.d.ts +0 -1
  89. package/android/src/main/java/com/dynatrace/android/agent/DynatraceRNBridgeImpl.java +0 -362
  90. package/android/src/main/java/com/dynatrace/android/agent/DynatraceReactPackage.java +0 -67
  91. package/android/src/main/java/com/dynatrace/android/agent/DynatraceUtils.java +0 -76
  92. package/android/src/main/java/com/dynatrace/android/agent/PrivateDTBridge.java +0 -28
  93. package/android/src/new/java/com/dynatrace/android/agent/DynatraceRNBridge.java +0 -187
  94. package/android/src/old/java/com/dynatrace/android/agent/DynatraceRNBridge.java +0 -189
  95. package/lib/community/Picker.InstrInfo.js +0 -20
  96. package/lib/community/gesture-handler/Touchables.InstrInfo.js +0 -56
  97. package/lib/instrumentor/DynatraceInstrumentation.js +0 -1
  98. package/lib/instrumentor/base/Application.js +0 -16
  99. package/lib/instrumentor/base/DynatraceInternal.js +0 -34
  100. package/lib/instrumentor/base/Logger.js +0 -16
  101. package/lib/instrumentor/base/model/LogLevel.js +0 -17
  102. package/lib/jsx-runtime.js +0 -69
  103. package/lib/react/Component.js +0 -90
  104. package/lib/react-native/Touchables.InstrInfo.js +0 -60
  105. /package/{lib/instrumentor/base/interface → instrumentation/jsx}/IDynatraceProperties.js +0 -0
  106. /package/{lib → instrumentation/libs}/community/gesture-handler/index.js +0 -0
  107. /package/{lib → instrumentation/libs}/gesture-handler.js +0 -0
  108. /package/{lib → instrumentation/libs}/react-native/index.js +0 -0
  109. /package/{lib → instrumentation/libs}/react-native.js +0 -0
  110. /package/{lib/instrumentor → instrumentation}/model/Reference.js +0 -0
  111. /package/{lib/instrumentor → instrumentation}/parser/Babel.js +0 -0
  112. /package/lib/{instrumentor/base → core}/DynatraceBridge.js +0 -0
  113. /package/lib/{instrumentor/base → core}/NullAction.js +0 -0
  114. /package/lib/{instrumentor/base → core}/NullRootAction.js +0 -0
  115. /package/lib/{instrumentor/base → core}/NullWebRequestTiming.js +0 -0
  116. /package/lib/{instrumentor/base → core}/UserPrivacyOptions.js +0 -0
  117. /package/lib/{instrumentor/base → core}/configuration/ConfigurationBuilder.js +0 -0
  118. /package/lib/{instrumentor/base → core}/configuration/ConfigurationPreset.js +0 -0
  119. /package/lib/{instrumentor/base → core}/configuration/IConfiguration.js +0 -0
  120. /package/lib/{instrumentor/base → core}/interface/IDynatrace.js +0 -0
  121. /package/lib/{instrumentor/base → core}/interface/IDynatraceAction.js +0 -0
  122. /package/lib/{instrumentor/base → core}/interface/IDynatraceInternal.js +0 -0
  123. /package/lib/{instrumentor/base → core}/interface/IDynatraceRootAction.js +0 -0
  124. /package/lib/{instrumentor/base → core}/interface/IWebRequestTiming.js +0 -0
  125. /package/lib/{instrumentor/base → core}/interface/NativeDynatraceBridge.js +0 -0
  126. /package/lib/{instrumentor/base/interface → core/logging}/ILogger.js +0 -0
  127. /package/lib/{instrumentor/base → core}/model/DataCollectionLevel.js +0 -0
  128. /package/lib/{instrumentor/base → core}/model/Json.js +0 -0
  129. /package/lib/{instrumentor/base → core}/model/Platform.js +0 -0
  130. /package/lib/{instrumentor/base → core}/util/StringUtils.js +0 -0
@@ -1,187 +0,0 @@
1
- package com.dynatrace.android.agent;
2
-
3
- import com.facebook.react.bridge.Promise;
4
- import com.facebook.react.bridge.ReadableMap;
5
- import com.facebook.react.bridge.ReactApplicationContext;
6
-
7
- import java.util.Map;
8
-
9
- public class DynatraceRNBridge extends NativeDynatraceBridgeSpec {
10
-
11
- private final DynatraceRNBridgeImpl impl;
12
-
13
- public DynatraceRNBridge(ReactApplicationContext reactContext, PrivateDTBridge internal) {
14
- super(reactContext);
15
- this.impl = new DynatraceRNBridgeImpl(reactContext, internal);
16
- }
17
-
18
- @Override
19
- public String getName(){
20
- return DynatraceRNBridgeImpl.NAME;
21
- }
22
-
23
- @Override
24
- public Map<String, Object> getTypedExportedConstants() {
25
- return this.impl.getConstants();
26
- }
27
-
28
- @Override
29
- public void start(ReadableMap configuration, Promise promise) {
30
- this.impl.start(configuration, promise);
31
- }
32
-
33
- @Override
34
- public void enterAction(String name, String key, String platform) {
35
- this.impl.enterAction(name, key, platform);
36
- }
37
-
38
- @Override
39
- public void enterManualAction(String name, String key, String platform) {
40
- this.impl.enterManualAction(name, key, platform);
41
- }
42
-
43
- @Override
44
- public void enterManualActionWithParent(String name, String key, String parentKey, String platform) {
45
- this.impl.enterManualActionWithParent(name, key, parentKey, platform);
46
- }
47
-
48
- @Override
49
- public void leaveAction(String key, boolean leave, String platform) {
50
- this.impl.leaveAction(key, leave, platform);
51
- }
52
-
53
- @Override
54
- public void cancelAction(String key, String platform) {
55
- this.impl.cancelAction(key, platform);
56
- }
57
-
58
- @Override
59
- public void endVisit(String platform) {
60
- this.impl.endVisit(platform);
61
- }
62
-
63
- @Override
64
- public void reportErrorWithoutStacktrace(String errorName, double errorCode, String platform) {
65
- this.impl.reportErrorWithoutStacktrace(errorName, (int) errorCode, platform);
66
- }
67
-
68
- @Override
69
- public void reportError(String errorName, String errorValue, String reason, String stacktrace, String platform){
70
- this.impl.reportError(errorName, errorValue, reason, stacktrace, platform);
71
- }
72
-
73
- @Override
74
- public void reportCrash(String errorName, String reason, String stacktrace, boolean isRealError, String platform){
75
- this.impl.reportCrash(errorName, reason, stacktrace, isRealError, platform);
76
- }
77
-
78
- @Override
79
- public void storeCrash(String errorName, String reason, String stacktrace){
80
- // Empty on Purpose
81
- }
82
-
83
- @Override
84
- public void reportErrorInAction(String key, String errorName, double errorCode, String platform) {
85
- this.impl.reportErrorInAction(key, errorName, (int) errorCode, platform);
86
- }
87
-
88
- @Override
89
- public void reportValue(String key, String valueName, String value, String platform) {
90
- this.impl.reportValue(key, valueName, value, platform);
91
- }
92
-
93
- @Override
94
- public void getRequestTag(String key, String url, Promise promise){
95
- this.impl.getRequestTag(key, url, promise);
96
- }
97
-
98
- @Override
99
- public void startWebRequestTiming(String requestTag, String url) {
100
- this.impl.startWebRequestTiming(requestTag, url);
101
- }
102
-
103
- @Override
104
- public void stopWebRequestTiming(String requestTag, String url, double responseCode, String responseMessage) {
105
- this.impl.stopWebRequestTiming(requestTag, url, (int) responseCode, responseMessage);
106
- }
107
-
108
- @Override
109
- public void stopWebRequestTimingWithSize(String requestTag, String url, double responseCode, String responseMessage, double requestSize, double responseSize) {
110
- this.impl.stopWebRequestTimingWithSize(requestTag, url, (int) responseCode, responseMessage, (long) requestSize, (long) responseSize);
111
- }
112
-
113
- @Override
114
- public void identifyUser(String user, String platform) {
115
- this.impl.identifyUser(user, platform);
116
- }
117
-
118
- @Override
119
- public void reportEventInAction(String actionKey, String name, String platform) {
120
- this.impl.reportEventInAction(actionKey, name, platform);
121
- }
122
-
123
- @Override
124
- public void reportStringValueInAction(String actionKey, String name, String value, String platform) {
125
- this.impl.reportStringValueInAction(actionKey, name, value, platform);
126
- }
127
-
128
- @Override
129
- public void reportIntValueInAction(String actionKey, String name, double value, String platform) {
130
- this.impl.reportIntValueInAction(actionKey, name, (int) value, platform);
131
- }
132
-
133
- @Override
134
- public void reportDoubleValueInAction(String actionKey, String name, double value, String platform) {
135
- this.impl.reportDoubleValueInAction(actionKey, name, value, platform);
136
- }
137
-
138
- @Override
139
- public void sendBizEvent(String type, ReadableMap attributes, String platform) {
140
- this.impl.sendBizEvent(type, attributes, platform);
141
- }
142
-
143
- @Override
144
- public void setGPSLocation(double latitude, double longitude, String platform){
145
- this.impl.setGPSLocation(latitude, longitude, platform);
146
- }
147
-
148
- @Override
149
- public void flushEvents(String platform){
150
- this.impl.flushEvents(platform);
151
- }
152
-
153
- @Override
154
- public void isCrashReportingOptedIn(String platform, Promise promise){
155
- this.impl.isCrashReportingOptedIn(platform, promise);
156
- }
157
-
158
- @Override
159
- public void setCrashReportingOptedIn(boolean crashReporting, String platform){
160
- this.impl.setCrashReportingOptedIn(crashReporting, platform);
161
- }
162
-
163
- @Override
164
- public void setDataCollectionLevel(String collectionLevel, String platform){
165
- this.impl.setDataCollectionLevel(collectionLevel, platform);
166
- }
167
-
168
- @Override
169
- public void getDataCollectionLevel(String platform, Promise promise){
170
- this.impl.getDataCollectionLevel(platform, promise);
171
- }
172
-
173
- @Override
174
- public void setBeaconHeaders(ReadableMap headers, String platform){
175
- this.impl.setBeaconHeaders(headers, platform);
176
- }
177
-
178
- @Override
179
- public void applyUserPrivacyOptions(ReadableMap userPrivacyOptions, String platform){
180
- this.impl.applyUserPrivacyOptions(userPrivacyOptions, platform);
181
- }
182
-
183
- @Override
184
- public void getUserPrivacyOptions(String platform, Promise promise){
185
- this.impl.getUserPrivacyOptions(platform, promise);
186
- }
187
- }
@@ -1,189 +0,0 @@
1
- package com.dynatrace.android.agent;
2
-
3
- import com.facebook.react.bridge.Promise;
4
- import com.facebook.react.bridge.ReadableMap;
5
- import com.facebook.react.bridge.ReactContextBaseJavaModule;
6
- import com.facebook.react.bridge.ReactApplicationContext;
7
- import com.facebook.react.bridge.ReactMethod;
8
-
9
- import java.util.Map;
10
-
11
- public class DynatraceRNBridge extends ReactContextBaseJavaModule {
12
-
13
- private final DynatraceRNBridgeImpl impl;
14
-
15
- public DynatraceRNBridge(ReactApplicationContext reactContext, PrivateDTBridge internal) {
16
- super(reactContext);
17
- this.impl = new DynatraceRNBridgeImpl(reactContext, internal);
18
- }
19
-
20
- @Override
21
- public String getName(){
22
- return DynatraceRNBridgeImpl.NAME;
23
- }
24
-
25
- @Override
26
- public Map<String, Object> getConstants() {
27
- return this.impl.getConstants();
28
- }
29
-
30
- @ReactMethod
31
- public void start(ReadableMap configuration, Promise promise) {
32
- this.impl.start(configuration, promise);
33
- }
34
-
35
- @ReactMethod
36
- public void enterAction(String name, String key, String platform) {
37
- this.impl.enterAction(name, key, platform);
38
- }
39
-
40
- @ReactMethod
41
- public void enterManualAction(String name, String key, String platform) {
42
- this.impl.enterManualAction(name, key, platform);
43
- }
44
-
45
- @ReactMethod
46
- public void enterManualActionWithParent(String name, String key, String parentKey, String platform) {
47
- this.impl.enterManualActionWithParent(name, key, parentKey, platform);
48
- }
49
-
50
- @ReactMethod
51
- public void leaveAction(String key, boolean leave, String platform) {
52
- this.impl.leaveAction(key, leave, platform);
53
- }
54
-
55
- @ReactMethod
56
- public void cancelAction(String key, String platform) {
57
- this.impl.cancelAction(key, platform);
58
- }
59
-
60
- @ReactMethod
61
- public void endVisit(String platform) {
62
- this.impl.endVisit(platform);
63
- }
64
-
65
- @ReactMethod
66
- public void reportErrorWithoutStacktrace(String errorName, int errorCode, String platform) {
67
- this.impl.reportErrorWithoutStacktrace(errorName, errorCode, platform);
68
- }
69
-
70
- @ReactMethod
71
- public void reportError(String errorName, String errorValue, String reason, String stacktrace, String platform){
72
- this.impl.reportError(errorName, errorValue, reason, stacktrace, platform);
73
- }
74
-
75
- @ReactMethod
76
- public void reportCrash(String errorName, String reason, String stacktrace, boolean isRealError, String platform){
77
- this.impl.reportCrash(errorName, reason, stacktrace, isRealError, platform);
78
- }
79
-
80
- @ReactMethod
81
- public void storeCrash(String errorName, String reason, String stacktrace){
82
- // Empty on Purpose
83
- }
84
-
85
- @ReactMethod
86
- public void reportErrorInAction(String key, String errorName, int errorCode, String platform) {
87
- this.impl.reportErrorInAction(key, errorName, errorCode, platform);
88
- }
89
-
90
- @ReactMethod
91
- public void reportValue(String key, String valueName, String value, String platform) {
92
- this.impl.reportValue(key, valueName, value, platform);
93
- }
94
-
95
- @ReactMethod
96
- public void getRequestTag(String key, String url, Promise promise){
97
- this.impl.getRequestTag(key, url, promise);
98
- }
99
-
100
- @ReactMethod
101
- public void startWebRequestTiming(String requestTag, String url) {
102
- this.impl.startWebRequestTiming(requestTag, url);
103
- }
104
-
105
- @ReactMethod
106
- public void stopWebRequestTiming(String requestTag, String url, int responseCode, String responseMessage) {
107
- this.impl.stopWebRequestTiming(requestTag, url, responseCode, responseMessage);
108
- }
109
-
110
- @ReactMethod
111
- public void stopWebRequestTimingWithSize(String requestTag, String url, int responseCode, String responseMessage, double requestSize, double responseSize) {
112
- this.impl.stopWebRequestTimingWithSize(requestTag, url, responseCode, responseMessage, (long) requestSize, (long) responseSize);
113
- }
114
-
115
- @ReactMethod
116
- public void identifyUser(String user, String platform) {
117
- this.impl.identifyUser(user, platform);
118
- }
119
-
120
- @ReactMethod
121
- public void reportEventInAction(String actionKey, String name, String platform) {
122
- this.impl.reportEventInAction(actionKey, name, platform);
123
- }
124
-
125
- @ReactMethod
126
- public void reportStringValueInAction(String actionKey, String name, String value, String platform) {
127
- this.impl.reportStringValueInAction(actionKey, name, value, platform);
128
- }
129
-
130
- @ReactMethod
131
- public void reportIntValueInAction(String actionKey, String name, int value, String platform) {
132
- this.impl.reportIntValueInAction(actionKey, name, value, platform);
133
- }
134
-
135
- @ReactMethod
136
- public void reportDoubleValueInAction(String actionKey, String name, double value, String platform) {
137
- this.impl.reportDoubleValueInAction(actionKey, name, value, platform);
138
- }
139
-
140
- @ReactMethod
141
- public void sendBizEvent(String type, ReadableMap attributes, String platform) {
142
- this.impl.sendBizEvent(type, attributes, platform);
143
- }
144
-
145
- @ReactMethod
146
- public void setGPSLocation(double latitude, double longitude, String platform){
147
- this.impl.setGPSLocation(latitude, longitude, platform);
148
- }
149
-
150
- @ReactMethod
151
- public void flushEvents(String platform){
152
- this.impl.flushEvents(platform);
153
- }
154
-
155
- @ReactMethod
156
- public void isCrashReportingOptedIn(String platform, Promise promise){
157
- this.impl.isCrashReportingOptedIn(platform, promise);
158
- }
159
-
160
- @ReactMethod
161
- public void setCrashReportingOptedIn(boolean crashReporting, String platform){
162
- this.impl.setCrashReportingOptedIn(crashReporting, platform);
163
- }
164
-
165
- @ReactMethod
166
- public void setDataCollectionLevel(String collectionLevel, String platform){
167
- this.impl.setDataCollectionLevel(collectionLevel, platform);
168
- }
169
-
170
- @ReactMethod
171
- public void getDataCollectionLevel(String platform, Promise promise){
172
- this.impl.getDataCollectionLevel(platform, promise);
173
- }
174
-
175
- @ReactMethod
176
- public void setBeaconHeaders(ReadableMap headers, String platform){
177
- this.impl.setBeaconHeaders(headers, platform);
178
- }
179
-
180
- @ReactMethod
181
- public void applyUserPrivacyOptions(ReadableMap userPrivacyOptions, String platform){
182
- this.impl.applyUserPrivacyOptions(userPrivacyOptions, platform);
183
- }
184
-
185
- @ReactMethod
186
- public void getUserPrivacyOptions(String platform, Promise promise){
187
- this.impl.getUserPrivacyOptions(platform, promise);
188
- }
189
- }
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.instrumentationInfo = void 0;
4
- exports.instrumentationInfo = [];
5
- exports.instrumentationInfo.push({
6
- old: { module: '@react-native-picker/picker', reference: 'Picker' },
7
- new: {
8
- module: '@dynatrace/react-native-plugin/lib/community/Picker',
9
- reference: 'Picker',
10
- defaultImport: '@dynatrace/react-native-plugin/lib/community/Picker',
11
- },
12
- });
13
- exports.instrumentationInfo.push({
14
- old: { module: '@react-native-picker/picker', reference: 'PickerIOS' },
15
- new: {
16
- module: '@dynatrace/react-native-plugin/lib/community/Picker',
17
- reference: 'PickerIOS',
18
- defaultImport: '@dynatrace/react-native-plugin/lib/community/Picker',
19
- },
20
- });
@@ -1,56 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.instrumentationInfo = void 0;
4
- exports.instrumentationInfo = [];
5
- exports.instrumentationInfo.push({
6
- old: {
7
- module: 'react-native-gesture-handler',
8
- reference: 'TouchableHighlight',
9
- },
10
- new: {
11
- module: '@dynatrace/react-native-plugin/lib/community/gesture-handler/',
12
- reference: 'TouchableHighlight',
13
- defaultImport: '@dynatrace/react-native-plugin/lib/gesture-handler',
14
- },
15
- });
16
- exports.instrumentationInfo.push({
17
- old: {
18
- module: 'react-native-gesture-handler',
19
- reference: 'TouchableOpacity',
20
- },
21
- new: {
22
- module: '@dynatrace/react-native-plugin/lib/community/gesture-handler/',
23
- reference: 'TouchableOpacity',
24
- defaultImport: '@dynatrace/react-native-plugin/lib/gesture-handler',
25
- },
26
- });
27
- exports.instrumentationInfo.push({
28
- old: {
29
- module: 'react-native-gesture-handler',
30
- reference: 'TouchableNativeFeedback',
31
- },
32
- new: {
33
- module: '@dynatrace/react-native-plugin/lib/community/gesture-handler/',
34
- reference: 'TouchableNativeFeedback',
35
- defaultImport: '@dynatrace/react-native-plugin/lib/gesture-handler',
36
- },
37
- });
38
- exports.instrumentationInfo.push({
39
- old: {
40
- module: 'react-native-gesture-handler',
41
- reference: 'TouchableWithoutFeedback',
42
- },
43
- new: {
44
- module: '@dynatrace/react-native-plugin/lib/community/gesture-handler/',
45
- reference: 'TouchableWithoutFeedback',
46
- defaultImport: '@dynatrace/react-native-plugin/lib/gesture-handler',
47
- },
48
- });
49
- exports.instrumentationInfo.push({
50
- old: { module: 'react-native-gesture-handler', reference: 'RectButton' },
51
- new: {
52
- module: '@dynatrace/react-native-plugin/lib/community/gesture-handler/',
53
- reference: 'RectButton',
54
- defaultImport: '@dynatrace/react-native-plugin/lib/gesture-handler',
55
- },
56
- });
@@ -1 +0,0 @@
1
- "use strict";var o,n=require("@babel/runtime/helpers/interopRequireDefault"),r=n(require("@babel/runtime/helpers/toConsumableArray")),a=(Object.defineProperty(exports,"t",{value:!0}),exports.instrument=void 0,require("path")),c=require("jscodeshift"),i=require("jscodeshift/src/Collection"),e=require("../../scripts/FileOperationHelper"),t=require("../../scripts/PathsConstants"),u=require("../react-native/Touchables.InstrInfo"),l=require("../react-native/RefreshControl.InstrInfo"),f=require("../react-native/Switch.InstrInfo"),s=require("../community/gesture-handler/Touchables.InstrInfo"),d=require("../community/Picker.InstrInfo"),v=require("./parser/Babel"),p=require("./model/Types"),m=(!function(n){n[n.i=-1]="Filtered",n[n.u=0]="Normal",n[n.o=1]="ReactNative",n[n.l=2]="React"}(o=o||{}),[]),y=(m.push.apply(m,(0,r.default)(u.instrumentationInfo)),m.push.apply(m,(0,r.default)(l.instrumentationInfo)),m.push.apply(m,(0,r.default)(f.instrumentationInfo)),m.push.apply(m,(0,r.default)(s.instrumentationInfo)),m.push.apply(m,(0,r.default)(d.instrumentationInfo)),["AppRegistry","renderApplication","setUpErrorHandling"]),instrument=function(n,r,e){r=P(r);var t=M(r);if(t!==o.i){var i=!1,u=N(r,n);if(t===o.l)B(u),i=!0;else if(t===o.o)r.endsWith("AppRegistry.js")?void 0!==e&&e.autoStart&&(T(u),i=!0):r.endsWith("renderApplication.js")?(q(u),i=!0):r.endsWith("setUpErrorHandling.js")&&void 0!==e&&e.autoStart&&e.errorHandler.enabled&&(U(u,e.autoStart,e.errorHandler.reportFatalErrorAsCrash),i=!0);else{var t=w(r,e);if(e.custom.reactnavigation&&g(r,u))i=!0;else{if(!t.input&&!t.lifecycle)return null!=e&&e.debug&&console.log("Dynatrace - Filtered All: ".concat(r)),E(r),n;t.lifecycle&&q(u)&&(i=!0),t.input&&m.forEach(function(n){n=G(u,n);u=n.root,i=i||n.v})}}i?(n=u.toSource({quote:"single"}),H(n,r)):E(r),null!=e&&e.debug&&i&&console.log("Dynatrace - Modified Filename: "+r)}else r.includes(a.join("@dynatrace","react-native-plugin"))&&r.endsWith(a.join("lib","instrumentor","base","configuration","ConfigurationPreset.js"))&&void 0!==e&&(t=N(r,n),void 0!==e.lifecycle&&h(t,"getLifecycleUpdate",e.lifecycle.includeUpdate),void 0!==e.debug&&h(t,"getLogLevel",e.debug?0:1),void 0!==e.bundleName&&h(t,"getBundleName",e.bundleName),void 0!==e.bundleVersion&&h(t,"getBundleVersion",e.bundleVersion),void 0!==e.input&&void 0!==e.input.actionNamePrivacy&&h(t,"getActionNamePrivacy",e.input.actionNamePrivacy),void 0!==e.errorHandler&&(h(t,"isErrorHandlerEnabled",e.errorHandler.enabled),h(t,"isReportFatalErrorAsCrash",e.errorHandler.reportFatalErrorAsCrash)),e.autoStart&&h(t,"isAutoStartupEnabled",e.autoStart),n=t.toSource({quote:"single"}),H(n,r));return n},g=(exports.instrument=instrument,function(n,r){return!!b(n,r)&&(r.find(c.ImportDeclaration).at(0).insertBefore("import { registerListener } from '@dynatrace/react-native-plugin/lib/react-navigation/ReactNavigation';"),!0)}),b=function(n,r){var e=!1;return n.includes("react-navigation")&&n.includes("NavigationContainer.tsx")&&r.find(c.VariableDeclarator).forEach(function(n){e||null==n.value||null==n.value.id||"refContainer"!==n.value.id.name||null!=n.parent&&null!=n.parent.value&&null!=n.parent.value.type&&"VariableDeclaration"===n.parent.value.type&&(n.parent.insertAfter("registerListener(refContainer);"),e=!0)}),e},q=function(n){var r=n.findJSXElements(),t=!1;return 0<r.length&&(n.find(c.FunctionDeclaration).forEach(function(n){var r,e=(0,i.fromPaths)([n]);0<e.findJSXElements().length&&null!=n&&null!=n.value&&null!=n.value.id&&n.value.id.name&&(r=e.find(c.ClassDeclaration),e=e.find(c.ClassExpression),0===r.length)&&0===e.length&&(A(n,p.Types.FunctionalComponent,n.value.id.name),t=!0)}),n.find(c.ClassDeclaration).forEach(function(n){0<(0,i.fromPaths)([n]).findJSXElements().length&&null!=n&&null!=n.value&&n.value.id&&n.value.id.name&&(A(n,p.Types.ClassComponent,n.value.id.name),t=!0)}),n.find(c.ArrowFunctionExpression).forEach(function(n){0<(0,i.fromPaths)([n]).findJSXElements().length&&null!=n.parent&&null!=n.parent.value&&null!=n.parent.value.id&&null!=n.parent.value.id.name&&(A(n,p.Types.FunctionalComponent,n.parent.value.id.name),t=!0)})),t},A=function(n,r,e){for(r=c.expressionStatement(c.assignmentExpression("=",c.memberExpression(c.identifier(e),c.identifier("_dtInfo")),O(r,e)));void 0!==n.parentPath&&"body"!==n.parentPath.name;)n=n.parentPath;void 0!==n.parentPath&&n.insertAfter(r)},O=function(n,r){return c.objectExpression([c.objectProperty(c.identifier("type"),c.numericLiteral(n)),c.objectProperty(c.identifier("name"),c.stringLiteral(r))])},h=function(n,r,e){var n=n.find(c.Identifier).filter(function(n){return n.node.name===r});1===n.length&&"ReturnStatement"===(n=n.paths()[0].parent.value.body.body[0]).type&&("boolean"==typeof e&&(n.argument=c.booleanLiteral(e)),"string"==typeof e&&(n.argument=c.stringLiteral(e)),"number"==typeof e)&&(n.argument=c.numericLiteral(e))},N=function(n,r){return c.withParser((0,v.babelParser)(a.extname(n)))(r)},P=function(n){return a.isAbsolute(n)?n.replace(t.default.getApplicationPath()+a.sep,""):n},E=function(n){try{var r=a.join(t.default.getBuildPath(),n+".dtx");e.default.checkIfFileExistsSync(r),e.default.deleteFileSync(r)}catch(n){}},H=function(n,r){r=a.join(t.default.getBuildPath(),r);try{e.default.checkIfFileExistsSync(a.dirname(r))}catch(n){e.default.createDirectorySync(a.dirname(r))}e.default.writeTextToFileSync(r+".dtx",n)},w=function(n,r){var e={input:!1,lifecycle:!1};return void 0!==r&&(void 0!==r.lifecycle&&void 0!==r.lifecycle.instrument&&r.lifecycle.instrument(n)&&(e.lifecycle=!0),void 0!==r.input)&&void 0!==r.input.instrument&&r.input.instrument(n)&&(e.input=!0),e},B=function(n){var r,n=n.find(c.Program);1===n.length&&(r=c.expressionStatement(c.callExpression(c.memberExpression(c.callExpression(c.identifier("require"),[c.stringLiteral("@dynatrace/react-native-plugin/lib/instrumentor/base/ElementHelper")]),c.identifier("instrumentCreateElement")),[c.memberExpression(c.identifier("module"),c.identifier("exports"))])),n.paths()[0].node.body.push(r))},T=function(n){var r=J(n,"runApplication",!0);1===r.length&&(rn(n,{p:"_DynatraceApplicationHandler",module:"@dynatrace/react-native-plugin",reference:"ApplicationHandler"}),I(r.paths()[0].parent.value.body.body,0,D("_DynatraceApplicationHandler","startup",[])))},U=function(n,r,e){n=n.paths()[0].value.program.body;null!=n&&(I(n,n.length,_({p:"_DynatraceErrorHandler",module:"@dynatrace/react-native-plugin/lib/instrumentor/base/ErrorHandler",reference:""})),I(n,n.length,D("_DynatraceErrorHandler","registerErrorHandler",[c.literal(e)])))},I=function(n,r){for(var e=arguments.length,t=new Array(2<e?e-2:0),i=2;i<e;i++)t[i-2]=arguments[i];return n.splice.apply(n,[r,0].concat(t))},J=function(n,r,t){for(var e=arguments.length,i=new Array(3<e?e-3:0),u=3;u<e;u++)i[u-3]=arguments[u];return n.find(c.Identifier).filter(function(n){return n.node.name===r}).filter(function(n){return void 0!==n.parent&&void 0!==n.parent.value&&void 0!==n.parent.value.params}).filter(function(n){var r=void 0!==n.parent&&void 0!==n.parent.value;t||(r=r&&n.parent.value.params.length===i.length);for(var e=0;e<0;e++)r=r&&n.parent.value.params[e].name===i[e];return r})},M=function(n){if(n.includes("@dynatrace"))return o.i;var r=a.extname(n);if(".js"!==r&&".ts"!==r&&".tsx"!==r&&".jsx"!==r)return o.i;for(var e=a.parse(n),t=e.dir.split(a.sep),i=0;i<t.length;i++)if("node_modules"===t[i]){if("react-native"===t[i+1]||"create-react-class"===t[i+1]||"react-clone-referenced-element"===t[i+1])return y.includes(e.name)?o.o:o.i;if("react"===t[i+1]&&"index"===e.name)return o.l}return o.u},V=function(n,r,e){var t=k(n,r,e);return z(n,r,e)||t},k=function(n,r,e){var t=K(n,r);return 0<t.length&&(void 0!==(t=j(t,r.reference,!1))&&(e.p=t.localName),$(n,e),!0)},z=function(n,r,e){var t=C(n,r.module);if(1===t.length){t=j(t,r.reference,!0);if(void 0!==t)return nn(n,e.defaultImport,t.localName,"ImportNamespaceSpecifier"===t.type),!0}return!1},G=function(n,r){var e=JSON.parse(JSON.stringify(r.new));return{root:n,v:V(n,r.old,e)||Q(n,r.old,r.new.defaultImport)}},K=function(n,r){return n.find(c.ImportDeclaration).filter(function(n){return n.node.source.value===r.module&&null!=n.node.specifiers&&n.node.specifiers.some(function(n){return x(n)&&n.imported.name===r.reference||n.local&&n.local.name===r.reference})})},x=function(n){return void 0!==n.imported},Q=function(n,r,e){var t=!1;return n.find(c.CallExpression).filter(function(n){return W(n.node.callee)&&X(n.node.arguments[0])&&n.node.arguments[0].value===r.module&&void 0!==n.parent}).forEach(function(n){(void 0===n.parent.value.property||void 0!==n.parent.value.property&&void 0!==n.parent.value.property.name&&n.parent.value.property.name===r.reference)&&(n.node.arguments[0].value=e,t=t||!0)}),t},W=function(n){return"require"===n.name},X=function(n){return"StringLiteral"===n.type||"Literal"===n.type},C=function(n,r){return n.find(c.ImportDeclaration).filter(function(n){return n.node.source.value===r})},j=function(n,e,t){var i;return n.forEach(function(n){void 0!==n.node.specifiers&&(n.node.specifiers=n.node.specifiers.filter(function(n){var r;return x(n)&&!t?((r=n.imported.name!==e)||null==n.local||n.imported.name===n.local.name||(i={localName:n.local.name,type:n.type}),r):!(!x(n)&&t&&(null!=n.local&&(i={localName:n.local.name,type:n.type}),1))}),0===n.node.specifiers.length)&&n.prune()}),i},Y=function(n,r){n.find(c.ImportDeclaration).filter(function(n){return n.node.source.value===r.module}).forEach(function(n){null!=n.node.specifiers&&n.node.specifiers.push(F(r))})},Z=function(n,r,e){n.find(c.ImportDeclaration).filter(function(n){return n.node.source.value===r}).forEach(function(n){null!=n.node.specifiers&&n.node.specifiers.push(e)})},R=function(n,r,e){var t=n.find(c.ImportDeclaration);0<t.length?c(t.paths()[0]).insertAfter(S(r,e)):1===(t=n.find(c.Program)).length&&t.paths()[0].node.body.unshift(S(r,e))},$=function(n,r){0<C(n,r.module).length?Y(n,r):R(n,r.module,[F(r)])},nn=function(n,r,e,t){var i=C(n,r),t=(t?cn:an)(e);0<i.length?Z(n,r,t):R(n,r,[t])},rn=function(n,r){n=n.find(c.VariableDeclaration);0<n.length&&c(n.paths()[0]).insertAfter(_(r))},D=function(n,r,e){return c.expressionStatement(en(n,r,e))},en=function(n,r,e){return c.callExpression(on(n,r),e)},_=function(n){return c.variableDeclaration("var",[tn(n)])},tn=function(n){return c.variableDeclarator(void 0!==n.p?c.identifier(n.p):c.identifier(n.reference),(0<n.reference.length?un:L)(n))},un=function(n){return c.memberExpression(L(n),c.identifier(n.reference))},on=function(n,r){return c.memberExpression(c.identifier(n),c.identifier(r))},L=function(n){return c.callExpression(c.identifier("require"),[c.literal(n.module)])},S=function(n,r){return c.importDeclaration(r,c.literal(n))},F=function(n){return void 0!==n.p?c.importSpecifier(c.identifier(n.reference),c.identifier(n.p)):c.importSpecifier(c.identifier(n.reference))},an=function(n){return c.importDefaultSpecifier(c.identifier(n))},cn=function(n){return c.importNamespaceSpecifier(c.identifier(n))};
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ApplicationHandler = void 0;
4
- const ConfigurationBuilder_1 = require("./configuration/ConfigurationBuilder");
5
- const ConfigurationHandler_1 = require("./configuration/ConfigurationHandler");
6
- const Logger_1 = require("./Logger");
7
- exports.ApplicationHandler = {
8
- startup: () => {
9
- if (!ConfigurationHandler_1.ConfigurationHandler.isConfigurationAvailable()) {
10
- const config = new ConfigurationBuilder_1.ConfigurationBuilder('', '').buildConfiguration();
11
- ConfigurationHandler_1.ConfigurationHandler.setConfiguration(config);
12
- Logger_1.Logger.logDebug('Configuration set: ' + config.toString());
13
- Logger_1.Logger.logInfo('Dynatrace React Native Plugin started!');
14
- }
15
- },
16
- };
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DynatraceInternal = void 0;
4
- const ReactNative = require("react-native");
5
- const DynatraceBridge_1 = require("./DynatraceBridge");
6
- const Dynatrace_1 = require("./Dynatrace");
7
- const Logger_1 = require("./Logger");
8
- const StringUtils_1 = require("./util/StringUtils");
9
- let counter = 0;
10
- exports.DynatraceInternal = {
11
- reportErrorFromHandler: (isFatal, errorName, reason, stacktrace, isReportFatalErrorAsCrash, platform) => {
12
- if (isFatal && isReportFatalErrorAsCrash) {
13
- if (ReactNative.Platform.OS === 'ios') {
14
- DynatraceBridge_1.DynatraceNative.storeCrash(errorName, reason, stacktrace);
15
- Logger_1.Logger.logDebug(`ErrorHandler storeCrash(${errorName}, ${reason}, ${stacktrace})`);
16
- }
17
- else {
18
- DynatraceBridge_1.DynatraceNative.reportCrash(errorName, reason, stacktrace, true, platform === null || platform === void 0 ? void 0 : platform.toString());
19
- Logger_1.Logger.logDebug(`Dynatrace reportCrash(${errorName}, ${reason}, ${stacktrace})`);
20
- }
21
- }
22
- else {
23
- if (!StringUtils_1.StringUtils.isStringNullEmptyOrUndefined(stacktrace)) {
24
- DynatraceBridge_1.DynatraceNative.reportError(errorName, '-', reason, stacktrace, platform === null || platform === void 0 ? void 0 : platform.toString());
25
- Logger_1.Logger.logDebug(`Dynatrace reportError(${errorName}, ${reason}, ${stacktrace})`);
26
- }
27
- else {
28
- Dynatrace_1.Dynatrace.reportError(errorName, -1);
29
- Logger_1.Logger.logDebug(`Dynatrace reportErrorWithoutStacktrace(${errorName})`);
30
- }
31
- }
32
- },
33
- getCounter: () => counter++,
34
- };
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Logger = void 0;
4
- const ConfigurationHandler_1 = require("./configuration/ConfigurationHandler");
5
- const LOG_PREFIX = 'DYNATRACE: ';
6
- exports.Logger = {
7
- logDebug: (message) => {
8
- if (ConfigurationHandler_1.ConfigurationHandler.isConfigurationAvailable() &&
9
- ConfigurationHandler_1.ConfigurationHandler.isDebugEnabled()) {
10
- console.log(LOG_PREFIX + message);
11
- }
12
- },
13
- logInfo: (message) => {
14
- console.log(LOG_PREFIX + message);
15
- },
16
- };
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LogLevelToString = exports.LogLevel = void 0;
4
- var LogLevel;
5
- (function (LogLevel) {
6
- LogLevel[LogLevel["Debug"] = 0] = "Debug";
7
- LogLevel[LogLevel["Info"] = 1] = "Info";
8
- })(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
9
- const LogLevelToString = (level) => {
10
- if (level === LogLevel.Debug) {
11
- return 'Debug';
12
- }
13
- else {
14
- return 'Info';
15
- }
16
- };
17
- exports.LogLevelToString = LogLevelToString;
@@ -1,69 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const ElementHelper_1 = require("./instrumentor/base/ElementHelper");
4
- const Types_1 = require("./instrumentor/model/Types");
5
- const Component_1 = require("./react/Component");
6
- try {
7
- let _jsxRuntime;
8
- try {
9
- _jsxRuntime = require('react/jsx-runtime.js');
10
- }
11
- catch (error) {
12
- try {
13
- _jsxRuntime = require('../../../react/jsx-runtime');
14
- }
15
- catch (error) {
16
- _jsxRuntime = null;
17
- }
18
- }
19
- if (_jsxRuntime != null) {
20
- const jsxProd = (type, config, maybeKey) => jsxHelper(_jsxRuntime.jsx, type, config, [maybeKey]);
21
- const jsxDev = (type, config, maybeKey, source, self) => jsxHelper(_jsxRuntime.jsx, type, config, [maybeKey, source, self]);
22
- const jsxsDev = (type, config, maybeKey, source, self) => jsxHelper(_jsxRuntime.jsxs, type, config, [
23
- maybeKey,
24
- source,
25
- self,
26
- ]);
27
- const jsxHelper = (jsxFn, type, config, args) => {
28
- if (type !== undefined &&
29
- type._dtInfo !== undefined &&
30
- !(0, ElementHelper_1.isDtActionIgnore)(config)) {
31
- if (type._dtInfo.type === Types_1.Types.FunctionalComponent) {
32
- const wrapperProps = {
33
- children: [],
34
- };
35
- wrapperProps.dtActionName =
36
- config !== undefined &&
37
- config.dtActionName !== undefined
38
- ? config.dtActionName
39
- : type._dtInfo.name;
40
- wrapperProps.children.push(jsxFn(type, config, ...args));
41
- return _jsxRuntime.jsxs(Component_1.DynatraceFnWrapper, wrapperProps);
42
- }
43
- else if (type._dtInfo.type === Types_1.Types.ClassComponent &&
44
- type.prototype !== undefined &&
45
- type.prototype.isReactComponent !== undefined) {
46
- const wrapperProps = {
47
- children: [],
48
- };
49
- wrapperProps.children.push(jsxFn(type, config, ...args));
50
- return _jsxRuntime.jsxs(Component_1.DynatraceClassWrapper, wrapperProps);
51
- }
52
- if (Array.isArray(config.children)) {
53
- (0, ElementHelper_1.modifyElement)(type, config, ...config.children);
54
- }
55
- else {
56
- (0, ElementHelper_1.modifyElement)(type, config, config.children);
57
- }
58
- }
59
- return jsxFn(type, config, ...args);
60
- };
61
- module.exports = Object.assign(Object.assign({}, _jsxRuntime), { jsx: __DEV__ ? jsxDev : jsxProd, jsxs: __DEV__ ? jsxsDev : jsxProd });
62
- }
63
- else {
64
- module.exports = {};
65
- }
66
- }
67
- catch (error) {
68
- module.exports = {};
69
- }