@rozenite/network-activity-plugin 1.6.0 → 1.7.0-rc.1
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 +16 -0
- package/dist/{App.html → devtools/App.html} +2 -2
- package/dist/react-native/chunks/boot-recording.js +1086 -0
- package/dist/react-native/chunks/boot-recording.require.cjs +5 -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 -8
- package/dist/react-native.d.ts +0 -4
- package/dist/rozenite.config.d.ts +0 -7
- package/dist/src/react-native/agent/__tests__/network-activity-agent-state.test.d.ts +0 -1
- package/dist/src/react-native/agent/state.d.ts +0 -733
- package/dist/src/react-native/agent/tools.d.ts +0 -11
- package/dist/src/react-native/agent/use-network-activity-agent-tools.d.ts +0 -13
- 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/{assets → devtools/assets}/App-BrSkOkws.css +0 -0
- /package/dist/{assets/App-CGt4qucR.js → devtools/assets/App-pokLiGYV.js} +0 -0
- /package/dist/{boot-recording.cjs → react-native/chunks/boot-recording.cjs} +0 -0
- /package/dist/{boot-recording.js → react-native/chunks/boot-recording.require.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
- /package/dist/{useNetworkActivityDevTools.cjs → react-native/chunks/useNetworkActivityDevTools.require.cjs} +0 -0
- /package/dist/{useNetworkActivityDevTools.js → react-native/chunks/useNetworkActivityDevTools.require.js} +0 -0
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { AgentTool } from '@rozenite/agent-bridge';
|
|
2
|
-
export declare const startRecordingTool: AgentTool;
|
|
3
|
-
export declare const stopRecordingTool: AgentTool;
|
|
4
|
-
export declare const getRecordingStatusTool: AgentTool;
|
|
5
|
-
export declare const listRequestsTool: AgentTool;
|
|
6
|
-
export declare const getRequestDetailsTool: AgentTool;
|
|
7
|
-
export declare const getRequestBodyTool: AgentTool;
|
|
8
|
-
export declare const getResponseBodyTool: AgentTool;
|
|
9
|
-
export declare const listRealtimeConnectionsTool: AgentTool;
|
|
10
|
-
export declare const getRealtimeConnectionDetailsTool: AgentTool;
|
|
11
|
-
export declare const NETWORK_ACTIVITY_AGENT_TOOLS: AgentTool[];
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { NetworkActivityDevToolsClient } from '../../shared/client';
|
|
2
|
-
import { NetworkInspector } from '../network-inspector';
|
|
3
|
-
type AgentToolsConfig = {
|
|
4
|
-
client: NetworkActivityDevToolsClient | null;
|
|
5
|
-
networkInspector: NetworkInspector;
|
|
6
|
-
enabledInspectors: {
|
|
7
|
-
http: boolean;
|
|
8
|
-
websocket: boolean;
|
|
9
|
-
sse: boolean;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export declare const useNetworkActivityAgentTools: ({ client, networkInspector, enabledInspectors, }: AgentToolsConfig) => void;
|
|
13
|
-
export {};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { NetworkActivityEventMap } from '../shared/client';
|
|
2
|
-
import { createEventsListener, EventsListenerOptions } from './events-listener';
|
|
3
|
-
import { NetworkInspector } from './network-inspector';
|
|
4
|
-
import { NetworkInspectorConfig } from './config';
|
|
5
|
-
type InspectorsConfiguration = {
|
|
6
|
-
eventsListener: ReturnType<typeof createEventsListener<NetworkActivityEventMap>>;
|
|
7
|
-
networkInspector: NetworkInspector;
|
|
8
|
-
};
|
|
9
|
-
export type BootRecordingOptions = NetworkInspectorConfig & EventsListenerOptions & {
|
|
10
|
-
/**
|
|
11
|
-
* Enable queuing of events during boot before DevTools connects.
|
|
12
|
-
* When true, network activity is captured and queued until DevTools is ready.
|
|
13
|
-
* When false, nothing is queued and inspectors are not even set up.
|
|
14
|
-
* @default true
|
|
15
|
-
*/
|
|
16
|
-
enableBootRecording?: boolean;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
* @internal
|
|
21
|
-
*/
|
|
22
|
-
export declare const createNetworkInspectorsConfiguration: (options?: BootRecordingOptions) => InspectorsConfiguration;
|
|
23
|
-
/**
|
|
24
|
-
* Enable network activity recording during app boot, before DevTools connects.
|
|
25
|
-
* Call this at the root of your app to capture early network requests.
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* ```tsx
|
|
29
|
-
* import { withOnBootNetworkActivityRecording } from '@rozenite/network-activity-plugin';
|
|
30
|
-
*
|
|
31
|
-
* // At app entry point, before any network requests
|
|
32
|
-
* withOnBootNetworkActivityRecording();
|
|
33
|
-
*
|
|
34
|
-
* function App() {
|
|
35
|
-
* useNetworkActivityDevTools();
|
|
36
|
-
* // ...
|
|
37
|
-
* }
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
export declare const withOnBootNetworkActivityRecording: (options?: BootRecordingOptions) => void;
|
|
41
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export type InspectorType = 'http' | 'websocket' | 'sse';
|
|
2
|
-
export type InspectorsConfig = {
|
|
3
|
-
[key in InspectorType]?: boolean;
|
|
4
|
-
};
|
|
5
|
-
export type NetworkInspectorConfig = {
|
|
6
|
-
/**
|
|
7
|
-
* Specifies which network inspectors are enabled.
|
|
8
|
-
* Set to `false` to disable monitoring for a specific type of network traffic.
|
|
9
|
-
* @default { http: true, websocket: true, sse: true }
|
|
10
|
-
*/
|
|
11
|
-
inspectors?: InspectorsConfig;
|
|
12
|
-
};
|
|
13
|
-
export type NetworkActivityDevToolsConfig = NetworkInspectorConfig & {
|
|
14
|
-
clientUISettings?: {
|
|
15
|
-
/**
|
|
16
|
-
* If true, display the entire relative URL as the request name in the UI instead of only the last path segment.
|
|
17
|
-
* @default false
|
|
18
|
-
*/
|
|
19
|
-
showUrlAsName?: boolean;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export declare const DEFAULT_CONFIG: NetworkActivityDevToolsConfig;
|
|
23
|
-
export declare const validateConfig: (config: NetworkActivityDevToolsConfig) => void;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
type QueuedMessage<TEventMap extends Record<string, unknown>> = {
|
|
2
|
-
type: keyof TEventMap;
|
|
3
|
-
data: TEventMap[keyof TEventMap];
|
|
4
|
-
};
|
|
5
|
-
type SendFunction<TEventMap extends Record<string, unknown>> = <K extends keyof TEventMap>(type: K, data: TEventMap[K]) => void;
|
|
6
|
-
/**
|
|
7
|
-
* Generic events listener that queues messages until a send function is registered.
|
|
8
|
-
* This allows capturing events before the DevTools client connects and so be boot compliant.
|
|
9
|
-
*/
|
|
10
|
-
export declare class EventsListener<TEventMap extends Record<string, unknown>> {
|
|
11
|
-
private messageQueue;
|
|
12
|
-
private sendFunction;
|
|
13
|
-
private maxQueueSize;
|
|
14
|
-
private isQueuing;
|
|
15
|
-
setMaxQueueSize(size: number): void;
|
|
16
|
-
/**
|
|
17
|
-
* Enable queuing mode to capture events before client is connected
|
|
18
|
-
*/
|
|
19
|
-
enableQueuing(): void;
|
|
20
|
-
/**
|
|
21
|
-
* Connect the actual send function and automatically flush queued messages
|
|
22
|
-
*/
|
|
23
|
-
connect(sendFn: SendFunction<TEventMap>, filterFn?: (message: QueuedMessage<TEventMap>) => boolean): void;
|
|
24
|
-
isInQueueMode(): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Send a message (queued if not connected, sent directly if connected)
|
|
27
|
-
*/
|
|
28
|
-
send<K extends keyof TEventMap>(type: K, data: TEventMap[K]): void;
|
|
29
|
-
private enqueueMessage;
|
|
30
|
-
private flushQueue;
|
|
31
|
-
}
|
|
32
|
-
export type EventsListenerOptions = {
|
|
33
|
-
/**
|
|
34
|
-
* Maximum number of messages to queue before DevTools connects.
|
|
35
|
-
* @default 200
|
|
36
|
-
*/
|
|
37
|
-
maxQueueSize?: number;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Create a new events listener instance for a specific event map.
|
|
41
|
-
* This factory can be used to create listeners for different protocols or plugins.
|
|
42
|
-
*/
|
|
43
|
-
export declare const createEventsListener: <TEventMap extends Record<string, unknown>>() => EventsListener<TEventMap>;
|
|
44
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { getNetworkRequestsRegistry } from './network-requests-registry';
|
|
2
|
-
import { HttpEventMap } from '../../shared/http-events';
|
|
3
|
-
import { Inspector } from '../inspector';
|
|
4
|
-
export type { HttpEventMap };
|
|
5
|
-
export declare const HTTP_EVENTS: (keyof HttpEventMap)[];
|
|
6
|
-
export declare const isHttpEvent: (type: string) => type is keyof HttpEventMap;
|
|
7
|
-
export type HTTPInspector = Inspector<HttpEventMap> & {
|
|
8
|
-
getNetworkRequestsRegistry: () => ReturnType<typeof getNetworkRequestsRegistry>;
|
|
9
|
-
};
|
|
10
|
-
export declare const getHTTPInspector: () => HTTPInspector;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { XHRPostData, RequestPostData } from '../../shared/client';
|
|
2
|
-
import { OverridesRegistry } from './overrides-registry';
|
|
3
|
-
export declare const getRequestBody: (body: XHRPostData) => RequestPostData;
|
|
4
|
-
export declare const getResponseSize: (request: XMLHttpRequest) => number | null;
|
|
5
|
-
export declare const getResponseBody: (request: XMLHttpRequest) => Promise<string | null>;
|
|
6
|
-
export declare const getInitiatorFromStack: () => {
|
|
7
|
-
type: string;
|
|
8
|
-
url?: string;
|
|
9
|
-
lineNumber?: number;
|
|
10
|
-
columnNumber?: number;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Applies override body and status to XMLHttpRequest objects.
|
|
14
|
-
*/
|
|
15
|
-
export declare const setupRequestOverride: (overridesRegistry: OverridesRegistry, request: XMLHttpRequest) => void;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { RequestOverride } from '../../shared/client';
|
|
2
|
-
export type OverridesRegistry = {
|
|
3
|
-
setOverrides: (newOverrides: [string, RequestOverride][]) => void;
|
|
4
|
-
getOverrideForUrl: (url: string) => RequestOverride | undefined;
|
|
5
|
-
};
|
|
6
|
-
export declare const getOverridesRegistry: () => OverridesRegistry;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { XHRPostData } from '../../shared/client';
|
|
2
|
-
type XHRInterceptorOpenCallback = (method: string, url: string, request: XMLHttpRequest) => void;
|
|
3
|
-
type XHRInterceptorSendCallback = (data: XHRPostData, request: XMLHttpRequest) => void;
|
|
4
|
-
type XHRInterceptorRequestHeaderCallback = (header: string, value: string, request: XMLHttpRequest) => void;
|
|
5
|
-
type XHRInterceptorHeaderReceivedCallback = (responseContentType: string | undefined, responseSize: number | undefined, allHeaders: string, request: XMLHttpRequest) => void;
|
|
6
|
-
type XHRInterceptorResponseCallback = (status: number, timeout: number, response: string, responseURL: string, responseType: string, request: XMLHttpRequest) => void;
|
|
7
|
-
type XHRInterceptorOverrideCallback = (request: XMLHttpRequest) => void;
|
|
8
|
-
/**
|
|
9
|
-
* A network interceptor which monkey-patches XMLHttpRequest methods
|
|
10
|
-
* to gather all network requests/responses, in order to show their
|
|
11
|
-
* information in the React Native inspector development tool.
|
|
12
|
-
* This supports interception with XMLHttpRequest API, including Fetch API
|
|
13
|
-
* and any other third party libraries that depend on XMLHttpRequest.
|
|
14
|
-
*/
|
|
15
|
-
export declare const XHRInterceptor: {
|
|
16
|
-
/**
|
|
17
|
-
* Invoked before XMLHttpRequest.open(...) is called.
|
|
18
|
-
*/
|
|
19
|
-
setOpenCallback(callback: XHRInterceptorOpenCallback): void;
|
|
20
|
-
/**
|
|
21
|
-
* Invoked before XMLHttpRequest.send(...) is called.
|
|
22
|
-
*/
|
|
23
|
-
setSendCallback(callback: XHRInterceptorSendCallback): void;
|
|
24
|
-
/**
|
|
25
|
-
* Invoked after xhr's readyState becomes xhr.HEADERS_RECEIVED.
|
|
26
|
-
*/
|
|
27
|
-
setHeaderReceivedCallback(callback: XHRInterceptorHeaderReceivedCallback): void;
|
|
28
|
-
/**
|
|
29
|
-
* Invoked after xhr's readyState becomes xhr.DONE.
|
|
30
|
-
*/
|
|
31
|
-
setResponseCallback(callback: XHRInterceptorResponseCallback): void;
|
|
32
|
-
/**
|
|
33
|
-
* Invoked before XMLHttpRequest.setRequestHeader(...) is called.
|
|
34
|
-
*/
|
|
35
|
-
setRequestHeaderCallback(callback: XHRInterceptorRequestHeaderCallback): void;
|
|
36
|
-
/**
|
|
37
|
-
* Invoked before XMLHttpRequest.send(...) is called.
|
|
38
|
-
*/
|
|
39
|
-
setOverrideCallback(callback: XHRInterceptorOverrideCallback): void;
|
|
40
|
-
isInterceptorEnabled(): boolean;
|
|
41
|
-
enableInterception(): void;
|
|
42
|
-
disableInterception(): void;
|
|
43
|
-
};
|
|
44
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { HTTPInspector } from './http/http-inspector';
|
|
2
|
-
import { SSEInspector } from './sse/sse-inspector';
|
|
3
|
-
import { WebSocketInspector } from './websocket/websocket-inspector';
|
|
4
|
-
import { EventsListener } from './events-listener';
|
|
5
|
-
import { NetworkActivityEventMap } from '../shared/client';
|
|
6
|
-
import { InspectorsConfig } from './config';
|
|
7
|
-
export type NetworkInspector = {
|
|
8
|
-
readonly http: HTTPInspector;
|
|
9
|
-
readonly sse: SSEInspector;
|
|
10
|
-
readonly websocket: WebSocketInspector;
|
|
11
|
-
setup: (eventsListener: EventsListener<NetworkActivityEventMap>) => void;
|
|
12
|
-
enable: (config?: InspectorsConfig) => void;
|
|
13
|
-
disable: () => void;
|
|
14
|
-
dispose: () => void;
|
|
15
|
-
};
|
|
16
|
-
export declare const getNetworkInspector: () => NetworkInspector;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { SSEEventMap } from '../../shared/sse-events';
|
|
2
|
-
import { Inspector } from '../inspector';
|
|
3
|
-
export type SSEInspector = Inspector<SSEEventMap>;
|
|
4
|
-
export declare const SSE_EVENTS: (keyof SSEEventMap)[];
|
|
5
|
-
export declare const isSSEEvent: (type: string) => type is keyof SSEEventMap;
|
|
6
|
-
export declare const getSSEInspector: () => SSEInspector;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { default as EventSource, MessageEvent, ErrorEvent, OpenEvent, CloseEvent, TimeoutEvent, ExceptionEvent, CustomEvent } from 'react-native-sse';
|
|
2
|
-
export type SSEInterceptorConnectCallback = (url: string, request: EventSource) => void;
|
|
3
|
-
export type SSEInterceptorMessageCallback = (event: MessageEvent | CustomEvent<string>, request: EventSource) => void;
|
|
4
|
-
export type SSEInterceptorErrorCallback = (error: ErrorEvent | TimeoutEvent | ExceptionEvent, request: EventSource) => void;
|
|
5
|
-
export type SSEInterceptorOpenEventCallback = (event: OpenEvent, request: EventSource) => void;
|
|
6
|
-
export type SSEInterceptorCloseCallback = (event: CloseEvent, request: EventSource) => void;
|
|
7
|
-
/**
|
|
8
|
-
* A network interceptor which monkey-patches EventSource open method
|
|
9
|
-
* to gather all SSE connections and events, in order to show their
|
|
10
|
-
* information in the Network Activity panel.
|
|
11
|
-
*/
|
|
12
|
-
export declare const SSEInterceptor: {
|
|
13
|
-
/**
|
|
14
|
-
* Invoked when EventSource.open() is called (connection attempt starting).
|
|
15
|
-
*/
|
|
16
|
-
setConnectCallback(callback: SSEInterceptorConnectCallback): void;
|
|
17
|
-
/**
|
|
18
|
-
* Invoked when a message event is received.
|
|
19
|
-
*/
|
|
20
|
-
setMessageCallback(callback: SSEInterceptorMessageCallback): void;
|
|
21
|
-
/**
|
|
22
|
-
* Invoked when an error event occurs.
|
|
23
|
-
*/
|
|
24
|
-
setErrorCallback(callback: SSEInterceptorErrorCallback): void;
|
|
25
|
-
/**
|
|
26
|
-
* Invoked when the connection is successfully opened (open event fired).
|
|
27
|
-
*/
|
|
28
|
-
setOpenEventCallback(callback: SSEInterceptorOpenEventCallback): void;
|
|
29
|
-
/**
|
|
30
|
-
* Invoked when the connection is closed.
|
|
31
|
-
*/
|
|
32
|
-
setCloseCallback(callback: SSEInterceptorCloseCallback): void;
|
|
33
|
-
isInterceptorEnabled(): boolean;
|
|
34
|
-
enableInterception(): void;
|
|
35
|
-
disableInterception(): void;
|
|
36
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { default as EventSource } from 'react-native-sse';
|
|
2
|
-
export interface EventSourceWithInternals<E extends string = never> extends EventSource<E> {
|
|
3
|
-
url: string;
|
|
4
|
-
/** Used internally to mark the underlying XHR to skip it in XHR interceptor. */
|
|
5
|
-
_xhr?: XMLHttpRequest;
|
|
6
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { HTTPInspector } from './http/http-inspector';
|
|
2
|
-
import { NetworkActivityDevToolsClient } from '../shared/client';
|
|
3
|
-
export declare const useHttpInspector: (client: NetworkActivityDevToolsClient | null, httpInspector: HTTPInspector, isEnabled: boolean, isRecordingEnabled: boolean) => void;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { NetworkActivityEventMap } from '../shared/client';
|
|
2
|
-
import { NetworkActivityDevToolsConfig } from './config';
|
|
3
|
-
export declare const useNetworkActivityDevTools: (config?: NetworkActivityDevToolsConfig) => import('@rozenite/plugin-bridge').RozeniteDevToolsClient<NetworkActivityEventMap> | null;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { SSEInspector } from './sse/sse-inspector';
|
|
2
|
-
import { NetworkActivityDevToolsClient } from '../shared/client';
|
|
3
|
-
export declare const useSSEInspector: (client: NetworkActivityDevToolsClient | null, sseInspector: SSEInspector, isEnabled: boolean, isRecordingEnabled: boolean) => void;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { WebSocketInspector } from './websocket/websocket-inspector';
|
|
2
|
-
import { NetworkActivityDevToolsClient } from '../shared/client';
|
|
3
|
-
export declare const useWebSocketInspector: (client: NetworkActivityDevToolsClient | null, websocketInspector: WebSocketInspector, isEnabled: boolean, isRecordingEnabled: boolean) => void;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utility function to get the name of a blob. Handles both the direct name property and the data object.
|
|
3
|
-
*
|
|
4
|
-
* ```
|
|
5
|
-
* // node_modules/react-native/Libraries/Blob/Blob.js
|
|
6
|
-
*
|
|
7
|
-
* export type BlobData = {
|
|
8
|
-
* blobId: string,
|
|
9
|
-
* offset: number,
|
|
10
|
-
* size: number,
|
|
11
|
-
* name?: string,
|
|
12
|
-
* type?: string,
|
|
13
|
-
* lastModified?: number,
|
|
14
|
-
* __collector?: ?BlobCollector,
|
|
15
|
-
* ...
|
|
16
|
-
* };
|
|
17
|
-
*
|
|
18
|
-
* get data(): BlobData {
|
|
19
|
-
* if (!this._data) {
|
|
20
|
-
* throw new Error('Blob has been closed and is no longer available');
|
|
21
|
-
* }
|
|
22
|
-
*
|
|
23
|
-
* return this._data;
|
|
24
|
-
* }
|
|
25
|
-
*
|
|
26
|
-
* get size(): number {
|
|
27
|
-
* return this.data.size;
|
|
28
|
-
* }
|
|
29
|
-
*
|
|
30
|
-
* get type(): string {
|
|
31
|
-
* return this.data.type || '';
|
|
32
|
-
* }
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
|
-
export declare function getBlobName(blob: any): string | undefined;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Extracts form data parts from a FormData object.
|
|
3
|
-
* Handles both the standard FormData API and the React Native FormData format.
|
|
4
|
-
*
|
|
5
|
-
* ```
|
|
6
|
-
* // node_modules/react-native/Libraries/Network/FormData.js
|
|
7
|
-
*
|
|
8
|
-
* class FormData {
|
|
9
|
-
* _parts: Array<FormDataNameValuePair>;
|
|
10
|
-
*
|
|
11
|
-
* constructor() {
|
|
12
|
-
* this._parts = [];
|
|
13
|
-
* }
|
|
14
|
-
*
|
|
15
|
-
* ...
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
export declare function getFormDataEntries(formData: any): [string, unknown][];
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
type UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
2
|
-
type LastOf<T> = UnionToIntersection<T extends unknown ? () => T : never> extends () => infer R ? R : never;
|
|
3
|
-
type Push<T extends unknown[], V> = [...T, V];
|
|
4
|
-
export type UnionToTuple<T, L = LastOf<T>> = [T] extends [never] ? [] : Push<UnionToTuple<Exclude<T, L>>, L>;
|
|
5
|
-
export declare const getContentType: (request: XMLHttpRequest) => string;
|
|
6
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { WebSocketEventMap } from '../../shared/websocket-events';
|
|
2
|
-
import { Inspector } from '../inspector';
|
|
3
|
-
export type WebSocketInspector = Inspector<WebSocketEventMap>;
|
|
4
|
-
export declare const WEBSOCKET_EVENTS: (keyof WebSocketEventMap)[];
|
|
5
|
-
export declare const isWebSocketEvent: (type: string) => type is keyof WebSocketEventMap;
|
|
6
|
-
export declare const getWebSocketInspector: () => WebSocketInspector;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
export interface WebSocketInterceptor {
|
|
2
|
-
/**
|
|
3
|
-
* Invoked when RCTWebSocketModule.close(...) is called.
|
|
4
|
-
*/
|
|
5
|
-
setCloseCallback(callback: (code: number | null, reason: string | null, socketId: number) => void): void;
|
|
6
|
-
/**
|
|
7
|
-
* Invoked when RCTWebSocketModule.send(...) or sendBinary(...) is called.
|
|
8
|
-
*/
|
|
9
|
-
setSendCallback(callback: (data: string, socketId: number) => void): void;
|
|
10
|
-
/**
|
|
11
|
-
* Invoked when RCTWebSocketModule.connect(...) is called.
|
|
12
|
-
*/
|
|
13
|
-
setConnectCallback(callback: (url: string, protocols: string[] | null, options: string[], socketId: number) => void): void;
|
|
14
|
-
/**
|
|
15
|
-
* Invoked when event "websocketOpen" happens.
|
|
16
|
-
*/
|
|
17
|
-
setOnOpenCallback(callback: (socketId: number) => void): void;
|
|
18
|
-
/**
|
|
19
|
-
* Invoked when event "websocketMessage" happens.
|
|
20
|
-
*/
|
|
21
|
-
setOnMessageCallback(callback: (data: string, socketId: number) => void): void;
|
|
22
|
-
/**
|
|
23
|
-
* Invoked when event "websocketFailed" happens.
|
|
24
|
-
*/
|
|
25
|
-
setOnErrorCallback(callback: (error: string, socketId: number) => void): void;
|
|
26
|
-
/**
|
|
27
|
-
* Invoked when event "websocketClosed" happens.
|
|
28
|
-
*/
|
|
29
|
-
setOnCloseCallback(callback: (error: {
|
|
30
|
-
code: number;
|
|
31
|
-
reason?: string;
|
|
32
|
-
}, socketId: number) => void): void;
|
|
33
|
-
isInterceptorEnabled(): boolean;
|
|
34
|
-
enableInterception(): void;
|
|
35
|
-
disableInterception(): void;
|
|
36
|
-
}
|
|
37
|
-
export interface WebSocketInterceptorPreRN079 {
|
|
38
|
-
/**
|
|
39
|
-
* Invoked when RCTWebSocketModule.close(...) is called.
|
|
40
|
-
*/
|
|
41
|
-
setCloseCallback(callback: (code: number | null, reason: string | null, socketId: number) => void): void;
|
|
42
|
-
/**
|
|
43
|
-
* Invoked when RCTWebSocketModule.send(...) or sendBinary(...) is called.
|
|
44
|
-
*/
|
|
45
|
-
setSendCallback(callback: (data: string, socketId: number) => void): void;
|
|
46
|
-
/**
|
|
47
|
-
* Invoked when RCTWebSocketModule.connect(...) is called.
|
|
48
|
-
*/
|
|
49
|
-
setConnectCallback(callback: (url: string, protocols: string[] | null, options: string[], socketId: number) => void): void;
|
|
50
|
-
/**
|
|
51
|
-
* Invoked when event "websocketOpen" happens.
|
|
52
|
-
*/
|
|
53
|
-
setOnOpenCallback(callback: (socketId: number) => void): void;
|
|
54
|
-
/**
|
|
55
|
-
* Invoked when event "websocketMessage" happens.
|
|
56
|
-
*/
|
|
57
|
-
setOnMessageCallback(callback: (socketId: number, data: string) => void): void;
|
|
58
|
-
/**
|
|
59
|
-
* Invoked when event "websocketFailed" happens.
|
|
60
|
-
*/
|
|
61
|
-
setOnErrorCallback(callback: (socketId: number, error: string) => void): void;
|
|
62
|
-
/**
|
|
63
|
-
* Invoked when event "websocketClosed" happens.
|
|
64
|
-
*/
|
|
65
|
-
setOnCloseCallback(callback: (socketId: number, error: {
|
|
66
|
-
code: number;
|
|
67
|
-
reason?: string;
|
|
68
|
-
}) => void): void;
|
|
69
|
-
isInterceptorEnabled(): boolean;
|
|
70
|
-
enableInterception(): void;
|
|
71
|
-
disableInterception(): void;
|
|
72
|
-
}
|
|
73
|
-
export declare const getWebSocketInterceptor: () => WebSocketInterceptor;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { RozeniteDevToolsClient } from '@rozenite/plugin-bridge';
|
|
2
|
-
import { WebSocketEventMap } from './websocket-events';
|
|
3
|
-
import { SSEEventMap } from './sse-events';
|
|
4
|
-
import { HttpEventMap } from './http-events';
|
|
5
|
-
export * from './http-events';
|
|
6
|
-
export type NetworkActivityClientUISettings = {
|
|
7
|
-
showUrlAsName?: boolean;
|
|
8
|
-
};
|
|
9
|
-
export type NetworkActivityEventMap = {
|
|
10
|
-
'network-enable': unknown;
|
|
11
|
-
'network-disable': unknown;
|
|
12
|
-
'get-client-ui-settings': unknown;
|
|
13
|
-
'client-ui-settings': {
|
|
14
|
-
settings?: NetworkActivityClientUISettings;
|
|
15
|
-
};
|
|
16
|
-
} & HttpEventMap & WebSocketEventMap & SSEEventMap;
|
|
17
|
-
export type NetworkActivityDevToolsClient = RozeniteDevToolsClient<NetworkActivityEventMap>;
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
export type HttpHeaders = Record<string, string | string[]>;
|
|
2
|
-
export type XHRHeaders = NonNullable<XMLHttpRequest['responseHeaders']>;
|
|
3
|
-
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD';
|
|
4
|
-
export type RequestId = string;
|
|
5
|
-
export type Timestamp = number;
|
|
6
|
-
export type XHRPostData = string | Blob | FormData | ArrayBuffer | ArrayBufferView | unknown | null | undefined;
|
|
7
|
-
export type RequestTextPostData = {
|
|
8
|
-
type: 'text';
|
|
9
|
-
value: string;
|
|
10
|
-
};
|
|
11
|
-
export type RequestBinaryPostData = {
|
|
12
|
-
type: 'binary';
|
|
13
|
-
value: {
|
|
14
|
-
size: number;
|
|
15
|
-
type?: string;
|
|
16
|
-
name?: string;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export type RequestFormDataPostData = {
|
|
20
|
-
type: 'form-data';
|
|
21
|
-
value: Record<string, RequestTextPostData | RequestBinaryPostData>;
|
|
22
|
-
};
|
|
23
|
-
export type RequestPostData = RequestTextPostData | RequestFormDataPostData | RequestBinaryPostData | null | undefined;
|
|
24
|
-
export type Cookie = {
|
|
25
|
-
name: string;
|
|
26
|
-
value: string;
|
|
27
|
-
domain?: string;
|
|
28
|
-
path?: string;
|
|
29
|
-
expires?: string;
|
|
30
|
-
maxAge?: string;
|
|
31
|
-
secure?: boolean;
|
|
32
|
-
httpOnly?: boolean;
|
|
33
|
-
sameSite?: string;
|
|
34
|
-
};
|
|
35
|
-
export type Request = {
|
|
36
|
-
url: string;
|
|
37
|
-
method: HttpMethod;
|
|
38
|
-
headers: HttpHeaders;
|
|
39
|
-
postData?: RequestPostData;
|
|
40
|
-
};
|
|
41
|
-
export type Response = {
|
|
42
|
-
url: string;
|
|
43
|
-
status: number;
|
|
44
|
-
statusText: string;
|
|
45
|
-
headers: HttpHeaders;
|
|
46
|
-
contentType: string;
|
|
47
|
-
size: number | null;
|
|
48
|
-
responseTime: Timestamp;
|
|
49
|
-
};
|
|
50
|
-
export type Initiator = {
|
|
51
|
-
type: string;
|
|
52
|
-
url?: string;
|
|
53
|
-
lineNumber?: number;
|
|
54
|
-
columnNumber?: number;
|
|
55
|
-
};
|
|
56
|
-
export type ResourceType = 'XHR' | 'Fetch' | 'Other';
|
|
57
|
-
export type RequestOverride = {
|
|
58
|
-
status?: number;
|
|
59
|
-
body?: string;
|
|
60
|
-
};
|
|
61
|
-
export type HttpEventMap = {
|
|
62
|
-
'request-sent': {
|
|
63
|
-
requestId: RequestId;
|
|
64
|
-
request: Request;
|
|
65
|
-
timestamp: Timestamp;
|
|
66
|
-
initiator: Initiator;
|
|
67
|
-
type: ResourceType;
|
|
68
|
-
};
|
|
69
|
-
'response-received': {
|
|
70
|
-
requestId: RequestId;
|
|
71
|
-
timestamp: Timestamp;
|
|
72
|
-
type: ResourceType;
|
|
73
|
-
response: Response;
|
|
74
|
-
};
|
|
75
|
-
'request-completed': {
|
|
76
|
-
requestId: RequestId;
|
|
77
|
-
timestamp: Timestamp;
|
|
78
|
-
duration: number;
|
|
79
|
-
size: number | null;
|
|
80
|
-
ttfb: number;
|
|
81
|
-
};
|
|
82
|
-
'request-failed': {
|
|
83
|
-
requestId: RequestId;
|
|
84
|
-
timestamp: Timestamp;
|
|
85
|
-
type: ResourceType;
|
|
86
|
-
error: string;
|
|
87
|
-
canceled: boolean;
|
|
88
|
-
};
|
|
89
|
-
'request-progress': {
|
|
90
|
-
requestId: RequestId;
|
|
91
|
-
timestamp: Timestamp;
|
|
92
|
-
loaded: number;
|
|
93
|
-
total: number;
|
|
94
|
-
lengthComputable: boolean;
|
|
95
|
-
};
|
|
96
|
-
'get-response-body': {
|
|
97
|
-
requestId: RequestId;
|
|
98
|
-
};
|
|
99
|
-
'response-body': {
|
|
100
|
-
requestId: RequestId;
|
|
101
|
-
body: string | null;
|
|
102
|
-
};
|
|
103
|
-
'set-overrides': {
|
|
104
|
-
overrides: [string, RequestOverride][];
|
|
105
|
-
};
|
|
106
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Response } from './http-events';
|
|
2
|
-
export type SSEConnectionStatus = 'connecting' | 'open' | 'closed';
|
|
3
|
-
export type SSERequestId = string;
|
|
4
|
-
export type SSEOpenEvent = {
|
|
5
|
-
type: 'sse-open';
|
|
6
|
-
requestId: SSERequestId;
|
|
7
|
-
timestamp: number;
|
|
8
|
-
response: Response;
|
|
9
|
-
};
|
|
10
|
-
export type SSEMessageEvent = {
|
|
11
|
-
type: 'sse-message';
|
|
12
|
-
requestId: SSERequestId;
|
|
13
|
-
timestamp: number;
|
|
14
|
-
payload: {
|
|
15
|
-
type: string;
|
|
16
|
-
data: string;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export type SSEErrorEvent = {
|
|
20
|
-
type: 'sse-error';
|
|
21
|
-
requestId: SSERequestId;
|
|
22
|
-
timestamp: number;
|
|
23
|
-
error: {
|
|
24
|
-
type: 'error' | 'timeout' | 'exception';
|
|
25
|
-
message: string;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
export type SSECloseEvent = {
|
|
29
|
-
type: 'sse-close';
|
|
30
|
-
requestId: SSERequestId;
|
|
31
|
-
timestamp: number;
|
|
32
|
-
};
|
|
33
|
-
export type SSEEvent = SSEOpenEvent | SSEMessageEvent | SSEErrorEvent | SSECloseEvent;
|
|
34
|
-
export type SSEEventMap = {
|
|
35
|
-
[K in SSEEvent['type']]: Extract<SSEEvent, {
|
|
36
|
-
type: K;
|
|
37
|
-
}>;
|
|
38
|
-
};
|