@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.
Files changed (239) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/FONTS_SETUP_GUIDE.md +521 -0
  3. package/Gemfile +1 -0
  4. package/Gemfile.lock +11 -0
  5. package/LICENSE +21 -0
  6. package/README.md +148 -0
  7. package/RNLuciq.podspec +21 -0
  8. package/android/build.gradle +88 -0
  9. package/android/gradle.properties +4 -0
  10. package/android/jacoco.gradle +52 -0
  11. package/android/native.gradle +7 -0
  12. package/android/proguard-rules.txt +1 -0
  13. package/android/sourcemaps.gradle +255 -0
  14. package/android/src/main/AndroidManifest.xml +4 -0
  15. package/android/src/main/java/ai/luciq/reactlibrary/ArgsRegistry.java +278 -0
  16. package/android/src/main/java/ai/luciq/reactlibrary/Constants.java +20 -0
  17. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciq.java +328 -0
  18. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqAPMModule.java +392 -0
  19. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqBugReportingModule.java +444 -0
  20. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqCrashReportingModule.java +169 -0
  21. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqFeatureRequestsModule.java +98 -0
  22. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqNetworkLoggerModule.java +195 -0
  23. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqReactnativeModule.java +1611 -0
  24. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqReactnativePackage.java +41 -0
  25. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqRepliesModule.java +298 -0
  26. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqSessionReplayModule.java +213 -0
  27. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqSurveysModule.java +237 -0
  28. package/android/src/main/java/ai/luciq/reactlibrary/utils/ArrayUtil.java +167 -0
  29. package/android/src/main/java/ai/luciq/reactlibrary/utils/EventEmitterModule.java +35 -0
  30. package/android/src/main/java/ai/luciq/reactlibrary/utils/LuciqUtil.java +58 -0
  31. package/android/src/main/java/ai/luciq/reactlibrary/utils/MainThreadHandler.java +13 -0
  32. package/android/src/main/java/ai/luciq/reactlibrary/utils/MapUtil.java +171 -0
  33. package/android/src/main/java/ai/luciq/reactlibrary/utils/RNTouchedViewExtractor.java +167 -0
  34. package/android/src/main/java/ai/luciq/reactlibrary/utils/ReportUtil.java +67 -0
  35. package/app.plugin.js +1 -0
  36. package/babel.config.js +3 -0
  37. package/bin/commands/MigrateCommand.d.ts +6 -0
  38. package/bin/commands/UploadEasUpdatesSourcemaps.d.ts +2 -0
  39. package/bin/commands/UploadSoFiles.d.ts +6 -0
  40. package/bin/commands/UploadSourcemaps.d.ts +2 -0
  41. package/bin/config/migration-config.json +125 -0
  42. package/bin/index.d.ts +2 -0
  43. package/bin/index.js +19179 -0
  44. package/bin/upload/index.d.ts +4 -0
  45. package/bin/upload/migrate.d.ts +14 -0
  46. package/bin/upload/uploadEasUpdatesSourcemaps.d.ts +21 -0
  47. package/bin/upload/uploadSoFiles.d.ts +21 -0
  48. package/bin/upload/uploadSourcemaps.d.ts +21 -0
  49. package/cli/commands/MigrateCommand.ts +32 -0
  50. package/cli/commands/UploadEasUpdatesSourcemaps.ts +34 -0
  51. package/cli/commands/UploadSoFiles.ts +38 -0
  52. package/cli/commands/UploadSourcemaps.ts +40 -0
  53. package/cli/config/migration-config.json +125 -0
  54. package/cli/index.ts +21 -0
  55. package/cli/upload/index.ts +4 -0
  56. package/cli/upload/migrate.ts +271 -0
  57. package/cli/upload/uploadEasUpdatesSourcemaps.ts +74 -0
  58. package/cli/upload/uploadSoFiles.ts +112 -0
  59. package/cli/upload/uploadSourcemaps.ts +73 -0
  60. package/dangerfile.ts +44 -0
  61. package/dist/index.d.ts +19 -0
  62. package/dist/index.js +14 -0
  63. package/dist/models/FeatureFlag.d.ts +11 -0
  64. package/dist/models/FeatureFlag.js +1 -0
  65. package/dist/models/LuciqConfig.d.ts +42 -0
  66. package/dist/models/LuciqConfig.js +1 -0
  67. package/dist/models/NonFatalOptions.d.ts +15 -0
  68. package/dist/models/NonFatalOptions.js +1 -0
  69. package/dist/models/OverAirUpdate.d.ts +12 -0
  70. package/dist/models/OverAirUpdate.js +1 -0
  71. package/dist/models/Report.d.ts +70 -0
  72. package/dist/models/Report.js +109 -0
  73. package/dist/models/ReproConfig.d.ts +27 -0
  74. package/dist/models/ReproConfig.js +1 -0
  75. package/dist/models/SessionMetadata.d.ts +55 -0
  76. package/dist/models/SessionMetadata.js +1 -0
  77. package/dist/models/ThemeConfig.d.ts +27 -0
  78. package/dist/models/ThemeConfig.js +1 -0
  79. package/dist/models/W3cExternalTraceAttributes.d.ts +22 -0
  80. package/dist/models/W3cExternalTraceAttributes.js +1 -0
  81. package/dist/modules/APM.d.ts +77 -0
  82. package/dist/modules/APM.js +104 -0
  83. package/dist/modules/BugReporting.d.ts +138 -0
  84. package/dist/modules/BugReporting.js +202 -0
  85. package/dist/modules/CrashReporting.d.ts +19 -0
  86. package/dist/modules/CrashReporting.js +40 -0
  87. package/dist/modules/FeatureRequests.d.ts +20 -0
  88. package/dist/modules/FeatureRequests.js +28 -0
  89. package/dist/modules/Luciq.d.ts +362 -0
  90. package/dist/modules/Luciq.js +797 -0
  91. package/dist/modules/NetworkLogger.d.ts +52 -0
  92. package/dist/modules/NetworkLogger.js +208 -0
  93. package/dist/modules/Replies.d.ts +78 -0
  94. package/dist/modules/Replies.js +121 -0
  95. package/dist/modules/SessionReplay.d.ts +78 -0
  96. package/dist/modules/SessionReplay.js +98 -0
  97. package/dist/modules/Surveys.d.ts +75 -0
  98. package/dist/modules/Surveys.js +101 -0
  99. package/dist/native/NativeAPM.d.ts +18 -0
  100. package/dist/native/NativeAPM.js +4 -0
  101. package/dist/native/NativeBugReporting.d.ts +32 -0
  102. package/dist/native/NativeBugReporting.js +10 -0
  103. package/dist/native/NativeConstants.d.ts +182 -0
  104. package/dist/native/NativeConstants.js +1 -0
  105. package/dist/native/NativeCrashReporting.d.ts +18 -0
  106. package/dist/native/NativeCrashReporting.js +2 -0
  107. package/dist/native/NativeFeatureRequests.d.ts +8 -0
  108. package/dist/native/NativeFeatureRequests.js +2 -0
  109. package/dist/native/NativeLuciq.d.ts +86 -0
  110. package/dist/native/NativeLuciq.js +10 -0
  111. package/dist/native/NativeNetworkLogger.d.ts +21 -0
  112. package/dist/native/NativeNetworkLogger.js +14 -0
  113. package/dist/native/NativePackage.d.ts +21 -0
  114. package/dist/native/NativePackage.js +2 -0
  115. package/dist/native/NativeReplies.d.ts +21 -0
  116. package/dist/native/NativeReplies.js +8 -0
  117. package/dist/native/NativeSessionReplay.d.ts +16 -0
  118. package/dist/native/NativeSessionReplay.js +8 -0
  119. package/dist/native/NativeSurveys.d.ts +22 -0
  120. package/dist/native/NativeSurveys.js +9 -0
  121. package/dist/utils/AppStatesHandler.d.ts +3 -0
  122. package/dist/utils/AppStatesHandler.js +16 -0
  123. package/dist/utils/Enums.d.ts +244 -0
  124. package/dist/utils/Enums.js +266 -0
  125. package/dist/utils/FeatureFlags.d.ts +7 -0
  126. package/dist/utils/FeatureFlags.js +24 -0
  127. package/dist/utils/LuciqConstants.d.ts +14 -0
  128. package/dist/utils/LuciqConstants.js +15 -0
  129. package/dist/utils/LuciqUtils.d.ts +97 -0
  130. package/dist/utils/LuciqUtils.js +301 -0
  131. package/dist/utils/UnhandledRejectionTracking.d.ts +9 -0
  132. package/dist/utils/UnhandledRejectionTracking.js +99 -0
  133. package/dist/utils/XhrNetworkInterceptor.d.ts +39 -0
  134. package/dist/utils/XhrNetworkInterceptor.js +253 -0
  135. package/dist/utils/config.d.ts +5 -0
  136. package/dist/utils/config.js +6 -0
  137. package/dist/utils/logger.d.ts +10 -0
  138. package/dist/utils/logger.js +39 -0
  139. package/expo.d.ts +1 -0
  140. package/expo.js +1 -0
  141. package/ios/RNLuciq/ArgsRegistry.h +32 -0
  142. package/ios/RNLuciq/ArgsRegistry.m +276 -0
  143. package/ios/RNLuciq/LuciqAPMBridge.h +26 -0
  144. package/ios/RNLuciq/LuciqAPMBridge.m +99 -0
  145. package/ios/RNLuciq/LuciqBugReportingBridge.h +60 -0
  146. package/ios/RNLuciq/LuciqBugReportingBridge.m +241 -0
  147. package/ios/RNLuciq/LuciqCrashReportingBridge.h +18 -0
  148. package/ios/RNLuciq/LuciqCrashReportingBridge.m +68 -0
  149. package/ios/RNLuciq/LuciqFeatureRequestsBridge.h +30 -0
  150. package/ios/RNLuciq/LuciqFeatureRequestsBridge.m +61 -0
  151. package/ios/RNLuciq/LuciqNetworkLoggerBridge.h +44 -0
  152. package/ios/RNLuciq/LuciqNetworkLoggerBridge.m +206 -0
  153. package/ios/RNLuciq/LuciqReactBridge.h +151 -0
  154. package/ios/RNLuciq/LuciqReactBridge.m +548 -0
  155. package/ios/RNLuciq/LuciqRepliesBridge.h +40 -0
  156. package/ios/RNLuciq/LuciqRepliesBridge.m +80 -0
  157. package/ios/RNLuciq/LuciqSessionReplayBridge.h +32 -0
  158. package/ios/RNLuciq/LuciqSessionReplayBridge.m +107 -0
  159. package/ios/RNLuciq/LuciqSurveysBridge.h +46 -0
  160. package/ios/RNLuciq/LuciqSurveysBridge.m +107 -0
  161. package/ios/RNLuciq/RCTConvert+LuciqEnums.h +18 -0
  162. package/ios/RNLuciq/RCTConvert+LuciqEnums.m +127 -0
  163. package/ios/RNLuciq/RNLuciq.h +35 -0
  164. package/ios/RNLuciq/RNLuciq.m +107 -0
  165. package/ios/RNLuciq/Util/LCQAPM+PrivateAPIs.h +15 -0
  166. package/ios/RNLuciq/Util/LCQCrashReporting+CP.h +13 -0
  167. package/ios/RNLuciq/Util/LCQNetworkLogger+CP.h +68 -0
  168. package/ios/RNLuciq/Util/Luciq+CP.h +12 -0
  169. package/ios/RNLuciq.xcodeproj/project.pbxproj +352 -0
  170. package/ios/native.rb +12 -0
  171. package/ios/sourcemaps.sh +120 -0
  172. package/migrate.js +569 -0
  173. package/package.json +92 -0
  174. package/plugin/build/index.js +42078 -0
  175. package/plugin/src/index.ts +5 -0
  176. package/plugin/src/pluginProps.ts +6 -0
  177. package/plugin/src/withLuciq.ts +51 -0
  178. package/plugin/src/withLuciqAndroid.ts +99 -0
  179. package/plugin/src/withLuciqIOS.ts +109 -0
  180. package/plugin/tsconfig.json +7 -0
  181. package/react-native.config.js +16 -0
  182. package/scripts/customize-ios-endpoints.sh +28 -0
  183. package/scripts/dream-11-delete-unused-features.sh +62 -0
  184. package/scripts/find-token.js +58 -0
  185. package/scripts/find-token.sh +70 -0
  186. package/scripts/notify-github.sh +15 -0
  187. package/scripts/replace.js +58 -0
  188. package/scripts/snapshot-comment.md +15 -0
  189. package/scripts/snapshot-version.sh +11 -0
  190. package/src/index.ts +40 -0
  191. package/src/models/FeatureFlag.ts +12 -0
  192. package/src/models/LuciqConfig.ts +48 -0
  193. package/src/models/NonFatalOptions.ts +16 -0
  194. package/src/models/OverAirUpdate.ts +14 -0
  195. package/src/models/Report.ts +124 -0
  196. package/src/models/ReproConfig.ts +31 -0
  197. package/src/models/SessionMetadata.ts +57 -0
  198. package/src/models/ThemeConfig.ts +34 -0
  199. package/src/models/W3cExternalTraceAttributes.ts +22 -0
  200. package/src/modules/APM.ts +117 -0
  201. package/src/modules/BugReporting.ts +254 -0
  202. package/src/modules/CrashReporting.ts +54 -0
  203. package/src/modules/FeatureRequests.ts +32 -0
  204. package/src/modules/Luciq.ts +934 -0
  205. package/src/modules/NetworkLogger.ts +270 -0
  206. package/src/modules/Replies.ts +137 -0
  207. package/src/modules/SessionReplay.ts +111 -0
  208. package/src/modules/Surveys.ts +118 -0
  209. package/src/native/NativeAPM.ts +51 -0
  210. package/src/native/NativeBugReporting.ts +70 -0
  211. package/src/native/NativeConstants.ts +215 -0
  212. package/src/native/NativeCrashReporting.ts +29 -0
  213. package/src/native/NativeFeatureRequests.ts +12 -0
  214. package/src/native/NativeLuciq.ts +179 -0
  215. package/src/native/NativeNetworkLogger.ts +42 -0
  216. package/src/native/NativePackage.ts +25 -0
  217. package/src/native/NativeReplies.ts +34 -0
  218. package/src/native/NativeSessionReplay.ts +21 -0
  219. package/src/native/NativeSurveys.ts +34 -0
  220. package/src/promise.d.ts +11 -0
  221. package/src/utils/AppStatesHandler.ts +19 -0
  222. package/src/utils/Enums.ts +266 -0
  223. package/src/utils/FeatureFlags.ts +33 -0
  224. package/src/utils/LuciqConstants.ts +24 -0
  225. package/src/utils/LuciqUtils.ts +417 -0
  226. package/src/utils/UnhandledRejectionTracking.ts +118 -0
  227. package/src/utils/XhrNetworkInterceptor.ts +333 -0
  228. package/src/utils/config.ts +7 -0
  229. package/src/utils/logger.ts +54 -0
  230. package/tsconfig.json +32 -0
  231. package/tsconfig.test.json +4 -0
  232. package/tsconfig.upload.json +10 -0
  233. package/upload/index.d.ts +4 -0
  234. package/upload/index.js +17314 -0
  235. package/upload/migrate.d.ts +14 -0
  236. package/upload/package.json +5 -0
  237. package/upload/uploadEasUpdatesSourcemaps.d.ts +21 -0
  238. package/upload/uploadSoFiles.d.ts +21 -0
  239. 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
+ };