@luciq/react-native 18.0.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/CHANGELOG.md +5 -0
- package/FONTS_SETUP_GUIDE.md +521 -0
- package/Gemfile +1 -0
- package/Gemfile.lock +11 -0
- package/LICENSE +21 -0
- package/README.md +148 -0
- package/RNLuciq.podspec +21 -0
- package/android/build.gradle +88 -0
- package/android/gradle.properties +4 -0
- package/android/jacoco.gradle +52 -0
- package/android/native.gradle +7 -0
- package/android/proguard-rules.txt +1 -0
- package/android/sourcemaps.gradle +255 -0
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/ai/luciq/reactlibrary/ArgsRegistry.java +278 -0
- package/android/src/main/java/ai/luciq/reactlibrary/Constants.java +20 -0
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciq.java +328 -0
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqAPMModule.java +392 -0
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqBugReportingModule.java +444 -0
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqCrashReportingModule.java +169 -0
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqFeatureRequestsModule.java +98 -0
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqNetworkLoggerModule.java +195 -0
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqReactnativeModule.java +1611 -0
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqReactnativePackage.java +41 -0
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqRepliesModule.java +298 -0
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqSessionReplayModule.java +213 -0
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqSurveysModule.java +237 -0
- package/android/src/main/java/ai/luciq/reactlibrary/utils/ArrayUtil.java +167 -0
- package/android/src/main/java/ai/luciq/reactlibrary/utils/EventEmitterModule.java +35 -0
- package/android/src/main/java/ai/luciq/reactlibrary/utils/LuciqUtil.java +58 -0
- package/android/src/main/java/ai/luciq/reactlibrary/utils/MainThreadHandler.java +13 -0
- package/android/src/main/java/ai/luciq/reactlibrary/utils/MapUtil.java +171 -0
- package/android/src/main/java/ai/luciq/reactlibrary/utils/RNTouchedViewExtractor.java +167 -0
- package/android/src/main/java/ai/luciq/reactlibrary/utils/ReportUtil.java +67 -0
- package/app.plugin.js +1 -0
- package/babel.config.js +3 -0
- package/bin/commands/MigrateCommand.d.ts +6 -0
- package/bin/commands/UploadEasUpdatesSourcemaps.d.ts +2 -0
- package/bin/commands/UploadSoFiles.d.ts +6 -0
- package/bin/commands/UploadSourcemaps.d.ts +2 -0
- package/bin/config/migration-config.json +125 -0
- package/bin/index.d.ts +2 -0
- package/bin/index.js +19179 -0
- package/bin/upload/index.d.ts +4 -0
- package/bin/upload/migrate.d.ts +14 -0
- package/bin/upload/uploadEasUpdatesSourcemaps.d.ts +21 -0
- package/bin/upload/uploadSoFiles.d.ts +21 -0
- package/bin/upload/uploadSourcemaps.d.ts +21 -0
- package/cli/commands/MigrateCommand.ts +32 -0
- package/cli/commands/UploadEasUpdatesSourcemaps.ts +34 -0
- package/cli/commands/UploadSoFiles.ts +38 -0
- package/cli/commands/UploadSourcemaps.ts +40 -0
- package/cli/config/migration-config.json +125 -0
- package/cli/index.ts +21 -0
- package/cli/upload/index.ts +4 -0
- package/cli/upload/migrate.ts +271 -0
- package/cli/upload/uploadEasUpdatesSourcemaps.ts +74 -0
- package/cli/upload/uploadSoFiles.ts +112 -0
- package/cli/upload/uploadSourcemaps.ts +73 -0
- package/dangerfile.ts +44 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +14 -0
- package/dist/models/FeatureFlag.d.ts +11 -0
- package/dist/models/FeatureFlag.js +1 -0
- package/dist/models/LuciqConfig.d.ts +42 -0
- package/dist/models/LuciqConfig.js +1 -0
- package/dist/models/NonFatalOptions.d.ts +15 -0
- package/dist/models/NonFatalOptions.js +1 -0
- package/dist/models/OverAirUpdate.d.ts +12 -0
- package/dist/models/OverAirUpdate.js +1 -0
- package/dist/models/Report.d.ts +70 -0
- package/dist/models/Report.js +109 -0
- package/dist/models/ReproConfig.d.ts +27 -0
- package/dist/models/ReproConfig.js +1 -0
- package/dist/models/SessionMetadata.d.ts +55 -0
- package/dist/models/SessionMetadata.js +1 -0
- package/dist/models/ThemeConfig.d.ts +27 -0
- package/dist/models/ThemeConfig.js +1 -0
- package/dist/models/W3cExternalTraceAttributes.d.ts +22 -0
- package/dist/models/W3cExternalTraceAttributes.js +1 -0
- package/dist/modules/APM.d.ts +77 -0
- package/dist/modules/APM.js +104 -0
- package/dist/modules/BugReporting.d.ts +138 -0
- package/dist/modules/BugReporting.js +202 -0
- package/dist/modules/CrashReporting.d.ts +19 -0
- package/dist/modules/CrashReporting.js +40 -0
- package/dist/modules/FeatureRequests.d.ts +20 -0
- package/dist/modules/FeatureRequests.js +28 -0
- package/dist/modules/Luciq.d.ts +362 -0
- package/dist/modules/Luciq.js +797 -0
- package/dist/modules/NetworkLogger.d.ts +52 -0
- package/dist/modules/NetworkLogger.js +208 -0
- package/dist/modules/Replies.d.ts +78 -0
- package/dist/modules/Replies.js +121 -0
- package/dist/modules/SessionReplay.d.ts +78 -0
- package/dist/modules/SessionReplay.js +98 -0
- package/dist/modules/Surveys.d.ts +75 -0
- package/dist/modules/Surveys.js +101 -0
- package/dist/native/NativeAPM.d.ts +18 -0
- package/dist/native/NativeAPM.js +4 -0
- package/dist/native/NativeBugReporting.d.ts +32 -0
- package/dist/native/NativeBugReporting.js +10 -0
- package/dist/native/NativeConstants.d.ts +182 -0
- package/dist/native/NativeConstants.js +1 -0
- package/dist/native/NativeCrashReporting.d.ts +18 -0
- package/dist/native/NativeCrashReporting.js +2 -0
- package/dist/native/NativeFeatureRequests.d.ts +8 -0
- package/dist/native/NativeFeatureRequests.js +2 -0
- package/dist/native/NativeLuciq.d.ts +86 -0
- package/dist/native/NativeLuciq.js +10 -0
- package/dist/native/NativeNetworkLogger.d.ts +21 -0
- package/dist/native/NativeNetworkLogger.js +14 -0
- package/dist/native/NativePackage.d.ts +21 -0
- package/dist/native/NativePackage.js +2 -0
- package/dist/native/NativeReplies.d.ts +21 -0
- package/dist/native/NativeReplies.js +8 -0
- package/dist/native/NativeSessionReplay.d.ts +16 -0
- package/dist/native/NativeSessionReplay.js +8 -0
- package/dist/native/NativeSurveys.d.ts +22 -0
- package/dist/native/NativeSurveys.js +9 -0
- package/dist/utils/AppStatesHandler.d.ts +3 -0
- package/dist/utils/AppStatesHandler.js +16 -0
- package/dist/utils/Enums.d.ts +244 -0
- package/dist/utils/Enums.js +266 -0
- package/dist/utils/FeatureFlags.d.ts +7 -0
- package/dist/utils/FeatureFlags.js +24 -0
- package/dist/utils/LuciqConstants.d.ts +14 -0
- package/dist/utils/LuciqConstants.js +15 -0
- package/dist/utils/LuciqUtils.d.ts +97 -0
- package/dist/utils/LuciqUtils.js +301 -0
- package/dist/utils/UnhandledRejectionTracking.d.ts +9 -0
- package/dist/utils/UnhandledRejectionTracking.js +99 -0
- package/dist/utils/XhrNetworkInterceptor.d.ts +39 -0
- package/dist/utils/XhrNetworkInterceptor.js +253 -0
- package/dist/utils/config.d.ts +5 -0
- package/dist/utils/config.js +6 -0
- package/dist/utils/logger.d.ts +10 -0
- package/dist/utils/logger.js +39 -0
- package/expo.d.ts +1 -0
- package/expo.js +1 -0
- package/ios/RNLuciq/ArgsRegistry.h +32 -0
- package/ios/RNLuciq/ArgsRegistry.m +276 -0
- package/ios/RNLuciq/LuciqAPMBridge.h +26 -0
- package/ios/RNLuciq/LuciqAPMBridge.m +99 -0
- package/ios/RNLuciq/LuciqBugReportingBridge.h +60 -0
- package/ios/RNLuciq/LuciqBugReportingBridge.m +241 -0
- package/ios/RNLuciq/LuciqCrashReportingBridge.h +18 -0
- package/ios/RNLuciq/LuciqCrashReportingBridge.m +68 -0
- package/ios/RNLuciq/LuciqFeatureRequestsBridge.h +30 -0
- package/ios/RNLuciq/LuciqFeatureRequestsBridge.m +61 -0
- package/ios/RNLuciq/LuciqNetworkLoggerBridge.h +44 -0
- package/ios/RNLuciq/LuciqNetworkLoggerBridge.m +206 -0
- package/ios/RNLuciq/LuciqReactBridge.h +151 -0
- package/ios/RNLuciq/LuciqReactBridge.m +548 -0
- package/ios/RNLuciq/LuciqRepliesBridge.h +40 -0
- package/ios/RNLuciq/LuciqRepliesBridge.m +80 -0
- package/ios/RNLuciq/LuciqSessionReplayBridge.h +32 -0
- package/ios/RNLuciq/LuciqSessionReplayBridge.m +107 -0
- package/ios/RNLuciq/LuciqSurveysBridge.h +46 -0
- package/ios/RNLuciq/LuciqSurveysBridge.m +107 -0
- package/ios/RNLuciq/RCTConvert+LuciqEnums.h +18 -0
- package/ios/RNLuciq/RCTConvert+LuciqEnums.m +127 -0
- package/ios/RNLuciq/RNLuciq.h +35 -0
- package/ios/RNLuciq/RNLuciq.m +107 -0
- package/ios/RNLuciq/Util/LCQAPM+PrivateAPIs.h +15 -0
- package/ios/RNLuciq/Util/LCQCrashReporting+CP.h +13 -0
- package/ios/RNLuciq/Util/LCQNetworkLogger+CP.h +68 -0
- package/ios/RNLuciq/Util/Luciq+CP.h +12 -0
- package/ios/RNLuciq.xcodeproj/project.pbxproj +352 -0
- package/ios/native.rb +12 -0
- package/ios/sourcemaps.sh +120 -0
- package/migrate.js +569 -0
- package/package.json +92 -0
- package/plugin/build/index.js +42078 -0
- package/plugin/src/index.ts +5 -0
- package/plugin/src/pluginProps.ts +6 -0
- package/plugin/src/withLuciq.ts +51 -0
- package/plugin/src/withLuciqAndroid.ts +99 -0
- package/plugin/src/withLuciqIOS.ts +109 -0
- package/plugin/tsconfig.json +7 -0
- package/react-native.config.js +16 -0
- package/scripts/customize-ios-endpoints.sh +28 -0
- package/scripts/dream-11-delete-unused-features.sh +62 -0
- package/scripts/find-token.js +58 -0
- package/scripts/find-token.sh +70 -0
- package/scripts/notify-github.sh +15 -0
- package/scripts/replace.js +58 -0
- package/scripts/snapshot-comment.md +15 -0
- package/scripts/snapshot-version.sh +11 -0
- package/src/index.ts +40 -0
- package/src/models/FeatureFlag.ts +12 -0
- package/src/models/LuciqConfig.ts +48 -0
- package/src/models/NonFatalOptions.ts +16 -0
- package/src/models/OverAirUpdate.ts +14 -0
- package/src/models/Report.ts +124 -0
- package/src/models/ReproConfig.ts +31 -0
- package/src/models/SessionMetadata.ts +57 -0
- package/src/models/ThemeConfig.ts +34 -0
- package/src/models/W3cExternalTraceAttributes.ts +22 -0
- package/src/modules/APM.ts +117 -0
- package/src/modules/BugReporting.ts +254 -0
- package/src/modules/CrashReporting.ts +54 -0
- package/src/modules/FeatureRequests.ts +32 -0
- package/src/modules/Luciq.ts +934 -0
- package/src/modules/NetworkLogger.ts +270 -0
- package/src/modules/Replies.ts +137 -0
- package/src/modules/SessionReplay.ts +111 -0
- package/src/modules/Surveys.ts +118 -0
- package/src/native/NativeAPM.ts +51 -0
- package/src/native/NativeBugReporting.ts +70 -0
- package/src/native/NativeConstants.ts +215 -0
- package/src/native/NativeCrashReporting.ts +29 -0
- package/src/native/NativeFeatureRequests.ts +12 -0
- package/src/native/NativeLuciq.ts +179 -0
- package/src/native/NativeNetworkLogger.ts +42 -0
- package/src/native/NativePackage.ts +25 -0
- package/src/native/NativeReplies.ts +34 -0
- package/src/native/NativeSessionReplay.ts +21 -0
- package/src/native/NativeSurveys.ts +34 -0
- package/src/promise.d.ts +11 -0
- package/src/utils/AppStatesHandler.ts +19 -0
- package/src/utils/Enums.ts +266 -0
- package/src/utils/FeatureFlags.ts +33 -0
- package/src/utils/LuciqConstants.ts +24 -0
- package/src/utils/LuciqUtils.ts +417 -0
- package/src/utils/UnhandledRejectionTracking.ts +118 -0
- package/src/utils/XhrNetworkInterceptor.ts +333 -0
- package/src/utils/config.ts +7 -0
- package/src/utils/logger.ts +54 -0
- package/tsconfig.json +32 -0
- package/tsconfig.test.json +4 -0
- package/tsconfig.upload.json +10 -0
- package/upload/index.d.ts +4 -0
- package/upload/index.js +17314 -0
- package/upload/migrate.d.ts +14 -0
- package/upload/package.json +5 -0
- package/upload/uploadEasUpdatesSourcemaps.d.ts +21 -0
- package/upload/uploadSoFiles.d.ts +21 -0
- package/upload/uploadSourcemaps.d.ts +21 -0
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
package ai.luciq.reactlibrary.utils;
|
|
2
|
+
|
|
3
|
+
import android.text.TextUtils;
|
|
4
|
+
import android.view.View;
|
|
5
|
+
import android.view.ViewParent;
|
|
6
|
+
import androidx.annotation.NonNull;
|
|
7
|
+
import androidx.annotation.Nullable;
|
|
8
|
+
import com.facebook.react.views.text.ReactTextView;
|
|
9
|
+
import com.facebook.react.views.view.ReactViewGroup;
|
|
10
|
+
import ai.luciq.library.core.InstabugCore;
|
|
11
|
+
import ai.luciq.library.visualusersteps.TouchedView;
|
|
12
|
+
import ai.luciq.library.visualusersteps.TouchedViewExtractor;
|
|
13
|
+
import ai.luciq.library.visualusersteps.VisualUserStepsHelper;
|
|
14
|
+
|
|
15
|
+
public class RNTouchedViewExtractor implements TouchedViewExtractor {
|
|
16
|
+
|
|
17
|
+
private final int depthTraversalLimit = 3;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Determines whether the native Android SDK should depend on native extraction
|
|
21
|
+
* when a label is not found by the RNTouchedViewExtractor.
|
|
22
|
+
*
|
|
23
|
+
* <p>
|
|
24
|
+
* - {@code RNTouchedViewExtractor} tries to find a label.
|
|
25
|
+
* <br>
|
|
26
|
+
* - If it returns a label, the view is labeled with the one returned.
|
|
27
|
+
* <br>
|
|
28
|
+
* - If it returns {@code null}:
|
|
29
|
+
* <br>
|
|
30
|
+
* - If {@code shouldDependOnNative} is {@code true}, the native Android SDK
|
|
31
|
+
* will try to extract the label from the view.
|
|
32
|
+
* <br>
|
|
33
|
+
* - If it's {@code false}, the Android SDK will label it {@code null} as returned
|
|
34
|
+
* from {@code RNTouchedViewExtractor} without trying to label it.
|
|
35
|
+
* </p>
|
|
36
|
+
*
|
|
37
|
+
* @return {@code true} if the native Android SDK should depend on native extraction,
|
|
38
|
+
* {@code false} otherwise.
|
|
39
|
+
*/
|
|
40
|
+
@Override
|
|
41
|
+
public boolean getShouldDependOnNative() {
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
@Nullable
|
|
47
|
+
@Override
|
|
48
|
+
public TouchedView extract(@NonNull View view, @NonNull TouchedView touchedView) {
|
|
49
|
+
ReactViewGroup reactViewGroup = findReactButtonViewGroup(view);
|
|
50
|
+
// If no button is found return `null` to leave the extraction of the touched view to the native Android SDK.
|
|
51
|
+
if (reactViewGroup == null) return null;
|
|
52
|
+
return getExtractionStrategy(reactViewGroup).extract(reactViewGroup, touchedView);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@Nullable
|
|
56
|
+
private ReactViewGroup findReactButtonViewGroup(@NonNull View startView) {
|
|
57
|
+
if (isReactButtonViewGroup(startView)) return (ReactViewGroup) startView;
|
|
58
|
+
ViewParent currentParent = startView.getParent();
|
|
59
|
+
int depth = 1;
|
|
60
|
+
do {
|
|
61
|
+
if (currentParent == null || isReactButtonViewGroup(currentParent))
|
|
62
|
+
return (ReactViewGroup) currentParent;
|
|
63
|
+
currentParent = currentParent.getParent();
|
|
64
|
+
depth++;
|
|
65
|
+
} while (depth < depthTraversalLimit);
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
private boolean isReactButtonViewGroup(@NonNull View view) {
|
|
70
|
+
return (view instanceof ReactViewGroup) && view.isFocusable() && view.isClickable();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
private boolean isReactButtonViewGroup(@NonNull ViewParent viewParent) {
|
|
74
|
+
if (!(viewParent instanceof ReactViewGroup)) return false;
|
|
75
|
+
ReactViewGroup group = (ReactViewGroup) viewParent;
|
|
76
|
+
return group.isFocusable() && group.isClickable();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
private ReactButtonExtractionStrategy getExtractionStrategy(ReactViewGroup reactButton) {
|
|
80
|
+
boolean isPrivateView = VisualUserStepsHelper.isPrivateView(reactButton);
|
|
81
|
+
if (isPrivateView) return new PrivateViewLabelExtractionStrategy();
|
|
82
|
+
|
|
83
|
+
int labelsCount = 0;
|
|
84
|
+
int groupsCount = 0;
|
|
85
|
+
for (int index = 0; index < reactButton.getChildCount(); index++) {
|
|
86
|
+
View currentView = reactButton.getChildAt(index);
|
|
87
|
+
if (currentView instanceof ReactTextView) {
|
|
88
|
+
|
|
89
|
+
labelsCount++;
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
if (currentView instanceof ReactViewGroup) {
|
|
93
|
+
groupsCount++;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (labelsCount > 1 || groupsCount > 0) return new MultiLabelsExtractionStrategy();
|
|
97
|
+
if (labelsCount == 1) return new SingleLabelExtractionStrategy();
|
|
98
|
+
return new NoLabelsExtractionStrategy();
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
interface ReactButtonExtractionStrategy {
|
|
102
|
+
@Nullable
|
|
103
|
+
TouchedView extract(ReactViewGroup reactButton, TouchedView touchedView);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
class MultiLabelsExtractionStrategy implements ReactButtonExtractionStrategy {
|
|
107
|
+
private final String MULTI_LABEL_BUTTON_PRE_STRING = "a button that contains \"%s\"";
|
|
108
|
+
|
|
109
|
+
@Override
|
|
110
|
+
@Nullable
|
|
111
|
+
public TouchedView extract(ReactViewGroup reactButton, TouchedView touchedView) {
|
|
112
|
+
|
|
113
|
+
touchedView.setProminentLabel(
|
|
114
|
+
InstabugCore.composeProminentLabelForViewGroup(reactButton, MULTI_LABEL_BUTTON_PRE_STRING)
|
|
115
|
+
);
|
|
116
|
+
return touchedView;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
class PrivateViewLabelExtractionStrategy implements ReactButtonExtractionStrategy {
|
|
121
|
+
|
|
122
|
+
private final String PRIVATE_VIEW_LABEL_BUTTON_PRE_STRING = "a button";
|
|
123
|
+
|
|
124
|
+
@Override
|
|
125
|
+
public TouchedView extract(ReactViewGroup reactButton, TouchedView touchedView) {
|
|
126
|
+
touchedView.setProminentLabel(PRIVATE_VIEW_LABEL_BUTTON_PRE_STRING);
|
|
127
|
+
return touchedView;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
class SingleLabelExtractionStrategy implements ReactButtonExtractionStrategy {
|
|
132
|
+
|
|
133
|
+
@Override
|
|
134
|
+
public TouchedView extract(ReactViewGroup reactButton, TouchedView touchedView) {
|
|
135
|
+
ReactTextView targetLabel = null;
|
|
136
|
+
for (int index = 0; index < reactButton.getChildCount(); index++) {
|
|
137
|
+
View currentView = reactButton.getChildAt(index);
|
|
138
|
+
if (!(currentView instanceof ReactTextView)) continue;
|
|
139
|
+
targetLabel = (ReactTextView) currentView;
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
if (targetLabel == null) return touchedView;
|
|
143
|
+
|
|
144
|
+
String labelText = getLabelText(targetLabel);
|
|
145
|
+
touchedView.setProminentLabel(InstabugCore.composeProminentLabelFor(labelText, false));
|
|
146
|
+
return touchedView;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
@Nullable
|
|
150
|
+
private String getLabelText(ReactTextView textView) {
|
|
151
|
+
String labelText = null;
|
|
152
|
+
if (!TextUtils.isEmpty(textView.getText())) {
|
|
153
|
+
labelText = textView.getText().toString();
|
|
154
|
+
} else if (!TextUtils.isEmpty(textView.getContentDescription())) {
|
|
155
|
+
labelText = textView.getContentDescription().toString();
|
|
156
|
+
}
|
|
157
|
+
return labelText;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
class NoLabelsExtractionStrategy implements ReactButtonExtractionStrategy {
|
|
162
|
+
@Override
|
|
163
|
+
public TouchedView extract(ReactViewGroup reactButton, TouchedView touchedView) {
|
|
164
|
+
return touchedView;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
package ai.luciq.reactlibrary.utils;
|
|
2
|
+
|
|
3
|
+
import android.net.Uri;
|
|
4
|
+
|
|
5
|
+
import com.facebook.react.bridge.ReadableArray;
|
|
6
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
7
|
+
import com.facebook.react.bridge.ReadableMapKeySetIterator;
|
|
8
|
+
import com.facebook.react.bridge.ReadableType;
|
|
9
|
+
import com.facebook.react.bridge.WritableArray;
|
|
10
|
+
import com.facebook.react.bridge.WritableNativeArray;
|
|
11
|
+
import ai.luciq.library.model.Report;
|
|
12
|
+
import ai.luciq.library.model.a;
|
|
13
|
+
|
|
14
|
+
import org.json.JSONException;
|
|
15
|
+
|
|
16
|
+
import java.util.ArrayList;
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Created by salmaali on 8/29/18.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
public class ReportUtil {
|
|
24
|
+
|
|
25
|
+
public static Report createReport(ReadableArray tags, ReadableArray consoleLogs, String userData, ReadableMap userAttributes, ReadableMap fileAttachments) {
|
|
26
|
+
Report report = new Report();
|
|
27
|
+
// map tags
|
|
28
|
+
report.addTag(ArrayUtil.parseReadableArrayOfStrings(tags).toArray(new String[0]));
|
|
29
|
+
|
|
30
|
+
// map consoleLogs
|
|
31
|
+
for (int i = 0; i < consoleLogs.size(); i++) {
|
|
32
|
+
ReadableType type = consoleLogs.getType(i);
|
|
33
|
+
if (type == ReadableType.String) {
|
|
34
|
+
report.appendToConsoleLogs(consoleLogs.getString(i));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// map userData
|
|
39
|
+
report.setUserData(userData);
|
|
40
|
+
|
|
41
|
+
// map userAttributes
|
|
42
|
+
ReadableMapKeySetIterator userAttrIterator = userAttributes.keySetIterator();
|
|
43
|
+
while (userAttrIterator.hasNextKey()) {
|
|
44
|
+
String key = userAttrIterator.nextKey();
|
|
45
|
+
ReadableType type = userAttributes.getType(key);
|
|
46
|
+
if (type == ReadableType.String) {
|
|
47
|
+
report.setUserAttribute(key, userAttributes.getString(key));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// map fileAttachments
|
|
53
|
+
ReadableMapKeySetIterator fileAttachmentsIterator = userAttributes.keySetIterator();
|
|
54
|
+
while (fileAttachmentsIterator.hasNextKey()) {
|
|
55
|
+
String key = fileAttachmentsIterator.nextKey();
|
|
56
|
+
ReadableType type = fileAttachments.getType(key);
|
|
57
|
+
if (type == ReadableType.String) {
|
|
58
|
+
Uri uri = Uri.parse(key);
|
|
59
|
+
report.addFileAttachment(uri, fileAttachments.getString(key));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return report;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
}
|
package/app.plugin.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./expo');
|
package/babel.config.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
/**
|
|
3
|
+
* This script uploads .so files to the specified endpoint used in NDK crash reporting.
|
|
4
|
+
* Usage: node upload-so-files.js --arch <arch> --file <path> --api_key <key> --token <token> --name <name>
|
|
5
|
+
*/
|
|
6
|
+
export declare const UploadSoFilesCommand: Command;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
{
|
|
2
|
+
"migrationMethods": [
|
|
3
|
+
{
|
|
4
|
+
"name": "Dependency Version Updates",
|
|
5
|
+
"description": "Update dependency versions from Instabug to Luciq (runs first)",
|
|
6
|
+
"priority": 1,
|
|
7
|
+
"searchReplace": [
|
|
8
|
+
{
|
|
9
|
+
"search": "com\\.instabug\\.library:instabug:[0-9]+\\.[0-9]+\\.[0-9]+",
|
|
10
|
+
"replacement": "ai.luciq.library:luciq:18.0.0",
|
|
11
|
+
"isRegex": true
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"search": "com\\.instabug\\.library:instabug:[0-9]+\\.[0-9]+\\.[0-9]+-.*",
|
|
15
|
+
"replacement": "ai.luciq.library:luciq:18.0.0",
|
|
16
|
+
"isRegex": true
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"search": "com\\.instabug\\.library:instabug:[0-9]+\\.[0-9]+\\.[0-9]+-SNAPSHOT",
|
|
20
|
+
"replacement": "ai.luciq.library:luciq:18.0.0",
|
|
21
|
+
"isRegex": true
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"search": "\"instabug-react-native\":\\s*\"[^\"]+\"",
|
|
25
|
+
"replacement": "\"@luciq/react-native\": \"^18.0.0\"",
|
|
26
|
+
"isRegex": true
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"search": "'instabug-react-native':\\s*'[^']+'",
|
|
30
|
+
"replacement": "'@luciq/react-native': '^18.0.0'",
|
|
31
|
+
"isRegex": true
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"targetExtensions": [".gradle", ".properties", ".xml", ".json", ".js", ".ts"],
|
|
35
|
+
"ignoredDirs": ["node_modules", "build", "Pods", "vendor", ".git", "dist", "coverage"],
|
|
36
|
+
"enabled": true
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "Package Name Updates",
|
|
40
|
+
"description": "Update package names and references",
|
|
41
|
+
"priority": 2,
|
|
42
|
+
"searchReplace": [
|
|
43
|
+
{ "search": "com.instabug", "replacement": "ai.luciq" },
|
|
44
|
+
{ "search": "com.instabug.reactlibrary", "replacement": "ai.luciq.reactlibrary" },
|
|
45
|
+
{ "search": "RNInstabug", "replacement": "RNLuciq" },
|
|
46
|
+
{ "search": "rninstabug", "replacement": "rnluciq" },
|
|
47
|
+
{ "search": "instabug-reactnative", "replacement": "@luciq/react-native" },
|
|
48
|
+
{ "search": "instabug-react-native", "replacement": "@luciq/react-native" }
|
|
49
|
+
],
|
|
50
|
+
"targetExtensions": [".java", ".kt", ".ts", ".tsx", ".js", ".jsx", ".json"],
|
|
51
|
+
"ignoredDirs": ["node_modules", "build", "Pods", "vendor", ".git", "dist", "coverage"],
|
|
52
|
+
"enabled": true
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "Instabug to Luciq",
|
|
56
|
+
"description": "Replace all instances of Instabug with Luciq",
|
|
57
|
+
"priority": 3,
|
|
58
|
+
"searchReplace": [
|
|
59
|
+
{ "search": "Instabug", "replacement": "Luciq" },
|
|
60
|
+
{ "search": "instabug", "replacement": "luciq" },
|
|
61
|
+
{ "search": "INSTABUG", "replacement": "LUCIQ" },
|
|
62
|
+
{ "search": "IBG", "replacement": "LCQ" },
|
|
63
|
+
{ "search": "ibg", "replacement": "lcq" }
|
|
64
|
+
],
|
|
65
|
+
"targetExtensions": [".h", ".m", ".java", ".kt", ".ts", ".tsx", ".js", ".jsx"],
|
|
66
|
+
"ignoredDirs": [
|
|
67
|
+
"node_modules",
|
|
68
|
+
"build",
|
|
69
|
+
"Pods",
|
|
70
|
+
"vendor",
|
|
71
|
+
".git",
|
|
72
|
+
"dist",
|
|
73
|
+
"coverage",
|
|
74
|
+
".next",
|
|
75
|
+
".nuxt",
|
|
76
|
+
"target"
|
|
77
|
+
],
|
|
78
|
+
"enabled": true
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"name": "Cleanup",
|
|
82
|
+
"description": "Clean up file extensions and references",
|
|
83
|
+
"priority": 4,
|
|
84
|
+
"searchReplace": [
|
|
85
|
+
{ "search": ".instabug", "replacement": ".luciq" },
|
|
86
|
+
{ "search": "_instabug", "replacement": "_luciq" },
|
|
87
|
+
{ "search": "instabug_", "replacement": "luciq_" }
|
|
88
|
+
],
|
|
89
|
+
"targetExtensions": [".ts", ".tsx", ".js", ".jsx"],
|
|
90
|
+
"ignoredDirs": ["node_modules", "build", "Pods", "vendor", ".git", "dist", "coverage"],
|
|
91
|
+
"enabled": true
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"name": "IOS File changes objective c",
|
|
95
|
+
"description": "IOS Objective C files",
|
|
96
|
+
"priority": 5,
|
|
97
|
+
"searchReplace": [
|
|
98
|
+
{ "search": "Instabug", "replacement": "Luciq" },
|
|
99
|
+
{ "search": "instabug", "replacement": "luciq" },
|
|
100
|
+
{ "search": "INSTABUG", "replacement": "LUCIQ" },
|
|
101
|
+
{ "search": "IBG", "replacement": "LCQ" }
|
|
102
|
+
],
|
|
103
|
+
"targetExtensions": [".h", ".m"],
|
|
104
|
+
"ignoredDirs": ["node_modules", "build", "Pods", "vendor", ".git", "dist", "coverage"],
|
|
105
|
+
"enabled": true
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"name": "IOS File changes objective swift",
|
|
109
|
+
"description": "IOS Swift files",
|
|
110
|
+
"priority": 6,
|
|
111
|
+
"searchReplace": [
|
|
112
|
+
{ "search": "Instabug", "replacement": "Luciq" },
|
|
113
|
+
{ "search": "instabug", "replacement": "luciq" },
|
|
114
|
+
{ "search": "INSTABUG", "replacement": "LUCIQ" }
|
|
115
|
+
],
|
|
116
|
+
"targetExtensions": [".swift"],
|
|
117
|
+
"ignoredDirs": ["node_modules", "build", "Pods", "vendor", ".git", "dist", "coverage"],
|
|
118
|
+
"enabled": true
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
"defaultOptions": {
|
|
122
|
+
"dryRun": false,
|
|
123
|
+
"silent": false
|
|
124
|
+
}
|
|
125
|
+
}
|
package/bin/index.d.ts
ADDED