react-native-debug-toolkit 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -92
- package/README.zh-CN.md +50 -88
- package/lib/commonjs/core/DebugToolkit.js +33 -11
- package/lib/commonjs/core/DebugToolkit.js.map +1 -1
- package/lib/commonjs/core/DebugToolkitProvider.js +18 -12
- package/lib/commonjs/core/DebugToolkitProvider.js.map +1 -1
- package/lib/commonjs/{initialize.js → core/initialize.js} +17 -17
- package/lib/commonjs/core/initialize.js.map +1 -0
- package/lib/commonjs/{components → features/clipboard}/ClipboardTab.js +2 -2
- package/lib/commonjs/features/clipboard/ClipboardTab.js.map +1 -0
- package/lib/commonjs/features/{ClipboardFeature.js → clipboard/index.js} +3 -3
- package/lib/commonjs/features/clipboard/index.js.map +1 -0
- package/lib/commonjs/{components → features/console}/ConsoleLogTab.js +9 -9
- package/lib/commonjs/features/console/ConsoleLogTab.js.map +1 -0
- package/lib/commonjs/features/{ConsoleLogFeature.js → console/index.js} +10 -7
- package/lib/commonjs/features/console/index.js.map +1 -0
- package/lib/commonjs/{components → features/environment}/EnvironmentTab.js +3 -3
- package/lib/commonjs/features/environment/EnvironmentTab.js.map +1 -0
- package/lib/commonjs/features/{EnvironmentFeature.js → environment/index.js} +18 -13
- package/lib/commonjs/features/environment/index.js.map +1 -0
- package/lib/commonjs/{components → features/navigation}/NavigationLogTab.js +4 -3
- package/lib/commonjs/features/navigation/NavigationLogTab.js.map +1 -0
- package/lib/commonjs/features/{NavigationLogFeature.js → navigation/index.js} +4 -4
- package/lib/commonjs/features/navigation/index.js.map +1 -0
- package/lib/commonjs/{hooks → features/navigation}/useNavigationLogger.js +3 -3
- package/lib/commonjs/features/navigation/useNavigationLogger.js.map +1 -0
- package/lib/commonjs/{components → features/network}/NetworkLogTab.js +8 -7
- package/lib/commonjs/features/network/NetworkLogTab.js.map +1 -0
- package/lib/commonjs/features/{NetworkFeature.js → network/index.js} +20 -31
- package/lib/commonjs/features/network/index.js.map +1 -0
- package/lib/commonjs/features/network/networkInterceptor.js +261 -0
- package/lib/commonjs/features/network/networkInterceptor.js.map +1 -0
- package/lib/commonjs/{components → features/thirdPartyLibs}/ThirdPartyLibsTab.js +3 -2
- package/lib/commonjs/features/thirdPartyLibs/ThirdPartyLibsTab.js.map +1 -0
- package/lib/commonjs/features/{ThirdPartyLibsFeature.js → thirdPartyLibs/index.js} +8 -8
- package/lib/commonjs/features/thirdPartyLibs/index.js.map +1 -0
- package/lib/commonjs/{native/NativeDebugLibs.js → features/thirdPartyLibs/nativeDebugLibs.js} +1 -1
- package/lib/commonjs/features/thirdPartyLibs/nativeDebugLibs.js.map +1 -0
- package/lib/commonjs/{components → features/track}/TrackLogTab.js +8 -8
- package/lib/commonjs/features/track/TrackLogTab.js.map +1 -0
- package/lib/commonjs/features/{TrackFeature.js → track/index.js} +10 -5
- package/lib/commonjs/features/track/index.js.map +1 -0
- package/lib/commonjs/{components → features/zustand}/ZustandLogTab.js +8 -8
- package/lib/commonjs/features/zustand/ZustandLogTab.js.map +1 -0
- package/lib/commonjs/features/{ZustandLogFeature.js → zustand/index.js} +4 -4
- package/lib/commonjs/features/zustand/index.js.map +1 -0
- package/lib/commonjs/index.js +21 -21
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/types/environment.js +2 -0
- package/lib/commonjs/types/environment.js.map +1 -0
- package/lib/commonjs/types/feature.js +6 -0
- package/lib/commonjs/types/feature.js.map +1 -0
- package/lib/commonjs/types/index.js +0 -4
- package/lib/commonjs/types/logs.js +2 -0
- package/lib/commonjs/types/logs.js.map +1 -0
- package/lib/commonjs/types/navigation.js +2 -0
- package/lib/commonjs/types/navigation.js.map +1 -0
- package/lib/commonjs/types/thirdPartyLibs.js +2 -0
- package/lib/commonjs/types/thirdPartyLibs.js.map +1 -0
- package/lib/commonjs/{components → ui}/DebugView.js +2 -2
- package/lib/commonjs/ui/DebugView.js.map +1 -0
- package/lib/commonjs/{components → ui/floating}/FloatIcon.js +65 -12
- package/lib/commonjs/ui/floating/FloatIcon.js.map +1 -0
- package/lib/commonjs/{components → ui/panel}/DebugPanel.js +4 -4
- package/lib/commonjs/ui/panel/DebugPanel.js.map +1 -0
- package/lib/commonjs/{components → ui/panel}/FeatureTabBar.js +1 -1
- package/lib/commonjs/ui/panel/FeatureTabBar.js.map +1 -0
- package/lib/commonjs/{components → ui/panel}/FloatPanelView.js +36 -12
- package/lib/commonjs/ui/panel/FloatPanelView.js.map +1 -0
- package/lib/commonjs/{components → ui}/shared/CollapsibleSection.js +1 -1
- package/lib/commonjs/ui/shared/CollapsibleSection.js.map +1 -0
- package/lib/commonjs/{components → ui}/shared/CopyButton.js +1 -1
- package/lib/commonjs/ui/shared/CopyButton.js.map +1 -0
- package/lib/commonjs/ui/shared/JsonView.js.map +1 -0
- package/lib/commonjs/{components → ui}/shared/LogListScreen.js +2 -2
- package/lib/commonjs/ui/shared/LogListScreen.js.map +1 -0
- package/lib/commonjs/ui/shared/useSlideDetailAnimation.js.map +1 -0
- package/lib/commonjs/{utils → ui/theme}/colors.js +0 -5
- package/lib/commonjs/ui/theme/colors.js.map +1 -0
- package/lib/commonjs/ui/theme/layout.js.map +1 -0
- package/lib/commonjs/utils/createChannelFeature.js +18 -4
- package/lib/commonjs/utils/createChannelFeature.js.map +1 -1
- package/lib/commonjs/utils/createObservableStore.js +5 -0
- package/lib/commonjs/utils/createObservableStore.js.map +1 -1
- package/lib/commonjs/utils/createPersistedObservableStore.js +71 -0
- package/lib/commonjs/utils/createPersistedObservableStore.js.map +1 -0
- package/lib/commonjs/utils/debugPreferences.js +52 -0
- package/lib/commonjs/utils/debugPreferences.js.map +1 -0
- package/lib/module/core/DebugToolkit.js +33 -11
- package/lib/module/core/DebugToolkit.js.map +1 -1
- package/lib/module/core/DebugToolkitProvider.js +18 -12
- package/lib/module/core/DebugToolkitProvider.js.map +1 -1
- package/lib/module/{initialize.js → core/initialize.js} +10 -10
- package/lib/module/core/initialize.js.map +1 -0
- package/lib/module/{components → features/clipboard}/ClipboardTab.js +2 -2
- package/lib/module/features/clipboard/ClipboardTab.js.map +1 -0
- package/lib/module/features/{ClipboardFeature.js → clipboard/index.js} +3 -3
- package/lib/module/features/clipboard/index.js.map +1 -0
- package/lib/module/{components → features/console}/ConsoleLogTab.js +9 -9
- package/lib/module/features/console/ConsoleLogTab.js.map +1 -0
- package/lib/module/features/{ConsoleLogFeature.js → console/index.js} +10 -7
- package/lib/module/features/console/index.js.map +1 -0
- package/lib/module/{components → features/environment}/EnvironmentTab.js +3 -3
- package/lib/module/features/environment/EnvironmentTab.js.map +1 -0
- package/lib/module/features/{EnvironmentFeature.js → environment/index.js} +18 -13
- package/lib/module/features/environment/index.js.map +1 -0
- package/lib/module/{components → features/navigation}/NavigationLogTab.js +4 -3
- package/lib/module/features/navigation/NavigationLogTab.js.map +1 -0
- package/lib/module/features/{NavigationLogFeature.js → navigation/index.js} +4 -4
- package/lib/module/features/navigation/index.js.map +1 -0
- package/lib/module/{hooks → features/navigation}/useNavigationLogger.js +2 -2
- package/lib/module/features/navigation/useNavigationLogger.js.map +1 -0
- package/lib/module/{components → features/network}/NetworkLogTab.js +8 -7
- package/lib/module/features/network/NetworkLogTab.js.map +1 -0
- package/lib/module/features/{NetworkFeature.js → network/index.js} +20 -31
- package/lib/module/features/network/index.js.map +1 -0
- package/lib/module/features/network/networkInterceptor.js +256 -0
- package/lib/module/features/network/networkInterceptor.js.map +1 -0
- package/lib/module/{components → features/thirdPartyLibs}/ThirdPartyLibsTab.js +3 -2
- package/lib/module/features/thirdPartyLibs/ThirdPartyLibsTab.js.map +1 -0
- package/lib/module/features/{ThirdPartyLibsFeature.js → thirdPartyLibs/index.js} +4 -4
- package/lib/module/features/thirdPartyLibs/index.js.map +1 -0
- package/lib/module/{native/NativeDebugLibs.js → features/thirdPartyLibs/nativeDebugLibs.js} +1 -1
- package/lib/module/features/thirdPartyLibs/nativeDebugLibs.js.map +1 -0
- package/lib/module/{components → features/track}/TrackLogTab.js +8 -8
- package/lib/module/features/track/TrackLogTab.js.map +1 -0
- package/lib/module/features/{TrackFeature.js → track/index.js} +10 -5
- package/lib/module/features/track/index.js.map +1 -0
- package/lib/module/{components → features/zustand}/ZustandLogTab.js +8 -8
- package/lib/module/features/zustand/ZustandLogTab.js.map +1 -0
- package/lib/module/features/{ZustandLogFeature.js → zustand/index.js} +4 -4
- package/lib/module/features/zustand/index.js.map +1 -0
- package/lib/module/index.js +11 -11
- package/lib/module/index.js.map +1 -1
- package/lib/module/types/environment.js +2 -0
- package/lib/module/types/environment.js.map +1 -0
- package/lib/module/types/feature.js +4 -0
- package/lib/module/types/feature.js.map +1 -0
- package/lib/module/types/index.js +0 -2
- package/lib/module/types/logs.js +2 -0
- package/lib/module/types/logs.js.map +1 -0
- package/lib/module/types/navigation.js +2 -0
- package/lib/module/types/navigation.js.map +1 -0
- package/lib/module/types/thirdPartyLibs.js +2 -0
- package/lib/module/types/thirdPartyLibs.js.map +1 -0
- package/lib/module/{components → ui}/DebugView.js +2 -2
- package/lib/module/ui/DebugView.js.map +1 -0
- package/lib/module/{components → ui/floating}/FloatIcon.js +66 -13
- package/lib/module/ui/floating/FloatIcon.js.map +1 -0
- package/lib/module/{components → ui/panel}/DebugPanel.js +4 -4
- package/lib/module/ui/panel/DebugPanel.js.map +1 -0
- package/lib/module/{components → ui/panel}/FeatureTabBar.js +1 -1
- package/lib/module/ui/panel/FeatureTabBar.js.map +1 -0
- package/lib/module/{components → ui/panel}/FloatPanelView.js +36 -12
- package/lib/module/ui/panel/FloatPanelView.js.map +1 -0
- package/lib/module/{components → ui}/shared/CollapsibleSection.js +1 -1
- package/lib/module/ui/shared/CollapsibleSection.js.map +1 -0
- package/lib/module/{components → ui}/shared/CopyButton.js +1 -1
- package/lib/module/ui/shared/CopyButton.js.map +1 -0
- package/lib/module/ui/shared/JsonView.js.map +1 -0
- package/lib/module/{components → ui}/shared/LogListScreen.js +2 -2
- package/lib/module/ui/shared/LogListScreen.js.map +1 -0
- package/lib/module/ui/shared/useSlideDetailAnimation.js.map +1 -0
- package/lib/module/{utils → ui/theme}/colors.js +0 -5
- package/lib/module/ui/theme/colors.js.map +1 -0
- package/lib/module/ui/theme/layout.js.map +1 -0
- package/lib/module/utils/createChannelFeature.js +18 -4
- package/lib/module/utils/createChannelFeature.js.map +1 -1
- package/lib/module/utils/createObservableStore.js +5 -0
- package/lib/module/utils/createObservableStore.js.map +1 -1
- package/lib/module/utils/createPersistedObservableStore.js +67 -0
- package/lib/module/utils/createPersistedObservableStore.js.map +1 -0
- package/lib/module/utils/debugPreferences.js +46 -0
- package/lib/module/utils/debugPreferences.js.map +1 -0
- package/lib/typescript/src/core/DebugToolkit.d.ts +7 -3
- package/lib/typescript/src/core/DebugToolkit.d.ts.map +1 -1
- package/lib/typescript/src/core/DebugToolkitProvider.d.ts +2 -2
- package/lib/typescript/src/core/DebugToolkitProvider.d.ts.map +1 -1
- package/lib/typescript/src/{initialize.d.ts → core/initialize.d.ts} +7 -7
- package/lib/typescript/src/core/initialize.d.ts.map +1 -0
- package/lib/typescript/src/features/clipboard/ClipboardTab.d.ts +4 -0
- package/lib/typescript/src/features/clipboard/ClipboardTab.d.ts.map +1 -0
- package/lib/typescript/src/features/{ClipboardFeature.d.ts → clipboard/index.d.ts} +3 -3
- package/lib/typescript/src/features/clipboard/index.d.ts.map +1 -0
- package/lib/typescript/src/{components → features/console}/ConsoleLogTab.d.ts +2 -2
- package/lib/typescript/src/features/console/ConsoleLogTab.d.ts.map +1 -0
- package/lib/typescript/src/features/{ConsoleLogFeature.d.ts → console/index.d.ts} +3 -3
- package/lib/typescript/src/features/console/index.d.ts.map +1 -0
- package/lib/typescript/src/{components → features/environment}/EnvironmentTab.d.ts +1 -1
- package/lib/typescript/src/features/environment/EnvironmentTab.d.ts.map +1 -0
- package/lib/typescript/src/features/{EnvironmentFeature.d.ts → environment/index.d.ts} +2 -2
- package/lib/typescript/src/features/environment/index.d.ts.map +1 -0
- package/lib/typescript/src/{components → features/navigation}/NavigationLogTab.d.ts +2 -2
- package/lib/typescript/src/features/navigation/NavigationLogTab.d.ts.map +1 -0
- package/lib/typescript/src/features/{NavigationLogFeature.d.ts → navigation/index.d.ts} +3 -3
- package/lib/typescript/src/features/navigation/index.d.ts.map +1 -0
- package/lib/typescript/src/{hooks → features/navigation}/useNavigationLogger.d.ts +1 -1
- package/lib/typescript/src/features/navigation/useNavigationLogger.d.ts.map +1 -0
- package/lib/typescript/src/{components → features/network}/NetworkLogTab.d.ts +2 -2
- package/lib/typescript/src/features/network/NetworkLogTab.d.ts.map +1 -0
- package/lib/typescript/src/features/network/index.d.ts +15 -0
- package/lib/typescript/src/features/network/index.d.ts.map +1 -0
- package/lib/typescript/src/features/network/networkInterceptor.d.ts +19 -0
- package/lib/typescript/src/features/network/networkInterceptor.d.ts.map +1 -0
- package/lib/typescript/src/{components → features/thirdPartyLibs}/ThirdPartyLibsTab.d.ts +2 -2
- package/lib/typescript/src/features/thirdPartyLibs/ThirdPartyLibsTab.d.ts.map +1 -0
- package/lib/typescript/src/features/thirdPartyLibs/index.d.ts +3 -0
- package/lib/typescript/src/features/thirdPartyLibs/index.d.ts.map +1 -0
- package/lib/typescript/src/{native/NativeDebugLibs.d.ts → features/thirdPartyLibs/nativeDebugLibs.d.ts} +1 -1
- package/lib/typescript/src/features/thirdPartyLibs/nativeDebugLibs.d.ts.map +1 -0
- package/lib/typescript/src/{components → features/track}/TrackLogTab.d.ts +2 -2
- package/lib/typescript/src/features/track/TrackLogTab.d.ts.map +1 -0
- package/lib/typescript/src/features/{TrackFeature.d.ts → track/index.d.ts} +3 -3
- package/lib/typescript/src/features/track/index.d.ts.map +1 -0
- package/lib/typescript/src/{components → features/zustand}/ZustandLogTab.d.ts +2 -2
- package/lib/typescript/src/features/zustand/ZustandLogTab.d.ts.map +1 -0
- package/lib/typescript/src/features/{ZustandLogFeature.d.ts → zustand/index.d.ts} +3 -3
- package/lib/typescript/src/features/zustand/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +19 -19
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/types/environment.d.ts +11 -0
- package/lib/typescript/src/types/environment.d.ts.map +1 -0
- package/lib/typescript/src/types/feature.d.ts +23 -0
- package/lib/typescript/src/types/feature.d.ts.map +1 -0
- package/lib/typescript/src/types/index.d.ts +5 -108
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/lib/typescript/src/types/logs.d.ts +51 -0
- package/lib/typescript/src/types/logs.d.ts.map +1 -0
- package/lib/typescript/src/types/navigation.d.ts +8 -0
- package/lib/typescript/src/types/navigation.d.ts.map +1 -0
- package/lib/typescript/src/types/thirdPartyLibs.d.ts +13 -0
- package/lib/typescript/src/types/thirdPartyLibs.d.ts.map +1 -0
- package/lib/typescript/src/{components → ui}/DebugView.d.ts +1 -1
- package/lib/typescript/src/ui/DebugView.d.ts.map +1 -0
- package/lib/typescript/src/ui/floating/FloatIcon.d.ts.map +1 -0
- package/lib/typescript/src/ui/panel/DebugPanel.d.ts.map +1 -0
- package/lib/typescript/src/ui/panel/FeatureTabBar.d.ts.map +1 -0
- package/lib/typescript/src/ui/panel/FloatPanelView.d.ts +12 -0
- package/lib/typescript/src/ui/panel/FloatPanelView.d.ts.map +1 -0
- package/lib/typescript/src/ui/shared/CollapsibleSection.d.ts.map +1 -0
- package/lib/typescript/src/ui/shared/CopyButton.d.ts.map +1 -0
- package/lib/typescript/src/ui/shared/JsonView.d.ts.map +1 -0
- package/lib/typescript/src/ui/shared/LogListScreen.d.ts.map +1 -0
- package/lib/typescript/src/ui/shared/useSlideDetailAnimation.d.ts.map +1 -0
- package/lib/typescript/src/ui/theme/colors.d.ts.map +1 -0
- package/lib/typescript/src/ui/theme/layout.d.ts.map +1 -0
- package/lib/typescript/src/utils/createChannelFeature.d.ts +12 -3
- package/lib/typescript/src/utils/createChannelFeature.d.ts.map +1 -1
- package/lib/typescript/src/utils/createObservableStore.d.ts +1 -0
- package/lib/typescript/src/utils/createObservableStore.d.ts.map +1 -1
- package/lib/typescript/src/utils/createPersistedObservableStore.d.ts +15 -0
- package/lib/typescript/src/utils/createPersistedObservableStore.d.ts.map +1 -0
- package/lib/typescript/src/utils/debugPreferences.d.ts +10 -0
- package/lib/typescript/src/utils/debugPreferences.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/core/DebugToolkit.tsx +37 -11
- package/src/core/DebugToolkitProvider.tsx +20 -13
- package/src/{initialize.ts → core/initialize.ts} +16 -16
- package/src/{components → features/clipboard}/ClipboardTab.tsx +4 -4
- package/src/features/{ClipboardFeature.ts → clipboard/index.ts} +4 -4
- package/src/{components → features/console}/ConsoleLogTab.tsx +10 -10
- package/src/features/{ConsoleLogFeature.ts → console/index.ts} +11 -8
- package/src/{components → features/environment}/EnvironmentTab.tsx +5 -5
- package/src/features/{EnvironmentFeature.ts → environment/index.ts} +23 -13
- package/src/{components → features/navigation}/NavigationLogTab.tsx +6 -5
- package/src/features/{NavigationLogFeature.ts → navigation/index.ts} +5 -5
- package/src/{hooks → features/navigation}/useNavigationLogger.ts +3 -3
- package/src/{components → features/network}/NetworkLogTab.tsx +10 -9
- package/src/features/{NetworkFeature.ts → network/index.ts} +26 -39
- package/src/features/network/networkInterceptor.ts +311 -0
- package/src/{components → features/thirdPartyLibs}/ThirdPartyLibsTab.tsx +5 -4
- package/src/features/{ThirdPartyLibsFeature.ts → thirdPartyLibs/index.ts} +5 -5
- package/src/{components → features/track}/TrackLogTab.tsx +9 -9
- package/src/features/{TrackFeature.ts → track/index.ts} +13 -6
- package/src/{components → features/zustand}/ZustandLogTab.tsx +10 -10
- package/src/features/{ZustandLogFeature.ts → zustand/index.ts} +5 -5
- package/src/index.ts +19 -19
- package/src/types/environment.ts +11 -0
- package/src/types/feature.ts +32 -0
- package/src/types/index.ts +29 -127
- package/src/types/logs.ts +54 -0
- package/src/types/navigation.ts +5 -0
- package/src/types/thirdPartyLibs.ts +13 -0
- package/src/{components → ui}/DebugView.tsx +3 -3
- package/src/{components → ui/floating}/FloatIcon.tsx +60 -29
- package/src/{components → ui/panel}/DebugPanel.tsx +4 -4
- package/src/{components → ui/panel}/FeatureTabBar.tsx +1 -1
- package/src/{components → ui/panel}/FloatPanelView.tsx +38 -13
- package/src/{components → ui}/shared/CollapsibleSection.tsx +1 -1
- package/src/{components → ui}/shared/CopyButton.tsx +1 -1
- package/src/{components → ui}/shared/LogListScreen.tsx +2 -2
- package/src/{utils → ui/theme}/colors.ts +0 -5
- package/src/utils/createChannelFeature.ts +32 -7
- package/src/utils/createObservableStore.ts +6 -0
- package/src/utils/createPersistedObservableStore.ts +76 -0
- package/src/utils/debugPreferences.ts +48 -0
- package/lib/commonjs/components/ClipboardTab.js.map +0 -1
- package/lib/commonjs/components/ConsoleLogTab.js.map +0 -1
- package/lib/commonjs/components/DebugPanel.js.map +0 -1
- package/lib/commonjs/components/DebugView.js.map +0 -1
- package/lib/commonjs/components/EnvironmentTab.js.map +0 -1
- package/lib/commonjs/components/FeatureTabBar.js.map +0 -1
- package/lib/commonjs/components/FloatIcon.js.map +0 -1
- package/lib/commonjs/components/FloatPanelView.js.map +0 -1
- package/lib/commonjs/components/NavigationLogTab.js.map +0 -1
- package/lib/commonjs/components/NetworkLogTab.js.map +0 -1
- package/lib/commonjs/components/ThirdPartyLibsTab.js.map +0 -1
- package/lib/commonjs/components/TrackLogTab.js.map +0 -1
- package/lib/commonjs/components/ZustandLogTab.js.map +0 -1
- package/lib/commonjs/components/shared/CollapsibleSection.js.map +0 -1
- package/lib/commonjs/components/shared/CopyButton.js.map +0 -1
- package/lib/commonjs/components/shared/JsonView.js.map +0 -1
- package/lib/commonjs/components/shared/LogListScreen.js.map +0 -1
- package/lib/commonjs/features/ClipboardFeature.js.map +0 -1
- package/lib/commonjs/features/ConsoleLogFeature.js.map +0 -1
- package/lib/commonjs/features/EnvironmentFeature.js.map +0 -1
- package/lib/commonjs/features/NavigationLogFeature.js.map +0 -1
- package/lib/commonjs/features/NetworkFeature.js.map +0 -1
- package/lib/commonjs/features/ThirdPartyLibsFeature.js.map +0 -1
- package/lib/commonjs/features/TrackFeature.js.map +0 -1
- package/lib/commonjs/features/ZustandLogFeature.js.map +0 -1
- package/lib/commonjs/hooks/useNavigationLogger.js.map +0 -1
- package/lib/commonjs/hooks/useSlideDetailAnimation.js.map +0 -1
- package/lib/commonjs/initialize.js.map +0 -1
- package/lib/commonjs/interceptors/networkInterceptor.js +0 -466
- package/lib/commonjs/interceptors/networkInterceptor.js.map +0 -1
- package/lib/commonjs/native/NativeDebugLibs.js.map +0 -1
- package/lib/commonjs/utils/colors.js.map +0 -1
- package/lib/commonjs/utils/layout.js.map +0 -1
- package/lib/module/components/ClipboardTab.js.map +0 -1
- package/lib/module/components/ConsoleLogTab.js.map +0 -1
- package/lib/module/components/DebugPanel.js.map +0 -1
- package/lib/module/components/DebugView.js.map +0 -1
- package/lib/module/components/EnvironmentTab.js.map +0 -1
- package/lib/module/components/FeatureTabBar.js.map +0 -1
- package/lib/module/components/FloatIcon.js.map +0 -1
- package/lib/module/components/FloatPanelView.js.map +0 -1
- package/lib/module/components/NavigationLogTab.js.map +0 -1
- package/lib/module/components/NetworkLogTab.js.map +0 -1
- package/lib/module/components/ThirdPartyLibsTab.js.map +0 -1
- package/lib/module/components/TrackLogTab.js.map +0 -1
- package/lib/module/components/ZustandLogTab.js.map +0 -1
- package/lib/module/components/shared/CollapsibleSection.js.map +0 -1
- package/lib/module/components/shared/CopyButton.js.map +0 -1
- package/lib/module/components/shared/JsonView.js.map +0 -1
- package/lib/module/components/shared/LogListScreen.js.map +0 -1
- package/lib/module/features/ClipboardFeature.js.map +0 -1
- package/lib/module/features/ConsoleLogFeature.js.map +0 -1
- package/lib/module/features/EnvironmentFeature.js.map +0 -1
- package/lib/module/features/NavigationLogFeature.js.map +0 -1
- package/lib/module/features/NetworkFeature.js.map +0 -1
- package/lib/module/features/ThirdPartyLibsFeature.js.map +0 -1
- package/lib/module/features/TrackFeature.js.map +0 -1
- package/lib/module/features/ZustandLogFeature.js.map +0 -1
- package/lib/module/hooks/useNavigationLogger.js.map +0 -1
- package/lib/module/hooks/useSlideDetailAnimation.js.map +0 -1
- package/lib/module/initialize.js.map +0 -1
- package/lib/module/interceptors/networkInterceptor.js +0 -460
- package/lib/module/interceptors/networkInterceptor.js.map +0 -1
- package/lib/module/native/NativeDebugLibs.js.map +0 -1
- package/lib/module/utils/colors.js.map +0 -1
- package/lib/module/utils/layout.js.map +0 -1
- package/lib/typescript/src/components/ClipboardTab.d.ts +0 -4
- package/lib/typescript/src/components/ClipboardTab.d.ts.map +0 -1
- package/lib/typescript/src/components/ConsoleLogTab.d.ts.map +0 -1
- package/lib/typescript/src/components/DebugPanel.d.ts.map +0 -1
- package/lib/typescript/src/components/DebugView.d.ts.map +0 -1
- package/lib/typescript/src/components/EnvironmentTab.d.ts.map +0 -1
- package/lib/typescript/src/components/FeatureTabBar.d.ts.map +0 -1
- package/lib/typescript/src/components/FloatIcon.d.ts.map +0 -1
- package/lib/typescript/src/components/FloatPanelView.d.ts +0 -9
- package/lib/typescript/src/components/FloatPanelView.d.ts.map +0 -1
- package/lib/typescript/src/components/NavigationLogTab.d.ts.map +0 -1
- package/lib/typescript/src/components/NetworkLogTab.d.ts.map +0 -1
- package/lib/typescript/src/components/ThirdPartyLibsTab.d.ts.map +0 -1
- package/lib/typescript/src/components/TrackLogTab.d.ts.map +0 -1
- package/lib/typescript/src/components/ZustandLogTab.d.ts.map +0 -1
- package/lib/typescript/src/components/shared/CollapsibleSection.d.ts.map +0 -1
- package/lib/typescript/src/components/shared/CopyButton.d.ts.map +0 -1
- package/lib/typescript/src/components/shared/JsonView.d.ts.map +0 -1
- package/lib/typescript/src/components/shared/LogListScreen.d.ts.map +0 -1
- package/lib/typescript/src/features/ClipboardFeature.d.ts.map +0 -1
- package/lib/typescript/src/features/ConsoleLogFeature.d.ts.map +0 -1
- package/lib/typescript/src/features/EnvironmentFeature.d.ts.map +0 -1
- package/lib/typescript/src/features/NavigationLogFeature.d.ts.map +0 -1
- package/lib/typescript/src/features/NetworkFeature.d.ts +0 -15
- package/lib/typescript/src/features/NetworkFeature.d.ts.map +0 -1
- package/lib/typescript/src/features/ThirdPartyLibsFeature.d.ts +0 -3
- package/lib/typescript/src/features/ThirdPartyLibsFeature.d.ts.map +0 -1
- package/lib/typescript/src/features/TrackFeature.d.ts.map +0 -1
- package/lib/typescript/src/features/ZustandLogFeature.d.ts.map +0 -1
- package/lib/typescript/src/hooks/useNavigationLogger.d.ts.map +0 -1
- package/lib/typescript/src/hooks/useSlideDetailAnimation.d.ts.map +0 -1
- package/lib/typescript/src/initialize.d.ts.map +0 -1
- package/lib/typescript/src/interceptors/networkInterceptor.d.ts +0 -18
- package/lib/typescript/src/interceptors/networkInterceptor.d.ts.map +0 -1
- package/lib/typescript/src/native/NativeDebugLibs.d.ts.map +0 -1
- package/lib/typescript/src/utils/colors.d.ts.map +0 -1
- package/lib/typescript/src/utils/layout.d.ts.map +0 -1
- package/src/interceptors/networkInterceptor.ts +0 -646
- /package/lib/commonjs/{components → ui}/shared/JsonView.js +0 -0
- /package/lib/commonjs/{hooks → ui/shared}/useSlideDetailAnimation.js +0 -0
- /package/lib/commonjs/{utils → ui/theme}/layout.js +0 -0
- /package/lib/module/{components → ui}/shared/JsonView.js +0 -0
- /package/lib/module/{hooks → ui/shared}/useSlideDetailAnimation.js +0 -0
- /package/lib/module/{utils → ui/theme}/layout.js +0 -0
- /package/lib/typescript/src/{components → ui/floating}/FloatIcon.d.ts +0 -0
- /package/lib/typescript/src/{components → ui/panel}/DebugPanel.d.ts +0 -0
- /package/lib/typescript/src/{components → ui/panel}/FeatureTabBar.d.ts +0 -0
- /package/lib/typescript/src/{components → ui}/shared/CollapsibleSection.d.ts +0 -0
- /package/lib/typescript/src/{components → ui}/shared/CopyButton.d.ts +0 -0
- /package/lib/typescript/src/{components → ui}/shared/JsonView.d.ts +0 -0
- /package/lib/typescript/src/{components → ui}/shared/LogListScreen.d.ts +0 -0
- /package/lib/typescript/src/{hooks → ui/shared}/useSlideDetailAnimation.d.ts +0 -0
- /package/lib/typescript/src/{utils → ui/theme}/colors.d.ts +0 -0
- /package/lib/typescript/src/{utils → ui/theme}/layout.d.ts +0 -0
- /package/src/{native/NativeDebugLibs.ts → features/thirdPartyLibs/nativeDebugLibs.ts} +0 -0
- /package/src/{components → ui}/shared/JsonView.tsx +0 -0
- /package/src/{hooks → ui/shared}/useSlideDetailAnimation.ts +0 -0
- /package/src/{utils → ui/theme}/layout.ts +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ZustandLogFeature.d.ts","sourceRoot":"","sources":["../../../../src/features/ZustandLogFeature.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAQ9D,eAAO,MAAM,aAAa,GACxB,QAAQ,MAAM,EACd,WAAW,OAAO,EAClB,WAAW,OAAO,EAClB,qBAAqB,MAAM,EAC3B,YAAY,MAAM,KACjB,IASF,CAAC;AAIF,KAAK,eAAe,CAAC,CAAC,IAAI,CACxB,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EACxD,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,EAC7B,MAAM,CAAC,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,KAC5C,IAAI,CAAC;AAEV,KAAK,eAAe,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC;AAElC,UAAU,eAAe,CAAC,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC,CAAC;IAClB,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;IAC7B,SAAS,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,KAAK,IAAI,KAAK,MAAM,IAAI,CAAC;IACtE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,KAAK,aAAa,CAAC,CAAC,IAAI,CACtB,GAAG,EAAE,eAAe,CAAC,CAAC,CAAC,EACvB,GAAG,EAAE,eAAe,CAAC,CAAC,CAAC,EACvB,GAAG,EAAE,eAAe,CAAC,CAAC,CAAC,KACpB,CAAC,CAAC;AAEP;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,GAAI,CAAC,EAAE,QAAQ,aAAa,CAAC,CAAC,CAAC,MAC9D,KAAK,eAAe,CAAC,CAAC,CAAC,EACvB,KAAK,eAAe,CAAC,CAAC,CAAC,EACvB,KAAK,eAAe,CAAC,CAAC,CAAC,MAqBtB,CAAC;AAIJ,MAAM,WAAW,oBAAoB;IACnC,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,uBAAuB,GAAI,SAAS,oBAAoB,KAAG,YAAY,CAAC,eAAe,CAKjG,CAAC;AAEJ,2CAA2C;AAC3C,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useNavigationLogger.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useNavigationLogger.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAyBvD;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,KAAK,CAAC,SAAS,CAAC,sBAAsB,GAAG,IAAI,CAAC,QA+DhG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useSlideDetailAnimation.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useSlideDetailAnimation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,EACvC,QAAQ,EAAE,CAAC,GAAG,IAAI,GACjB;IACD,gBAAgB,EAAE,QAAQ,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACzD,cAAc,EAAE,QAAQ,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACvD,WAAW,EAAE,QAAQ,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;CACrD,CA+BA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../../src/initialize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAE/E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAMzE,yCAAyC;AACzC,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,OAAO,GAAG,oBAAoB,CAAC;IACzC,OAAO,CAAC,EAAE,OAAO,GAAG,oBAAoB,CAAC;IACzC,OAAO,CAAC,EAAE,OAAO,GAAG,oBAAoB,CAAC;IACzC,UAAU,CAAC,EAAE,OAAO,GAAG,uBAAuB,CAAC;IAC/C,KAAK,CAAC,EAAE,OAAO,GAAG,kBAAkB,CAAC;IACrC,WAAW,CAAC,EAAE,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7D,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAmDD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,YAAY,CA4BrB"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { NetworkLogEntry } from '../types';
|
|
2
|
-
type NetworkLogPayload = Omit<NetworkLogEntry, 'id'>;
|
|
3
|
-
interface AxiosInterceptorManager {
|
|
4
|
-
use: (onFulfilled: unknown, onRejected?: unknown) => number | void;
|
|
5
|
-
eject?: (id: number) => void;
|
|
6
|
-
}
|
|
7
|
-
export interface AxiosInstanceLike {
|
|
8
|
-
interceptors: {
|
|
9
|
-
request: AxiosInterceptorManager;
|
|
10
|
-
response: AxiosInterceptorManager;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
export declare function startFetch(emit: (entry: NetworkLogPayload) => void): () => void;
|
|
14
|
-
export declare function startXMLHttpRequest(emit: (entry: NetworkLogPayload) => void): () => void;
|
|
15
|
-
export declare function setupAxios(axiosInstance: AxiosInstanceLike, emit: (entry: NetworkLogPayload) => void): () => void;
|
|
16
|
-
export declare function resetInterceptors(): void;
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=networkInterceptor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"networkInterceptor.d.ts","sourceRoot":"","sources":["../../../../src/interceptors/networkInterceptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGhD,KAAK,iBAAiB,GAAG,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;AAIrD,UAAU,uBAAuB;IAC/B,GAAG,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,OAAO,KAAK,MAAM,GAAG,IAAI,CAAC;IACnE,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B;AAwBD,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE;QACZ,OAAO,EAAE,uBAAuB,CAAC;QACjC,QAAQ,EAAE,uBAAuB,CAAC;KACnC,CAAC;CACH;AAoOD,wBAAgB,UAAU,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,GAAG,MAAM,IAAI,CA+D/E;AAqGD,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,GACvC,MAAM,IAAI,CA6FZ;AAoBD,wBAAgB,UAAU,CACxB,aAAa,EAAE,iBAAiB,EAChC,IAAI,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,GACvC,MAAM,IAAI,CAsFZ;AAED,wBAAgB,iBAAiB,IAAI,IAAI,CAQxC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NativeDebugLibs.d.ts","sourceRoot":"","sources":["../../../../src/native/NativeDebugLibs.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,eAAe;oBACV,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;wBAOlB,MAAM,GAAG,IAAI;oBAOjB,OAAO;oBASP,IAAI;oBAMJ,IAAI;kCAOU,MAAM,GAAG,IAAI;uBAMxB,IAAI;uBAMJ,IAAI;CAKxB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../../../src/utils/colors.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;CAyBT,CAAC;AAEX,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CASrD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../src/utils/layout.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,KAAK,CAAC"}
|
|
@@ -1,646 +0,0 @@
|
|
|
1
|
-
import type { NetworkLogEntry } from '../types';
|
|
2
|
-
import { urlRewriter } from '../utils/urlRewriterRegistry';
|
|
3
|
-
|
|
4
|
-
type NetworkLogPayload = Omit<NetworkLogEntry, 'id'>;
|
|
5
|
-
|
|
6
|
-
// ─── Axios types ───────────────────────────────────────
|
|
7
|
-
|
|
8
|
-
interface AxiosInterceptorManager {
|
|
9
|
-
use: (onFulfilled: unknown, onRejected?: unknown) => number | void;
|
|
10
|
-
eject?: (id: number) => void;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface AxiosRequestConfigLike {
|
|
14
|
-
baseURL?: string;
|
|
15
|
-
url?: string;
|
|
16
|
-
method?: string;
|
|
17
|
-
headers?: Record<string, string>;
|
|
18
|
-
data?: unknown;
|
|
19
|
-
params?: unknown;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
interface AxiosResponseLike {
|
|
23
|
-
status: number;
|
|
24
|
-
statusText: string;
|
|
25
|
-
headers?: Record<string, string>;
|
|
26
|
-
data?: unknown;
|
|
27
|
-
config: AxiosRequestConfigLike;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
interface AxiosErrorLike {
|
|
31
|
-
message: string;
|
|
32
|
-
config?: AxiosRequestConfigLike;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface AxiosInstanceLike {
|
|
36
|
-
interceptors: {
|
|
37
|
-
request: AxiosInterceptorManager;
|
|
38
|
-
response: AxiosInterceptorManager;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
interface AxiosRegistration {
|
|
43
|
-
refCount: number;
|
|
44
|
-
requestId?: number;
|
|
45
|
-
responseId?: number;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// ─── XMLHttpRequest types ─────────────────────────────
|
|
49
|
-
|
|
50
|
-
type XhrOpen = (
|
|
51
|
-
this: XMLHttpRequestLike,
|
|
52
|
-
method: string,
|
|
53
|
-
url: string,
|
|
54
|
-
async?: boolean,
|
|
55
|
-
username?: string | null,
|
|
56
|
-
password?: string | null,
|
|
57
|
-
) => void;
|
|
58
|
-
|
|
59
|
-
type XhrSend = (this: XMLHttpRequestLike, body?: unknown) => void;
|
|
60
|
-
type XhrSetRequestHeader = (
|
|
61
|
-
this: XMLHttpRequestLike,
|
|
62
|
-
name: string,
|
|
63
|
-
value: string,
|
|
64
|
-
) => void;
|
|
65
|
-
type XhrEventListener = (event?: unknown) => void;
|
|
66
|
-
type XhrHandler = ((this: XMLHttpRequestLike, event?: unknown) => void) | null;
|
|
67
|
-
|
|
68
|
-
interface XMLHttpRequestLike {
|
|
69
|
-
status?: number;
|
|
70
|
-
statusText?: string;
|
|
71
|
-
response?: unknown;
|
|
72
|
-
responseText?: string;
|
|
73
|
-
responseType?: string;
|
|
74
|
-
readyState?: number;
|
|
75
|
-
DONE?: number;
|
|
76
|
-
open: XhrOpen;
|
|
77
|
-
send: XhrSend;
|
|
78
|
-
setRequestHeader?: XhrSetRequestHeader;
|
|
79
|
-
getAllResponseHeaders?: () => string;
|
|
80
|
-
addEventListener?: (event: string, listener: XhrEventListener) => void;
|
|
81
|
-
removeEventListener?: (event: string, listener: XhrEventListener) => void;
|
|
82
|
-
onreadystatechange?: XhrHandler;
|
|
83
|
-
onloadend?: XhrHandler;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
interface XMLHttpRequestConstructorLike {
|
|
87
|
-
new (): XMLHttpRequestLike;
|
|
88
|
-
prototype: XMLHttpRequestLike;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
interface XMLHttpRequestRegistration {
|
|
92
|
-
constructor: XMLHttpRequestConstructorLike;
|
|
93
|
-
open: XhrOpen;
|
|
94
|
-
send: XhrSend;
|
|
95
|
-
setRequestHeader?: XhrSetRequestHeader;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
interface XhrRequestState {
|
|
99
|
-
method: string;
|
|
100
|
-
url: string;
|
|
101
|
-
headers: Record<string, string>;
|
|
102
|
-
body?: unknown;
|
|
103
|
-
startTime: number;
|
|
104
|
-
timestamp: number;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// ─── Shared helpers ────────────────────────────────────
|
|
108
|
-
|
|
109
|
-
function rewriteUrl(url: string): string {
|
|
110
|
-
const rewriter = urlRewriter.get();
|
|
111
|
-
if (!rewriter) {
|
|
112
|
-
return url;
|
|
113
|
-
}
|
|
114
|
-
try {
|
|
115
|
-
return rewriter(url);
|
|
116
|
-
} catch {
|
|
117
|
-
return url;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
function headersToObject(
|
|
122
|
-
headers: Record<string, string> | Headers | undefined,
|
|
123
|
-
): Record<string, string> {
|
|
124
|
-
const result: Record<string, string> = {};
|
|
125
|
-
if (!headers) {
|
|
126
|
-
return result;
|
|
127
|
-
}
|
|
128
|
-
if (typeof (headers as Headers).forEach === 'function') {
|
|
129
|
-
(headers as Headers).forEach((value: string, key: string) => {
|
|
130
|
-
result[key] = value;
|
|
131
|
-
});
|
|
132
|
-
return result;
|
|
133
|
-
}
|
|
134
|
-
Object.keys(headers).forEach((key) => {
|
|
135
|
-
result[key] = (headers as Record<string, string>)[key]!;
|
|
136
|
-
});
|
|
137
|
-
return result;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
function getRequestSnapshot(
|
|
141
|
-
input: unknown,
|
|
142
|
-
init?: RequestInit,
|
|
143
|
-
): NetworkLogEntry['request'] {
|
|
144
|
-
const request = input instanceof Request ? input : null;
|
|
145
|
-
return {
|
|
146
|
-
url: typeof input === 'string' ? input : request?.url ?? String(input),
|
|
147
|
-
method: (init?.method || request?.method || 'GET').toUpperCase(),
|
|
148
|
-
headers: init?.headers
|
|
149
|
-
? headersToObject(init.headers as Record<string, string> | Headers)
|
|
150
|
-
: request?.headers
|
|
151
|
-
? headersToObject(request.headers)
|
|
152
|
-
: undefined,
|
|
153
|
-
body: init?.body,
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
async function parseResponseBody(response: Response): Promise<unknown> {
|
|
158
|
-
const raw = await response.clone().text();
|
|
159
|
-
if (!raw) {
|
|
160
|
-
return undefined;
|
|
161
|
-
}
|
|
162
|
-
try {
|
|
163
|
-
return JSON.parse(raw);
|
|
164
|
-
} catch {
|
|
165
|
-
return raw;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
function parseMaybeJson(raw: string): unknown {
|
|
170
|
-
if (!raw) {
|
|
171
|
-
return undefined;
|
|
172
|
-
}
|
|
173
|
-
try {
|
|
174
|
-
return JSON.parse(raw);
|
|
175
|
-
} catch {
|
|
176
|
-
return raw;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
function parseRawHeaders(rawHeaders: string | undefined): Record<string, string> | undefined {
|
|
181
|
-
if (!rawHeaders) {
|
|
182
|
-
return undefined;
|
|
183
|
-
}
|
|
184
|
-
const headers: Record<string, string> = {};
|
|
185
|
-
rawHeaders.split(/\r?\n/).forEach((line) => {
|
|
186
|
-
const separatorIndex = line.indexOf(':');
|
|
187
|
-
if (separatorIndex <= 0) {
|
|
188
|
-
return;
|
|
189
|
-
}
|
|
190
|
-
const key = line.slice(0, separatorIndex).trim();
|
|
191
|
-
const value = line.slice(separatorIndex + 1).trim();
|
|
192
|
-
if (!key) {
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
headers[key] = value;
|
|
196
|
-
});
|
|
197
|
-
return Object.keys(headers).length > 0 ? headers : undefined;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
function getXMLHttpRequestConstructor(): XMLHttpRequestConstructorLike | undefined {
|
|
201
|
-
const globalWithXhr = globalThis as unknown as { XMLHttpRequest?: unknown };
|
|
202
|
-
const candidate = globalWithXhr.XMLHttpRequest;
|
|
203
|
-
if (typeof candidate !== 'function') {
|
|
204
|
-
return undefined;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
const prototype = (candidate as { prototype?: Partial<XMLHttpRequestLike> }).prototype;
|
|
208
|
-
if (
|
|
209
|
-
!prototype ||
|
|
210
|
-
typeof prototype.open !== 'function' ||
|
|
211
|
-
typeof prototype.send !== 'function'
|
|
212
|
-
) {
|
|
213
|
-
return undefined;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
return candidate as XMLHttpRequestConstructorLike;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
function getXhrResponseHeaders(xhr: XMLHttpRequestLike): Record<string, string> | undefined {
|
|
220
|
-
if (typeof xhr.getAllResponseHeaders !== 'function') {
|
|
221
|
-
return undefined;
|
|
222
|
-
}
|
|
223
|
-
try {
|
|
224
|
-
return parseRawHeaders(xhr.getAllResponseHeaders());
|
|
225
|
-
} catch {
|
|
226
|
-
return undefined;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
function getXhrResponseData(xhr: XMLHttpRequestLike): unknown {
|
|
231
|
-
const responseType = typeof xhr.responseType === 'string' ? xhr.responseType : '';
|
|
232
|
-
if (responseType === 'json') {
|
|
233
|
-
return xhr.response;
|
|
234
|
-
}
|
|
235
|
-
if (responseType && responseType !== 'text') {
|
|
236
|
-
return undefined;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
try {
|
|
240
|
-
if (typeof xhr.responseText === 'string') {
|
|
241
|
-
return parseMaybeJson(xhr.responseText);
|
|
242
|
-
}
|
|
243
|
-
} catch {
|
|
244
|
-
return undefined;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
return typeof xhr.response === 'string' ? parseMaybeJson(xhr.response) : xhr.response;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
// ─── Interceptor manager (encapsulated mutable state) ──
|
|
251
|
-
|
|
252
|
-
let originalFetch: typeof globalThis.fetch | null = null;
|
|
253
|
-
let fetchRefCount = 0;
|
|
254
|
-
const pendingAxiosRequests = new WeakMap<AxiosRequestConfigLike, { startTime: number; timestamp: number }>();
|
|
255
|
-
const axiosRegistrations = new WeakMap<AxiosInstanceLike, AxiosRegistration>();
|
|
256
|
-
let originalXMLHttpRequest: XMLHttpRequestRegistration | null = null;
|
|
257
|
-
let xhrRefCount = 0;
|
|
258
|
-
const pendingXhrRequests = new WeakMap<XMLHttpRequestLike, XhrRequestState>();
|
|
259
|
-
|
|
260
|
-
function stopFetch(): void {
|
|
261
|
-
fetchRefCount = Math.max(0, fetchRefCount - 1);
|
|
262
|
-
if (fetchRefCount === 0 && originalFetch) {
|
|
263
|
-
globalThis.fetch = originalFetch;
|
|
264
|
-
originalFetch = null;
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
export function startFetch(emit: (entry: NetworkLogPayload) => void): () => void {
|
|
269
|
-
fetchRefCount += 1;
|
|
270
|
-
if (originalFetch) {
|
|
271
|
-
return () => {
|
|
272
|
-
stopFetch();
|
|
273
|
-
};
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
originalFetch = globalThis.fetch;
|
|
277
|
-
|
|
278
|
-
globalThis.fetch = async function interceptedFetch(
|
|
279
|
-
input: Parameters<typeof fetch>[0],
|
|
280
|
-
init?: Parameters<typeof fetch>[1],
|
|
281
|
-
) {
|
|
282
|
-
const startTime = Date.now();
|
|
283
|
-
|
|
284
|
-
let rewrittenInput: typeof input = input;
|
|
285
|
-
if (urlRewriter.get()) {
|
|
286
|
-
if (typeof input === 'string') {
|
|
287
|
-
rewrittenInput = rewriteUrl(input);
|
|
288
|
-
} else if (input instanceof Request) {
|
|
289
|
-
rewrittenInput = new Request(rewriteUrl(input.url), input as RequestInit);
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
const request = getRequestSnapshot(rewrittenInput, init);
|
|
294
|
-
|
|
295
|
-
try {
|
|
296
|
-
const response = await originalFetch!.call(globalThis, rewrittenInput, init);
|
|
297
|
-
const duration = Date.now() - startTime;
|
|
298
|
-
|
|
299
|
-
try {
|
|
300
|
-
const data = await parseResponseBody(response);
|
|
301
|
-
emit({
|
|
302
|
-
timestamp: startTime,
|
|
303
|
-
duration,
|
|
304
|
-
request,
|
|
305
|
-
response: { status: response.status, statusText: response.statusText, data },
|
|
306
|
-
});
|
|
307
|
-
} catch {
|
|
308
|
-
emit({
|
|
309
|
-
timestamp: startTime,
|
|
310
|
-
duration,
|
|
311
|
-
request,
|
|
312
|
-
response: { status: response.status, statusText: response.statusText },
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
return response;
|
|
317
|
-
} catch (error) {
|
|
318
|
-
emit({
|
|
319
|
-
timestamp: startTime,
|
|
320
|
-
duration: Date.now() - startTime,
|
|
321
|
-
request,
|
|
322
|
-
error: error instanceof Error ? error.message : String(error),
|
|
323
|
-
});
|
|
324
|
-
throw error;
|
|
325
|
-
}
|
|
326
|
-
};
|
|
327
|
-
|
|
328
|
-
return () => {
|
|
329
|
-
stopFetch();
|
|
330
|
-
};
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
function emitXhrLog(
|
|
334
|
-
xhr: XMLHttpRequestLike,
|
|
335
|
-
emit: (entry: NetworkLogPayload) => void,
|
|
336
|
-
error?: string,
|
|
337
|
-
): void {
|
|
338
|
-
const pending = pendingXhrRequests.get(xhr);
|
|
339
|
-
if (!pending) {
|
|
340
|
-
return;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
const status = typeof xhr.status === 'number' ? xhr.status : 0;
|
|
344
|
-
const statusText = typeof xhr.statusText === 'string' ? xhr.statusText : undefined;
|
|
345
|
-
|
|
346
|
-
emit({
|
|
347
|
-
timestamp: pending.timestamp,
|
|
348
|
-
duration: Date.now() - pending.startTime,
|
|
349
|
-
request: {
|
|
350
|
-
url: pending.url,
|
|
351
|
-
method: pending.method,
|
|
352
|
-
headers: Object.keys(pending.headers).length > 0 ? pending.headers : undefined,
|
|
353
|
-
body: pending.body,
|
|
354
|
-
},
|
|
355
|
-
response: error
|
|
356
|
-
? undefined
|
|
357
|
-
: {
|
|
358
|
-
status,
|
|
359
|
-
statusText,
|
|
360
|
-
headers: getXhrResponseHeaders(xhr),
|
|
361
|
-
data: getXhrResponseData(xhr),
|
|
362
|
-
success: status >= 200 && status < 300,
|
|
363
|
-
},
|
|
364
|
-
error,
|
|
365
|
-
});
|
|
366
|
-
|
|
367
|
-
pendingXhrRequests.delete(xhr);
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
function isXhrDone(xhr: XMLHttpRequestLike): boolean {
|
|
371
|
-
return typeof xhr.readyState === 'number' && xhr.readyState === (xhr.DONE ?? 4);
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
function attachXhrCompletion(
|
|
375
|
-
xhr: XMLHttpRequestLike,
|
|
376
|
-
emit: (entry: NetworkLogPayload) => void,
|
|
377
|
-
): void {
|
|
378
|
-
let completed = false;
|
|
379
|
-
const finish = (error?: string) => {
|
|
380
|
-
if (completed) {
|
|
381
|
-
return;
|
|
382
|
-
}
|
|
383
|
-
completed = true;
|
|
384
|
-
if (typeof xhr.removeEventListener === 'function') {
|
|
385
|
-
xhr.removeEventListener('loadend', onLoadEnd);
|
|
386
|
-
xhr.removeEventListener('error', onError);
|
|
387
|
-
xhr.removeEventListener('abort', onAbort);
|
|
388
|
-
xhr.removeEventListener('timeout', onTimeout);
|
|
389
|
-
}
|
|
390
|
-
emitXhrLog(xhr, emit, error);
|
|
391
|
-
};
|
|
392
|
-
const onLoadEnd = () => finish();
|
|
393
|
-
const onError = () => finish('XMLHttpRequest error');
|
|
394
|
-
const onAbort = () => finish('XMLHttpRequest aborted');
|
|
395
|
-
const onTimeout = () => finish('XMLHttpRequest timeout');
|
|
396
|
-
|
|
397
|
-
if (typeof xhr.addEventListener === 'function') {
|
|
398
|
-
xhr.addEventListener('loadend', onLoadEnd);
|
|
399
|
-
xhr.addEventListener('error', onError);
|
|
400
|
-
xhr.addEventListener('abort', onAbort);
|
|
401
|
-
xhr.addEventListener('timeout', onTimeout);
|
|
402
|
-
return;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
const originalOnReadyStateChange = xhr.onreadystatechange;
|
|
406
|
-
const originalOnLoadEnd = xhr.onloadend;
|
|
407
|
-
xhr.onreadystatechange = function interceptedReadyStateChange(event?: unknown) {
|
|
408
|
-
originalOnReadyStateChange?.call(this, event);
|
|
409
|
-
if (isXhrDone(this)) {
|
|
410
|
-
finish();
|
|
411
|
-
}
|
|
412
|
-
};
|
|
413
|
-
xhr.onloadend = function interceptedLoadEnd(event?: unknown) {
|
|
414
|
-
originalOnLoadEnd?.call(this, event);
|
|
415
|
-
finish();
|
|
416
|
-
};
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
function stopXMLHttpRequest(): void {
|
|
420
|
-
xhrRefCount = Math.max(0, xhrRefCount - 1);
|
|
421
|
-
if (xhrRefCount === 0 && originalXMLHttpRequest) {
|
|
422
|
-
const prototype = originalXMLHttpRequest.constructor.prototype;
|
|
423
|
-
prototype.open = originalXMLHttpRequest.open;
|
|
424
|
-
prototype.send = originalXMLHttpRequest.send;
|
|
425
|
-
if (originalXMLHttpRequest.setRequestHeader) {
|
|
426
|
-
prototype.setRequestHeader = originalXMLHttpRequest.setRequestHeader;
|
|
427
|
-
}
|
|
428
|
-
originalXMLHttpRequest = null;
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
export function startXMLHttpRequest(
|
|
433
|
-
emit: (entry: NetworkLogPayload) => void,
|
|
434
|
-
): () => void {
|
|
435
|
-
xhrRefCount += 1;
|
|
436
|
-
if (originalXMLHttpRequest) {
|
|
437
|
-
return () => {
|
|
438
|
-
stopXMLHttpRequest();
|
|
439
|
-
};
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
const XMLHttpRequestConstructor = getXMLHttpRequestConstructor();
|
|
443
|
-
if (!XMLHttpRequestConstructor) {
|
|
444
|
-
return () => {
|
|
445
|
-
stopXMLHttpRequest();
|
|
446
|
-
};
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
const prototype = XMLHttpRequestConstructor.prototype;
|
|
450
|
-
const originalOpen = prototype.open;
|
|
451
|
-
const originalSend = prototype.send;
|
|
452
|
-
const originalSetRequestHeader = prototype.setRequestHeader;
|
|
453
|
-
originalXMLHttpRequest = {
|
|
454
|
-
constructor: XMLHttpRequestConstructor,
|
|
455
|
-
open: originalOpen,
|
|
456
|
-
send: originalSend,
|
|
457
|
-
setRequestHeader: originalSetRequestHeader,
|
|
458
|
-
};
|
|
459
|
-
|
|
460
|
-
prototype.open = function interceptedOpen(
|
|
461
|
-
method: string,
|
|
462
|
-
url: string,
|
|
463
|
-
async?: boolean,
|
|
464
|
-
username?: string | null,
|
|
465
|
-
password?: string | null,
|
|
466
|
-
): void {
|
|
467
|
-
const rewrittenUrl = urlRewriter.get() ? rewriteUrl(url) : url;
|
|
468
|
-
const now = Date.now();
|
|
469
|
-
pendingXhrRequests.set(this, {
|
|
470
|
-
method: method.toUpperCase(),
|
|
471
|
-
url: rewrittenUrl,
|
|
472
|
-
headers: {},
|
|
473
|
-
startTime: now,
|
|
474
|
-
timestamp: now,
|
|
475
|
-
});
|
|
476
|
-
|
|
477
|
-
if (typeof password !== 'undefined') {
|
|
478
|
-
return originalOpen.call(this, method, rewrittenUrl, async, username, password);
|
|
479
|
-
}
|
|
480
|
-
if (typeof username !== 'undefined') {
|
|
481
|
-
return originalOpen.call(this, method, rewrittenUrl, async, username);
|
|
482
|
-
}
|
|
483
|
-
if (typeof async !== 'undefined') {
|
|
484
|
-
return originalOpen.call(this, method, rewrittenUrl, async);
|
|
485
|
-
}
|
|
486
|
-
return originalOpen.call(this, method, rewrittenUrl);
|
|
487
|
-
};
|
|
488
|
-
|
|
489
|
-
if (originalSetRequestHeader) {
|
|
490
|
-
prototype.setRequestHeader = function interceptedSetRequestHeader(
|
|
491
|
-
name: string,
|
|
492
|
-
value: string,
|
|
493
|
-
): void {
|
|
494
|
-
const pending = pendingXhrRequests.get(this);
|
|
495
|
-
if (pending) {
|
|
496
|
-
pending.headers[name] = value;
|
|
497
|
-
}
|
|
498
|
-
return originalSetRequestHeader.call(this, name, value);
|
|
499
|
-
};
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
prototype.send = function interceptedSend(body?: unknown): void {
|
|
503
|
-
const pending = pendingXhrRequests.get(this);
|
|
504
|
-
if (pending) {
|
|
505
|
-
const now = Date.now();
|
|
506
|
-
pending.body = body;
|
|
507
|
-
pending.startTime = now;
|
|
508
|
-
pending.timestamp = now;
|
|
509
|
-
attachXhrCompletion(this, emit);
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
try {
|
|
513
|
-
return originalSend.call(this, body);
|
|
514
|
-
} catch (error) {
|
|
515
|
-
emitXhrLog(
|
|
516
|
-
this,
|
|
517
|
-
emit,
|
|
518
|
-
error instanceof Error ? error.message : String(error),
|
|
519
|
-
);
|
|
520
|
-
throw error;
|
|
521
|
-
}
|
|
522
|
-
};
|
|
523
|
-
|
|
524
|
-
return () => {
|
|
525
|
-
stopXMLHttpRequest();
|
|
526
|
-
};
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
function teardownAxios(axiosInstance: AxiosInstanceLike): void {
|
|
530
|
-
const registration = axiosRegistrations.get(axiosInstance);
|
|
531
|
-
if (!registration) {
|
|
532
|
-
return;
|
|
533
|
-
}
|
|
534
|
-
registration.refCount -= 1;
|
|
535
|
-
if (registration.refCount > 0) {
|
|
536
|
-
return;
|
|
537
|
-
}
|
|
538
|
-
if (typeof registration.requestId === 'number') {
|
|
539
|
-
axiosInstance.interceptors.request.eject?.(registration.requestId);
|
|
540
|
-
}
|
|
541
|
-
if (typeof registration.responseId === 'number') {
|
|
542
|
-
axiosInstance.interceptors.response.eject?.(registration.responseId);
|
|
543
|
-
}
|
|
544
|
-
axiosRegistrations.delete(axiosInstance);
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
export function setupAxios(
|
|
548
|
-
axiosInstance: AxiosInstanceLike,
|
|
549
|
-
emit: (entry: NetworkLogPayload) => void,
|
|
550
|
-
): () => void {
|
|
551
|
-
const existing = axiosRegistrations.get(axiosInstance);
|
|
552
|
-
if (existing) {
|
|
553
|
-
existing.refCount += 1;
|
|
554
|
-
return () => {
|
|
555
|
-
teardownAxios(axiosInstance);
|
|
556
|
-
};
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
const requestId = axiosInstance.interceptors.request.use(
|
|
560
|
-
(config: AxiosRequestConfigLike) => {
|
|
561
|
-
if (urlRewriter.get() && config.url) {
|
|
562
|
-
const fullUrl = config.baseURL ? `${config.baseURL}${config.url}` : config.url;
|
|
563
|
-
const rewritten = rewriteUrl(fullUrl);
|
|
564
|
-
if (rewritten !== fullUrl) {
|
|
565
|
-
if (config.baseURL && rewritten.startsWith(config.baseURL)) {
|
|
566
|
-
config.url = rewritten.slice(config.baseURL.length);
|
|
567
|
-
} else {
|
|
568
|
-
config.baseURL = '';
|
|
569
|
-
config.url = rewritten;
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
pendingAxiosRequests.set(config, { startTime: Date.now(), timestamp: Date.now() });
|
|
574
|
-
return config;
|
|
575
|
-
},
|
|
576
|
-
(error: unknown) => Promise.reject(error),
|
|
577
|
-
);
|
|
578
|
-
|
|
579
|
-
const responseId = axiosInstance.interceptors.response.use(
|
|
580
|
-
(response: AxiosResponseLike) => {
|
|
581
|
-
const pending = pendingAxiosRequests.get(response.config);
|
|
582
|
-
if (pending) {
|
|
583
|
-
emit({
|
|
584
|
-
timestamp: pending.timestamp,
|
|
585
|
-
duration: Date.now() - pending.startTime,
|
|
586
|
-
request: {
|
|
587
|
-
url: `${response.config.baseURL || ''}${response.config.url}`,
|
|
588
|
-
method: (response.config.method || 'GET').toUpperCase(),
|
|
589
|
-
headers: response.config.headers,
|
|
590
|
-
body: response.config.data || response.config.params,
|
|
591
|
-
},
|
|
592
|
-
response: {
|
|
593
|
-
status: response.status,
|
|
594
|
-
statusText: response.statusText,
|
|
595
|
-
headers: response.headers,
|
|
596
|
-
data: response.data,
|
|
597
|
-
success:
|
|
598
|
-
response.data && typeof response.data === 'object'
|
|
599
|
-
? (response.data as Record<string, unknown>).success !== false
|
|
600
|
-
: response.status >= 200 && response.status < 300,
|
|
601
|
-
},
|
|
602
|
-
});
|
|
603
|
-
pendingAxiosRequests.delete(response.config);
|
|
604
|
-
}
|
|
605
|
-
return response;
|
|
606
|
-
},
|
|
607
|
-
(error: AxiosErrorLike) => {
|
|
608
|
-
if (error.config) {
|
|
609
|
-
const pending = pendingAxiosRequests.get(error.config);
|
|
610
|
-
emit({
|
|
611
|
-
timestamp: pending ? pending.timestamp : Date.now(),
|
|
612
|
-
duration: pending ? Date.now() - pending.startTime : undefined,
|
|
613
|
-
request: {
|
|
614
|
-
url: `${error.config.baseURL || ''}${error.config.url}`,
|
|
615
|
-
method: (error.config.method || 'GET').toUpperCase(),
|
|
616
|
-
headers: error.config.headers,
|
|
617
|
-
body: error.config.data || error.config.params,
|
|
618
|
-
},
|
|
619
|
-
error: error.message,
|
|
620
|
-
});
|
|
621
|
-
pendingAxiosRequests.delete(error.config);
|
|
622
|
-
}
|
|
623
|
-
return Promise.reject(error);
|
|
624
|
-
},
|
|
625
|
-
);
|
|
626
|
-
|
|
627
|
-
axiosRegistrations.set(axiosInstance, {
|
|
628
|
-
refCount: 1,
|
|
629
|
-
requestId: typeof requestId === 'number' ? requestId : undefined,
|
|
630
|
-
responseId: typeof responseId === 'number' ? responseId : undefined,
|
|
631
|
-
});
|
|
632
|
-
|
|
633
|
-
return () => {
|
|
634
|
-
teardownAxios(axiosInstance);
|
|
635
|
-
};
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
export function resetInterceptors(): void {
|
|
639
|
-
if (originalFetch) {
|
|
640
|
-
globalThis.fetch = originalFetch;
|
|
641
|
-
originalFetch = null;
|
|
642
|
-
}
|
|
643
|
-
fetchRefCount = 0;
|
|
644
|
-
xhrRefCount = 1;
|
|
645
|
-
stopXMLHttpRequest();
|
|
646
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|