@buoy-gg/network 7.0.3 → 7.0.5
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 +3 -2
- package/lib/commonjs/index.js +85 -0
- package/lib/commonjs/network/components/NetworkEventDetailView.js +201 -40
- package/lib/commonjs/network/components/NetworkEventItemCompact.js +52 -5
- package/lib/commonjs/network/components/NetworkHeaderLive.js +132 -0
- package/lib/commonjs/network/components/NetworkListScreen.js +134 -56
- package/lib/commonjs/network/components/NetworkModal.js +154 -36
- package/lib/commonjs/network/components/NetworkSavedScreen.js +245 -0
- package/lib/commonjs/network/components/NetworkUpgradeBanner.js +76 -0
- package/lib/commonjs/network/hooks/useLiveNetworkEvent.js +62 -0
- package/lib/commonjs/network/hooks/useNetworkSaved.js +38 -0
- package/lib/commonjs/network/index.js +84 -0
- package/lib/commonjs/network/sync/networkSyncAdapter.js +85 -7
- package/lib/commonjs/network/utils/generateCurl.js +71 -0
- package/lib/commonjs/network/utils/networkEventStore.js +10 -1
- package/lib/commonjs/network/utils/networkListener.js +54 -1
- package/lib/commonjs/network/utils/networkSavedStore.js +575 -0
- package/lib/commonjs/network/utils/withPinnedFirst.js +32 -0
- package/lib/module/index.js +17 -1
- package/lib/module/network/components/NetworkEventDetailView.js +204 -41
- package/lib/module/network/components/NetworkEventItemCompact.js +53 -6
- package/lib/module/network/components/NetworkHeaderLive.js +132 -2
- package/lib/module/network/components/NetworkListScreen.js +136 -58
- package/lib/module/network/components/NetworkModal.js +156 -39
- package/lib/module/network/components/NetworkSavedScreen.js +241 -0
- package/lib/module/network/components/NetworkUpgradeBanner.js +72 -0
- package/lib/module/network/hooks/useLiveNetworkEvent.js +58 -0
- package/lib/module/network/hooks/useNetworkSaved.js +34 -0
- package/lib/module/network/index.js +7 -1
- package/lib/module/network/sync/networkSyncAdapter.js +85 -7
- package/lib/module/network/utils/generateCurl.js +67 -0
- package/lib/module/network/utils/networkEventStore.js +10 -1
- package/lib/module/network/utils/networkListener.js +54 -1
- package/lib/module/network/utils/networkSavedStore.js +569 -0
- package/lib/module/network/utils/withPinnedFirst.js +28 -0
- package/lib/typescript/index.d.ts +13 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/network/components/NetworkEventDetailView.d.ts.map +1 -1
- package/lib/typescript/network/components/NetworkEventItemCompact.d.ts +12 -0
- package/lib/typescript/network/components/NetworkEventItemCompact.d.ts.map +1 -1
- package/lib/typescript/network/components/NetworkHeaderLive.d.ts +28 -0
- package/lib/typescript/network/components/NetworkHeaderLive.d.ts.map +1 -1
- package/lib/typescript/network/components/NetworkListScreen.d.ts.map +1 -1
- package/lib/typescript/network/components/NetworkModal.d.ts +34 -0
- package/lib/typescript/network/components/NetworkModal.d.ts.map +1 -1
- package/lib/typescript/network/components/NetworkSavedScreen.d.ts +29 -0
- package/lib/typescript/network/components/NetworkSavedScreen.d.ts.map +1 -0
- package/lib/typescript/network/components/NetworkUpgradeBanner.d.ts +17 -0
- package/lib/typescript/network/components/NetworkUpgradeBanner.d.ts.map +1 -0
- package/lib/typescript/network/hooks/useLiveNetworkEvent.d.ts +19 -0
- package/lib/typescript/network/hooks/useLiveNetworkEvent.d.ts.map +1 -0
- package/lib/typescript/network/hooks/useNetworkSaved.d.ts +21 -0
- package/lib/typescript/network/hooks/useNetworkSaved.d.ts.map +1 -0
- package/lib/typescript/network/index.d.ts +8 -1
- package/lib/typescript/network/index.d.ts.map +1 -1
- package/lib/typescript/network/sync/networkSyncAdapter.d.ts +52 -3
- package/lib/typescript/network/sync/networkSyncAdapter.d.ts.map +1 -1
- package/lib/typescript/network/types/index.d.ts +43 -0
- package/lib/typescript/network/types/index.d.ts.map +1 -1
- package/lib/typescript/network/utils/generateCurl.d.ts +3 -0
- package/lib/typescript/network/utils/generateCurl.d.ts.map +1 -0
- package/lib/typescript/network/utils/networkEventStore.d.ts.map +1 -1
- package/lib/typescript/network/utils/networkListener.d.ts +4 -0
- package/lib/typescript/network/utils/networkListener.d.ts.map +1 -1
- package/lib/typescript/network/utils/networkSavedStore.d.ts +186 -0
- package/lib/typescript/network/utils/networkSavedStore.d.ts.map +1 -0
- package/lib/typescript/network/utils/withPinnedFirst.d.ts +24 -0
- package/lib/typescript/network/utils/withPinnedFirst.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pinned + saved network requests.
|
|
3
|
+
*
|
|
4
|
+
* The live `networkEventStore` is volatile by design: it caps at 500 events
|
|
5
|
+
* and `clearEvents()` wipes it. So "pin this failure so I don't lose it"
|
|
6
|
+
* cannot be an ID pointing into that store — it has to be a SNAPSHOT that
|
|
7
|
+
* outlives the stream. This store owns those snapshots and persists them.
|
|
8
|
+
*
|
|
9
|
+
* Two independent flags per record:
|
|
10
|
+
* - `pinned` — hoisted into the PINNED section at the top of the list,
|
|
11
|
+
* unaffected by search/filters.
|
|
12
|
+
* - `saved` — kept in the Saved (favorites) screen, out of the live stream.
|
|
13
|
+
* A record exists while either flag is true and is dropped when both go false,
|
|
14
|
+
* so all four states fall out without special cases.
|
|
15
|
+
*
|
|
16
|
+
* IDENTITY WARNING: `networkListener` mints request IDs from a per-runtime
|
|
17
|
+
* counter (`fetch_1`, `xhr_2`), so after an app reload `fetch_1` is a
|
|
18
|
+
* DIFFERENT request. Records are therefore keyed on a generated `key`, carry
|
|
19
|
+
* the `sessionId` that captured them, and only trust `liveId` while that
|
|
20
|
+
* session is the current one. Snapshots restored from an earlier session get
|
|
21
|
+
* their event `id` rewritten to `saved:<key>` so a restored pin can never
|
|
22
|
+
* resolve to (or dedupe against) an unrelated live request.
|
|
23
|
+
*
|
|
24
|
+
* Shape/persistence follows `ignoredPatternsStore` in @buoy-gg/shared-ui:
|
|
25
|
+
* lazy hydrate on first subscribe, a `dirty` flag so a slow read can't clobber
|
|
26
|
+
* a mutation, and commit = set + emit + persist.
|
|
27
|
+
*/
|
|
28
|
+
import type { NetworkEvent } from "../types";
|
|
29
|
+
/** Identifies THIS runtime. Records from other sessions can't trust `liveId`. */
|
|
30
|
+
export declare const SESSION_ID: string;
|
|
31
|
+
/** Pins render un-virtualized in the list header, so the count stays bounded. */
|
|
32
|
+
export declare const MAX_PINNED = 25;
|
|
33
|
+
/** Upper bound on the persisted favorites list (oldest unpinned evicted). */
|
|
34
|
+
export declare const MAX_SAVED = 50;
|
|
35
|
+
/** Free tier keeps a handful of favorites; Pro is unlimited (up to MAX_SAVED). */
|
|
36
|
+
export declare const FREE_TIER_SAVED_LIMIT = 5;
|
|
37
|
+
export interface SavedNetworkRecord {
|
|
38
|
+
/** Stable across app launches — unlike `event.id`. */
|
|
39
|
+
key: string;
|
|
40
|
+
/** Frozen snapshot; bodies may be truncated (see `bodyTruncated`). */
|
|
41
|
+
event: NetworkEvent;
|
|
42
|
+
pinned: boolean;
|
|
43
|
+
saved: boolean;
|
|
44
|
+
savedAt: number;
|
|
45
|
+
/** Runtime that captured the request. */
|
|
46
|
+
sessionId: string;
|
|
47
|
+
/** `event.id` within `sessionId` — meaningless in any other session. */
|
|
48
|
+
liveId: string;
|
|
49
|
+
/** A request/response body was too large to keep in full. */
|
|
50
|
+
bodyTruncated?: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface NetworkSavedState {
|
|
53
|
+
/** Every record, newest first. */
|
|
54
|
+
records: SavedNetworkRecord[];
|
|
55
|
+
/** Pinned records' snapshots, newest first — what the PINNED section renders. */
|
|
56
|
+
pinnedEvents: NetworkEvent[];
|
|
57
|
+
/** Saved records, newest first — what the Saved screen renders. */
|
|
58
|
+
savedRecords: SavedNetworkRecord[];
|
|
59
|
+
/** Live IDs pinned IN THIS SESSION (for row glyphs + list dedupe). */
|
|
60
|
+
pinnedLiveIds: Set<string>;
|
|
61
|
+
/** Live IDs saved IN THIS SESSION (for row glyphs). */
|
|
62
|
+
savedLiveIds: Set<string>;
|
|
63
|
+
}
|
|
64
|
+
/** Why a toggle didn't take effect, so the UI can explain itself. */
|
|
65
|
+
export type SavedToggleResult = {
|
|
66
|
+
ok: true;
|
|
67
|
+
active: boolean;
|
|
68
|
+
} | {
|
|
69
|
+
ok: false;
|
|
70
|
+
reason: "pin-cap" | "saved-cap" | "invalid-event";
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Handlers the desktop dashboard installs to forward mutations to the device.
|
|
74
|
+
*
|
|
75
|
+
* The dashboard must not keep its own copy of the device's pins: the device is
|
|
76
|
+
* the only place the snapshots can stay in sync with the traffic that produced
|
|
77
|
+
* them (and the only place a >16KB body still exists). So in remote mode this
|
|
78
|
+
* store becomes a MIRROR — same seam `networkEventStore.disableCapture()` +
|
|
79
|
+
* `replaceEvents()` uses for the event list.
|
|
80
|
+
*/
|
|
81
|
+
export interface NetworkSavedRemote {
|
|
82
|
+
setPinned: (eventId: string, pinned: boolean) => void;
|
|
83
|
+
setSaved: (eventId: string, saved: boolean) => void;
|
|
84
|
+
removeRecord: (key: string) => void;
|
|
85
|
+
clearSaved: () => void;
|
|
86
|
+
clearPinned: () => void;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Read an event's flags out of a state snapshot.
|
|
90
|
+
*
|
|
91
|
+
* Two lookups because an event ID means two different things: a live request
|
|
92
|
+
* matches by `liveId` (the fast Set path), while a snapshot restored from an
|
|
93
|
+
* earlier session carries the namespaced `saved:<key>` id and has to be found
|
|
94
|
+
* among the records.
|
|
95
|
+
*/
|
|
96
|
+
export declare function flagsForEventId(state: NetworkSavedState, eventId: string | null): {
|
|
97
|
+
pinned: boolean;
|
|
98
|
+
saved: boolean;
|
|
99
|
+
};
|
|
100
|
+
type Listener = () => void;
|
|
101
|
+
declare class NetworkSavedStore {
|
|
102
|
+
private records;
|
|
103
|
+
private readonly listeners;
|
|
104
|
+
private loaded;
|
|
105
|
+
private loadPromise;
|
|
106
|
+
/** Set once a mutation happens so a slow initial load can't clobber it. */
|
|
107
|
+
private dirty;
|
|
108
|
+
private keyCounter;
|
|
109
|
+
/**
|
|
110
|
+
* Live IDs tracked in THIS session. `syncFromLive` runs on every captured
|
|
111
|
+
* response, so the hot path has to be a Set membership test.
|
|
112
|
+
*/
|
|
113
|
+
private trackedLiveIds;
|
|
114
|
+
/** Derived view, rebuilt on commit so consumers get stable references. */
|
|
115
|
+
private state;
|
|
116
|
+
/** Set on the desktop dashboard — see NetworkSavedRemote. */
|
|
117
|
+
private remote;
|
|
118
|
+
private remoteEchoUntil;
|
|
119
|
+
getState(): NetworkSavedState;
|
|
120
|
+
/**
|
|
121
|
+
* Turn this store into a mirror of a connected device's records. Mutations
|
|
122
|
+
* are applied locally for immediate feedback AND forwarded to the device,
|
|
123
|
+
* which is the source of truth; nothing is persisted to this machine.
|
|
124
|
+
*/
|
|
125
|
+
enableRemoteMode(remote: NetworkSavedRemote): void;
|
|
126
|
+
disableRemoteMode(): void;
|
|
127
|
+
/**
|
|
128
|
+
* Feed the device's records in (mirror mode only). `force` bypasses the
|
|
129
|
+
* echo guard — used when tearing the mirror down, where there is no later
|
|
130
|
+
* snapshot to converge on.
|
|
131
|
+
*/
|
|
132
|
+
replaceRecords(records: SavedNetworkRecord[], force?: boolean): void;
|
|
133
|
+
/**
|
|
134
|
+
* Whether a record's `liveId` can be trusted against the current event
|
|
135
|
+
* stream. Locally that means "captured in this runtime"; mirrored, the ids
|
|
136
|
+
* belong to the device whose events we are also mirroring, so they line up
|
|
137
|
+
* by construction.
|
|
138
|
+
*/
|
|
139
|
+
private sessionMatches;
|
|
140
|
+
getRecords(): SavedNetworkRecord[];
|
|
141
|
+
subscribe(listener: Listener): () => void;
|
|
142
|
+
/**
|
|
143
|
+
* Resolve an event the live store no longer has — a pin whose request was
|
|
144
|
+
* cleared or aged out, or a snapshot restored from an earlier session.
|
|
145
|
+
*/
|
|
146
|
+
getEventById(id: string): NetworkEvent | null;
|
|
147
|
+
isPinned(liveId: string): boolean;
|
|
148
|
+
isSaved(liveId: string): boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Keep a tracked snapshot current while its request is still in flight —
|
|
151
|
+
* pinning a pending request would otherwise freeze it as "Pending" forever.
|
|
152
|
+
* Called from `networkEventStore` for every response/error, so the no-op
|
|
153
|
+
* path (nothing pinned) is a single empty-Set check.
|
|
154
|
+
*/
|
|
155
|
+
syncFromLive(event: NetworkEvent): void;
|
|
156
|
+
togglePin(event: NetworkEvent): SavedToggleResult;
|
|
157
|
+
toggleSave(event: NetworkEvent): SavedToggleResult;
|
|
158
|
+
/** Drop a record outright, whatever its flags. */
|
|
159
|
+
remove(key: string): void;
|
|
160
|
+
/** Empty the favorites list; pinned-only records stay pinned. */
|
|
161
|
+
clearSaved(): void;
|
|
162
|
+
/** Unpin everything; saved-only records stay saved. */
|
|
163
|
+
clearPinned(): void;
|
|
164
|
+
private setFlag;
|
|
165
|
+
/**
|
|
166
|
+
* Match an event to its record: by live ID within this session, or by the
|
|
167
|
+
* namespaced snapshot ID when the row being toggled IS a restored snapshot.
|
|
168
|
+
*/
|
|
169
|
+
private findRecordFor;
|
|
170
|
+
private hasRoomFor;
|
|
171
|
+
/** Trim the oldest UNPINNED saves once the list outgrows MAX_SAVED. */
|
|
172
|
+
private evictIfNeeded;
|
|
173
|
+
private ensureLoaded;
|
|
174
|
+
private persist;
|
|
175
|
+
private commit;
|
|
176
|
+
/** Rebuild the derived view once per mutation so renders get stable refs. */
|
|
177
|
+
private rebuild;
|
|
178
|
+
private emit;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Singleton — one instance per JS runtime, shared by the mobile modal, the
|
|
182
|
+
* desktop inline port and the sync adapter.
|
|
183
|
+
*/
|
|
184
|
+
export declare const networkSavedStore: NetworkSavedStore;
|
|
185
|
+
export {};
|
|
186
|
+
//# sourceMappingURL=networkSavedStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"networkSavedStore.d.ts","sourceRoot":"","sources":["../../../../src/network/utils/networkSavedStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;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AAE,QAAQ,GAAG,MAAM,IAAI;IAQzC;;;OAGG;IACH,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI;IAO7C,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAIjC,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAIhC;;;;;OAKG;IACH,YAAY,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAiBvC,SAAS,CAAC,KAAK,EAAE,YAAY,GAAG,iBAAiB;IAIjD,UAAU,CAAC,KAAK,EAAE,YAAY,GAAG,iBAAiB;IAIlD,kDAAkD;IAClD,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAMzB,iEAAiE;IACjE,UAAU,IAAI,IAAI;IAUlB,uDAAuD;IACvD,WAAW,IAAI,IAAI;IAUnB,OAAO,CAAC,OAAO;IAuDf;;;OAGG;IACH,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,UAAU;IAQlB,uEAAuE;IACvE,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,YAAY;IA2BpB,OAAO,CAAC,OAAO;IAWf,OAAO,CAAC,MAAM;IAUd,6EAA6E;IAC7E,OAAO,CAAC,OAAO;IA0Bf,OAAO,CAAC,IAAI;CAGb;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,mBAA0B,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Split a filtered event list into its PINNED section and the rest.
|
|
3
|
+
*
|
|
4
|
+
* Lives as a pure function because there are TWO list implementations — the
|
|
5
|
+
* mobile modal's `NetworkListScreen` and the desktop dashboard's hand-mirrored
|
|
6
|
+
* `NetworkInline` — and pin ordering silently diverging between them is
|
|
7
|
+
* exactly the drift `buoy.tools.json` exists to prevent.
|
|
8
|
+
*
|
|
9
|
+
* Pins are deliberately NOT filtered: they come straight from the saved store,
|
|
10
|
+
* so a pinned request stays visible no matter what the search box or the
|
|
11
|
+
* status chips say. The only thing the filtered list contributes is the
|
|
12
|
+
* dedupe — a pinned request that is still live must not render twice.
|
|
13
|
+
*/
|
|
14
|
+
import type { NetworkEvent } from "../types";
|
|
15
|
+
export interface PinnedSplit {
|
|
16
|
+
/** Pinned snapshots, newest first — rendered above the list. */
|
|
17
|
+
pinned: NetworkEvent[];
|
|
18
|
+
/** The filtered list minus anything already shown as a pin. */
|
|
19
|
+
rest: NetworkEvent[];
|
|
20
|
+
}
|
|
21
|
+
export declare function splitPinned(filtered: NetworkEvent[], pinnedEvents: NetworkEvent[],
|
|
22
|
+
/** Live IDs pinned in THIS session — from `networkSavedStore.getState()`. */
|
|
23
|
+
pinnedLiveIds: Set<string>): PinnedSplit;
|
|
24
|
+
//# sourceMappingURL=withPinnedFirst.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withPinnedFirst.d.ts","sourceRoot":"","sources":["../../../../src/network/utils/withPinnedFirst.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAI7C,MAAM,WAAW,WAAW;IAC1B,gEAAgE;IAChE,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,+DAA+D;IAC/D,IAAI,EAAE,YAAY,EAAE,CAAC;CACtB;AAED,wBAAgB,WAAW,CACzB,QAAQ,EAAE,YAAY,EAAE,EACxB,YAAY,EAAE,YAAY,EAAE;AAC5B,6EAA6E;AAC7E,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,GACzB,WAAW,CASb"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buoy-gg/network",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.5",
|
|
4
4
|
"description": "In-app network inspector for React Native — requests, responses, timing & errors live, with GraphQL operation parsing. Part of Buoy devtools.",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
],
|
|
27
27
|
"sideEffects": false,
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@buoy-gg/shared-ui": "7.0.
|
|
29
|
+
"@buoy-gg/shared-ui": "7.0.5"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"react": "*",
|