react-native-inapp-inspector 2.4.0 → 2.4.2
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/README.ar.md +163 -0
- package/README.de.md +163 -0
- package/README.es.md +164 -0
- package/README.fr.md +163 -0
- package/README.hi.md +163 -0
- package/README.ja.md +180 -0
- package/README.ko.md +163 -0
- package/README.md +340 -243
- package/README.pt-BR.md +163 -0
- package/README.ru.md +163 -0
- package/README.zh-CN.md +387 -0
- package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +82 -21
- package/assets/banner_dark.svg +186 -0
- package/assets/banner_light.svg +186 -0
- package/assets/icon_circle.svg +148 -0
- package/assets/icon_square.svg +369 -0
- package/assets/inapp_inspector_icon.gif +0 -0
- package/assets/inapp_inspector_icon_original.gif +0 -0
- package/assets/social_preview.png +0 -0
- package/assets/walkthrough.gif +0 -0
- package/dist/commonjs/components/AnimatedBrandOwl.d.ts +7 -0
- package/dist/commonjs/components/AnimatedBrandOwl.js +175 -0
- package/dist/commonjs/components/AppHeaderLogo.d.ts +1 -0
- package/dist/commonjs/components/AppHeaderLogo.js +7 -5
- package/dist/commonjs/components/BrandSquareIcon.d.ts +5 -0
- package/dist/commonjs/components/BrandSquareIcon.js +139 -0
- package/dist/commonjs/components/ConsoleLogCard.d.ts +2 -1
- package/dist/commonjs/components/ConsoleLogCard.js +23 -39
- package/dist/commonjs/components/Inspector/AboutModal.js +44 -54
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +16 -16
- package/dist/commonjs/components/Inspector/ConfirmationModal.d.ts +13 -0
- package/dist/commonjs/components/Inspector/ConfirmationModal.js +32 -0
- package/dist/commonjs/components/Inspector/ConsoleTab.js +15 -15
- package/dist/commonjs/components/Inspector/CrashTab.js +25 -23
- package/dist/commonjs/components/Inspector/DebuggingTab.js +17 -17
- package/dist/commonjs/components/Inspector/FabLauncher.js +22 -30
- package/dist/commonjs/components/Inspector/FeatureUnderDevNotice.js +2 -2
- package/dist/commonjs/components/Inspector/LanguageSelectorModal.d.ts +15 -0
- package/dist/commonjs/components/Inspector/LanguageSelectorModal.js +90 -0
- package/dist/commonjs/components/Inspector/MainScreen.js +46 -33
- package/dist/commonjs/components/Inspector/MediaGalleryTab.js +21 -19
- package/dist/commonjs/components/Inspector/MediaPreviewModal.js +85 -101
- package/dist/commonjs/components/Inspector/NetworkTab.js +50 -50
- package/dist/commonjs/components/Inspector/NpmUpdateToast.js +1 -1
- package/dist/commonjs/components/Inspector/PushCard.d.ts +3 -2
- package/dist/commonjs/components/Inspector/PushCard.js +5 -4
- package/dist/commonjs/components/Inspector/PushDetail.js +32 -23
- package/dist/commonjs/components/Inspector/PushTab.js +13 -13
- package/dist/commonjs/components/Inspector/ReduxDetail.js +32 -32
- package/dist/commonjs/components/Inspector/ReduxTab.js +14 -14
- package/dist/commonjs/components/Inspector/SettingsPanel.js +258 -139
- package/dist/commonjs/components/Inspector/SocketCard.d.ts +5 -0
- package/dist/commonjs/components/Inspector/SocketCard.js +116 -0
- package/dist/commonjs/components/Inspector/SocketDetail.d.ts +4 -0
- package/dist/commonjs/components/Inspector/SocketDetail.js +317 -0
- package/dist/commonjs/components/Inspector/SocketFilterModal.d.ts +13 -0
- package/dist/commonjs/components/Inspector/SocketFilterModal.js +69 -0
- package/dist/commonjs/components/Inspector/SocketTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/SocketTab.js +112 -0
- package/dist/commonjs/components/Inspector/StorageTab.js +34 -32
- package/dist/commonjs/components/Inspector/SupportModal.d.ts +7 -0
- package/dist/commonjs/components/Inspector/SupportModal.js +125 -0
- package/dist/commonjs/components/Inspector/SupportPage.d.ts +5 -0
- package/dist/commonjs/components/Inspector/SupportPage.js +227 -0
- package/dist/commonjs/components/Inspector/TabBar.js +24 -23
- package/dist/commonjs/components/Inspector/UpdateAvailableModal.js +24 -24
- package/dist/commonjs/components/JsonViewer.js +7 -7
- package/dist/commonjs/components/LogCard.d.ts +3 -2
- package/dist/commonjs/components/LogCard.js +17 -14
- package/dist/commonjs/components/LogSyntaxHighlighter.js +5 -5
- package/dist/commonjs/components/ModuleErrorBoundary.js +2 -2
- package/dist/commonjs/components/NetworkIcons.d.ts +15 -0
- package/dist/commonjs/components/NetworkIcons.js +38 -3
- package/dist/commonjs/components/SegmentedTabs.js +1 -1
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/socketLogger.d.ts +26 -0
- package/dist/commonjs/customHooks/socketLogger.js +2 -0
- package/dist/commonjs/helpers/index.js +3 -3
- package/dist/commonjs/helpers/memoryManager.d.ts +1 -0
- package/dist/commonjs/helpers/memoryManager.js +1 -1
- package/dist/commonjs/helpers/searchQueryParser.d.ts +1 -1
- package/dist/commonjs/helpers/searchQueryParser.js +5 -1
- package/dist/commonjs/helpers/settingsStore.d.ts +1 -0
- package/dist/commonjs/helpers/settingsStore.js +1 -1
- package/dist/commonjs/helpers/shareFormatter.d.ts +3 -1
- package/dist/commonjs/helpers/shareFormatter.js +8 -7
- package/dist/commonjs/i18n/index.d.ts +99 -1
- package/dist/commonjs/i18n/index.js +1 -1
- package/dist/commonjs/i18n/locales/ar.json +1 -1
- package/dist/commonjs/i18n/locales/bn.json +1 -0
- 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 -0
- package/dist/commonjs/i18n/locales/hi.json +1 -1
- package/dist/commonjs/i18n/locales/id.json +1 -0
- package/dist/commonjs/i18n/locales/it.json +1 -0
- package/dist/commonjs/i18n/locales/ja.json +1 -1
- package/dist/commonjs/i18n/locales/kn.json +1 -0
- package/dist/commonjs/i18n/locales/ko.json +1 -1
- package/dist/commonjs/i18n/locales/ml.json +1 -0
- package/dist/commonjs/i18n/locales/mr.json +1 -0
- package/dist/commonjs/i18n/locales/nl.json +1 -0
- package/dist/commonjs/i18n/locales/pa.json +1 -0
- package/dist/commonjs/i18n/locales/pl.json +1 -0
- 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 -0
- package/dist/commonjs/i18n/locales/te.json +1 -0
- package/dist/commonjs/i18n/locales/tr.json +1 -0
- package/dist/commonjs/i18n/locales/vi.json +1 -0
- package/dist/commonjs/i18n/locales/zh.json +1 -1
- package/dist/commonjs/index.d.ts +13 -13
- package/dist/commonjs/index.js +5 -4
- package/dist/commonjs/native/NativeInspector.d.ts +1 -0
- package/dist/commonjs/socket.d.ts +4 -0
- package/dist/commonjs/socket.js +1 -0
- package/dist/commonjs/styles/index.d.ts +23 -0
- package/dist/commonjs/styles/index.js +1 -1
- package/dist/commonjs/types/enums.d.ts +40 -0
- package/dist/commonjs/types/enums.js +1 -1
- package/dist/commonjs/types/interfaces.d.ts +122 -1
- package/dist/esm/components/AnimatedBrandOwl.d.ts +7 -0
- package/dist/esm/components/AnimatedBrandOwl.js +175 -0
- package/dist/esm/components/AppHeaderLogo.d.ts +1 -0
- package/dist/esm/components/AppHeaderLogo.js +7 -5
- package/dist/esm/components/BrandSquareIcon.d.ts +5 -0
- package/dist/esm/components/BrandSquareIcon.js +139 -0
- package/dist/esm/components/ConsoleLogCard.d.ts +2 -1
- package/dist/esm/components/ConsoleLogCard.js +61 -77
- package/dist/esm/components/Inspector/AboutModal.js +85 -95
- package/dist/esm/components/Inspector/AnalyticsTab.js +31 -31
- package/dist/esm/components/Inspector/ConfirmationModal.d.ts +13 -0
- package/dist/esm/components/Inspector/ConfirmationModal.js +32 -0
- package/dist/esm/components/Inspector/ConsoleTab.js +49 -49
- package/dist/esm/components/Inspector/CrashTab.js +40 -38
- package/dist/esm/components/Inspector/DebuggingTab.js +29 -29
- package/dist/esm/components/Inspector/FabLauncher.js +50 -58
- package/dist/esm/components/Inspector/FeatureUnderDevNotice.js +7 -7
- package/dist/esm/components/Inspector/LanguageSelectorModal.d.ts +15 -0
- package/dist/esm/components/Inspector/LanguageSelectorModal.js +90 -0
- package/dist/esm/components/Inspector/MainScreen.js +123 -110
- package/dist/esm/components/Inspector/MediaGalleryTab.js +64 -62
- package/dist/esm/components/Inspector/MediaPreviewModal.js +107 -123
- package/dist/esm/components/Inspector/NetworkTab.js +90 -90
- package/dist/esm/components/Inspector/NpmUpdateToast.js +1 -1
- package/dist/esm/components/Inspector/PushCard.d.ts +3 -2
- package/dist/esm/components/Inspector/PushCard.js +23 -22
- package/dist/esm/components/Inspector/PushDetail.js +34 -25
- package/dist/esm/components/Inspector/PushTab.js +25 -25
- package/dist/esm/components/Inspector/ReduxDetail.js +42 -42
- package/dist/esm/components/Inspector/ReduxTab.js +35 -35
- package/dist/esm/components/Inspector/SettingsPanel.js +495 -376
- package/dist/esm/components/Inspector/SocketCard.d.ts +5 -0
- package/dist/esm/components/Inspector/SocketCard.js +116 -0
- package/dist/esm/components/Inspector/SocketDetail.d.ts +4 -0
- package/dist/esm/components/Inspector/SocketDetail.js +317 -0
- package/dist/esm/components/Inspector/SocketFilterModal.d.ts +13 -0
- package/dist/esm/components/Inspector/SocketFilterModal.js +69 -0
- package/dist/esm/components/Inspector/SocketTab.d.ts +3 -0
- package/dist/esm/components/Inspector/SocketTab.js +112 -0
- package/dist/esm/components/Inspector/StorageTab.js +136 -134
- package/dist/esm/components/Inspector/SupportModal.d.ts +7 -0
- package/dist/esm/components/Inspector/SupportModal.js +125 -0
- package/dist/esm/components/Inspector/SupportPage.d.ts +5 -0
- package/dist/esm/components/Inspector/SupportPage.js +227 -0
- package/dist/esm/components/Inspector/TabBar.js +36 -35
- package/dist/esm/components/Inspector/UpdateAvailableModal.js +22 -22
- package/dist/esm/components/JsonViewer.js +55 -55
- package/dist/esm/components/LogCard.d.ts +3 -2
- package/dist/esm/components/LogCard.js +61 -58
- package/dist/esm/components/LogSyntaxHighlighter.js +5 -5
- package/dist/esm/components/ModuleErrorBoundary.js +23 -23
- package/dist/esm/components/NetworkIcons.d.ts +15 -0
- package/dist/esm/components/NetworkIcons.js +38 -3
- package/dist/esm/components/SegmentedTabs.js +7 -7
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/socketLogger.d.ts +26 -0
- package/dist/esm/customHooks/socketLogger.js +2 -0
- package/dist/esm/helpers/index.js +3 -3
- package/dist/esm/helpers/memoryManager.d.ts +1 -0
- package/dist/esm/helpers/memoryManager.js +1 -1
- package/dist/esm/helpers/searchQueryParser.d.ts +1 -1
- package/dist/esm/helpers/searchQueryParser.js +5 -1
- package/dist/esm/helpers/settingsStore.d.ts +1 -0
- package/dist/esm/helpers/settingsStore.js +1 -1
- package/dist/esm/helpers/shareFormatter.d.ts +3 -1
- package/dist/esm/helpers/shareFormatter.js +8 -7
- package/dist/esm/i18n/index.d.ts +99 -1
- package/dist/esm/i18n/index.js +1 -1
- package/dist/esm/i18n/locales/ar.json +1 -1
- package/dist/esm/i18n/locales/bn.json +1 -0
- 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 -0
- package/dist/esm/i18n/locales/hi.json +1 -1
- package/dist/esm/i18n/locales/id.json +1 -0
- package/dist/esm/i18n/locales/it.json +1 -0
- package/dist/esm/i18n/locales/ja.json +1 -1
- package/dist/esm/i18n/locales/kn.json +1 -0
- package/dist/esm/i18n/locales/ko.json +1 -1
- package/dist/esm/i18n/locales/ml.json +1 -0
- package/dist/esm/i18n/locales/mr.json +1 -0
- package/dist/esm/i18n/locales/nl.json +1 -0
- package/dist/esm/i18n/locales/pa.json +1 -0
- package/dist/esm/i18n/locales/pl.json +1 -0
- 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 -0
- package/dist/esm/i18n/locales/te.json +1 -0
- package/dist/esm/i18n/locales/tr.json +1 -0
- package/dist/esm/i18n/locales/vi.json +1 -0
- package/dist/esm/i18n/locales/zh.json +1 -1
- package/dist/esm/index.d.ts +13 -13
- package/dist/esm/index.js +8 -7
- package/dist/esm/native/NativeInspector.d.ts +1 -0
- package/dist/esm/socket.d.ts +4 -0
- package/dist/esm/socket.js +1 -0
- package/dist/esm/styles/index.d.ts +23 -0
- package/dist/esm/styles/index.js +1 -1
- package/dist/esm/types/enums.d.ts +40 -0
- package/dist/esm/types/enums.js +1 -1
- package/dist/esm/types/interfaces.d.ts +122 -1
- package/ios/NetworkInspectorModule.mm +102 -12
- package/package.json +204 -2
- package/src/native/NativeInspector.ts +8 -0
|
@@ -47,6 +47,7 @@ export declare const DebugIcon: ({ color, size }: IconProps) => React.JSX.Elemen
|
|
|
47
47
|
export declare const SunIcon: ({ color, size }: IconProps) => React.JSX.Element;
|
|
48
48
|
export declare const MoonIcon: ({ color, size }: IconProps) => React.JSX.Element;
|
|
49
49
|
export { BrandCircleIcon } from './BrandCircleIcon';
|
|
50
|
+
export { BrandSquareIcon } from './BrandSquareIcon';
|
|
50
51
|
export declare const HtmlIcon: ({ color, size }: IconProps) => React.JSX.Element;
|
|
51
52
|
export declare const CssIcon: ({ color, size }: IconProps) => React.JSX.Element;
|
|
52
53
|
export declare const JsIcon: ({ color, size }: IconProps) => React.JSX.Element;
|
|
@@ -168,3 +169,17 @@ export declare const HeartFaceIcon: ({ color, size, }: IconProps) => React.JSX.E
|
|
|
168
169
|
export declare const BellIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
169
170
|
export declare const NotificationIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
170
171
|
export declare const CloudPushIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
172
|
+
export declare const SocketIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
173
|
+
export declare const WebsocketIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
174
|
+
export declare const SendFrameIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
175
|
+
export declare const ReceiveFrameIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
176
|
+
export declare const PingIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
177
|
+
export declare const BroadcastIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
178
|
+
export declare const VolumeIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
179
|
+
export declare const BuildingIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
180
|
+
export declare const ArrowUpIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
181
|
+
export declare const ArrowDownIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
182
|
+
export declare const SupportIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
183
|
+
export declare const HeartIcon: ({ color, size, fill, }: IconProps & {
|
|
184
|
+
fill?: string;
|
|
185
|
+
}) => React.JSX.Element;
|
|
@@ -80,8 +80,8 @@ import"react";import W,{Circle as M,Ellipse as T,Line as S,Path as L,Rect as B}f
|
|
|
80
80
|
<L d="M4 6h4M4 12h7M4 18h10"stroke={e}strokeWidth="2"strokeLinecap="round"/>
|
|
81
81
|
<L d="M18 18V6m0 0l-3 3m3-3l3 3"stroke={e}strokeWidth="2"strokeLinecap="round"strokeLinejoin="round"/>
|
|
82
82
|
</>}
|
|
83
|
-
</W>,ChevronIcon=({color:e=p.grayTextWeak,size:t=14,direction:I="down"})=>{let
|
|
84
|
-
<L d={
|
|
83
|
+
</W>,ChevronIcon=({color:e=p.grayTextWeak,size:t=14,direction:I="down"})=>{let m="M6 9l6 6 6-6";return I==="up"?m="M18 15l-6-6-6 6":I==="right"?m="M9 18l6-6-6-6":I==="left"&&(m="M15 18l-6-6 6-6"),<W width={t}height={t}viewBox="0 0 24 24"fill="none">
|
|
84
|
+
<L d={m}stroke={e}strokeWidth="2.5"strokeLinecap="round"strokeLinejoin="round"/>
|
|
85
85
|
</W>},FilterIcon=({color:e=p.grayTextWeak,size:t=18})=><W width={t}height={t}viewBox="0 0 24 24"fill="none">
|
|
86
86
|
<L d="M4 6h16M7 12h10M10 18h4"stroke={e}strokeWidth="2"strokeLinecap="round"strokeLinejoin="round"/>
|
|
87
87
|
</W>,DownloadIcon=({color:e=p.primaryLight,size:t=18})=><W width={t}height={t}viewBox="0 0 24 24"fill="none">
|
|
@@ -114,7 +114,7 @@ import"react";import W,{Circle as M,Ellipse as T,Line as S,Path as L,Rect as B}f
|
|
|
114
114
|
<L d="M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"stroke={e}strokeWidth="2"strokeLinecap="round"/>
|
|
115
115
|
</W>,MoonIcon=({color:e=p.white,size:t=16})=><W width={t}height={t}viewBox="0 0 24 24"fill="none">
|
|
116
116
|
<L d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"fill={e}stroke={e}strokeWidth="1.5"strokeLinecap="round"strokeLinejoin="round"/>
|
|
117
|
-
</W>;export{BrandCircleIcon}from"./BrandCircleIcon";export const HtmlIcon=({color:e=p.grayTextWeak,size:t=14})=><W width={t}height={t}viewBox="0 0 24 24"fill="none">
|
|
117
|
+
</W>;export{BrandCircleIcon}from"./BrandCircleIcon";export{BrandSquareIcon}from"./BrandSquareIcon";export const HtmlIcon=({color:e=p.grayTextWeak,size:t=14})=><W width={t}height={t}viewBox="0 0 24 24"fill="none">
|
|
118
118
|
<L d="M17.5 8.5L21 12l-3.5 3.5M6.5 8.5L3 12l3.5 3.5M14 4.5l-4 15"stroke={e}strokeWidth="2.5"strokeLinecap="round"strokeLinejoin="round"/>
|
|
119
119
|
</W>,CssIcon=({color:e=p.grayTextWeak,size:t=14})=><W width={t}height={t}viewBox="0 0 24 24"fill="none">
|
|
120
120
|
<L d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"stroke={e}strokeWidth="2"strokeLinecap="round"strokeLinejoin="round"/>
|
|
@@ -537,4 +537,39 @@ import"react";import W,{Circle as M,Ellipse as T,Line as S,Path as L,Rect as B}f
|
|
|
537
537
|
</W>,NotificationIcon=BellIcon,CloudPushIcon=({color:e=p.brandPurple,size:t=20})=><W width={t}height={t}viewBox="0 0 24 24"fill="none">
|
|
538
538
|
<L d="M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z"stroke={e}strokeWidth="2"strokeLinecap="round"strokeLinejoin="round"/>
|
|
539
539
|
<L d="m12 13 3 3m0 0-3 3m3-3H7"stroke={e}strokeWidth="1.8"strokeLinecap="round"strokeLinejoin="round"/>
|
|
540
|
+
</W>,SocketIcon=({color:e=p.blue600,size:t=14})=><W width={t}height={t}viewBox="0 0 24 24"fill="none">
|
|
541
|
+
<L d="M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm0 18a8 8 0 1 1 8-8 8 8 0 0 1-8 8z"stroke={e}strokeWidth="1.8"strokeLinecap="round"strokeLinejoin="round"/>
|
|
542
|
+
<L d="M12 6v6l4 2"stroke={e}strokeWidth="1.8"strokeLinecap="round"strokeLinejoin="round"/>
|
|
543
|
+
<L d="M4.93 4.93l4.24 4.24m5.66 5.66l4.24 4.24"stroke={e}strokeWidth="1.6"strokeLinecap="round"strokeLinejoin="round"/>
|
|
544
|
+
</W>,WebsocketIcon=({color:e=p.blue600,size:t=14})=><W width={t}height={t}viewBox="0 0 24 24"fill="none">
|
|
545
|
+
<L d="M7 8h10M17 8l-3-3M17 8l-3 3"stroke={e}strokeWidth="2"strokeLinecap="round"strokeLinejoin="round"/>
|
|
546
|
+
<L d="M17 16H7M7 16l3-3M7 16l3 3"stroke={e}strokeWidth="2"strokeLinecap="round"strokeLinejoin="round"/>
|
|
547
|
+
<M cx="4"cy="8"r="1.5"fill={e}/>
|
|
548
|
+
<M cx="20"cy="16"r="1.5"fill={e}/>
|
|
549
|
+
</W>,SendFrameIcon=({color:e=p.blue600,size:t=12})=><W width={t}height={t}viewBox="0 0 24 24"fill="none">
|
|
550
|
+
<L d="m12 19V5m-7 7 7-7 7 7"stroke={e}strokeWidth="2.2"strokeLinecap="round"strokeLinejoin="round"/>
|
|
551
|
+
</W>,ReceiveFrameIcon=({color:e=p.emerald600,size:t=12})=><W width={t}height={t}viewBox="0 0 24 24"fill="none">
|
|
552
|
+
<L d="m12 5v14m-7-7 7 7 7-7"stroke={e}strokeWidth="2.2"strokeLinecap="round"strokeLinejoin="round"/>
|
|
553
|
+
</W>,PingIcon=({color:e=p.amber600,size:t=12})=><W width={t}height={t}viewBox="0 0 24 24"fill="none">
|
|
554
|
+
<L d="M22 12h-4l-3 9L9 3l-3 9H2"stroke={e}strokeWidth="2"strokeLinecap="round"strokeLinejoin="round"/>
|
|
555
|
+
</W>,BroadcastIcon=({color:e=p.brandPurple,size:t=14})=><W width={t}height={t}viewBox="0 0 24 24"fill="none">
|
|
556
|
+
<L d="M4.93 4.93a10 10 0 0 1 14.14 0M7.76 7.76a6 6 0 0 1 8.48 0"stroke={e}strokeWidth="2"strokeLinecap="round"/>
|
|
557
|
+
<M cx="12"cy="12"r="2"fill={e}/>
|
|
558
|
+
</W>,VolumeIcon=({color:e=p.violet600,size:t=14})=><W width={t}height={t}viewBox="0 0 24 24"fill="none">
|
|
559
|
+
<L d="M11 5L6 9H2v6h4l5 4V5zM19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.08"stroke={e}strokeWidth="2"strokeLinecap="round"strokeLinejoin="round"/>
|
|
560
|
+
</W>,BuildingIcon=({color:e=p.blue600,size:t=14})=><W width={t}height={t}viewBox="0 0 24 24"fill="none">
|
|
561
|
+
<L d="M3 21h18M5 21V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16M9 9h1M9 13h1M9 17h1M14 9h1M14 13h1M14 17h1"stroke={e}strokeWidth="2"strokeLinecap="round"strokeLinejoin="round"/>
|
|
562
|
+
</W>,ArrowUpIcon=({color:e=p.green600,size:t=12})=><W width={t}height={t}viewBox="0 0 24 24"fill="none">
|
|
563
|
+
<L d="M12 19V5M5 12l7-7 7 7"stroke={e}strokeWidth="2.5"strokeLinecap="round"strokeLinejoin="round"/>
|
|
564
|
+
</W>,ArrowDownIcon=({color:e=p.blue600,size:t=12})=><W width={t}height={t}viewBox="0 0 24 24"fill="none">
|
|
565
|
+
<L d="M12 5v14M19 12l-7 7-7-7"stroke={e}strokeWidth="2.5"strokeLinecap="round"strokeLinejoin="round"/>
|
|
566
|
+
</W>,SupportIcon=({color:e=p.white,size:t=14})=><W width={t}height={t}viewBox="0 0 24 24"fill="none">
|
|
567
|
+
<M cx="12"cy="12"r="9.5"stroke={e}strokeWidth="1.8"/>
|
|
568
|
+
<M cx="12"cy="12"r="4"stroke={e}strokeWidth="1.8"/>
|
|
569
|
+
<S x1="4.93"y1="4.93"x2="9.17"y2="9.17"stroke={e}strokeWidth="1.8"strokeLinecap="round"/>
|
|
570
|
+
<S x1="14.83"y1="9.17"x2="19.07"y2="4.93"stroke={e}strokeWidth="1.8"strokeLinecap="round"/>
|
|
571
|
+
<S x1="14.83"y1="14.83"x2="19.07"y2="19.07"stroke={e}strokeWidth="1.8"strokeLinecap="round"/>
|
|
572
|
+
<S x1="4.93"y1="19.07"x2="9.17"y2="14.83"stroke={e}strokeWidth="1.8"strokeLinecap="round"/>
|
|
573
|
+
</W>,HeartIcon=({color:e=p.red500,size:t=20,fill:I=e})=><W width={t}height={t}viewBox="0 0 24 24"fill="none">
|
|
574
|
+
<L d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"fill={I}/>
|
|
540
575
|
</W>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import A from"react";import{Pressable as R,ScrollView as V,Text as D,View as C}from"react-native";import{AppColors as e}from"../styles/AppColors";import{AppFonts as E}from"../styles/AppFonts";export const DEFAULT_INNER_TAB_THEMES={metadata:e.sky600,headers:e.teal600,request:e.amber600,response:e.brandPurple,req:e.amber600,res:e.brandPurple,output:e.teal600,arguments:e.amber600,stack:e.errorColor,caller:e.sky600,error:e.errorColor,app:e.green600,all:e.brandPurple,live:e.violet600,timeline:e.orange600,persisted:e.teal600,payload:e.violet600,diff:e.green600,raw:e.brandPurple,diagnostics:e.amber600,breadcrumbs:e.orange600,overview:e.sky600,json:e.brandPurple,tree:e.violet600,preview:e.brandPurple,delivery:e.amber600,domainAttrs:e.sky600,messages:e.violet600,params:e.teal600,code:e.amber600,pretty:e.violet600,table:e.teal600,production:e.brandPurple,files:e.teal600,packages:e.orange600,media:e.pink600,optimizer:e.violet600,hardware:e.orange600,network:e.teal600,display:e.pink600,runtime:e.amber600,security:e.errorColor,fatal:e.errorColor,promise:e.orange600,render:e.pink600,native:e.cyan600,js:e.amber600,asyncStorage:e.brandPurple,mmkv:e.teal600};const I=A.memo(({tabs:P,activeKey:x,onChange:S,style:i,scrollable:t})=>{const n=P.map(r=>{const o=x===r.key,a=r.themeColor||r.color||DEFAULT_INNER_TAB_THEMES[r.key]||e.brandPurple;return<R key={r.key}onPress={()=>S(r.key)}style={({pressed:T})=>[{flex:t?void 0:1,paddingVertical:7,paddingHorizontal:t?12:6,borderRadius:7,backgroundColor:o?a:"transparent",alignItems:"center",justifyContent:"center",gap:4.5,flexDirection:"row",opacity:T?.8:1},o&&{shadowColor:a,shadowOffset:{width:0,height:1},shadowOpacity:.28,shadowRadius:3,elevation:2}]}>
|
|
2
2
|
{r.icon?typeof r.icon=="function"?r.icon(o,a):r.icon:null}
|
|
3
|
-
<
|
|
3
|
+
<D numberOfLines={1}style={{fontFamily:E.interBold,fontSize:10.5,color:o?e.white:e.grayText,letterSpacing:.2}}>
|
|
4
4
|
{r.label}
|
|
5
|
-
</
|
|
6
|
-
</
|
|
7
|
-
<
|
|
5
|
+
</D>
|
|
6
|
+
</R>});return t?<C style={[{borderRadius:10,backgroundColor:`${e.slate200}80`,padding:3,borderWidth:1,borderColor:e.dividerColor},i]}>
|
|
7
|
+
<V horizontal showsHorizontalScrollIndicator={!1}contentContainerStyle={{flexDirection:"row",alignItems:"center",gap:4}}>
|
|
8
8
|
{n}
|
|
9
|
-
</
|
|
9
|
+
</V>
|
|
10
10
|
</C>:<C style={[{flexDirection:"row",borderRadius:10,backgroundColor:`${e.slate200}80`,padding:3,borderWidth:1,borderColor:e.dividerColor,gap:3,minWidth:0},i]}>
|
|
11
11
|
{n}
|
|
12
|
-
</C>});export default
|
|
12
|
+
</C>});export default I;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "2.4.
|
|
1
|
+
export declare const LIB_VERSION = "2.4.2";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const LIB_VERSION="2.4.
|
|
1
|
+
export const LIB_VERSION="2.4.2";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { SocketConnectionRecord, SocketFrame, SocketFrameDirection, SocketFrameType, RouteInfo } from '../types';
|
|
2
|
+
export declare const setSocketRouteInfoProvider: (provider: (() => RouteInfo | null) | null) => void;
|
|
3
|
+
export declare const setSocketModuleEnabled: (enabled: boolean) => void;
|
|
4
|
+
export declare const getSocketModuleEnabled: () => boolean;
|
|
5
|
+
export declare const setMaxSocketRecordsLimit: (limit: number) => void;
|
|
6
|
+
export declare const getMaxSocketRecordsLimit: () => number;
|
|
7
|
+
export declare function getSocketRecords(): SocketConnectionRecord[];
|
|
8
|
+
export declare function clearSocketRecords(): void;
|
|
9
|
+
export declare function deleteSocketRecord(id: string): void;
|
|
10
|
+
export declare function deleteMultipleSocketRecords(ids: string[]): void;
|
|
11
|
+
export declare function subscribeSocketRecords(callback: (records: SocketConnectionRecord[]) => void): () => void;
|
|
12
|
+
export declare function pruneSocketRecords(keepCount?: number): void;
|
|
13
|
+
interface ParsedPayloadInfo {
|
|
14
|
+
data: any;
|
|
15
|
+
type: SocketFrameType;
|
|
16
|
+
eventName?: string;
|
|
17
|
+
size: number;
|
|
18
|
+
}
|
|
19
|
+
export declare function analyzeSocketPayload(raw: any): ParsedPayloadInfo;
|
|
20
|
+
export declare function recordSocketConnection(url: string, options?: Partial<SocketConnectionRecord>): SocketConnectionRecord;
|
|
21
|
+
export declare function recordSocketFrame(socketId: string, rawPayload: any, direction?: SocketFrameDirection, options?: Partial<SocketFrame>): SocketFrame | null;
|
|
22
|
+
export declare function recordSocketClose(socketId: string, closeCode?: number, closeReason?: string): void;
|
|
23
|
+
export declare function recordSocketError(socketId: string, error: any): void;
|
|
24
|
+
export declare function setupSocketLogger(): void;
|
|
25
|
+
export declare function simulateTestSocket(preset?: 'chat' | 'crypto' | 'socketio' | 'echo' | 'custom', customData?: any): SocketConnectionRecord;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
let r=[],m=50,h=!0,b=!1,g=null;const S=new Set;export const setSocketRouteInfoProvider=e=>{g=e},setSocketModuleEnabled=e=>{h=e},getSocketModuleEnabled=()=>h,setMaxSocketRecordsLimit=e=>{m=Math.max(10,Math.min(500,e)),r.length>m&&(r=r.slice(0,m),d())},getMaxSocketRecordsLimit=()=>m;export function getSocketRecords(){return[...r]}export function clearSocketRecords(){r=[],d()}export function deleteSocketRecord(e){r=r.filter(t=>t.id!==e),d()}export function deleteMultipleSocketRecords(e){const t=new Set(e);r=r.filter(s=>!t.has(s.id)),d()}export function subscribeSocketRecords(e){return S.add(e),e([...r]),()=>{S.delete(e)}}export function pruneSocketRecords(e=25){r.length>e&&(r=r.slice(0,e),d())}function d(){const e=[...r];S.forEach(t=>{try{t(e)}catch{}})}function y(){return`ws_${Date.now()}_${Math.random().toString(36).substring(2,8)}`}function a(){return`f_${Date.now()}_${Math.random().toString(36).substring(2,7)}`}function z(){try{const e=new Error().stack;if(!e)return;const t=e.split(`
|
|
2
|
+
`);for(const s of t)if(!s.includes("socketLogger")&&!s.includes("NativeInspector")&&!s.includes("InspectorWebSocket")&&!s.includes("node_modules/react-native")&&!s.includes("node_modules/expo")&&s.includes(".js")||s.includes(".tsx")||s.includes(".ts")){const i=s.match(/(?:at\s+)?(?:(.+?)\s+\()?(.*?):(\d+):(\d+)\)?$/);if(i){const n=i[1]||"anonymous",u=i[2]?.split("/").pop()||i[2],l=i[3];return`${u}:${l} (${n})`}}}catch{}}function _(e){const t={};try{const s=e.indexOf("?");if(s>=0){const n=e.substring(s+1).split("#")[0].split("&");for(const u of n){const[l,p]=u.split("=");l&&(t[decodeURIComponent(l)]=p?decodeURIComponent(p):"")}}}catch{}return t}export function analyzeSocketPayload(e){if(e==null)return{data:null,type:"text",size:0};if(typeof e=="string"){const t=(new Blob,e.length);if(/^\d+/.test(e)){if(e.startsWith("2"))return{data:"ping",type:"ping",size:t};if(e.startsWith("3"))return{data:"pong",type:"pong",size:t};if(e.startsWith("42")||e.startsWith("43"))try{const i=e.substring(2),n=JSON.parse(i);if(Array.isArray(n)&&n.length>0){const u=typeof n[0]=="string"?n[0]:"socket.io",l=n.length>1?n.length===2?n[1]:n.slice(1):null;return{data:l!==null?l:n,type:"socket.io",eventName:u,size:t}}}catch{}if(e.startsWith("0"))try{return{data:JSON.parse(e.substring(1)),type:"socket.io",eventName:"handshake",size:t}}catch{}}const s=e.trim();if(s.startsWith("{")&&s.endsWith("}")||s.startsWith("[")&&s.endsWith("]"))try{return{data:JSON.parse(s),type:"json",size:t}}catch{}return{data:e,type:"text",size:t}}return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?{data:`[ArrayBuffer ${e.byteLength} bytes]`,type:"binary",size:e.byteLength}:typeof Uint8Array<"u"&&e instanceof Uint8Array?{data:`[Uint8Array ${e.byteLength} bytes]`,type:"binary",size:e.byteLength}:typeof Blob<"u"&&e instanceof Blob?{data:`[Blob ${e.size} bytes: ${e.type||"binary"}]`,type:"binary",size:e.size}:typeof e=="object"?{data:e,type:"json",size:JSON.stringify(e).length}:{data:String(e),type:"text",size:String(e).length}}export function recordSocketConnection(e,t){const s=_(e),i=e.includes("/socket.io")||t?.client==="socket.io",n={id:t?.id||y(),url:e,protocols:t?.protocols,readyState:t?.readyState??1,status:t?.status||"open",startTime:t?.startTime||Date.now(),client:t?.client||(i?"socket.io":"websocket"),frames:t?.frames||[],sentCount:t?.sentCount||0,receivedCount:t?.receivedCount||0,totalBytesSent:t?.totalBytesSent||0,totalBytesReceived:t?.totalBytesReceived||0,caller:t?.caller||z(),query:s,headers:t?.headers,routeInfo:t?.routeInfo||g&&g()||void 0};return r.unshift(n),r.length>m&&(r=r.slice(0,m)),d(),n}export function recordSocketFrame(e,t,s="send",i){const n=r.find(p=>p.id===e);if(!n)return null;const u=analyzeSocketPayload(t),l={id:i?.id||a(),timestamp:i?.timestamp||Date.now(),direction:s,type:i?.type||u.type,data:i?.data!==void 0?i.data:u.data,raw:t,size:i?.size!==void 0?i.size:u.size,eventName:i?.eventName||u.eventName,ackId:i?.ackId};return n.frames.push(l),s==="send"?(n.sentCount+=1,n.totalBytesSent+=l.size||0):(n.receivedCount+=1,n.totalBytesReceived+=l.size||0),d(),l}export function recordSocketClose(e,t=1e3,s="Normal closure"){const i=r.find(n=>n.id===e);i&&(i.readyState=3,i.status="closed",i.closeCode=t,i.closeReason=s,i.endTime=Date.now(),i.duration=i.endTime-i.startTime,d())}export function recordSocketError(e,t){const s=r.find(i=>i.id===e);s&&(s.status="error",s.error=typeof t=="string"?t:t?.message||"WebSocket error occurred",d())}const x=typeof global<"u"&&global.WebSocket?global.WebSocket:void 0;export function setupSocketLogger(){if(b||!x)return;class e extends x{constructor(s,i){const n=typeof s=="string"?s:s.toString();if(super(s,i),this._inspectorUrl=n,this._inspectorId=y(),h){const u=_(n),l=n.includes("/socket.io"),p={id:this._inspectorId,url:n,protocols:i,readyState:0,status:"connecting",startTime:Date.now(),client:l?"socket.io":"websocket",frames:[],sentCount:0,receivedCount:0,totalBytesSent:0,totalBytesReceived:0,caller:z(),query:u,routeInfo:g&&g()||void 0};r.unshift(p),r.length>m&&(r=r.slice(0,m)),d(),this.addEventListener("open",()=>{const o=r.find(c=>c.id===this._inspectorId);o&&(o.readyState=1,o.status="open",d())}),this.addEventListener("message",o=>{if(!h)return;const c=r.find(C=>C.id===this._inspectorId);if(!c)return;const f=o?.data,k=analyzeSocketPayload(f),v={id:a(),timestamp:Date.now(),direction:"receive",type:k.type,data:k.data,raw:f,size:k.size,eventName:k.eventName};c.frames.push(v),c.receivedCount+=1,c.totalBytesReceived+=v.size||0,d()}),this.addEventListener("error",o=>{const c=r.find(f=>f.id===this._inspectorId);c&&(c.status="error",c.error=o?.message||"WebSocket connection error",d())}),this.addEventListener("close",o=>{const c=r.find(f=>f.id===this._inspectorId);c&&(c.readyState=3,c.status="closed",c.closeCode=o?.code||1e3,c.closeReason=o?.reason||"Closed",c.endTime=Date.now(),c.duration=c.endTime-c.startTime,d())})}}send(s){if(h&&this._inspectorId){const i=r.find(n=>n.id===this._inspectorId);if(i){const n=analyzeSocketPayload(s),u={id:a(),timestamp:Date.now(),direction:"send",type:n.type,data:n.data,raw:s,size:n.size,eventName:n.eventName};i.frames.push(u),i.sentCount+=1,i.totalBytesSent+=u.size||0,d()}}super.send(s)}}e.CONNECTING=0,e.OPEN=1,e.CLOSING=2,e.CLOSED=3,global.WebSocket=e,b=!0}export function simulateTestSocket(e="chat",t){const s=Date.now();if(e==="chat"){const p=y(),o=s-18450,c={id:p,url:"wss://chat.example.com/v2/rooms/engineering?user=lead_dev",protocols:"chat.v2",readyState:1,status:"open",startTime:o,client:"websocket",sentCount:3,receivedCount:5,totalBytesSent:412,totalBytesReceived:890,caller:"ChatRoomScreen.tsx:84 (initChatWebSocket)",query:{user:"lead_dev",version:"2.0.4"},frames:[{id:a(),timestamp:o+120,direction:"send",type:"json",data:{action:"auth",token:"bearer_token_sec_99182",userId:"usr_81723"},size:78},{id:a(),timestamp:o+380,direction:"receive",type:"json",data:{status:"authenticated",room:"engineering",activeUsers:14},size:64},{id:a(),timestamp:o+2400,direction:"send",type:"json",data:{action:"send_message",message:"Hello team, the new release build is ready! \u{1F680}"},size:82},{id:a(),timestamp:o+3100,direction:"receive",type:"json",data:{user:"Sarah_QA",message:"Awesome! Starting regression tests on iOS 18 now.",timestamp:o+3090},size:114},{id:a(),timestamp:o+7500,direction:"receive",type:"json",data:{user:"Alex_Backend",message:"API response times look great on staging cluster.",timestamp:o+7490},size:98},{id:a(),timestamp:o+12e3,direction:"send",type:"ping",data:"ping",size:4},{id:a(),timestamp:o+12045,direction:"receive",type:"pong",data:"pong",size:4},{id:a(),timestamp:o+16200,direction:"receive",type:"json",data:{event:"typing_indicator",user:"David_Design",status:"typing"},size:56}]};return r.unshift(c),d(),c}if(e==="crypto"){const p=y(),o=s-45e3,c={id:p,url:"wss://stream.binance.com:9443/ws/btcusdt@ticker/ethusdt@ticker",protocols:void 0,readyState:1,status:"open",startTime:o,client:"websocket",sentCount:1,receivedCount:6,totalBytesSent:86,totalBytesReceived:2140,caller:"CryptoLiveTicker.tsx:42 (connectTickerStream)",query:{symbols:"btcusdt,ethusdt"},frames:[{id:a(),timestamp:o+80,direction:"send",type:"json",data:{method:"SUBSCRIBE",params:["btcusdt@ticker","ethusdt@ticker"],id:1},size:86},{id:a(),timestamp:o+250,direction:"receive",type:"json",data:{result:null,id:1},size:24},{id:a(),timestamp:o+1200,direction:"receive",type:"json",data:{s:"BTCUSDT",c:"92,450.00",h:"93,120.00",l:"90,800.00",v:"18420.45",q:"1702891240.50",P:"+2.45%"},size:142},{id:a(),timestamp:o+5400,direction:"receive",type:"json",data:{s:"ETHUSDT",c:"3,420.50",h:"3,480.00",l:"3,360.00",v:"84120.12",q:"287890124.00",P:"+1.82%"},size:138},{id:a(),timestamp:o+18e3,direction:"receive",type:"json",data:{s:"BTCUSDT",c:"92,610.00",h:"93,120.00",l:"90,800.00",v:"18650.10",q:"1724120890.00",P:"+2.62%"},size:142}]};return r.unshift(c),d(),c}if(e==="socketio"){const p=y(),o=s-32e3,c={id:p,url:"https://api.myapp.io/socket.io/?EIO=4&transport=websocket&sid=U9k1l_892Zq",readyState:1,status:"open",startTime:o,client:"socket.io",sentCount:3,receivedCount:4,totalBytesSent:280,totalBytesReceived:560,caller:"SocketIOClient.ts:62 (io.connect)",query:{EIO:"4",transport:"websocket",sid:"U9k1l_892Zq"},frames:[{id:a(),timestamp:o+90,direction:"receive",type:"socket.io",eventName:"handshake",data:{sid:"U9k1l_892Zq",upgrades:[],pingInterval:25e3,pingTimeout:2e4},size:96},{id:a(),timestamp:o+210,direction:"send",type:"socket.io",eventName:"connect_namespace",data:{token:"jwt_auth_pass_token_99"},size:54},{id:a(),timestamp:o+340,direction:"receive",type:"socket.io",eventName:"connect",data:{status:"ok",sid:"U9k1l_892Zq"},size:42},{id:a(),timestamp:o+4200,direction:"send",type:"socket.io",eventName:"subscribe_order_feed",data:{orderId:"ORD_99182",tenantId:"enterprise_gold"},size:72},{id:a(),timestamp:o+8900,direction:"receive",type:"socket.io",eventName:"order_status_updated",data:{orderId:"ORD_99182",status:"DISPATCHED",driverName:"Michael Brown",etaMinutes:12,location:{lat:37.7749,lng:-122.4194}},size:168},{id:a(),timestamp:o+25e3,direction:"send",type:"ping",data:"ping",size:4},{id:a(),timestamp:o+25032,direction:"receive",type:"pong",data:"pong",size:4}]};return r.unshift(c),d(),c}const i=y(),n=s-6e4,u=s-2e3,l={id:i,url:"wss://echo.websocket.events",readyState:3,status:"closed",startTime:n,endTime:u,duration:u-n,closeCode:1e3,closeReason:"Normal session closure",client:"websocket",sentCount:2,receivedCount:2,totalBytesSent:110,totalBytesReceived:110,caller:"HomeScreen.tsx:120 (testWebSocketEcho)",frames:[{id:a(),timestamp:n+200,direction:"send",type:"text",data:"Echo ping test #1",size:17},{id:a(),timestamp:n+380,direction:"receive",type:"text",data:"Echo ping test #1",size:17},{id:a(),timestamp:n+15e3,direction:"send",type:"json",data:{type:"diagnostics",timestamp:n+15e3},size:45},{id:a(),timestamp:n+15210,direction:"receive",type:"json",data:{type:"diagnostics",timestamp:n+15e3},size:45}]};return t&&Object.assign(l,t),r.unshift(l),d(),l}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{Platform as
|
|
1
|
+
import{Platform as $,ToastAndroid as y,Alert as D,NativeModules as p,Linking as b}from"react-native";import S from"@react-native-clipboard/clipboard";import{showToast as _}from"./toast";import{copyMediaToClipboard as E}from"../native/NativeInspector";import{AppColors as a}from"../styles/AppColors";import{DOMAIN_COLORS as C,DURATION_FAST_MS as U,DURATION_SLOW_MS as P}from"../constants";export*from"./searchQueryParser";export*from"./memoryManager";export*from"./toast";export const isLocalDebugEnvironment=()=>{const t=typeof __DEV__<"u"&&!!__DEV__,e=p.SourceCode?.scriptURL||"",n=e.startsWith("http://")||e.startsWith("https://")||e.includes(":8081")||e.includes(":8082");return t||n},getDomainColor=t=>{if(!t)return C[0];let e=0;for(let n=0;n<t.length;n++)e=t.charCodeAt(n)+((e<<5)-e);return C[Math.abs(e)%C.length]},formatDateTime=t=>{const e=new Date(t),n=(h,l=2)=>String(h).padStart(l,"0"),r=n(e.getDate()),o=n(e.getMonth()+1),i=e.getFullYear(),s=n(e.getHours()),c=n(e.getMinutes()),u=n(e.getSeconds());return`${r}/${o}/${i} ${s}:${c}:${u}`},formatTimestamp=t=>{try{const e=new Date(t),n=e.getHours().toString().padStart(2,"0"),r=e.getMinutes().toString().padStart(2,"0"),o=e.getSeconds().toString().padStart(2,"0"),i=e.getMilliseconds().toString().padStart(3,"0");return`${n}:${r}:${o}.${i}`}catch{return"\u2014"}},getStatusColor=t=>!t||t===0?a.errorColor:t>=500?a.errorColor:t>=400?a.darkOrange:t>=300?a.warningIconGold:a.greenColor,getDurationColor=t=>t==null?a.grayTextWeak:t<U?a.greenColor:t<P?a.lightOrange:a.errorColor,getSize=t=>{try{const e=JSON.stringify(t)?.length??0;return e<1024?`${e} B`:`${(e/1024).toFixed(1)} KB`}catch{return"\u2014"}},formatBytes=t=>{if(t===0||!t||isNaN(t))return"0 B";const e=1024,n=["B","KB","MB","GB"],r=Math.floor(Math.log(t)/Math.log(e));return`${parseFloat((t/Math.pow(e,r)).toFixed(1))} ${n[r]||"B"}`},copyToClipboard=(t,e)=>{const n=typeof t=="function"?t():t;let r="";if(typeof n=="string")r=n;else try{r=JSON.stringify(n,null,2)}catch{r=String(n)}try{typeof S?.setString=="function"?S.setString(r):typeof S?.default?.setString=="function"&&S.default.setString(r)}catch(o){__DEV__&&console.warn("[NetworkInspector] Clipboard.setString failed:",o)}try{_(e?`${e} copied to clipboard`:"Copied to clipboard")}catch{}try{$.OS==="android"&&y?.show&&y.show(e?`${e} copied to clipboard`:"Copied to clipboard",y.SHORT)}catch{}},copyImageOrMediaToClipboard=async(t,e="Image")=>{if(!t)return;let n=!1;try{n=await E(t)}catch{n=!1}if(!n){copyToClipboard(t,e);return}try{_(`${e} copied to clipboard`)}catch{}try{$.OS==="android"&&y?.show&&y.show(`${e} copied to clipboard`,y.SHORT)}catch{}},getPath=t=>{try{const e=new URL(t);return e.pathname+(e.search?e.search:"")}catch{return t.replace(/^https?:\/\/[^/?#]+/,"")||"/"}},getBaseUrl=t=>{try{const e=new URL(t);return`${e.protocol}//${e.host}`}catch{const e=t.match(/^(https?:\/\/[^/]+)/);return e?e[1]:""}},getCurlCommand=t=>{let e=`curl -X ${t.method} "${t.url}"`;if(t.requestHeaders&&Object.entries(t.requestHeaders).forEach(([n,r])=>{e+=` \\
|
|
2
2
|
-H "${n}: ${r}"`}),t.request&&t.method!=="GET"){const n=typeof t.request=="string"?t.request:JSON.stringify(t.request);e+=` \\
|
|
3
|
-
-d '${n.replace(/'/g,"'\\''")}'`}return e},getFetchCommand=t=>{const e={method:t.method};return t.requestHeaders&&Object.keys(t.requestHeaders).length>0&&(e.headers=t.requestHeaders),t.request&&t.method!=="GET"&&(e.body=JSON.stringify(t.request)),`fetch("${t.url}", ${JSON.stringify(e,null,2)})`},deduplicateLogs=t=>{const e=new Map;return t.forEach(n=>{if(!e.has(n.id))e.set(n.id,n);else{const r=e.get(n.id);(r.status==null&&n.status!=null||(n.startTime??0)>=(r.startTime??0))&&e.set(n.id,n)}}),Array.from(e.values()).sort((n,r)=>r.id-n.id)},escapeRegex=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),getNavigationInfo=(t,e=[])=>{if(!t)return{path:e.length>0?e.join(" \u2794 "):"",params:null};if(t.name&&!t.routes)return{path:e.length>0?[...e,t.name].join(" \u2794 "):t.name,params:t.params||null};if(!t.routes||!Array.isArray(t.routes)||t.routes.length===0)return{path:e.length>0?e.join(" \u2794 "):"",params:null};const n=typeof t.index=="number"&&t.index>=0&&t.index<t.routes.length?t.index:0,r=t.routes[n];if(!r)return{path:e.length>0?e.join(" \u2794 "):"",params:null};const o=r.name?[...e,r.name]:e;return r?.state?getNavigationInfo(r.state,o):{path:o.length>0?o.join(" \u2794 "):r.name||"",params:r.params||null}},getLogPageName=(t,e)=>{const n=e||t?.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(t.caller&&t.caller!=="Unknown")try{const r=t.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(t.url)try{const o=t.url.split("?")[0].split("#")[0].replace(/^https?:\/\//i,""),i=o.indexOf("/");if(i!==-1){const
|
|
3
|
+
-d '${n.replace(/'/g,"'\\''")}'`}return e},getFetchCommand=t=>{const e={method:t.method};return t.requestHeaders&&Object.keys(t.requestHeaders).length>0&&(e.headers=t.requestHeaders),t.request&&t.method!=="GET"&&(e.body=JSON.stringify(t.request)),`fetch("${t.url}", ${JSON.stringify(e,null,2)})`},deduplicateLogs=t=>{const e=new Map;return t.forEach(n=>{if(!e.has(n.id))e.set(n.id,n);else{const r=e.get(n.id);(r.status==null&&n.status!=null||(n.startTime??0)>=(r.startTime??0))&&e.set(n.id,n)}}),Array.from(e.values()).sort((n,r)=>r.id-n.id)},escapeRegex=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),getNavigationInfo=(t,e=[])=>{if(!t)return{path:e.length>0?e.join(" \u2794 "):"",params:null};if(t.name&&!t.routes)return{path:e.length>0?[...e,t.name].join(" \u2794 "):t.name,params:t.params||null};if(!t.routes||!Array.isArray(t.routes)||t.routes.length===0)return{path:e.length>0?e.join(" \u2794 "):"",params:null};const n=typeof t.index=="number"&&t.index>=0&&t.index<t.routes.length?t.index:0,r=t.routes[n];if(!r)return{path:e.length>0?e.join(" \u2794 "):"",params:null};const o=r.name?[...e,r.name]:e;return r?.state?getNavigationInfo(r.state,o):{path:o.length>0?o.join(" \u2794 "):r.name||"",params:r.params||null}},getLogPageName=(t,e)=>{const n=e||t?.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(t.caller&&t.caller!=="Unknown")try{const r=t.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(t.url)try{const o=t.url.split("?")[0].split("#")[0].replace(/^https?:\/\//i,""),i=o.indexOf("/");if(i!==-1){const c=o.substring(i+1).split("/").filter(Boolean),u=["api","v1","v2","v3","v4","rest","graphql","json","data","service","app"],h=c.filter(l=>!u.includes(l.toLowerCase()));if(h.length>0){const l=h[0];return l.charAt(0).toUpperCase()+l.slice(1)}}const s=o.split("/")[0];if(s)return s}catch{}return"General"},flattenObject=(t,e="")=>{let n={};return typeof t=="object"&&t!==null?Array.isArray(t)?t.forEach((r,o)=>{Object.assign(n,flattenObject(r,e?`${e}[${o}]`:`[${o}]`))}):Object.keys(t).forEach(r=>{Object.assign(n,flattenObject(t[r],e?`${e}.${r}`:r))}):n[e||"root"]=t,n},getDiff=(t,e)=>{const n=flattenObject(t),r=flattenObject(e),o=[];return new Set([...Object.keys(n),...Object.keys(r)]).forEach(s=>{s in n?s in r?n[s]!==r[s]&&o.push({type:"changed",path:s,oldVal:n[s],newVal:r[s]}):o.push({type:"removed",path:s,oldVal:n[s]}):o.push({type:"added",path:s,newVal:r[s]})}),o.sort((s,c)=>s.path.localeCompare(c.path))},formatDisplayUrl=t=>t?t.startsWith("http://")||t.startsWith("https://")?t:`https://${t}`:"",getLocalizedFilePath=(t,e,n)=>t.replace("country-language",`${e?.toLowerCase()}-${n?.toLowerCase()}`),getLocalizedFilePathWithSlash=(t,e,n)=>t.replace("country/language",`${e?.toLowerCase()}/${n?.toLowerCase()}`),isAllValuesEmpty=t=>!t||typeof t!="object"?!0:Object.values(t).every(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0),formatDateTimeToAnalytics=t=>new Date(t)?.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),getBundleIdentifier=()=>{const t=p.RNDeviceInfo;if(t&&typeof t.bundleId=="string")return t.bundleId;if(t&&typeof t.getBundleId=="function")try{const o=t.getBundleId();if(typeof o=="string")return o}catch{}const e=p.ExponentConstants;if(e&&e.manifest){const o=e.manifest;if(o.ios&&o.ios.bundleIdentifier)return o.ios.bundleIdentifier;if(o.android&&o.android.package)return o.android.package}const n=p.ExpoApplication;if(n&&typeof n.applicationId=="string")return n.applicationId;const r=p.SourceCode;if(r&&typeof r.scriptURL=="string"){const o=r.scriptURL;if(o.includes("assets/"))try{const i=o.match(/assets\/([^/?#]+)/);if(i&&i[1])return i[1]}catch{}}return"org.reactjs.native.example"},getAppName=()=>{const t=p.PlatformConstants;t&&t.interfaceIdiom;const e=p.RNDeviceInfo;if(e&&typeof e.appName=="string")return e.appName;const n=p.NetworkInspectorModule;if(n&&typeof n.appName=="string"&&n.appName.length>0&&n.appName!=="App")return n.appName;const r=p.ExpoApplication;if(r&&typeof r.applicationName=="string")return r.applicationName;const o=p.ExponentConstants;if(o&&o.manifest){const c=o.manifest;if(c.name)return c.name}const i=p.AppInfo;if(i&&typeof i.appName=="string")return i.appName;const s=getBundleIdentifier();if(s&&s!=="org.reactjs.native.example"){const c=s.split("."),u=c[c.length-1];return u?u.charAt(0).toUpperCase()+u.slice(1):"App"}return"App"},getAppVersionAndBuild=()=>{let t="",e="";const n=p.NetworkInspectorModule;if(n&&(typeof n.appVersion=="string"&&n.appVersion.length>0&&(t=n.appVersion),typeof n.appBuild=="string"&&n.appBuild.length>0&&(e=n.appBuild)),!t||!e){const r=p.ExpoApplication;r&&(!t&&typeof r.nativeAppVersion=="string"&&(t=r.nativeAppVersion),!e&&typeof r.nativeBuildVersion=="string"&&(e=r.nativeBuildVersion))}if(!t||!e){const r=p.ExponentConstants;if(r){const o=r.manifest||r.expoConfig;o&&(!t&&o.version&&(t=String(o.version)),e||(o.ios?.buildNumber?e=String(o.ios.buildNumber):o.android?.versionCode&&(e=String(o.android.versionCode))))}}if(!t||!e){const r=p.RNDeviceInfo;if(r){if(!t){if(typeof r.appVersion=="string")t=r.appVersion;else if(typeof r.getVersion=="function")try{t=r.getVersion()}catch{}}if(!e){if(typeof r.buildNumber=="string")e=r.buildNumber;else if(typeof r.getBuildNumber=="function")try{e=r.getBuildNumber()}catch{}}}}if(!t||!e){const r=p.AppInfo;r&&(!t&&typeof r.versionName=="string"&&(t=r.versionName),!e&&typeof r.versionCode=="string"&&(e=r.versionCode))}if(!t){const r=$.constants||p.PlatformConstants;r&&r.Version&&typeof r.Version=="string"&&r.Version.includes(".")&&(t=r.Version)}return t||(t="1.0"),e||(e="1"),{version:t,build:e,formatted:`${t} (${e})`}},handleOpenExternalLink=t=>{if(!t)return;const e=formatDisplayUrl(t);D.alert("Open Link",`Do you want to open this link in your web browser?
|
|
4
4
|
|
|
5
5
|
${e}`,[{text:"Cancel",style:"cancel"},{text:"Open",onPress:()=>{b.openURL(e).catch(()=>{})}}])},formatTimeShort=t=>{const e=new Date(t),n=String(e.getHours()).padStart(2,"0"),r=String(e.getMinutes()).padStart(2,"0"),o=String(e.getSeconds()).padStart(2,"0");return`${n}:${r}:${o}`},formatTime=t=>{const e=new Date(t),n=String(e.getHours()).padStart(2,"0"),r=String(e.getMinutes()).padStart(2,"0"),o=String(e.getSeconds()).padStart(2,"0"),i=String(e.getMilliseconds()).padStart(3,"0");return`${n}:${r}:${o}.${i}`},formatGap=t=>{if(t<1e3)return`+${t}ms`;const e=Math.round(t/1e3);if(e<60)return`+${e}s`;const n=Math.floor(e/60),r=e%60;return r>0?`+${n}m ${r}s`:`+${n}m`},getJsonContent=t=>{if(!t)return null;const e=[];for(let n=0;n<t.length;n++)(t[n]==="{"||t[n]==="[")&&e.push(n);for(const n of e){const r=t.substring(n).trim();try{const o=JSON.parse(r);if(o!==null&&typeof o=="object")return{header:t.substring(0,n).trim(),data:o}}catch{}}return null},getJsonPreviewText=(t,e=4)=>{try{const n=JSON.stringify(t,null,2),r=n.split(`
|
|
6
6
|
`);return r.length>e?{text:r.slice(0,e).join(`
|
|
7
7
|
`)+`
|
|
8
|
-
...`,hasMore:!0}:{text:n,hasMore:!1}}catch{return{text:String(t),hasMore:!1}}},parseStackLine=(t,e=!1)=>{let n=t.trim().replace(/^at /,"");if(n.includes("@")){const
|
|
8
|
+
...`,hasMore:!0}:{text:n,hasMore:!1}}catch{return{text:String(t),hasMore:!1}}},parseStackLine=(t,e=!1)=>{let n=t.trim().replace(/^at /,"");if(n.includes("@")){const A=n.indexOf("@"),O=n.substring(0,A).trim(),B=n.substring(A+1).trim();n=O?`${O} (${B})`:B}const r=n.match(/^(.*?)\s*\((.*?)\)$/);let o="<anonymous>",i=n;r&&(o=r[1].trim()||"<anonymous>",i=r[2].trim()),(o.startsWith("?anon_")||o==="?")&&(o="anonymous"),i=i.replace(/^address at /,"");const s=i.match(/^(.*?):(\d+):(\d+)$/);let c=i,u,h;s&&(c=s[1],u=s[2],h=s[3]);let l=c.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 x=f.match(/\.([a-z0-9]+)$/i),d=x?x[1].toLowerCase():"",g=d==="tsx"||d==="jsx"||d==="ts"||d==="js"?d:"other",N=i==="native"||l==="native",v=l.includes("InternalBytecode")||l.includes("metro-runtime")||l.includes("regenerator-runtime")||o==="tryCallOne"||o==="asyncGeneratorStep"||o==="_next"||o==="next"&&N,w=l.includes("node_modules")||l.includes("react-native/Libraries")||l.includes("react-native-inapp-inspector")&&!l.includes("/example/"),I=!N&&!v&&!w&&(g==="tsx"||g==="jsx"||g==="ts"||g==="js"||!f.includes(".bundle")&&f!=="Unknown"),M=I?"app":w?"dependency":N?"native":"runtime",L=v||N||o==="asyncGeneratorStep"||o==="_next";let m=l;m.includes("/example/")?m=m.substring(m.indexOf("/example/")+9):m.includes("/src/")?m=m.substring(m.indexOf("/src/")+1):m.includes("/node_modules/")&&(m=m.substring(m.indexOf("/node_modules/")+14));const T=u?`${f}:${u}${h?`:${h}`:""}`:f;return{raw:t,functionName:o,fileName:f,fullPath:m,rawFilePath:c,fileExt:g,frameType:M,isUserCode:I,isRuntimeNoise:L,lineNumber:u,columnNumber:h,isOrigin:e,copyableLocation:T}},getCleanCallerDisplay=t=>{if(!t||t==="Unknown"||t.trim()==="")return null;const e=t.trim();if(e.startsWith("&platform")||e.startsWith("?platform")||e.startsWith("&")||e.includes("&platform=")||e.includes("?platform=")){const i=e.match(/^(.*?)\s*[\(@]/);if(i&&i[1]&&!i[1].includes("&")&&!i[1].includes("platform")){const s=i[1].trim();if(s&&s!=="<anonymous>"&&s!=="anonymous"&&!s.startsWith("?anon_"))return{fileName:s,functionName:s,display:s}}return null}const n=parseStackLine(t,!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=(t,e,n)=>{const r=e?Number(e):1,o=n?Number(n):1,i=e?`:${e}`:"",s=n?`:${n}`:"",c=t.replace(/^file:\/\//,"");let u=null;try{const d=p?.SourceCode?.scriptURL||p?.PlatformConstants?.serverHost||p?.DevSettings?.serverHost;if(typeof d=="string"&&d.length>0){const g=d.match(/^(https?:\/\/[^/]+)/);g?u=g[1]:!d.startsWith("http")&&d.includes(":")&&(u=`http://${d}`)}}catch{}Array.from(new Set([...u?[u]:[],"http://localhost:8081","http://127.0.0.1:8081","http://10.0.2.2:8081"])).forEach(d=>{try{fetch(`${d}/open-stack-frame`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:c,lineNumber:r,column:o})}).catch(()=>{})}catch{}});const l=`vscode://file/${c.replace(/^\/+/,"")}${i}${s}`,f=`cursor://file/${c.replace(/^\/+/,"")}${i}${s}`,x=`vscode-insiders://file/${c.replace(/^\/+/,"")}${i}${s}`;b.openURL(l).catch(()=>{b.openURL(f).catch(()=>{b.openURL(x).catch(()=>{copyToClipboard(`${c}${i}${s}`,"Location")})})})},ANALYTICS_EVENT_PALETTE=[a.googleBlue,a.googleGreen,a.googlePurple,a.googleTeal,a.googleRed,a.googleOrange,a.blue700,a.materialGreen],getEventColor=t=>{const e=typeof t=="string"?t:String(t||"");let n=0;for(let r=0;r<e.length;r++)n=n*31+e.charCodeAt(r)|0;return ANALYTICS_EVENT_PALETTE[Math.abs(n)%ANALYTICS_EVENT_PALETTE.length]};export{getEventCategory,registerGAPlugin}from"./gaAnalyticsRegistry";export const getCategoryColors=t=>{switch(t){case"page_view":case"Page View":return{bg:a.blueBg,border:a.blueBorder,text:a.blue800};case"ecommerce":case"Ecommerce":return{bg:a.greenBg,border:a.greenBorder,text:a.materialGreen};case"system":case"System":return{bg:a.greyBg,border:a.greyBorder,text:a.grey600};default:return{bg:a.purpleBg,border:a.purpleBorder,text:a.purpleText}}},getRuntimeDiagnostics=()=>{const t=typeof global.HermesInternal<"u",e=typeof global._v8runtime<"u",n=t?"hermes":e?"v8":"jsc",o=typeof global.nativeFabricUIManager<"u"||!!global.__turboModuleProxy?"fabric":"paper";let i=32.4,s=64;try{const c=global.HermesInternal?.getInstrumentedStats?.();c?.js_heap_size?(i=Number((c.js_heap_size/(1024*1024)).toFixed(1)),s=Number(((c.js_allocated_bytes||c.js_heap_size*1.6)/(1024*1024)).toFixed(1))):global.performance?.memory?.usedJSHeapSize&&(i=Number((global.performance.memory.usedJSHeapSize/(1024*1024)).toFixed(1)),s=Number((global.performance.memory.totalJSHeapSize/(1024*1024)).toFixed(1)))}catch{}return{engineType:n,archType:o,usedHeapMb:i,totalAllocMb:s}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AppState as
|
|
1
|
+
import{AppState as g}from"react-native";import{pruneNetworkLogs as h}from"../customHooks/networkLogger";import{pruneConsoleLogs as x}from"../customHooks/consoleLogger";import{pruneReduxHistory as L}from"../customHooks/reduxLogger";import{pruneAnalyticsLogs as w}from"../customHooks/analyticsLogger";import{pruneCrashRecords as A,addCrashBreadcrumb as M}from"../customHooks/crashHandler";import{prunePushRecords as P}from"../customHooks/pushNotificationLogger";import{pruneSocketRecords as b}from"../customHooks/socketLogger";import{showToast as R}from"./toast";const n=new Set;let r=null,t=!1,s=0;export const pruneAllLogs=(e="manual",a=.5)=>{const c=h(void 0),u=x(void 0),m=L(void 0),p=w(void 0),i=A(void 0),d=0;P(20);const l=0;b(20);const f=c+u+m+p+i+d+l;if(s=Date.now(),typeof globalThis.gc=="function")try{globalThis.gc()}catch{}const o={timestamp:s,prunedNetwork:c,prunedConsole:u,prunedRedux:m,prunedAnalytics:p,prunedCrashes:i,prunedPush:d,prunedSocket:l,totalPruned:f,triggeredBy:e};try{M("system",`[MemoryManager] Low memory auto-prune executed (${e}). Freed ${f} log records.`,o)}catch{}return n.forEach(y=>{try{y(o)}catch{}}),o},setupMemoryWarningHandler=()=>{if(t)return()=>{};t=!0;try{r=g.addEventListener("memoryWarning",e=>{const a=pruneAllLogs("memory-warning",.5);try{R(`Memory Warning: Auto-pruned ${a.totalPruned} inspector logs`)}catch{}})}catch{}return()=>{if(r){try{r.remove()}catch{}r=null}t=!1}},subscribeMemoryWarning=e=>(n.add(e),()=>{n.delete(e)}),getLastPruneTimestamp=()=>s,isMemoryHandlerActive=()=>t;
|
|
@@ -4,4 +4,4 @@ export interface SearchQueryOptions {
|
|
|
4
4
|
isRegex?: boolean;
|
|
5
5
|
isCaseSensitive?: boolean;
|
|
6
6
|
}
|
|
7
|
-
export declare function matchNetworkLogQuery(log: NetworkLog, searchQuery: string, routePath?: string,
|
|
7
|
+
export declare function matchNetworkLogQuery(log: NetworkLog, searchQuery: string, routePath?: string, options?: SearchQueryOptions): boolean;
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
import{markSearchFilterUsed as
|
|
1
|
+
import{markSearchFilterUsed as N}from"./telemetry";const W=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 I(s){const u=[],w=/[^\s"']+|"([^"]*)"|'([^']*)'/g;let i;for(;(i=w.exec(s))!==null;)i[1]!=null?u.push(i[1]):i[2]!=null?u.push(i[2]):i[0]&&u.push(i[0]);return u}export function matchNetworkLogQuery(s,u,w,i){if(!u||u.trim().length===0)return!0;N();const R=!!i?.isCaseSensitive,L=!!i?.isRegex,x=i?.scope||"all",H=s.method||"",y=s.url||"",d=s.status!=null?String(s.status):"pending",o=typeof s.status=="number"?s.status:s.status!=null?parseInt(String(s.status),10):null,$=s.client||"",j=s.caller||"",b=w||s?.routeInfo?.path||"",k=n=>{if(n==null)return"";if(typeof n=="string")return n;try{return JSON.stringify(n)}catch{return""}},m=k(s.request),C=k(s.response),p=(n,l=!1)=>{if(!n||typeof n!="object")return"";const r=Object.entries(n);return l?r.map(([t,f])=>`${t}: ${f}`).join(`
|
|
2
|
+
`):r.filter(([t])=>!W.has(t.toLowerCase())).map(([t,f])=>`${t}: ${f}`).join(`
|
|
3
|
+
`)},v=p(s.requestHeaders,x==="headers"),q=p(s.responseHeaders,x==="headers"),h=(n=>{switch(n){case"url":return y;case"reqBody":return m;case"resBody":return C;case"headers":return`${v}
|
|
4
|
+
${q}`;default:return[y,H,d,b,$,j,m,C,v,q].join(" ")}})(x),c=(n,l)=>{if(L)try{return new RegExp(l,R?"":"i").test(n)}catch{}return R?n.includes(l):n.toLowerCase().includes(l.toLowerCase())},B=I(u);return B.length===0?!0:B.every(n=>{let l=!1,r=n;if(r.length>1&&(r.startsWith("-")||r.startsWith("!"))&&(l=!0,r=r.slice(1)),!r)return!0;let t=!1;const f=r.indexOf(":");if(f>0){const e=r.slice(0,f).toLowerCase(),a=r.slice(f+1);if(e==="url"||e==="u"||e==="path")t=c(y,a);else if(e==="method"||e==="m")t=c(H,a);else if(e==="status"||e==="s")if(a==="error"||a==="failed"||a==="err")t=s.status===0||o!==null&&o>=400;else if(a==="success"||a==="ok")t=o!==null&&o>=200&&o<300;else if(a.endsWith("xx")){const S=a[0];t=d.startsWith(S)}else t=d.includes(a);else if(e==="header"||e==="h"){const S=`${p(s.requestHeaders,!0)}
|
|
5
|
+
${p(s.responseHeaders,!0)}`;t=c(S,a)}else e==="body"||e==="b"?t=c(m,a)||c(C,a):e==="client"||e==="c"?t=c($,a):e==="page"||e==="p"?t=c(b,a):t=c(h,r)}else{const e=r.toLowerCase();e==="error"||e==="failed"||e==="err"||e==="fail"?t=s.status===0||o!==null&&o>=400||c(h,r):e==="success"||e==="ok"||e==="2xx"?t=o!==null&&o>=200&&o<300||c(h,r):/^[1-5]xx$/.test(e)?t=d.startsWith(e[0]):t=c(h,r)}return l?!t:t})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Platform as n,Settings as c}from"react-native";import{getNativeStorageItem as l,setNativeStorageItem as u,isNativeModuleAvailable as i}from"../native/NativeInspector";const m=new Map;let s=null;export function setCustomStorage(t){s=t}const e="rn-inapp-inspector.settings.v1";export async function loadSettings(){try{if(s){const
|
|
1
|
+
import{Platform as n,Settings as c}from"react-native";import{getNativeStorageItem as l,setNativeStorageItem as u,isNativeModuleAvailable as i}from"../native/NativeInspector";const m=new Map;let s=null;export function setCustomStorage(t){s=t}const e="rn-inapp-inspector.settings.v1";export async function loadSettings(){try{if(s){const o=await s.getItem(e);if(!o)return{};const r=JSON.parse(o);return r&&typeof r=="object"?r:{}}if(i()){const o=await l(e);if(o){const r=JSON.parse(o);return r&&typeof r=="object"?r:{}}}if(n.OS==="ios"){const o=c.get(e);if(!o)return{};if(typeof o=="string"){const r=JSON.parse(o);return r&&typeof r=="object"?r:{}}return o&&typeof o=="object"?o:{}}const t=m.get(e);if(!t)return{};const a=JSON.parse(t);return a&&typeof a=="object"?a:{}}catch{return{}}}export function saveSettings(t){try{const a=JSON.stringify(t);if(s){s.setItem(e,a);return}if(i()&&u(e,a),n.OS==="ios"){c.set({[e]:a});return}m.set(e,a)}catch{}}export async function clearPersistedSettings(){try{if(s){typeof s.removeItem=="function"?await s.removeItem(e):await s.setItem(e,"");return}if(i()&&await u(e,null),n.OS==="ios"){c.set({[e]:null});return}m.delete(e)}catch{}}export const isPersistentStorageAvailable=()=>s!==null||i()||n.OS==="ios";export function getCustomStorage(){return s}export function calculateRamBasedLimits(t){return t>=3e3?{maxNetworkLogs:500,maxConsoleLogs:500,maxAnalyticsEvents:300,maxCrashRecords:150,maxPushRecords:100,maxSocketRecords:100,profileName:"High-End",freeRamMb:t}:t>=1500?{maxNetworkLogs:300,maxConsoleLogs:300,maxAnalyticsEvents:200,maxCrashRecords:100,maxPushRecords:75,maxSocketRecords:75,profileName:"Standard",freeRamMb:t}:t>=600?{maxNetworkLogs:200,maxConsoleLogs:200,maxAnalyticsEvents:100,maxCrashRecords:50,maxPushRecords:50,maxSocketRecords:50,profileName:"Compact",freeRamMb:t}:{maxNetworkLogs:100,maxConsoleLogs:100,maxAnalyticsEvents:50,maxCrashRecords:25,maxPushRecords:25,maxSocketRecords:25,profileName:"Ultra-Light",freeRamMb:t}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnalyticsEvent, ConsoleLog, CrashRecord, NetworkLog, PushNotificationRecord, ReduxHistoryEntry } from '../types';
|
|
1
|
+
import type { AnalyticsEvent, ConsoleLog, CrashRecord, NetworkLog, PushNotificationRecord, ReduxHistoryEntry, SocketConnectionRecord } from '../types';
|
|
2
2
|
export declare function formatApiReport(log: NetworkLog): string;
|
|
3
3
|
export declare function formatPushReport(record: PushNotificationRecord): string;
|
|
4
4
|
export declare function formatCrashReport(crash: CrashRecord): string;
|
|
@@ -11,3 +11,5 @@ export declare function shareCrashReport(crash: CrashRecord): Promise<void>;
|
|
|
11
11
|
export declare function shareAnalyticsReport(event: AnalyticsEvent): Promise<void>;
|
|
12
12
|
export declare function shareReduxReport(action: ReduxHistoryEntry): Promise<void>;
|
|
13
13
|
export declare function shareLogReport(log: ConsoleLog): Promise<void>;
|
|
14
|
+
export declare function formatSocketReport(record: SocketConnectionRecord): string;
|
|
15
|
+
export declare function shareSocketReport(record: SocketConnectionRecord): Promise<void>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import{Alert as
|
|
2
|
-
`)}export function formatPushReport(e){const
|
|
3
|
-
`)}export function formatCrashReport(e){const
|
|
4
|
-
`)}export function formatAnalyticsReport(e){const
|
|
5
|
-
`)}export function formatReduxReport(e){const
|
|
6
|
-
`)}export function formatLogReport(e){const
|
|
7
|
-
`)}async function r(e,
|
|
1
|
+
import{Alert as l,Share as $}from"react-native";import{formatDateTime as i,getCurlCommand as c}from"./index";function p(e){if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}export function formatApiReport(e){const n=(e.method||"GET").toUpperCase(),t=e.status===0?"Failed / Network Error":e.status!=null?`${e.status} ${e.status===200?"OK":""}`.trim():"Pending",u=e.duration!=null?`${e.duration}ms`:"N/A",o=i(e.startTime||Date.now()),s=c(e),a=["\u{1F680} API INSPECTION REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Method: ${n}`,`\u{1F4CA} Status: ${t}`,`\u23F1\uFE0F Duration: ${u}`,`\u{1F552} Time: ${o}`];return e.client&&a.push(`\u{1F50C} Client: ${e.client.toUpperCase()}`),a.push(`\u{1F310} URL: ${e.url||"N/A"}`),a.push(""),e.requestHeaders&&Object.keys(e.requestHeaders).length>0&&(a.push("\u{1F4CB} Request Headers:"),a.push(p(e.requestHeaders)),a.push("")),e.request!=null&&e.request!==""&&(a.push("\u{1F4DD} Request Body:"),a.push(p(e.request)),a.push("")),e.responseHeaders&&Object.keys(e.responseHeaders).length>0&&(a.push("\u{1F4D1} Response Headers:"),a.push(p(e.responseHeaders)),a.push("")),e.response!=null&&e.response!==""&&(a.push("\u{1F4E5} Response Data:"),a.push(p(e.response)),a.push("")),s&&(a.push("\u{1F4BB} cURL Command:"),a.push(s),a.push("")),a.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),a.push("Generated by React Native InApp Inspector"),a.join(`
|
|
2
|
+
`)}export function formatPushReport(e){const n=i(e.timestamp||Date.now()),t=(e.source||"push").toUpperCase(),u=(e.appState||"unknown").toUpperCase(),o=(e.action||"received").toUpperCase(),s=["\u{1F514} PUSH NOTIFICATION REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Title: ${e.title||"(No Title)"}`,`\u{1F4DD} Body: ${e.body||"(No Body)"}`,`\u{1F3E2} Source: ${t}${e.domain?` (${e.domain})`:""}`,`\u{1F194} Message ID: ${e.id||"N/A"}`,`\u{1F4F1} App State: ${u}`,`\u{1F3AF} Action: ${o}`,`\u{1F552} Time: ${n}`];return e.subtitle&&s.push(`\u{1F4D1} Subtitle: ${e.subtitle}`),e.channelId&&s.push(`\u{1F3F7}\uFE0F Channel: ${e.channelId}`),e.priority&&s.push(`\u26A1 Priority: ${e.priority}`),e.badge!=null&&s.push(`\u{1F522} Badge: ${e.badge}`),e.sound&&s.push(`\u{1F50A} Sound: ${e.sound}`),e.imageUrl&&s.push(`\u{1F5BC}\uFE0F Image: ${e.imageUrl}`),s.push(""),e.data&&Object.keys(e.data).length>0&&(s.push("\u{1F4E6} Custom Data Payload:"),s.push(p(e.data)),s.push("")),e.customDomainAttributes&&Object.keys(e.customDomainAttributes).length>0&&(s.push("\u{1F3E2} Domain Attributes:"),s.push(p(e.customDomainAttributes)),s.push("")),e.rawPayload!=null&&(s.push("\u2699\uFE0F Raw Payload:"),s.push(p(e.rawPayload)),s.push("")),s.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),s.push("Generated by React Native InApp Inspector"),s.join(`
|
|
3
|
+
`)}export function formatCrashReport(e){const n=`${e.dateStr||""} ${e.timeStr||""}`.trim()||i(e.timestamp),t=["\u{1F4A5} CRASH REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u26A0\uFE0F Error: ${e.name||"Error"}: ${e.message||"Unknown error"}`,`\u{1F6A8} Fatal: ${e.isFatal?"YES (Fatal)":"NO (Caught)"}`,`\u{1F3F7}\uFE0F Type: ${(e.type||"js").toUpperCase()}`,`\u{1F552} Time: ${n}`];return e.deviceInfo&&t.push(`\u{1F4F1} Platform: ${e.deviceInfo.platform||"N/A"} (OS: ${e.deviceInfo.osVersion||"N/A"}, RN: ${e.deviceInfo.rnVersion||"N/A"})`),e.memoryInfo?.usedJSHeapSize&&t.push(`\u{1F4BE} Used Heap: ${Math.round(e.memoryInfo.usedJSHeapSize/(1024*1024))} MB`),t.push(""),e.stack&&(t.push("\u{1F4DC} Stack Trace:"),t.push(e.stack),t.push("")),e.breadcrumbs&&e.breadcrumbs.length>0&&(t.push(`\u{1F43E} Breadcrumbs (${e.breadcrumbs.length}):`),e.breadcrumbs.slice(-10).forEach(u=>{t.push(` \u2022 [${u.type}] ${u.message} (${i(u.timestamp)})`)}),t.push("")),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push("Generated by React Native InApp Inspector"),t.join(`
|
|
4
|
+
`)}export function formatAnalyticsReport(e){const n=i(e.timestamp),t=["\u{1F4CA} ANALYTICS EVENT REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Event Name: ${e.name||"Unknown"}`,`\u{1F3E2} Source: ${(e.source||"manual").toUpperCase()}`,`\u{1F552} Timestamp: ${n}`];return e.screenName&&t.push(`\u{1F4F1} Screen Name: ${e.screenName}`),e.userId&&t.push(`\u{1F464} User ID: ${e.userId}`),e.trackingId&&t.push(`\u{1F194} Tracking ID: ${e.trackingId}`),t.push(""),e.params&&Object.keys(e.params).length>0&&(t.push("\u{1F4E6} Event Parameters:"),t.push(p(e.params)),t.push("")),e.userProperties&&Object.keys(e.userProperties).length>0&&(t.push("\u{1F464} User Properties:"),t.push(p(e.userProperties)),t.push("")),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push("Generated by React Native InApp Inspector"),t.join(`
|
|
5
|
+
`)}export function formatReduxReport(e){const n=typeof e.timestamp=="number"?i(e.timestamp):e.timestamp,t=["\u{1F504} REDUX ACTION REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Action Type: ${e.type||"UNKNOWN"}`,`\u{1F552} Timestamp: ${n}`];return e.caller&&t.push(`\u{1F4CD} Caller: ${e.caller}`),e.originType&&t.push(`\u2699\uFE0F Origin: ${e.originType}`),e.affectedSlices&&e.affectedSlices.length>0&&t.push(`\u{1F370} Slices: ${e.affectedSlices.join(", ")}`),t.push(""),t.push("\u{1F4E6} Action Payload:"),t.push(p(e.payload)),t.push(""),e.prevState!==void 0&&(t.push("\u23EE\uFE0F Previous State:"),t.push(p(e.prevState)),t.push("")),e.nextState!==void 0&&(t.push("\u23ED\uFE0F Next State:"),t.push(p(e.nextState)),t.push("")),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push("Generated by React Native InApp Inspector"),t.join(`
|
|
6
|
+
`)}export function formatLogReport(e){const n=i(e.timestamp),t=["\u{1F4DC} CONSOLE LOG REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Level: ${(e.type||"info").toUpperCase()}`,`\u{1F552} Timestamp: ${n}`,`\u{1F4AC} Message: ${e.message||""}`];return e.caller&&t.push(`\u{1F4CD} Caller: ${e.caller}`),t.push(""),e.rawArgs&&e.rawArgs.length>0&&(t.push("\u{1F4E6} Arguments:"),t.push(p(e.rawArgs)),t.push("")),(e.stack||e.errorStack)&&(t.push("\u{1F4DC} Stack Trace:"),t.push(e.stack||e.errorStack||""),t.push("")),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push("Generated by React Native InApp Inspector"),t.join(`
|
|
7
|
+
`)}async function r(e,n){try{await $.share({title:e,message:n},{dialogTitle:e})}catch(t){t?.message!=="User did not share"&&l.alert("Share Error",t?.message||"Failed to open share sheet")}}export async function shareApiReport(e){const n=formatApiReport(e),t=`API: ${e.method||"GET"} ${e.url?.substring(0,40)||""}`;await r(t,n)}export async function sharePushReport(e){const n=formatPushReport(e),t=`Push: ${e.title||e.id||"Notification"}`;await r(t,n)}export async function shareCrashReport(e){const n=formatCrashReport(e),t=`Crash: ${e.name||e.message||"Error"}`;await r(t,n)}export async function shareAnalyticsReport(e){const n=formatAnalyticsReport(e),t=`Analytics: ${e.name||"Event"}`;await r(t,n)}export async function shareReduxReport(e){const n=formatReduxReport(e),t=`Redux: ${e.type||"Action"}`;await r(t,n)}export async function shareLogReport(e){const n=formatLogReport(e),t=`Log: ${(e.type||"info").toUpperCase()} - ${e.message?.substring(0,30)||""}`;await r(t,n)}export function formatSocketReport(e){const n=(e.client||"websocket").toUpperCase(),t=(e.status||"open").toUpperCase(),u=e.duration!=null?`${e.duration}ms`:"Active / Open",o=i(e.startTime||Date.now()),s=["\u{1F50C} WEBSOCKET / SOCKET.IO REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4E1} Client: ${n}`,`\u{1F310} URL: ${e.url||"N/A"}`,`\u26A1 Status: ${t}`,`\u23F1\uFE0F Connected: ${o}`,`\u23F3 Duration: ${u}`,`\u{1F4E6} Total Frames: ${e.frames?.length||0} (${e.sentCount||0} sent, ${e.receivedCount||0} recvd)`,`\u{1F4CA} Data Size: ${(e.totalBytesSent||0)+(e.totalBytesReceived||0)} bytes`];return e.protocols&&s.push(`\u{1F4DC} Protocols: ${Array.isArray(e.protocols)?e.protocols.join(", "):e.protocols}`),e.closeCode!=null&&s.push(`\u{1F6D1} Close Code: ${e.closeCode} (${e.closeReason||"N/A"})`),e.error&&s.push(`\u274C Error: ${e.error}`),e.caller&&s.push(`\u{1F4CD} Caller: ${e.caller}`),e.query&&Object.keys(e.query).length>0&&(s.push(""),s.push("\u{1F50D} Query Parameters:"),s.push(p(e.query))),e.frames&&e.frames.length>0&&(s.push(""),s.push("\u{1F4AC} Recent Message Frames:"),e.frames.slice(-10).forEach((a,h)=>{const m=a.direction==="send"?"\u2B06\uFE0F SEND":"\u2B07\uFE0F RECV",f=a.eventName?` [${a.eventName}]`:"";s.push(`--- Frame #${h+1} (${m}${f}, ${a.type}, ${a.size||0}B) ---`),s.push(p(a.data))})),s.push(""),s.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),s.push("Generated by React Native InApp Inspector"),s.join(`
|
|
8
|
+
`)}export async function shareSocketReport(e){const n=formatSocketReport(e),t=`Socket: ${e.client?.toUpperCase()||"WS"} ${e.url?.substring(0,35)||""}`;await r(t,n)}
|