@caido/sdk-frontend 0.37.0 → 0.38.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.
@@ -21,5 +21,35 @@ type CommandContextRequestRow = {
21
21
  isTls: boolean;
22
22
  }[];
23
23
  };
24
- export type CommandContext = CommandContextBase | CommandContextRequestRow;
24
+ type CommandContextRequest = {
25
+ type: "RequestContext";
26
+ request: {
27
+ host: string;
28
+ port: number;
29
+ path: string;
30
+ query: string;
31
+ isTls: boolean;
32
+ raw: string;
33
+ };
34
+ selection: string;
35
+ };
36
+ type CommandContextResponse = {
37
+ type: "ResponseContext";
38
+ request: {
39
+ id: string;
40
+ host: string;
41
+ port: number;
42
+ path: string;
43
+ query: string;
44
+ isTls: boolean;
45
+ };
46
+ response: {
47
+ id: string;
48
+ raw: string;
49
+ statusCode: number;
50
+ roundtripTime: number;
51
+ };
52
+ selection: string;
53
+ };
54
+ export type CommandContext = CommandContextBase | CommandContextRequestRow | CommandContextRequest | CommandContextResponse;
25
55
  export {};
@@ -1,12 +1,22 @@
1
1
  export type Menu = {
2
2
  registerItem: (item: MenuItem) => void;
3
3
  };
4
- type MenuItem = RequestRowMenuItem | SettingsMenuItem;
4
+ type MenuItem = RequestRowMenuItem | SettingsMenuItem | RequestMenuItem | ResponseMenuItem;
5
5
  type RequestRowMenuItem = {
6
6
  type: "RequestRow";
7
7
  commandId: string;
8
8
  leadingIcon?: string;
9
9
  };
10
+ type RequestMenuItem = {
11
+ type: "Request";
12
+ commandId: string;
13
+ leadingIcon?: string;
14
+ };
15
+ type ResponseMenuItem = {
16
+ type: "Response";
17
+ commandId: string;
18
+ leadingIcon?: string;
19
+ };
10
20
  type SettingsMenuItem = {
11
21
  type: "Settings";
12
22
  label: string;
@@ -1,5 +1,10 @@
1
1
  export type Window = {
2
2
  getActiveEditor: () => Editor | undefined;
3
+ showToast: (message: string, options?: ToastOptions) => void;
4
+ };
5
+ type ToastOptions = {
6
+ variant?: "success" | "error" | "warning" | "info";
7
+ duration?: number;
3
8
  };
4
9
  type Editor = {
5
10
  getSelectedText: () => string;