@rozenite/network-activity-plugin 1.0.0-alpha.8 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/App.html +2 -2
- package/dist/assets/{App-R2ZMH9wJ.css → App-BrSkOkws.css} +269 -2
- package/dist/assets/{App-lNMijPJ4.js → App-C6wCDVkW.js} +17485 -10814
- package/dist/event-source.cjs +22 -0
- package/dist/event-source.js +23 -0
- package/dist/react-native.cjs +4 -1
- package/dist/react-native.js +4 -1
- package/dist/rozenite.json +1 -1
- package/dist/src/react-native/config.d.ts +20 -0
- package/dist/src/react-native/{network-inspector.d.ts → http/network-inspector.d.ts} +1 -1
- package/dist/src/react-native/http/overrides-registry.d.ts +6 -0
- package/dist/src/react-native/{xhr-interceptor.d.ts → http/xhr-interceptor.d.ts} +7 -1
- package/dist/src/react-native/sse/event-source.d.ts +2 -0
- package/dist/src/react-native/sse/sse-inspector.d.ts +9 -0
- package/dist/src/react-native/sse/sse-interceptor.d.ts +36 -0
- package/dist/src/react-native/sse/types.d.ts +6 -0
- package/dist/src/react-native/useNetworkActivityDevTools.d.ts +2 -1
- package/dist/src/react-native/utils/getBlobName.d.ts +35 -0
- package/dist/src/react-native/utils/getFormDataEntries.d.ts +18 -0
- package/dist/src/react-native/utils.d.ts +6 -0
- package/dist/src/react-native/websocket/websocket-inspector.d.ts +9 -0
- package/dist/src/react-native/websocket/websocket-interceptor.d.ts +74 -0
- package/dist/src/shared/client.d.ts +53 -6
- package/dist/src/shared/sse-events.d.ts +38 -0
- package/dist/src/shared/websocket-events.d.ts +60 -0
- package/dist/src/ui/components/Badge.d.ts +1 -1
- package/dist/src/ui/components/Button.d.ts +2 -2
- package/dist/src/ui/components/CodeBlock.d.ts +3 -0
- package/dist/src/ui/components/CodeEditor.d.ts +5 -0
- package/dist/src/ui/components/CookieCard.d.ts +7 -0
- package/dist/src/ui/components/CopyRequestDropdown.d.ts +7 -0
- package/dist/src/ui/components/DropdownMenu.d.ts +27 -0
- package/dist/src/ui/components/FilterBar.d.ts +10 -0
- package/dist/src/ui/components/JsonTreeCopyableItem.d.ts +7 -0
- package/dist/src/ui/components/KeyValueGrid.d.ts +13 -0
- package/dist/src/ui/components/OverrideResponse.d.ts +8 -0
- package/dist/src/ui/components/RequestBody.d.ts +6 -0
- package/dist/src/ui/components/RequestList.d.ts +13 -28
- package/dist/src/ui/components/ScrollArea.d.ts +3 -2
- package/dist/src/ui/components/Section.d.ts +8 -0
- package/dist/src/ui/components/Separator.d.ts +2 -1
- package/dist/src/ui/components/SidePanel.d.ts +1 -0
- package/dist/src/ui/components/Tabs.d.ts +7 -0
- package/dist/src/ui/components/Toolbar.d.ts +1 -0
- package/dist/src/ui/hooks/useCopyToClipboard.d.ts +4 -0
- package/dist/src/ui/state/derived.d.ts +5 -0
- package/dist/src/ui/state/hooks.d.ts +21 -0
- package/dist/src/ui/state/model.d.ts +103 -0
- package/dist/src/ui/state/store.d.ts +48 -0
- package/dist/src/ui/tabs/CookiesTab.d.ts +3 -6
- package/dist/src/ui/tabs/HeadersTab.d.ts +3 -15
- package/dist/src/ui/tabs/MessagesTab.d.ts +5 -0
- package/dist/src/ui/tabs/RequestTab.d.ts +2 -7
- package/dist/src/ui/tabs/ResponseTab.d.ts +2 -8
- package/dist/src/ui/tabs/SSEMessagesTab.d.ts +5 -0
- package/dist/src/ui/tabs/TimingTab.d.ts +3 -5
- package/dist/src/ui/types.d.ts +4 -1
- package/dist/src/ui/utils/assert.d.ts +1 -0
- package/dist/src/ui/utils/checkRequestBodyBinary.d.ts +2 -0
- package/dist/src/ui/utils/copyToClipboard.d.ts +1 -0
- package/dist/src/ui/utils/escapeShellArg.d.ts +1 -0
- package/dist/src/ui/utils/generateCurlCommand.d.ts +2 -0
- package/dist/src/ui/utils/generateFetchCall.d.ts +2 -0
- package/dist/src/ui/utils/generateMultipartBody.d.ts +4 -0
- package/dist/src/ui/utils/getId.d.ts +1 -0
- package/dist/src/ui/utils/getStatusColor.d.ts +1 -0
- package/dist/src/utils/applyReactNativeRequestHeadersLogic.d.ts +7 -0
- package/dist/src/utils/applyReactNativeResponseHeadersLogic.d.ts +9 -0
- package/dist/src/utils/cookieParser.d.ts +6 -0
- package/dist/src/utils/getContentTypeMimeType.d.ts +2 -0
- package/dist/src/utils/getHttpHeader.d.ts +5 -0
- package/dist/src/utils/getHttpHeaderValueAsString.d.ts +11 -0
- package/dist/src/utils/getStringSizeInBytes.d.ts +1 -0
- package/dist/src/utils/inferContentTypeFromPostData.d.ts +2 -0
- package/dist/src/utils/safeStringify.d.ts +1 -0
- package/dist/src/utils/typeChecks.d.ts +9 -0
- package/dist/useNetworkActivityDevTools.cjs +724 -40
- package/dist/useNetworkActivityDevTools.js +723 -41
- package/package.json +22 -8
- package/react-native.ts +6 -1
- package/src/react-native/config.ts +43 -0
- package/src/react-native/http/network-inspector.ts +388 -0
- package/src/react-native/http/overrides-registry.ts +32 -0
- package/src/react-native/{xhr-interceptor.ts → http/xhr-interceptor.ts} +19 -2
- package/src/react-native/{xml-request.d.ts → http/xml-request.d.ts} +1 -0
- package/src/react-native/sse/event-source.ts +25 -0
- package/src/react-native/sse/sse-inspector.ts +139 -0
- package/src/react-native/sse/sse-interceptor.ts +180 -0
- package/src/react-native/sse/types.ts +9 -0
- package/src/react-native/useNetworkActivityDevTools.ts +156 -4
- package/src/react-native/utils/getBlobName.ts +45 -0
- package/src/react-native/utils/getFormDataEntries.ts +32 -0
- package/src/react-native/utils.ts +43 -0
- package/src/react-native/websocket/websocket-inspector.ts +180 -0
- package/src/react-native/websocket/websocket-interceptor.d.ts +4 -0
- package/src/react-native/websocket/websocket-interceptor.ts +166 -0
- package/src/shared/client.ts +79 -6
- package/src/shared/sse-events.ts +47 -0
- package/src/shared/websocket-events.ts +79 -0
- package/src/ui/components/Button.tsx +1 -0
- package/src/ui/components/CodeBlock.tsx +19 -0
- package/src/ui/components/CodeEditor.tsx +26 -0
- package/src/ui/components/CookieCard.tsx +64 -0
- package/src/ui/components/CopyRequestDropdown.tsx +95 -0
- package/src/ui/components/DropdownMenu.tsx +206 -0
- package/src/ui/components/FilterBar.tsx +117 -0
- package/src/ui/components/Input.tsx +1 -1
- package/src/ui/components/JsonTree.tsx +20 -0
- package/src/ui/components/JsonTreeCopyableItem.tsx +37 -0
- package/src/ui/components/KeyValueGrid.tsx +51 -0
- package/src/ui/components/OverrideResponse.tsx +132 -0
- package/src/ui/components/RequestBody.tsx +86 -0
- package/src/ui/components/RequestList.tsx +101 -131
- package/src/ui/components/ScrollArea.tsx +1 -0
- package/src/ui/components/Section.tsx +46 -0
- package/src/ui/components/SidePanel.tsx +333 -0
- package/src/ui/components/Tabs.tsx +1 -1
- package/src/ui/components/Toolbar.tsx +45 -0
- package/src/ui/globals.css +4 -0
- package/src/ui/hooks/useCopyToClipboard.ts +28 -0
- package/src/ui/state/derived.ts +112 -0
- package/src/ui/state/hooks.ts +52 -0
- package/src/ui/state/model.ts +140 -0
- package/src/ui/state/store.ts +669 -0
- package/src/ui/tabs/CookiesTab.tsx +61 -278
- package/src/ui/tabs/HeadersTab.tsx +85 -103
- package/src/ui/tabs/MessagesTab.tsx +276 -0
- package/src/ui/tabs/RequestTab.tsx +58 -51
- package/src/ui/tabs/ResponseTab.tsx +101 -74
- package/src/ui/tabs/SSEMessagesTab.tsx +224 -0
- package/src/ui/tabs/TimingTab.tsx +30 -43
- package/src/ui/types.ts +4 -1
- package/src/ui/utils/assert.ts +5 -0
- package/src/ui/utils/checkRequestBodyBinary.ts +7 -0
- package/src/ui/utils/copyToClipboard.ts +3 -0
- package/src/ui/utils/escapeShellArg.ts +12 -0
- package/src/ui/utils/generateCurlCommand.ts +83 -0
- package/src/ui/utils/generateFetchCall.ts +64 -0
- package/src/ui/utils/generateMultipartBody.ts +19 -0
- package/src/ui/utils/getId.ts +10 -0
- package/src/ui/utils/getStatusColor.ts +15 -0
- package/src/ui/views/InspectorView.tsx +35 -319
- package/src/utils/applyReactNativeRequestHeadersLogic.ts +30 -0
- package/src/utils/applyReactNativeResponseHeadersLogic.ts +28 -0
- package/src/utils/cookieParser.ts +126 -0
- package/src/utils/getContentTypeMimeType.ts +17 -0
- package/src/utils/getHttpHeader.ts +17 -0
- package/src/utils/getHttpHeaderValueAsString.ts +13 -0
- package/src/utils/getStringSizeInBytes.ts +3 -0
- package/src/utils/inferContentTypeFromPostData.ts +9 -0
- package/src/utils/safeStringify.ts +7 -0
- package/src/utils/typeChecks.ts +27 -0
- package/tailwind.config.ts +3 -0
- package/vite.config.ts +12 -0
- package/dist/src/ui/utils/getHttpHeaderValue.d.ts +0 -2
- package/src/react-native/network-inspector.ts +0 -247
- package/src/ui/utils/getHttpHeaderValue.ts +0 -14
- /package/dist/src/react-native/{network-requests-registry.d.ts → http/network-requests-registry.d.ts} +0 -0
- /package/src/react-native/{network-requests-registry.ts → http/network-requests-registry.ts} +0 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Initiator,
|
|
3
|
+
ResourceType,
|
|
4
|
+
HttpHeaders,
|
|
5
|
+
RequestPostData,
|
|
6
|
+
} from '../../shared/client';
|
|
7
|
+
|
|
8
|
+
export type RequestId = string;
|
|
9
|
+
export type Timestamp = number;
|
|
10
|
+
export type SocketId = number;
|
|
11
|
+
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD';
|
|
12
|
+
|
|
13
|
+
export type NetworkEntryType = 'http' | 'websocket' | 'sse';
|
|
14
|
+
|
|
15
|
+
/* HTTP */
|
|
16
|
+
export type HttpRequestData = {
|
|
17
|
+
type: string;
|
|
18
|
+
data: NonNullable<RequestPostData>;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type HttpResponseData = {
|
|
22
|
+
type: string;
|
|
23
|
+
data: string;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type HttpRequest = {
|
|
27
|
+
url: string;
|
|
28
|
+
method: HttpMethod;
|
|
29
|
+
headers: HttpHeaders;
|
|
30
|
+
body?: HttpRequestData;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type HttpResponse = {
|
|
34
|
+
url: string;
|
|
35
|
+
status: number;
|
|
36
|
+
statusText: string;
|
|
37
|
+
headers: HttpHeaders;
|
|
38
|
+
contentType: string;
|
|
39
|
+
size: number;
|
|
40
|
+
responseTime: Timestamp;
|
|
41
|
+
body?: HttpResponseData;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type HttpStatus = 'pending' | 'loading' | 'finished' | 'failed';
|
|
45
|
+
|
|
46
|
+
export type HttpNetworkEntry = {
|
|
47
|
+
id: RequestId;
|
|
48
|
+
type: 'http';
|
|
49
|
+
timestamp: Timestamp;
|
|
50
|
+
duration?: number;
|
|
51
|
+
|
|
52
|
+
request: HttpRequest;
|
|
53
|
+
response?: HttpResponse;
|
|
54
|
+
status: HttpStatus;
|
|
55
|
+
error?: string;
|
|
56
|
+
canceled?: boolean;
|
|
57
|
+
ttfb?: number;
|
|
58
|
+
size?: number;
|
|
59
|
+
initiator?: Initiator;
|
|
60
|
+
resourceType?: ResourceType;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/* SSE */
|
|
64
|
+
export type SSEMessage = {
|
|
65
|
+
id: string;
|
|
66
|
+
type: string;
|
|
67
|
+
data: string;
|
|
68
|
+
timestamp: Timestamp;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export type SSEStatus = 'connecting' | 'open' | 'closed' | 'error';
|
|
72
|
+
|
|
73
|
+
export type SSENetworkEntry = {
|
|
74
|
+
id: RequestId;
|
|
75
|
+
type: 'sse';
|
|
76
|
+
timestamp: Timestamp;
|
|
77
|
+
duration?: number;
|
|
78
|
+
|
|
79
|
+
request: HttpRequest;
|
|
80
|
+
response?: HttpResponse;
|
|
81
|
+
status: SSEStatus;
|
|
82
|
+
messages: SSEMessage[];
|
|
83
|
+
error?: string;
|
|
84
|
+
initiator?: Initiator;
|
|
85
|
+
resourceType?: ResourceType;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/* WebSocket */
|
|
89
|
+
export type WebSocketConnection = {
|
|
90
|
+
url: string;
|
|
91
|
+
socketId: SocketId;
|
|
92
|
+
protocols?: string[];
|
|
93
|
+
options?: string[];
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export type WebSocketMessage = {
|
|
97
|
+
id: string;
|
|
98
|
+
direction: 'sent' | 'received';
|
|
99
|
+
data: string;
|
|
100
|
+
messageType: 'text' | 'binary';
|
|
101
|
+
timestamp: Timestamp;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export type WebSocketStatus =
|
|
105
|
+
| 'connecting'
|
|
106
|
+
| 'open'
|
|
107
|
+
| 'closing'
|
|
108
|
+
| 'closed'
|
|
109
|
+
| 'error';
|
|
110
|
+
|
|
111
|
+
export type WebSocketNetworkEntry = {
|
|
112
|
+
id: RequestId;
|
|
113
|
+
type: 'websocket';
|
|
114
|
+
timestamp: Timestamp;
|
|
115
|
+
duration?: number;
|
|
116
|
+
|
|
117
|
+
connection: WebSocketConnection;
|
|
118
|
+
status: WebSocketStatus;
|
|
119
|
+
error?: string;
|
|
120
|
+
closeCode?: number;
|
|
121
|
+
closeReason?: string;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
/* Shared */
|
|
125
|
+
export type NetworkEntry =
|
|
126
|
+
| HttpNetworkEntry
|
|
127
|
+
| WebSocketNetworkEntry
|
|
128
|
+
| SSENetworkEntry;
|
|
129
|
+
|
|
130
|
+
export type ProcessedRequest = {
|
|
131
|
+
id: RequestId;
|
|
132
|
+
type: NetworkEntryType;
|
|
133
|
+
name: string;
|
|
134
|
+
status: HttpStatus | WebSocketStatus | SSEStatus;
|
|
135
|
+
timestamp: Timestamp;
|
|
136
|
+
duration?: number;
|
|
137
|
+
size: number | null;
|
|
138
|
+
method: HttpMethod | 'WS' | 'SSE';
|
|
139
|
+
httpStatus?: number;
|
|
140
|
+
};
|