react-native-inapp-inspector 2.3.19 → 2.3.21

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 (353) hide show
  1. package/README.md +14 -14
  2. package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +67 -0
  3. package/dist/commonjs/analytics.js +1 -24
  4. package/dist/commonjs/bundle.js +1 -16
  5. package/dist/commonjs/capture.js +1 -35
  6. package/dist/commonjs/components/AnalyticsDetail.js +92 -623
  7. package/dist/commonjs/components/AnalyticsEventCard.js +54 -350
  8. package/dist/commonjs/components/AnalyticsGraph.js +70 -370
  9. package/dist/commonjs/components/AnimatedEntrance.js +1 -11
  10. package/dist/commonjs/components/AppHeaderLogo.js +7 -134
  11. package/dist/commonjs/components/BrandCircleIcon.js +73 -118
  12. package/dist/commonjs/components/BrandSquareIcon.js +63 -108
  13. package/dist/commonjs/components/CodeSnippet.js +48 -623
  14. package/dist/commonjs/components/ConsoleLogCard.js +63 -537
  15. package/dist/commonjs/components/CopyButton.js +3 -89
  16. package/dist/commonjs/components/DiffViewer.js +19 -83
  17. package/dist/commonjs/components/DomainHeader.js +27 -127
  18. package/dist/commonjs/components/EmptyState.js +10 -87
  19. package/dist/commonjs/components/EndOfListFooter.js +7 -81
  20. package/dist/commonjs/components/ErrorBoundary.js +72 -566
  21. package/dist/commonjs/components/HeadersSection.js +31 -110
  22. package/dist/commonjs/components/HighlightText.js +17 -58
  23. package/dist/commonjs/components/Inspector/AboutModal.d.ts +6 -0
  24. package/dist/commonjs/components/Inspector/AboutModal.js +243 -0
  25. package/dist/commonjs/components/Inspector/AnalyticsFilterModal.js +98 -797
  26. package/dist/commonjs/components/Inspector/AnalyticsTab.js +284 -930
  27. package/dist/commonjs/components/Inspector/BundleTab.js +551 -2918
  28. package/dist/commonjs/components/Inspector/ConsoleTab.js +79 -492
  29. package/dist/commonjs/components/Inspector/CrashDetail.js +123 -672
  30. package/dist/commonjs/components/Inspector/CrashFilterModal.js +66 -498
  31. package/dist/commonjs/components/Inspector/CrashTab.js +98 -670
  32. package/dist/commonjs/components/Inspector/DebuggingTab.js +74 -875
  33. package/dist/commonjs/components/Inspector/DeviceInfoTab.js +143 -907
  34. package/dist/commonjs/components/Inspector/FabLauncher.js +42 -466
  35. package/dist/commonjs/components/Inspector/FeatureUnderDevNotice.js +6 -99
  36. package/dist/commonjs/components/Inspector/InspectorContext.js +1 -21
  37. package/dist/commonjs/components/Inspector/InspectorHeader.js +191 -1110
  38. package/dist/commonjs/components/Inspector/LogDetail.js +168 -994
  39. package/dist/commonjs/components/Inspector/MainScreen.js +52 -335
  40. package/dist/commonjs/components/Inspector/MediaGalleryTab.js +97 -644
  41. package/dist/commonjs/components/Inspector/MediaPreviewModal.js +90 -605
  42. package/dist/commonjs/components/Inspector/NavigationTracker.js +1 -12
  43. package/dist/commonjs/components/Inspector/NetworkDetail.js +89 -411
  44. package/dist/commonjs/components/Inspector/NetworkFilterModal.js +60 -576
  45. package/dist/commonjs/components/Inspector/NetworkTab.js +84 -514
  46. package/dist/commonjs/components/Inspector/NpmStarPrompt.js +18 -434
  47. package/dist/commonjs/components/Inspector/NpmUpdateToast.js +25 -298
  48. package/dist/commonjs/components/Inspector/PerformanceTab.js +182 -1397
  49. package/dist/commonjs/components/Inspector/ReduxDetail.js +188 -1089
  50. package/dist/commonjs/components/Inspector/ReduxTab.js +85 -701
  51. package/dist/commonjs/components/Inspector/SettingsPanel.js +427 -3807
  52. package/dist/commonjs/components/Inspector/SkeletonPlaceholder.js +11 -180
  53. package/dist/commonjs/components/Inspector/StorageTab.js +93 -826
  54. package/dist/commonjs/components/Inspector/TabBar.js +36 -334
  55. package/dist/commonjs/components/Inspector/UpdateAvailableModal.js +37 -412
  56. package/dist/commonjs/components/JsonViewer.js +168 -381
  57. package/dist/commonjs/components/LogCard.js +57 -567
  58. package/dist/commonjs/components/LogSyntaxHighlighter.js +11 -130
  59. package/dist/commonjs/components/MetaAccordion.js +69 -238
  60. package/dist/commonjs/components/MiniBarChart.js +3 -56
  61. package/dist/commonjs/components/MiniLineChart.js +3 -58
  62. package/dist/commonjs/components/NetworkIcons.d.ts +13 -0
  63. package/dist/commonjs/components/NetworkIcons.js +521 -1022
  64. package/dist/commonjs/components/QRCodeView.js +5 -79
  65. package/dist/commonjs/components/SectionHeader.js +15 -37
  66. package/dist/commonjs/components/SegmentedTabs.js +7 -62
  67. package/dist/commonjs/components/SkeletonPlaceholder.js +11 -180
  68. package/dist/commonjs/components/Slider.js +15 -243
  69. package/dist/commonjs/components/SourcePageCard.js +30 -89
  70. package/dist/commonjs/components/Toast.js +5 -147
  71. package/dist/commonjs/components/TouchableScale.js +3 -24
  72. package/dist/commonjs/components/TreeNode.js +55 -130
  73. package/dist/commonjs/console.js +1 -16
  74. package/dist/commonjs/constants/index.js +1 -32
  75. package/dist/commonjs/constants/telemetryConfig.js +1 -6
  76. package/dist/commonjs/constants/version.d.ts +1 -1
  77. package/dist/commonjs/constants/version.js +1 -4
  78. package/dist/commonjs/crash.js +1 -23
  79. package/dist/commonjs/customHooks/analyticsLogger.js +1 -250
  80. package/dist/commonjs/customHooks/bundleAnalyzer.js +1 -957
  81. package/dist/commonjs/customHooks/consoleLogger.js +6 -445
  82. package/dist/commonjs/customHooks/crashHandler.js +7 -656
  83. package/dist/commonjs/customHooks/logFilters.js +1 -23
  84. package/dist/commonjs/customHooks/networkLogger.js +2 -536
  85. package/dist/commonjs/customHooks/performanceTracker.js +63 -750
  86. package/dist/commonjs/customHooks/reduxLogger.js +2 -313
  87. package/dist/commonjs/customHooks/storageInspector.js +1 -435
  88. package/dist/commonjs/customHooks/useAccordion.js +1 -18
  89. package/dist/commonjs/decorators/index.js +1 -100
  90. package/dist/commonjs/helpers/gaAnalyticsRegistry.js +1 -148
  91. package/dist/commonjs/helpers/index.d.ts +1 -0
  92. package/dist/commonjs/helpers/index.js +8 -921
  93. package/dist/commonjs/helpers/memoryManager.js +1 -99
  94. package/dist/commonjs/helpers/qrGenerator.js +1 -367
  95. package/dist/commonjs/helpers/remoteConfig.js +1 -165
  96. package/dist/commonjs/helpers/searchQueryParser.js +1 -62
  97. package/dist/commonjs/helpers/settingsStore.js +1 -144
  98. package/dist/commonjs/helpers/telemetry.js +1 -501
  99. package/dist/commonjs/helpers/toast.js +1 -20
  100. package/dist/commonjs/i18n/index.js +1 -90
  101. package/dist/commonjs/i18n/locales/en.json +1 -1140
  102. package/dist/commonjs/index.js +5 -2168
  103. package/dist/commonjs/metro.js +6 -468
  104. package/dist/commonjs/native/NativeInspector.d.ts +1 -0
  105. package/dist/commonjs/native/NativeInspector.js +1 -415
  106. package/dist/commonjs/native/NativeNetworkInspector.js +1 -4
  107. package/dist/commonjs/network.js +1 -13
  108. package/dist/commonjs/performance.js +1 -29
  109. package/dist/commonjs/redux.js +1 -20
  110. package/dist/commonjs/storage.js +1 -14
  111. package/dist/commonjs/styles/AppColors.js +1 -423
  112. package/dist/commonjs/styles/AppFonts.js +1 -17
  113. package/dist/commonjs/styles/common.js +1 -190
  114. package/dist/commonjs/styles/index.d.ts +6 -0
  115. package/dist/commonjs/styles/index.js +1 -1589
  116. package/dist/commonjs/types/enums.d.ts +0 -1
  117. package/dist/commonjs/types/enums.js +1 -152
  118. package/dist/commonjs/types/index.js +1 -18
  119. package/dist/commonjs/types/interfaces.d.ts +2 -2
  120. package/dist/commonjs/types/interfaces.js +1 -2
  121. package/dist/esm/analytics.js +1 -2
  122. package/dist/esm/bundle.js +1 -2
  123. package/dist/esm/capture.js +1 -32
  124. package/dist/esm/components/AnalyticsDetail.js +171 -664
  125. package/dist/esm/components/AnalyticsEventCard.js +77 -335
  126. package/dist/esm/components/AnalyticsGraph.js +95 -357
  127. package/dist/esm/components/AnimatedEntrance.js +1 -6
  128. package/dist/esm/components/AppHeaderLogo.js +7 -94
  129. package/dist/esm/components/BrandCircleIcon.js +114 -119
  130. package/dist/esm/components/BrandSquareIcon.js +73 -78
  131. package/dist/esm/components/CodeSnippet.js +58 -595
  132. package/dist/esm/components/ConsoleLogCard.js +91 -526
  133. package/dist/esm/components/CopyButton.js +3 -51
  134. package/dist/esm/components/DiffViewer.js +22 -48
  135. package/dist/esm/components/DomainHeader.js +43 -138
  136. package/dist/esm/components/EmptyState.js +17 -56
  137. package/dist/esm/components/EndOfListFooter.js +15 -83
  138. package/dist/esm/components/ErrorBoundary.js +125 -582
  139. package/dist/esm/components/HeadersSection.js +52 -93
  140. package/dist/esm/components/HighlightText.js +17 -53
  141. package/dist/esm/components/Inspector/AboutModal.d.ts +6 -0
  142. package/dist/esm/components/Inspector/AboutModal.js +243 -0
  143. package/dist/esm/components/Inspector/AnalyticsFilterModal.js +225 -886
  144. package/dist/esm/components/Inspector/AnalyticsTab.js +296 -904
  145. package/dist/esm/components/Inspector/BundleTab.js +1175 -3502
  146. package/dist/esm/components/Inspector/ConsoleTab.js +113 -488
  147. package/dist/esm/components/Inspector/CrashDetail.js +236 -747
  148. package/dist/esm/components/Inspector/CrashFilterModal.js +149 -541
  149. package/dist/esm/components/Inspector/CrashTab.js +177 -711
  150. package/dist/esm/components/Inspector/DebuggingTab.js +164 -925
  151. package/dist/esm/components/Inspector/DeviceInfoTab.js +199 -924
  152. package/dist/esm/components/Inspector/FabLauncher.js +68 -454
  153. package/dist/esm/components/Inspector/FeatureUnderDevNotice.js +14 -70
  154. package/dist/esm/components/Inspector/InspectorContext.js +1 -12
  155. package/dist/esm/components/Inspector/InspectorHeader.js +282 -1163
  156. package/dist/esm/components/Inspector/LogDetail.js +235 -1023
  157. package/dist/esm/components/Inspector/MainScreen.js +78 -323
  158. package/dist/esm/components/Inspector/MediaGalleryTab.js +143 -650
  159. package/dist/esm/components/Inspector/MediaPreviewModal.js +138 -613
  160. package/dist/esm/components/Inspector/NavigationTracker.js +1 -10
  161. package/dist/esm/components/Inspector/NetworkDetail.js +138 -455
  162. package/dist/esm/components/Inspector/NetworkFilterModal.js +122 -597
  163. package/dist/esm/components/Inspector/NetworkTab.js +125 -517
  164. package/dist/esm/components/Inspector/NpmStarPrompt.js +58 -434
  165. package/dist/esm/components/Inspector/NpmUpdateToast.js +45 -281
  166. package/dist/esm/components/Inspector/PerformanceTab.js +393 -1570
  167. package/dist/esm/components/Inspector/ReduxDetail.js +307 -1170
  168. package/dist/esm/components/Inspector/ReduxTab.js +144 -722
  169. package/dist/esm/components/Inspector/SettingsPanel.js +643 -3985
  170. package/dist/esm/components/Inspector/SkeletonPlaceholder.js +30 -163
  171. package/dist/esm/components/Inspector/StorageTab.js +172 -866
  172. package/dist/esm/components/Inspector/TabBar.js +45 -305
  173. package/dist/esm/components/Inspector/UpdateAvailableModal.js +80 -418
  174. package/dist/esm/components/JsonViewer.js +179 -354
  175. package/dist/esm/components/LogCard.js +93 -565
  176. package/dist/esm/components/LogSyntaxHighlighter.js +11 -123
  177. package/dist/esm/components/MetaAccordion.js +136 -267
  178. package/dist/esm/components/MiniBarChart.js +3 -18
  179. package/dist/esm/components/MiniLineChart.js +3 -20
  180. package/dist/esm/components/NetworkIcons.d.ts +13 -0
  181. package/dist/esm/components/NetworkIcons.js +523 -838
  182. package/dist/esm/components/QRCodeView.js +8 -45
  183. package/dist/esm/components/SectionHeader.js +22 -39
  184. package/dist/esm/components/SegmentedTabs.js +8 -58
  185. package/dist/esm/components/SkeletonPlaceholder.js +30 -163
  186. package/dist/esm/components/Slider.js +24 -213
  187. package/dist/esm/components/SourcePageCard.js +65 -86
  188. package/dist/esm/components/Toast.js +10 -117
  189. package/dist/esm/components/TouchableScale.js +3 -19
  190. package/dist/esm/components/TreeNode.js +58 -95
  191. package/dist/esm/console.js +1 -2
  192. package/dist/esm/constants/index.js +1 -28
  193. package/dist/esm/constants/telemetryConfig.js +1 -3
  194. package/dist/esm/constants/version.d.ts +1 -1
  195. package/dist/esm/constants/version.js +1 -1
  196. package/dist/esm/crash.js +1 -2
  197. package/dist/esm/customHooks/analyticsLogger.js +1 -230
  198. package/dist/esm/customHooks/bundleAnalyzer.js +1 -944
  199. package/dist/esm/customHooks/consoleLogger.js +6 -432
  200. package/dist/esm/customHooks/crashHandler.js +7 -630
  201. package/dist/esm/customHooks/logFilters.js +1 -20
  202. package/dist/esm/customHooks/networkLogger.js +2 -519
  203. package/dist/esm/customHooks/performanceTracker.js +63 -723
  204. package/dist/esm/customHooks/reduxLogger.js +2 -293
  205. package/dist/esm/customHooks/storageInspector.js +1 -418
  206. package/dist/esm/customHooks/useAccordion.js +1 -16
  207. package/dist/esm/decorators/index.js +1 -95
  208. package/dist/esm/helpers/gaAnalyticsRegistry.js +1 -143
  209. package/dist/esm/helpers/index.d.ts +1 -0
  210. package/dist/esm/helpers/index.js +8 -861
  211. package/dist/esm/helpers/memoryManager.js +1 -91
  212. package/dist/esm/helpers/qrGenerator.js +1 -364
  213. package/dist/esm/helpers/remoteConfig.js +1 -160
  214. package/dist/esm/helpers/searchQueryParser.js +1 -59
  215. package/dist/esm/helpers/settingsStore.js +1 -134
  216. package/dist/esm/helpers/telemetry.js +1 -489
  217. package/dist/esm/helpers/toast.js +1 -15
  218. package/dist/esm/i18n/index.js +1 -78
  219. package/dist/esm/i18n/locales/en.json +1 -1140
  220. package/dist/esm/index.js +7 -1982
  221. package/dist/esm/metro.js +6 -459
  222. package/dist/esm/native/NativeInspector.d.ts +1 -0
  223. package/dist/esm/native/NativeInspector.js +1 -382
  224. package/dist/esm/native/NativeNetworkInspector.js +1 -2
  225. package/dist/esm/network.js +1 -1
  226. package/dist/esm/performance.js +1 -2
  227. package/dist/esm/redux.js +1 -1
  228. package/dist/esm/storage.js +1 -1
  229. package/dist/esm/styles/AppColors.js +1 -417
  230. package/dist/esm/styles/AppFonts.js +1 -13
  231. package/dist/esm/styles/common.js +1 -186
  232. package/dist/esm/styles/index.d.ts +6 -0
  233. package/dist/esm/styles/index.js +1 -1551
  234. package/dist/esm/types/enums.d.ts +0 -1
  235. package/dist/esm/types/enums.js +1 -149
  236. package/dist/esm/types/index.js +1 -2
  237. package/dist/esm/types/interfaces.d.ts +2 -2
  238. package/dist/esm/types/interfaces.js +1 -1
  239. package/ios/NetworkInspectorModule.mm +60 -12
  240. package/package.json +5 -3
  241. package/src/native/NativeInspector.ts +18 -0
  242. package/dist/commonjs/components/Inspector/FeedbackModal.d.ts +0 -7
  243. package/dist/commonjs/components/Inspector/FeedbackModal.js +0 -552
  244. package/dist/esm/components/Inspector/FeedbackModal.d.ts +0 -7
  245. package/dist/esm/components/Inspector/FeedbackModal.js +0 -515
  246. package/src/analytics.ts +0 -35
  247. package/src/bundle.ts +0 -25
  248. package/src/capture.ts +0 -109
  249. package/src/components/AnalyticsDetail.tsx +0 -870
  250. package/src/components/AnalyticsEventCard.tsx +0 -444
  251. package/src/components/AnalyticsGraph.tsx +0 -583
  252. package/src/components/AnimatedEntrance.tsx +0 -20
  253. package/src/components/AppHeaderLogo.tsx +0 -143
  254. package/src/components/BrandCircleIcon.tsx +0 -144
  255. package/src/components/BrandSquareIcon.tsx +0 -184
  256. package/src/components/CodeSnippet.tsx +0 -725
  257. package/src/components/ConsoleLogCard.tsx +0 -679
  258. package/src/components/CopyButton.tsx +0 -87
  259. package/src/components/DiffViewer.tsx +0 -82
  260. package/src/components/DomainHeader.tsx +0 -224
  261. package/src/components/EmptyState.tsx +0 -97
  262. package/src/components/EndOfListFooter.tsx +0 -100
  263. package/src/components/ErrorBoundary.tsx +0 -688
  264. package/src/components/HeadersSection.tsx +0 -172
  265. package/src/components/HighlightText.tsx +0 -100
  266. package/src/components/Inspector/AnalyticsFilterModal.tsx +0 -1250
  267. package/src/components/Inspector/AnalyticsTab.tsx +0 -1362
  268. package/src/components/Inspector/BundleTab.tsx +0 -4768
  269. package/src/components/Inspector/ConsoleTab.tsx +0 -726
  270. package/src/components/Inspector/CrashDetail.tsx +0 -997
  271. package/src/components/Inspector/CrashFilterModal.tsx +0 -721
  272. package/src/components/Inspector/CrashTab.tsx +0 -933
  273. package/src/components/Inspector/DebuggingTab.tsx +0 -1103
  274. package/src/components/Inspector/DeviceInfoTab.tsx +0 -1397
  275. package/src/components/Inspector/FabLauncher.tsx +0 -590
  276. package/src/components/Inspector/FeatureUnderDevNotice.tsx +0 -94
  277. package/src/components/Inspector/FeedbackModal.tsx +0 -626
  278. package/src/components/Inspector/InspectorContext.tsx +0 -28
  279. package/src/components/Inspector/InspectorHeader.tsx +0 -1583
  280. package/src/components/Inspector/LogDetail.tsx +0 -1431
  281. package/src/components/Inspector/MainScreen.tsx +0 -460
  282. package/src/components/Inspector/MediaGalleryTab.tsx +0 -829
  283. package/src/components/Inspector/MediaPreviewModal.tsx +0 -783
  284. package/src/components/Inspector/NavigationTracker.tsx +0 -13
  285. package/src/components/Inspector/NetworkDetail.tsx +0 -778
  286. package/src/components/Inspector/NetworkFilterModal.tsx +0 -730
  287. package/src/components/Inspector/NetworkTab.tsx +0 -820
  288. package/src/components/Inspector/NpmStarPrompt.tsx +0 -532
  289. package/src/components/Inspector/NpmUpdateToast.tsx +0 -387
  290. package/src/components/Inspector/PerformanceTab.tsx +0 -1967
  291. package/src/components/Inspector/ReduxDetail.tsx +0 -1651
  292. package/src/components/Inspector/ReduxTab.tsx +0 -987
  293. package/src/components/Inspector/SettingsPanel.tsx +0 -5136
  294. package/src/components/Inspector/SkeletonPlaceholder.tsx +0 -206
  295. package/src/components/Inspector/StorageTab.tsx +0 -1159
  296. package/src/components/Inspector/TabBar.tsx +0 -431
  297. package/src/components/Inspector/UpdateAvailableModal.tsx +0 -555
  298. package/src/components/JsonViewer.tsx +0 -549
  299. package/src/components/LogCard.tsx +0 -694
  300. package/src/components/LogSyntaxHighlighter.tsx +0 -178
  301. package/src/components/MetaAccordion.tsx +0 -355
  302. package/src/components/MiniBarChart.tsx +0 -42
  303. package/src/components/MiniLineChart.tsx +0 -33
  304. package/src/components/NetworkIcons.tsx +0 -2655
  305. package/src/components/QRCodeView.tsx +0 -75
  306. package/src/components/SectionHeader.tsx +0 -101
  307. package/src/components/SegmentedTabs.tsx +0 -84
  308. package/src/components/SkeletonPlaceholder.tsx +0 -206
  309. package/src/components/Slider.tsx +0 -300
  310. package/src/components/SourcePageCard.tsx +0 -150
  311. package/src/components/Toast.tsx +0 -131
  312. package/src/components/TouchableScale.tsx +0 -61
  313. package/src/components/TreeNode.tsx +0 -171
  314. package/src/console.ts +0 -24
  315. package/src/constants/index.ts +0 -41
  316. package/src/constants/telemetryConfig.ts +0 -4
  317. package/src/constants/version.ts +0 -3
  318. package/src/crash.ts +0 -32
  319. package/src/customHooks/analyticsLogger.ts +0 -336
  320. package/src/customHooks/bundleAnalyzer.ts +0 -1256
  321. package/src/customHooks/consoleLogger.ts +0 -530
  322. package/src/customHooks/crashHandler.ts +0 -944
  323. package/src/customHooks/logFilters.ts +0 -32
  324. package/src/customHooks/networkLogger.ts +0 -624
  325. package/src/customHooks/performanceTracker.ts +0 -1014
  326. package/src/customHooks/reduxLogger.ts +0 -406
  327. package/src/customHooks/storageInspector.ts +0 -513
  328. package/src/customHooks/useAccordion.tsx +0 -27
  329. package/src/decorators/index.ts +0 -184
  330. package/src/helpers/gaAnalyticsRegistry.ts +0 -204
  331. package/src/helpers/index.ts +0 -1092
  332. package/src/helpers/memoryManager.ts +0 -138
  333. package/src/helpers/qrGenerator.ts +0 -430
  334. package/src/helpers/remoteConfig.ts +0 -212
  335. package/src/helpers/searchQueryParser.ts +0 -84
  336. package/src/helpers/settingsStore.ts +0 -171
  337. package/src/helpers/telemetry.ts +0 -568
  338. package/src/helpers/toast.ts +0 -17
  339. package/src/i18n/index.ts +0 -104
  340. package/src/i18n/locales/en.json +0 -1141
  341. package/src/index.tsx +0 -2650
  342. package/src/metro.ts +0 -598
  343. package/src/network.ts +0 -22
  344. package/src/performance.ts +0 -38
  345. package/src/redux.ts +0 -23
  346. package/src/storage.ts +0 -18
  347. package/src/styles/AppColors.ts +0 -455
  348. package/src/styles/AppFonts.ts +0 -26
  349. package/src/styles/common.ts +0 -209
  350. package/src/styles/index.ts +0 -1606
  351. package/src/types/enums.ts +0 -210
  352. package/src/types/index.ts +0 -34
  353. package/src/types/interfaces.ts +0 -535
