react-native-inapp-inspector 2.5.12 → 2.5.13
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/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.9/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- package/android/.gradle/9.2.0/checksums/checksums.lock +0 -0
- package/android/.gradle/9.2.0/fileChanges/last-build.bin +0 -0
- package/android/.gradle/9.2.0/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/9.2.0/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/9.2.0/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.settings/org.eclipse.buildship.core.prefs +13 -0
- package/android/src/main/AndroidManifest.xml +11 -0
- package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +379 -19
- package/android/src/main/res/xml/inappinspector_file_paths.xml +7 -0
- package/dist/commonjs/components/Inspector/AnalyticsFilterModal.js +47 -49
- package/dist/commonjs/components/Inspector/BoxModelVisualizer.d.ts +8 -0
- package/dist/commonjs/components/Inspector/BoxModelVisualizer.js +76 -0
- package/dist/commonjs/components/Inspector/ConsoleExportModal.js +51 -51
- package/dist/commonjs/components/Inspector/CrashTab.js +17 -17
- package/dist/commonjs/components/Inspector/DebuggingTab.js +24 -24
- package/dist/commonjs/components/Inspector/DeviceInfoTab.js +2 -2
- package/dist/commonjs/components/Inspector/FabLauncher.js +2 -2
- package/dist/commonjs/components/Inspector/FloatingCaptureWidget.js +2 -2
- package/dist/commonjs/components/Inspector/InspectorHeader.js +10 -10
- package/dist/commonjs/components/Inspector/MediaGalleryTab.js +10 -10
- package/dist/commonjs/components/Inspector/MediaPreviewModal.d.ts +1 -0
- package/dist/commonjs/components/Inspector/MediaPreviewModal.js +222 -222
- package/dist/commonjs/components/Inspector/NetworkExportModal.d.ts +10 -0
- package/dist/commonjs/components/Inspector/NetworkExportModal.js +333 -0
- package/dist/commonjs/components/Inspector/NetworkTab.js +48 -41
- package/dist/commonjs/components/Inspector/NpmStarPrompt.js +11 -12
- package/dist/commonjs/components/Inspector/ReduxDetail.js +17 -19
- package/dist/commonjs/components/Inspector/ReduxTab.js +5 -5
- package/dist/commonjs/components/Inspector/SettingsPanel.js +3 -6
- package/dist/commonjs/components/Inspector/SocketCard.js +2 -2
- package/dist/commonjs/components/Inspector/SupportPage.js +5 -5
- package/dist/commonjs/components/Inspector/UiA11yAuditPanel.d.ts +7 -0
- package/dist/commonjs/components/Inspector/UiA11yAuditPanel.js +97 -0
- package/dist/commonjs/components/Inspector/UiInspectorDetail.d.ts +2 -0
- package/dist/commonjs/components/Inspector/UiInspectorDetail.js +485 -0
- package/dist/commonjs/components/Inspector/UiInspectorOverlay.d.ts +2 -0
- package/dist/commonjs/components/Inspector/UiInspectorOverlay.js +199 -0
- package/dist/commonjs/components/Inspector/UiInspectorTab.d.ts +2 -0
- package/dist/commonjs/components/Inspector/UiInspectorTab.js +117 -0
- package/dist/commonjs/components/Inspector/UiLiveStyleTweaker.d.ts +10 -0
- package/dist/commonjs/components/Inspector/UiLiveStyleTweaker.js +148 -0
- package/dist/commonjs/components/Inspector/index.d.ts +28 -0
- package/dist/commonjs/components/Inspector/index.js +1 -0
- package/dist/commonjs/components/LogCard.js +9 -7
- package/dist/commonjs/constants/index.js +1 -1
- package/dist/commonjs/constants/telemetryConfig.d.ts +3 -3
- package/dist/commonjs/constants/telemetryConfig.js +1 -1
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/crashHandler.d.ts +1 -1
- package/dist/commonjs/customHooks/crashHandler.js +6 -6
- package/dist/commonjs/customHooks/uiInspectorManager.d.ts +22 -0
- package/dist/commonjs/customHooks/uiInspectorManager.js +1 -0
- package/dist/commonjs/helpers/index.js +1 -3
- package/dist/commonjs/helpers/searchQueryParser.d.ts +1 -0
- package/dist/commonjs/helpers/searchQueryParser.js +7 -5
- package/dist/commonjs/helpers/shareFormatter.d.ts +16 -0
- package/dist/commonjs/helpers/shareFormatter.js +16 -9
- package/dist/commonjs/helpers/uiInspectorEngine.d.ts +62 -0
- package/dist/commonjs/helpers/uiInspectorEngine.js +19 -0
- package/dist/commonjs/i18n/locales/ar.json +1 -1
- package/dist/commonjs/i18n/locales/bn.json +1 -1
- package/dist/commonjs/i18n/locales/de.json +1 -1
- package/dist/commonjs/i18n/locales/en.json +1 -1
- package/dist/commonjs/i18n/locales/es.json +1 -1
- package/dist/commonjs/i18n/locales/fr.json +1 -1
- package/dist/commonjs/i18n/locales/gu.json +1 -1
- package/dist/commonjs/i18n/locales/hi.json +1 -1
- package/dist/commonjs/i18n/locales/id.json +1 -1
- package/dist/commonjs/i18n/locales/it.json +1 -1
- package/dist/commonjs/i18n/locales/ja.json +1 -1
- package/dist/commonjs/i18n/locales/kn.json +1 -1
- package/dist/commonjs/i18n/locales/ko.json +1 -1
- package/dist/commonjs/i18n/locales/ml.json +1 -1
- package/dist/commonjs/i18n/locales/mr.json +1 -1
- package/dist/commonjs/i18n/locales/nl.json +1 -1
- package/dist/commonjs/i18n/locales/pa.json +1 -1
- package/dist/commonjs/i18n/locales/pl.json +1 -1
- package/dist/commonjs/i18n/locales/pt.json +1 -1
- package/dist/commonjs/i18n/locales/ru.json +1 -1
- package/dist/commonjs/i18n/locales/ta.json +1 -1
- package/dist/commonjs/i18n/locales/te.json +1 -1
- package/dist/commonjs/i18n/locales/tr.json +1 -1
- package/dist/commonjs/i18n/locales/vi.json +1 -1
- package/dist/commonjs/i18n/locales/zh.json +1 -1
- package/dist/commonjs/index.d.ts +3 -1
- package/dist/commonjs/index.js +3 -3
- package/dist/commonjs/native/NativeInspector.d.ts +2 -0
- package/dist/commonjs/native/NativeInspector.js +1 -1
- package/dist/commonjs/native/NativeNetworkInspector.d.ts +2 -0
- package/dist/commonjs/types/editor.d.ts +31 -0
- package/dist/esm/components/Inspector/AnalyticsFilterModal.js +73 -75
- package/dist/esm/components/Inspector/BoxModelVisualizer.d.ts +8 -0
- package/dist/esm/components/Inspector/BoxModelVisualizer.js +76 -0
- package/dist/esm/components/Inspector/ConsoleExportModal.js +67 -67
- package/dist/esm/components/Inspector/CrashTab.js +58 -58
- package/dist/esm/components/Inspector/DebuggingTab.js +89 -89
- package/dist/esm/components/Inspector/DeviceInfoTab.js +2 -2
- package/dist/esm/components/Inspector/FabLauncher.js +21 -21
- package/dist/esm/components/Inspector/FloatingCaptureWidget.js +23 -23
- package/dist/esm/components/Inspector/InspectorHeader.js +26 -26
- package/dist/esm/components/Inspector/MediaGalleryTab.js +151 -151
- package/dist/esm/components/Inspector/MediaPreviewModal.d.ts +1 -0
- package/dist/esm/components/Inspector/MediaPreviewModal.js +468 -468
- package/dist/esm/components/Inspector/NetworkExportModal.d.ts +10 -0
- package/dist/esm/components/Inspector/NetworkExportModal.js +333 -0
- package/dist/esm/components/Inspector/NetworkTab.js +118 -111
- package/dist/esm/components/Inspector/NpmStarPrompt.js +32 -33
- package/dist/esm/components/Inspector/ReduxDetail.js +54 -56
- package/dist/esm/components/Inspector/ReduxTab.js +9 -9
- package/dist/esm/components/Inspector/SettingsPanel.js +3 -6
- package/dist/esm/components/Inspector/SocketCard.js +13 -13
- package/dist/esm/components/Inspector/SupportPage.js +5 -5
- package/dist/esm/components/Inspector/UiA11yAuditPanel.d.ts +7 -0
- package/dist/esm/components/Inspector/UiA11yAuditPanel.js +97 -0
- package/dist/esm/components/Inspector/UiInspectorDetail.d.ts +2 -0
- package/dist/esm/components/Inspector/UiInspectorDetail.js +422 -0
- package/dist/esm/components/Inspector/UiInspectorOverlay.d.ts +2 -0
- package/dist/esm/components/Inspector/UiInspectorOverlay.js +138 -0
- package/dist/esm/components/Inspector/UiInspectorTab.d.ts +2 -0
- package/dist/esm/components/Inspector/UiInspectorTab.js +117 -0
- package/dist/esm/components/Inspector/UiLiveStyleTweaker.d.ts +10 -0
- package/dist/esm/components/Inspector/UiLiveStyleTweaker.js +148 -0
- package/dist/esm/components/Inspector/index.d.ts +28 -0
- package/dist/esm/components/Inspector/index.js +1 -0
- package/dist/esm/components/LogCard.js +57 -55
- package/dist/esm/constants/index.js +1 -1
- package/dist/esm/constants/telemetryConfig.d.ts +3 -3
- package/dist/esm/constants/telemetryConfig.js +1 -1
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/crashHandler.d.ts +1 -1
- package/dist/esm/customHooks/crashHandler.js +6 -6
- package/dist/esm/customHooks/uiInspectorManager.d.ts +22 -0
- package/dist/esm/customHooks/uiInspectorManager.js +1 -0
- package/dist/esm/helpers/index.js +4 -6
- package/dist/esm/helpers/searchQueryParser.d.ts +1 -0
- package/dist/esm/helpers/searchQueryParser.js +7 -5
- package/dist/esm/helpers/shareFormatter.d.ts +16 -0
- package/dist/esm/helpers/shareFormatter.js +20 -13
- package/dist/esm/helpers/uiInspectorEngine.d.ts +48 -0
- package/dist/esm/helpers/uiInspectorEngine.js +19 -0
- package/dist/esm/i18n/locales/ar.json +1 -1
- package/dist/esm/i18n/locales/bn.json +1 -1
- package/dist/esm/i18n/locales/de.json +1 -1
- package/dist/esm/i18n/locales/en.json +1 -1
- package/dist/esm/i18n/locales/es.json +1 -1
- package/dist/esm/i18n/locales/fr.json +1 -1
- package/dist/esm/i18n/locales/gu.json +1 -1
- package/dist/esm/i18n/locales/hi.json +1 -1
- package/dist/esm/i18n/locales/id.json +1 -1
- package/dist/esm/i18n/locales/it.json +1 -1
- package/dist/esm/i18n/locales/ja.json +1 -1
- package/dist/esm/i18n/locales/kn.json +1 -1
- package/dist/esm/i18n/locales/ko.json +1 -1
- package/dist/esm/i18n/locales/ml.json +1 -1
- package/dist/esm/i18n/locales/mr.json +1 -1
- package/dist/esm/i18n/locales/nl.json +1 -1
- package/dist/esm/i18n/locales/pa.json +1 -1
- package/dist/esm/i18n/locales/pl.json +1 -1
- package/dist/esm/i18n/locales/pt.json +1 -1
- package/dist/esm/i18n/locales/ru.json +1 -1
- package/dist/esm/i18n/locales/ta.json +1 -1
- package/dist/esm/i18n/locales/te.json +1 -1
- package/dist/esm/i18n/locales/tr.json +1 -1
- package/dist/esm/i18n/locales/vi.json +1 -1
- package/dist/esm/i18n/locales/zh.json +1 -1
- package/dist/esm/index.d.ts +3 -1
- package/dist/esm/index.js +7 -7
- package/dist/esm/native/NativeInspector.d.ts +2 -0
- package/dist/esm/native/NativeInspector.js +1 -1
- package/dist/esm/native/NativeNetworkInspector.d.ts +2 -0
- package/dist/esm/types/editor.d.ts +31 -0
- package/ios/NetworkInspectorModule.mm +314 -16
- package/package.json +1 -1
- package/src/native/NativeInspector.ts +37 -0
- package/src/native/NativeNetworkInspector.ts +2 -0
|
@@ -1,116 +1,118 @@
|
|
|
1
|
-
import re,{useEffect as ne,useRef as le,useMemo as
|
|
1
|
+
import re,{useEffect as ne,useRef as le,useMemo as ie}from"react";import{Alert as E,Animated as O,Linking as ae,View as C,Pressable as D,Text as T,StyleSheet as U}from"react-native";import Ce,{Path as Te}from"react-native-svg";import{AppColors as e}from"../styles/AppColors";import{METHOD_COLORS as A}from"../constants";import{getStatusColor as Se,getDurationColor as Be,formatDateTime as Re,getSize as He,getPath as Ve,getBaseUrl as ze,openWithPostman as q}from"../helpers";import{CalendarIcon as Ie,ClockIcon as N,SizeIcon as Le,CircleCheckIcon as Pe,CircleAlertIcon as $e,CircleXIcon as We,RepeatIcon as Oe,ForwardChevronIcon as De,GlobeIcon as Fe,PostmanIcon as Me}from"./NetworkIcons";import{AppFonts as S}from"../styles/AppFonts";import G from"./HighlightText";import Ee from"./TouchableScale";import{useTranslation as Ue}from"../i18n";function Ae({item:t,onPress:B,timelineMinStart:Ne,timelineTotalRange:Ge,isNew:L,isSelected:F,onToggleSelect:J,searchStr:j,testID:K}){const{t:R}=Ue(),M=A[t.method]??A.ALL,V=ie(()=>{try{const r=new URL(t.url),W=r.host,v=r.pathname+(r.search?r.search:""),oe=r.protocol==="https:";return{host:W,path:v||"/",isHttps:oe}}catch{const r=t.url.toLowerCase().startsWith("https:"),W=Ve(t.url);return{host:ze(t.url).replace(/^https?:\/\//,""),path:W||t.url,isHttps:r}}},[t.url]),Q=r=>{r?.stopPropagation?.(),E.alert(R("common.openInBrowser")||"Open URL",`${R("common.openInBrowserPrompt")||"Choose how you want to open or inspect this URL:"}
|
|
2
2
|
|
|
3
|
-
${
|
|
4
|
-
<Ee testID={K}onPress={B}style={[
|
|
5
|
-
<C style={
|
|
3
|
+
${t.url}`,[{text:R("common.cancel")||"Cancel",style:"cancel"},{text:"Open in Postman",onPress:()=>q(t)},{text:R("common.open")||"Browser",onPress:()=>{ae.openURL(t.url).catch(()=>{E.alert(R("common.error")||"Error",R("common.cannotOpenUrl")||"Could not open URL")})}}])},X=r=>{r?.stopPropagation?.(),q(t)},H=t.status===0||t.status!=null&&t.status>=400,z=t.status==null,P=Se(t.status),I=Be(t.duration),_=z?e.darkOrange:H?e.errorColor:e.greenColor,$=le(new O.Value(L?.35:0)).current;ne(()=>{L&&O.timing($,{toValue:0,duration:1200,useNativeDriver:!0}).start()},[L,$]);const Y=()=>{if(z)return"...";if(t.status===0||t.status==null)return R("network.statusFailed")||"FAILED";const r=typeof t.status=="number"?t.status:parseInt(String(t.status||0),10);return r===200?"200 OK":r===201?"201 Created":r===204?"204 No Content":r===304?"304 Not Modified":r===400?"400 Bad Req":r===401?"401 Unauth":r===403?"403 Forbidden":r===404?"404 Not Found":r===500?"500 Error":String(t.status)},Z=()=>{if(z)return<N color={e.darkOrange}size={10}/>;const r=typeof t.status=="number"?t.status:parseInt(String(t.status||0),10);return r>=200&&r<300?<Pe color={e.greenColor}size={10}/>:r>=300&&r<400?<Oe color={e.amber700}size={10}/>:r>=400&&r<500?<$e color={e.darkOrange}size={10}/>:<We color={e.errorColor}size={10}/>},ee=Re(t.startTime),te=t.url.split("?")[0].toLowerCase().endsWith(".json");return<C style={o.container}>
|
|
4
|
+
<Ee testID={K}onPress={B}style={[o.card,{borderLeftWidth:3.5,borderLeftColor:_,backgroundColor:H?e.errorCardBg:e.white}]}>
|
|
5
|
+
<C style={o.cardBody}>
|
|
6
6
|
|
|
7
|
-
<C style={
|
|
8
|
-
<C style={
|
|
9
|
-
<
|
|
10
|
-
{
|
|
7
|
+
<C style={o.cardHeaderRow}>
|
|
8
|
+
<C style={o.cardHeaderLeft}>
|
|
9
|
+
<D onPress={()=>J(t.id)}hitSlop={12}style={[o.smallCheckbox,F&&o.smallCheckboxChecked]}>
|
|
10
|
+
{F&&<Ce width={9}height={9}viewBox="0 0 24 24"fill="none">
|
|
11
11
|
<Te d="M20 6L9 17l-5-5"stroke={e.white}strokeWidth="4"strokeLinecap="round"strokeLinejoin="round"/>
|
|
12
12
|
</Ce>}
|
|
13
|
-
</
|
|
13
|
+
</D>
|
|
14
14
|
|
|
15
|
-
<T style={
|
|
15
|
+
<T style={o.serialNumber}>#{t.id+1}</T>
|
|
16
16
|
|
|
17
|
-
<C style={[
|
|
18
|
-
<T style={
|
|
19
|
-
{
|
|
17
|
+
<C style={[o.methodBadge,{backgroundColor:M}]}>
|
|
18
|
+
<T style={o.methodBadgeText}>
|
|
19
|
+
{t.method}
|
|
20
20
|
</T>
|
|
21
21
|
</C>
|
|
22
22
|
|
|
23
|
-
{
|
|
24
|
-
<T style={[
|
|
25
|
-
{
|
|
23
|
+
{t.client&&<C style={[o.chip,{backgroundColor:t.client==="axios"?`${e.purple}14`:t.client==="apollo"||t.client==="graphql"?`${e.pink500}14`:t.client==="xhr"?`${e.amber500}14`:`${e.sky500}14`,borderColor:t.client==="axios"?`${e.purple}30`:t.client==="apollo"||t.client==="graphql"?`${e.pink500}30`:t.client==="xhr"?`${e.amber500}30`:`${e.sky500}30`}]}>
|
|
24
|
+
<T style={[o.chipText,{color:t.client==="axios"?e.purple:t.client==="apollo"||t.client==="graphql"?e.pink500:t.client==="xhr"?e.amber700:e.sky600}]}>
|
|
25
|
+
{t.client.toUpperCase()}
|
|
26
26
|
</T>
|
|
27
27
|
</C>}
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
{(
|
|
31
|
-
<T style={[
|
|
30
|
+
{(t.url.toLowerCase().includes("graphql")||t.client==="apollo"||t.client==="graphql")&&<C style={[o.chip,{backgroundColor:e.roseBg,borderColor:e.roseBorder}]}>
|
|
31
|
+
<T style={[o.chipText,{color:e.pink600}]}>
|
|
32
32
|
GQL
|
|
33
33
|
</T>
|
|
34
34
|
</C>}
|
|
35
35
|
</C>
|
|
36
36
|
|
|
37
|
-
<C style={
|
|
38
|
-
<C style={[
|
|
37
|
+
<C style={o.cardHeaderRight}>
|
|
38
|
+
<C style={[o.statusPill,{backgroundColor:H?`${e.errorColor}14`:z?`${e.darkOrange}14`:`${P}14`,borderColor:H?`${e.errorColor}33`:z?`${e.darkOrange}33`:`${P}33`}]}>
|
|
39
39
|
{Z()}
|
|
40
|
-
<T style={[
|
|
40
|
+
<T style={[o.statusPillText,{color:H?e.errorColor:z?e.darkOrange:P}]}>
|
|
41
41
|
{Y()}
|
|
42
42
|
</T>
|
|
43
43
|
</C>
|
|
44
|
-
<
|
|
45
|
-
<
|
|
46
|
-
</
|
|
47
|
-
<
|
|
44
|
+
<D onPress={Q}hitSlop={{top:6,bottom:6,left:3,right:3}}style={o.globeBtn}accessibilityRole="button"accessibilityLabel="Open in Browser">
|
|
45
|
+
<Fe color={e.grayTextWeak}size={12}/>
|
|
46
|
+
</D>
|
|
47
|
+
<D onPress={X}hitSlop={{top:6,bottom:6,left:3,right:3}}style={[o.globeBtn,{backgroundColor:"rgba(255, 108, 55, 0.12)",borderColor:"rgba(255, 108, 55, 0.28)"}]}accessibilityRole="button"accessibilityLabel="Open with Postman">
|
|
48
48
|
<Me color="#FF6C37"size={11}/>
|
|
49
|
-
</
|
|
50
|
-
<
|
|
49
|
+
</D>
|
|
50
|
+
<C style={o.chevronWrapper}>
|
|
51
|
+
<De color={e.grayTextWeak}size={13}/>
|
|
52
|
+
</C>
|
|
51
53
|
</C>
|
|
52
54
|
</C>
|
|
53
55
|
|
|
54
56
|
|
|
55
|
-
<C style={
|
|
57
|
+
<C style={o.urlBox}>
|
|
56
58
|
|
|
57
|
-
<C style={
|
|
58
|
-
<C style={
|
|
59
|
-
<C style={[
|
|
60
|
-
<T style={[
|
|
59
|
+
<C style={o.urlMainRow}>
|
|
60
|
+
<C style={o.hostRow}>
|
|
61
|
+
<C style={[o.protoBadge,{backgroundColor:V.isHttps?`${e.emerald600}12`:`${e.amber600}12`,borderColor:V.isHttps?`${e.emerald600}2B`:`${e.amber600}2B`}]}>
|
|
62
|
+
<T style={[o.protoBadgeText,{color:V.isHttps?e.emerald600:e.amber700}]}>
|
|
61
63
|
{V.isHttps?"HTTPS":"HTTP"}
|
|
62
64
|
</T>
|
|
63
65
|
</C>
|
|
64
|
-
<G text={V.host||
|
|
66
|
+
<G text={V.host||t.url}search={j}style={o.hostText}highlightStyle={o.highlight}numberOfLines={1}ellipsizeMode="tail"/>
|
|
65
67
|
</C>
|
|
66
|
-
<C style={
|
|
67
|
-
{
|
|
68
|
-
<T style={
|
|
68
|
+
<C style={o.urlBadgeRow}>
|
|
69
|
+
{te&&<C style={o.jsonBadge}>
|
|
70
|
+
<T style={o.jsonBadgeText}>.json</T>
|
|
69
71
|
</C>}
|
|
70
|
-
{
|
|
71
|
-
<T style={
|
|
72
|
+
{t.duplicateCount!=null&&t.duplicateCount>1&&<C style={o.dupBadge}>
|
|
73
|
+
<T style={o.dupBadgeText}>×{t.duplicateCount}</T>
|
|
72
74
|
</C>}
|
|
73
75
|
</C>
|
|
74
76
|
</C>
|
|
75
77
|
|
|
76
78
|
|
|
77
|
-
<C style={
|
|
78
|
-
<G text={V.path}search={j}style={
|
|
79
|
+
<C style={o.slugRow}>
|
|
80
|
+
<G text={V.path}search={j}style={o.pathText}highlightStyle={o.highlight}numberOfLines={1}ellipsizeMode="middle"/>
|
|
79
81
|
</C>
|
|
80
82
|
</C>
|
|
81
83
|
|
|
82
84
|
|
|
83
|
-
<C style={
|
|
84
|
-
<C style={
|
|
85
|
-
<C style={
|
|
85
|
+
<C style={o.cardFooterRow}>
|
|
86
|
+
<C style={o.footerLeft}>
|
|
87
|
+
<C style={o.cardDateRow}>
|
|
86
88
|
<Ie color={e.grayTextWeak}size={10}/>
|
|
87
|
-
<T style={
|
|
89
|
+
<T style={o.cardDateText}numberOfLines={1}>{ee}</T>
|
|
88
90
|
</C>
|
|
89
91
|
</C>
|
|
90
92
|
|
|
91
|
-
<C style={
|
|
92
|
-
{
|
|
93
|
+
<C style={o.footerRight}>
|
|
94
|
+
{t.response!=null&&<C style={o.metaStatChip}>
|
|
93
95
|
<Le color={e.purple}size={9}/>
|
|
94
|
-
<T style={
|
|
95
|
-
{He(
|
|
96
|
+
<T style={o.metaStatText}>
|
|
97
|
+
{He(t.response)}
|
|
96
98
|
</T>
|
|
97
99
|
</C>}
|
|
98
100
|
|
|
99
|
-
{
|
|
101
|
+
{t.duration!=null&&!H&&<C style={[o.metaStatChip,{backgroundColor:`${I}12`,borderColor:`${I}2E`}]}>
|
|
100
102
|
<N color={I}size={9}/>
|
|
101
|
-
<T style={[
|
|
102
|
-
{
|
|
103
|
+
<T style={[o.metaStatText,{color:I}]}>
|
|
104
|
+
{t.duration}ms
|
|
103
105
|
</T>
|
|
104
106
|
</C>}
|
|
105
107
|
</C>
|
|
106
108
|
</C>
|
|
107
109
|
|
|
108
110
|
|
|
109
|
-
<C style={
|
|
110
|
-
{typeof
|
|
111
|
+
<C style={o.waterfallContainer}>
|
|
112
|
+
{typeof t.duration=="number"&&t.duration>0&&!H&&<C style={[o.waterfallBar,{width:`${Math.min(100,Math.max(6,t.duration/1200*100))}%`,backgroundColor:I}]}/>}
|
|
111
113
|
</C>
|
|
112
114
|
</C>
|
|
113
115
|
|
|
114
|
-
{L&&<
|
|
116
|
+
{L&&<O.View pointerEvents="none"style={[U.absoluteFill,{backgroundColor:M,opacity:$}]}/>}
|
|
115
117
|
</Ee>
|
|
116
|
-
</C>}const
|
|
118
|
+
</C>}const o=U.create({container:{paddingHorizontal:8,paddingVertical:4,height:126,justifyContent:"center"},card:{height:118,alignSelf:"stretch",borderRadius:10,overflow:"hidden",borderWidth:1,borderColor:e.dividerColor,shadowColor:e.shadowColorString},cardBody:{height:"100%",paddingHorizontal:8,paddingTop:8,paddingBottom:6,justifyContent:"space-between"},cardHeaderRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:22,minHeight:22,maxHeight:22},cardHeaderLeft:{flexDirection:"row",alignItems:"center",flex:1,marginRight:4,gap:4.5,minWidth:0,overflow:"hidden"},cardHeaderRight:{flexDirection:"row",alignItems:"center",gap:7,flexShrink:0},smallCheckbox:{width:15,height:15,borderRadius:4,borderWidth:1.5,borderColor:e.grayTextWeak,alignItems:"center",justifyContent:"center",backgroundColor:e.white},smallCheckboxChecked:{backgroundColor:e.purple,borderColor:e.purple},serialNumber:{fontFamily:S.interBold,color:e.grayTextWeak,fontSize:10},methodBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:5,alignItems:"center",justifyContent:"center"},methodBadgeText:{fontFamily:S.interBold,fontSize:9.5,lineHeight:12,letterSpacing:.5,color:e.white},chip:{paddingHorizontal:5.5,paddingVertical:1.5,borderRadius:4,borderWidth:1},chipText:{fontFamily:S.interBold,fontSize:9,lineHeight:12},statusPill:{flexDirection:"row",alignItems:"center",gap:3.5,paddingHorizontal:6,paddingVertical:2,borderRadius:6,borderWidth:1,flexShrink:0},statusPillText:{fontFamily:S.interBold,fontSize:9.5,lineHeight:12},globeBtn:{width:26,height:22,borderRadius:5,backgroundColor:`${e.grayTextWeak}14`,borderWidth:1,borderColor:`${e.grayTextWeak}28`,alignItems:"center",justifyContent:"center"},chevronWrapper:{paddingLeft:2,alignItems:"center",justifyContent:"center"},urlBox:{backgroundColor:e.grayBackground,borderRadius:7,borderWidth:1,borderColor:e.dividerColor,paddingHorizontal:7,paddingVertical:4.5,height:48,minHeight:48,maxHeight:48,justifyContent:"center",gap:2.5,overflow:"hidden"},urlMainRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:4,minHeight:16},hostRow:{flexDirection:"row",alignItems:"center",gap:5,flex:1,minWidth:0},protoBadge:{paddingHorizontal:4,paddingVertical:1,borderRadius:3.5,borderWidth:1},protoBadgeText:{fontFamily:S.interBold,fontSize:8,lineHeight:10},hostText:{fontFamily:S.interBold,fontSize:11.5,lineHeight:15,color:e.primaryBlack,flex:1},urlBadgeRow:{flexDirection:"row",alignItems:"center",gap:4,flexShrink:0},jsonBadge:{backgroundColor:`${e.darkOrange}14`,borderColor:`${e.darkOrange}2E`,borderWidth:1,paddingHorizontal:4.5,paddingVertical:1,borderRadius:3.5},jsonBadgeText:{fontFamily:S.interBold,fontSize:8.5,color:e.darkOrange},dupBadge:{backgroundColor:`${e.purple}14`,borderColor:`${e.purple}2E`,borderWidth:1,paddingHorizontal:4.5,paddingVertical:1,borderRadius:3.5},dupBadgeText:{fontFamily:S.interBold,fontSize:8.5,color:e.purple},slugRow:{flexDirection:"row",alignItems:"center",minHeight:15},pathText:{fontFamily:S.interMedium,fontSize:10.5,lineHeight:14,color:e.slate600||e.grayText,flex:1},highlight:{backgroundColor:e.yellowHighlight,color:e.primaryBlack,borderRadius:2},cardFooterRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:18,minHeight:18,maxHeight:18,gap:4},footerLeft:{flexDirection:"row",alignItems:"center",gap:4.5,flex:1,minWidth:0,overflow:"hidden"},footerRight:{flexDirection:"row",alignItems:"center",gap:4,flexShrink:0},cardDateRow:{flexDirection:"row",alignItems:"center",gap:3.5},cardDateText:{fontFamily:S.interRegular,fontSize:10,lineHeight:13,color:e.slate400},metaStatChip:{flexDirection:"row",alignItems:"center",gap:3,backgroundColor:e.violetSoftBg,borderColor:e.violetSoftBorder,borderWidth:1,paddingHorizontal:5.5,paddingVertical:1.5,borderRadius:4},metaStatText:{fontFamily:S.interBold,color:e.violetSoftText,fontSize:9,lineHeight:12},waterfallContainer:{height:2.5,width:"100%",backgroundColor:e.graySurface,borderRadius:1.5,overflow:"hidden",marginTop:2},waterfallBar:{height:"100%",borderRadius:1.5}});function qe(t,B){return t.item===B.item&&t.isSelected===B.isSelected&&t.isNew===B.isNew&&t.searchStr===B.searchStr&&t.timelineMinStart===B.timelineMinStart&&t.timelineTotalRange===B.timelineTotalRange&&t.onPress===B.onPress&&t.onToggleSelect===B.onToggleSelect}export default re.memo(Ae,qe);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AppColors as o}from"../styles/AppColors";export const STATUS_FILTERS=["ALL","2xx","200","3xx","4xx","400","404","5xx","500","Failed"],METHOD_COLORS={ALL:o.slate500,GET:o.emerald600,POST:o.blue600,PUT:o.amber600,PATCH:o.violet600,DELETE:o.red600,QUERY:o.sky600,OPTIONS:o.slate600,HEAD:o.cyan600},DOMAIN_COLORS=o.domainColors,DURATION_FAST_MS=200,DURATION_SLOW_MS=800,DEFAULT_HIDDEN_URL_PATTERNS=["https://google-analytics.com/g/collect","https://api.npmjs.org","https://api.github.com","https://registry.npmjs.org"];export{LIB_VERSION}from"./version";
|
|
1
|
+
import{AppColors as o}from"../styles/AppColors";export const STATUS_FILTERS=["ALL","2xx","200","3xx","4xx","400","404","5xx","500","Failed"],METHOD_COLORS={ALL:o.slate500,GET:o.emerald600,POST:o.blue600,PUT:o.amber600,PATCH:o.violet600,DELETE:o.red600,QUERY:o.sky600,OPTIONS:o.slate600,HEAD:o.cyan600},DOMAIN_COLORS=o.domainColors,DURATION_FAST_MS=200,DURATION_SLOW_MS=800,DEFAULT_HIDDEN_URL_PATTERNS=["https://google-analytics.com/g/collect","https://api.npmjs.org","https://api.github.com","https://registry.npmjs.org","clients3.google.com"];export{LIB_VERSION}from"./version";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const ENC_MID = "";
|
|
2
|
-
export declare const ENC_SEC = "";
|
|
3
|
-
export declare const TELEMETRY_SALT = "";
|
|
1
|
+
export declare const ENC_MID = "df8ace0290a695bd05986213";
|
|
2
|
+
export declare const ENC_SEC = "db93cb0186b1f7bb0ba63a0d0a64997586849455ce37";
|
|
3
|
+
export declare const TELEMETRY_SALT = "rn-inapp-inspector-telemetry-v1";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ENC_MID="",ENC_SEC="",TELEMETRY_SALT="";
|
|
1
|
+
export const ENC_MID="df8ace0290a695bd05986213",ENC_SEC="db93cb0186b1f7bb0ba63a0d0a64997586849455ce37",TELEMETRY_SALT="rn-inapp-inspector-telemetry-v1";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "2.5.
|
|
1
|
+
export declare const LIB_VERSION = "2.5.13";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const LIB_VERSION="2.5.
|
|
1
|
+
export const LIB_VERSION="2.5.13";
|
|
@@ -37,7 +37,7 @@ export declare const getCrashRecords: () => CrashRecord[];
|
|
|
37
37
|
export declare const clearCrashRecords: () => void;
|
|
38
38
|
export declare const subscribeCrashEvents: (listener: CrashListener) => (() => void);
|
|
39
39
|
export declare const emitCrashEvent: (payload: CrashEventPayload) => void;
|
|
40
|
-
export declare const handleInterceptedCrash: (errorOrTitle: any, rawStack?: any, isFatal?: boolean, customType?: CrashType, componentStack?: string) => CrashRecord;
|
|
40
|
+
export declare const handleInterceptedCrash: (errorOrTitle: any, rawStack?: any, isFatal?: boolean, customType?: CrashType, componentStack?: string, bypassIgnoredCheck?: boolean) => CrashRecord;
|
|
41
41
|
export declare const recordCustomCrash: (error: Error | string, options?: {
|
|
42
42
|
isFatal?: boolean;
|
|
43
43
|
type?: CrashType;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{LogBox as D,NativeModules as M,TurboModuleRegistry as U,NativeEventEmitter as P,Platform as x,AppState as J,Dimensions as z}from"react-native";import{CrashExportFormat as V,CrashType as
|
|
2
|
-
`),n=[];for(const o of r){const t=o.trim();if(!t||t.includes("crashHandler.ts")||t.includes("handleInterceptedCrash")||t.includes("addLogFromCrash")||t.includes("setupGlobalCrashHandler"))continue;const
|
|
3
|
-
`):
|
|
1
|
+
import{LogBox as D,NativeModules as M,TurboModuleRegistry as U,NativeEventEmitter as P,Platform as x,AppState as J,Dimensions as z}from"react-native";import{CrashExportFormat as V,CrashType as h}from"../types/enums";import{addLogFromCrash as G}from"./consoleLogger";import{showNativeFloatingButton as W,setNativeFloatingButtonBadge as Y}from"../native/NativeInspector";import{t as s}from"../i18n";export{V as CrashExportFormat};export const DEFAULT_CRASH_IGNORED_TYPES={js:!0,native:!1,render:!0,promise:!1,custom:!1};let k=[],T=!1,N=0,L="",p=[],g=[];const F=50;let C=100;const Z=Date.now();let _=!1,b={...DEFAULT_CRASH_IGNORED_TYPES},v="fatal_only",B=!0;export const setCrashIgnoredTypesConfig=e=>{b={...b,...e}},getCrashIgnoredTypesConfig=()=>({...b}),setCrashModalTriggerPolicyConfig=e=>{v=e},getCrashModalTriggerPolicyConfig=()=>v,setCrashThrottleDuplicatesConfig=e=>{B=e},applyCrashPolicyPreset=e=>{switch(e){case"max_shield":b={js:!1,native:!1,render:!1,promise:!1,custom:!1};break;case"silent":b={js:!0,native:!0,render:!0,promise:!0,custom:!0};break;default:b={...DEFAULT_CRASH_IGNORED_TYPES};break}return{...b}},setCrashModuleEnabled=e=>{_=e},getCrashModuleEnabled=()=>_,setMaxCrashLogsLimit=e=>{C=Math.max(10,e),p.length>C&&(p=p.slice(0,C))},getMaxCrashLogsLimit=()=>C,pruneCrashRecords=e=>{const r=e!==void 0?Math.max(0,e):Math.floor(p.length/2),n=p.length-r;return n>0&&(p=p.slice(0,r)),g.length>20&&(g=g.slice(0,20)),Math.max(0,n)},addCrashBreadcrumb=(e,r,n)=>{if(_)try{const o={type:e,message:r,timestamp:Date.now(),data:n};g.unshift(o),g.length>F&&(g=g.slice(0,F))}catch{}},recordNavigationBreadcrumb=(e,r)=>{addCrashBreadcrumb("navigation",s("crash.breadcrumbNavigation",{from:e||"/",to:r||"/"}),{from:e,to:r})},recordNetworkBreadcrumb=(e,r,n,o)=>{const t=n!=null?` [${n}]`:"",c=o!=null?` (${Math.round(o)}ms)`:"";addCrashBreadcrumb("network",`${r.toUpperCase()} ${e}${t}${c}`,{url:e,method:r,status:n,duration:o})},recordReduxBreadcrumb=(e,r)=>{addCrashBreadcrumb("redux",s("crash.breadcrumbAction",{actionType:e}),{type:e,payloadSummary:typeof r=="object"&&r!==null?Object.keys(r):typeof r})},recordUserActionBreadcrumb=(e,r)=>{addCrashBreadcrumb("user",e,r)},clearCrashBreadcrumbs=()=>{g=[]},getCrashBreadcrumbs=()=>[...g],parseCrashStackTrace=e=>{if(!e||typeof e!="string")return[];const r=e.split(`
|
|
2
|
+
`),n=[];for(const o of r){const t=o.trim();if(!t||t.includes("crashHandler.ts")||t.includes("handleInterceptedCrash")||t.includes("addLogFromCrash")||t.includes("setupGlobalCrashHandler"))continue;const c=t.match(/^([^@]+)@(.*):(\d+):(\d+)$/);if(c){const[,a,i,d,$]=c,y=i.split("?")[0].split("/").pop()||i,S=!i.includes("node_modules")&&!i.includes("react-native")&&!i.includes("react-dom")&&!i.includes("hermes")&&!i.includes("internal");n.push({method:a.trim(),file:y,lineNumber:parseInt(d,10),column:parseInt($,10),raw:t,isAppCode:S});continue}const l=t.match(/^at\s+(.+)\s+\((.+):(\d+):(\d+)\)$/);if(l){const[,a,i,d,$]=l,y=i.split("?")[0].split("/").pop()||i,S=!i.includes("node_modules")&&!i.includes("react-native")&&!i.includes("react-dom")&&!i.includes("internal");n.push({method:a.trim(),file:y,lineNumber:parseInt(d,10),column:parseInt($,10),raw:t,isAppCode:S});continue}const f=t.match(/^at\s+(.+):(\d+):(\d+)$/);if(f){const[,a,i,d]=f,$=a.split("?")[0].split("/").pop()||a,y=!a.includes("node_modules")&&!a.includes("react-native");n.push({method:"<anonymous>",file:$,lineNumber:parseInt(i,10),column:parseInt(d,10),raw:t,isAppCode:y});continue}const m=t.match(/^at\s+([a-zA-Z0-9_$.]+)\(([a-zA-Z0-9_$]+\.java):(\d+)\)$/);if(m){const[,a,i,d]=m,$=!a.startsWith("com.facebook.react")&&!a.startsWith("android.");n.push({method:a,file:i,lineNumber:parseInt(d,10),column:0,raw:t,isAppCode:$});continue}const u=t.match(/^\d+\s+([^\s]+)\s+(0x[0-9a-fA-F]+)\s+(.+)$/);if(u){const[,a,,i]=u,d=!a.startsWith("lib")&&!a.startsWith("Core")&&!a.startsWith("React");n.push({method:i,file:a,lineNumber:0,column:0,raw:t,isAppCode:d});continue}n.push({method:t.startsWith("at ")?t.slice(3):t,file:"runtime",lineNumber:0,column:0,raw:t,isAppCode:!1})}return n};const q=()=>{try{const e=globalThis.performance;if(e&&e.memory)return{usedJSHeapSize:Math.round(e.memory.usedJSHeapSize/(1024*1024)),totalJSHeapSize:Math.round(e.memory.totalJSHeapSize/(1024*1024))}}catch{}},K=()=>{try{const e=z.get("window");return`${Math.round(e.width)}x${Math.round(e.height)} (${e.scale}x)`}catch{return s("crash.unknown")}};export const computeCrashFingerprint=e=>{const r=e.type||"js",n=e.name||"Error",o=e.parsedStack&&e.parsedStack.length>0?e.parsedStack[0]:null,t=o?`${o.file}:${o.lineNumber}`:"unknown";return`${r}_${n}_${t}`},getCrashRecords=()=>[...p],clearCrashRecords=()=>{p=[],emitCrashEvent({error:null,message:"__CLEARED__",timestamp:Date.now()})},subscribeCrashEvents=e=>(k.push(e),()=>{k=k.filter(r=>r!==e)}),emitCrashEvent=e=>{if(e.message!=="__CLEARED__"){const r=Date.now();if(r-N<250)return;N=r}k.forEach(r=>{try{r(e)}catch{}})},handleInterceptedCrash=(e,r,n=!1,o,t,c=!1)=>{try{const l=e instanceof Error||typeof e=="object"&&e!==null?e:new Error(String(e||s("crash.runtimeException"))),f=l.message||(typeof e=="string"?e:s("crash.runtimeException"));let m="";typeof r=="string"?m=r:Array.isArray(r)?m=r.map(w=>`at ${w.methodName||"<anonymous>"} (${w.file||"unknown"}:${w.lineNumber||0}:${w.column||0})`).join(`
|
|
3
|
+
`):m=l.stack||new Error().stack||"";let u=o||h.Js;const a=f.toLowerCase();if(o||(a.includes("native")||a.includes("sigsegv")||a.includes("nsrange")||a.includes("nullpointerexception")||a.includes("fatal signal")?u=h.Native:a.includes("promise")||a.includes("unhandled rejection")||a.includes("unhandledrejection")?u=h.Promise:a.includes("render")||a.includes("errorboundary")||t?u=h.Render:u=h.Js),!c&&!!b[u])return{id:`crash_ignored_${Date.now()}`,isFatal:n,type:u,message:f,timestamp:Date.now(),dateStr:new Date().toLocaleDateString(),timeStr:new Date().toLocaleTimeString()};const i=new Date,d=i.toLocaleDateString(),$=i.toLocaleTimeString(),y=parseCrashStackTrace(m),S=`${u}_${f}_${m.slice(0,80)}`,R=Date.now();if(B&&S===L&&R-N<500)return p.length>0&&(p[0].duplicateCount=(p[0].duplicateCount||1)+1),p[0];L=S,N=R;const j=G(l,`[${n?s("crash.logFatalCrash"):s("crash.logUnhandledError")}] ${f}`,m,n),A=typeof globalThis.HermesInternal<"u",H=typeof globalThis.nativeFabricUIManager<"u",I={id:`crash_${Date.now()}_${Math.random().toString(36).substr(2,6)}`,error:l,isFatal:n,type:u,message:f,name:l.name||(n?s("crash.errorNameFatal"):s("crash.errorNameUnhandled")),stack:m,parsedStack:y,componentStack:t||void 0,timestamp:Date.now(),dateStr:d,timeStr:$,deviceInfo:{platform:x.OS,osVersion:String(x.Version),rnVersion:x.constants?.reactNativeVersion?`${x.constants.reactNativeVersion.major}.${x.constants.reactNativeVersion.minor}.${x.constants.reactNativeVersion.patch}`:s("crash.unknown"),isHermes:A,isFabric:H,appState:J.currentState||"active"},memoryInfo:q(),breadcrumbs:[...g],logId:j?.id};p.unshift(I),p.length>C&&(p=p.slice(0,C));let E=!1;v==="all_errors"?E=!0:v==="fatal_only"?E=n||u===h.Native:v==="silent_tab_only"&&(E=!1),emitCrashEvent({error:l,isFatal:n,message:`[${n?s("crash.logFatalCrash"):s("crash.logUnhandledError")}] ${f}`,stack:m,timestamp:Date.now(),logId:j?.id,crashRecord:I,shouldShowModal:E});try{W(),Y(!0)}catch{}return I}catch{return{id:`crash_${Date.now()}`,isFatal:!0,type:h.Js,message:String(e||s("crash.unknownException")),timestamp:Date.now(),dateStr:new Date().toLocaleDateString(),timeStr:new Date().toLocaleTimeString()}}},recordCustomCrash=(e,r)=>handleInterceptedCrash(e,typeof e=="object"?e.stack:void 0,r?.isFatal??!1,r?.type||h.Custom,r?.componentStack),triggerGlobalCrashScreen=e=>{emitCrashEvent({error:e.error||new Error(e.message),isFatal:!0,message:e.message,stack:e.stack,timestamp:e.timestamp||Date.now(),logId:e.logId,crashRecord:e})},simulateTestCrash=(e=h.Js,r,n,o=!0)=>{const t=new Error(r||X(e));return handleInterceptedCrash(e===h.Native?t.message:t,n||t.stack,o,e,e===h.Render?Q():void 0,!0)};const X=e=>{switch(e){case"native":return s("crash.simNativeMessage");case"promise":return s("crash.simPromiseMessage");case"render":return s("crash.simRenderMessage");default:return s("crash.simJsMessage")}},Q=()=>{try{const e=new Error;if(e.stack)return e.stack.split(`
|
|
4
4
|
`).slice(1,6).map(r=>` ${r.trim()}`).join(`
|
|
5
|
-
`)}catch{}};export const exportCrashReport=(e,r="text")=>{if(r==="json")return JSON.stringify(e,null,2);const n=Math.round((e.timestamp-Z)/1e3);if(r==="markdown"){const t=[];return t.push(`## ${s("crash.mdReportTitle",{name:e.name||"Error"})}`),t.push(`> **${e.message}**`),t.push(""),t.push(`- **${s("crash.reportType")}** \`${e.type.toUpperCase()}\``),t.push(`- **${s("crash.reportFatal")}** \`${e.isFatal?s("crash.mdSeverityFatal"):s("crash.mdSeverityHandled")}\``),t.push(`- **${s("crash.reportTimestamp")}** ${e.dateStr} ${e.timeStr}`),t.push(`- **${s("crash.reportUptime")}** ${n}s`),t.push(`- **${s("crash.reportPlatform")}** ${e.deviceInfo?.platform?.toUpperCase()} (v${e.deviceInfo?.osVersion})`),t.push(`- **${s("crash.reportReactNative")}** v${e.deviceInfo?.rnVersion||"N/A"}`),t.push(`- **${s("crash.jsEngine")}** ${e.deviceInfo?.isHermes?s("crash.hermesEngine"):s("crash.jsc")}`),t.push(`- **${s("crash.reportArchitecture")}** ${e.deviceInfo?.isFabric?s("crash.reportFabricNew"):s("crash.reportPaperLegacy")}`),e.memoryInfo&&t.push(`- **${s("crash.reportJsMemory")}** ${e.memoryInfo.usedJSHeapSize} MB / ${e.memoryInfo.totalJSHeapSize} MB`),t.push(""),t.push(`### ${s("crash.mdStackTrace")}`),t.push("```"),t.push(e.stack||s("crash.reportNoStackTrace")),t.push("```"),e.componentStack&&(t.push(""),t.push(`### ${s("crash.mdComponentHierarchy")}`),t.push("```"),t.push(e.componentStack),t.push("```")),e.breadcrumbs&&e.breadcrumbs.length>0&&(t.push(""),t.push(`### ${s("crash.mdRecentBreadcrumbs")}`),e.breadcrumbs.forEach(
|
|
6
|
-
`)}const o=[];return o.push("===================================================="),o.push(` ${s("crash.reportTitle")} `),o.push("===================================================="),o.push(`${s("crash.reportErrorName")} ${e.name||"Error"}`),o.push(`${s("crash.reportMessage")} ${e.message}`),o.push(`${s("crash.reportType")} ${e.type.toUpperCase()}`),o.push(`${s("crash.reportFatal")} ${e.isFatal?s("crash.reportFatalYes"):s("crash.reportFatalNo")}`),o.push(`${s("crash.reportTimestamp")} ${e.dateStr} ${e.timeStr} (${e.timestamp})`),o.push(`${s("crash.reportUptime")} ${s("crash.reportUptimeValue",{seconds:n})}`),o.push(`${s("crash.reportPlatform")} ${e.deviceInfo?.platform?.toUpperCase()} (v${e.deviceInfo?.osVersion})`),o.push(`${s("crash.reportReactNative")} ${e.deviceInfo?.rnVersion||"N/A"}`),o.push(`${s("crash.reportHermes")} ${e.deviceInfo?.isHermes?s("crash.reportEnabled"):s("crash.reportDisabled")}`),o.push(`${s("crash.reportArchitecture")} ${e.deviceInfo?.isFabric?s("crash.reportFabricNew"):s("crash.reportPaperLegacy")}`),o.push(`${s("crash.reportScreenSize")} ${K()}`),o.push(`${s("crash.reportAppState")} ${e.deviceInfo?.appState||"active"}`),e.memoryInfo&&o.push(`${s("crash.reportJsMemory")} ${e.memoryInfo.usedJSHeapSize} MB / ${e.memoryInfo.totalJSHeapSize} MB`),o.push("----------------------------------------------------"),o.push(`${s("crash.reportStackTrace")}`),o.push(e.stack||s("crash.reportNoStackTrace")),e.componentStack&&(o.push("----------------------------------------------------"),o.push(`${s("crash.reportComponentHierarchy")}`),o.push(e.componentStack)),e.breadcrumbs&&e.breadcrumbs.length>0&&(o.push("----------------------------------------------------"),o.push(`${s("crash.reportRecentBreadcrumbs")}`),e.breadcrumbs.forEach(t=>{const
|
|
7
|
-
`)},setupGlobalCrashHandler=()=>{if(!T){T=!0;try{D&&typeof D.ignoreAllLogs=="function"&&D.ignoreAllLogs(!0)}catch{}try{const e=require("react-native/Libraries/LogBox/Data/LogBoxData");e&&typeof e.setDisabled=="function"&&e.setDisabled(!0)}catch{}try{const e=M?.NetworkInspectorModule;e&&(typeof e.enableNativeCrashProtection=="function"&&e.enableNativeCrashProtection(),new P(e).addListener("onNativeCrash",n=>{const t=`[${(n?.platform||x.OS).toUpperCase()} ${s("crash.nativeCrashTitle")}] ${n?.message||s("crash.nativeUncaughtException")}`,
|
|
5
|
+
`)}catch{}};export const exportCrashReport=(e,r="text")=>{if(r==="json")return JSON.stringify(e,null,2);const n=Math.round((e.timestamp-Z)/1e3);if(r==="markdown"){const t=[];return t.push(`## ${s("crash.mdReportTitle",{name:e.name||"Error"})}`),t.push(`> **${e.message}**`),t.push(""),t.push(`- **${s("crash.reportType")}** \`${e.type.toUpperCase()}\``),t.push(`- **${s("crash.reportFatal")}** \`${e.isFatal?s("crash.mdSeverityFatal"):s("crash.mdSeverityHandled")}\``),t.push(`- **${s("crash.reportTimestamp")}** ${e.dateStr} ${e.timeStr}`),t.push(`- **${s("crash.reportUptime")}** ${n}s`),t.push(`- **${s("crash.reportPlatform")}** ${e.deviceInfo?.platform?.toUpperCase()} (v${e.deviceInfo?.osVersion})`),t.push(`- **${s("crash.reportReactNative")}** v${e.deviceInfo?.rnVersion||"N/A"}`),t.push(`- **${s("crash.jsEngine")}** ${e.deviceInfo?.isHermes?s("crash.hermesEngine"):s("crash.jsc")}`),t.push(`- **${s("crash.reportArchitecture")}** ${e.deviceInfo?.isFabric?s("crash.reportFabricNew"):s("crash.reportPaperLegacy")}`),e.memoryInfo&&t.push(`- **${s("crash.reportJsMemory")}** ${e.memoryInfo.usedJSHeapSize} MB / ${e.memoryInfo.totalJSHeapSize} MB`),t.push(""),t.push(`### ${s("crash.mdStackTrace")}`),t.push("```"),t.push(e.stack||s("crash.reportNoStackTrace")),t.push("```"),e.componentStack&&(t.push(""),t.push(`### ${s("crash.mdComponentHierarchy")}`),t.push("```"),t.push(e.componentStack),t.push("```")),e.breadcrumbs&&e.breadcrumbs.length>0&&(t.push(""),t.push(`### ${s("crash.mdRecentBreadcrumbs")}`),e.breadcrumbs.forEach(c=>{const l=new Date(c.timestamp).toLocaleTimeString();t.push(`- \`[${l}]\` **[${c.type.toUpperCase()}]** ${c.message}`)})),t.join(`
|
|
6
|
+
`)}const o=[];return o.push("===================================================="),o.push(` ${s("crash.reportTitle")} `),o.push("===================================================="),o.push(`${s("crash.reportErrorName")} ${e.name||"Error"}`),o.push(`${s("crash.reportMessage")} ${e.message}`),o.push(`${s("crash.reportType")} ${e.type.toUpperCase()}`),o.push(`${s("crash.reportFatal")} ${e.isFatal?s("crash.reportFatalYes"):s("crash.reportFatalNo")}`),o.push(`${s("crash.reportTimestamp")} ${e.dateStr} ${e.timeStr} (${e.timestamp})`),o.push(`${s("crash.reportUptime")} ${s("crash.reportUptimeValue",{seconds:n})}`),o.push(`${s("crash.reportPlatform")} ${e.deviceInfo?.platform?.toUpperCase()} (v${e.deviceInfo?.osVersion})`),o.push(`${s("crash.reportReactNative")} ${e.deviceInfo?.rnVersion||"N/A"}`),o.push(`${s("crash.reportHermes")} ${e.deviceInfo?.isHermes?s("crash.reportEnabled"):s("crash.reportDisabled")}`),o.push(`${s("crash.reportArchitecture")} ${e.deviceInfo?.isFabric?s("crash.reportFabricNew"):s("crash.reportPaperLegacy")}`),o.push(`${s("crash.reportScreenSize")} ${K()}`),o.push(`${s("crash.reportAppState")} ${e.deviceInfo?.appState||"active"}`),e.memoryInfo&&o.push(`${s("crash.reportJsMemory")} ${e.memoryInfo.usedJSHeapSize} MB / ${e.memoryInfo.totalJSHeapSize} MB`),o.push("----------------------------------------------------"),o.push(`${s("crash.reportStackTrace")}`),o.push(e.stack||s("crash.reportNoStackTrace")),e.componentStack&&(o.push("----------------------------------------------------"),o.push(`${s("crash.reportComponentHierarchy")}`),o.push(e.componentStack)),e.breadcrumbs&&e.breadcrumbs.length>0&&(o.push("----------------------------------------------------"),o.push(`${s("crash.reportRecentBreadcrumbs")}`),e.breadcrumbs.forEach(t=>{const c=new Date(t.timestamp).toLocaleTimeString();o.push(` [${c}] [${t.type.toUpperCase()}] ${t.message}`)})),o.push("===================================================="),o.join(`
|
|
7
|
+
`)},setupGlobalCrashHandler=()=>{if(!T){T=!0;try{D&&typeof D.ignoreAllLogs=="function"&&D.ignoreAllLogs(!0)}catch{}try{const e=require("react-native/Libraries/LogBox/Data/LogBoxData");e&&typeof e.setDisabled=="function"&&e.setDisabled(!0)}catch{}try{const e=M?.NetworkInspectorModule;e&&(typeof e.enableNativeCrashProtection=="function"&&e.enableNativeCrashProtection(),new P(e).addListener("onNativeCrash",n=>{const t=`[${(n?.platform||x.OS).toUpperCase()} ${s("crash.nativeCrashTitle")}] ${n?.message||s("crash.nativeUncaughtException")}`,c=n?.stack||"";handleInterceptedCrash(t,c,!0,"native")}))}catch{}try{const e=U||globalThis.__turboModuleProxy,r=M?.ExceptionsManager||(e?.get?e.get("ExceptionsManager"):null);if(r){r.reportFatalException=(o,t,c)=>{handleInterceptedCrash(o,t,!0,"native");try{typeof r.dismissRedbox=="function"&&r.dismissRedbox()}catch{}},r.reportSoftException=(o,t,c)=>{handleInterceptedCrash(o,t,!1,"js");try{typeof r.dismissRedbox=="function"&&r.dismissRedbox()}catch{}},r.reportException=o=>{const t=o?.message||o?.title||s("crash.nativeException"),c=o?.stack||o?.rawStack;handleInterceptedCrash(t,c,o?.isFatal??!0,"js");try{typeof r.dismissRedbox=="function"&&r.dismissRedbox()}catch{}},r.updateExceptionMessage=()=>{};try{typeof r.dismissRedbox=="function"&&r.dismissRedbox()}catch{}}const n=M?.RedBox||M?.RCTRedBox||(e?.get?e.get("RedBox")||e.get("RCTRedBox"):null);n&&(typeof n.showErrorMessage=="function"&&(n.showErrorMessage=()=>{}),typeof n.showUserError=="function"&&(n.showUserError=()=>{}),typeof n.dismiss=="function"&&n.dismiss())}catch{}try{const r=globalThis.ErrorUtils;r&&(typeof r.setGlobalHandler=="function"&&r.setGlobalHandler((n,o)=>{handleInterceptedCrash(n,n?.stack,o??!1,"js")}),typeof r.reportFatalError=="function"&&(r.reportFatalError=n=>{handleInterceptedCrash(n,n?.stack,!0,"js")}),typeof r.reportError=="function"&&(r.reportError=n=>{handleInterceptedCrash(n,n?.stack,!1,"js")}))}catch{}try{const e=globalThis,r=n=>{try{const o=n?.reason||n?.detail?.reason||n,t=o?.stack||(n?.stack??new Error().stack);handleInterceptedCrash(o,t,!1,"promise")}catch{}};typeof e.addEventListener=="function"&&e.addEventListener("unhandledrejection",r),typeof e.onunhandledrejection<"u"&&(e.onunhandledrejection=r)}catch{}}};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { InspectedElementInfo, UiInspectorSubTab } from '../types';
|
|
2
|
+
type UiInspectorListener = (state: UiInspectorState) => void;
|
|
3
|
+
export interface UiInspectorState {
|
|
4
|
+
isInspectModeActive: boolean;
|
|
5
|
+
selectedElement: InspectedElementInfo | null;
|
|
6
|
+
activeSubTab: UiInspectorSubTab;
|
|
7
|
+
showAlignmentGrid: boolean;
|
|
8
|
+
showDistanceGuides: boolean;
|
|
9
|
+
history: InspectedElementInfo[];
|
|
10
|
+
tweakedStyles: Record<string, any>;
|
|
11
|
+
}
|
|
12
|
+
export declare function subscribeUiInspectorState(listener: UiInspectorListener): () => void;
|
|
13
|
+
export declare function getUiInspectorState(): UiInspectorState;
|
|
14
|
+
export declare function setInspectModeActive(active: boolean): void;
|
|
15
|
+
export declare function setSelectedUiElement(element: InspectedElementInfo | null): void;
|
|
16
|
+
export declare function setUiInspectorSubTab(subTab: UiInspectorSubTab): void;
|
|
17
|
+
export declare function toggleAlignmentGrid(show?: boolean): void;
|
|
18
|
+
export declare function toggleDistanceGuides(show?: boolean): void;
|
|
19
|
+
export declare function applyLiveStyleOverride(key: string, value: any): void;
|
|
20
|
+
export declare function resetLiveStyleOverrides(): void;
|
|
21
|
+
export declare function clearUiInspectorHistory(): void;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e={isInspectModeActive:!1,selectedElement:null,activeSubTab:"styles",showAlignmentGrid:!1,showDistanceGuides:!0,history:[],tweakedStyles:{}};const i=new Set;function s(){const t={...e,history:[...e.history],tweakedStyles:{...e.tweakedStyles}};i.forEach(n=>{try{n(t)}catch(o){console.warn("[UIInspector] Listener notification error:",o)}})}export function subscribeUiInspectorState(t){return i.add(t),t(e),()=>{i.delete(t)}}export function getUiInspectorState(){return e}export function setInspectModeActive(t){e.isInspectModeActive=t,s()}export function setSelectedUiElement(t){e.selectedElement=t,t?(e.tweakedStyles={...t.tweakedStyles},e.history.some(n=>n.id===t.id)||(e.history=[t,...e.history.slice(0,19)])):e.tweakedStyles={},s()}export function setUiInspectorSubTab(t){e.activeSubTab=t,s()}export function toggleAlignmentGrid(t){e.showAlignmentGrid=typeof t=="boolean"?t:!e.showAlignmentGrid,s()}export function toggleDistanceGuides(t){e.showDistanceGuides=typeof t=="boolean"?t:!e.showDistanceGuides,s()}export function applyLiveStyleOverride(t,n){e.tweakedStyles={...e.tweakedStyles,[t]:n},e.selectedElement&&(e.selectedElement={...e.selectedElement,tweakedStyles:{...e.tweakedStyles},flattenedStyles:{...e.selectedElement.originalStyles,...e.tweakedStyles}}),s()}export function resetLiveStyleOverrides(){e.tweakedStyles={},e.selectedElement&&(e.selectedElement={...e.selectedElement,tweakedStyles:{},flattenedStyles:{...e.selectedElement.originalStyles}}),s()}export function clearUiInspectorHistory(){e.history=[],s()}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import{Platform as
|
|
1
|
+
import{Platform as b,ToastAndroid as y,Alert as P,NativeModules as u,Linking as x}from"react-native";import N from"@react-native-clipboard/clipboard";import{showToast as w}from"./toast";import{copyMediaToClipboard as E}from"../native/NativeInspector";import{AppColors as c}from"../styles/AppColors";import{DOMAIN_COLORS as C,DURATION_FAST_MS as M,DURATION_SLOW_MS as T}from"../constants";export*from"./searchQueryParser";export*from"./memoryManager";export*from"./toast";export const isLocalDebugEnvironment=()=>{const e=typeof __DEV__<"u"&&!!__DEV__,t=u.SourceCode?.scriptURL||"",n=t.startsWith("http://")||t.startsWith("https://")||t.includes(":8081")||t.includes(":8082");return e||n},getDomainColor=e=>{if(!e)return C[0];let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return C[Math.abs(t)%C.length]},formatDateTime=e=>{const t=new Date(e),n=(d,l=2)=>String(d).padStart(l,"0"),r=n(t.getDate()),o=n(t.getMonth()+1),s=t.getFullYear(),i=n(t.getHours()),a=n(t.getMinutes()),p=n(t.getSeconds());return`${r}/${o}/${s} ${i}:${a}:${p}`},formatTimestamp=e=>{try{const t=new Date(e),n=t.getHours().toString().padStart(2,"0"),r=t.getMinutes().toString().padStart(2,"0"),o=t.getSeconds().toString().padStart(2,"0"),s=t.getMilliseconds().toString().padStart(3,"0");return`${n}:${r}:${o}.${s}`}catch{return"\u2014"}},getStatusColor=e=>!e||e===0?c.errorColor:e>=500?c.errorColor:e>=400?c.darkOrange:e>=300?c.warningIconGold:c.greenColor,getDurationColor=e=>e==null?c.grayTextWeak:e<M?c.greenColor:e<T?c.lightOrange:c.errorColor,getSize=e=>{try{const t=JSON.stringify(e)?.length??0;return t<1024?`${t} B`:`${(t/1024).toFixed(1)} KB`}catch{return"\u2014"}},formatBytes=e=>{if(e===0||!e||isNaN(e))return"0 B";const t=1024,n=["B","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/Math.pow(t,r)).toFixed(1))} ${n[r]||"B"}`},formatByteSize=e=>!e||e<=0?"0 B":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(2)} MB`,copyToClipboard=(e,t)=>{const n=typeof e=="function"?e():e;let r="";if(typeof n=="string")r=n;else try{r=JSON.stringify(n,null,2)}catch{r=String(n)}try{typeof N?.setString=="function"?N.setString(r):typeof N?.default?.setString=="function"&&N.default.setString(r)}catch(o){__DEV__&&console.warn("[NetworkInspector] Clipboard.setString failed:",o)}try{w(t?`${t} copied to clipboard`:"Copied to clipboard")}catch{}try{b.OS==="android"&&y?.show&&y.show(t?`${t} copied to clipboard`:"Copied to clipboard",y.SHORT)}catch{}},copyImageOrMediaToClipboard=async(e,t="Image")=>{if(!e)return;let n=!1;try{n=await E(e)}catch{n=!1}if(!n){copyToClipboard(e,t);return}try{w(`${t} copied to clipboard`)}catch{}try{b.OS==="android"&&y?.show&&y.show(`${t} copied to clipboard`,y.SHORT)}catch{}},getPath=e=>{try{const t=new URL(e);return t.pathname+(t.search?t.search:"")}catch{return e.replace(/^https?:\/\/[^/?#]+/,"")||"/"}},getBaseUrl=e=>{try{const t=new URL(e);return`${t.protocol}//${t.host}`}catch{const t=e.match(/^(https?:\/\/[^/]+)/);return t?t[1]:""}},getCurlCommand=e=>{let t=`curl -X ${e.method} "${e.url}"`;if(e.requestHeaders&&Object.entries(e.requestHeaders).forEach(([n,r])=>{t+=` \\
|
|
2
2
|
-H "${n}: ${r}"`}),e.request&&e.method!=="GET"){const n=typeof e.request=="string"?e.request:JSON.stringify(e.request);t+=` \\
|
|
3
|
-
-d '${n.replace(/'/g,"'\\''")}'`}return t},getFetchCommand=e=>{const t={method:e.method};return e.requestHeaders&&Object.keys(e.requestHeaders).length>0&&(t.headers=e.requestHeaders),e.request&&e.method!=="GET"&&(t.body=JSON.stringify(e.request)),`fetch("${e.url}", ${JSON.stringify(t,null,2)})`},getPostmanRequestJson=e=>{let t;try{const s=new URL(e.url),i=s.hostname.split("."),a=s.pathname.replace(/^\//,"").split("/").filter(Boolean),p=[];s.searchParams.forEach((d,l)=>{p.push({key:l,value:d})}),t={raw:e.url,host:i,path:a,query:p.length>0?p:void 0}}catch{t={raw:e.url}}const n=[];e.requestHeaders&&typeof e.requestHeaders=="object"&&Object.entries(e.requestHeaders).forEach(([s,i])=>{n.push({key:s,value:String(i),type:"text"})});let r;if(e.request){const s=e.request;let i="";if(typeof s=="object")try{i=JSON.stringify(s,null,2)}catch{i=String(s)}else i=String(s);r={mode:"raw",raw:i,options:{raw:{language:"json"}}}}const o={info:{name:`${e.method} ${getPath(e.url)||e.url}`,schema:"https://schema.getpostman.com/json/collection/v2.1.0/collection.json",_exporter_id:"inapp-inspector"},item:[{name:`${e.method} ${getPath(e.url)||e.url}`,request:{method:e.method||"GET",header:n,body:r,url:t,description:"Captured by React Native In-App Inspector"},response:[]}]};return JSON.stringify(o,null,2)},openWithPostman=async(e,t)=>{const n=getCurlCommand(e)
|
|
3
|
+
-d '${n.replace(/'/g,"'\\''")}'`}return t},getFetchCommand=e=>{const t={method:e.method};return e.requestHeaders&&Object.keys(e.requestHeaders).length>0&&(t.headers=e.requestHeaders),e.request&&e.method!=="GET"&&(t.body=JSON.stringify(e.request)),`fetch("${e.url}", ${JSON.stringify(t,null,2)})`},getPostmanRequestJson=e=>{let t;try{const s=new URL(e.url),i=s.hostname.split("."),a=s.pathname.replace(/^\//,"").split("/").filter(Boolean),p=[];s.searchParams.forEach((d,l)=>{p.push({key:l,value:d})}),t={raw:e.url,host:i,path:a,query:p.length>0?p:void 0}}catch{t={raw:e.url}}const n=[];e.requestHeaders&&typeof e.requestHeaders=="object"&&Object.entries(e.requestHeaders).forEach(([s,i])=>{n.push({key:s,value:String(i),type:"text"})});let r;if(e.request){const s=e.request;let i="";if(typeof s=="object")try{i=JSON.stringify(s,null,2)}catch{i=String(s)}else i=String(s);r={mode:"raw",raw:i,options:{raw:{language:"json"}}}}const o={info:{name:`${e.method} ${getPath(e.url)||e.url}`,schema:"https://schema.getpostman.com/json/collection/v2.1.0/collection.json",_exporter_id:"inapp-inspector"},item:[{name:`${e.method} ${getPath(e.url)||e.url}`,request:{method:e.method||"GET",header:n,body:r,url:t,description:"Captured by React Native In-App Inspector"},response:[]}]};return JSON.stringify(o,null,2)},openWithPostman=async(e,t)=>{const n=getCurlCommand(e);N.setString(n);const r=s=>{t?t(s):w(s)},o="postman://";try{if(await x.canOpenURL(o))try{await x.openURL(o),r("Opened Postman (cURL copied to clipboard)");return}catch{}}catch{}r("cURL copied! Ready to paste into Postman")},deduplicateLogs=e=>{const t=new Map;return e.forEach(n=>{if(!t.has(n.id))t.set(n.id,n);else{const r=t.get(n.id);(r.status==null&&n.status!=null||(n.startTime??0)>=(r.startTime??0))&&t.set(n.id,n)}}),Array.from(t.values()).sort((n,r)=>r.id-n.id)},escapeRegex=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),getNavigationInfo=(e,t=[])=>{if(!e)return{path:t.length>0?t.join(" \u2794 "):"",params:null};if(e.name&&!e.routes)return{path:t.length>0?[...t,e.name].join(" \u2794 "):e.name,params:e.params||null};if(!e.routes||!Array.isArray(e.routes)||e.routes.length===0)return{path:t.length>0?t.join(" \u2794 "):"",params:null};const n=typeof e.index=="number"&&e.index>=0&&e.index<e.routes.length?e.index:0,r=e.routes[n];if(!r)return{path:t.length>0?t.join(" \u2794 "):"",params:null};const o=r.name?[...t,r.name]:t;return r?.state?getNavigationInfo(r.state,o):{path:o.length>0?o.join(" \u2794 "):r.name||"",params:r.params||null}},getLogPageName=(e,t)=>{const n=t||e?.routeInfo;if(n&&n.path&&n.path!=="Navigators"){const r=n.path.split(" \u2794 ").map(o=>o.trim()).filter(Boolean);return r.length>0?r[r.length-1]:n.path}if(e.caller&&e.caller!=="Unknown")try{const r=e.caller.match(/([^/\\]+)\.(tsx|jsx|ts|js)/i);if(r&&r[1]){const o=r[1];if(!["networklogger","fetch","axios","apiclient","request","http","index","nativeinspector","inappinspector","bundleanalyzer"].includes(o.toLowerCase()))return o}}catch{}if(e.url)try{const o=e.url.split("?")[0].split("#")[0].replace(/^https?:\/\//i,""),s=o.indexOf("/");if(s!==-1){const a=o.substring(s+1).split("/").filter(Boolean),p=["api","v1","v2","v3","v4","rest","graphql","json","data","service","app"],d=a.filter(l=>!p.includes(l.toLowerCase()));if(d.length>0){const l=d[0];return l.charAt(0).toUpperCase()+l.slice(1)}}const i=o.split("/")[0];if(i)return i}catch{}return"General"},flattenObject=(e,t="")=>{let n={};return typeof e=="object"&&e!==null?Array.isArray(e)?e.forEach((r,o)=>{Object.assign(n,flattenObject(r,t?`${t}[${o}]`:`[${o}]`))}):Object.keys(e).forEach(r=>{Object.assign(n,flattenObject(e[r],t?`${t}.${r}`:r))}):n[t||"root"]=e,n},getDiff=(e,t)=>{const n=flattenObject(e),r=flattenObject(t),o=[];return new Set([...Object.keys(n),...Object.keys(r)]).forEach(i=>{i in n?i in r?n[i]!==r[i]&&o.push({type:"changed",path:i,oldVal:n[i],newVal:r[i]}):o.push({type:"removed",path:i,oldVal:n[i]}):o.push({type:"added",path:i,newVal:r[i]})}),o.sort((i,a)=>i.path.localeCompare(a.path))},formatDisplayUrl=e=>e?e.startsWith("http://")||e.startsWith("https://")?e:`https://${e}`:"",getLocalizedFilePath=(e,t,n)=>e.replace("country-language",`${t?.toLowerCase()}-${n?.toLowerCase()}`),getLocalizedFilePathWithSlash=(e,t,n)=>e.replace("country/language",`${t?.toLowerCase()}/${n?.toLowerCase()}`),isAllValuesEmpty=e=>!e||typeof e!="object"?!0:Object.values(e).every(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0),formatDateTimeToAnalytics=e=>new Date(e)?.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),getBundleIdentifier=()=>{const e=u.RNDeviceInfo;if(e&&typeof e.bundleId=="string")return e.bundleId;if(e&&typeof e.getBundleId=="function")try{const o=e.getBundleId();if(typeof o=="string")return o}catch{}const t=u.ExponentConstants;if(t&&t.manifest){const o=t.manifest;if(o.ios&&o.ios.bundleIdentifier)return o.ios.bundleIdentifier;if(o.android&&o.android.package)return o.android.package}const n=u.ExpoApplication;if(n&&typeof n.applicationId=="string")return n.applicationId;const r=u.SourceCode;if(r&&typeof r.scriptURL=="string"){const o=r.scriptURL;if(o.includes("assets/"))try{const s=o.match(/assets\/([^/?#]+)/);if(s&&s[1])return s[1]}catch{}}return"org.reactjs.native.example"},getAppName=()=>{const e=u.PlatformConstants;e&&e.interfaceIdiom;const t=u.RNDeviceInfo;if(t&&typeof t.appName=="string")return t.appName;const n=u.NetworkInspectorModule;if(n&&typeof n.appName=="string"&&n.appName.length>0&&n.appName!=="App")return n.appName;const r=u.ExpoApplication;if(r&&typeof r.applicationName=="string")return r.applicationName;const o=u.ExponentConstants;if(o&&o.manifest){const a=o.manifest;if(a.name)return a.name}const s=u.AppInfo;if(s&&typeof s.appName=="string")return s.appName;const i=getBundleIdentifier();if(i&&i!=="org.reactjs.native.example"){const a=i.split("."),p=a[a.length-1];return p?p.charAt(0).toUpperCase()+p.slice(1):"App"}return"App"},getAppVersionAndBuild=()=>{let e="",t="";const n=u.NetworkInspectorModule;if(n&&(typeof n.appVersion=="string"&&n.appVersion.length>0&&(e=n.appVersion),typeof n.appBuild=="string"&&n.appBuild.length>0&&(t=n.appBuild)),!e||!t){const r=u.ExpoApplication;r&&(!e&&typeof r.nativeAppVersion=="string"&&(e=r.nativeAppVersion),!t&&typeof r.nativeBuildVersion=="string"&&(t=r.nativeBuildVersion))}if(!e||!t){const r=u.ExponentConstants;if(r){const o=r.manifest||r.expoConfig;o&&(!e&&o.version&&(e=String(o.version)),t||(o.ios?.buildNumber?t=String(o.ios.buildNumber):o.android?.versionCode&&(t=String(o.android.versionCode))))}}if(!e||!t){const r=u.RNDeviceInfo;if(r){if(!e){if(typeof r.appVersion=="string")e=r.appVersion;else if(typeof r.getVersion=="function")try{e=r.getVersion()}catch{}}if(!t){if(typeof r.buildNumber=="string")t=r.buildNumber;else if(typeof r.getBuildNumber=="function")try{t=r.getBuildNumber()}catch{}}}}if(!e||!t){const r=u.AppInfo;r&&(!e&&typeof r.versionName=="string"&&(e=r.versionName),!t&&typeof r.versionCode=="string"&&(t=r.versionCode))}if(!e){const r=b.constants||u.PlatformConstants;r&&r.Version&&typeof r.Version=="string"&&r.Version.includes(".")&&(e=r.Version)}return e||(e="1.0"),t||(t="1"),{version:e,build:t,formatted:`${e} (${t})`}},handleOpenExternalLink=e=>{if(!e)return;const t=formatDisplayUrl(e);P.alert("Open Link",`Do you want to open this link in your web browser?
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
${t}`,[{text:"Cancel",style:"cancel"},{text:"Open",onPress:()=>{y.openURL(t).catch(()=>{})}}])},formatTimeShort=e=>{const t=new Date(e),n=String(t.getHours()).padStart(2,"0"),r=String(t.getMinutes()).padStart(2,"0"),o=String(t.getSeconds()).padStart(2,"0");return`${n}:${r}:${o}`},formatTime=e=>{const t=new Date(e),n=String(t.getHours()).padStart(2,"0"),r=String(t.getMinutes()).padStart(2,"0"),o=String(t.getSeconds()).padStart(2,"0"),s=String(t.getMilliseconds()).padStart(3,"0");return`${n}:${r}:${o}.${s}`},formatGap=e=>{if(e<1e3)return`+${e}ms`;const t=Math.round(e/1e3);if(t<60)return`+${t}s`;const n=Math.floor(t/60),r=t%60;return r>0?`+${n}m ${r}s`:`+${n}m`},getJsonContent=e=>{if(!e)return null;const t=[];for(let n=0;n<e.length;n++)(e[n]==="{"||e[n]==="[")&&t.push(n);for(const n of t){const r=e.substring(n).trim();try{const o=JSON.parse(r);if(o!==null&&typeof o=="object")return{header:e.substring(0,n).trim(),data:o}}catch{}}return null},getJsonPreviewText=(e,t=4)=>{try{const n=JSON.stringify(e,null,2),r=n.split(`
|
|
5
|
+
${t}`,[{text:"Cancel",style:"cancel"},{text:"Open",onPress:()=>{x.openURL(t).catch(()=>{})}}])},formatTimeShort=e=>{const t=new Date(e),n=String(t.getHours()).padStart(2,"0"),r=String(t.getMinutes()).padStart(2,"0"),o=String(t.getSeconds()).padStart(2,"0");return`${n}:${r}:${o}`},formatTime=e=>{const t=new Date(e),n=String(t.getHours()).padStart(2,"0"),r=String(t.getMinutes()).padStart(2,"0"),o=String(t.getSeconds()).padStart(2,"0"),s=String(t.getMilliseconds()).padStart(3,"0");return`${n}:${r}:${o}.${s}`},formatGap=e=>{if(e<1e3)return`+${e}ms`;const t=Math.round(e/1e3);if(t<60)return`+${t}s`;const n=Math.floor(t/60),r=t%60;return r>0?`+${n}m ${r}s`:`+${n}m`},getJsonContent=e=>{if(!e)return null;const t=[];for(let n=0;n<e.length;n++)(e[n]==="{"||e[n]==="[")&&t.push(n);for(const n of t){const r=e.substring(n).trim();try{const o=JSON.parse(r);if(o!==null&&typeof o=="object")return{header:e.substring(0,n).trim(),data:o}}catch{}}return null},getJsonPreviewText=(e,t=4)=>{try{const n=JSON.stringify(e,null,2),r=n.split(`
|
|
8
6
|
`);return r.length>t?{text:r.slice(0,t).join(`
|
|
9
7
|
`)+`
|
|
10
|
-
...`,hasMore:!0}:{text:n,hasMore:!1}}catch{return{text:String(e),hasMore:!1}}},parseStackLine=(e,t=!1)=>{let n=e.trim().replace(/^at /,"");if(n.includes("@")){const
|
|
8
|
+
...`,hasMore:!0}:{text:n,hasMore:!1}}catch{return{text:String(e),hasMore:!1}}},parseStackLine=(e,t=!1)=>{let n=e.trim().replace(/^at /,"");if(n.includes("@")){const A=n.indexOf("@"),B=n.substring(0,A).trim(),L=n.substring(A+1).trim();n=B?`${B} (${L})`:L}const r=n.match(/^(.*?)\s*\((.*?)\)$/);let o="<anonymous>",s=n;r&&(o=r[1].trim()||"<anonymous>",s=r[2].trim()),(o.startsWith("?anon_")||o==="?")&&(o="anonymous"),s=s.replace(/^address at /,"");const i=s.match(/^(.*?):(\d+):(\d+)$/);let a=s,p,d;i&&(a=i[1],p=i[2],d=i[3]);let l=a.replace(/[?&].*$/,"").replace(/[)]+$/,"").replace(/\/\/+$/,"");l=l.replace(/^(?:https?:\/\/[^\/]+\/|file:\/\/\/|webpack:\/\/\/?)/,"");let f=l.split("/").filter(Boolean).pop()||l;f=f.replace(/[?&].*$/,"").replace(/[)]+$/,""),(f.startsWith("&")||f.startsWith("?")||f.startsWith("platform=")||f.includes("platform=")||f.startsWith("dev=")||f.includes("dev="))&&(f="Unknown",l="Unknown");const S=f.match(/\.([a-z0-9]+)$/i),m=S?S[1].toLowerCase():"",g=m==="tsx"||m==="jsx"||m==="ts"||m==="js"?m:"other",$=s==="native"||l==="native",v=l.includes("InternalBytecode")||l.includes("metro-runtime")||l.includes("regenerator-runtime")||o==="tryCallOne"||o==="asyncGeneratorStep"||o==="_next"||o==="next"&&$,O=l.includes("node_modules")||l.includes("react-native/Libraries")||l.includes("react-native-inapp-inspector")&&!l.includes("/example/"),I=!$&&!v&&!O&&(g==="tsx"||g==="jsx"||g==="ts"||g==="js"||!f.includes(".bundle")&&f!=="Unknown"),R=I?"app":O?"dependency":$?"native":"runtime",U=v||$||o==="asyncGeneratorStep"||o==="_next";let h=l;h.includes("/example/")?h=h.substring(h.indexOf("/example/")+9):h.includes("/src/")?h=h.substring(h.indexOf("/src/")+1):h.includes("/node_modules/")&&(h=h.substring(h.indexOf("/node_modules/")+14));const _=p?`${f}:${p}${d?`:${d}`:""}`:f;return{raw:e,functionName:o,fileName:f,fullPath:h,rawFilePath:a,fileExt:g,frameType:R,isUserCode:I,isRuntimeNoise:U,lineNumber:p,columnNumber:d,isOrigin:t,copyableLocation:_}},getCleanCallerDisplay=e=>{if(!e||e==="Unknown"||e.trim()==="")return null;const t=e.trim();if(t.startsWith("&platform")||t.startsWith("?platform")||t.startsWith("&")||t.includes("&platform=")||t.includes("?platform=")){const s=t.match(/^(.*?)\s*[\(@]/);if(s&&s[1]&&!s[1].includes("&")&&!s[1].includes("platform")){const i=s[1].trim();if(i&&i!=="<anonymous>"&&i!=="anonymous"&&!i.startsWith("?anon_"))return{fileName:i,functionName:i,display:i}}return null}const n=parseStackLine(e,!0);if(!n)return null;if(n.fileName.includes(".bundle")||n.fileName.includes("platform=")||n.fileName.startsWith("&")||n.fileName.startsWith("?")||n.fileName==="index.bundle"||n.fileName==="bundle"||n.fileName==="Unknown")return n.functionName&&n.functionName!=="<anonymous>"&&n.functionName!=="anonymous"&&!n.functionName.startsWith("?")&&!n.functionName.startsWith("_callee")&&!n.functionName.includes("regeneratorRuntime")?{fileName:n.functionName,lineNumber:n.lineNumber,functionName:n.functionName,display:n.functionName}:null;const o=n.lineNumber?`${n.fileName}:${n.lineNumber}`:n.fileName;return{fileName:n.fileName,lineNumber:n.lineNumber,functionName:n.functionName,display:o}},openInVSCode=(e,t,n)=>{const r=t?Number(t):1,o=n?Number(n):1,s=t?`:${t}`:"",i=n?`:${n}`:"",a=e.replace(/^file:\/\//,"");let p=null;try{const m=u?.SourceCode?.scriptURL||u?.PlatformConstants?.serverHost||u?.DevSettings?.serverHost;if(typeof m=="string"&&m.length>0){const g=m.match(/^(https?:\/\/[^/]+)/);g?p=g[1]:!m.startsWith("http")&&m.includes(":")&&(p=`http://${m}`)}}catch{}Array.from(new Set([...p?[p]:[],"http://localhost:8081","http://127.0.0.1:8081","http://10.0.2.2:8081"])).forEach(m=>{try{fetch(`${m}/open-stack-frame`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:a,lineNumber:r,column:o})}).catch(()=>{})}catch{}});const l=`vscode://file/${a.replace(/^\/+/,"")}${s}${i}`,f=`cursor://file/${a.replace(/^\/+/,"")}${s}${i}`,S=`vscode-insiders://file/${a.replace(/^\/+/,"")}${s}${i}`;x.openURL(l).catch(()=>{x.openURL(f).catch(()=>{x.openURL(S).catch(()=>{copyToClipboard(`${a}${s}${i}`,"Location")})})})},ANALYTICS_EVENT_PALETTE=[c.googleBlue,c.googleGreen,c.googlePurple,c.googleTeal,c.googleRed,c.googleOrange,c.blue700,c.materialGreen],getEventColor=e=>{const t=typeof e=="string"?e:String(e||"");let n=0;for(let r=0;r<t.length;r++)n=n*31+t.charCodeAt(r)|0;return ANALYTICS_EVENT_PALETTE[Math.abs(n)%ANALYTICS_EVENT_PALETTE.length]};export{getEventCategory,registerGAPlugin}from"./gaAnalyticsRegistry";export const getCategoryColors=e=>{switch(e){case"page_view":case"Page View":return{bg:c.blueBg,border:c.blueBorder,text:c.blue800};case"ecommerce":case"Ecommerce":return{bg:c.greenBg,border:c.greenBorder,text:c.materialGreen};case"system":case"System":return{bg:c.greyBg,border:c.greyBorder,text:c.grey600};default:return{bg:c.purpleBg,border:c.purpleBorder,text:c.purpleText}}},getRuntimeDiagnostics=()=>{const e=typeof global.HermesInternal<"u",t=typeof global._v8runtime<"u",n=e?"hermes":t?"v8":"jsc",o=typeof global.nativeFabricUIManager<"u"||!!global.__turboModuleProxy?"fabric":"paper";let s=32.4,i=64;try{const a=global.HermesInternal?.getInstrumentedStats?.();a?.js_heap_size?(s=Number((a.js_heap_size/(1024*1024)).toFixed(1)),i=Number(((a.js_allocated_bytes||a.js_heap_size*1.6)/(1024*1024)).toFixed(1))):global.performance?.memory?.usedJSHeapSize&&(s=Number((global.performance.memory.usedJSHeapSize/(1024*1024)).toFixed(1)),i=Number((global.performance.memory.totalJSHeapSize/(1024*1024)).toFixed(1)))}catch{}return{engineType:n,archType:o,usedHeapMb:s,totalAllocMb:i}},isUrlHidden=(e,t)=>{if(!e||!t||t.length===0)return!1;const n=e.trim();if(!n)return!1;const r=n.toLowerCase();for(let o=0;o<t.length;o++){const s=t[o]?.trim();if(!s)continue;const i=s.toLowerCase();if(r.includes(i))return!0;const a=i.replace(/^https?:\/\//,""),p=r.replace(/^https?:\/\//,"");if(a&&p.includes(a))return!0;if(s.includes("*"))try{const d=s.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");if(new RegExp(d,"i").test(n))return!0}catch{}try{if(new RegExp(s,"i").test(n))return!0}catch{}}return!1};
|
|
@@ -5,3 +5,4 @@ export interface SearchQueryOptions {
|
|
|
5
5
|
isCaseSensitive?: boolean;
|
|
6
6
|
}
|
|
7
7
|
export declare function matchNetworkLogQuery(log: NetworkLog, searchQuery: string, routePath?: string, options?: SearchQueryOptions): boolean;
|
|
8
|
+
export declare function scoreNetworkLogQuery(log: NetworkLog, searchQuery: string, routePath?: string, options?: SearchQueryOptions): number;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import{markSearchFilterUsed as
|
|
2
|
-
`):
|
|
3
|
-
`)},
|
|
4
|
-
${
|
|
5
|
-
${
|
|
1
|
+
import{markSearchFilterUsed as _}from"./telemetry";const A=new Set(["via","nel","report-to","reporting-endpoints","cf-ray","cf-cache-status","alt-svc","server","etag","date","x-powered-by","x-request-id","x-content-type-options","accept-ranges","transfer-encoding","connection","keep-alive"]);function J(t){const h=[],B=/[^\s"']+|"([^"]*)"|'([^']*)'/g;let p;for(;(p=B.exec(t))!==null;)p[1]!=null?h.push(p[1]):p[2]!=null?h.push(p[2]):p[0]&&h.push(p[0]);return h}export function matchNetworkLogQuery(t,h,B,p){if(!h||h.trim().length===0)return!0;_();const I=!!p?.isCaseSensitive,P=!!p?.isRegex,v=p?.scope||"all",x=t.method||"",O=t.url||"",R=t.status!=null?String(t.status):"pending",m=typeof t.status=="number"?t.status:t.status!=null?parseInt(String(t.status),10):null,N=t.client||"",q=t.caller||"",W=B||t?.routeInfo?.path||"",H=o=>{if(o==null)return"";if(typeof o=="string")return o;try{return JSON.stringify(o)}catch{return""}},$=H(t.request),j=H(t.response),b=(o,w=!1)=>{if(!o||typeof o!="object")return"";const c=Object.entries(o);return w?c.map(([s,y])=>`${s}: ${y}`).join(`
|
|
2
|
+
`):c.filter(([s])=>!A.has(s.toLowerCase())).map(([s,y])=>`${s}: ${y}`).join(`
|
|
3
|
+
`)},L=b(t.requestHeaders,v==="headers"),g=b(t.responseHeaders,v==="headers"),u=(o=>{switch(o){case"url":return O;case"reqBody":return $;case"resBody":return j;case"headers":return`${L}
|
|
4
|
+
${g}`;default:return[O,x,R,W,N,q,$,j,L,g].join(" ")}})(v),r=(o,w)=>{if(P)try{return new RegExp(w,I?"":"i").test(o)}catch{}return I?o.includes(w):o.toLowerCase().includes(w.toLowerCase())},S=J(h);return S.length===0?!0:S.every(o=>{let w=!1,c=o;if(c.length>1&&(c.startsWith("-")||c.startsWith("!"))&&(w=!0,c=c.slice(1)),!c)return!0;let s=!1;const y=c.indexOf(":");if(y>0){const n=c.slice(0,y).toLowerCase(),f=c.slice(y+1);if(n==="url"||n==="u"||n==="path")s=r(O,f);else if(n==="method"||n==="m")s=r(x,f);else if(n==="status"||n==="s")if(f==="error"||f==="failed"||f==="err")s=t.status===0||m!==null&&m>=400;else if(f==="success"||f==="ok")s=m!==null&&m>=200&&m<300;else if(f.endsWith("xx")){const k=f[0];s=R.startsWith(k)}else s=R.includes(f);else if(n==="header"||n==="h"){const k=`${b(t.requestHeaders,!0)}
|
|
5
|
+
${b(t.responseHeaders,!0)}`;s=r(k,f)}else n==="body"||n==="b"?s=r($,f)||r(j,f):n==="client"||n==="c"?s=r(N,f):n==="page"||n==="p"?s=r(W,f):s=r(u,c)}else{const n=c.toLowerCase();n==="error"||n==="failed"||n==="err"||n==="fail"?s=t.status===0||m!==null&&m>=400||r(u,c):n==="success"||n==="ok"||n==="2xx"?s=m!==null&&m>=200&&m<300||r(u,c):/^[1-5]xx$/.test(n)?s=R.startsWith(n[0]):s=r(u,c)}return w?!s:s})}export function scoreNetworkLogQuery(t,h,B,p){if(!h||h.trim().length===0)return 0;const I=!!p?.isCaseSensitive,P=p?.scope||"all",v=(t.method||"").trim(),x=(t.url||"").trim(),O=t.status!=null?String(t.status):"pending",R=t.client||"",m=t.caller||"",N=B||t?.routeInfo?.path||"";let q=x,W="",H="";try{const l=x.indexOf("?"),i=l>=0?x.slice(0,l):x;W=l>=0?x.slice(l+1):"";const C=i.indexOf("://"),a=C>=0?i.slice(C+3):i,d=a.indexOf("/");q=d>=0?a.slice(d):a;const T=q.split("/").filter(Boolean);H=T[T.length-1]||""}catch{q=x,H=x}const $=l=>{if(l==null)return"";if(typeof l=="string")return l;try{return JSON.stringify(l)}catch{return""}},j=$(t.request),b=$(t.response),L=(l,i=!1)=>{if(!l||typeof l!="object")return"";const C=Object.entries(l);return i?C.map(([a,d])=>`${a}: ${d}`).join(`
|
|
6
|
+
`):C.filter(([a])=>!A.has(a.toLowerCase())).map(([a,d])=>`${a}: ${d}`).join(`
|
|
7
|
+
`)},g=L(t.requestHeaders,P==="headers"),M=L(t.responseHeaders,P==="headers"),u=l=>I?l:l.toLowerCase(),r=u(h.trim()),S=u(H),o=u(q),w=u(x),c=u(v),s=u(O),y=u(N),n=u(R),f=u(m),k=u(W),E=u(g),U=u(M),z=u(j),F=u(b);let e=0;return S===r?e+=500:S.startsWith(r)?e+=350:S.includes(r)&&(e+=250),o===r?e+=400:o.includes(r)&&(e+=180),w.includes(r)&&(e+=120),c===r&&(e+=100),s===r&&(e+=90),y.includes(r)&&(e+=80),k.includes(r)&&(e+=60),E.includes(r)&&(e+=40),z.includes(r)&&(e+=30),U.includes(r)&&(e+=20),F.includes(r)&&(e+=5),J(h).forEach(l=>{if(!l||l.startsWith("-")||l.startsWith("!"))return;const i=u(l),C=i.indexOf(":");if(C>0){const a=i.slice(0,C),d=i.slice(C+1);a==="url"||a==="u"||a==="path"?o.includes(d)?e+=150:w.includes(d)&&(e+=100):a==="method"||a==="m"?c===d&&(e+=150):a==="status"||a==="s"?s.includes(d)&&(e+=150):a==="body"||a==="b"?(z.includes(d)&&(e+=80),F.includes(d)&&(e+=40)):(a==="header"||a==="h")&&(E.includes(d)||U.includes(d))&&(e+=80);return}S===i?e+=150:S.startsWith(i)?e+=100:S.includes(i)&&(e+=70),o.includes(i)?e+=40:w.includes(i)&&(e+=25),c===i&&(e+=50),s===i&&(e+=40),y.includes(i)&&(e+=30),(n.includes(i)||f.includes(i))&&(e+=20),E.includes(i)&&(e+=15),z.includes(i)&&(e+=10),U.includes(i)&&(e+=8),F.includes(i)&&(e+=2)}),e}
|
|
@@ -28,3 +28,19 @@ export declare function generateConsoleLogsFilename(format?: ConsoleLogExportFor
|
|
|
28
28
|
export declare function formatConsoleLogsExport(logs: ConsoleLog[], format?: ConsoleLogExportFormat, options?: ConsoleLogExportOptions): string;
|
|
29
29
|
export declare function estimateConsoleLogsExportSize(logs: ConsoleLog[], format?: ConsoleLogExportFormat, options?: ConsoleLogExportOptions): number;
|
|
30
30
|
export declare function shareConsoleLogs(logs: ConsoleLog[], format?: ConsoleLogExportFormat, options?: ConsoleLogExportOptions, customTitle?: string): Promise<void>;
|
|
31
|
+
export type NetworkLogExportFormat = 'txt' | 'log' | 'json' | 'curl';
|
|
32
|
+
export interface NetworkLogExportOptions {
|
|
33
|
+
includeRequestHeaders?: boolean;
|
|
34
|
+
includeRequestBody?: boolean;
|
|
35
|
+
includeResponseHeaders?: boolean;
|
|
36
|
+
includeResponseBody?: boolean;
|
|
37
|
+
includeCurlCommand?: boolean;
|
|
38
|
+
includeTimestamps?: boolean;
|
|
39
|
+
includeAppInfo?: boolean;
|
|
40
|
+
ignorePattern?: string;
|
|
41
|
+
}
|
|
42
|
+
export declare const DEFAULT_NETWORK_EXPORT_OPTIONS: NetworkLogExportOptions;
|
|
43
|
+
export declare function generateNetworkLogsFilename(format?: NetworkLogExportFormat): string;
|
|
44
|
+
export declare function formatNetworkLogsExport(logs: NetworkLog[], format?: NetworkLogExportFormat, options?: NetworkLogExportOptions): string;
|
|
45
|
+
export declare function estimateNetworkLogsExportSize(logs: NetworkLog[], format?: NetworkLogExportFormat, options?: NetworkLogExportOptions): number;
|
|
46
|
+
export declare function shareNetworkLogs(logs: NetworkLog[], format?: NetworkLogExportFormat, options?: NetworkLogExportOptions, customTitle?: string): Promise<void>;
|