@rozenite/network-activity-plugin 1.5.1 → 1.7.0-rc.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/CHANGELOG.md +20 -0
- package/README.md +2 -0
- package/dist/{App.html → devtools/App.html} +2 -2
- package/dist/{boot-recording.cjs → react-native/chunks/boot-recording.cjs} +1 -1
- package/dist/{boot-recording.js → react-native/chunks/boot-recording.js} +3 -3
- package/dist/react-native/chunks/boot-recording.require.cjs +5 -0
- package/dist/react-native/chunks/boot-recording.require.js +5 -0
- package/dist/react-native/chunks/useNetworkActivityDevTools.require.cjs +1102 -0
- package/dist/react-native/chunks/useNetworkActivityDevTools.require.js +1102 -0
- package/dist/{react-native.cjs → react-native/index.cjs} +2 -2
- package/dist/react-native/index.d.ts +305 -0
- package/dist/{react-native.js → react-native/index.js} +2 -2
- package/dist/rozenite.json +1 -1
- package/package.json +27 -7
- package/src/react-native/agent/__tests__/network-activity-agent-state.test.ts +250 -0
- package/src/react-native/agent/state.ts +869 -0
- package/src/react-native/agent/tools.ts +146 -0
- package/src/react-native/agent/use-network-activity-agent-tools.ts +244 -0
- package/src/react-native/http/http-inspector.ts +0 -1
- package/src/react-native/useNetworkActivityDevTools.ts +11 -0
- package/tsconfig.json +3 -0
- package/dist/react-native.d.ts +0 -4
- package/dist/rozenite.config.d.ts +0 -7
- package/dist/src/react-native/boot-recording.d.ts +0 -41
- package/dist/src/react-native/config.d.ts +0 -23
- package/dist/src/react-native/events-listener.d.ts +0 -44
- package/dist/src/react-native/http/http-inspector.d.ts +0 -10
- package/dist/src/react-native/http/http-utils.d.ts +0 -15
- package/dist/src/react-native/http/network-requests-registry.d.ts +0 -6
- package/dist/src/react-native/http/overrides-registry.d.ts +0 -6
- package/dist/src/react-native/http/xhr-interceptor.d.ts +0 -44
- package/dist/src/react-native/inspector.d.ts +0 -7
- package/dist/src/react-native/network-inspector.d.ts +0 -16
- package/dist/src/react-native/sse/event-source.d.ts +0 -2
- package/dist/src/react-native/sse/sse-inspector.d.ts +0 -6
- package/dist/src/react-native/sse/sse-interceptor.d.ts +0 -36
- package/dist/src/react-native/sse/types.d.ts +0 -6
- package/dist/src/react-native/useHttpInspector.d.ts +0 -3
- package/dist/src/react-native/useNetworkActivityDevTools.d.ts +0 -3
- package/dist/src/react-native/useSSEInspector.d.ts +0 -3
- package/dist/src/react-native/useWebSocketInspector.d.ts +0 -3
- package/dist/src/react-native/utils/getBlobName.d.ts +0 -35
- package/dist/src/react-native/utils/getFormDataEntries.d.ts +0 -18
- package/dist/src/react-native/utils.d.ts +0 -6
- package/dist/src/react-native/websocket/websocket-inspector.d.ts +0 -6
- package/dist/src/react-native/websocket/websocket-interceptor.d.ts +0 -73
- package/dist/src/shared/client.d.ts +0 -17
- package/dist/src/shared/http-events.d.ts +0 -106
- package/dist/src/shared/sse-events.d.ts +0 -38
- package/dist/src/shared/websocket-events.d.ts +0 -60
- package/dist/src/ui/App.d.ts +0 -1
- package/dist/src/ui/components/Badge.d.ts +0 -9
- package/dist/src/ui/components/Button.d.ts +0 -11
- package/dist/src/ui/components/CodeBlock.d.ts +0 -3
- package/dist/src/ui/components/CodeEditor.d.ts +0 -5
- package/dist/src/ui/components/CookieCard.d.ts +0 -7
- package/dist/src/ui/components/CopyRequestDropdown.d.ts +0 -7
- package/dist/src/ui/components/DropdownMenu.d.ts +0 -27
- package/dist/src/ui/components/FilterBar.d.ts +0 -10
- package/dist/src/ui/components/Input.d.ts +0 -3
- package/dist/src/ui/components/JsonTree.d.ts +0 -5
- package/dist/src/ui/components/JsonTreeCopyableItem.d.ts +0 -7
- package/dist/src/ui/components/KeyValueGrid.d.ts +0 -13
- package/dist/src/ui/components/OverrideResponse.d.ts +0 -8
- package/dist/src/ui/components/RequestBody.d.ts +0 -6
- package/dist/src/ui/components/RequestList.d.ts +0 -30
- package/dist/src/ui/components/ScrollArea.d.ts +0 -5
- package/dist/src/ui/components/Section.d.ts +0 -8
- package/dist/src/ui/components/Separator.d.ts +0 -4
- package/dist/src/ui/components/SidePanel.d.ts +0 -1
- package/dist/src/ui/components/Tabs.d.ts +0 -7
- package/dist/src/ui/components/Toolbar.d.ts +0 -1
- package/dist/src/ui/hooks/useCopyToClipboard.d.ts +0 -4
- package/dist/src/ui/state/derived.d.ts +0 -5
- package/dist/src/ui/state/hooks.d.ts +0 -21
- package/dist/src/ui/state/model.d.ts +0 -113
- package/dist/src/ui/state/store.d.ts +0 -48
- package/dist/src/ui/tabs/CookiesTab.d.ts +0 -5
- package/dist/src/ui/tabs/HeadersTab.d.ts +0 -5
- package/dist/src/ui/tabs/MessagesTab.d.ts +0 -5
- package/dist/src/ui/tabs/RequestTab.d.ts +0 -5
- package/dist/src/ui/tabs/ResponseTab.d.ts +0 -6
- package/dist/src/ui/tabs/SSEMessagesTab.d.ts +0 -5
- package/dist/src/ui/tabs/TimingTab.d.ts +0 -5
- package/dist/src/ui/types.d.ts +0 -26
- package/dist/src/ui/utils/assert.d.ts +0 -1
- package/dist/src/ui/utils/checkRequestBodyBinary.d.ts +0 -2
- package/dist/src/ui/utils/cn.d.ts +0 -2
- package/dist/src/ui/utils/copyToClipboard.d.ts +0 -1
- package/dist/src/ui/utils/escapeShellArg.d.ts +0 -1
- package/dist/src/ui/utils/generateCurlCommand.d.ts +0 -2
- package/dist/src/ui/utils/generateFetchCall.d.ts +0 -2
- package/dist/src/ui/utils/generateMultipartBody.d.ts +0 -4
- package/dist/src/ui/utils/getId.d.ts +0 -1
- package/dist/src/ui/utils/getStatusColor.d.ts +0 -1
- package/dist/src/ui/views/InspectorView.d.ts +0 -5
- package/dist/src/ui/views/LoadingView.d.ts +0 -1
- package/dist/src/utils/applyReactNativeRequestHeadersLogic.d.ts +0 -7
- package/dist/src/utils/applyReactNativeResponseHeadersLogic.d.ts +0 -9
- package/dist/src/utils/cookieParser.d.ts +0 -6
- package/dist/src/utils/getContentTypeMimeType.d.ts +0 -2
- package/dist/src/utils/getHttpHeader.d.ts +0 -5
- package/dist/src/utils/getHttpHeaderValueAsString.d.ts +0 -11
- package/dist/src/utils/getStringSizeInBytes.d.ts +0 -1
- package/dist/src/utils/inferContentTypeFromPostData.d.ts +0 -2
- package/dist/src/utils/safeStringify.d.ts +0 -1
- package/dist/src/utils/typeChecks.d.ts +0 -9
- package/dist/useNetworkActivityDevTools.cjs +0 -171
- package/dist/useNetworkActivityDevTools.js +0 -171
- /package/dist/{assets → devtools/assets}/App-BrSkOkws.css +0 -0
- /package/dist/{assets/App-CGt4qucR.js → devtools/assets/App-pokLiGYV.js} +0 -0
- /package/dist/{event-source.cjs → react-native/chunks/event-source.cjs} +0 -0
- /package/dist/{event-source.js → react-native/chunks/event-source.js} +0 -0
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
3
|
-
declare const Tabs: React.ForwardRefExoticComponent<TabsPrimitive.TabsProps & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
-
declare const TabsList: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
-
declare const TabsTrigger: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
-
declare const TabsContent: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
-
export { Tabs, TabsList, TabsTrigger, TabsContent };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const Toolbar: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { NetworkActivityState } from './store';
|
|
2
|
-
import { ProcessedRequest } from './model';
|
|
3
|
-
export declare const getProcessedRequests: (obj: NetworkActivityState) => ProcessedRequest[];
|
|
4
|
-
export declare const getSelectedRequest: (obj: NetworkActivityState) => import('./model').NetworkEntry | null;
|
|
5
|
-
export declare const getRequestSummary: (requestId: string) => ((state: NetworkActivityState) => ProcessedRequest | null);
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { NetworkActivityState } from './store';
|
|
2
|
-
export declare const useNetworkActivityStore: <T>(selector: (state: NetworkActivityState) => T) => T;
|
|
3
|
-
export declare const useProcessedRequests: () => import('./model').ProcessedRequest[];
|
|
4
|
-
export declare const useSelectedRequest: () => import('./model').NetworkEntry | null;
|
|
5
|
-
export declare const useHasSelectedRequest: () => boolean;
|
|
6
|
-
export declare const useSelectedRequestId: () => string | null;
|
|
7
|
-
export declare const useIsRecording: () => boolean;
|
|
8
|
-
export declare const useNetworkActivityActions: () => {
|
|
9
|
-
setRecording: (isRecording: boolean) => void;
|
|
10
|
-
setSelectedRequest: (requestId: import('../../shared/http-events').RequestId | null) => void;
|
|
11
|
-
clearRequests: () => void;
|
|
12
|
-
addOverride: (requestUrl: string, override: import('../../shared/http-events').RequestOverride) => void;
|
|
13
|
-
clearOverride: (requestUrl: string) => void;
|
|
14
|
-
};
|
|
15
|
-
export declare const useNetworkActivityClientManagement: () => {
|
|
16
|
-
setupClient: (client: import('../../shared/client').NetworkActivityDevToolsClient) => void;
|
|
17
|
-
cleanupClient: () => void;
|
|
18
|
-
};
|
|
19
|
-
export declare const useWebSocketMessages: (requestId: string) => import('./model').WebSocketMessage[];
|
|
20
|
-
export declare const useOverrides: () => Map<string, import('../../shared/http-events').RequestOverride>;
|
|
21
|
-
export declare const useClientUISettings: () => import('../../shared/client').NetworkActivityClientUISettings | null;
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { Initiator, ResourceType, HttpHeaders, RequestPostData } from '../../shared/client';
|
|
2
|
-
export type RequestId = string;
|
|
3
|
-
export type Timestamp = number;
|
|
4
|
-
export type SocketId = number;
|
|
5
|
-
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD';
|
|
6
|
-
export type NetworkEntryType = 'http' | 'websocket' | 'sse';
|
|
7
|
-
export type HttpRequestData = {
|
|
8
|
-
type: string;
|
|
9
|
-
data: NonNullable<RequestPostData>;
|
|
10
|
-
};
|
|
11
|
-
export type HttpResponseData = {
|
|
12
|
-
type: string;
|
|
13
|
-
data: string;
|
|
14
|
-
};
|
|
15
|
-
export type HttpRequest = {
|
|
16
|
-
url: string;
|
|
17
|
-
method: HttpMethod;
|
|
18
|
-
headers: HttpHeaders;
|
|
19
|
-
body?: HttpRequestData;
|
|
20
|
-
};
|
|
21
|
-
export type HttpResponse = {
|
|
22
|
-
url: string;
|
|
23
|
-
status: number;
|
|
24
|
-
statusText: string;
|
|
25
|
-
headers: HttpHeaders;
|
|
26
|
-
contentType: string;
|
|
27
|
-
size: number;
|
|
28
|
-
responseTime: Timestamp;
|
|
29
|
-
body?: HttpResponseData;
|
|
30
|
-
};
|
|
31
|
-
export type HttpStatus = 'pending' | 'loading' | 'finished' | 'failed';
|
|
32
|
-
export type HttpNetworkEntry = {
|
|
33
|
-
id: RequestId;
|
|
34
|
-
type: 'http';
|
|
35
|
-
timestamp: Timestamp;
|
|
36
|
-
duration?: number;
|
|
37
|
-
request: HttpRequest;
|
|
38
|
-
response?: HttpResponse;
|
|
39
|
-
status: HttpStatus;
|
|
40
|
-
error?: string;
|
|
41
|
-
canceled?: boolean;
|
|
42
|
-
ttfb?: number;
|
|
43
|
-
size?: number;
|
|
44
|
-
initiator?: Initiator;
|
|
45
|
-
resourceType?: ResourceType;
|
|
46
|
-
progress?: {
|
|
47
|
-
loaded: number;
|
|
48
|
-
total: number;
|
|
49
|
-
lengthComputable: boolean;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
export type SSEMessage = {
|
|
53
|
-
id: string;
|
|
54
|
-
type: string;
|
|
55
|
-
data: string;
|
|
56
|
-
timestamp: Timestamp;
|
|
57
|
-
};
|
|
58
|
-
export type SSEStatus = 'connecting' | 'open' | 'closed' | 'error';
|
|
59
|
-
export type SSENetworkEntry = {
|
|
60
|
-
id: RequestId;
|
|
61
|
-
type: 'sse';
|
|
62
|
-
timestamp: Timestamp;
|
|
63
|
-
duration?: number;
|
|
64
|
-
request: HttpRequest;
|
|
65
|
-
response?: HttpResponse;
|
|
66
|
-
status: SSEStatus;
|
|
67
|
-
messages: SSEMessage[];
|
|
68
|
-
error?: string;
|
|
69
|
-
initiator?: Initiator;
|
|
70
|
-
resourceType?: ResourceType;
|
|
71
|
-
};
|
|
72
|
-
export type WebSocketConnection = {
|
|
73
|
-
url: string;
|
|
74
|
-
socketId: SocketId;
|
|
75
|
-
protocols?: string[];
|
|
76
|
-
options?: string[];
|
|
77
|
-
};
|
|
78
|
-
export type WebSocketMessage = {
|
|
79
|
-
id: string;
|
|
80
|
-
direction: 'sent' | 'received';
|
|
81
|
-
data: string;
|
|
82
|
-
messageType: 'text' | 'binary';
|
|
83
|
-
timestamp: Timestamp;
|
|
84
|
-
};
|
|
85
|
-
export type WebSocketStatus = 'connecting' | 'open' | 'closing' | 'closed' | 'error';
|
|
86
|
-
export type WebSocketNetworkEntry = {
|
|
87
|
-
id: RequestId;
|
|
88
|
-
type: 'websocket';
|
|
89
|
-
timestamp: Timestamp;
|
|
90
|
-
duration?: number;
|
|
91
|
-
connection: WebSocketConnection;
|
|
92
|
-
status: WebSocketStatus;
|
|
93
|
-
error?: string;
|
|
94
|
-
closeCode?: number;
|
|
95
|
-
closeReason?: string;
|
|
96
|
-
};
|
|
97
|
-
export type NetworkEntry = HttpNetworkEntry | WebSocketNetworkEntry | SSENetworkEntry;
|
|
98
|
-
export type ProcessedRequest = {
|
|
99
|
-
id: RequestId;
|
|
100
|
-
type: NetworkEntryType;
|
|
101
|
-
name: string;
|
|
102
|
-
status: HttpStatus | WebSocketStatus | SSEStatus;
|
|
103
|
-
timestamp: Timestamp;
|
|
104
|
-
duration?: number;
|
|
105
|
-
size: number | null;
|
|
106
|
-
method: HttpMethod | 'WS' | 'SSE';
|
|
107
|
-
httpStatus?: number;
|
|
108
|
-
progress?: {
|
|
109
|
-
loaded: number;
|
|
110
|
-
total: number;
|
|
111
|
-
lengthComputable: boolean;
|
|
112
|
-
};
|
|
113
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { NetworkActivityDevToolsClient, NetworkActivityEventMap, RequestOverride, RequestId, NetworkActivityClientUISettings } from '../../shared/client';
|
|
2
|
-
import { NetworkEntry, WebSocketMessage } from './model';
|
|
3
|
-
export interface NetworkActivityState {
|
|
4
|
-
isRecording: boolean;
|
|
5
|
-
selectedRequestId: RequestId | null;
|
|
6
|
-
networkEntries: Map<RequestId, NetworkEntry>;
|
|
7
|
-
websocketMessages: Map<RequestId, WebSocketMessage[]>;
|
|
8
|
-
overrides: Map<string, RequestOverride>;
|
|
9
|
-
clientUISettings: NetworkActivityClientUISettings | null;
|
|
10
|
-
_unsubscribeFunctions?: Array<{
|
|
11
|
-
remove: () => void;
|
|
12
|
-
}>;
|
|
13
|
-
_client?: NetworkActivityDevToolsClient;
|
|
14
|
-
actions: {
|
|
15
|
-
setRecording: (isRecording: boolean) => void;
|
|
16
|
-
setSelectedRequest: (requestId: RequestId | null) => void;
|
|
17
|
-
clearRequests: () => void;
|
|
18
|
-
addOverride: (requestUrl: string, override: RequestOverride) => void;
|
|
19
|
-
clearOverride: (requestUrl: string) => void;
|
|
20
|
-
};
|
|
21
|
-
handleEvent: <K extends keyof NetworkActivityEventMap>(eventType: K, data: NetworkActivityEventMap[K]) => void;
|
|
22
|
-
client: {
|
|
23
|
-
setupClient: (client: NetworkActivityDevToolsClient) => void;
|
|
24
|
-
cleanupClient: () => void;
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
export declare const createNetworkActivityStore: () => Omit<import('zustand').StoreApi<NetworkActivityState>, "persist"> & {
|
|
28
|
-
persist: {
|
|
29
|
-
setOptions: (options: Partial<import('zustand/middleware').PersistOptions<NetworkActivityState, unknown>>) => void;
|
|
30
|
-
clearStorage: () => void;
|
|
31
|
-
rehydrate: () => Promise<void> | void;
|
|
32
|
-
hasHydrated: () => boolean;
|
|
33
|
-
onHydrate: (fn: (state: NetworkActivityState) => void) => () => void;
|
|
34
|
-
onFinishHydration: (fn: (state: NetworkActivityState) => void) => () => void;
|
|
35
|
-
getOptions: () => Partial<import('zustand/middleware').PersistOptions<NetworkActivityState, unknown>>;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
export declare const store: Omit<import('zustand').StoreApi<NetworkActivityState>, "persist"> & {
|
|
39
|
-
persist: {
|
|
40
|
-
setOptions: (options: Partial<import('zustand/middleware').PersistOptions<NetworkActivityState, unknown>>) => void;
|
|
41
|
-
clearStorage: () => void;
|
|
42
|
-
rehydrate: () => Promise<void> | void;
|
|
43
|
-
hasHydrated: () => boolean;
|
|
44
|
-
onHydrate: (fn: (state: NetworkActivityState) => void) => () => void;
|
|
45
|
-
onFinishHydration: (fn: (state: NetworkActivityState) => void) => () => void;
|
|
46
|
-
getOptions: () => Partial<import('zustand/middleware').PersistOptions<NetworkActivityState, unknown>>;
|
|
47
|
-
};
|
|
48
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { HttpNetworkEntry, SSENetworkEntry } from '../state/model';
|
|
2
|
-
export type CookiesTabProps = {
|
|
3
|
-
selectedRequest: HttpNetworkEntry | SSENetworkEntry;
|
|
4
|
-
};
|
|
5
|
-
export declare const CookiesTab: ({ selectedRequest }: CookiesTabProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { HttpNetworkEntry, SSENetworkEntry } from '../state/model';
|
|
2
|
-
export type HeadersTabProps = {
|
|
3
|
-
selectedRequest: HttpNetworkEntry | SSENetworkEntry;
|
|
4
|
-
};
|
|
5
|
-
export declare const HeadersTab: ({ selectedRequest }: HeadersTabProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { HttpNetworkEntry, SSENetworkEntry } from '../state/model';
|
|
2
|
-
export type RequestTabProps = {
|
|
3
|
-
selectedRequest: HttpNetworkEntry | SSENetworkEntry;
|
|
4
|
-
};
|
|
5
|
-
export declare const RequestTab: ({ selectedRequest }: RequestTabProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { HttpNetworkEntry } from '../state/model';
|
|
2
|
-
export type ResponseTabProps = {
|
|
3
|
-
selectedRequest: HttpNetworkEntry;
|
|
4
|
-
onRequestResponseBody: (requestId: string) => void;
|
|
5
|
-
};
|
|
6
|
-
export declare const ResponseTab: ({ selectedRequest, onRequestResponseBody, }: ResponseTabProps) => import("react/jsx-runtime").JSX.Element;
|
package/dist/src/ui/types.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { RequestId, Request, Response, Initiator, ResourceType, HttpHeaders } from '../shared/client';
|
|
2
|
-
export type NetworkEntry = {
|
|
3
|
-
requestId: RequestId;
|
|
4
|
-
url: string;
|
|
5
|
-
method: string;
|
|
6
|
-
headers: HttpHeaders;
|
|
7
|
-
body?: {
|
|
8
|
-
type: string;
|
|
9
|
-
data: string;
|
|
10
|
-
};
|
|
11
|
-
status: 'pending' | 'loading' | 'finished' | 'failed';
|
|
12
|
-
startTime: number;
|
|
13
|
-
endTime?: number;
|
|
14
|
-
duration?: number;
|
|
15
|
-
ttfb?: number;
|
|
16
|
-
type?: ResourceType;
|
|
17
|
-
initiator?: Initiator;
|
|
18
|
-
request?: Request;
|
|
19
|
-
response?: Response;
|
|
20
|
-
responseBody?: {
|
|
21
|
-
body: string | null;
|
|
22
|
-
};
|
|
23
|
-
error?: string;
|
|
24
|
-
canceled?: boolean;
|
|
25
|
-
size?: number;
|
|
26
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function assert(condition: boolean, message: string): asserts condition;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function copyToClipboard(text: string): Promise<void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function escapeShellArg(arg: string): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getId: (namespace: string) => string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getStatusColor: (status: number | string) => string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const LoadingView: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { HttpHeaders, RequestPostData } from '../shared/client';
|
|
2
|
-
/**
|
|
3
|
-
* Partially emulates React Native's behavior for setting HTTP headers.
|
|
4
|
-
*
|
|
5
|
-
* @see https://github.com/facebook/react-native/blob/de5093c88771977b58f7bec3f3ffa64a9595334e/packages/react-native/Libraries/Network/RCTNetworking.mm#L345-L349
|
|
6
|
-
*/
|
|
7
|
-
export declare function applyReactNativeRequestHeadersLogic(headers: HttpHeaders, postData?: RequestPostData): HttpHeaders;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { HttpHeaders, XHRHeaders } from '../shared/client';
|
|
2
|
-
/**
|
|
3
|
-
* Applies React Native specific logic to response headers.
|
|
4
|
-
* React Native concatenates multiple header values into single strings,
|
|
5
|
-
* this function parses them back into arrays where appropriate.
|
|
6
|
-
*
|
|
7
|
-
* @see https://github.com/facebook/react-native/blob/588f0c5ce6c283f116228456da2170d2adc3cbf4/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.java#L637
|
|
8
|
-
*/
|
|
9
|
-
export declare const applyReactNativeResponseHeadersLogic: (headers: XHRHeaders) => HttpHeaders;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Cookie, HttpHeaders } from '../shared/client';
|
|
2
|
-
export declare const parseSetCookieHeader: (setCookieStr: string) => Cookie;
|
|
3
|
-
export declare const splitSetCookieHeaderByComma: (header: string) => string[];
|
|
4
|
-
export declare const parseCookieHeader: (cookieString: string) => Cookie[];
|
|
5
|
-
export declare const parseRequestCookiesFromHeaders: (headers: HttpHeaders) => Cookie[];
|
|
6
|
-
export declare const parseResponseCookiesFromHeaders: (headers: HttpHeaders) => Cookie[];
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Combines multiple HTTP header values according to RFC 7230 Section 3.2.2
|
|
3
|
-
*
|
|
4
|
-
* Per RFC 7230 Section 3.2.2: "A recipient MAY combine multiple header fields
|
|
5
|
-
* with the same field name into one 'field-name: field-value' pair, without
|
|
6
|
-
* changing the semantics of the message, by appending each subsequent field
|
|
7
|
-
* value to the combined field value in order, separated by a comma."
|
|
8
|
-
*
|
|
9
|
-
* @see https://tools.ietf.org/html/rfc7230#section-3.2.2
|
|
10
|
-
*/
|
|
11
|
-
export declare function getHttpHeaderValueAsString(value: string | string[]): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getStringSizeInBytes: (value: string) => number;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function safeStringify(data: unknown): string;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const isBlob: (value: unknown) => value is Blob;
|
|
2
|
-
export declare const isArrayBuffer: (value: unknown) => value is ArrayBuffer | ArrayBufferView;
|
|
3
|
-
export declare const isFormData: (value: unknown) => value is FormData;
|
|
4
|
-
export declare const isNullOrUndefined: (value: unknown) => value is null | undefined;
|
|
5
|
-
export declare const isString: (value: unknown) => value is string;
|
|
6
|
-
export declare const isNumber: (value: unknown) => value is number;
|
|
7
|
-
export declare const isBoolean: (value: unknown) => value is boolean;
|
|
8
|
-
export declare const isObject: (value: unknown) => value is object;
|
|
9
|
-
export declare const isArray: (value: unknown) => value is unknown[];
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const react = require("react");
|
|
4
|
-
const pluginBridge = require("@rozenite/plugin-bridge");
|
|
5
|
-
const bootRecording = require("./boot-recording.cjs");
|
|
6
|
-
const overridesRegistry = bootRecording.getOverridesRegistry();
|
|
7
|
-
const useHttpInspector = (client, httpInspector, isEnabled, isRecordingEnabled) => {
|
|
8
|
-
react.useEffect(() => {
|
|
9
|
-
if (!client || !isEnabled) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
const networkRequestsRegistry = httpInspector.getNetworkRequestsRegistry();
|
|
13
|
-
const subscriptions = [
|
|
14
|
-
client.onMessage("network-enable", () => {
|
|
15
|
-
httpInspector.enable();
|
|
16
|
-
}),
|
|
17
|
-
client.onMessage("network-disable", () => {
|
|
18
|
-
httpInspector.disable();
|
|
19
|
-
}),
|
|
20
|
-
client.onMessage("set-overrides", (data) => {
|
|
21
|
-
overridesRegistry.setOverrides(data.overrides);
|
|
22
|
-
}),
|
|
23
|
-
client.onMessage("get-response-body", async ({ requestId }) => {
|
|
24
|
-
const request = networkRequestsRegistry.getEntry(requestId);
|
|
25
|
-
if (!request) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
const body = await bootRecording.getResponseBody(request);
|
|
29
|
-
client.send("response-body", {
|
|
30
|
-
requestId,
|
|
31
|
-
body
|
|
32
|
-
});
|
|
33
|
-
})
|
|
34
|
-
];
|
|
35
|
-
if (isRecordingEnabled) {
|
|
36
|
-
httpInspector.enable();
|
|
37
|
-
}
|
|
38
|
-
return () => {
|
|
39
|
-
subscriptions.forEach((subscription) => subscription.remove());
|
|
40
|
-
httpInspector.dispose();
|
|
41
|
-
};
|
|
42
|
-
}, [client, httpInspector, isEnabled, isRecordingEnabled]);
|
|
43
|
-
};
|
|
44
|
-
const useWebSocketInspector = (client, websocketInspector, isEnabled, isRecordingEnabled) => {
|
|
45
|
-
react.useEffect(() => {
|
|
46
|
-
if (!client || !isEnabled) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
const subscriptions = [
|
|
50
|
-
client.onMessage("network-enable", () => {
|
|
51
|
-
websocketInspector.enable();
|
|
52
|
-
}),
|
|
53
|
-
client.onMessage("network-disable", () => {
|
|
54
|
-
websocketInspector.disable();
|
|
55
|
-
})
|
|
56
|
-
];
|
|
57
|
-
if (isRecordingEnabled) {
|
|
58
|
-
websocketInspector.enable();
|
|
59
|
-
}
|
|
60
|
-
return () => {
|
|
61
|
-
subscriptions.forEach((subscription) => subscription.remove());
|
|
62
|
-
websocketInspector.dispose();
|
|
63
|
-
};
|
|
64
|
-
}, [client, websocketInspector, isEnabled, isRecordingEnabled]);
|
|
65
|
-
};
|
|
66
|
-
const useSSEInspector = (client, sseInspector, isEnabled, isRecordingEnabled) => {
|
|
67
|
-
react.useEffect(() => {
|
|
68
|
-
if (!client || !isEnabled) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
const subscriptions = [
|
|
72
|
-
client.onMessage("network-enable", () => {
|
|
73
|
-
sseInspector.enable();
|
|
74
|
-
}),
|
|
75
|
-
client.onMessage("network-disable", () => {
|
|
76
|
-
sseInspector.disable();
|
|
77
|
-
})
|
|
78
|
-
];
|
|
79
|
-
if (isRecordingEnabled) {
|
|
80
|
-
sseInspector.enable();
|
|
81
|
-
}
|
|
82
|
-
return () => {
|
|
83
|
-
subscriptions.forEach((subscription) => subscription.remove());
|
|
84
|
-
sseInspector.dispose();
|
|
85
|
-
};
|
|
86
|
-
}, [client, sseInspector, isEnabled, isRecordingEnabled]);
|
|
87
|
-
};
|
|
88
|
-
const inspectorsConfig = bootRecording.createNetworkInspectorsConfiguration();
|
|
89
|
-
const useNetworkActivityDevTools = (config = bootRecording.DEFAULT_CONFIG) => {
|
|
90
|
-
const isRecordingEnabledRef = react.useRef(false);
|
|
91
|
-
const client = pluginBridge.useRozeniteDevToolsClient({
|
|
92
|
-
pluginId: "@rozenite/network-activity-plugin"
|
|
93
|
-
});
|
|
94
|
-
const isHttpInspectorEnabled = config.inspectors?.http ?? true;
|
|
95
|
-
const isWebSocketInspectorEnabled = config.inspectors?.websocket ?? true;
|
|
96
|
-
const isSSEInspectorEnabled = config.inspectors?.sse ?? true;
|
|
97
|
-
const showUrlAsName = config.clientUISettings?.showUrlAsName;
|
|
98
|
-
const { eventsListener, networkInspector } = inspectorsConfig;
|
|
99
|
-
react.useEffect(() => {
|
|
100
|
-
if (!client) {
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
bootRecording.validateConfig(config);
|
|
104
|
-
}, [config]);
|
|
105
|
-
react.useEffect(() => {
|
|
106
|
-
if (!client) {
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
const sendClientUISettings = () => {
|
|
110
|
-
client.send("client-ui-settings", {
|
|
111
|
-
settings: {
|
|
112
|
-
showUrlAsName: showUrlAsName ?? bootRecording.DEFAULT_CONFIG.clientUISettings?.showUrlAsName
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
};
|
|
116
|
-
const subscriptions = [
|
|
117
|
-
client.onMessage("network-enable", () => {
|
|
118
|
-
isRecordingEnabledRef.current = true;
|
|
119
|
-
eventsListener.connect(client.send, (message) => {
|
|
120
|
-
const type = message.type;
|
|
121
|
-
if (bootRecording.isHttpEvent(type)) {
|
|
122
|
-
return isHttpInspectorEnabled;
|
|
123
|
-
}
|
|
124
|
-
if (bootRecording.isWebSocketEvent(type)) {
|
|
125
|
-
return isWebSocketInspectorEnabled;
|
|
126
|
-
}
|
|
127
|
-
if (bootRecording.isSSEEvent(type)) {
|
|
128
|
-
return isSSEInspectorEnabled;
|
|
129
|
-
}
|
|
130
|
-
return true;
|
|
131
|
-
});
|
|
132
|
-
}),
|
|
133
|
-
client.onMessage("network-disable", () => {
|
|
134
|
-
isRecordingEnabledRef.current = false;
|
|
135
|
-
}),
|
|
136
|
-
client.onMessage("get-client-ui-settings", () => {
|
|
137
|
-
sendClientUISettings();
|
|
138
|
-
})
|
|
139
|
-
];
|
|
140
|
-
sendClientUISettings();
|
|
141
|
-
return () => {
|
|
142
|
-
subscriptions.forEach((subscription) => subscription.remove());
|
|
143
|
-
};
|
|
144
|
-
}, [
|
|
145
|
-
client,
|
|
146
|
-
showUrlAsName,
|
|
147
|
-
isHttpInspectorEnabled,
|
|
148
|
-
isWebSocketInspectorEnabled,
|
|
149
|
-
isSSEInspectorEnabled
|
|
150
|
-
]);
|
|
151
|
-
useHttpInspector(
|
|
152
|
-
client,
|
|
153
|
-
networkInspector.http,
|
|
154
|
-
isHttpInspectorEnabled,
|
|
155
|
-
isRecordingEnabledRef.current
|
|
156
|
-
);
|
|
157
|
-
useWebSocketInspector(
|
|
158
|
-
client,
|
|
159
|
-
networkInspector.websocket,
|
|
160
|
-
isWebSocketInspectorEnabled,
|
|
161
|
-
isRecordingEnabledRef.current
|
|
162
|
-
);
|
|
163
|
-
useSSEInspector(
|
|
164
|
-
client,
|
|
165
|
-
networkInspector.sse,
|
|
166
|
-
isSSEInspectorEnabled,
|
|
167
|
-
isRecordingEnabledRef.current
|
|
168
|
-
);
|
|
169
|
-
return client;
|
|
170
|
-
};
|
|
171
|
-
exports.useNetworkActivityDevTools = useNetworkActivityDevTools;
|