@@ -1,32 +0,0 @@
1
- /**
2
- * Configuration for console logs to ignore.
3
- * Logs matching any of these starting prefixes will be filtered out.
4
- */
5
- export const IGNORED_LOG_PREFIXES: Record<'info' | 'warn' | 'error', string[]> =
6
- {
7
- info: [
8
- // Add prefixes of info logs you want to ignore, e.g.:
9
- // 'Starting server',
10
- 'VirtualizedList: You have a large list that is slow to update',
11
- ],
12
- warn: [
13
- // Add prefixes of warning logs you want to ignore, e.g.:
14
- // 'Require cycle:',
15
- // 'ViewPropTypes will be removed',
16
- 'This method is deprecated (as well as all React Native Firebase namespaced API) and will be removed in the next major release as part of move to match Firebase Web modular SDK API.',
17
- 'SerializableStateInvariantMiddleware took',
18
- 'Non-serializable values were found in the navigation state.',
19
- 'SafeAreaView has been deprecated and will be removed in a future release.',
20
- 'Clipboard has been extracted from react-native core and will be removed in a future release.',
21
- 'You should always pass contentWidth prop to properly handle screen rotations and have a seamless support for images scaling.',
22
- 'Selector unknown returned a different result when called with the same parameters.',
23
- 'You seem to update props of the "TRenderEngineProvider" component in short periods of time',
24
- 'A non-serializable value was detected in an action',
25
- ],
26
- error: [
27
- // Add prefixes of error logs you want to ignore, e.g.:
28
- // 'Warning: Each child in a list should have a unique',
29
- 'A non-serializable value was detected in the state, in the path: `tierStatusCalculator.date`',
30
- 'VirtualizedLists should never be nested inside plain ScrollViews with the same orientation because it can break windowing and other functionality - use another VirtualizedList-backed container instead.',
31
- ],
32
- };
@@ -1,624 +0,0 @@
1
- import axios from "axios";
2
- import {setupGlobalCrashHandler} from "./crashHandler";
3
- import {RouteInfo} from "../types";
4
-
5
- type NetworkLog = {
6
- id: number;
7
- url: string;
8
- method: string;
9
- status?: number;
10
- request?: any;
11
- response?: any;
12
- duration?: number;
13
- startTime: number;
14
- caller?: string; // ✅ Captures the file and line number
15
- client?: string; // ✅ Captures request client: axios, fetch, xhr, apollo, etc.
16
- requestHeaders?: Record<string, string>;
17
- responseHeaders?: Record<string, string>;
18
- routeInfo?: RouteInfo;
19
- };
20
-
21
- let logs: NetworkLog[] = [];
22
- let listeners: ((logs: NetworkLog[]) => void)[] = [];
23
- let counter = 0;
24
- let isNetworkModuleEnabled = true;
25
- let currentRouteProvider: (() => RouteInfo | null) | null = null;
26
-
27
- export const setRouteInfoProvider = (
28
- provider: (() => RouteInfo | null) | null,
29
- ) => {
30
- currentRouteProvider = provider;
31
- };
32
-
33
- export const setNetworkModuleEnabled = (enabled: boolean) => {
34
- isNetworkModuleEnabled = enabled;
35
- };
36
-
37
- export const getNetworkModuleEnabled = () => isNetworkModuleEnabled;
38
-
39
- const ALLOWED_METHODS = [
40
- "GET",
41
- "POST",
42
- "PUT",
43
- "PATCH",
44
- "DELETE",
45
- "HEAD",
46
- "OPTIONS",
47
- "CONNECT",
48
- "TRACE",
49
- ];
50
-
51
- const IGNORED_URL_PATTERNS: RegExp[] = [
52
- /\/symbolicate(?:\?|$)/i,
53
- /\/index\.bundle(?:\?|$)/i,
54
- /\/open-debugger(?:\?|$)/i,
55
- /:(?:8081|8082|8083|19000|19001)\/(?:index\.bundle|symbolicate|hot|message|status)/i,
56
- /google-analytics\.com\/mp\/collect/i,
57
- /analytics\.google\.com/i,
58
- ];
59
-
60
- function shouldIgnoreUrl(url: string | undefined | null): boolean {
61
- if (!url) return false;
62
- return IGNORED_URL_PATTERNS.some((re) => re.test(url));
63
- }
64
-
65
- // ─── Helpers ──────────────────────────────────────────────────────────────────
66
-
67
- function parseXHRResponseHeaders(
68
- headerStr: string | null | undefined,
69
- ): Record<string, string> | undefined {
70
- if (!headerStr || typeof headerStr !== "string") return undefined;
71
- const lines = headerStr.trim().split(/[\r\n]+/);
72
- const result: Record<string, string> = {};
73
- lines.forEach((line) => {
74
- const idx = line.indexOf(":");
75
- if (idx > 0) {
76
- const key = line.substring(0, idx).trim().toLowerCase();
77
- const val = line.substring(idx + 1).trim();
78
- result[key] = val;
79
- }
80
- });
81
- return Object.keys(result).length > 0 ? result : undefined;
82
- }
83
-
84
- function normaliseHeaders(
85
- raw: Headers | undefined | null,
86
- ): Record<string, string> | undefined {
87
- if (!raw) return undefined;
88
-
89
- if (typeof (raw as Headers).forEach === "function") {
90
- const result: Record<string, string> = {};
91
- (raw as Headers).forEach((value: string, key: string | number) => {
92
- result[key] = value;
93
- });
94
- return Object.keys(result).length > 0 ? result : undefined;
95
- }
96
-
97
- if (Array.isArray(raw)) {
98
- const result: Record<string, string> = {};
99
- (raw as string[][]).forEach(([key, value]) => {
100
- result[key] = value;
101
- });
102
- return Object.keys(result).length > 0 ? result : undefined;
103
- }
104
-
105
- const obj = raw as any as Record<string, string>;
106
- const result: Record<string, string> = {};
107
- Object.entries(obj).forEach(([key, value]) => {
108
- if (value != null) {
109
- result[key] = String(value);
110
- }
111
- });
112
- return Object.keys(result).length > 0 ? result : undefined;
113
- }
114
-
115
- // ✅ Parse FormData for File Upload previews
116
- function parseRequestData(data: any): any {
117
- if (!data) return data;
118
-
119
- if (data && data._parts && Array.isArray(data._parts)) {
120
- const parsedFormData: any = {};
121
- data._parts.forEach((part: any) => {
122
- const key = part[0];
123
- const value = part[1];
124
-
125
- if (value && typeof value === "object" && value.uri) {
126
- parsedFormData[key] = {
127
- _isFile: true,
128
- name: value.name || "unknown",
129
- type: value.type || "unknown",
130
- uri: value.uri,
131
- };
132
- } else {
133
- parsedFormData[key] = value;
134
- }
135
- });
136
- return { _isFormData: true, ...parsedFormData };
137
- }
138
-
139
- return data;
140
- }
141
-
142
- // ✅ Magic function to extract file and line number from the call stack
143
- function getCallerFromStack(): string {
144
- try {
145
- const stack = new Error().stack;
146
- if (!stack) return "Unknown";
147
- const lines = stack.split("\n");
148
- for (let i = 0; i < lines.length; i++) {
149
- const line = lines[i];
150
- // Skip internal react-native network modules and the logger itself
151
- if (
152
- line.includes("networkLogger") ||
153
- line.includes("node_modules") ||
154
- line.includes("Error") ||
155
- line.includes("regeneratorRuntime")
156
- ) {
157
- continue;
158
- }
159
- return line.trim().replace(/^at /, "");
160
- }
161
- } catch (e) {}
162
- return "Unknown";
163
- }
164
-
165
- // ─── Subscribe ────────────────────────────────────────────────────────────────
166
-
167
- export const subscribeNetworkLogs = (
168
- callback: (logs: NetworkLog[]) => void,
169
- ) => {
170
- listeners.push(callback);
171
- callback([...logs]);
172
- return () => {
173
- listeners = listeners.filter((l) => l !== callback);
174
- };
175
- };
176
-
177
- export const clearNetworkLogs = () => {
178
- logs = [];
179
- notify();
180
- };
181
-
182
- export const getNetworkLogs = () => [...logs];
183
-
184
- let maxNetworkLogsLimit = 250;
185
-
186
- export const setMaxNetworkLogsLimit = (limit: number): void => {
187
- maxNetworkLogsLimit = Math.max(10, limit);
188
- if (logs.length > maxNetworkLogsLimit) {
189
- logs = logs.slice(0, maxNetworkLogsLimit);
190
- notify();
191
- }
192
- };
193
-
194
- export const getMaxNetworkLogsLimit = (): number => maxNetworkLogsLimit;
195
-
196
- export const pruneNetworkLogs = (targetCount?: number): number => {
197
- const countToKeep = targetCount !== undefined ? Math.max(0, targetCount) : Math.floor(logs.length / 2);
198
- const pruned = logs.length - countToKeep;
199
- if (pruned > 0) {
200
- logs = logs.slice(0, countToKeep);
201
- notify();
202
- }
203
- return Math.max(0, pruned);
204
- };
205
-
206
- // ─── Internal ─────────────────────────────────────────────────────────────────
207
-
208
- const notify = () => {
209
- const snapshot = [...logs];
210
- listeners.forEach((cb) => cb(snapshot));
211
- };
212
-
213
- const addOrUpdateLog = (log: NetworkLog) => {
214
- if (!isNetworkModuleEnabled) return;
215
- const method = log.method?.toUpperCase();
216
-
217
- if (method && !ALLOWED_METHODS.includes(method)) return;
218
-
219
- if (shouldIgnoreUrl(log.url)) return;
220
-
221
- const index = logs.findIndex((l) => l.id === log.id);
222
-
223
- if (index >= 0) {
224
- logs[index] = { ...logs[index], ...log };
225
- } else {
226
- logs.unshift(log);
227
- }
228
-
229
- logs = logs.slice(0, maxNetworkLogsLimit);
230
- notify();
231
- };
232
-
233
- let isInsideFetch = false;
234
-
235
- // ─── Setup ────────────────────────────────────────────────────────────────────
236
-
237
- export const setupNetworkLogger = () => {
238
- if ((globalThis as any).__NETWORK_LOGGER_INITIALIZED__) return;
239
- (globalThis as any).__NETWORK_LOGGER__ = addOrUpdateLog;
240
-
241
- // 1. Hook XMLHttpRequest
242
- const globalXHR = (globalThis as any).XMLHttpRequest;
243
- if (globalXHR && globalXHR.prototype && !(globalThis as any).__XHR_LOGGER_INITIALIZED__) {
244
- (globalThis as any).__XHR_LOGGER_INITIALIZED__ = true;
245
- const originalOpen = globalXHR.prototype.open;
246
- const originalSend = globalXHR.prototype.send;
247
- const originalSetRequestHeader = globalXHR.prototype.setRequestHeader;
248
-
249
- globalXHR.prototype.open = function (
250
- method: string,
251
- url: string | any,
252
- async?: boolean,
253
- user?: string | null,
254
- password?: string | null,
255
- ) {
256
- this.__logMethod = (method || "GET").toUpperCase();
257
- this.__logUrl = typeof url === "string" ? url : String(url);
258
- this.__logRequestHeaders = {};
259
- this.__logStartTime = Date.now();
260
- this.__logCaller = getCallerFromStack();
261
-
262
- return originalOpen.apply(this, [method, url, async !== false, user, password]);
263
- };
264
-
265
- globalXHR.prototype.setRequestHeader = function (header: string, value: string) {
266
- if (header && value != null) {
267
- if (!this.__logRequestHeaders) this.__logRequestHeaders = {};
268
- this.__logRequestHeaders[header.toLowerCase()] = String(value);
269
- }
270
- return originalSetRequestHeader.apply(this, [header, value]);
271
- };
272
-
273
- globalXHR.prototype.send = function (body?: any) {
274
- if (!isNetworkModuleEnabled || isInsideFetch || this.__inAppInspectorTracked) {
275
- return originalSend.apply(this, [body]);
276
- }
277
-
278
- const url = this.__logUrl || "";
279
- const method = this.__logMethod || "GET";
280
-
281
- if (shouldIgnoreUrl(url)) {
282
- return originalSend.apply(this, [body]);
283
- }
284
-
285
- const id = counter++;
286
- this.__logId = id;
287
- const start = this.__logStartTime || Date.now();
288
- const caller = this.__logCaller || "Unknown";
289
- const requestHeaders = this.__logRequestHeaders;
290
-
291
- let client = "xhr";
292
- if (
293
- requestHeaders?.["apollographql-client-name"] ||
294
- url.toLowerCase().includes("/graphql")
295
- ) {
296
- client = "apollo";
297
- } else if (caller.toLowerCase().includes("axios")) {
298
- client = "axios";
299
- }
300
-
301
- const currentRoute = currentRouteProvider ? currentRouteProvider() : null;
302
-
303
- addOrUpdateLog({
304
- id,
305
- url,
306
- method,
307
- startTime: start,
308
- caller,
309
- client,
310
- routeInfo: currentRoute || undefined,
311
- request: method === "GET" ? undefined : parseRequestData(body),
312
- requestHeaders:
313
- Object.keys(requestHeaders || {}).length > 0 ? requestHeaders : undefined,
314
- });
315
-
316
- const onFinished = () => {
317
- if (this.__logFinished) return;
318
- this.__logFinished = true;
319
- const duration = Date.now() - start;
320
- let responseData: any = null;
321
-
322
- try {
323
- if (this.responseType === "" || this.responseType === "text") {
324
- const raw = this.responseText;
325
- try {
326
- responseData = JSON.parse(raw);
327
- } catch {
328
- responseData = raw;
329
- }
330
- } else if (this.responseType === "json") {
331
- responseData = this.response;
332
- } else if (this.responseType === "blob") {
333
- responseData = `[Blob: ${this.response?.size || 0} bytes]`;
334
- } else {
335
- responseData = `[${this.responseType || "Unknown"} Data]`;
336
- }
337
- } catch {
338
- responseData = this.response || null;
339
- }
340
-
341
- const rawRespHeaders = this.getAllResponseHeaders
342
- ? this.getAllResponseHeaders()
343
- : "";
344
- const responseHeaders = parseXHRResponseHeaders(rawRespHeaders);
345
-
346
- addOrUpdateLog({
347
- id,
348
- url,
349
- method,
350
- status: this.status,
351
- response: responseData,
352
- duration,
353
- startTime: start,
354
- caller,
355
- client,
356
- responseHeaders,
357
- });
358
- };
359
-
360
- const onErrorOrAbort = () => {
361
- if (this.__logFinished) return;
362
- this.__logFinished = true;
363
- const duration = Date.now() - start;
364
-
365
- addOrUpdateLog({
366
- id,
367
- url,
368
- method,
369
- status: this.status || 0,
370
- response: "Network request failed",
371
- duration,
372
- startTime: start,
373
- caller,
374
- client,
375
- });
376
- };
377
-
378
- this.addEventListener("load", onFinished);
379
- this.addEventListener("error", onErrorOrAbort);
380
- this.addEventListener("abort", onErrorOrAbort);
381
- this.addEventListener("timeout", onErrorOrAbort);
382
-
383
- return originalSend.apply(this, [body]);
384
- };
385
- }
386
-
387
- // 2. Hook fetch
388
- const originalFetch = (globalThis as any).fetch;
389
-
390
- if (originalFetch) {
391
- (globalThis as any).fetch = async (url: any, options: any = {}) => {
392
- if (!isNetworkModuleEnabled) return originalFetch(url, options);
393
- const method = (options?.method || "GET").toUpperCase();
394
-
395
- const id = counter++;
396
- const start = Date.now();
397
- const finalUrl = typeof url === "string" ? url : url?.url;
398
-
399
- if (shouldIgnoreUrl(finalUrl)) return originalFetch(url, options);
400
-
401
- let caller = "Unknown";
402
- let requestHeaders: Record<string, string> | undefined;
403
- let client = "fetch";
404
-
405
- try {
406
- requestHeaders = normaliseHeaders(options?.headers);
407
- caller = getCallerFromStack(); // ✅ Capture call line
408
-
409
- if (
410
- requestHeaders?.["apollographql-client-name"] ||
411
- finalUrl?.toLowerCase().includes("/graphql")
412
- ) {
413
- client = "apollo";
414
- } else if (
415
- requestHeaders?.["x-requested-with"]?.toLowerCase().includes("xmlhttprequest")
416
- ) {
417
- client = "xhr";
418
- } else if (caller?.toLowerCase().includes("axios")) {
419
- client = "axios";
420
- }
421
-
422
- const currentRoute = currentRouteProvider ? currentRouteProvider() : null;
423
-
424
- addOrUpdateLog({
425
- id,
426
- url: finalUrl,
427
- method,
428
- startTime: start,
429
- caller,
430
- client,
431
- routeInfo: currentRoute || undefined,
432
- request: method === "GET" ? undefined : parseRequestData(options?.body),
433
- requestHeaders,
434
- });
435
- } catch {}
436
-
437
- try {
438
- isInsideFetch = true;
439
- let response: any;
440
- try {
441
- response = await originalFetch(url, options);
442
- } finally {
443
- isInsideFetch = false;
444
- }
445
- const duration = Date.now() - start;
446
-
447
- try {
448
- const responseHeaders = normaliseHeaders(response.headers);
449
- let data: any = null;
450
- const contentType =
451
- responseHeaders?.["content-type"] ||
452
- responseHeaders?.["Content-Type"] ||
453
- "";
454
- if (contentType.includes("image/")) {
455
- data = "[Image Data]";
456
- } else {
457
- try {
458
- const clone = response.clone();
459
- const text = await clone.text();
460
- try {
461
- data = JSON.parse(text);
462
- } catch {
463
- data = text;
464
- }
465
- } catch {}
466
- }
467
-
468
- addOrUpdateLog({
469
- id,
470
- url: finalUrl,
471
- method,
472
- status: response.status,
473
- response: data,
474
- duration,
475
- startTime: start,
476
- caller,
477
- client,
478
- responseHeaders,
479
- });
480
- } catch {}
481
-
482
- return response;
483
- } catch (error) {
484
- try {
485
- addOrUpdateLog({
486
- id,
487
- url: finalUrl,
488
- method,
489
- status: 0,
490
- startTime: start,
491
- response: error,
492
- caller,
493
- client,
494
- duration: Date.now() - start,
495
- });
496
- } catch {}
497
- throw error;
498
- }
499
- };
500
- }
501
-
502
- // 3. Hook Axios — patches default instance and future axios.create() instances
503
- try {
504
- if (axios) {
505
- addAxiosInterceptors(axios);
506
- const originalCreate = axios.create;
507
- if (typeof originalCreate === "function") {
508
- axios.create = function (...args: any[]) {
509
- const instance = originalCreate.apply(this, args);
510
- addAxiosInterceptors(instance);
511
- return instance;
512
- };
513
- }
514
- }
515
- } catch (_e) {
516
- // Axios not available — fetch/XHR mode
517
- }
518
-
519
- try {
520
- setupGlobalCrashHandler();
521
- } catch {}
522
-
523
- (globalThis as any).__NETWORK_LOGGER_INITIALIZED__ = true;
524
- };
525
-
526
- // ─── Axios interceptor helper ─────────────────────────────────────────────────
527
- export const addAxiosInterceptors = (axiosInstance: any) => {
528
- axiosInstance.interceptors.request.use(async (config: any) => {
529
- const method = (config.method || "GET").toUpperCase();
530
-
531
- const id = counter++;
532
- const start = Date.now();
533
- const caller = getCallerFromStack(); // ✅ Capture call line
534
-
535
- let url = config.url ?? "";
536
- if (!url.startsWith("http")) url = `${config.baseURL ?? ""}${url}`;
537
-
538
- // ✅ Leave config untagged so the response interceptor skips it too.
539
- if (shouldIgnoreUrl(url)) return config;
540
-
541
- config.__logId = id;
542
- config.__logStart = start;
543
- config.__logCaller = caller;
544
-
545
- const currentRoute = currentRouteProvider ? currentRouteProvider() : null;
546
-
547
- addOrUpdateLog({
548
- id,
549
- url,
550
- method,
551
- startTime: start,
552
- caller,
553
- client: "axios",
554
- routeInfo: currentRoute || undefined,
555
- request: method === "GET" ? undefined : parseRequestData(config.data),
556
- requestHeaders: normaliseHeaders(config.headers),
557
- });
558
-
559
- return config;
560
- });
561
-
562
- axiosInstance.interceptors.response.use(
563
- (response: any) => {
564
- const config = response.config || {};
565
- const id = config.__logId;
566
- const start = config.__logStart;
567
- const caller = config.__logCaller;
568
- const method = (config.method || "GET").toUpperCase();
569
-
570
- if (id == null) return response;
571
-
572
- let url = config.url ?? "";
573
- if (!url.startsWith("http")) url = `${config.baseURL ?? ""}${url}`;
574
-
575
- addOrUpdateLog({
576
- id,
577
- url,
578
- method,
579
- status: response.status,
580
- response: response.data,
581
- startTime: start || Date.now(),
582
- duration: start != null ? Date.now() - start : undefined,
583
- caller,
584
- client: "axios",
585
- responseHeaders: normaliseHeaders(response.headers),
586
- });
587
-
588
- return response;
589
- },
590
- (error: any) => {
591
- const config = error.config || {};
592
- const id = config.__logId;
593
- const start = config.__logStart;
594
- const caller = config.__logCaller;
595
- const method = (config.method || "GET").toUpperCase();
596
-
597
- if (id != null) {
598
- let url = config.url ?? "";
599
- if (!url.startsWith("http")) url = `${config.baseURL ?? ""}${url}`;
600
-
601
- addOrUpdateLog({
602
- id,
603
- url,
604
- method,
605
- status: error.response?.status ?? 0,
606
- response: error.response?.data ?? error.message,
607
- startTime: start || Date.now(),
608
- duration: start != null ? Date.now() - start : undefined,
609
- caller,
610
- client: "axios",
611
- responseHeaders: normaliseHeaders(error.response?.headers),
612
- });
613
- }
614
- return Promise.reject(error);
615
- },
616
- );
617
- };
618
-
619
- // Auto-initialize logger on module load so startup requests are never missed
620
- if (typeof globalThis !== "undefined") {
621
- try {
622
- setupNetworkLogger();
623
- } catch {}
624
- }