@buoy-gg/network 7.0.77 → 7.0.79
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 +68 -2
- package/lib/commonjs/expo-network.js +1 -0
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/index.web.js +1 -1
- package/lib/commonjs/netinfo.js +1 -0
- package/lib/commonjs/network/components/NetworkCopySettingsView.js +1 -1
- package/lib/commonjs/network/components/NetworkEventDetailView.js +2 -2
- package/lib/commonjs/network/components/NetworkEventDetailView.web.js +1 -1
- package/lib/commonjs/network/components/NetworkEventItemCompact.js +2 -2
- package/lib/commonjs/network/components/NetworkEventItemCompact.web.js +1 -1
- package/lib/commonjs/network/components/NetworkListScreen.js +1 -1
- package/lib/commonjs/network/components/NetworkModal.js +1 -1
- package/lib/commonjs/network/components/NetworkSavedScreen.js +1 -1
- package/lib/commonjs/network/conditions/NetworkConditionsControl.js +1 -1
- package/lib/commonjs/network/conditions/NetworkConditionsControl.test.js +1 -1
- package/lib/commonjs/network/conditions/NetworkConditionsIcon.js +1 -1
- package/lib/commonjs/network/conditions/NetworkFloatingTool.js +1 -1
- package/lib/commonjs/network/conditions/NetworkFloatingTool.test.js +1 -1
- package/lib/commonjs/network/conditions/connectivity/netInfoFacade.js +1 -0
- package/lib/commonjs/network/conditions/connectivity/patchNetwork.js +1 -0
- package/lib/commonjs/network/conditions/pacer.js +1 -0
- package/lib/commonjs/network/conditions/profiles.js +1 -0
- package/lib/commonjs/network/conditions/remoteState.js +1 -0
- package/lib/commonjs/network/conditions/store.js +1 -1
- package/lib/commonjs/network/conditions/wait.js +1 -1
- package/lib/commonjs/network/conditions/xhr.js +1 -1
- package/lib/commonjs/network/overrides/engine.js +1 -1
- package/lib/commonjs/network/overrides/matchRule.js +1 -1
- package/lib/commonjs/network/overrides/overrideRulesStore.js +1 -1
- package/lib/commonjs/network/sync/networkSyncAdapter.js +1 -1
- package/lib/commonjs/network/utils/generateNetworkCopyText.js +1 -0
- package/lib/commonjs/network/utils/networkListener.js +4 -4
- package/lib/module/expo-network.js +1 -0
- package/lib/module/index.js +1 -1
- package/lib/module/index.web.js +1 -1
- package/lib/module/netinfo.js +1 -0
- package/lib/module/network/components/NetworkCopySettingsView.js +3 -3
- package/lib/module/network/components/NetworkEventDetailView.js +2 -2
- package/lib/module/network/components/NetworkEventDetailView.web.js +2 -2
- package/lib/module/network/components/NetworkEventItemCompact.js +2 -2
- package/lib/module/network/components/NetworkEventItemCompact.web.js +1 -1
- package/lib/module/network/components/NetworkListScreen.js +1 -1
- package/lib/module/network/components/NetworkModal.js +1 -1
- package/lib/module/network/components/NetworkSavedScreen.js +1 -1
- package/lib/module/network/conditions/NetworkConditionsControl.js +1 -1
- package/lib/module/network/conditions/NetworkConditionsControl.test.js +1 -1
- package/lib/module/network/conditions/NetworkConditionsIcon.js +1 -1
- package/lib/module/network/conditions/NetworkFloatingTool.js +1 -1
- package/lib/module/network/conditions/NetworkFloatingTool.test.js +1 -1
- package/lib/module/network/conditions/connectivity/netInfoFacade.js +1 -0
- package/lib/module/network/conditions/connectivity/patchNetwork.js +1 -0
- package/lib/module/network/conditions/pacer.js +1 -0
- package/lib/module/network/conditions/profiles.js +1 -0
- package/lib/module/network/conditions/remoteState.js +1 -0
- package/lib/module/network/conditions/store.js +1 -1
- package/lib/module/network/conditions/wait.js +1 -1
- package/lib/module/network/conditions/xhr.js +1 -1
- package/lib/module/network/overrides/engine.js +1 -1
- package/lib/module/network/overrides/matchRule.js +1 -1
- package/lib/module/network/overrides/overrideRulesStore.js +1 -1
- package/lib/module/network/sync/networkSyncAdapter.js +1 -1
- package/lib/module/network/utils/generateNetworkCopyText.js +23 -22
- package/lib/module/network/utils/networkListener.js +4 -4
- package/lib/typescript/expo-network.d.ts +2 -0
- package/lib/typescript/index.d.ts +3 -2
- package/lib/typescript/index.web.d.ts +3 -2
- package/lib/typescript/netinfo.d.ts +3 -0
- package/lib/typescript/network/conditions/NetworkConditionsControl.d.ts +5 -2
- package/lib/typescript/network/conditions/NetworkFloatingTool.d.ts +4 -3
- package/lib/typescript/network/conditions/connectivity/netInfoFacade.d.ts +3 -0
- package/lib/typescript/network/conditions/connectivity/patchNetwork.d.ts +24 -0
- package/lib/typescript/network/conditions/pacer.d.ts +16 -0
- package/lib/typescript/network/conditions/profiles.d.ts +57 -0
- package/lib/typescript/network/conditions/remoteState.d.ts +4 -0
- package/lib/typescript/network/conditions/store.d.ts +45 -19
- package/lib/typescript/network/conditions/xhr.d.ts +1 -1
- package/lib/typescript/network/overrides/engine.d.ts +14 -0
- package/lib/typescript/network/overrides/matchRule.d.ts +3 -0
- package/lib/typescript/network/overrides/overrideRulesStore.d.ts +3 -0
- package/lib/typescript/network/overrides/types.d.ts +19 -0
- package/lib/typescript/network/sync/networkSyncAdapter.d.ts +27 -12
- package/lib/typescript/network/utils/networkListener.d.ts +4 -0
- package/lib/web/index.mjs +58 -57
- package/package.json +26 -3
package/README.md
CHANGED
|
@@ -22,10 +22,76 @@ npm install @buoy-gg/core @buoy-gg/network
|
|
|
22
22
|
|
|
23
23
|
Render `<FloatingDevTools />` once in your app root and Network appears in the menu. Requests sent through a separate native transport are not captured.
|
|
24
24
|
|
|
25
|
+
Buoy keeps its own web calls out of this view. App calls still show when they use the same files.
|
|
26
|
+
|
|
27
|
+
## Slow links in dev builds
|
|
28
|
+
|
|
29
|
+
Open **⋯ → Speed and link state** in Network.
|
|
30
|
+
The floating strip stays on while you test.
|
|
31
|
+
On Android, drag by the grip while you edit.
|
|
32
|
+
Tap Edit to show the controls, or Done to hide them.
|
|
33
|
+
Choose Slow 3G, Slow 4G, Fast 4G, or Offline.
|
|
34
|
+
The old Slow and Very slow choices just add waits.
|
|
35
|
+
|
|
36
|
+
Down caps pace bytes to the app in JS.
|
|
37
|
+
Up caps wait before send based on body bytes.
|
|
38
|
+
For gzip, down caps count unpacked body bytes.
|
|
39
|
+
Upload time is simulated. Neither cap paces the socket.
|
|
40
|
+
Caps apply to each call. They use global fetch and RN XHR.
|
|
41
|
+
Text, bytes and Blob uploads have known sizes.
|
|
42
|
+
FormData adds a wait for the parts we can size.
|
|
43
|
+
This includes text, bytes, Blob, and files with a `size`.
|
|
44
|
+
Unknown parts use just the start wait, then pass through.
|
|
45
|
+
The count skips headers and the bytes between fields.
|
|
46
|
+
Streams use just that wait. We do not read them first.
|
|
47
|
+
The list, detail, and MCP show each cap gap.
|
|
48
|
+
|
|
49
|
+
WebSocket, native images, native SDKs and file transfers stay real.
|
|
50
|
+
Direct `expo/fetch` imports and saved fetch refs may bypass hooks.
|
|
51
|
+
Local file reads and Buoy's own web calls stay real.
|
|
52
|
+
|
|
53
|
+
The chip stays on when you close the tool.
|
|
54
|
+
No throttling clears both speed and app link state.
|
|
55
|
+
App reload clears them too. No throttling adds no byte wrapper or cap timer.
|
|
56
|
+
Normal capture still has its own cost. These controls stay off in a release build.
|
|
57
|
+
|
|
58
|
+
### App link state
|
|
59
|
+
|
|
60
|
+
Load the hook before app imports in your dev entry:
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
import '@buoy-gg/network/netinfo';
|
|
64
|
+
// Or, if your app uses Expo Network:
|
|
65
|
+
import '@buoy-gg/network/expo-network';
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Each hook needs its peer in the app already.
|
|
69
|
+
Core does not load these peers. It adds no native code.
|
|
70
|
+
Late setup shows a gap. Move the hook, then reload.
|
|
71
|
+
NetInfo 12 and Expo Network 56 are the tested peers.
|
|
72
|
+
|
|
73
|
+
Choose Real link, Offline, Wi-Fi, Cellular, or No internet.
|
|
74
|
+
Follow speed sets Offline with the Offline speed choice.
|
|
75
|
+
All other speed choices use the real link state.
|
|
76
|
+
No internet reports Wi-Fi with no internet access.
|
|
77
|
+
The radio and web calls do not change.
|
|
78
|
+
Restore sends the latest real state to the app.
|
|
79
|
+
|
|
80
|
+
NetInfo covers `fetch`, `refresh`, `addEventListener`, and `useNetInfo`.
|
|
81
|
+
Its isolated `useNetInfoInstance` hook is not a supported path.
|
|
82
|
+
Expo covers `getNetworkStateAsync`, `addNetworkStateListener`, and `useNetworkState`.
|
|
83
|
+
IP address and airplane-mode reads stay real.
|
|
84
|
+
|
|
85
|
+
### MCP and Desktop
|
|
86
|
+
|
|
87
|
+
Both views send changes to the selected device.
|
|
88
|
+
MCP uses `network_conditions` with `action: 'get'` or `'set'`.
|
|
89
|
+
Set accepts `profile`, `connection`, or both.
|
|
90
|
+
The reply shows rates, hook support, and what they affect.
|
|
91
|
+
If the link is lost, the view says so.
|
|
92
|
+
|
|
25
93
|
The [Network guide](https://buoy.gg/buoy/latest/docs/tools/network) covers setup, what it captures and its limits. New to Buoy? Start with the [Quick start](https://buoy.gg/buoy/latest/docs/quick-start).
|
|
26
94
|
|
|
27
95
|
---
|
|
28
96
|
|
|
29
97
|
<sub>Part of <a href="https://buoy.gg">Buoy</a>, developer tools that live inside your app. Proprietary software. © Buoy LLC. <a href="https://buoy.gg/terms">Terms</a></sub>
|
|
30
|
-
|
|
31
|
-
Buoy keeps its own web calls out of this view. App calls still show when they use the same files.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.installExpoNetworkConditions=installExpoNetworkConditions;var _store=require("./network/conditions/store");var _patchNetwork=require("./network/conditions/connectivity/patchNetwork");let installed=false;function installExpoNetworkConditions(){if(installed||typeof __DEV__==="undefined"||!__DEV__)return;try{const e=require("expo-network/build/ExpoNetwork").default;const t={get getCurrentState(){return e.getNetworkStateAsync},set getCurrentState(o){e.getNetworkStateAsync=o},eventEmitter:e};(0,_patchNetwork.patchConnectionState)(t,_store.getEffectiveNetworkConnection,_store.subscribeNetworkConditions,{eventName:"onNetworkStateChanged",expo:true,receiver:e});installed=true;(0,_store.setConnectionSupport)("expoNetwork",{supported:true})}catch(e){(0,_store.setConnectionSupport)("expoNetwork",{supported:false,reason:e instanceof Error?e.message:"Expo Network hook could not load."})}}installExpoNetworkConditions();
|
package/lib/commonjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"DEFAULT_SETTLE_MS",{enumerable:true,get:function(){return _networkSelectionStore.DEFAULT_SETTLE_MS}});Object.defineProperty(exports,"FREE_TIER_OVERRIDE_LIMIT",{enumerable:true,get:function(){return _types.FREE_TIER_RULE_LIMIT}});Object.defineProperty(exports,"FREE_TIER_SAVED_LIMIT",{enumerable:true,get:function(){return _networkSavedStore.FREE_TIER_SAVED_LIMIT}});Object.defineProperty(exports,"MAX_OVERRIDE_RULES",{enumerable:true,get:function(){return _types.MAX_RULES}});Object.defineProperty(exports,"MAX_PINNED",{enumerable:true,get:function(){return _networkSavedStore.MAX_PINNED}});Object.defineProperty(exports,"MAX_SAVED",{enumerable:true,get:function(){return _networkSavedStore.MAX_SAVED}});Object.defineProperty(exports,"NETWORK_CONDITIONS",{enumerable:true,get:function(){return _store.NETWORK_CONDITIONS}});Object.defineProperty(exports,"NetworkBodyResolverProvider",{enumerable:true,get:function(){return _networkBodyResolver.NetworkBodyResolverProvider}});Object.defineProperty(exports,"NetworkDetailPinActions",{enumerable:true,get:function(){return _NetworkHeaderLive.NetworkDetailPinActions}});Object.defineProperty(exports,"NetworkEventDetailView",{enumerable:true,get:function(){return _NetworkEventDetailView.NetworkEventDetailView}});Object.defineProperty(exports,"NetworkEventItemCompact",{enumerable:true,get:function(){return _NetworkEventItemCompact.NetworkEventItemCompact}});Object.defineProperty(exports,"NetworkHeaderBadgesView",{enumerable:true,get:function(){return _NetworkHeaderLive.NetworkHeaderBadgesView}});Object.defineProperty(exports,"NetworkModal",{enumerable:true,get:function(){return _NetworkModal.NetworkModal}});Object.defineProperty(exports,"NetworkSavedButton",{enumerable:true,get:function(){return _NetworkHeaderLive.NetworkSavedButton}});Object.defineProperty(exports,"NetworkSavedScreen",{enumerable:true,get:function(){return _NetworkSavedScreen.NetworkSavedScreen}});Object.defineProperty(exports,"NetworkToolView",{enumerable:true,get:function(){return _NetworkModal.NetworkToolView}});Object.defineProperty(exports,"OVERRIDE_STATUS_MAX",{enumerable:true,get:function(){return _types.STATUS_MAX}});Object.defineProperty(exports,"OVERRIDE_STATUS_MIN",{enumerable:true,get:function(){return _types.STATUS_MIN}});Object.defineProperty(exports,"TickProvider",{enumerable:true,get:function(){return _useTickEveryMinute.TickProvider}});Object.defineProperty(exports,"addNetworkListener",{enumerable:true,get:function(){return _networkListener.addNetworkListener}});Object.defineProperty(exports,"createNetworkTool",{enumerable:true,get:function(){return _preset.createNetworkTool}});Object.defineProperty(exports,"draftFromEvent",{enumerable:true,get:function(){return _presets.draftFromEvent}});Object.defineProperty(exports,"flagsForEventId",{enumerable:true,get:function(){return _networkSavedStore.flagsForEventId}});Object.defineProperty(exports,"formatBytes",{enumerable:true,get:function(){return _formatting.formatBytes}});Object.defineProperty(exports,"formatDuration",{enumerable:true,get:function(){return _formatting.formatDuration}});Object.defineProperty(exports,"formatHttpStatus",{enumerable:true,get:function(){return _formatting.formatHttpStatus}});Object.defineProperty(exports,"generateCurl",{enumerable:true,get:function(){return _generateCurl.generateCurl}});Object.defineProperty(exports,"getNetworkCondition",{enumerable:true,get:function(){return _store.getNetworkCondition}});Object.defineProperty(exports,"ignoredPatternsStore",{enumerable:true,get:function(){return _sharedUi.ignoredPatternsStore}});Object.defineProperty(exports,"isUrlIgnored",{enumerable:true,get:function(){return _sharedUi.isUrlIgnored}});Object.defineProperty(exports,"networkEventStore",{enumerable:true,get:function(){return _networkEventStore.networkEventStore}});Object.defineProperty(exports,"networkListener",{enumerable:true,get:function(){return _networkListener.networkListener}});Object.defineProperty(exports,"networkSavedStore",{enumerable:true,get:function(){return _networkSavedStore.networkSavedStore}});Object.defineProperty(exports,"networkSelectionStore",{enumerable:true,get:function(){return _networkSelectionStore.networkSelectionStore}});Object.defineProperty(exports,"networkSyncAdapter",{enumerable:true,get:function(){return _networkSyncAdapter.networkSyncAdapter}});Object.defineProperty(exports,"networkToolPreset",{enumerable:true,get:function(){return _preset.networkToolPreset}});Object.defineProperty(exports,"overrideRulesStore",{enumerable:true,get:function(){return _overrideRulesStore.overrideRulesStore}});Object.defineProperty(exports,"removeAllNetworkListeners",{enumerable:true,get:function(){return _networkListener.removeAllNetworkListeners}});Object.defineProperty(exports,"setNetworkCondition",{enumerable:true,get:function(){return _store.setNetworkCondition}});Object.defineProperty(exports,"splitPinned",{enumerable:true,get:function(){return _withPinnedFirst.splitPinned}});Object.defineProperty(exports,"startNetworkCapture",{enumerable:true,get:function(){return _startNetworkCapture.startNetworkCapture}});Object.defineProperty(exports,"subscribeNetworkConditions",{enumerable:true,get:function(){return _store.subscribeNetworkConditions}});Object.defineProperty(exports,"urlMatchesIgnoredPattern",{enumerable:true,get:function(){return _sharedUi.urlMatchesIgnoredPattern}});Object.defineProperty(exports,"useIgnoredPatterns",{enumerable:true,get:function(){return _sharedUi.useIgnoredPatterns}});Object.defineProperty(exports,"useLiveNetworkEvent",{enumerable:true,get:function(){return _useLiveNetworkEvent.useLiveNetworkEvent}});Object.defineProperty(exports,"useNetworkBadgeCounts",{enumerable:true,get:function(){return _useNetworkBadgeCounts.useNetworkBadgeCounts}});Object.defineProperty(exports,"useNetworkEventList",{enumerable:true,get:function(){return _useNetworkEventList.useNetworkEventList}});Object.defineProperty(exports,"useNetworkEvents",{enumerable:true,get:function(){return _useNetworkEvents.useNetworkEvents}});Object.defineProperty(exports,"useNetworkSaved",{enumerable:true,get:function(){return _useNetworkSaved.useNetworkSaved}});Object.defineProperty(exports,"useTickEveryMinute",{enumerable:true,get:function(){return _useTickEveryMinute.useTickEveryMinute}});var _preset=require("./preset");var _startNetworkCapture=require("./network/utils/startNetworkCapture");var _NetworkModal=require("./network/components/NetworkModal");var _NetworkEventDetailView=require("./network/components/NetworkEventDetailView");var _NetworkEventItemCompact=require("./network/components/NetworkEventItemCompact");var _NetworkSavedScreen=require("./network/components/NetworkSavedScreen");var _NetworkHeaderLive=require("./network/components/NetworkHeaderLive");var _useNetworkEvents=require("./network/hooks/useNetworkEvents");var _useNetworkEventList=require("./network/hooks/useNetworkEventList");var _useLiveNetworkEvent=require("./network/hooks/useLiveNetworkEvent");var _useNetworkBadgeCounts=require("./network/hooks/useNetworkBadgeCounts");var _useNetworkSaved=require("./network/hooks/useNetworkSaved");var _withPinnedFirst=require("./network/utils/withPinnedFirst");var _networkSelectionStore=require("./network/utils/networkSelectionStore");var _useTickEveryMinute=require("./network/hooks/useTickEveryMinute");var _formatting=require("./network/utils/formatting");var _overrideRulesStore=require("./network/overrides/overrideRulesStore");var _presets=require("./network/overrides/presets");var _types=require("./network/overrides/types");var _sharedUi=require("@buoy-gg/shared-ui");var _networkSyncAdapter=require("./network/sync/networkSyncAdapter");var _networkBodyResolver=require("./network/sync/networkBodyResolver");var _networkEventStore=require("./network/utils/networkEventStore");var _networkSavedStore=require("./network/utils/networkSavedStore");var _generateCurl=require("./network/utils/generateCurl");var _networkListener=require("./network/utils/networkListener");var _store=require("./network/conditions/store");
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"DEFAULT_SETTLE_MS",{enumerable:true,get:function(){return _networkSelectionStore.DEFAULT_SETTLE_MS}});Object.defineProperty(exports,"FREE_TIER_OVERRIDE_LIMIT",{enumerable:true,get:function(){return _types.FREE_TIER_RULE_LIMIT}});Object.defineProperty(exports,"FREE_TIER_SAVED_LIMIT",{enumerable:true,get:function(){return _networkSavedStore.FREE_TIER_SAVED_LIMIT}});Object.defineProperty(exports,"MAX_OVERRIDE_RULES",{enumerable:true,get:function(){return _types.MAX_RULES}});Object.defineProperty(exports,"MAX_PINNED",{enumerable:true,get:function(){return _networkSavedStore.MAX_PINNED}});Object.defineProperty(exports,"MAX_SAVED",{enumerable:true,get:function(){return _networkSavedStore.MAX_SAVED}});Object.defineProperty(exports,"NETWORK_CONDITIONS",{enumerable:true,get:function(){return _store.NETWORK_CONDITIONS}});Object.defineProperty(exports,"NetworkBodyResolverProvider",{enumerable:true,get:function(){return _networkBodyResolver.NetworkBodyResolverProvider}});Object.defineProperty(exports,"NetworkDetailPinActions",{enumerable:true,get:function(){return _NetworkHeaderLive.NetworkDetailPinActions}});Object.defineProperty(exports,"NetworkEventDetailView",{enumerable:true,get:function(){return _NetworkEventDetailView.NetworkEventDetailView}});Object.defineProperty(exports,"NetworkEventItemCompact",{enumerable:true,get:function(){return _NetworkEventItemCompact.NetworkEventItemCompact}});Object.defineProperty(exports,"NetworkHeaderBadgesView",{enumerable:true,get:function(){return _NetworkHeaderLive.NetworkHeaderBadgesView}});Object.defineProperty(exports,"NetworkModal",{enumerable:true,get:function(){return _NetworkModal.NetworkModal}});Object.defineProperty(exports,"NetworkSavedButton",{enumerable:true,get:function(){return _NetworkHeaderLive.NetworkSavedButton}});Object.defineProperty(exports,"NetworkSavedScreen",{enumerable:true,get:function(){return _NetworkSavedScreen.NetworkSavedScreen}});Object.defineProperty(exports,"NetworkToolView",{enumerable:true,get:function(){return _NetworkModal.NetworkToolView}});Object.defineProperty(exports,"OVERRIDE_STATUS_MAX",{enumerable:true,get:function(){return _types.STATUS_MAX}});Object.defineProperty(exports,"OVERRIDE_STATUS_MIN",{enumerable:true,get:function(){return _types.STATUS_MIN}});Object.defineProperty(exports,"TickProvider",{enumerable:true,get:function(){return _useTickEveryMinute.TickProvider}});Object.defineProperty(exports,"addNetworkListener",{enumerable:true,get:function(){return _networkListener.addNetworkListener}});Object.defineProperty(exports,"chooseConditionsSnapshot",{enumerable:true,get:function(){return _remoteState.chooseConditionsSnapshot}});Object.defineProperty(exports,"createNetworkTool",{enumerable:true,get:function(){return _preset.createNetworkTool}});Object.defineProperty(exports,"draftFromEvent",{enumerable:true,get:function(){return _presets.draftFromEvent}});Object.defineProperty(exports,"flagsForEventId",{enumerable:true,get:function(){return _networkSavedStore.flagsForEventId}});Object.defineProperty(exports,"formatBytes",{enumerable:true,get:function(){return _formatting.formatBytes}});Object.defineProperty(exports,"formatDuration",{enumerable:true,get:function(){return _formatting.formatDuration}});Object.defineProperty(exports,"formatHttpStatus",{enumerable:true,get:function(){return _formatting.formatHttpStatus}});Object.defineProperty(exports,"generateCurl",{enumerable:true,get:function(){return _generateCurl.generateCurl}});Object.defineProperty(exports,"getConditionsRevision",{enumerable:true,get:function(){return _store.getConditionsRevision}});Object.defineProperty(exports,"getNetworkCondition",{enumerable:true,get:function(){return _store.getNetworkCondition}});Object.defineProperty(exports,"getNetworkConditions",{enumerable:true,get:function(){return _store.getNetworkConditions}});Object.defineProperty(exports,"getNetworkConnection",{enumerable:true,get:function(){return _store.getNetworkConnection}});Object.defineProperty(exports,"ignoredPatternsStore",{enumerable:true,get:function(){return _sharedUi.ignoredPatternsStore}});Object.defineProperty(exports,"isUrlIgnored",{enumerable:true,get:function(){return _sharedUi.isUrlIgnored}});Object.defineProperty(exports,"networkConditionsActive",{enumerable:true,get:function(){return _store.networkConditionsActive}});Object.defineProperty(exports,"networkEventStore",{enumerable:true,get:function(){return _networkEventStore.networkEventStore}});Object.defineProperty(exports,"networkListener",{enumerable:true,get:function(){return _networkListener.networkListener}});Object.defineProperty(exports,"networkSavedStore",{enumerable:true,get:function(){return _networkSavedStore.networkSavedStore}});Object.defineProperty(exports,"networkSelectionStore",{enumerable:true,get:function(){return _networkSelectionStore.networkSelectionStore}});Object.defineProperty(exports,"networkSyncAdapter",{enumerable:true,get:function(){return _networkSyncAdapter.networkSyncAdapter}});Object.defineProperty(exports,"networkToolPreset",{enumerable:true,get:function(){return _preset.networkToolPreset}});Object.defineProperty(exports,"overrideRulesStore",{enumerable:true,get:function(){return _overrideRulesStore.overrideRulesStore}});Object.defineProperty(exports,"removeAllNetworkListeners",{enumerable:true,get:function(){return _networkListener.removeAllNetworkListeners}});Object.defineProperty(exports,"setNetworkCondition",{enumerable:true,get:function(){return _store.setNetworkCondition}});Object.defineProperty(exports,"setNetworkConditions",{enumerable:true,get:function(){return _store.setNetworkConditions}});Object.defineProperty(exports,"splitPinned",{enumerable:true,get:function(){return _withPinnedFirst.splitPinned}});Object.defineProperty(exports,"startNetworkCapture",{enumerable:true,get:function(){return _startNetworkCapture.startNetworkCapture}});Object.defineProperty(exports,"subscribeNetworkConditions",{enumerable:true,get:function(){return _store.subscribeNetworkConditions}});Object.defineProperty(exports,"urlMatchesIgnoredPattern",{enumerable:true,get:function(){return _sharedUi.urlMatchesIgnoredPattern}});Object.defineProperty(exports,"useIgnoredPatterns",{enumerable:true,get:function(){return _sharedUi.useIgnoredPatterns}});Object.defineProperty(exports,"useLiveNetworkEvent",{enumerable:true,get:function(){return _useLiveNetworkEvent.useLiveNetworkEvent}});Object.defineProperty(exports,"useNetworkBadgeCounts",{enumerable:true,get:function(){return _useNetworkBadgeCounts.useNetworkBadgeCounts}});Object.defineProperty(exports,"useNetworkEventList",{enumerable:true,get:function(){return _useNetworkEventList.useNetworkEventList}});Object.defineProperty(exports,"useNetworkEvents",{enumerable:true,get:function(){return _useNetworkEvents.useNetworkEvents}});Object.defineProperty(exports,"useNetworkSaved",{enumerable:true,get:function(){return _useNetworkSaved.useNetworkSaved}});Object.defineProperty(exports,"useTickEveryMinute",{enumerable:true,get:function(){return _useTickEveryMinute.useTickEveryMinute}});var _preset=require("./preset");var _startNetworkCapture=require("./network/utils/startNetworkCapture");var _NetworkModal=require("./network/components/NetworkModal");var _NetworkEventDetailView=require("./network/components/NetworkEventDetailView");var _NetworkEventItemCompact=require("./network/components/NetworkEventItemCompact");var _NetworkSavedScreen=require("./network/components/NetworkSavedScreen");var _NetworkHeaderLive=require("./network/components/NetworkHeaderLive");var _useNetworkEvents=require("./network/hooks/useNetworkEvents");var _useNetworkEventList=require("./network/hooks/useNetworkEventList");var _useLiveNetworkEvent=require("./network/hooks/useLiveNetworkEvent");var _useNetworkBadgeCounts=require("./network/hooks/useNetworkBadgeCounts");var _useNetworkSaved=require("./network/hooks/useNetworkSaved");var _withPinnedFirst=require("./network/utils/withPinnedFirst");var _networkSelectionStore=require("./network/utils/networkSelectionStore");var _useTickEveryMinute=require("./network/hooks/useTickEveryMinute");var _formatting=require("./network/utils/formatting");var _overrideRulesStore=require("./network/overrides/overrideRulesStore");var _presets=require("./network/overrides/presets");var _types=require("./network/overrides/types");var _sharedUi=require("@buoy-gg/shared-ui");var _networkSyncAdapter=require("./network/sync/networkSyncAdapter");var _networkBodyResolver=require("./network/sync/networkBodyResolver");var _networkEventStore=require("./network/utils/networkEventStore");var _networkSavedStore=require("./network/utils/networkSavedStore");var _generateCurl=require("./network/utils/generateCurl");var _networkListener=require("./network/utils/networkListener");var _store=require("./network/conditions/store");var _remoteState=require("./network/conditions/remoteState");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"DEFAULT_COPY_SETTINGS",{enumerable:true,get:function(){return _NetworkCopySettingsView.DEFAULT_COPY_SETTINGS}});Object.defineProperty(exports,"FREE_TIER_REQUEST_LIMIT",{enumerable:true,get:function(){return _useNetworkEvents.FREE_TIER_REQUEST_LIMIT}});Object.defineProperty(exports,"FREE_TIER_RULE_LIMIT",{enumerable:true,get:function(){return _types.FREE_TIER_RULE_LIMIT}});Object.defineProperty(exports,"FREE_TIER_SAVED_LIMIT",{enumerable:true,get:function(){return _networkSavedStore.FREE_TIER_SAVED_LIMIT}});Object.defineProperty(exports,"MAX_RULES",{enumerable:true,get:function(){return _types.MAX_RULES}});Object.defineProperty(exports,"MAX_SAVED",{enumerable:true,get:function(){return _networkSavedStore.MAX_SAVED}});Object.defineProperty(exports,"NETWORK_CONDITIONS",{enumerable:true,get:function(){return _store.NETWORK_CONDITIONS}});Object.defineProperty(exports,"NetworkClearButton",{enumerable:true,get:function(){return _NetworkHeaderLive.NetworkClearButton}});Object.defineProperty(exports,"NetworkCopyScreen",{enumerable:true,get:function(){return _NetworkCopyScreen.NetworkCopyScreen}});Object.defineProperty(exports,"NetworkCopySettingsView",{enumerable:true,get:function(){return _NetworkCopySettingsView.NetworkCopySettingsView}});Object.defineProperty(exports,"NetworkDetailPinActions",{enumerable:true,get:function(){return _NetworkHeaderLive.NetworkDetailPinActions}});Object.defineProperty(exports,"NetworkDetailScreen",{enumerable:true,get:function(){return _NetworkDetailScreen.NetworkDetailScreen}});Object.defineProperty(exports,"NetworkDetailStepper",{enumerable:true,get:function(){return _NetworkDetailStepper.NetworkDetailStepper}});Object.defineProperty(exports,"NetworkEventDetailView",{enumerable:true,get:function(){return _NetworkEventDetailView.NetworkEventDetailView}});Object.defineProperty(exports,"NetworkEventItemCompact",{enumerable:true,get:function(){return _NetworkEventItemCompact.NetworkEventItemCompact}});Object.defineProperty(exports,"NetworkFilterScreen",{enumerable:true,get:function(){return _NetworkFilterScreen.NetworkFilterScreen}});Object.defineProperty(exports,"NetworkFilterViewV3",{enumerable:true,get:function(){return _NetworkFilterViewV.NetworkFilterViewV3}});Object.defineProperty(exports,"NetworkHeaderBadges",{enumerable:true,get:function(){return _NetworkHeaderLive.NetworkHeaderBadges}});Object.defineProperty(exports,"NetworkHeaderCopyButton",{enumerable:true,get:function(){return _NetworkHeaderLive.NetworkHeaderCopyButton}});Object.defineProperty(exports,"NetworkListScreen",{enumerable:true,get:function(){return _NetworkListScreen.NetworkListScreen}});Object.defineProperty(exports,"NetworkNumberPrompt",{enumerable:true,get:function(){return _NetworkNumberPrompt.NetworkNumberPrompt}});Object.defineProperty(exports,"NetworkOverrideEditor",{enumerable:true,get:function(){return _NetworkOverrideEditor.NetworkOverrideEditor}});Object.defineProperty(exports,"NetworkOverrideHeaderButton",{enumerable:true,get:function(){return _NetworkOverrideHeaderButton.NetworkOverrideHeaderButton}});Object.defineProperty(exports,"NetworkOverridesButton",{enumerable:true,get:function(){return _NetworkOverridesButton.NetworkOverridesButton}});Object.defineProperty(exports,"NetworkOverridesScreen",{enumerable:true,get:function(){return _NetworkOverridesScreen.NetworkOverridesScreen}});Object.defineProperty(exports,"NetworkSavedButton",{enumerable:true,get:function(){return _NetworkHeaderLive.NetworkSavedButton}});Object.defineProperty(exports,"NetworkSavedScreen",{enumerable:true,get:function(){return _NetworkSavedScreen.NetworkSavedScreen}});Object.defineProperty(exports,"STATUS_MAX",{enumerable:true,get:function(){return _types.STATUS_MAX}});Object.defineProperty(exports,"STATUS_MIN",{enumerable:true,get:function(){return _types.STATUS_MIN}});Object.defineProperty(exports,"addNetworkListener",{enumerable:true,get:function(){return _networkListener.addNetworkListener}});Object.defineProperty(exports,"applyIgnoredPatterns",{enumerable:true,get:function(){return _filterNetworkEvents.applyIgnoredPatterns}});Object.defineProperty(exports,"draftFromEvent",{enumerable:true,get:function(){return _presets.draftFromEvent}});Object.defineProperty(exports,"extractOperationName",{enumerable:true,get:function(){return _extractOperationName.extractOperationName}});Object.defineProperty(exports,"filterNetworkEvents",{enumerable:true,get:function(){return _filterNetworkEvents.filterNetworkEvents}});Object.defineProperty(exports,"flagsForEventId",{enumerable:true,get:function(){return _networkSavedStore.flagsForEventId}});Object.defineProperty(exports,"generateCurl",{enumerable:true,get:function(){return _generateCurl.generateCurl}});Object.defineProperty(exports,"generateNetworkCopyText",{enumerable:true,get:function(){return _generateNetworkCopyText.generateNetworkCopyText}});Object.defineProperty(exports,"getNetworkCondition",{enumerable:true,get:function(){return _store.getNetworkCondition}});Object.defineProperty(exports,"isNetworkListening",{enumerable:true,get:function(){return _networkListener.isNetworkListening}});Object.defineProperty(exports,"networkEventStore",{enumerable:true,get:function(){return _networkEventStore.networkEventStore}});Object.defineProperty(exports,"networkListener",{enumerable:true,get:function(){return _networkListener.networkListener}});Object.defineProperty(exports,"networkSavedStore",{enumerable:true,get:function(){return _networkSavedStore.networkSavedStore}});Object.defineProperty(exports,"networkSelectionStore",{enumerable:true,get:function(){return _networkSelectionStore.networkSelectionStore}});Object.defineProperty(exports,"overrideRulesStore",{enumerable:true,get:function(){return _overrideRulesStore.overrideRulesStore}});Object.defineProperty(exports,"patternForUrl",{enumerable:true,get:function(){return _presets.patternForUrl}});Object.defineProperty(exports,"removeAllNetworkListeners",{enumerable:true,get:function(){return _networkListener.removeAllNetworkListeners}});Object.defineProperty(exports,"ruleMatches",{enumerable:true,get:function(){return _matchRule.ruleMatches}});Object.defineProperty(exports,"selectSavedEvents",{enumerable:true,get:function(){return _selectSavedEvents.selectSavedEvents}});Object.defineProperty(exports,"setNetworkCondition",{enumerable:true,get:function(){return _store.setNetworkCondition}});Object.defineProperty(exports,"splitPinned",{enumerable:true,get:function(){return _withPinnedFirst.splitPinned}});Object.defineProperty(exports,"startNetworkListener",{enumerable:true,get:function(){return _networkListener.startNetworkListener}});Object.defineProperty(exports,"stopNetworkListener",{enumerable:true,get:function(){return _networkListener.stopNetworkListener}});Object.defineProperty(exports,"subscribeNetworkConditions",{enumerable:true,get:function(){return _store.subscribeNetworkConditions}});Object.defineProperty(exports,"toSelectionIds",{enumerable:true,get:function(){return _networkSelectionStore.toSelectionIds}});Object.defineProperty(exports,"useHasNetworkSelection",{enumerable:true,get:function(){return _useNetworkSelection.useHasNetworkSelection}});Object.defineProperty(exports,"useLiveNetworkEvent",{enumerable:true,get:function(){return _useLiveNetworkEvent.useLiveNetworkEvent}});Object.defineProperty(exports,"useNetworkBadgeCounts",{enumerable:true,get:function(){return _useNetworkBadgeCounts.useNetworkBadgeCounts}});Object.defineProperty(exports,"useNetworkBodyEventId",{enumerable:true,get:function(){return _useNetworkSelection.useNetworkBodyEventId}});Object.defineProperty(exports,"useNetworkCursor",{enumerable:true,get:function(){return _useNetworkSelection.useNetworkCursor}});Object.defineProperty(exports,"useNetworkEventList",{enumerable:true,get:function(){return _useNetworkEventList.useNetworkEventList}});Object.defineProperty(exports,"useNetworkEvents",{enumerable:true,get:function(){return _useNetworkEvents.useNetworkEvents}});Object.defineProperty(exports,"useOverrideRules",{enumerable:true,get:function(){return _useOverrideRules.useOverrideRules}});Object.defineProperty(exports,"useSelectedNetworkEventId",{enumerable:true,get:function(){return _useNetworkSelection.useSelectedNetworkEventId}});var _networkListener=require("./network/utils/networkListener");var _networkEventStore=require("./network/utils/networkEventStore");var _networkSavedStore=require("./network/utils/networkSavedStore");var _useNetworkEvents=require("./network/hooks/useNetworkEvents");var _useNetworkEventList=require("./network/hooks/useNetworkEventList");var _useLiveNetworkEvent=require("./network/hooks/useLiveNetworkEvent");var _useNetworkBadgeCounts=require("./network/hooks/useNetworkBadgeCounts");var _useNetworkSelection=require("./network/hooks/useNetworkSelection");var _networkSelectionStore=require("./network/utils/networkSelectionStore");var _NetworkListScreen=require("./network/components/NetworkListScreen.web");var _NetworkEventItemCompact=require("./network/components/NetworkEventItemCompact.web");var _NetworkHeaderLive=require("./network/components/NetworkHeaderLive.web");var _NetworkEventDetailView=require("./network/components/NetworkEventDetailView.web");var _NetworkDetailStepper=require("./network/components/NetworkDetailStepper.web");var _NetworkDetailScreen=require("./network/components/NetworkDetailScreen.web");var _NetworkFilterViewV=require("./network/components/NetworkFilterViewV3.web");var _NetworkFilterScreen=require("./network/components/NetworkFilterScreen.web");var _NetworkSavedScreen=require("./network/components/NetworkSavedScreen.web");var _NetworkCopySettingsView=require("./network/components/NetworkCopySettingsView.web");var _NetworkCopyScreen=require("./network/components/NetworkCopyScreen.web");var _generateNetworkCopyText=require("./network/utils/generateNetworkCopyText");var _selectSavedEvents=require("./network/utils/selectSavedEvents");var _NetworkOverridesScreen=require("./network/components/NetworkOverridesScreen.web");var _NetworkOverrideEditor=require("./network/components/NetworkOverrideEditor.web");var _NetworkNumberPrompt=require("./network/components/NetworkNumberPrompt.web");var _NetworkOverridesButton=require("./network/components/NetworkOverridesButton.web");var _NetworkOverrideHeaderButton=require("./network/components/NetworkOverrideHeaderButton.web");var _useOverrideRules=require("./network/hooks/useOverrideRules");var _overrideRulesStore=require("./network/overrides/overrideRulesStore");var _presets=require("./network/overrides/presets");var _types=require("./network/overrides/types");var _matchRule=require("./network/overrides/matchRule");var _filterNetworkEvents=require("./network/utils/filterNetworkEvents");var _withPinnedFirst=require("./network/utils/withPinnedFirst");var _extractOperationName=require("./network/utils/extractOperationName");var _generateCurl=require("./network/utils/generateCurl");var _store=require("./network/conditions/store");
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"DEFAULT_COPY_SETTINGS",{enumerable:true,get:function(){return _NetworkCopySettingsView.DEFAULT_COPY_SETTINGS}});Object.defineProperty(exports,"FREE_TIER_REQUEST_LIMIT",{enumerable:true,get:function(){return _useNetworkEvents.FREE_TIER_REQUEST_LIMIT}});Object.defineProperty(exports,"FREE_TIER_RULE_LIMIT",{enumerable:true,get:function(){return _types.FREE_TIER_RULE_LIMIT}});Object.defineProperty(exports,"FREE_TIER_SAVED_LIMIT",{enumerable:true,get:function(){return _networkSavedStore.FREE_TIER_SAVED_LIMIT}});Object.defineProperty(exports,"MAX_RULES",{enumerable:true,get:function(){return _types.MAX_RULES}});Object.defineProperty(exports,"MAX_SAVED",{enumerable:true,get:function(){return _networkSavedStore.MAX_SAVED}});Object.defineProperty(exports,"NETWORK_CONDITIONS",{enumerable:true,get:function(){return _store.NETWORK_CONDITIONS}});Object.defineProperty(exports,"NetworkClearButton",{enumerable:true,get:function(){return _NetworkHeaderLive.NetworkClearButton}});Object.defineProperty(exports,"NetworkCopyScreen",{enumerable:true,get:function(){return _NetworkCopyScreen.NetworkCopyScreen}});Object.defineProperty(exports,"NetworkCopySettingsView",{enumerable:true,get:function(){return _NetworkCopySettingsView.NetworkCopySettingsView}});Object.defineProperty(exports,"NetworkDetailPinActions",{enumerable:true,get:function(){return _NetworkHeaderLive.NetworkDetailPinActions}});Object.defineProperty(exports,"NetworkDetailScreen",{enumerable:true,get:function(){return _NetworkDetailScreen.NetworkDetailScreen}});Object.defineProperty(exports,"NetworkDetailStepper",{enumerable:true,get:function(){return _NetworkDetailStepper.NetworkDetailStepper}});Object.defineProperty(exports,"NetworkEventDetailView",{enumerable:true,get:function(){return _NetworkEventDetailView.NetworkEventDetailView}});Object.defineProperty(exports,"NetworkEventItemCompact",{enumerable:true,get:function(){return _NetworkEventItemCompact.NetworkEventItemCompact}});Object.defineProperty(exports,"NetworkFilterScreen",{enumerable:true,get:function(){return _NetworkFilterScreen.NetworkFilterScreen}});Object.defineProperty(exports,"NetworkFilterViewV3",{enumerable:true,get:function(){return _NetworkFilterViewV.NetworkFilterViewV3}});Object.defineProperty(exports,"NetworkHeaderBadges",{enumerable:true,get:function(){return _NetworkHeaderLive.NetworkHeaderBadges}});Object.defineProperty(exports,"NetworkHeaderCopyButton",{enumerable:true,get:function(){return _NetworkHeaderLive.NetworkHeaderCopyButton}});Object.defineProperty(exports,"NetworkListScreen",{enumerable:true,get:function(){return _NetworkListScreen.NetworkListScreen}});Object.defineProperty(exports,"NetworkNumberPrompt",{enumerable:true,get:function(){return _NetworkNumberPrompt.NetworkNumberPrompt}});Object.defineProperty(exports,"NetworkOverrideEditor",{enumerable:true,get:function(){return _NetworkOverrideEditor.NetworkOverrideEditor}});Object.defineProperty(exports,"NetworkOverrideHeaderButton",{enumerable:true,get:function(){return _NetworkOverrideHeaderButton.NetworkOverrideHeaderButton}});Object.defineProperty(exports,"NetworkOverridesButton",{enumerable:true,get:function(){return _NetworkOverridesButton.NetworkOverridesButton}});Object.defineProperty(exports,"NetworkOverridesScreen",{enumerable:true,get:function(){return _NetworkOverridesScreen.NetworkOverridesScreen}});Object.defineProperty(exports,"NetworkSavedButton",{enumerable:true,get:function(){return _NetworkHeaderLive.NetworkSavedButton}});Object.defineProperty(exports,"NetworkSavedScreen",{enumerable:true,get:function(){return _NetworkSavedScreen.NetworkSavedScreen}});Object.defineProperty(exports,"STATUS_MAX",{enumerable:true,get:function(){return _types.STATUS_MAX}});Object.defineProperty(exports,"STATUS_MIN",{enumerable:true,get:function(){return _types.STATUS_MIN}});Object.defineProperty(exports,"addNetworkListener",{enumerable:true,get:function(){return _networkListener.addNetworkListener}});Object.defineProperty(exports,"applyIgnoredPatterns",{enumerable:true,get:function(){return _filterNetworkEvents.applyIgnoredPatterns}});Object.defineProperty(exports,"chooseConditionsSnapshot",{enumerable:true,get:function(){return _remoteState.chooseConditionsSnapshot}});Object.defineProperty(exports,"draftFromEvent",{enumerable:true,get:function(){return _presets.draftFromEvent}});Object.defineProperty(exports,"extractOperationName",{enumerable:true,get:function(){return _extractOperationName.extractOperationName}});Object.defineProperty(exports,"filterNetworkEvents",{enumerable:true,get:function(){return _filterNetworkEvents.filterNetworkEvents}});Object.defineProperty(exports,"flagsForEventId",{enumerable:true,get:function(){return _networkSavedStore.flagsForEventId}});Object.defineProperty(exports,"generateCurl",{enumerable:true,get:function(){return _generateCurl.generateCurl}});Object.defineProperty(exports,"generateNetworkCopyText",{enumerable:true,get:function(){return _generateNetworkCopyText.generateNetworkCopyText}});Object.defineProperty(exports,"getConditionsRevision",{enumerable:true,get:function(){return _store.getConditionsRevision}});Object.defineProperty(exports,"getNetworkCondition",{enumerable:true,get:function(){return _store.getNetworkCondition}});Object.defineProperty(exports,"getNetworkConditions",{enumerable:true,get:function(){return _store.getNetworkConditions}});Object.defineProperty(exports,"getNetworkConnection",{enumerable:true,get:function(){return _store.getNetworkConnection}});Object.defineProperty(exports,"isNetworkListening",{enumerable:true,get:function(){return _networkListener.isNetworkListening}});Object.defineProperty(exports,"networkConditionsActive",{enumerable:true,get:function(){return _store.networkConditionsActive}});Object.defineProperty(exports,"networkEventStore",{enumerable:true,get:function(){return _networkEventStore.networkEventStore}});Object.defineProperty(exports,"networkListener",{enumerable:true,get:function(){return _networkListener.networkListener}});Object.defineProperty(exports,"networkSavedStore",{enumerable:true,get:function(){return _networkSavedStore.networkSavedStore}});Object.defineProperty(exports,"networkSelectionStore",{enumerable:true,get:function(){return _networkSelectionStore.networkSelectionStore}});Object.defineProperty(exports,"overrideRulesStore",{enumerable:true,get:function(){return _overrideRulesStore.overrideRulesStore}});Object.defineProperty(exports,"patternForUrl",{enumerable:true,get:function(){return _presets.patternForUrl}});Object.defineProperty(exports,"removeAllNetworkListeners",{enumerable:true,get:function(){return _networkListener.removeAllNetworkListeners}});Object.defineProperty(exports,"ruleMatches",{enumerable:true,get:function(){return _matchRule.ruleMatches}});Object.defineProperty(exports,"selectSavedEvents",{enumerable:true,get:function(){return _selectSavedEvents.selectSavedEvents}});Object.defineProperty(exports,"setNetworkCondition",{enumerable:true,get:function(){return _store.setNetworkCondition}});Object.defineProperty(exports,"setNetworkConditions",{enumerable:true,get:function(){return _store.setNetworkConditions}});Object.defineProperty(exports,"splitPinned",{enumerable:true,get:function(){return _withPinnedFirst.splitPinned}});Object.defineProperty(exports,"startNetworkListener",{enumerable:true,get:function(){return _networkListener.startNetworkListener}});Object.defineProperty(exports,"stopNetworkListener",{enumerable:true,get:function(){return _networkListener.stopNetworkListener}});Object.defineProperty(exports,"subscribeNetworkConditions",{enumerable:true,get:function(){return _store.subscribeNetworkConditions}});Object.defineProperty(exports,"toSelectionIds",{enumerable:true,get:function(){return _networkSelectionStore.toSelectionIds}});Object.defineProperty(exports,"useHasNetworkSelection",{enumerable:true,get:function(){return _useNetworkSelection.useHasNetworkSelection}});Object.defineProperty(exports,"useLiveNetworkEvent",{enumerable:true,get:function(){return _useLiveNetworkEvent.useLiveNetworkEvent}});Object.defineProperty(exports,"useNetworkBadgeCounts",{enumerable:true,get:function(){return _useNetworkBadgeCounts.useNetworkBadgeCounts}});Object.defineProperty(exports,"useNetworkBodyEventId",{enumerable:true,get:function(){return _useNetworkSelection.useNetworkBodyEventId}});Object.defineProperty(exports,"useNetworkCursor",{enumerable:true,get:function(){return _useNetworkSelection.useNetworkCursor}});Object.defineProperty(exports,"useNetworkEventList",{enumerable:true,get:function(){return _useNetworkEventList.useNetworkEventList}});Object.defineProperty(exports,"useNetworkEvents",{enumerable:true,get:function(){return _useNetworkEvents.useNetworkEvents}});Object.defineProperty(exports,"useOverrideRules",{enumerable:true,get:function(){return _useOverrideRules.useOverrideRules}});Object.defineProperty(exports,"useSelectedNetworkEventId",{enumerable:true,get:function(){return _useNetworkSelection.useSelectedNetworkEventId}});var _networkListener=require("./network/utils/networkListener");var _networkEventStore=require("./network/utils/networkEventStore");var _networkSavedStore=require("./network/utils/networkSavedStore");var _useNetworkEvents=require("./network/hooks/useNetworkEvents");var _useNetworkEventList=require("./network/hooks/useNetworkEventList");var _useLiveNetworkEvent=require("./network/hooks/useLiveNetworkEvent");var _useNetworkBadgeCounts=require("./network/hooks/useNetworkBadgeCounts");var _useNetworkSelection=require("./network/hooks/useNetworkSelection");var _networkSelectionStore=require("./network/utils/networkSelectionStore");var _NetworkListScreen=require("./network/components/NetworkListScreen.web");var _NetworkEventItemCompact=require("./network/components/NetworkEventItemCompact.web");var _NetworkHeaderLive=require("./network/components/NetworkHeaderLive.web");var _NetworkEventDetailView=require("./network/components/NetworkEventDetailView.web");var _NetworkDetailStepper=require("./network/components/NetworkDetailStepper.web");var _NetworkDetailScreen=require("./network/components/NetworkDetailScreen.web");var _NetworkFilterViewV=require("./network/components/NetworkFilterViewV3.web");var _NetworkFilterScreen=require("./network/components/NetworkFilterScreen.web");var _NetworkSavedScreen=require("./network/components/NetworkSavedScreen.web");var _NetworkCopySettingsView=require("./network/components/NetworkCopySettingsView.web");var _NetworkCopyScreen=require("./network/components/NetworkCopyScreen.web");var _generateNetworkCopyText=require("./network/utils/generateNetworkCopyText");var _selectSavedEvents=require("./network/utils/selectSavedEvents");var _NetworkOverridesScreen=require("./network/components/NetworkOverridesScreen.web");var _NetworkOverrideEditor=require("./network/components/NetworkOverrideEditor.web");var _NetworkNumberPrompt=require("./network/components/NetworkNumberPrompt.web");var _NetworkOverridesButton=require("./network/components/NetworkOverridesButton.web");var _NetworkOverrideHeaderButton=require("./network/components/NetworkOverrideHeaderButton.web");var _useOverrideRules=require("./network/hooks/useOverrideRules");var _overrideRulesStore=require("./network/overrides/overrideRulesStore");var _presets=require("./network/overrides/presets");var _types=require("./network/overrides/types");var _matchRule=require("./network/overrides/matchRule");var _filterNetworkEvents=require("./network/utils/filterNetworkEvents");var _withPinnedFirst=require("./network/utils/withPinnedFirst");var _extractOperationName=require("./network/utils/extractOperationName");var _generateCurl=require("./network/utils/generateCurl");var _store=require("./network/conditions/store");var _remoteState=require("./network/conditions/remoteState");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.installNetInfoConditions=installNetInfoConditions;var _netInfoFacade=require("./network/conditions/connectivity/netInfoFacade");var _store=require("./network/conditions/store");var _patchNetwork=require("./network/conditions/connectivity/patchNetwork");let installed=false;function installNetInfoConditions(){if(installed||typeof __DEV__==="undefined"||!__DEV__)return;let t;try{const e=require("@react-native-community/netinfo/src/internal/nativeInterface").default;t=(0,_patchNetwork.patchConnectionState)(e,_store.getEffectiveNetworkConnection,_store.subscribeNetworkConditions);(0,_netInfoFacade.wrapNetInfoApi)(require("@react-native-community/netinfo"));installed=true;(0,_store.setConnectionSupport)("netInfo",{supported:true})}catch(e){t?.();(0,_store.setConnectionSupport)("netInfo",{supported:false,reason:e instanceof Error?e.message:"NetInfo hook could not load."})}}installNetInfoConditions();
|
|
@@ -24,4 +24,4 @@ ${JSON.stringify(w||{},null,2)}
|
|
|
24
24
|
## Response Body
|
|
25
25
|
\`\`\`json
|
|
26
26
|
${JSON.stringify(w||{},null,2)}
|
|
27
|
-
\`\`\``)}return p.join("\n")});const i=e.join("\n\n---\n\n");return(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{style:styles.previewScroll,nestedScrollEnabled:true,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.markdownText,selectable:S,children:i||"No data included"})})}const O=d.map((e,i)=>{const r=[];r.push(`Request ${i+1}:`);if(u){r.push(`${e.method} ${e.url}`)}if(n){r.push(`Status: ${e.status}`);r.push(`Duration: ${e.duration}ms`)}if(y){r.push(`Timestamp: ${e.timestamp}`)}if(h){const m="requestBody"in e?e.requestBody:e.requestData;r.push("\nRequest:");r.push(JSON.stringify(m||{},null,2))}if(q){const m="responseBody"in e?e.responseBody:e.responseData;r.push("\nResponse:");r.push(JSON.stringify(m||{},null,2))}return r.join("\n")});const o=O.join("\n\n---\n\n");return(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{style:styles.previewScroll,nestedScrollEnabled:true,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.plaintextText,selectable:S,children:o||"No data included"})})},[s,c,a,f,S]);const L=(0,_react.useCallback)(()=>{const d=c?a:[f];const t=d.length;return(0,_jsxRuntime.jsx)(_sharedUi.ExportPreview,{expanded:E,onExpandedChange:_,summary:`${t} request${t!==1?"s":""} \u2022 ~${formatBytes(b)}`,warningLevel:F,warningText:{warning:"Large payload - preview may be slow",danger:"Very large payload - may cause performance issues"},renderBody:P})},[s,c,a,f,E,b,F,P]);const I=(0,_react.useCallback)(()=>{const d=c&&j?`Live data \u2022 Updated ${(0,_sharedUi.formatRelativeTime)(j,B)}`:"Mock data (no events captured)";return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.statusLabel,children:d}),(0,_jsxRuntime.jsx)(_sharedUi.ToolbarCopyButton,{value:A()})]})},[c,j,B,A]);const z=(0,_react.useCallback)(()=>{return L()},[L]);const J=(0,_react.useMemo)(()=>({sections:[{id:"presets",title:"Presets",type:"custom",data:[{id:"preset::urls",label:"URLs",icon:_sharedUi.Link,color:_sharedUi.macOSColors.semantic.info,value:"urls",isActive:R==="urls"},{id:"preset::llm",label:"LLM",icon:_sharedUi.Zap,color:_sharedUi.macOSColors.semantic.success,value:"llm",isActive:R==="llm"},{id:"preset::json",label:"JSON",icon:_sharedUi.FileCode,color:_sharedUi.macOSColors.semantic.warning,value:"json",isActive:R==="json"},{id:"preset::full",label:"Full",icon:_sharedUi.FileText,color:_sharedUi.macOSColors.semantic.info,value:"full",isActive:R==="full"},{id:"preset::custom",label:"Custom",icon:_sharedUi.Settings,color:_sharedUi.macOSColors.text.secondary,value:"custom",isActive:R===null}]},{id:"include",title:"Include",type:"custom",data:[{id:"requestInfo::includeMethod",label:"URL",value:"includeMethod",isActive:s.includeMethod},{id:"requestInfo::includeStatus",label:"Status",value:"includeStatus",isActive:s.includeStatus},{id:"requestInfo::includeTimestamp",label:"Time",value:"includeTimestamp",isActive:s.includeTimestamp},{id:"headers::includeRequestHeaders",label:"Headers",value:"includeRequestHeaders",isActive:s.includeRequestHeaders},{id:"body::includeRequestBody",label:"Req Body",value:"includeRequestBody",isActive:s.includeRequestBody},{id:"body::includeResponseBody",label:"Res Body",value:"includeResponseBody",isActive:s.includeResponseBody},{id:"requestInfo::includeErrors",label:"Errors",value:"includeErrors",isActive:s.includeErrors}]},{id:"format",title:"Format",type:"custom",data:[{id:"format::markdown",label:"Markdown",icon:_sharedUi.FileText,color:_sharedUi.macOSColors.semantic.info,value:"markdown",isActive:s.format==="markdown"},{id:"format::json",label:"JSON",icon:_sharedUi.FileCode,color:_sharedUi.macOSColors.semantic.warning,value:"json",isActive:s.format==="json"},{id:"format::plaintext",label:"Text",icon:_sharedUi.Hash,color:_sharedUi.macOSColors.text.secondary,value:"plaintext",isActive:s.format==="plaintext"}]}],previewSection:{enabled:true,title:"PREVIEW",icon:_sharedUi.Eye,content:z,headerActions:I},onFilterChange:N}),[s,N,z,I,R]);if(!S){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.gatedContainer,children:[(0,_jsxRuntime.jsx)(_sharedUi.ProFeatureBanner,{featureName:"Network Export",description:"Export network requests to share with your team, debug APIs, or feed into AI tools.",benefits:["Export to JSON, Markdown, or plain text","Customizable copy presets (URLs only, LLM-ready, full data)","Share request details with teammates","Feed network data directly to AI assistants"]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.gatedPreview,children:(0,_jsxRuntime.jsx)(_sharedUi.DynamicFilterView,{...J})})]})}return(0,_jsxRuntime.jsx)(_sharedUi.DynamicFilterView,{...J})}const styles=_reactNative.StyleSheet.create({previewScroll:{maxHeight:300},markdownText:{fontFamily:_sharedUi.monoFont,fontSize:11,color:_sharedUi.macOSColors.text.primary,lineHeight:18},plaintextText:{fontFamily:_sharedUi.monoFont,fontSize:11,color:_sharedUi.macOSColors.text.primary,lineHeight:18},statusLabel:{fontSize:11,fontWeight:"600",color:_sharedUi.macOSColors.text.muted,marginRight:8},gatedContainer:{flex:1,padding:12},gatedPreview:{flex:1}});
|
|
27
|
+
\`\`\``)}return p.join("\n")});const i=e.join("\n\n---\n\n");return(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{keyboardShouldPersistTaps:"handled",style:styles.previewScroll,nestedScrollEnabled:true,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.markdownText,selectable:S,children:i||"No data included"})})}const O=d.map((e,i)=>{const r=[];r.push(`Request ${i+1}:`);if(u){r.push(`${e.method} ${e.url}`)}if(n){r.push(`Status: ${e.status}`);r.push(`Duration: ${e.duration}ms`)}if(y){r.push(`Timestamp: ${e.timestamp}`)}if(h){const m="requestBody"in e?e.requestBody:e.requestData;r.push("\nRequest:");r.push(JSON.stringify(m||{},null,2))}if(q){const m="responseBody"in e?e.responseBody:e.responseData;r.push("\nResponse:");r.push(JSON.stringify(m||{},null,2))}return r.join("\n")});const o=O.join("\n\n---\n\n");return(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{keyboardShouldPersistTaps:"handled",style:styles.previewScroll,nestedScrollEnabled:true,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.plaintextText,selectable:S,children:o||"No data included"})})},[s,c,a,f,S]);const L=(0,_react.useCallback)(()=>{const d=c?a:[f];const t=d.length;return(0,_jsxRuntime.jsx)(_sharedUi.ExportPreview,{expanded:E,onExpandedChange:_,summary:`${t} request${t!==1?"s":""} \u2022 ~${formatBytes(b)}`,warningLevel:F,warningText:{warning:"Large payload - preview may be slow",danger:"Very large payload - may cause performance issues"},renderBody:P})},[s,c,a,f,E,b,F,P]);const I=(0,_react.useCallback)(()=>{const d=c&&j?`Live data \u2022 Updated ${(0,_sharedUi.formatRelativeTime)(j,B)}`:"Mock data (no events captured)";return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.statusLabel,children:d}),(0,_jsxRuntime.jsx)(_sharedUi.ToolbarCopyButton,{value:A()})]})},[c,j,B,A]);const z=(0,_react.useCallback)(()=>{return L()},[L]);const J=(0,_react.useMemo)(()=>({sections:[{id:"presets",title:"Presets",type:"custom",data:[{id:"preset::urls",label:"URLs",icon:_sharedUi.Link,color:_sharedUi.macOSColors.semantic.info,value:"urls",isActive:R==="urls"},{id:"preset::llm",label:"LLM",icon:_sharedUi.Zap,color:_sharedUi.macOSColors.semantic.success,value:"llm",isActive:R==="llm"},{id:"preset::json",label:"JSON",icon:_sharedUi.FileCode,color:_sharedUi.macOSColors.semantic.warning,value:"json",isActive:R==="json"},{id:"preset::full",label:"Full",icon:_sharedUi.FileText,color:_sharedUi.macOSColors.semantic.info,value:"full",isActive:R==="full"},{id:"preset::custom",label:"Custom",icon:_sharedUi.Settings,color:_sharedUi.macOSColors.text.secondary,value:"custom",isActive:R===null}]},{id:"include",title:"Include",type:"custom",data:[{id:"requestInfo::includeMethod",label:"URL",value:"includeMethod",isActive:s.includeMethod},{id:"requestInfo::includeStatus",label:"Status",value:"includeStatus",isActive:s.includeStatus},{id:"requestInfo::includeTimestamp",label:"Time",value:"includeTimestamp",isActive:s.includeTimestamp},{id:"headers::includeRequestHeaders",label:"Headers",value:"includeRequestHeaders",isActive:s.includeRequestHeaders},{id:"body::includeRequestBody",label:"Req Body",value:"includeRequestBody",isActive:s.includeRequestBody},{id:"body::includeResponseBody",label:"Res Body",value:"includeResponseBody",isActive:s.includeResponseBody},{id:"requestInfo::includeErrors",label:"Errors",value:"includeErrors",isActive:s.includeErrors}]},{id:"format",title:"Format",type:"custom",data:[{id:"format::markdown",label:"Markdown",icon:_sharedUi.FileText,color:_sharedUi.macOSColors.semantic.info,value:"markdown",isActive:s.format==="markdown"},{id:"format::json",label:"JSON",icon:_sharedUi.FileCode,color:_sharedUi.macOSColors.semantic.warning,value:"json",isActive:s.format==="json"},{id:"format::plaintext",label:"Text",icon:_sharedUi.Hash,color:_sharedUi.macOSColors.text.secondary,value:"plaintext",isActive:s.format==="plaintext"}]}],previewSection:{enabled:true,title:"PREVIEW",icon:_sharedUi.Eye,content:z,headerActions:I},onFilterChange:N}),[s,N,z,I,R]);if(!S){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.gatedContainer,children:[(0,_jsxRuntime.jsx)(_sharedUi.ProFeatureBanner,{featureName:"Network Export",description:"Export network requests to share with your team, debug APIs, or feed into AI tools.",benefits:["Export to JSON, Markdown, or plain text","Customizable copy presets (URLs only, LLM-ready, full data)","Share request details with teammates","Feed network data directly to AI assistants"]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.gatedPreview,children:(0,_jsxRuntime.jsx)(_sharedUi.DynamicFilterView,{...J})})]})}return(0,_jsxRuntime.jsx)(_sharedUi.DynamicFilterView,{...J})}const styles=_reactNative.StyleSheet.create({previewScroll:{maxHeight:300},markdownText:{fontFamily:_sharedUi.monoFont,fontSize:11,color:_sharedUi.macOSColors.text.primary,lineHeight:18},plaintextText:{fontFamily:_sharedUi.monoFont,fontSize:11,color:_sharedUi.macOSColors.text.primary,lineHeight:18},statusLabel:{fontSize:11,fontWeight:"600",color:_sharedUi.macOSColors.text.muted,marginRight:8},gatedContainer:{flex:1,padding:12},gatedPreview:{flex:1}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NetworkEventDetailView=void 0;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _formatting=require("../utils/formatting");var _dataViewer=require("@buoy-gg/shared-ui/dataViewer");var _formatGraphQLVariables=require("../utils/formatGraphQLVariables");var _networkBodyResolver=require("../sync/networkBodyResolver");var _jsxRuntime=require("react/jsx-runtime");const NEUTRAL_ICON=_sharedUi.night.color.accent;const EMPTY_PATTERNS=new Set;const noop=()=>{};const TimingPhases=({timings:i,total:e})=>{const l=Math.max(1,e);const a=[{label:"Waiting (TTFB)",hint:"incl. queue, DNS, TLS",value:i.ttfb,color:_sharedUi.macOSColors.semantic.warning},{label:"Content download",hint:void 0,value:i.download,color:_sharedUi.macOSColors.semantic.success}];return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.phaseList,children:a.map(o=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.phaseRow,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.phaseLabelGroup,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.phaseLabel,children:o.label}),o.hint?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.phaseHint,children:o.hint}):null]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.phaseTrack,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.phaseBar,{backgroundColor:o.color,width:`${Math.min(100,Math.max(1,o.value/l*100))}%`}]})}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.phaseValue,children:(0,_formatting.formatDuration)(o.value)})]},o.label))})};const BodyDeferred=()=>(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.bodyDeferred});const CollapsibleSection=({title:i,icon:e,children:l,defaultOpen:a=false,count:o})=>{const[n,w]=(0,_react.useState)(a);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.collapsibleSection,children:[(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:styles.collapsibleHeader,onPress:()=>w(!n),testID:`buoy-network-section-${i.toLowerCase().replace(/\s+/g,"-")}`,accessibilityRole:"button",accessibilityLabel:i,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.collapsibleTitle,children:[e,(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.collapsibleTitleText,children:i}),o!==void 0?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.collapsibleCount,children:o}):null]}),n?(0,_jsxRuntime.jsx)(_sharedUi.ChevronUp,{size:16,color:_sharedUi.night.color.textSecondary}):(0,_jsxRuntime.jsx)(_sharedUi.ChevronDown,{size:16,color:_sharedUi.night.color.textSecondary})]}),n?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.collapsibleContent,children:l}):null]})};const UrlBreakdown=({url:i,requestData:e,operationName:l,graphqlVariables:a,requestClient:o,isPro:n=false,onUpgradePress:w})=>{const s=j=>{try{const d=new URL(j);const x=String(d.protocol||"");const y=String(d.host||"");const z=x==="https:";let u=String(d.pathname||"");if(o==="graphql"&&l){const f=(0,_formatGraphQLVariables.formatGraphQLDisplay)(l,a);u=`${u} (${f})`}else if(l){u=`${u} (${l})`}const p={};const g=d.searchParams;if(g&&typeof g.forEach==="function"){g.forEach((f,m)=>{p[m]=f})}return{protocol:x.replace(":",""),host:y,pathname:u,params:Object.keys(p).length>0?p:null,isSecure:z}}catch{return{protocol:"",host:i,pathname:"",params:null,isSecure:false}}};const r=(0,_react.useMemo)(()=>s(i),[i,o,l,a]);const[c,b]=(0,_react.useState)(false);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.urlBreakdown,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.urlRow,children:[r.isSecure?(0,_jsxRuntime.jsx)(_sharedUi.Lock,{size:12,color:_sharedUi.macOSColors.semantic.success}):(0,_jsxRuntime.jsx)(_sharedUi.Unlock,{size:12,color:_sharedUi.macOSColors.semantic.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.urlDomain,children:r.host}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.urlProtocol,children:["(",r.protocol.toUpperCase(),")"]}),n?(0,_jsxRuntime.jsx)(_sharedUi.InlineCopyButton,{value:i,buttonStyle:styles.copyButton}):(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:styles.copyButton,onPress:w,activeOpacity:.7,children:(0,_jsxRuntime.jsx)(_sharedUi.Copy,{size:14,color:_sharedUi.night.color.textSecondary})})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.urlPathRow,children:(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.urlPath,numberOfLines:2,children:[r.pathname,r.params?(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.urlQueryString,children:["?",new URLSearchParams(r.params).toString()]}):null]})}),r.params?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.queryParamsCollapsible,children:[(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:styles.queryParamsToggle,onPress:()=>b(!c),activeOpacity:.7,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.queryParamsToggleText,children:"Query Parameters"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.collapsibleCount,children:Object.keys(r.params).length}),c?(0,_jsxRuntime.jsx)(_sharedUi.ChevronUp,{size:14,color:_sharedUi.night.color.textSecondary}):(0,_jsxRuntime.jsx)(_sharedUi.ChevronDown,{size:14,color:_sharedUi.night.color.textSecondary})]}),c?(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:r.params,showTypeFilter:true,rawMode:true,initialExpanded:true}):null]}):null]})};const NetworkEventDetailView=exports.NetworkEventDetailView=(0,_react.memo)(function i({event:e,ignoredPatterns:l=EMPTY_PATTERNS,onTogglePattern:a=noop,showBodies:o=true}){const n=e.status?(0,_formatting.formatHttpStatus)(e.status):null;const w=!e.status&&!e.error;const{isPro:s}=(0,_sharedUi.useFeatureGate)();const[r,c]=(0,_react.useState)(false);(0,_react.useEffect)(()=>{if(r&&s){c(false)}},[r,s]);const b=(0,_networkBodyResolver.useNetworkBodyResolver)();const j=e.requestData===void 0&&(e.requestBodyOmitted===true||(e.requestSize??0)>0);const d=e.responseData===void 0&&(e.responseBodyOmitted===true||(e.responseSize??0)>0);const x=e.headersOmitted===true;const[y,z]=(0,_react.useState)(null);const[u,p]=(0,_react.useState)(false);(0,_react.useEffect)(()=>{z(null);if(!b||!j&&!d&&!x){p(false);return}let t=false;p(true);b(e.id).then(h=>{if(!t)z(h)}).catch(()=>{}).finally(()=>{if(!t)p(false)});return()=>{t=true}},[e.id,b,j,d,x]);const g=e.requestData??y?.requestData??void 0;const f=e.responseData??y?.responseData??void 0;const m=(x?y?.requestHeaders:void 0)??e.requestHeaders;const C=(x?y?.responseHeaders:void 0)??e.responseHeaders;const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NetworkEventDetailView=void 0;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _formatting=require("../utils/formatting");var _dataViewer=require("@buoy-gg/shared-ui/dataViewer");var _formatGraphQLVariables=require("../utils/formatGraphQLVariables");var _networkBodyResolver=require("../sync/networkBodyResolver");var _jsxRuntime=require("react/jsx-runtime");const NEUTRAL_ICON=_sharedUi.night.color.accent;const EMPTY_PATTERNS=new Set;const noop=()=>{};const TimingPhases=({timings:i,total:e})=>{const l=Math.max(1,e);const a=[{label:"Waiting (TTFB)",hint:"incl. queue, DNS, TLS",value:i.ttfb,color:_sharedUi.macOSColors.semantic.warning},{label:"Content download",hint:void 0,value:i.download,color:_sharedUi.macOSColors.semantic.success}];return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.phaseList,children:a.map(o=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.phaseRow,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.phaseLabelGroup,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.phaseLabel,children:o.label}),o.hint?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.phaseHint,children:o.hint}):null]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.phaseTrack,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.phaseBar,{backgroundColor:o.color,width:`${Math.min(100,Math.max(1,o.value/l*100))}%`}]})}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.phaseValue,children:(0,_formatting.formatDuration)(o.value)})]},o.label))})};const BodyDeferred=()=>(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.bodyDeferred});const CollapsibleSection=({title:i,icon:e,children:l,defaultOpen:a=false,count:o})=>{const[n,w]=(0,_react.useState)(a);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.collapsibleSection,children:[(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:styles.collapsibleHeader,onPress:()=>w(!n),testID:`buoy-network-section-${i.toLowerCase().replace(/\s+/g,"-")}`,accessibilityRole:"button",accessibilityLabel:i,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.collapsibleTitle,children:[e,(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.collapsibleTitleText,children:i}),o!==void 0?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.collapsibleCount,children:o}):null]}),n?(0,_jsxRuntime.jsx)(_sharedUi.ChevronUp,{size:16,color:_sharedUi.night.color.textSecondary}):(0,_jsxRuntime.jsx)(_sharedUi.ChevronDown,{size:16,color:_sharedUi.night.color.textSecondary})]}),n?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.collapsibleContent,children:l}):null]})};const UrlBreakdown=({url:i,requestData:e,operationName:l,graphqlVariables:a,requestClient:o,isPro:n=false,onUpgradePress:w})=>{const s=j=>{try{const d=new URL(j);const x=String(d.protocol||"");const y=String(d.host||"");const z=x==="https:";let u=String(d.pathname||"");if(o==="graphql"&&l){const f=(0,_formatGraphQLVariables.formatGraphQLDisplay)(l,a);u=`${u} (${f})`}else if(l){u=`${u} (${l})`}const p={};const g=d.searchParams;if(g&&typeof g.forEach==="function"){g.forEach((f,m)=>{p[m]=f})}return{protocol:x.replace(":",""),host:y,pathname:u,params:Object.keys(p).length>0?p:null,isSecure:z}}catch{return{protocol:"",host:i,pathname:"",params:null,isSecure:false}}};const r=(0,_react.useMemo)(()=>s(i),[i,o,l,a]);const[c,b]=(0,_react.useState)(false);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.urlBreakdown,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.urlRow,children:[r.isSecure?(0,_jsxRuntime.jsx)(_sharedUi.Lock,{size:12,color:_sharedUi.macOSColors.semantic.success}):(0,_jsxRuntime.jsx)(_sharedUi.Unlock,{size:12,color:_sharedUi.macOSColors.semantic.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.urlDomain,children:r.host}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.urlProtocol,children:["(",r.protocol.toUpperCase(),")"]}),n?(0,_jsxRuntime.jsx)(_sharedUi.InlineCopyButton,{value:i,buttonStyle:styles.copyButton}):(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:styles.copyButton,onPress:w,activeOpacity:.7,children:(0,_jsxRuntime.jsx)(_sharedUi.Copy,{size:14,color:_sharedUi.night.color.textSecondary})})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.urlPathRow,children:(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.urlPath,numberOfLines:2,children:[r.pathname,r.params?(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.urlQueryString,children:["?",new URLSearchParams(r.params).toString()]}):null]})}),r.params?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.queryParamsCollapsible,children:[(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:styles.queryParamsToggle,onPress:()=>b(!c),activeOpacity:.7,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.queryParamsToggleText,children:"Query Parameters"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.collapsibleCount,children:Object.keys(r.params).length}),c?(0,_jsxRuntime.jsx)(_sharedUi.ChevronUp,{size:14,color:_sharedUi.night.color.textSecondary}):(0,_jsxRuntime.jsx)(_sharedUi.ChevronDown,{size:14,color:_sharedUi.night.color.textSecondary})]}),c?(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:r.params,showTypeFilter:true,rawMode:true,initialExpanded:true}):null]}):null]})};const NetworkEventDetailView=exports.NetworkEventDetailView=(0,_react.memo)(function i({event:e,ignoredPatterns:l=EMPTY_PATTERNS,onTogglePattern:a=noop,showBodies:o=true}){const n=e.status?(0,_formatting.formatHttpStatus)(e.status):null;const w=!e.status&&!e.error;const{isPro:s}=(0,_sharedUi.useFeatureGate)();const[r,c]=(0,_react.useState)(false);(0,_react.useEffect)(()=>{if(r&&s){c(false)}},[r,s]);const b=(0,_networkBodyResolver.useNetworkBodyResolver)();const j=e.requestData===void 0&&(e.requestBodyOmitted===true||(e.requestSize??0)>0);const d=e.responseData===void 0&&(e.responseBodyOmitted===true||(e.responseSize??0)>0);const x=e.headersOmitted===true;const[y,z]=(0,_react.useState)(null);const[u,p]=(0,_react.useState)(false);(0,_react.useEffect)(()=>{z(null);if(!b||!j&&!d&&!x){p(false);return}let t=false;p(true);b(e.id).then(h=>{if(!t)z(h)}).catch(()=>{}).finally(()=>{if(!t)p(false)});return()=>{t=true}},[e.id,b,j,d,x]);const g=e.requestData??y?.requestData??void 0;const f=e.responseData??y?.responseData??void 0;const m=(x?y?.requestHeaders:void 0)??e.requestHeaders;const C=(x?y?.responseHeaders:void 0)??e.responseHeaders;const V=()=>{const t={method:e.method,url:e.url,status:e.status,statusText:e.statusText,timestamp:new Date(e.timestamp).toISOString(),duration:e.duration?`${e.duration}ms`:"N/A",requestHeaders:m,requestData:g,responseHeaders:C,responseData:f,requestSize:e.requestSize?(0,_formatting.formatBytes)(e.requestSize):"N/A",responseSize:e.responseSize?(0,_formatting.formatBytes)(e.responseSize):"N/A",error:e.error,client:e.requestClient};return`# Network Request Details
|
|
2
2
|
|
|
3
3
|
## Request
|
|
4
4
|
- **Method:** ${t.method}
|
|
@@ -32,4 +32,4 @@ ${JSON.stringify(t.responseHeaders,null,2)}
|
|
|
32
32
|
\`\`\`json
|
|
33
33
|
${JSON.stringify(t.responseData,null,2)}
|
|
34
34
|
\`\`\`
|
|
35
|
-
`};return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{testID:"buoy-network-detail-scroll",style:styles.container,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.requestDetailsSection,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.httpHeader,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.httpMethodBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.httpMethod,children:e.method})}),e.status?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.httpStatusBadge,{backgroundColor:`${n?.color}20`}],children:(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:[styles.httpStatusText,{color:n?.color}],children:[n?.text," ",n?.meaning]})}):w?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.pendingBadge,children:[(0,_jsxRuntime.jsx)(_sharedUi.Clock,{size:10,color:_sharedUi.night.color.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.pendingBadgeText,children:"Pending"})]}):null,e.condition&&(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:{color:"#FFCC66"},children:["Conditions: ",e.condition.profile," (+",e.condition.delayMs," ms)"]}),e.duration?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.httpDuration,children:[(0,_jsxRuntime.jsx)(_sharedUi.Clock,{size:10,color:_sharedUi.night.color.textTertiary}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.httpDurationText,children:(0,_formatting.formatDuration)(e.duration)})]}):null,e.override?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.overrideBadge,children:[(0,_jsxRuntime.jsx)(_sharedUi.FlaskConical,{size:10,color:_sharedUi.night.color.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.overrideBadgeText,children:e.override.ruleName||"Overridden"})]}):null,s?(0,_jsxRuntime.jsx)(_sharedUi.InlineCopyButton,{value:D,buttonStyle:styles.copyFullButton}):(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:styles.copyFullButton,onPress:()=>c(true),activeOpacity:.7,children:(0,_jsxRuntime.jsx)(_sharedUi.Copy,{size:14,color:_sharedUi.night.color.textSecondary})})]}),(0,_jsxRuntime.jsx)(UrlBreakdown,{url:e.url,requestData:g,operationName:e.operationName,graphqlVariables:e.graphqlVariables,requestClient:e.requestClient,isPro:s,onUpgradePress:()=>c(true)}),e.error?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.errorBox,children:[(0,_jsxRuntime.jsx)(_sharedUi.AlertCircle,{size:12,color:_sharedUi.night.color.danger}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.errorText,children:e.error})]}):null]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.timingSection,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.timingRow,children:[(0,_jsxRuntime.jsx)(_sharedUi.Clock,{size:12,color:_sharedUi.night.color.textSecondary}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.timingLabel,children:"Started:"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.timingValue,children:(0,_sharedUi.formatRelativeTime)(e.timestamp)}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.timingExact,children:["(",new Date(e.timestamp).toLocaleTimeString(),")"]}),e.requestSize||e.responseSize?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sizeRow,children:[e.requestSize!==void 0?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sizeItem,children:[(0,_jsxRuntime.jsx)(_sharedUi.Upload,{size:10,color:_sharedUi.night.color.info}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sizeLabel,children:"Sent:"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sizeValue,children:(0,_formatting.formatBytes)(e.requestSize)})]}):null,e.responseSize!==void 0?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sizeItem,children:[(0,_jsxRuntime.jsx)(_sharedUi.Download,{size:10,color:NEUTRAL_ICON}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sizeLabel,children:"Received:"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sizeValue,children:(0,_formatting.formatBytes)(e.responseSize)})]}):null]}):null]}),e.timings?(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.phaseDivider}),(0,_jsxRuntime.jsx)(TimingPhases,{timings:e.timings,total:e.duration??e.timings.ttfb+e.timings.download})]}):null]}),(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Request Headers",icon:(0,_jsxRuntime.jsx)(_sharedUi.Upload,{size:14,color:_sharedUi.night.color.info}),defaultOpen:false,count:Object.keys(m).length,children:Object.keys(m).length>0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataViewerContainer,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:m,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!s})}):(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyText,children:"No request headers"})}),(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Response Headers",icon:(0,_jsxRuntime.jsx)(_sharedUi.Download,{size:14,color:NEUTRAL_ICON}),defaultOpen:false,count:Object.keys(C).length,children:Object.keys(C).length>0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataViewerContainer,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:C,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!s})}):(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyText,children:"No response headers yet"})}),g!==void 0?(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Request Body",icon:(0,_jsxRuntime.jsx)(_sharedUi.FileJson,{size:14,color:_sharedUi.night.color.accent}),defaultOpen:false,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataViewerContainer,children:o?(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:g,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!s}):(0,_jsxRuntime.jsx)(BodyDeferred,{})})}):j?(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Request Body",icon:(0,_jsxRuntime.jsx)(_sharedUi.FileJson,{size:14,color:_sharedUi.night.color.accent}),defaultOpen:true,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyText,children:u?`Loading request body (${(0,_formatting.formatBytes)(e.requestSize??0)})\u2026`:"Request body unavailable"})}):null,f!==void 0?(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Response Body",icon:(0,_jsxRuntime.jsx)(_sharedUi.FileJson,{size:14,color:NEUTRAL_ICON}),defaultOpen:true,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataViewerContainer,children:o?(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:f,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!s}):(0,_jsxRuntime.jsx)(BodyDeferred,{})})}):d?(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Response Body",icon:(0,_jsxRuntime.jsx)(_sharedUi.FileJson,{size:14,color:NEUTRAL_ICON}),defaultOpen:true,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyText,children:u?`Loading response body (${(0,_formatting.formatBytes)(e.responseSize??0)})\u2026`:"Response body unavailable"})}):null,(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Filter Options",icon:(0,_jsxRuntime.jsx)(_sharedUi.Filter,{size:14,color:_sharedUi.night.color.warning}),defaultOpen:false,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.filterOptionsContainer,children:(()=>{let t="";let h="";try{const V=new URL(e.url);t=V.hostname;h=V.pathname}catch{h=e.url}const T=l.has(t);const S=l.has(h);return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:[styles.filterOption,T&&styles.filterOptionActive],onPress:()=>t&&a(t),children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.filterOptionLeft,children:[(0,_jsxRuntime.jsx)(_sharedUi.Globe,{size:16,color:T?_sharedUi.night.color.warning:_sharedUi.night.color.textTertiary}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.filterOptionContent,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.filterOptionLabel,children:"Ignore Domain"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.filterOptionValue,children:t||"N/A"})]})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.filterToggle,T&&styles.filterToggleActive],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.filterToggleText,T&&styles.filterToggleTextActive],children:T?"IGNORED":"IGNORE"})})]}),(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:[styles.filterOption,S&&styles.filterOptionActive],onPress:()=>h&&a(h),children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.filterOptionLeft,children:[(0,_jsxRuntime.jsx)(_sharedUi.Link,{size:16,color:S?_sharedUi.night.color.warning:_sharedUi.night.color.textTertiary}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.filterOptionContent,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.filterOptionLabel,children:"Ignore URL Pattern"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.filterOptionValue,numberOfLines:1,children:h||"N/A"})]})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.filterToggle,S&&styles.filterToggleActive],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.filterToggleText,S&&styles.filterToggleTextActive],children:S?"IGNORED":"IGNORE"})})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.filterInfoBox,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.filterInfoText,children:"Ignored requests will be hidden from the network list. You can manage filters in the Filters tab."})})]})})()})})]}),(0,_jsxRuntime.jsx)(_sharedUi.UpgradeModal,{visible:r,onClose:()=>c(false),featureName:"Copy Request Details",description:"Copy network request details to share or debug issues.",benefits:["Copy full request details including headers and body","Export to JSON, Markdown, or plain text","Share request data with teammates","Feed data to AI assistants for debugging"]})]})});const styles=_reactNative.StyleSheet.create({container:{flex:1,backgroundColor:"transparent"},requestDetailsSection:{marginHorizontal:12,marginTop:12,backgroundColor:_sharedUi.night.color.surface,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border,padding:12},httpHeader:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:12,flexWrap:"nowrap"},httpMethodBadge:{backgroundColor:_sharedUi.night.color.infoSoft,paddingHorizontal:8,paddingVertical:4,borderRadius:4},httpMethod:{color:_sharedUi.night.color.info,fontSize:11,fontWeight:"700",letterSpacing:.5},httpStatusBadge:{paddingHorizontal:8,paddingVertical:4,borderRadius:4},httpStatusText:{fontSize:11,fontWeight:"600"},pendingBadge:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:_sharedUi.night.color.warningSoft,paddingHorizontal:8,paddingVertical:4,borderRadius:4},pendingBadgeText:{color:_sharedUi.night.color.warning,fontSize:11,fontWeight:"600"},httpDuration:{flexDirection:"row",alignItems:"center",gap:4},httpDurationText:{color:_sharedUi.night.color.textSecondary,fontSize:11},overrideBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:6,paddingVertical:3,borderRadius:4,backgroundColor:_sharedUi.night.color.warningSoft},overrideBadgeText:{color:_sharedUi.night.color.warning,fontSize:10,fontWeight:"700"},copyFullButton:{marginLeft:"auto",flexShrink:0,padding:4},urlBreakdown:{backgroundColor:_sharedUi.night.color.bg,borderRadius:4,padding:8},urlRow:{flexDirection:"row",alignItems:"center",gap:6,marginBottom:4},urlDomain:{color:_sharedUi.night.color.text,fontSize:12,fontWeight:"600",flex:1},urlProtocol:{color:_sharedUi.night.color.textTertiary,fontSize:10},copyButton:{padding:4},urlPathRow:{paddingLeft:18},urlPath:{color:_sharedUi.night.color.textSecondary,fontSize:11,fontFamily:_sharedUi.monoFont},urlQueryString:{color:_sharedUi.night.color.info,fontSize:11,fontFamily:_sharedUi.monoFont},queryParamsCollapsible:{marginTop:8},queryParamsToggle:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:10,backgroundColor:_sharedUi.night.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border,marginBottom:8},queryParamsToggleText:{flexGrow:0,color:_sharedUi.night.color.text,fontSize:12,fontWeight:"600",letterSpacing:.3},timingSection:{marginHorizontal:12,marginTop:8,backgroundColor:_sharedUi.night.color.surface,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border,padding:12},timingRow:{flexDirection:"row",alignItems:"center",gap:6,flexWrap:"wrap"},timingLabel:{color:_sharedUi.night.color.textSecondary,fontSize:11},timingValue:{color:_sharedUi.night.color.text,fontSize:11,fontWeight:"600"},timingExact:{color:_sharedUi.night.color.textTertiary,fontSize:10,marginLeft:4},sizeRow:{flexDirection:"row",alignItems:"center",gap:16,marginLeft:"auto"},sizeItem:{flexDirection:"row",alignItems:"center",gap:4},sizeLabel:{color:_sharedUi.night.color.textTertiary,fontSize:10},sizeValue:{color:_sharedUi.night.color.info,fontSize:10,fontFamily:_sharedUi.monoFont,fontWeight:"600"},phaseDivider:{height:1,backgroundColor:_sharedUi.night.color.border,marginTop:12,marginBottom:12},phaseList:{gap:8},phaseRow:{flexDirection:"row",alignItems:"center",gap:14},phaseLabelGroup:{width:150},phaseLabel:{fontSize:12,color:_sharedUi.night.color.textSecondary},phaseHint:{fontSize:10,color:_sharedUi.night.color.textTertiary},phaseTrack:{flex:1,height:7,borderRadius:4,backgroundColor:_sharedUi.night.color.surfaceElevated,justifyContent:"center",overflow:"hidden"},phaseBar:{height:7,borderRadius:4},phaseValue:{width:72,textAlign:"right",fontSize:12,fontFamily:_sharedUi.monoFont,color:_sharedUi.night.color.text},collapsibleSection:{marginHorizontal:12,marginTop:8,backgroundColor:_sharedUi.night.color.surface,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border,overflow:"hidden"},collapsibleHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:12,backgroundColor:_sharedUi.night.color.surfaceElevated},collapsibleTitle:{flexDirection:"row",alignItems:"center",gap:8},collapsibleTitleText:{color:_sharedUi.night.color.text,fontSize:13,fontWeight:"600"},collapsibleCount:{color:_sharedUi.night.color.textTertiary,fontSize:11.5,fontFamily:_sharedUi.monoFont},collapsibleContent:{padding:12},dataViewerContainer:{marginTop:-12,marginHorizontal:-12,marginBottom:-12},bodyDeferred:{height:120},errorBox:{flexDirection:"row",alignItems:"center",gap:6,backgroundColor:_sharedUi.night.color.dangerSoft,padding:8,borderRadius:4,marginTop:8},errorText:{color:_sharedUi.night.color.danger,fontSize:11,flex:1},emptyText:{color:_sharedUi.night.color.textTertiary,fontSize:12,fontStyle:"italic",textAlign:"center"},filterOptionsContainer:{gap:12},filterOption:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",backgroundColor:_sharedUi.night.color.surfaceElevated,borderRadius:8,padding:12,borderWidth:1,borderColor:_sharedUi.night.color.border},filterOptionActive:{backgroundColor:_sharedUi.night.color.warningSoft,borderColor:_sharedUi.night.color.warning+"33"},filterOptionLeft:{flexDirection:"row",alignItems:"center",gap:12,flex:1},filterOptionContent:{flex:1},filterOptionLabel:{color:_sharedUi.night.color.textSecondary,fontSize:11,marginBottom:2,textTransform:"uppercase",letterSpacing:.5},filterOptionValue:{color:_sharedUi.night.color.text,fontSize:13,fontFamily:_sharedUi.monoFont},filterToggle:{paddingHorizontal:10,paddingVertical:6,borderRadius:4,backgroundColor:_sharedUi.night.color.bg,borderWidth:1,borderColor:_sharedUi.night.color.border},filterToggleActive:{backgroundColor:_sharedUi.night.color.warningSoft,borderColor:_sharedUi.night.color.warning+"4D"},filterToggleText:{fontSize:10,fontWeight:"600",color:_sharedUi.night.color.textTertiary,letterSpacing:.5},filterToggleTextActive:{color:_sharedUi.night.color.warning},filterInfoBox:{backgroundColor:_sharedUi.night.color.infoSoft,borderRadius:6,padding:10,borderWidth:1,borderColor:_sharedUi.night.color.info+"33"},filterInfoText:{color:_sharedUi.night.color.textSecondary,fontSize:11,lineHeight:16}});
|
|
35
|
+
`};return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{keyboardShouldPersistTaps:"handled",testID:"buoy-network-detail-scroll",style:styles.container,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.requestDetailsSection,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.httpHeader,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.httpMethodBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.httpMethod,children:e.method})}),e.status?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.httpStatusBadge,{backgroundColor:`${n?.color}20`}],children:(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:[styles.httpStatusText,{color:n?.color}],children:[n?.text," ",n?.meaning]})}):w?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.pendingBadge,children:[(0,_jsxRuntime.jsx)(_sharedUi.Clock,{size:10,color:_sharedUi.night.color.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.pendingBadgeText,children:"Pending"})]}):null,e.condition&&(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:{color:"#FFCC66"},children:["Conditions: ",e.condition.profile," (+",e.condition.delayMs," ms)"]}),e.condition?.uploadCap?.note&&(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-network-upload-cap-detail",style:{color:"#FFCC66"},children:e.condition.uploadCap.note}),e.duration?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.httpDuration,children:[(0,_jsxRuntime.jsx)(_sharedUi.Clock,{size:10,color:_sharedUi.night.color.textTertiary}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.httpDurationText,children:(0,_formatting.formatDuration)(e.duration)})]}):null,e.override?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.overrideBadge,children:[(0,_jsxRuntime.jsx)(_sharedUi.FlaskConical,{size:10,color:_sharedUi.night.color.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.overrideBadgeText,children:e.override.ruleName||"Overridden"})]}):null,s?(0,_jsxRuntime.jsx)(_sharedUi.InlineCopyButton,{value:V,buttonStyle:styles.copyFullButton}):(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:styles.copyFullButton,onPress:()=>c(true),activeOpacity:.7,children:(0,_jsxRuntime.jsx)(_sharedUi.Copy,{size:14,color:_sharedUi.night.color.textSecondary})})]}),(0,_jsxRuntime.jsx)(UrlBreakdown,{url:e.url,requestData:g,operationName:e.operationName,graphqlVariables:e.graphqlVariables,requestClient:e.requestClient,isPro:s,onUpgradePress:()=>c(true)}),e.error?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.errorBox,children:[(0,_jsxRuntime.jsx)(_sharedUi.AlertCircle,{size:12,color:_sharedUi.night.color.danger}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.errorText,children:e.error})]}):null]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.timingSection,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.timingRow,children:[(0,_jsxRuntime.jsx)(_sharedUi.Clock,{size:12,color:_sharedUi.night.color.textSecondary}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.timingLabel,children:"Started:"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.timingValue,children:(0,_sharedUi.formatRelativeTime)(e.timestamp)}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.timingExact,children:["(",new Date(e.timestamp).toLocaleTimeString(),")"]}),e.requestSize||e.responseSize?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sizeRow,children:[e.requestSize!==void 0?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sizeItem,children:[(0,_jsxRuntime.jsx)(_sharedUi.Upload,{size:10,color:_sharedUi.night.color.info}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sizeLabel,children:"Sent:"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sizeValue,children:(0,_formatting.formatBytes)(e.requestSize)})]}):null,e.responseSize!==void 0?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sizeItem,children:[(0,_jsxRuntime.jsx)(_sharedUi.Download,{size:10,color:NEUTRAL_ICON}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sizeLabel,children:"Received:"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sizeValue,children:(0,_formatting.formatBytes)(e.responseSize)})]}):null]}):null]}),e.timings?(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.phaseDivider}),(0,_jsxRuntime.jsx)(TimingPhases,{timings:e.timings,total:e.duration??e.timings.ttfb+e.timings.download})]}):null]}),(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Request Headers",icon:(0,_jsxRuntime.jsx)(_sharedUi.Upload,{size:14,color:_sharedUi.night.color.info}),defaultOpen:false,count:Object.keys(m).length,children:Object.keys(m).length>0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataViewerContainer,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:m,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!s})}):(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyText,children:"No request headers"})}),(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Response Headers",icon:(0,_jsxRuntime.jsx)(_sharedUi.Download,{size:14,color:NEUTRAL_ICON}),defaultOpen:false,count:Object.keys(C).length,children:Object.keys(C).length>0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataViewerContainer,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:C,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!s})}):(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyText,children:"No response headers yet"})}),g!==void 0?(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Request Body",icon:(0,_jsxRuntime.jsx)(_sharedUi.FileJson,{size:14,color:_sharedUi.night.color.accent}),defaultOpen:false,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataViewerContainer,children:o?(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:g,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!s}):(0,_jsxRuntime.jsx)(BodyDeferred,{})})}):j?(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Request Body",icon:(0,_jsxRuntime.jsx)(_sharedUi.FileJson,{size:14,color:_sharedUi.night.color.accent}),defaultOpen:true,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyText,children:u?`Loading request body (${(0,_formatting.formatBytes)(e.requestSize??0)})\u2026`:"Request body unavailable"})}):null,f!==void 0?(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Response Body",icon:(0,_jsxRuntime.jsx)(_sharedUi.FileJson,{size:14,color:NEUTRAL_ICON}),defaultOpen:true,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataViewerContainer,children:o?(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:f,showTypeFilter:true,rawMode:true,initialExpanded:true,disableCopy:!s}):(0,_jsxRuntime.jsx)(BodyDeferred,{})})}):d?(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Response Body",icon:(0,_jsxRuntime.jsx)(_sharedUi.FileJson,{size:14,color:NEUTRAL_ICON}),defaultOpen:true,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyText,children:u?`Loading response body (${(0,_formatting.formatBytes)(e.responseSize??0)})\u2026`:"Response body unavailable"})}):null,(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Filter Options",icon:(0,_jsxRuntime.jsx)(_sharedUi.Filter,{size:14,color:_sharedUi.night.color.warning}),defaultOpen:false,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.filterOptionsContainer,children:(()=>{let t="";let h="";try{const D=new URL(e.url);t=D.hostname;h=D.pathname}catch{h=e.url}const T=l.has(t);const S=l.has(h);return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:[styles.filterOption,T&&styles.filterOptionActive],onPress:()=>t&&a(t),children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.filterOptionLeft,children:[(0,_jsxRuntime.jsx)(_sharedUi.Globe,{size:16,color:T?_sharedUi.night.color.warning:_sharedUi.night.color.textTertiary}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.filterOptionContent,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.filterOptionLabel,children:"Ignore Domain"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.filterOptionValue,children:t||"N/A"})]})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.filterToggle,T&&styles.filterToggleActive],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.filterToggleText,T&&styles.filterToggleTextActive],children:T?"IGNORED":"IGNORE"})})]}),(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:[styles.filterOption,S&&styles.filterOptionActive],onPress:()=>h&&a(h),children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.filterOptionLeft,children:[(0,_jsxRuntime.jsx)(_sharedUi.Link,{size:16,color:S?_sharedUi.night.color.warning:_sharedUi.night.color.textTertiary}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.filterOptionContent,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.filterOptionLabel,children:"Ignore URL Pattern"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.filterOptionValue,numberOfLines:1,children:h||"N/A"})]})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.filterToggle,S&&styles.filterToggleActive],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.filterToggleText,S&&styles.filterToggleTextActive],children:S?"IGNORED":"IGNORE"})})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.filterInfoBox,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.filterInfoText,children:"Ignored requests will be hidden from the network list. You can manage filters in the Filters tab."})})]})})()})})]}),(0,_jsxRuntime.jsx)(_sharedUi.UpgradeModal,{visible:r,onClose:()=>c(false),featureName:"Copy Request Details",description:"Copy network request details to share or debug issues.",benefits:["Copy full request details including headers and body","Export to JSON, Markdown, or plain text","Share request data with teammates","Feed data to AI assistants for debugging"]})]})});const styles=_reactNative.StyleSheet.create({container:{flex:1,backgroundColor:"transparent"},requestDetailsSection:{marginHorizontal:12,marginTop:12,backgroundColor:_sharedUi.night.color.surface,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border,padding:12},httpHeader:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:12,flexWrap:"nowrap"},httpMethodBadge:{backgroundColor:_sharedUi.night.color.infoSoft,paddingHorizontal:8,paddingVertical:4,borderRadius:4},httpMethod:{color:_sharedUi.night.color.info,fontSize:11,fontWeight:"700",letterSpacing:.5},httpStatusBadge:{paddingHorizontal:8,paddingVertical:4,borderRadius:4},httpStatusText:{fontSize:11,fontWeight:"600"},pendingBadge:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:_sharedUi.night.color.warningSoft,paddingHorizontal:8,paddingVertical:4,borderRadius:4},pendingBadgeText:{color:_sharedUi.night.color.warning,fontSize:11,fontWeight:"600"},httpDuration:{flexDirection:"row",alignItems:"center",gap:4},httpDurationText:{color:_sharedUi.night.color.textSecondary,fontSize:11},overrideBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:6,paddingVertical:3,borderRadius:4,backgroundColor:_sharedUi.night.color.warningSoft},overrideBadgeText:{color:_sharedUi.night.color.warning,fontSize:10,fontWeight:"700"},copyFullButton:{marginLeft:"auto",flexShrink:0,padding:4},urlBreakdown:{backgroundColor:_sharedUi.night.color.bg,borderRadius:4,padding:8},urlRow:{flexDirection:"row",alignItems:"center",gap:6,marginBottom:4},urlDomain:{color:_sharedUi.night.color.text,fontSize:12,fontWeight:"600",flex:1},urlProtocol:{color:_sharedUi.night.color.textTertiary,fontSize:10},copyButton:{padding:4},urlPathRow:{paddingLeft:18},urlPath:{color:_sharedUi.night.color.textSecondary,fontSize:11,fontFamily:_sharedUi.monoFont},urlQueryString:{color:_sharedUi.night.color.info,fontSize:11,fontFamily:_sharedUi.monoFont},queryParamsCollapsible:{marginTop:8},queryParamsToggle:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:10,backgroundColor:_sharedUi.night.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border,marginBottom:8},queryParamsToggleText:{flexGrow:0,color:_sharedUi.night.color.text,fontSize:12,fontWeight:"600",letterSpacing:.3},timingSection:{marginHorizontal:12,marginTop:8,backgroundColor:_sharedUi.night.color.surface,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border,padding:12},timingRow:{flexDirection:"row",alignItems:"center",gap:6,flexWrap:"wrap"},timingLabel:{color:_sharedUi.night.color.textSecondary,fontSize:11},timingValue:{color:_sharedUi.night.color.text,fontSize:11,fontWeight:"600"},timingExact:{color:_sharedUi.night.color.textTertiary,fontSize:10,marginLeft:4},sizeRow:{flexDirection:"row",alignItems:"center",gap:16,marginLeft:"auto"},sizeItem:{flexDirection:"row",alignItems:"center",gap:4},sizeLabel:{color:_sharedUi.night.color.textTertiary,fontSize:10},sizeValue:{color:_sharedUi.night.color.info,fontSize:10,fontFamily:_sharedUi.monoFont,fontWeight:"600"},phaseDivider:{height:1,backgroundColor:_sharedUi.night.color.border,marginTop:12,marginBottom:12},phaseList:{gap:8},phaseRow:{flexDirection:"row",alignItems:"center",gap:14},phaseLabelGroup:{width:150},phaseLabel:{fontSize:12,color:_sharedUi.night.color.textSecondary},phaseHint:{fontSize:10,color:_sharedUi.night.color.textTertiary},phaseTrack:{flex:1,height:7,borderRadius:4,backgroundColor:_sharedUi.night.color.surfaceElevated,justifyContent:"center",overflow:"hidden"},phaseBar:{height:7,borderRadius:4},phaseValue:{width:72,textAlign:"right",fontSize:12,fontFamily:_sharedUi.monoFont,color:_sharedUi.night.color.text},collapsibleSection:{marginHorizontal:12,marginTop:8,backgroundColor:_sharedUi.night.color.surface,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border,overflow:"hidden"},collapsibleHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:12,backgroundColor:_sharedUi.night.color.surfaceElevated},collapsibleTitle:{flexDirection:"row",alignItems:"center",gap:8},collapsibleTitleText:{color:_sharedUi.night.color.text,fontSize:13,fontWeight:"600"},collapsibleCount:{color:_sharedUi.night.color.textTertiary,fontSize:11.5,fontFamily:_sharedUi.monoFont},collapsibleContent:{padding:12},dataViewerContainer:{marginTop:-12,marginHorizontal:-12,marginBottom:-12},bodyDeferred:{height:120},errorBox:{flexDirection:"row",alignItems:"center",gap:6,backgroundColor:_sharedUi.night.color.dangerSoft,padding:8,borderRadius:4,marginTop:8},errorText:{color:_sharedUi.night.color.danger,fontSize:11,flex:1},emptyText:{color:_sharedUi.night.color.textTertiary,fontSize:12,fontStyle:"italic",textAlign:"center"},filterOptionsContainer:{gap:12},filterOption:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",backgroundColor:_sharedUi.night.color.surfaceElevated,borderRadius:8,padding:12,borderWidth:1,borderColor:_sharedUi.night.color.border},filterOptionActive:{backgroundColor:_sharedUi.night.color.warningSoft,borderColor:_sharedUi.night.color.warning+"33"},filterOptionLeft:{flexDirection:"row",alignItems:"center",gap:12,flex:1},filterOptionContent:{flex:1},filterOptionLabel:{color:_sharedUi.night.color.textSecondary,fontSize:11,marginBottom:2,textTransform:"uppercase",letterSpacing:.5},filterOptionValue:{color:_sharedUi.night.color.text,fontSize:13,fontFamily:_sharedUi.monoFont},filterToggle:{paddingHorizontal:10,paddingVertical:6,borderRadius:4,backgroundColor:_sharedUi.night.color.bg,borderWidth:1,borderColor:_sharedUi.night.color.border},filterToggleActive:{backgroundColor:_sharedUi.night.color.warningSoft,borderColor:_sharedUi.night.color.warning+"4D"},filterToggleText:{fontSize:10,fontWeight:"600",color:_sharedUi.night.color.textTertiary,letterSpacing:.5},filterToggleTextActive:{color:_sharedUi.night.color.warning},filterInfoBox:{backgroundColor:_sharedUi.night.color.infoSoft,borderRadius:6,padding:10,borderWidth:1,borderColor:_sharedUi.night.color.info+"33"},filterInfoText:{color:_sharedUi.night.color.textSecondary,fontSize:11,lineHeight:16}});
|
|
@@ -32,4 +32,4 @@ ${JSON.stringify(r.responseHeaders,null,2)}
|
|
|
32
32
|
\`\`\`json
|
|
33
33
|
${JSON.stringify(r.responseData,null,2)}
|
|
34
34
|
\`\`\`
|
|
35
|
-
`};return(0,_jsxRuntime.jsxs)("div",{style:styles.container,children:[(0,_jsxRuntime.jsxs)("div",{style:styles.requestDetailsSection,children:[(0,_jsxRuntime.jsxs)("div",{style:styles.httpHeader,children:[(0,_jsxRuntime.jsx)("span",{style:styles.httpMethodBadge,children:(0,_jsxRuntime.jsx)("span",{style:styles.httpMethod,children:e.method})}),e.status?(0,_jsxRuntime.jsx)("span",{style:{...styles.httpStatusBadge,backgroundColor:`${n?.color}20`},children:(0,_jsxRuntime.jsxs)("span",{style:{...styles.httpStatusText,color:n?.color},children:[n?.text," ",n?.meaning]})}):l?(0,_jsxRuntime.jsxs)("span",{style:styles.pendingBadge,children:[(0,_jsxRuntime.jsx)(Clock,{size:10,color:macOSColors.semantic.warning}),(0,_jsxRuntime.jsx)("span",{style:styles.pendingBadgeText,children:"Pending"})]}):null,e.duration?(0,_jsxRuntime.jsxs)("span",{style:styles.httpDuration,children:[(0,_jsxRuntime.jsx)(Clock,{size:10,color:macOSColors.text.muted}),(0,_jsxRuntime.jsx)("span",{style:styles.httpDurationText,children:formatDuration(e.duration)})]}):null,e.override?(0,_jsxRuntime.jsxs)("span",{style:styles.overrideBadge,children:[(0,_jsxRuntime.jsx)(FlaskConical,{size:10,color:macOSColors.semantic.warning}),(0,_jsxRuntime.jsx)("span",{style:styles.overrideBadgeText,children:e.override.ruleName||"Overridden"})]}):null,(0,_jsxRuntime.jsx)(_DataViewer.InlineCopyButton,{value:z,buttonStyle:styles.copyFullButton})]}),(0,_jsxRuntime.jsx)(UrlBreakdown,{url:e.url,requestData:c,operationName:e.operationName,graphqlVariables:e.graphqlVariables,requestClient:e.requestClient}),e.error?(0,_jsxRuntime.jsxs)("div",{style:styles.errorBox,children:[(0,_jsxRuntime.jsx)(AlertCircle,{size:12,color:macOSColors.semantic.error}),(0,_jsxRuntime.jsx)("span",{style:styles.errorText,children:e.error})]}):null]}),(0,_jsxRuntime.jsxs)("div",{style:styles.timingSection,children:[(0,_jsxRuntime.jsxs)("div",{style:styles.timingRow,children:[(0,_jsxRuntime.jsx)(Clock,{size:12,color:macOSColors.text.secondary}),(0,_jsxRuntime.jsx)("span",{style:styles.timingLabel,children:"Started:"}),(0,_jsxRuntime.jsx)("span",{style:styles.timingValue,children:formatRelativeTime(e.timestamp)}),(0,_jsxRuntime.jsxs)("span",{style:styles.timingExact,children:["(",new Date(e.timestamp).toLocaleTimeString(),")"]}),e.requestSize||e.responseSize?(0,_jsxRuntime.jsxs)("span",{style:styles.sizeRow,children:[e.requestSize!==void 0?(0,_jsxRuntime.jsxs)("span",{style:styles.sizeItem,children:[(0,_jsxRuntime.jsx)(Upload,{size:10,color:macOSColors.semantic.info}),(0,_jsxRuntime.jsx)("span",{style:styles.sizeLabel,children:"Sent:"}),(0,_jsxRuntime.jsx)("span",{style:styles.sizeValue,children:formatBytes(e.requestSize)})]}):null,e.responseSize!==void 0?(0,_jsxRuntime.jsxs)("span",{style:styles.sizeItem,children:[(0,_jsxRuntime.jsx)(Download,{size:10,color:NEUTRAL_ICON}),(0,_jsxRuntime.jsx)("span",{style:styles.sizeLabel,children:"Received:"}),(0,_jsxRuntime.jsx)("span",{style:styles.sizeValue,children:formatBytes(e.responseSize)})]}):null]}):null]}),e.timings?(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)("div",{style:styles.phaseDivider}),(0,_jsxRuntime.jsx)(TimingPhases,{timings:e.timings,total:e.duration??e.timings.ttfb+e.timings.download})]}):null]}),(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Request Headers",icon:(0,_jsxRuntime.jsx)(Upload,{size:14,color:macOSColors.semantic.info}),defaultOpen:false,count:Object.keys(g).length,children:Object.keys(g).length>0?(0,_jsxRuntime.jsx)("div",{style:styles.dataViewerContainer,children:(0,_jsxRuntime.jsx)(_DataViewer.DataViewer,{title:"",data:g,showTypeFilter:true,rawMode:true,initialExpanded:true})}):(0,_jsxRuntime.jsx)("div",{style:styles.emptyText,children:"No request headers"})}),(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Response Headers",icon:(0,_jsxRuntime.jsx)(Download,{size:14,color:NEUTRAL_ICON}),defaultOpen:false,count:Object.keys(S).length,children:Object.keys(S).length>0?(0,_jsxRuntime.jsx)("div",{style:styles.dataViewerContainer,children:(0,_jsxRuntime.jsx)(_DataViewer.DataViewer,{title:"",data:S,showTypeFilter:true,rawMode:true,initialExpanded:true})}):(0,_jsxRuntime.jsx)("div",{style:styles.emptyText,children:"No response headers yet"})}),c!==void 0?(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Request Body",icon:(0,_jsxRuntime.jsx)(FileJson,{size:14,color:macOSColors.semantic.info}),defaultOpen:false,children:(0,_jsxRuntime.jsx)("div",{style:styles.dataViewerContainer,children:i?(0,_jsxRuntime.jsx)(_DataViewer.DataViewer,{title:"",data:c,showTypeFilter:true,rawMode:true,initialExpanded:true}):(0,_jsxRuntime.jsx)(BodyDeferred,{})})}):y?(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Request Body",icon:(0,_jsxRuntime.jsx)(FileJson,{size:14,color:macOSColors.semantic.info}),defaultOpen:true,children:(0,_jsxRuntime.jsx)("div",{style:styles.emptyText,children:d?`Loading request body (${formatBytes(e.requestSize??0)})\u2026`:"Request body unavailable"})}):null,h!==void 0?(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Response Body",icon:(0,_jsxRuntime.jsx)(FileJson,{size:14,color:NEUTRAL_ICON}),defaultOpen:true,children:(0,_jsxRuntime.jsx)("div",{style:styles.dataViewerContainer,children:i?(0,_jsxRuntime.jsx)(_DataViewer.DataViewer,{title:"",data:h,showTypeFilter:true,rawMode:true,initialExpanded:true}):(0,_jsxRuntime.jsx)(BodyDeferred,{})})}):a?(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Response Body",icon:(0,_jsxRuntime.jsx)(FileJson,{size:14,color:NEUTRAL_ICON}),defaultOpen:true,children:(0,_jsxRuntime.jsx)("div",{style:styles.emptyText,children:d?`Loading response body (${formatBytes(e.responseSize??0)})\u2026`:"Response body unavailable"})}):null,(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Filter Options",icon:(0,_jsxRuntime.jsx)(Filter,{size:14,color:macOSColors.semantic.warning}),defaultOpen:false,children:(0,_jsxRuntime.jsx)("div",{style:styles.filterOptionsContainer,children:(()=>{let r="";let p="";try{const k=new URL(e.url);r=k.hostname;p=k.pathname}catch{p=e.url}const j=s.has(r);const b=s.has(p);return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)("button",{type:"button",style:{...styles.filterOption,...j?styles.filterOptionActive:null},onClick:()=>r&&o(r),children:[(0,_jsxRuntime.jsxs)("span",{style:styles.filterOptionLeft,children:[(0,_jsxRuntime.jsx)(Globe,{size:16,color:j?macOSColors.semantic.warning:macOSColors.text.muted}),(0,_jsxRuntime.jsxs)("span",{style:styles.filterOptionContent,children:[(0,_jsxRuntime.jsx)("span",{style:styles.filterOptionLabel,children:"Ignore Domain"}),(0,_jsxRuntime.jsx)("span",{style:styles.filterOptionValue,children:r||"N/A"})]})]}),(0,_jsxRuntime.jsx)("span",{style:{...styles.filterToggle,...j?styles.filterToggleActive:null},children:(0,_jsxRuntime.jsx)("span",{style:{...styles.filterToggleText,...j?styles.filterToggleTextActive:null},children:j?"IGNORED":"IGNORE"})})]}),(0,_jsxRuntime.jsxs)("button",{type:"button",style:{...styles.filterOption,...b?styles.filterOptionActive:null},onClick:()=>p&&o(p),children:[(0,_jsxRuntime.jsxs)("span",{style:styles.filterOptionLeft,children:[(0,_jsxRuntime.jsx)(Link,{size:16,color:b?macOSColors.semantic.warning:macOSColors.text.muted}),(0,_jsxRuntime.jsxs)("span",{style:styles.filterOptionContent,children:[(0,_jsxRuntime.jsx)("span",{style:styles.filterOptionLabel,children:"Ignore URL Pattern"}),(0,_jsxRuntime.jsx)("span",{style:{...styles.filterOptionValue,...styles.singleLine},children:p||"N/A"})]})]}),(0,_jsxRuntime.jsx)("span",{style:{...styles.filterToggle,...b?styles.filterToggleActive:null},children:(0,_jsxRuntime.jsx)("span",{style:{...styles.filterToggleText,...b?styles.filterToggleTextActive:null},children:b?"IGNORED":"IGNORE"})})]}),(0,_jsxRuntime.jsx)("div",{style:styles.filterInfoBox,children:(0,_jsxRuntime.jsx)("span",{style:styles.filterInfoText,children:"Ignored requests will be hidden from the network list. You can manage filters in the Filters tab."})})]})})()})})]})});const styles={container:{flex:1,minHeight:0,overflowY:"auto",backgroundColor:macOSColors.background.base},requestDetailsSection:{margin:"12px 12px 0",backgroundColor:macOSColors.background.card,borderRadius:8,border:`1px solid ${macOSColors.border.default}`,padding:12},httpHeader:{display:"flex",flexDirection:"row",alignItems:"center",gap:8,marginBottom:12,flexWrap:"nowrap"},httpMethodBadge:{display:"inline-flex",backgroundColor:macOSColors.semantic.infoBackground,padding:"4px 8px",borderRadius:4},httpMethod:{color:macOSColors.semantic.info,fontSize:11,fontWeight:700,letterSpacing:.5},httpStatusBadge:{display:"inline-flex",padding:"4px 8px",borderRadius:4,whiteSpace:"nowrap"},httpStatusText:{fontSize:11,fontWeight:600},pendingBadge:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:4,backgroundColor:macOSColors.semantic.warningBackground,padding:"4px 8px",borderRadius:4},pendingBadgeText:{color:macOSColors.semantic.warning,fontSize:11,fontWeight:600},httpDuration:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:4},httpDurationText:{color:macOSColors.text.secondary,fontSize:11},overrideBadge:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:4,padding:"3px 6px",borderRadius:4,backgroundColor:macOSColors.semantic.warningBackground},overrideBadgeText:{color:macOSColors.semantic.warning,fontSize:10,fontWeight:700},copyFullButton:{marginLeft:"auto",flexShrink:0,padding:4},urlBreakdown:{backgroundColor:macOSColors.background.input,borderRadius:4,padding:8},urlRow:{display:"flex",flexDirection:"row",alignItems:"center",gap:6,marginBottom:4},urlDomain:{color:macOSColors.text.primary,fontSize:12,fontWeight:600,flex:1,minWidth:0,overflowWrap:"anywhere"},urlProtocol:{color:macOSColors.text.muted,fontSize:10},copyButton:{padding:4},urlPathRow:{paddingLeft:18},urlPath:{color:macOSColors.text.secondary,fontSize:11,fontFamily:"ui-monospace, Menlo, monospace",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",overflowWrap:"anywhere"},urlQueryString:{color:macOSColors.semantic.info,fontSize:11,fontFamily:"ui-monospace, Menlo, monospace"},queryParamsCollapsible:{marginTop:8},queryParamsToggle:{display:"flex",width:"100%",boxSizing:"border-box",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:8,padding:"10px 12px",backgroundColor:macOSColors.background.hover,borderRadius:8,border:`1px solid ${macOSColors.border.default}`,marginBottom:8,cursor:"pointer",margin:"0 0 8px",font:"inherit"},queryParamsToggleText:{flexGrow:0,color:macOSColors.text.primary,fontSize:12,fontWeight:600,letterSpacing:.3,whiteSpace:"nowrap"},timingSection:{margin:"8px 12px 0",backgroundColor:macOSColors.background.card,borderRadius:8,border:`1px solid ${macOSColors.border.default}`,padding:12},timingRow:{display:"flex",flexDirection:"row",alignItems:"center",gap:6,flexWrap:"wrap"},timingLabel:{color:macOSColors.text.secondary,fontSize:11},timingValue:{color:macOSColors.text.primary,fontSize:11,fontWeight:600},timingExact:{color:macOSColors.text.muted,fontSize:10,marginLeft:4},sizeRow:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:16,marginLeft:"auto"},sizeItem:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:4},sizeLabel:{color:macOSColors.text.muted,fontSize:10},sizeValue:{color:macOSColors.semantic.info,fontSize:10,fontFamily:"ui-monospace, Menlo, monospace",fontWeight:600},phaseDivider:{height:1,backgroundColor:macOSColors.border.default,marginTop:12,marginBottom:12},phaseList:{display:"flex",flexDirection:"column",gap:8},phaseRow:{display:"flex",flexDirection:"row",alignItems:"center",gap:14},phaseLabelGroup:{width:150,flexShrink:0},phaseLabel:{fontSize:12,color:macOSColors.text.secondary},phaseHint:{fontSize:10,color:macOSColors.text.muted},phaseTrack:{flex:1,minWidth:0,height:7,borderRadius:4,backgroundColor:macOSColors.background.hover,display:"flex",justifyContent:"center",flexDirection:"column",overflow:"hidden"},phaseBar:{height:7,borderRadius:4},phaseValue:{width:72,flexShrink:0,textAlign:"right",fontSize:12,fontFamily:"ui-monospace, Menlo, monospace",color:macOSColors.text.primary},collapsibleSection:{margin:"8px 12px 0",backgroundColor:macOSColors.background.card,borderRadius:8,border:`1px solid ${macOSColors.border.default}`,overflow:"hidden"},collapsibleHeader:{display:"flex",width:"100%",boxSizing:"border-box",flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:12,backgroundColor:macOSColors.background.hover,border:"none",cursor:"pointer",margin:0,font:"inherit",textAlign:"left"},collapsibleTitle:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:8},collapsibleTitleText:{color:macOSColors.text.primary,fontSize:13,fontWeight:600},collapsibleCount:{color:macOSColors.text.muted,fontSize:11.5,fontFamily:"ui-monospace, Menlo, monospace"},collapsibleContent:{padding:12},dataViewerContainer:{margin:-12},bodyDeferred:{height:120},errorBox:{display:"flex",flexDirection:"row",alignItems:"center",gap:6,backgroundColor:macOSColors.semantic.errorBackground,padding:8,borderRadius:4,marginTop:8},errorText:{color:macOSColors.semantic.error,fontSize:11,flex:1,minWidth:0,overflowWrap:"anywhere"},emptyText:{color:macOSColors.text.muted,fontSize:12,fontStyle:"italic",textAlign:"center"},filterOptionsContainer:{display:"flex",flexDirection:"column",gap:12},filterOption:{display:"flex",width:"100%",boxSizing:"border-box",flexDirection:"row",alignItems:"center",justifyContent:"space-between",backgroundColor:macOSColors.background.hover,borderRadius:8,padding:12,border:`1px solid ${macOSColors.border.default}`,cursor:"pointer",margin:0,font:"inherit",textAlign:"left"},filterOptionActive:{backgroundColor:macOSColors.semantic.warningBackground,border:`1px solid ${macOSColors.semantic.warning}33`},filterOptionLeft:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:12,flex:1,minWidth:0},filterOptionContent:{display:"inline-flex",flexDirection:"column",flex:1,minWidth:0},filterOptionLabel:{color:macOSColors.text.secondary,fontSize:11,marginBottom:2,textTransform:"uppercase",letterSpacing:.5},filterOptionValue:{color:macOSColors.text.primary,fontSize:13,fontFamily:"ui-monospace, Menlo, monospace",overflowWrap:"anywhere"},singleLine:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"block"},filterToggle:{display:"inline-flex",padding:"6px 10px",borderRadius:4,backgroundColor:macOSColors.background.input,border:`1px solid ${macOSColors.border.default}`,flexShrink:0},filterToggleActive:{backgroundColor:`${macOSColors.semantic.warning}26`,border:`1px solid ${macOSColors.semantic.warning}4D`},filterToggleText:{fontSize:10,fontWeight:600,color:macOSColors.text.muted,letterSpacing:.5},filterToggleTextActive:{color:macOSColors.semantic.warning},filterInfoBox:{backgroundColor:macOSColors.semantic.infoBackground,borderRadius:6,padding:10,border:`1px solid ${macOSColors.semantic.info}33`},filterInfoText:{color:macOSColors.text.secondary,fontSize:11,lineHeight:"16px"}};
|
|
35
|
+
`};return(0,_jsxRuntime.jsxs)("div",{style:styles.container,children:[(0,_jsxRuntime.jsxs)("div",{style:styles.requestDetailsSection,children:[(0,_jsxRuntime.jsxs)("div",{style:styles.httpHeader,children:[(0,_jsxRuntime.jsx)("span",{style:styles.httpMethodBadge,children:(0,_jsxRuntime.jsx)("span",{style:styles.httpMethod,children:e.method})}),e.status?(0,_jsxRuntime.jsx)("span",{style:{...styles.httpStatusBadge,backgroundColor:`${n?.color}20`},children:(0,_jsxRuntime.jsxs)("span",{style:{...styles.httpStatusText,color:n?.color},children:[n?.text," ",n?.meaning]})}):l?(0,_jsxRuntime.jsxs)("span",{style:styles.pendingBadge,children:[(0,_jsxRuntime.jsx)(Clock,{size:10,color:macOSColors.semantic.warning}),(0,_jsxRuntime.jsx)("span",{style:styles.pendingBadgeText,children:"Pending"})]}):null,e.condition?.uploadCap?.note&&(0,_jsxRuntime.jsx)("span",{style:{color:"#FFCC66"},children:e.condition.uploadCap.note}),e.duration?(0,_jsxRuntime.jsxs)("span",{style:styles.httpDuration,children:[(0,_jsxRuntime.jsx)(Clock,{size:10,color:macOSColors.text.muted}),(0,_jsxRuntime.jsx)("span",{style:styles.httpDurationText,children:formatDuration(e.duration)})]}):null,e.override?(0,_jsxRuntime.jsxs)("span",{style:styles.overrideBadge,children:[(0,_jsxRuntime.jsx)(FlaskConical,{size:10,color:macOSColors.semantic.warning}),(0,_jsxRuntime.jsx)("span",{style:styles.overrideBadgeText,children:e.override.ruleName||"Overridden"})]}):null,(0,_jsxRuntime.jsx)(_DataViewer.InlineCopyButton,{value:z,buttonStyle:styles.copyFullButton})]}),(0,_jsxRuntime.jsx)(UrlBreakdown,{url:e.url,requestData:c,operationName:e.operationName,graphqlVariables:e.graphqlVariables,requestClient:e.requestClient}),e.error?(0,_jsxRuntime.jsxs)("div",{style:styles.errorBox,children:[(0,_jsxRuntime.jsx)(AlertCircle,{size:12,color:macOSColors.semantic.error}),(0,_jsxRuntime.jsx)("span",{style:styles.errorText,children:e.error})]}):null]}),(0,_jsxRuntime.jsxs)("div",{style:styles.timingSection,children:[(0,_jsxRuntime.jsxs)("div",{style:styles.timingRow,children:[(0,_jsxRuntime.jsx)(Clock,{size:12,color:macOSColors.text.secondary}),(0,_jsxRuntime.jsx)("span",{style:styles.timingLabel,children:"Started:"}),(0,_jsxRuntime.jsx)("span",{style:styles.timingValue,children:formatRelativeTime(e.timestamp)}),(0,_jsxRuntime.jsxs)("span",{style:styles.timingExact,children:["(",new Date(e.timestamp).toLocaleTimeString(),")"]}),e.requestSize||e.responseSize?(0,_jsxRuntime.jsxs)("span",{style:styles.sizeRow,children:[e.requestSize!==void 0?(0,_jsxRuntime.jsxs)("span",{style:styles.sizeItem,children:[(0,_jsxRuntime.jsx)(Upload,{size:10,color:macOSColors.semantic.info}),(0,_jsxRuntime.jsx)("span",{style:styles.sizeLabel,children:"Sent:"}),(0,_jsxRuntime.jsx)("span",{style:styles.sizeValue,children:formatBytes(e.requestSize)})]}):null,e.responseSize!==void 0?(0,_jsxRuntime.jsxs)("span",{style:styles.sizeItem,children:[(0,_jsxRuntime.jsx)(Download,{size:10,color:NEUTRAL_ICON}),(0,_jsxRuntime.jsx)("span",{style:styles.sizeLabel,children:"Received:"}),(0,_jsxRuntime.jsx)("span",{style:styles.sizeValue,children:formatBytes(e.responseSize)})]}):null]}):null]}),e.timings?(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)("div",{style:styles.phaseDivider}),(0,_jsxRuntime.jsx)(TimingPhases,{timings:e.timings,total:e.duration??e.timings.ttfb+e.timings.download})]}):null]}),(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Request Headers",icon:(0,_jsxRuntime.jsx)(Upload,{size:14,color:macOSColors.semantic.info}),defaultOpen:false,count:Object.keys(g).length,children:Object.keys(g).length>0?(0,_jsxRuntime.jsx)("div",{style:styles.dataViewerContainer,children:(0,_jsxRuntime.jsx)(_DataViewer.DataViewer,{title:"",data:g,showTypeFilter:true,rawMode:true,initialExpanded:true})}):(0,_jsxRuntime.jsx)("div",{style:styles.emptyText,children:"No request headers"})}),(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Response Headers",icon:(0,_jsxRuntime.jsx)(Download,{size:14,color:NEUTRAL_ICON}),defaultOpen:false,count:Object.keys(S).length,children:Object.keys(S).length>0?(0,_jsxRuntime.jsx)("div",{style:styles.dataViewerContainer,children:(0,_jsxRuntime.jsx)(_DataViewer.DataViewer,{title:"",data:S,showTypeFilter:true,rawMode:true,initialExpanded:true})}):(0,_jsxRuntime.jsx)("div",{style:styles.emptyText,children:"No response headers yet"})}),c!==void 0?(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Request Body",icon:(0,_jsxRuntime.jsx)(FileJson,{size:14,color:macOSColors.semantic.info}),defaultOpen:false,children:(0,_jsxRuntime.jsx)("div",{style:styles.dataViewerContainer,children:i?(0,_jsxRuntime.jsx)(_DataViewer.DataViewer,{title:"",data:c,showTypeFilter:true,rawMode:true,initialExpanded:true}):(0,_jsxRuntime.jsx)(BodyDeferred,{})})}):y?(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Request Body",icon:(0,_jsxRuntime.jsx)(FileJson,{size:14,color:macOSColors.semantic.info}),defaultOpen:true,children:(0,_jsxRuntime.jsx)("div",{style:styles.emptyText,children:d?`Loading request body (${formatBytes(e.requestSize??0)})\u2026`:"Request body unavailable"})}):null,h!==void 0?(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Response Body",icon:(0,_jsxRuntime.jsx)(FileJson,{size:14,color:NEUTRAL_ICON}),defaultOpen:true,children:(0,_jsxRuntime.jsx)("div",{style:styles.dataViewerContainer,children:i?(0,_jsxRuntime.jsx)(_DataViewer.DataViewer,{title:"",data:h,showTypeFilter:true,rawMode:true,initialExpanded:true}):(0,_jsxRuntime.jsx)(BodyDeferred,{})})}):a?(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Response Body",icon:(0,_jsxRuntime.jsx)(FileJson,{size:14,color:NEUTRAL_ICON}),defaultOpen:true,children:(0,_jsxRuntime.jsx)("div",{style:styles.emptyText,children:d?`Loading response body (${formatBytes(e.responseSize??0)})\u2026`:"Response body unavailable"})}):null,(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Filter Options",icon:(0,_jsxRuntime.jsx)(Filter,{size:14,color:macOSColors.semantic.warning}),defaultOpen:false,children:(0,_jsxRuntime.jsx)("div",{style:styles.filterOptionsContainer,children:(()=>{let r="";let p="";try{const k=new URL(e.url);r=k.hostname;p=k.pathname}catch{p=e.url}const j=s.has(r);const b=s.has(p);return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)("button",{type:"button",style:{...styles.filterOption,...j?styles.filterOptionActive:null},onClick:()=>r&&o(r),children:[(0,_jsxRuntime.jsxs)("span",{style:styles.filterOptionLeft,children:[(0,_jsxRuntime.jsx)(Globe,{size:16,color:j?macOSColors.semantic.warning:macOSColors.text.muted}),(0,_jsxRuntime.jsxs)("span",{style:styles.filterOptionContent,children:[(0,_jsxRuntime.jsx)("span",{style:styles.filterOptionLabel,children:"Ignore Domain"}),(0,_jsxRuntime.jsx)("span",{style:styles.filterOptionValue,children:r||"N/A"})]})]}),(0,_jsxRuntime.jsx)("span",{style:{...styles.filterToggle,...j?styles.filterToggleActive:null},children:(0,_jsxRuntime.jsx)("span",{style:{...styles.filterToggleText,...j?styles.filterToggleTextActive:null},children:j?"IGNORED":"IGNORE"})})]}),(0,_jsxRuntime.jsxs)("button",{type:"button",style:{...styles.filterOption,...b?styles.filterOptionActive:null},onClick:()=>p&&o(p),children:[(0,_jsxRuntime.jsxs)("span",{style:styles.filterOptionLeft,children:[(0,_jsxRuntime.jsx)(Link,{size:16,color:b?macOSColors.semantic.warning:macOSColors.text.muted}),(0,_jsxRuntime.jsxs)("span",{style:styles.filterOptionContent,children:[(0,_jsxRuntime.jsx)("span",{style:styles.filterOptionLabel,children:"Ignore URL Pattern"}),(0,_jsxRuntime.jsx)("span",{style:{...styles.filterOptionValue,...styles.singleLine},children:p||"N/A"})]})]}),(0,_jsxRuntime.jsx)("span",{style:{...styles.filterToggle,...b?styles.filterToggleActive:null},children:(0,_jsxRuntime.jsx)("span",{style:{...styles.filterToggleText,...b?styles.filterToggleTextActive:null},children:b?"IGNORED":"IGNORE"})})]}),(0,_jsxRuntime.jsx)("div",{style:styles.filterInfoBox,children:(0,_jsxRuntime.jsx)("span",{style:styles.filterInfoText,children:"Ignored requests will be hidden from the network list. You can manage filters in the Filters tab."})})]})})()})})]})});const styles={container:{flex:1,minHeight:0,overflowY:"auto",backgroundColor:macOSColors.background.base},requestDetailsSection:{margin:"12px 12px 0",backgroundColor:macOSColors.background.card,borderRadius:8,border:`1px solid ${macOSColors.border.default}`,padding:12},httpHeader:{display:"flex",flexDirection:"row",alignItems:"center",gap:8,marginBottom:12,flexWrap:"nowrap"},httpMethodBadge:{display:"inline-flex",backgroundColor:macOSColors.semantic.infoBackground,padding:"4px 8px",borderRadius:4},httpMethod:{color:macOSColors.semantic.info,fontSize:11,fontWeight:700,letterSpacing:.5},httpStatusBadge:{display:"inline-flex",padding:"4px 8px",borderRadius:4,whiteSpace:"nowrap"},httpStatusText:{fontSize:11,fontWeight:600},pendingBadge:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:4,backgroundColor:macOSColors.semantic.warningBackground,padding:"4px 8px",borderRadius:4},pendingBadgeText:{color:macOSColors.semantic.warning,fontSize:11,fontWeight:600},httpDuration:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:4},httpDurationText:{color:macOSColors.text.secondary,fontSize:11},overrideBadge:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:4,padding:"3px 6px",borderRadius:4,backgroundColor:macOSColors.semantic.warningBackground},overrideBadgeText:{color:macOSColors.semantic.warning,fontSize:10,fontWeight:700},copyFullButton:{marginLeft:"auto",flexShrink:0,padding:4},urlBreakdown:{backgroundColor:macOSColors.background.input,borderRadius:4,padding:8},urlRow:{display:"flex",flexDirection:"row",alignItems:"center",gap:6,marginBottom:4},urlDomain:{color:macOSColors.text.primary,fontSize:12,fontWeight:600,flex:1,minWidth:0,overflowWrap:"anywhere"},urlProtocol:{color:macOSColors.text.muted,fontSize:10},copyButton:{padding:4},urlPathRow:{paddingLeft:18},urlPath:{color:macOSColors.text.secondary,fontSize:11,fontFamily:"ui-monospace, Menlo, monospace",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",overflowWrap:"anywhere"},urlQueryString:{color:macOSColors.semantic.info,fontSize:11,fontFamily:"ui-monospace, Menlo, monospace"},queryParamsCollapsible:{marginTop:8},queryParamsToggle:{display:"flex",width:"100%",boxSizing:"border-box",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:8,padding:"10px 12px",backgroundColor:macOSColors.background.hover,borderRadius:8,border:`1px solid ${macOSColors.border.default}`,marginBottom:8,cursor:"pointer",margin:"0 0 8px",font:"inherit"},queryParamsToggleText:{flexGrow:0,color:macOSColors.text.primary,fontSize:12,fontWeight:600,letterSpacing:.3,whiteSpace:"nowrap"},timingSection:{margin:"8px 12px 0",backgroundColor:macOSColors.background.card,borderRadius:8,border:`1px solid ${macOSColors.border.default}`,padding:12},timingRow:{display:"flex",flexDirection:"row",alignItems:"center",gap:6,flexWrap:"wrap"},timingLabel:{color:macOSColors.text.secondary,fontSize:11},timingValue:{color:macOSColors.text.primary,fontSize:11,fontWeight:600},timingExact:{color:macOSColors.text.muted,fontSize:10,marginLeft:4},sizeRow:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:16,marginLeft:"auto"},sizeItem:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:4},sizeLabel:{color:macOSColors.text.muted,fontSize:10},sizeValue:{color:macOSColors.semantic.info,fontSize:10,fontFamily:"ui-monospace, Menlo, monospace",fontWeight:600},phaseDivider:{height:1,backgroundColor:macOSColors.border.default,marginTop:12,marginBottom:12},phaseList:{display:"flex",flexDirection:"column",gap:8},phaseRow:{display:"flex",flexDirection:"row",alignItems:"center",gap:14},phaseLabelGroup:{width:150,flexShrink:0},phaseLabel:{fontSize:12,color:macOSColors.text.secondary},phaseHint:{fontSize:10,color:macOSColors.text.muted},phaseTrack:{flex:1,minWidth:0,height:7,borderRadius:4,backgroundColor:macOSColors.background.hover,display:"flex",justifyContent:"center",flexDirection:"column",overflow:"hidden"},phaseBar:{height:7,borderRadius:4},phaseValue:{width:72,flexShrink:0,textAlign:"right",fontSize:12,fontFamily:"ui-monospace, Menlo, monospace",color:macOSColors.text.primary},collapsibleSection:{margin:"8px 12px 0",backgroundColor:macOSColors.background.card,borderRadius:8,border:`1px solid ${macOSColors.border.default}`,overflow:"hidden"},collapsibleHeader:{display:"flex",width:"100%",boxSizing:"border-box",flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:12,backgroundColor:macOSColors.background.hover,border:"none",cursor:"pointer",margin:0,font:"inherit",textAlign:"left"},collapsibleTitle:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:8},collapsibleTitleText:{color:macOSColors.text.primary,fontSize:13,fontWeight:600},collapsibleCount:{color:macOSColors.text.muted,fontSize:11.5,fontFamily:"ui-monospace, Menlo, monospace"},collapsibleContent:{padding:12},dataViewerContainer:{margin:-12},bodyDeferred:{height:120},errorBox:{display:"flex",flexDirection:"row",alignItems:"center",gap:6,backgroundColor:macOSColors.semantic.errorBackground,padding:8,borderRadius:4,marginTop:8},errorText:{color:macOSColors.semantic.error,fontSize:11,flex:1,minWidth:0,overflowWrap:"anywhere"},emptyText:{color:macOSColors.text.muted,fontSize:12,fontStyle:"italic",textAlign:"center"},filterOptionsContainer:{display:"flex",flexDirection:"column",gap:12},filterOption:{display:"flex",width:"100%",boxSizing:"border-box",flexDirection:"row",alignItems:"center",justifyContent:"space-between",backgroundColor:macOSColors.background.hover,borderRadius:8,padding:12,border:`1px solid ${macOSColors.border.default}`,cursor:"pointer",margin:0,font:"inherit",textAlign:"left"},filterOptionActive:{backgroundColor:macOSColors.semantic.warningBackground,border:`1px solid ${macOSColors.semantic.warning}33`},filterOptionLeft:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:12,flex:1,minWidth:0},filterOptionContent:{display:"inline-flex",flexDirection:"column",flex:1,minWidth:0},filterOptionLabel:{color:macOSColors.text.secondary,fontSize:11,marginBottom:2,textTransform:"uppercase",letterSpacing:.5},filterOptionValue:{color:macOSColors.text.primary,fontSize:13,fontFamily:"ui-monospace, Menlo, monospace",overflowWrap:"anywhere"},singleLine:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"block"},filterToggle:{display:"inline-flex",padding:"6px 10px",borderRadius:4,backgroundColor:macOSColors.background.input,border:`1px solid ${macOSColors.border.default}`,flexShrink:0},filterToggleActive:{backgroundColor:`${macOSColors.semantic.warning}26`,border:`1px solid ${macOSColors.semantic.warning}4D`},filterToggleText:{fontSize:10,fontWeight:600,color:macOSColors.text.muted,letterSpacing:.5},filterToggleTextActive:{color:macOSColors.semantic.warning},filterInfoBox:{backgroundColor:macOSColors.semantic.infoBackground,borderRadius:6,padding:10,border:`1px solid ${macOSColors.semantic.info}33`},filterInfoText:{color:macOSColors.text.secondary,fontSize:11,lineHeight:"16px"}};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NetworkEventItemCompact=void 0;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _formatting=require("../utils/formatting");var _useTickEveryMinute=require("../hooks/useTickEveryMinute");var _formatGraphQLVariables=require("../utils/formatGraphQLVariables");var _jsxRuntime=require("react/jsx-runtime");function getStatusColor(
|
|
2
|
-
(${e.operationName})`}return(0,_jsxRuntime.jsxs)(_sharedUi.DevToolsCard,{onPress:()=>o(e),onLongPress:n?()=>n(e):void 0,style:styles.cardWrapper,contentStyle:[styles.container,{borderLeftColor:l}],testID:`buoy-network-row-${e.id}`,accessibilityLabel:`${e.method} ${e.path||e.url}`,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.topRightContainer,children:[i?(0,_jsxRuntime.jsx)(_sharedUi.Pin,{size:10,active:true,color:_sharedUi.night.color.info}):null,s?(0,_jsxRuntime.jsx)(_sharedUi.Bookmark,{size:10,color:_sharedUi.night.color.accent}):null,c||e.override?(0,_jsxRuntime.jsx)(_sharedUi.FlaskConical,{size:10,color:_sharedUi.night.color.warning}):null,(0,_jsxRuntime.jsx)(StatusIndicator,{event:e,isPending:d,statusColor:l}),e.requestClient?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.topRightBadge,{backgroundColor:getClientChipColors(e.requestClient).backgroundColor}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.clientText,{color:getClientChipColors(e.requestClient).color}],children:e.requestClient==="graphql"?"GQL":e.requestClient==="grpc-web"?"gRPC":e.requestClient==="xhr"?"XHR":e.requestClient})}):null]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.leftSection,children:[(0,_jsxRuntime.jsx)(_sharedUi.MethodBadge,{method:e.method,size:"small"}),(0,_jsxRuntime.jsx)(SizeIndicators,{requestSize:e.requestSize,responseSize:e.responseSize})]}),(0,_jsxRuntime.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NetworkEventItemCompact=void 0;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _formatting=require("../utils/formatting");var _useTickEveryMinute=require("../hooks/useTickEveryMinute");var _formatGraphQLVariables=require("../utils/formatGraphQLVariables");var _jsxRuntime=require("react/jsx-runtime");function getStatusColor(t,e){if(e)return _sharedUi.macOSColors.semantic.error;if(!t)return _sharedUi.macOSColors.semantic.warning;if(t>=200&&t<300)return _sharedUi.macOSColors.semantic.success;if(t>=300&&t<400)return _sharedUi.macOSColors.semantic.info;if(t>=400)return _sharedUi.macOSColors.semantic.error;return _sharedUi.macOSColors.text.muted}function getContentTypeBadge(t){const e=t?.["content-type"]||t?.["Content-Type"]||"";if(e.includes("json"))return"JSON";if(e.includes("xml"))return"XML";if(e.includes("html"))return"HTML";if(e.includes("text"))return"TEXT";if(e.includes("image"))return"IMG";if(e.includes("video"))return"VIDEO";if(e.includes("audio"))return"AUDIO";if(e.includes("form"))return"FORM";return null}function getClientChipColors(t){switch(t){case"fetch":return{backgroundColor:"rgba(74, 144, 226, 0.15)",color:"#4A90E2"};case"graphql":return{backgroundColor:"rgba(229, 53, 171, 0.15)",color:"#E535AB"};case"grpc-web":return{backgroundColor:"rgba(16, 185, 129, 0.15)",color:"#10B981"};case"xhr":return{backgroundColor:"rgba(245, 158, 11, 0.15)",color:"#F59E0B"};default:return{backgroundColor:"rgba(147, 51, 234, 0.15)",color:"#9333EA"}}}function StatusIndicator({event:t,isPending:e,statusColor:o}){if(e){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.pendingBadge,children:[(0,_jsxRuntime.jsx)(_sharedUi.Clock,{size:10,color:_sharedUi.night.color.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.pendingText,children:"..."})]})}if(t.error){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.errorBadge,children:[(0,_jsxRuntime.jsx)(_sharedUi.AlertCircle,{size:10,color:_sharedUi.night.color.danger}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.errorText,children:"ERR"})]})}return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.statusBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.statusText,{color:o}],children:String(t.status)})})}function SizeIndicators({requestSize:t,responseSize:e}){if(!t&&!e)return null;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sizeRow,children:[t?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sizeItem,children:[(0,_jsxRuntime.jsx)(_sharedUi.Upload,{size:8,color:_sharedUi.night.color.info}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sizeText,children:(0,_formatting.formatBytes)(t)})]}):null,e?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sizeItem,children:[(0,_jsxRuntime.jsx)(_sharedUi.Download,{size:8,color:_sharedUi.night.color.accent}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sizeText,children:(0,_formatting.formatBytes)(e)})]}):null]})}function BottomRightTime({timestamp:t,duration:e}){const o=(0,_useTickEveryMinute.useTickEveryMinute)();const i=(0,_sharedUi.formatRelativeTime)(t,o);return e?(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.bottomRightText,children:[(0,_formatting.formatDuration)(e)," ",i]}):(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.bottomRightText,children:i})}const NetworkEventItemCompact=exports.NetworkEventItemCompact=(0,_react.memo)(function t({event:e,onPress:o,pinned:i=false,saved:s=false,overridden:c=false,onLongPress:n}){const l=getStatusColor(e.status,e.error);const d=!e.status&&!e.error;const a=getContentTypeBadge(e.responseHeaders);let r=e.path||e.url.replace(/^https?:\/\/[^/]+/,"");if(e.requestClient==="graphql"){if(e.operationName){r=(0,_formatGraphQLVariables.formatGraphQLDisplay)(e.operationName,e.graphqlVariables)}else{r=r.replace(/\/graphql[^?]*/,"/graphql")}}else if(e.operationName){r=`${r}
|
|
2
|
+
(${e.operationName})`}return(0,_jsxRuntime.jsxs)(_sharedUi.DevToolsCard,{onPress:()=>o(e),onLongPress:n?()=>n(e):void 0,style:styles.cardWrapper,contentStyle:[styles.container,{borderLeftColor:l}],testID:`buoy-network-row-${e.id}`,accessibilityLabel:`${e.method} ${e.path||e.url}`,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.topRightContainer,children:[i?(0,_jsxRuntime.jsx)(_sharedUi.Pin,{size:10,active:true,color:_sharedUi.night.color.info}):null,s?(0,_jsxRuntime.jsx)(_sharedUi.Bookmark,{size:10,color:_sharedUi.night.color.accent}):null,c||e.override?(0,_jsxRuntime.jsx)(_sharedUi.FlaskConical,{size:10,color:_sharedUi.night.color.warning}):null,(0,_jsxRuntime.jsx)(StatusIndicator,{event:e,isPending:d,statusColor:l}),e.requestClient?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.topRightBadge,{backgroundColor:getClientChipColors(e.requestClient).backgroundColor}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.clientText,{color:getClientChipColors(e.requestClient).color}],children:e.requestClient==="graphql"?"GQL":e.requestClient==="grpc-web"?"gRPC":e.requestClient==="xhr"?"XHR":e.requestClient})}):null]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.leftSection,children:[(0,_jsxRuntime.jsx)(_sharedUi.MethodBadge,{method:e.method,size:"small"}),(0,_jsxRuntime.jsx)(SizeIndicators,{requestSize:e.requestSize,responseSize:e.responseSize})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.middleSection,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.urlText,numberOfLines:2,children:r}),e.condition?.uploadCap?.note&&(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:`buoy-network-upload-cap-${e.id}`,style:{color:_sharedUi.night.color.warning,fontSize:10},children:e.condition.uploadCap.note})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.rightSection,children:[a?(0,_jsxRuntime.jsx)(_sharedUi.TypeBadge,{type:a,size:"small"}):null,(0,_jsxRuntime.jsx)(_sharedUi.ChevronRight,{size:14,color:_sharedUi.night.color.textTertiary})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.bottomRightContainer,children:(0,_jsxRuntime.jsx)(BottomRightTime,{timestamp:e.timestamp,duration:e.duration})})]})});NetworkEventItemCompact.displayName="NetworkEventItemCompact";const styles=_reactNative.StyleSheet.create({cardWrapper:{marginHorizontal:8},container:{flexDirection:"row",alignItems:"center",backgroundColor:"rgba(12, 12, 12, 0.9)",borderLeftWidth:3,borderLeftColor:"transparent",borderBottomWidth:1},leftSection:{marginRight:8,alignItems:"flex-start"},topRightContainer:{position:"absolute",top:1,right:1,flexDirection:"row",alignItems:"center",gap:4},topRightBadge:{paddingHorizontal:4,paddingVertical:2,borderRadius:4},middleSection:{flex:1,justifyContent:"center",paddingRight:8},urlText:{fontSize:12,color:_sharedUi.night.color.text,lineHeight:16,fontFamily:_sharedUi.monoFont},rightSection:{flexDirection:"row",alignItems:"center",gap:6},bottomRightContainer:{position:"absolute",bottom:4,right:8},bottomRightText:{fontSize:9,color:_sharedUi.night.color.textTertiary,fontFamily:_sharedUi.monoFont},statusBadge:{paddingHorizontal:4,paddingVertical:1,borderRadius:3},statusText:{fontSize:10,fontWeight:"600"},pendingBadge:{flexDirection:"row",alignItems:"center",gap:2,paddingHorizontal:4,paddingVertical:1,backgroundColor:_sharedUi.night.color.warningSoft,borderRadius:3},pendingText:{fontSize:10,color:_sharedUi.night.color.warning,fontWeight:"600"},errorBadge:{flexDirection:"row",alignItems:"center",gap:2,paddingHorizontal:4,paddingVertical:1,backgroundColor:_sharedUi.night.color.dangerSoft,borderRadius:3},errorText:{fontSize:10,color:_sharedUi.night.color.danger,fontWeight:"600"},durationText:{fontSize:9,color:_sharedUi.night.color.textSecondary},sizeRow:{flexDirection:"row",gap:4,marginTop:4},sizeItem:{flexDirection:"row",alignItems:"center",gap:2},sizeText:{fontSize:8,color:_sharedUi.night.color.textSecondary,fontFamily:_sharedUi.monoFont},clientText:{fontSize:8,fontWeight:"700",letterSpacing:.3,textTransform:"uppercase"}});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NetworkEventItemCompact=void 0;var _react=require("react");var _formatGraphQLVariables=require("../utils/formatGraphQLVariables");var _jsxRuntime=require("react/jsx-runtime");const macOSColors={text:{muted:"#8E8E93"},semantic:{success:"#34C759",error:"#FF453A",warning:"#FFEB3B",info:"#00B8E6"}};const buoy={primary:"#20C997",success:"#20C997",warning:"#FFA94D",error:"#EF4444"};const night={cardScrim:"rgba(12, 12, 12, 0.9)",border:"#1A1A1C",separator:"rgba(255, 255, 255, 0.08)",text:"#ECEDEE",textSecondary:"#9BA1A6",textTertiary:"#636366",accent:"#20C997",danger:"#FF3B30",dangerSoft:"rgba(255, 59, 48, 0.10)",warning:"#FF8329",warningSoft:"rgba(255, 131, 41, 0.12)",info:"#1E6DFF"};function Svg({size:t=14,color:e="currentColor",children:r}){return(0,_jsxRuntime.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0,display:"block"},children:r})}const ChevronRight=t=>(0,_jsxRuntime.jsx)(Svg,{...t,children:(0,_jsxRuntime.jsx)("path",{d:"m9 18 6-6-6-6"})});const Upload=t=>(0,_jsxRuntime.jsxs)(Svg,{...t,children:[(0,_jsxRuntime.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,_jsxRuntime.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,_jsxRuntime.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]});const Download=t=>(0,_jsxRuntime.jsxs)(Svg,{...t,children:[(0,_jsxRuntime.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,_jsxRuntime.jsx)("polyline",{points:"7 10 12 15 17 10"}),(0,_jsxRuntime.jsx)("line",{x1:"12",x2:"12",y1:"15",y2:"3"})]});const Clock=t=>(0,_jsxRuntime.jsxs)(Svg,{...t,children:[(0,_jsxRuntime.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,_jsxRuntime.jsx)("polyline",{points:"12 6 12 12 16 14"})]});const AlertCircle=t=>(0,_jsxRuntime.jsxs)(Svg,{...t,children:[(0,_jsxRuntime.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,_jsxRuntime.jsx)("line",{x1:"12",x2:"12",y1:"8",y2:"12"}),(0,_jsxRuntime.jsx)("line",{x1:"12",x2:"12.01",y1:"16",y2:"16"})]});const Bookmark=t=>(0,_jsxRuntime.jsx)(Svg,{...t,children:(0,_jsxRuntime.jsx)("path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z"})});const FlaskConical=t=>(0,_jsxRuntime.jsxs)(Svg,{...t,children:[(0,_jsxRuntime.jsx)("path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2"}),(0,_jsxRuntime.jsx)("path",{d:"M8.5 2h7"}),(0,_jsxRuntime.jsx)("path",{d:"M7 16h10"})]});const Pin=({active:t,...e})=>(0,_jsxRuntime.jsx)(Svg,{...e,children:(0,_jsxRuntime.jsxs)("g",{transform:t?"rotate(-45 12 12) translate(12 12) scale(0.92) translate(-12 -12)":void 0,children:[(0,_jsxRuntime.jsx)("path",{d:"M2.97 21.03 8.18 15.82"}),(0,_jsxRuntime.jsx)("path",{d:"M4.4 10.81 13.19 19.6"}),(0,_jsxRuntime.jsx)("path",{d:"M5.17 10.54 11.43 8.83"}),(0,_jsxRuntime.jsx)("path",{d:"M13.46 18.83 15.17 12.57"}),(0,_jsxRuntime.jsx)("rect",{x:"12.15",y:"5.4",width:"9.38",height:"3.52",rx:"1.07",transform:"rotate(-45 16.84 7.16)"})]})});function formatBytes(t){if(t===void 0||t===null)return"N/A";if(t===0)return"0 B";const e=1024;const r=["B","KB","MB","GB","TB"];const n=Math.floor(Math.log(t)/Math.log(e));return`${(t/Math.pow(e,n)).toFixed(1)} ${r[n]}`}function formatDuration(t){if(t===void 0||t===null)return"N/A";if(t<1e3){return`${t}ms`}if(t<6e4){return`${(t/1e3).toFixed(1)}s`}if(t<36e5){const n=Math.floor(t/6e4);const o=Math.floor(t%6e4/1e3);return o>0?`${n}m ${o}s`:`${n}m`}const e=Math.floor(t/36e5);const r=Math.floor(t%36e5/6e4);return r>0?`${e}h ${r}m`:`${e}h`}function formatRelativeTime(t,e=Date.now()){const r=t instanceof Date?t.getTime():t;const n=Math.floor((e-r)/1e3);if(n<0){return"just now"}if(n<60){return n===0?"just now":`${n}s ago`}const o=Math.floor(n/60);if(o<60){return`${o}m ago`}const i=Math.floor(o/60);if(i<24){return`${i}h ago`}const s=Math.floor(i/24);return`${s}d ago`}const tickListeners=new Set;let tickInterval=null;function subscribeTick(t){tickListeners.add(t);if(tickInterval==null){tickInterval=setInterval(()=>{const e=Date.now();tickListeners.forEach(r=>r(e))},5e3)}return()=>{tickListeners.delete(t);if(tickListeners.size===0&&tickInterval!=null){clearInterval(tickInterval);tickInterval=null}}}function useSharedTick(){const[t,e]=(0,_react.useState)(()=>Date.now());(0,_react.useEffect)(()=>subscribeTick(e),[]);return t}function getStatusColor(t,e){if(e)return macOSColors.semantic.error;if(!t)return macOSColors.semantic.warning;if(t>=200&&t<300)return macOSColors.semantic.success;if(t>=300&&t<400)return macOSColors.semantic.info;if(t>=400)return macOSColors.semantic.error;return macOSColors.text.muted}function getContentTypeBadge(t){const e=t?.["content-type"]||t?.["Content-Type"]||"";if(e.includes("json"))return"JSON";if(e.includes("xml"))return"XML";if(e.includes("html"))return"HTML";if(e.includes("text"))return"TEXT";if(e.includes("image"))return"IMG";if(e.includes("video"))return"VIDEO";if(e.includes("audio"))return"AUDIO";if(e.includes("form"))return"FORM";return null}function getClientChipColors(t){switch(t){case"fetch":return{backgroundColor:"rgba(74, 144, 226, 0.15)",color:"#4A90E2"};case"graphql":return{backgroundColor:"rgba(229, 53, 171, 0.15)",color:"#E535AB"};case"grpc-web":return{backgroundColor:"rgba(16, 185, 129, 0.15)",color:"#10B981"};case"xhr":return{backgroundColor:"rgba(245, 158, 11, 0.15)",color:"#F59E0B"};default:return{backgroundColor:"rgba(147, 51, 234, 0.15)",color:"#9333EA"}}}const METHOD_COLORS={GET:buoy.success,POST:buoy.primary,PUT:buoy.warning,PATCH:night.textSecondary,DELETE:buoy.error,HEAD:night.textTertiary,OPTIONS:buoy.primary};function MethodBadgeWeb({method:t}){const e=METHOD_COLORS[t.toUpperCase()]||"#6B7280";return(0,_jsxRuntime.jsx)("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:45,boxSizing:"border-box",padding:"2px 6px",fontSize:11,fontWeight:700,color:e,backgroundColor:`${e}15`,border:`1px solid ${e}40`,borderRadius:4},children:t.toUpperCase()})}function TypeBadgeWeb({type:t}){const e=night.textTertiary;return(0,_jsxRuntime.jsx)("span",{style:{display:"inline-flex",alignItems:"center",padding:"2px 6px",fontSize:11,fontWeight:600,color:e,backgroundColor:`${e}15`,border:`1px solid ${e}40`,borderRadius:4},children:t})}function DevToolsCardWeb({onPress:t,onLongPress:e,children:r,contentStyle:n}){const[o,i]=(0,_react.useState)(false);const s=(0,_react.useRef)(null);const l=(0,_react.useRef)(false);const a=()=>{if(s.current!=null){clearTimeout(s.current);s.current=null}};return(0,_jsxRuntime.jsx)("div",{style:{margin:"4px 8px"},children:(0,_jsxRuntime.jsx)("button",{type:"button",onPointerDown:()=>{i(true);if(e){l.current=false;a();s.current=setTimeout(()=>{l.current=true;e()},500)}},onPointerUp:()=>{i(false);a()},onPointerLeave:()=>{i(false);a()},onPointerCancel:()=>{i(false);a()},onClick:()=>{if(l.current){l.current=false;return}t()},style:{position:"relative",display:"flex",width:"100%",boxSizing:"border-box",backgroundColor:night.cardScrim,borderRadius:8,border:`1px solid ${night.border}`,borderBottom:`1px solid ${night.separator}`,padding:12,minHeight:44,margin:0,textAlign:"left",cursor:"pointer",fontFamily:"inherit",color:"inherit",userSelect:"none",WebkitUserSelect:"none",opacity:o?.8:1,...n},children:r})})}function StatusIndicator({event:t,isPending:e,statusColor:r}){if(e){return(0,_jsxRuntime.jsxs)("span",{style:styles.pendingBadge,children:[(0,_jsxRuntime.jsx)(Clock,{size:10,color:night.warning}),(0,_jsxRuntime.jsx)("span",{style:styles.pendingText,children:"..."})]})}if(t.error){return(0,_jsxRuntime.jsxs)("span",{style:styles.errorBadge,children:[(0,_jsxRuntime.jsx)(AlertCircle,{size:10,color:night.danger}),(0,_jsxRuntime.jsx)("span",{style:styles.errorText,children:"ERR"})]})}return(0,_jsxRuntime.jsx)("span",{style:styles.statusBadge,children:(0,_jsxRuntime.jsx)("span",{style:{...styles.statusText,color:r},children:String(t.status)})})}function SizeIndicators({requestSize:t,responseSize:e}){if(!t&&!e)return null;return(0,_jsxRuntime.jsxs)("span",{style:styles.sizeRow,children:[t?(0,_jsxRuntime.jsxs)("span",{style:styles.sizeItem,children:[(0,_jsxRuntime.jsx)(Upload,{size:8,color:night.info}),(0,_jsxRuntime.jsx)("span",{style:styles.sizeText,children:formatBytes(t)})]}):null,e?(0,_jsxRuntime.jsxs)("span",{style:styles.sizeItem,children:[(0,_jsxRuntime.jsx)(Download,{size:8,color:night.accent}),(0,_jsxRuntime.jsx)("span",{style:styles.sizeText,children:formatBytes(e)})]}):null]})}function BottomRightTime({timestamp:t,duration:e}){const r=useSharedTick();const n=formatRelativeTime(t,r);return e?(0,_jsxRuntime.jsxs)("span",{style:styles.bottomRightText,children:[formatDuration(e)," ",n]}):(0,_jsxRuntime.jsx)("span",{style:styles.bottomRightText,children:n})}const NetworkEventItemCompact=exports.NetworkEventItemCompact=(0,_react.memo)(function t({event:e,onPress:r,pinned:n=false,saved:o=false,overridden:i=false,onLongPress:s}){const l=getStatusColor(e.status,e.error);const a=!e.status&&!e.error;const d=getContentTypeBadge(e.responseHeaders);let c=e.path||e.url.replace(/^https?:\/\/[^/]+/,"");if(e.requestClient==="graphql"){if(e.operationName){c=(0,_formatGraphQLVariables.formatGraphQLDisplay)(e.operationName,e.graphqlVariables)}else{c=c.replace(/\/graphql[^?]*/,"/graphql")}}else if(e.operationName){c=`${c}
|
|
2
|
-
(${e.operationName})`}return(0,_jsxRuntime.jsxs)(DevToolsCardWeb,{onPress:()=>r(e),onLongPress:s?()=>s(e):void 0,contentStyle:{flexDirection:"row",alignItems:"center",borderLeft:`3px solid ${l}`},children:[(0,_jsxRuntime.jsxs)("span",{style:styles.topRightContainer,children:[n?(0,_jsxRuntime.jsx)(Pin,{size:10,active:true,color:night.info}):null,o?(0,_jsxRuntime.jsx)(Bookmark,{size:10,color:night.accent}):null,i||e.override?(0,_jsxRuntime.jsx)(FlaskConical,{size:10,color:night.warning}):null,(0,_jsxRuntime.jsx)(StatusIndicator,{event:e,isPending:a,statusColor:l}),e.requestClient?(0,_jsxRuntime.jsx)("span",{style:{...styles.topRightBadge,backgroundColor:getClientChipColors(e.requestClient).backgroundColor},children:(0,_jsxRuntime.jsx)("span",{style:{...styles.clientText,color:getClientChipColors(e.requestClient).color},children:e.requestClient==="graphql"?"GQL":e.requestClient==="grpc-web"?"gRPC":e.requestClient==="xhr"?"XHR":e.requestClient})}):null]}),(0,_jsxRuntime.jsxs)("span",{style:styles.leftSection,children:[(0,_jsxRuntime.jsx)(MethodBadgeWeb,{method:e.method}),(0,_jsxRuntime.jsx)(SizeIndicators,{requestSize:e.requestSize,responseSize:e.responseSize})]}),(0,_jsxRuntime.
|
|
2
|
+
(${e.operationName})`}return(0,_jsxRuntime.jsxs)(DevToolsCardWeb,{onPress:()=>r(e),onLongPress:s?()=>s(e):void 0,contentStyle:{flexDirection:"row",alignItems:"center",borderLeft:`3px solid ${l}`},children:[(0,_jsxRuntime.jsxs)("span",{style:styles.topRightContainer,children:[n?(0,_jsxRuntime.jsx)(Pin,{size:10,active:true,color:night.info}):null,o?(0,_jsxRuntime.jsx)(Bookmark,{size:10,color:night.accent}):null,i||e.override?(0,_jsxRuntime.jsx)(FlaskConical,{size:10,color:night.warning}):null,(0,_jsxRuntime.jsx)(StatusIndicator,{event:e,isPending:a,statusColor:l}),e.requestClient?(0,_jsxRuntime.jsx)("span",{style:{...styles.topRightBadge,backgroundColor:getClientChipColors(e.requestClient).backgroundColor},children:(0,_jsxRuntime.jsx)("span",{style:{...styles.clientText,color:getClientChipColors(e.requestClient).color},children:e.requestClient==="graphql"?"GQL":e.requestClient==="grpc-web"?"gRPC":e.requestClient==="xhr"?"XHR":e.requestClient})}):null]}),(0,_jsxRuntime.jsxs)("span",{style:styles.leftSection,children:[(0,_jsxRuntime.jsx)(MethodBadgeWeb,{method:e.method}),(0,_jsxRuntime.jsx)(SizeIndicators,{requestSize:e.requestSize,responseSize:e.responseSize})]}),(0,_jsxRuntime.jsxs)("span",{style:styles.middleSection,children:[(0,_jsxRuntime.jsx)("span",{style:styles.urlText,children:c}),e.condition?.uploadCap?.note&&(0,_jsxRuntime.jsx)("span",{style:{color:night.warning,fontSize:10},children:e.condition.uploadCap.note})]}),(0,_jsxRuntime.jsxs)("span",{style:styles.rightSection,children:[d?(0,_jsxRuntime.jsx)(TypeBadgeWeb,{type:d}):null,(0,_jsxRuntime.jsx)(ChevronRight,{size:14,color:night.textTertiary})]}),(0,_jsxRuntime.jsx)("span",{style:styles.bottomRightContainer,children:(0,_jsxRuntime.jsx)(BottomRightTime,{timestamp:e.timestamp,duration:e.duration})})]})});NetworkEventItemCompact.displayName="NetworkEventItemCompact";const styles={leftSection:{display:"flex",flexDirection:"column",marginRight:8,alignItems:"flex-start"},topRightContainer:{position:"absolute",top:1,right:1,display:"flex",flexDirection:"row",alignItems:"center",gap:4},topRightBadge:{display:"inline-flex",padding:"2px 4px",borderRadius:4},middleSection:{flex:1,minWidth:0,display:"flex",flexDirection:"column",justifyContent:"center",paddingRight:8},urlText:{fontSize:12,color:night.text,lineHeight:"16px",fontFamily:"ui-monospace, Menlo, monospace",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",whiteSpace:"pre-wrap",wordBreak:"break-all"},rightSection:{display:"flex",flexDirection:"row",alignItems:"center",gap:6},bottomRightContainer:{position:"absolute",bottom:4,right:8},bottomRightText:{fontSize:9,color:night.textTertiary,fontFamily:"ui-monospace, Menlo, monospace",whiteSpace:"pre"},statusBadge:{display:"inline-flex",padding:"1px 4px",borderRadius:3},statusText:{fontSize:10,fontWeight:600},pendingBadge:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:2,padding:"1px 4px",backgroundColor:night.warningSoft,borderRadius:3},pendingText:{fontSize:10,color:night.warning,fontWeight:600},errorBadge:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:2,padding:"1px 4px",backgroundColor:night.dangerSoft,borderRadius:3},errorText:{fontSize:10,color:night.danger,fontWeight:600},sizeRow:{display:"flex",flexDirection:"row",gap:4,marginTop:4},sizeItem:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:2},sizeText:{fontSize:8,color:night.textSecondary,fontFamily:"ui-monospace, Menlo, monospace"},clientText:{fontSize:8,fontWeight:700,letterSpacing:.3,textTransform:"uppercase"}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NetworkListScreen=NetworkListScreen;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _NetworkEventItemCompact=require("./NetworkEventItemCompact");var _NetworkUpgradeBanner=require("./NetworkUpgradeBanner");var _useNetworkEventList=require("../hooks/useNetworkEventList");var _useNetworkSaved=require("../hooks/useNetworkSaved");var _useOverrideRules=require("../hooks/useOverrideRules");var _overriddenRows=require("../overrides/overriddenRows");var _withPinnedFirst=require("../utils/withPinnedFirst");var _jsxRuntime=require("react/jsx-runtime");const keyExtractor=r=>r.id;function PinnedSection({events:r,onEventPress:i,onLongPress:s,savedLiveIds:a,onClearPinned:t}){if(r.length===0)return null;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.pinnedSection,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.pinnedHeader,children:[(0,_jsxRuntime.jsx)(_sharedUi.Pin,{size:11,active:true,color:_sharedUi.macOSColors.semantic.info}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.pinnedTitle,children:["PINNED \xB7 ",r.length]}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:t,"sentry-label":"ignore unpin all",style:styles.pinnedClear,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.pinnedClearText,children:"Unpin all"})})]}),r.map(n=>(0,_jsxRuntime.jsx)(_NetworkEventItemCompact.NetworkEventItemCompact,{event:n,onPress:i,onLongPress:s,pinned:true,saved:a.has(n.id)},n.id))]})}function OverriddenSection({events:r,onEventPress:i,onLongPress:s,savedLiveIds:a,paused:t,onTogglePaused:n}){if(r.length===0)return null;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.overriddenSection,t&&styles.overriddenSectionOff],children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.overriddenHeader,children:[(0,_jsxRuntime.jsx)(_sharedUi.FlaskConical,{size:11,color:t?_sharedUi.macOSColors.text.muted:_sharedUi.macOSColors.semantic.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-network-overridden-strip",style:[styles.overriddenTitle,t&&styles.overriddenTitleOff],children:t?`PAUSED \xB7 ${r.length}`:`OVERRIDDEN \xB7 ${r.length}`}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:n,"sentry-label":"ignore pause overrides",style:styles.overriddenManage,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.overriddenManageText,t&&styles.overriddenTitleOff],children:t?"Resume":"Pause"})})]}),r.map(o=>(0,_jsxRuntime.jsx)(_NetworkEventItemCompact.NetworkEventItemCompact,{event:o,onPress:i,onLongPress:s,overridden:true,saved:a.has(o.id)},o.id))]})}function NetworkListScreen({visible:r,paused:i,filter:s,ignoredPatterns:a,isPro:t,searchText:n,onEventPress:o,onUpgradePress:k}){const{visibleEvents:b,hasLockedEvents:v,lockedEventCount:l,totalEvents:C}=(0,_useNetworkEventList.useNetworkEventList)({filter:s,ignoredPatterns:a,paused:i,visible:r,isPro:t});const{pinnedEvents:y,pinnedLiveIds:E,savedLiveIds:d,togglePin:p,clearPinned:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NetworkListScreen=NetworkListScreen;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _NetworkEventItemCompact=require("./NetworkEventItemCompact");var _NetworkUpgradeBanner=require("./NetworkUpgradeBanner");var _useNetworkEventList=require("../hooks/useNetworkEventList");var _useNetworkSaved=require("../hooks/useNetworkSaved");var _useOverrideRules=require("../hooks/useOverrideRules");var _overriddenRows=require("../overrides/overriddenRows");var _withPinnedFirst=require("../utils/withPinnedFirst");var _jsxRuntime=require("react/jsx-runtime");const keyExtractor=r=>r.id;function PinnedSection({events:r,onEventPress:i,onLongPress:s,savedLiveIds:a,onClearPinned:t}){if(r.length===0)return null;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.pinnedSection,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.pinnedHeader,children:[(0,_jsxRuntime.jsx)(_sharedUi.Pin,{size:11,active:true,color:_sharedUi.macOSColors.semantic.info}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.pinnedTitle,children:["PINNED \xB7 ",r.length]}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:t,"sentry-label":"ignore unpin all",style:styles.pinnedClear,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.pinnedClearText,children:"Unpin all"})})]}),r.map(n=>(0,_jsxRuntime.jsx)(_NetworkEventItemCompact.NetworkEventItemCompact,{event:n,onPress:i,onLongPress:s,pinned:true,saved:a.has(n.id)},n.id))]})}function OverriddenSection({events:r,onEventPress:i,onLongPress:s,savedLiveIds:a,paused:t,onTogglePaused:n}){if(r.length===0)return null;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.overriddenSection,t&&styles.overriddenSectionOff],children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.overriddenHeader,children:[(0,_jsxRuntime.jsx)(_sharedUi.FlaskConical,{size:11,color:t?_sharedUi.macOSColors.text.muted:_sharedUi.macOSColors.semantic.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-network-overridden-strip",style:[styles.overriddenTitle,t&&styles.overriddenTitleOff],children:t?`PAUSED \xB7 ${r.length}`:`OVERRIDDEN \xB7 ${r.length}`}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:n,"sentry-label":"ignore pause overrides",style:styles.overriddenManage,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.overriddenManageText,t&&styles.overriddenTitleOff],children:t?"Resume":"Pause"})})]}),r.map(o=>(0,_jsxRuntime.jsx)(_NetworkEventItemCompact.NetworkEventItemCompact,{event:o,onPress:i,onLongPress:s,overridden:true,saved:a.has(o.id)},o.id))]})}function NetworkListScreen({visible:r,paused:i,filter:s,ignoredPatterns:a,isPro:t,searchText:n,onEventPress:o,onUpgradePress:k}){const{visibleEvents:b,hasLockedEvents:v,lockedEventCount:l,totalEvents:C}=(0,_useNetworkEventList.useNetworkEventList)({filter:s,ignoredPatterns:a,paused:i,visible:r,isPro:t});const{pinnedEvents:y,pinnedLiveIds:E,savedLiveIds:d,togglePin:p,clearPinned:T}=(0,_useNetworkSaved.useNetworkSaved)();const{rules:O,enabled:h,setEnabled:P,isRuleSpent:j}=(0,_useOverrideRules.useOverrideRules)();const c=(0,_react.useCallback)(e=>{p(e)},[p]);if(!r)return null;const{pinned:x,rest:u}=(0,_withPinnedFirst.splitPinned)(b,y,E);const N=O.filter(e=>e.enabled&&!j(e));const g=(0,_overriddenRows.overriddenEvents)([...x,...u],N);const m=new Set(g.map(e=>e.id));const w=x.filter(e=>!m.has(e.id));const S=m.size?u.filter(e=>!m.has(e.id)):u;const f=!i;const I=({item:e})=>(0,_jsxRuntime.jsx)(_NetworkEventItemCompact.NetworkEventItemCompact,{event:e,onPress:o,onLongPress:c,saved:d.has(e.id)});const L=()=>{if(w.length>0||g.length>0)return null;return(0,_jsxRuntime.jsx)(_sharedUi.ToolEmptyState,{testID:"buoy-network-empty",...(0,_sharedUi.resolveListEmptyState)({subject:"requests",search:n,total:C,capturing:f,waiting:{otto:"fishing",title:"No network events",message:"Network requests will appear here"},paused:{title:"No network events",message:"Enable interception to start capturing"}})})};const q=()=>{if(!v)return null;const e=n.length>0;const B=e?`${l} matching ${l===1?"request":"requests"} in locked history`:`${l} requests locked`;const R=e?"Upgrade to Pro to search your full request history":"Upgrade to Pro to unlock full request history";return(0,_jsxRuntime.jsx)(_NetworkUpgradeBanner.NetworkUpgradeBanner,{title:B,subtitle:R,onPress:k})};return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.root,children:[!f?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.disabledBanner,children:[(0,_jsxRuntime.jsx)(_sharedUi.Power,{size:14,color:_sharedUi.macOSColors.semantic.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.disabledText,children:"Network interception is disabled"})]}):null,(0,_jsxRuntime.jsx)(OverriddenSection,{events:g,onEventPress:o,onLongPress:c,savedLiveIds:d,paused:!h,onTogglePaused:()=>P(!h)}),(0,_jsxRuntime.jsx)(PinnedSection,{events:w,onEventPress:o,onLongPress:c,savedLiveIds:d,onClearPinned:T}),S.length>0||v?(0,_jsxRuntime.jsx)(_reactNative.FlatList,{keyboardShouldPersistTaps:"handled",testID:"buoy-network-list",data:S,renderItem:I,keyExtractor,contentContainerStyle:styles.listContent,showsVerticalScrollIndicator:true,onEndReachedThreshold:.8,scrollEnabled:true,..._sharedUi.EVENT_LIST_PRESET,extraData:d,"sentry-label":"ignore network events list",ListFooterComponent:q}):L()]})}const styles=_reactNative.StyleSheet.create({root:{flex:1,minHeight:0},overriddenSection:{borderBottomWidth:1,borderBottomColor:_sharedUi.macOSColors.semantic.warning+"44",backgroundColor:_sharedUi.macOSColors.semantic.warningBackground},overriddenSectionOff:{borderBottomColor:_sharedUi.macOSColors.border.default,backgroundColor:_sharedUi.macOSColors.background.card},overriddenTitleOff:{color:_sharedUi.macOSColors.text.muted},overriddenHeader:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:12,paddingTop:8,paddingBottom:4},overriddenTitle:{flex:1,fontSize:10,fontWeight:"700",letterSpacing:.8,color:_sharedUi.macOSColors.semantic.warning},overriddenManage:{paddingHorizontal:6,paddingVertical:2},overriddenManageText:{fontSize:10,fontWeight:"600",color:_sharedUi.macOSColors.semantic.warning},pinnedSection:{borderBottomWidth:1,borderBottomColor:_sharedUi.macOSColors.border.default,paddingBottom:4},pinnedHeader:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:20,paddingTop:10,paddingBottom:6},pinnedTitle:{flex:1,color:_sharedUi.macOSColors.semantic.info,fontSize:10,fontWeight:"700",letterSpacing:.6,fontFamily:_sharedUi.monoFont},pinnedClear:{paddingHorizontal:6,paddingVertical:2},pinnedClearText:{color:_sharedUi.macOSColors.text.muted,fontSize:10},disabledBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:_sharedUi.macOSColors.semantic.warningBackground,borderRadius:8,borderWidth:1,borderColor:_sharedUi.macOSColors.semantic.warning+"20"},disabledText:{color:_sharedUi.macOSColors.semantic.warning,fontSize:11,flex:1},listContent:{paddingTop:8}});
|