@caido/sdk-frontend 0.49.1-beta.6 → 0.49.1-beta.7
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/package.json
CHANGED
package/src/types/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { FooterSlot, type FooterSlotContent } from "./types/footer";
|
|
|
2
2
|
export type { DialogOptions } from "./types/window";
|
|
3
3
|
export type { CommandContext } from "./types/commands";
|
|
4
4
|
export type { MenuItem } from "./types/menu";
|
|
5
|
-
export { type ReplayTab, type ReplaySession, type ReplayCollection, ReplaySlot, type ReplaySlotContent, } from "./types/replay";
|
|
5
|
+
export { type ReplayTab, type ReplaySession, type ReplayCollection, type SendRequestOptions, ReplaySlot, type ReplaySlotContent, } from "./types/replay";
|
|
6
6
|
export type { HostedFile } from "./types/files";
|
|
7
7
|
export type { Filter } from "./types/filter";
|
|
8
8
|
export type { HTTPQL, ID, ComponentDefinition } from "./types/utils";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Extension } from "@codemirror/state";
|
|
2
|
-
import { type OpenTabOptions, type ReplayCollection, type ReplaySession, type ReplaySlotContent, type ReplayTab } from "../types/replay";
|
|
2
|
+
import { type OpenTabOptions, type ReplayCollection, type ReplaySession, type ReplaySlotContent, type ReplayTab, type SendRequestOptions } from "../types/replay";
|
|
3
3
|
import { type DefineAddToSlotFn } from "../types/slots";
|
|
4
4
|
import type { ID } from "../types/utils";
|
|
5
5
|
/**
|
|
@@ -103,4 +103,22 @@ export type ReplaySDK = {
|
|
|
103
103
|
* @param extension The extension to add.
|
|
104
104
|
*/
|
|
105
105
|
addRequestEditorExtension: (extension: Extension) => void;
|
|
106
|
+
/**
|
|
107
|
+
* Send a request to the Replay backend.
|
|
108
|
+
* @param request The request to send.
|
|
109
|
+
* @param options The options for sending the request.
|
|
110
|
+
* @example
|
|
111
|
+
* ```ts
|
|
112
|
+
* sendRequest(sessionId, {
|
|
113
|
+
* connectionInfo: {
|
|
114
|
+
* SNI: "example.com",
|
|
115
|
+
* host: "example.com",
|
|
116
|
+
* isTLS: true,
|
|
117
|
+
* port: 443,
|
|
118
|
+
* },
|
|
119
|
+
* raw: "GET / HTTP/1.1\r\nHost: example.com\r\n\r\n",
|
|
120
|
+
* updateContentLength: false,
|
|
121
|
+
* });
|
|
122
|
+
*/
|
|
123
|
+
sendRequest: (sessionId: ID, options: SendRequestOptions) => Promise<void>;
|
|
106
124
|
};
|
|
@@ -7,7 +7,7 @@ export type ShortcutsSDK = {
|
|
|
7
7
|
/**
|
|
8
8
|
* Register a shortcut.
|
|
9
9
|
* @param commandId The id of the command to run when the shortcut is triggered.
|
|
10
|
-
* @param keys The keys of the shortcut. Check out {@link https://
|
|
10
|
+
* @param keys The keys of the shortcut. Check out {@link https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values KeyboardEvent.key} for the list of supported keys.
|
|
11
11
|
*/
|
|
12
12
|
register: (commandId: CommandID, keys: string[]) => void;
|
|
13
13
|
};
|
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent } from "./slots";
|
|
2
2
|
import { type ID } from "./utils";
|
|
3
|
+
/**
|
|
4
|
+
* The slots in the Replay UI.
|
|
5
|
+
* @category Replay
|
|
6
|
+
*/
|
|
3
7
|
export declare const ReplaySlot: {
|
|
8
|
+
/**
|
|
9
|
+
* The left side of the session toolbar.
|
|
10
|
+
*/
|
|
4
11
|
readonly SessionToolbarPrimary: "session-toolbar-primary";
|
|
12
|
+
/**
|
|
13
|
+
* The right side of the session toolbar.
|
|
14
|
+
*/
|
|
5
15
|
readonly SessionToolbarSecondary: "session-toolbar-secondary";
|
|
16
|
+
/**
|
|
17
|
+
* The left side of the topbar.
|
|
18
|
+
*/
|
|
6
19
|
readonly Topbar: "topbar";
|
|
7
20
|
};
|
|
8
21
|
export type ReplaySlot = (typeof ReplaySlot)[keyof typeof ReplaySlot];
|
|
@@ -68,3 +81,40 @@ export type ReplayCollection = {
|
|
|
68
81
|
*/
|
|
69
82
|
sessionIds: ID[];
|
|
70
83
|
};
|
|
84
|
+
/**
|
|
85
|
+
* Options for sending a request.
|
|
86
|
+
* @category Replay
|
|
87
|
+
*/
|
|
88
|
+
export type SendRequestOptions = {
|
|
89
|
+
/**
|
|
90
|
+
* The connection information to use for the request.
|
|
91
|
+
*/
|
|
92
|
+
connectionInfo: {
|
|
93
|
+
/**
|
|
94
|
+
* The host to use for the request.
|
|
95
|
+
*/
|
|
96
|
+
host: string;
|
|
97
|
+
/**
|
|
98
|
+
* The port to use for the request.
|
|
99
|
+
*/
|
|
100
|
+
port: number;
|
|
101
|
+
/**
|
|
102
|
+
* Whether the request is TLS.
|
|
103
|
+
*/
|
|
104
|
+
isTLS: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* The SNI to use for the request.
|
|
107
|
+
* If not provided, the SNI will be inferred from the host.
|
|
108
|
+
*/
|
|
109
|
+
SNI?: string;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* The raw request to send.
|
|
113
|
+
*/
|
|
114
|
+
raw: string;
|
|
115
|
+
/**
|
|
116
|
+
* Whether to update the content length automatically to match the body.
|
|
117
|
+
* Defaults to true.
|
|
118
|
+
*/
|
|
119
|
+
updateContentLength?: boolean;
|
|
120
|
+
};
|