@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,48 @@
|
|
|
1
|
+
import type { InvocationEvent, LogLevel, NetworkInterceptionMode } from '../utils/Enums';
|
|
2
|
+
import type { OverAirUpdate } from './OverAirUpdate';
|
|
3
|
+
|
|
4
|
+
export interface LuciqConfig {
|
|
5
|
+
/**
|
|
6
|
+
* The token that identifies the app. You can find it on your dashboard.
|
|
7
|
+
*/
|
|
8
|
+
token: string;
|
|
9
|
+
/**
|
|
10
|
+
* An array of events that invoke the SDK's UI.
|
|
11
|
+
*/
|
|
12
|
+
invocationEvents: InvocationEvent[];
|
|
13
|
+
/**
|
|
14
|
+
* An optional LogLevel to indicate the verbosity of SDK logs. Default is Error.
|
|
15
|
+
*/
|
|
16
|
+
debugLogsLevel?: LogLevel;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* An optional code push version to be used for all reports.
|
|
20
|
+
*/
|
|
21
|
+
codePushVersion?: string;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* An optional flag to override SDK screenshot security behavior.
|
|
25
|
+
*/
|
|
26
|
+
ignoreAndroidSecureFlag?: boolean;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* An optional current App variant to be used for filtering data.
|
|
30
|
+
*/
|
|
31
|
+
appVariant?: string;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* An optional network interception mode, this determines whether network interception
|
|
35
|
+
* is done in the JavaScript side or in the native Android and iOS SDK side.
|
|
36
|
+
*
|
|
37
|
+
* When set to `NetworkInterceptionMode.native`, configuring network logging
|
|
38
|
+
* should be done through native code not JavaScript (e.g. network request obfuscation).
|
|
39
|
+
*
|
|
40
|
+
* @default NetworkInterceptionMode.javascript
|
|
41
|
+
*/
|
|
42
|
+
networkInterceptionMode?: NetworkInterceptionMode;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* An optional over air service update version to be used for all reports.
|
|
46
|
+
*/
|
|
47
|
+
overAirVersion?: OverAirUpdate;
|
|
48
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { NonFatalErrorLevel } from '../utils/Enums';
|
|
2
|
+
|
|
3
|
+
export interface NonFatalOptions {
|
|
4
|
+
/**
|
|
5
|
+
* An Optional extra user attributes attached to the crash
|
|
6
|
+
* */
|
|
7
|
+
userAttributes?: Record<string, string>;
|
|
8
|
+
/**
|
|
9
|
+
* An Optional key used to customize how crashes are grouped together
|
|
10
|
+
* */
|
|
11
|
+
fingerprint?: string;
|
|
12
|
+
/**
|
|
13
|
+
* An Optional different severity levels for errors
|
|
14
|
+
* */
|
|
15
|
+
level?: NonFatalErrorLevel;
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { OverAirUpdateServices } from '../utils/Enums';
|
|
2
|
+
export interface OverAirUpdate {
|
|
3
|
+
/**
|
|
4
|
+
* the name of OTA service
|
|
5
|
+
* e.g. `codePush` or `expo`
|
|
6
|
+
*/
|
|
7
|
+
service: OverAirUpdateServices;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The version or UUID of the OTA service
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
version: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import { NativeLuciq } from '../native/NativeLuciq';
|
|
4
|
+
|
|
5
|
+
interface LogInfo {
|
|
6
|
+
log: string;
|
|
7
|
+
type: 'verbose' | 'debug' | 'warn' | 'info' | 'error';
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface FileAttachmentInfo {
|
|
11
|
+
file: string;
|
|
12
|
+
type: 'url' | 'data';
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default class Report {
|
|
16
|
+
constructor(
|
|
17
|
+
public tags: string[] = [],
|
|
18
|
+
public consoleLogs: string[] = [],
|
|
19
|
+
public luciqLogs: LogInfo[] = [],
|
|
20
|
+
public userAttributes: Record<string, string> = {},
|
|
21
|
+
public fileAttachments: FileAttachmentInfo[] = [],
|
|
22
|
+
) {}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Append a tag to the report to be sent.
|
|
26
|
+
* @param tag
|
|
27
|
+
*/
|
|
28
|
+
appendTag(tag: string) {
|
|
29
|
+
NativeLuciq.appendTagToReport(tag);
|
|
30
|
+
this.tags = [...this.tags, tag];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Append a console log to the report to be sent.
|
|
35
|
+
* @param consoleLog
|
|
36
|
+
*/
|
|
37
|
+
appendConsoleLog(consoleLog: string) {
|
|
38
|
+
NativeLuciq.appendConsoleLogToReport(consoleLog);
|
|
39
|
+
this.consoleLogs = [...this.consoleLogs, consoleLog];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Add a user attribute with key and value to the report to be sent.
|
|
44
|
+
* @param key
|
|
45
|
+
* @param value
|
|
46
|
+
*/
|
|
47
|
+
setUserAttribute(key: string, value: string) {
|
|
48
|
+
NativeLuciq.setUserAttributeToReport(key, value);
|
|
49
|
+
this.userAttributes[key] = value;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Attach debug log to the report to be sent.
|
|
54
|
+
* @param log
|
|
55
|
+
*/
|
|
56
|
+
logDebug(log: string) {
|
|
57
|
+
NativeLuciq.logDebugToReport(log);
|
|
58
|
+
this.luciqLogs = [...this.luciqLogs, { log: log, type: 'debug' }];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Attach verbose log to the report to be sent.
|
|
63
|
+
* @param log
|
|
64
|
+
*/
|
|
65
|
+
logVerbose(log: string) {
|
|
66
|
+
NativeLuciq.logVerboseToReport(log);
|
|
67
|
+
this.luciqLogs = [...this.luciqLogs, { log: log, type: 'verbose' }];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Attach warn log to the report to be sent.
|
|
72
|
+
* @param log
|
|
73
|
+
*/
|
|
74
|
+
logWarn(log: string) {
|
|
75
|
+
NativeLuciq.logWarnToReport(log);
|
|
76
|
+
this.luciqLogs = [...this.luciqLogs, { log: log, type: 'warn' }];
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Attach error log to the report to be sent.
|
|
81
|
+
* @param log
|
|
82
|
+
*/
|
|
83
|
+
logError(log: string) {
|
|
84
|
+
NativeLuciq.logErrorToReport(log);
|
|
85
|
+
this.luciqLogs = [...this.luciqLogs, { log: log, type: 'error' }];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Attach info log to the report to be sent.
|
|
90
|
+
* @param log
|
|
91
|
+
*/
|
|
92
|
+
logInfo(log: string) {
|
|
93
|
+
NativeLuciq.logInfoToReport(log);
|
|
94
|
+
this.luciqLogs = [...this.luciqLogs, { log: log, type: 'info' }];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Attach a file to the report to be sent.
|
|
99
|
+
* @param url
|
|
100
|
+
* @param fileName
|
|
101
|
+
*/
|
|
102
|
+
addFileAttachmentWithUrl(url: string, fileName: string) {
|
|
103
|
+
if (Platform.OS === 'ios') {
|
|
104
|
+
NativeLuciq.addFileAttachmentWithURLToReport(url);
|
|
105
|
+
} else {
|
|
106
|
+
NativeLuciq.addFileAttachmentWithURLToReport(url, fileName);
|
|
107
|
+
}
|
|
108
|
+
this.fileAttachments = [...this.fileAttachments, { file: url, type: 'url' }];
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Attach a file to the report to be sent.
|
|
113
|
+
* @param data
|
|
114
|
+
* @param fileName
|
|
115
|
+
*/
|
|
116
|
+
addFileAttachmentWithData(data: string, fileName: string) {
|
|
117
|
+
if (Platform.OS === 'ios') {
|
|
118
|
+
NativeLuciq.addFileAttachmentWithDataToReport(data);
|
|
119
|
+
} else {
|
|
120
|
+
NativeLuciq.addFileAttachmentWithDataToReport(data, fileName);
|
|
121
|
+
}
|
|
122
|
+
this.fileAttachments = [...this.fileAttachments, { file: data, type: 'data' }];
|
|
123
|
+
}
|
|
124
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ReproStepsMode } from '../utils/Enums';
|
|
2
|
+
|
|
3
|
+
export interface ReproConfig {
|
|
4
|
+
/**
|
|
5
|
+
* Repro steps mode for Bug Reporting.
|
|
6
|
+
*
|
|
7
|
+
* @default ReproStepsMode.enabled
|
|
8
|
+
*/
|
|
9
|
+
bug?: ReproStepsMode;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Repro steps mode for Crash Reporting.
|
|
13
|
+
*
|
|
14
|
+
* @default ReproStepsMode.enabledWithNoScreenshots
|
|
15
|
+
*/
|
|
16
|
+
crash?: ReproStepsMode;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Repro steps mode for Session Replay.
|
|
20
|
+
*
|
|
21
|
+
* @default ReproStepsMode.enabled
|
|
22
|
+
*/
|
|
23
|
+
sessionReplay?: ReproStepsMode;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Repro steps mode for Bug Reporting, Crash Reporting, and Session Replay.
|
|
27
|
+
*
|
|
28
|
+
* When this is set, `bug`, `crash`, and `sessionReplay` will be ignored.
|
|
29
|
+
*/
|
|
30
|
+
all?: ReproStepsMode;
|
|
31
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { LaunchType } from '../utils/Enums';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* network log item
|
|
5
|
+
*/
|
|
6
|
+
export interface NetworkLog {
|
|
7
|
+
url: string;
|
|
8
|
+
duration: number;
|
|
9
|
+
statusCode: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface SessionMetadata {
|
|
13
|
+
/**
|
|
14
|
+
* app version of the session
|
|
15
|
+
*/
|
|
16
|
+
appVersion: string;
|
|
17
|
+
/**
|
|
18
|
+
* operating system of the session
|
|
19
|
+
*/
|
|
20
|
+
OS: string;
|
|
21
|
+
/**
|
|
22
|
+
* mobile device model of the session
|
|
23
|
+
*/
|
|
24
|
+
device: string;
|
|
25
|
+
/**
|
|
26
|
+
* session duration in seconds
|
|
27
|
+
*/
|
|
28
|
+
sessionDurationInSeconds: number;
|
|
29
|
+
/**
|
|
30
|
+
* list of netwrok requests occurred during the session
|
|
31
|
+
*/
|
|
32
|
+
networkLogs: NetworkLog[];
|
|
33
|
+
/**
|
|
34
|
+
* launch type of the session
|
|
35
|
+
*/
|
|
36
|
+
launchType: LaunchType;
|
|
37
|
+
/**
|
|
38
|
+
* is an in-app review occurred in the previous session.
|
|
39
|
+
*/
|
|
40
|
+
hasLinkToAppReview: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* app launch duration
|
|
43
|
+
*/
|
|
44
|
+
launchDuration: number;
|
|
45
|
+
/**
|
|
46
|
+
* number of bugs in the session (iOS only)
|
|
47
|
+
*/
|
|
48
|
+
bugsCount?: number;
|
|
49
|
+
/**
|
|
50
|
+
* number of fetal crashes in the session (iOS only)
|
|
51
|
+
*/
|
|
52
|
+
fatalCrashCount?: number;
|
|
53
|
+
/**
|
|
54
|
+
* number of out of memory crashes in the session (iOS only)
|
|
55
|
+
*/
|
|
56
|
+
oomCrashCount?: number;
|
|
57
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type ThemeConfig = {
|
|
2
|
+
// Colors
|
|
3
|
+
primaryColor?: string;
|
|
4
|
+
backgroundColor?: string;
|
|
5
|
+
titleTextColor?: string;
|
|
6
|
+
subtitleTextColor?: string;
|
|
7
|
+
primaryTextColor?: string;
|
|
8
|
+
secondaryTextColor?: string;
|
|
9
|
+
callToActionTextColor?: string;
|
|
10
|
+
headerBackgroundColor?: string;
|
|
11
|
+
footerBackgroundColor?: string;
|
|
12
|
+
rowBackgroundColor?: string;
|
|
13
|
+
selectedRowBackgroundColor?: string;
|
|
14
|
+
rowSeparatorColor?: string;
|
|
15
|
+
|
|
16
|
+
// Text Styles (Android only)
|
|
17
|
+
primaryTextStyle?: 'bold' | 'italic' | 'normal';
|
|
18
|
+
secondaryTextStyle?: 'bold' | 'italic' | 'normal';
|
|
19
|
+
titleTextStyle?: 'bold' | 'italic' | 'normal';
|
|
20
|
+
ctaTextStyle?: 'bold' | 'italic' | 'normal';
|
|
21
|
+
|
|
22
|
+
// Fonts
|
|
23
|
+
primaryFontPath?: string;
|
|
24
|
+
primaryFontAsset?: string;
|
|
25
|
+
secondaryFontPath?: string;
|
|
26
|
+
secondaryFontAsset?: string;
|
|
27
|
+
ctaFontPath?: string;
|
|
28
|
+
ctaFontAsset?: string;
|
|
29
|
+
|
|
30
|
+
// Legacy properties (deprecated)
|
|
31
|
+
primaryTextType?: string;
|
|
32
|
+
secondaryTextType?: string;
|
|
33
|
+
ctaTextType?: string;
|
|
34
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type W3cExternalTraceAttributes = {
|
|
2
|
+
/**
|
|
3
|
+
* A key that determines if the traceparent header was found
|
|
4
|
+
*/
|
|
5
|
+
isW3cHeaderFound: boolean | null;
|
|
6
|
+
/**
|
|
7
|
+
* A unique identifier for the trace generated by the SDK in case of no cought header found
|
|
8
|
+
*/
|
|
9
|
+
partialId: number | null;
|
|
10
|
+
/**
|
|
11
|
+
* The start time of the network request
|
|
12
|
+
*/
|
|
13
|
+
networkStartTimeInSeconds: number | null;
|
|
14
|
+
/**
|
|
15
|
+
* The traceparent header generated by the SDK
|
|
16
|
+
*/
|
|
17
|
+
w3cGeneratedHeader: string | null;
|
|
18
|
+
/**
|
|
19
|
+
* The traceparent header received by the server
|
|
20
|
+
*/
|
|
21
|
+
w3cCaughtHeader: string | null;
|
|
22
|
+
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import { NativeAPM } from '../native/NativeAPM';
|
|
4
|
+
import { NativeLuciq } from '../native/NativeLuciq';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Enables or disables APM
|
|
8
|
+
* @param isEnabled
|
|
9
|
+
*/
|
|
10
|
+
export const setEnabled = (isEnabled: boolean) => {
|
|
11
|
+
NativeAPM.setEnabled(isEnabled);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* If APM is enabled, Luciq SDK starts collecting data about the app launch time by default.
|
|
16
|
+
* This API is used to give user more control over this behavior.
|
|
17
|
+
* @param isEnabled
|
|
18
|
+
*/
|
|
19
|
+
export const setAppLaunchEnabled = (isEnabled: boolean) => {
|
|
20
|
+
NativeAPM.setAppLaunchEnabled(isEnabled);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* To define when an app launch is complete,
|
|
25
|
+
* such as when it's intractable, use the end app launch API.
|
|
26
|
+
* You can then view this data with the automatic cold app launch.
|
|
27
|
+
*/
|
|
28
|
+
export const endAppLaunch = () => {
|
|
29
|
+
NativeAPM.endAppLaunch();
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Enables or disables APM Network Metric
|
|
34
|
+
* @param isEnabled - a boolean indicates either iOS monitoring is enabled or disabled.
|
|
35
|
+
*/
|
|
36
|
+
export const setNetworkEnabledIOS = (isEnabled: boolean) => {
|
|
37
|
+
if (Platform.OS === 'ios') {
|
|
38
|
+
NativeLuciq.setNetworkLoggingEnabled(isEnabled);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Enables or disables APM UI Responsiveness tracking feature
|
|
44
|
+
* @param isEnabled
|
|
45
|
+
*/
|
|
46
|
+
export const setAutoUITraceEnabled = (isEnabled: boolean) => {
|
|
47
|
+
NativeAPM.setAutoUITraceEnabled(isEnabled);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Starts an AppFlow with the specified name.
|
|
52
|
+
*
|
|
53
|
+
* On starting two flows with the same name, the older flow will end with a force abandon end reason.
|
|
54
|
+
* The AppFlow name cannot exceed 150 characters; otherwise, it's truncated,
|
|
55
|
+
* leading and trailing whitespaces are also ignored.
|
|
56
|
+
*
|
|
57
|
+
* @param name - The name of the AppFlow. It cannot be an empty string or null.
|
|
58
|
+
* A new AppFlow is started if APM is enabled, the feature is enabled,
|
|
59
|
+
* and the Luciq SDK is initialized.
|
|
60
|
+
*/
|
|
61
|
+
export const startFlow = (name: string) => {
|
|
62
|
+
NativeAPM.startFlow(name);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Ends an AppFlow with the given name.
|
|
67
|
+
*
|
|
68
|
+
* @param name - The name of the AppFlow to end. It cannot be an empty string or null.
|
|
69
|
+
*/
|
|
70
|
+
export const endFlow = (name: string) => {
|
|
71
|
+
NativeAPM.endFlow(name);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Sets custom attributes for an AppFlow with a given name.
|
|
76
|
+
*
|
|
77
|
+
* Setting an attribute value to null will remove the corresponding key if it already exists.
|
|
78
|
+
* Attribute keys cannot exceed 30 characters and leading/trailing whitespaces are ignored.
|
|
79
|
+
* Empty strings or null for attribute keys are not accepted.
|
|
80
|
+
*
|
|
81
|
+
* Attribute values cannot exceed 60 characters and leading/trailing whitespaces are ignored.
|
|
82
|
+
* Empty strings for attribute values are not accepted, but null can be used to remove an attribute.
|
|
83
|
+
*
|
|
84
|
+
* If an AppFlow is ended, attributes will not be added and existing ones will not be updated.
|
|
85
|
+
*
|
|
86
|
+
* @param name - The name of the AppFlow. It cannot be an empty string or null.
|
|
87
|
+
* @param key - The key of the attribute. It cannot be an empty string or null.
|
|
88
|
+
* @param [value] - The value of the attribute. It cannot be an empty string. Use null to remove the attribute.
|
|
89
|
+
*/
|
|
90
|
+
|
|
91
|
+
export const setFlowAttribute = (name: string, key: string, value?: string | null) => {
|
|
92
|
+
NativeAPM.setFlowAttribute(name, key, value);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Initiates a UI trace with the specified name using a native module.
|
|
97
|
+
* @param {string} name - The `name` parameter in the `startUITrace` function is a string that
|
|
98
|
+
* represents the name of the UI trace that you want to start. This name is used to identify and track
|
|
99
|
+
* the specific UI trace within the application.
|
|
100
|
+
*/
|
|
101
|
+
export const startUITrace = (name: string) => {
|
|
102
|
+
NativeAPM.startUITrace(name);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Ends the currently running custom trace.
|
|
107
|
+
*/
|
|
108
|
+
export const endUITrace = () => {
|
|
109
|
+
NativeAPM.endUITrace();
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Used for internal testing.
|
|
114
|
+
*/
|
|
115
|
+
export const _lcqSleep = () => {
|
|
116
|
+
NativeAPM.lcqSleep();
|
|
117
|
+
};
|