@caido/sdk-frontend 0.49.1-beta.2 → 0.49.1-beta.4
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 +1 -1
- package/src/types/index.d.ts +17 -151
- package/src/types/{assets.d.ts → sdks/assets.d.ts} +1 -11
- package/src/types/{backend.d.ts → sdks/backend.d.ts} +2 -15
- package/src/types/{commandPalette.d.ts → sdks/commandPalette.d.ts} +2 -2
- package/src/types/sdks/commands.d.ts +31 -0
- package/src/types/{environment.d.ts → sdks/environment.d.ts} +1 -14
- package/src/types/{files.d.ts → sdks/files.d.ts} +1 -30
- package/src/types/{filters.d.ts → sdks/filters.d.ts} +2 -24
- package/src/types/{findings.d.ts → sdks/findings.d.ts} +2 -32
- package/src/types/{footer.d.ts → sdks/footer.d.ts} +3 -10
- package/src/types/{httpHistory.d.ts → sdks/httpHistory.d.ts} +2 -2
- package/src/types/sdks/index.d.ts +137 -0
- package/src/types/{intercept.d.ts → sdks/intercept.d.ts} +1 -1
- package/src/types/sdks/matchReplace.d.ts +87 -0
- package/src/types/sdks/menu.d.ts +21 -0
- package/src/types/{replay.d.ts → sdks/replay.d.ts} +4 -59
- package/src/types/{scopes.d.ts → sdks/scopes.d.ts} +2 -23
- package/src/types/{search.d.ts → sdks/search.d.ts} +1 -1
- package/src/types/{shortcuts.d.ts → sdks/shortcuts.d.ts} +1 -1
- package/src/types/{sidebar.d.ts → sdks/sidebar.d.ts} +2 -13
- package/src/types/{sitemap.d.ts → sdks/sitemap.d.ts} +1 -1
- package/src/types/{storage.d.ts → sdks/storage.d.ts} +1 -1
- package/src/types/{ui.d.ts → sdks/ui.d.ts} +2 -2
- package/src/types/{window.d.ts → sdks/window.d.ts} +4 -11
- package/src/types/{workflows.d.ts → sdks/workflows.d.ts} +2 -25
- package/src/types/types/assets.d.ts +10 -0
- package/src/types/types/backend.d.ts +14 -0
- package/src/types/{commands.d.ts → types/commands.d.ts} +5 -28
- package/src/types/types/environment.d.ts +14 -0
- package/src/types/types/files.d.ts +30 -0
- package/src/types/types/filter.d.ts +24 -0
- package/src/types/types/findings.d.ts +31 -0
- package/src/types/types/footer.d.ts +10 -0
- package/src/types/types/json.d.ts +9 -0
- package/src/types/{matchReplace.d.ts → types/matchReplace.d.ts} +1 -86
- package/src/types/{menu.d.ts → types/menu.d.ts} +2 -21
- package/src/types/types/replay.d.ts +59 -0
- package/src/types/{request.d.ts → types/request.d.ts} +2 -2
- package/src/types/types/scopes.d.ts +23 -0
- package/src/types/types/sidebar.d.ts +11 -0
- package/src/types/{slots.d.ts → types/slots.d.ts} +4 -4
- package/src/types/{utils.d.ts → types/utils.d.ts} +9 -15
- package/src/types/types/window.d.ts +8 -0
- package/src/types/types/workflows.d.ts +25 -0
- /package/src/types/{navigation.d.ts → sdks/navigation.d.ts} +0 -0
- /package/src/types/{runtime.d.ts → sdks/runtime.d.ts} +0 -0
- /package/src/types/{editor.d.ts → types/editor.d.ts} +0 -0
package/package.json
CHANGED
package/src/types/index.d.ts
CHANGED
|
@@ -1,151 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
import type { ScopesSDK } from "./scopes";
|
|
19
|
-
import type { SearchSDK } from "./search";
|
|
20
|
-
import type { ShortcutsSDK } from "./shortcuts";
|
|
21
|
-
import type { SidebarSDK } from "./sidebar";
|
|
22
|
-
import type { SitemapSDK } from "./sitemap";
|
|
23
|
-
import type { StorageSDK } from "./storage";
|
|
24
|
-
import type { UISDK } from "./ui";
|
|
25
|
-
import type { WindowSDK } from "./window";
|
|
26
|
-
import type { WorkflowSDK } from "./workflows";
|
|
27
|
-
export { FooterSlot } from "./footer";
|
|
28
|
-
export type { DialogOptions } from "./window";
|
|
29
|
-
export type { CommandContext } from "./commands";
|
|
30
|
-
export type { MenuItem } from "./menu";
|
|
31
|
-
export { type ReplayTab, type ReplaySession, type ReplayCollection, ReplaySlot, } from "./replay";
|
|
32
|
-
export type { HostedFile } from "./files";
|
|
33
|
-
export type { Filter } from "./filters";
|
|
34
|
-
export type { HTTPQL, ID, JSONValue, JSONCompatible } from "./utils";
|
|
35
|
-
export type { SlotContent, ButtonSlotContent, CustomSlotContent, CommandSlotContent, } from "./slots";
|
|
36
|
-
export type { RequestViewModeOptions } from "./request";
|
|
37
|
-
export type { MatchReplaceRule, MatchReplaceCollection, MatchReplaceSection, MatchReplaceSectionRequestBody, MatchReplaceSectionRequestFirstLine, MatchReplaceSectionRequestHeader, MatchReplaceSectionRequestMethod, MatchReplaceSectionRequestPath, MatchReplaceSectionRequestQuery, MatchReplaceSectionResponseBody, MatchReplaceSectionResponseFirstLine, MatchReplaceSectionResponseHeader, MatchReplaceSectionResponseStatusCode, MatchReplaceOperationStatusCode, MatchReplaceOperationStatusCodeUpdate, MatchReplaceOperationQuery, MatchReplaceOperationQueryRaw, MatchReplaceOperationQueryAdd, MatchReplaceOperationQueryRemove, MatchReplaceOperationQueryUpdate, MatchReplaceOperationPath, MatchReplaceOperationPathRaw, MatchReplaceOperationMethod, MatchReplaceOperationMethodUpdate, MatchReplaceOperationHeader, MatchReplaceOperationHeaderRaw, MatchReplaceOperationHeaderAdd, MatchReplaceOperationHeaderRemove, MatchReplaceOperationHeaderUpdate, MatchReplaceOperationBody, MatchReplaceOperationBodyRaw, MatchReplaceOperationFirstLine, MatchReplaceOperationFirstLineRaw, MatchReplaceReplacer, MatchReplaceReplacerTerm, MatchReplaceReplacerWorkflow, MatchReplaceMatcherName, MatchReplaceMatcherRaw, MatchReplaceMatcherRawFull, MatchReplaceMatcherRawRegex, MatchReplaceMatcherRawValue, } from "./matchReplace";
|
|
38
|
-
export type { Scope } from "./scopes";
|
|
39
|
-
export type { EnvironmentVariable } from "./environment";
|
|
40
|
-
export type { Workflow, WorkflowKind, OnCreatedWorkflowCallback, OnUpdatedWorkflowCallback, OnDeletedWorkflowCallback, } from "./workflows";
|
|
41
|
-
export type { ListenerHandle } from "./utils";
|
|
42
|
-
/**
|
|
43
|
-
* Utilities for frontend plugins.
|
|
44
|
-
* @category SDK
|
|
45
|
-
*/
|
|
46
|
-
export type API<T extends BackendEndpoints = Record<string, never>, E extends BackendEvents = Record<string, never>> = {
|
|
47
|
-
/**
|
|
48
|
-
* Utilities to interact with the GraphQL API.
|
|
49
|
-
*/
|
|
50
|
-
graphql: GraphqlSDK;
|
|
51
|
-
/**
|
|
52
|
-
* Utilities to interact with the backend plugin.
|
|
53
|
-
*/
|
|
54
|
-
backend: BackendSDK<T, E>;
|
|
55
|
-
/**
|
|
56
|
-
* Utilities to create UI components.
|
|
57
|
-
*/
|
|
58
|
-
ui: UISDK;
|
|
59
|
-
/**
|
|
60
|
-
* Utilities to interact with scopes
|
|
61
|
-
*/
|
|
62
|
-
scopes: ScopesSDK;
|
|
63
|
-
/**
|
|
64
|
-
* Utilities to interact with findings
|
|
65
|
-
*/
|
|
66
|
-
findings: FindingsSDK;
|
|
67
|
-
/**
|
|
68
|
-
* Utilities to interact with commands
|
|
69
|
-
*/
|
|
70
|
-
commands: CommandsSDK;
|
|
71
|
-
/**
|
|
72
|
-
* Utilities to insert menu items and context-menus throughout the UI.
|
|
73
|
-
*/
|
|
74
|
-
menu: MenuSDK;
|
|
75
|
-
/**
|
|
76
|
-
* Utilities to interact with navigation.
|
|
77
|
-
*/
|
|
78
|
-
navigation: NavigationSDK;
|
|
79
|
-
/**
|
|
80
|
-
* Utilities to interact with the active page.
|
|
81
|
-
*/
|
|
82
|
-
window: WindowSDK;
|
|
83
|
-
/**
|
|
84
|
-
* Utilities to interact with frontend-plugin storage.
|
|
85
|
-
*/
|
|
86
|
-
storage: StorageSDK;
|
|
87
|
-
/**
|
|
88
|
-
* Utilities to interact with the plugin's static assets.
|
|
89
|
-
*/
|
|
90
|
-
assets: AssetsSDK;
|
|
91
|
-
/**
|
|
92
|
-
* Utilities to interact with shortcuts.
|
|
93
|
-
*/
|
|
94
|
-
shortcuts: ShortcutsSDK;
|
|
95
|
-
/**
|
|
96
|
-
* Utilities to interact with the command palette.
|
|
97
|
-
*/
|
|
98
|
-
commandPalette: CommandPaletteSDK;
|
|
99
|
-
/**
|
|
100
|
-
* Utilities to interact with the sidebar.
|
|
101
|
-
*/
|
|
102
|
-
sidebar: SidebarSDK;
|
|
103
|
-
/**
|
|
104
|
-
* Utilities to interact with the Replay page.
|
|
105
|
-
*/
|
|
106
|
-
replay: ReplaySDK;
|
|
107
|
-
/**
|
|
108
|
-
* Utilities to interact with the Search page.
|
|
109
|
-
*/
|
|
110
|
-
search: SearchSDK;
|
|
111
|
-
/**
|
|
112
|
-
* Utilities to interact with the HTTP History page.
|
|
113
|
-
*/
|
|
114
|
-
httpHistory: HTTPHistorySDK;
|
|
115
|
-
/**
|
|
116
|
-
* Utilities to interact with the Files page.
|
|
117
|
-
*/
|
|
118
|
-
files: FilesSDK;
|
|
119
|
-
/**
|
|
120
|
-
* Utilities to interact with Filters page.
|
|
121
|
-
*/
|
|
122
|
-
filters: FiltersSDK;
|
|
123
|
-
/**
|
|
124
|
-
* Utilities to interact with Match and Replace page.
|
|
125
|
-
*/
|
|
126
|
-
matchReplace: MatchReplaceSDK;
|
|
127
|
-
/**
|
|
128
|
-
* Utilities to interact with the environment.
|
|
129
|
-
*/
|
|
130
|
-
env: EnvironmentSDK;
|
|
131
|
-
/**
|
|
132
|
-
* Utilities to interact with the Sitemap page.
|
|
133
|
-
*/
|
|
134
|
-
sitemap: SitemapSDK;
|
|
135
|
-
/**
|
|
136
|
-
* Utilities to interact with the Intercept page.
|
|
137
|
-
*/
|
|
138
|
-
intercept: InterceptSDK;
|
|
139
|
-
/**
|
|
140
|
-
* Utilities to interact with the runtime.
|
|
141
|
-
*/
|
|
142
|
-
runtime: RuntimeSDK;
|
|
143
|
-
/**
|
|
144
|
-
* Utilities to interact with workflows.
|
|
145
|
-
*/
|
|
146
|
-
workflows: WorkflowSDK;
|
|
147
|
-
/**
|
|
148
|
-
* Utilities to interact with the footer.
|
|
149
|
-
*/
|
|
150
|
-
footer: FooterSDK;
|
|
151
|
-
};
|
|
1
|
+
export { FooterSlot, type FooterSlotContent } from "./types/footer";
|
|
2
|
+
export type { DialogOptions } from "./types/window";
|
|
3
|
+
export type { CommandContext } from "./types/commands";
|
|
4
|
+
export type { MenuItem } from "./types/menu";
|
|
5
|
+
export { type ReplayTab, type ReplaySession, type ReplayCollection, ReplaySlot, type ReplaySlotContent, } from "./types/replay";
|
|
6
|
+
export type { HostedFile } from "./types/files";
|
|
7
|
+
export type { Filter } from "./types/filter";
|
|
8
|
+
export type { HTTPQL, ID, ComponentDefinition } from "./types/utils";
|
|
9
|
+
export type { JSONValue, JSONCompatible } from "./types/json";
|
|
10
|
+
export type { SlotContent, ButtonSlotContent, CustomSlotContent, CommandSlotContent, } from "./types/slots";
|
|
11
|
+
export type { RequestViewModeOptions } from "./types/request";
|
|
12
|
+
export type { MatchReplaceRule, MatchReplaceCollection, MatchReplaceSection, MatchReplaceSectionRequestBody, MatchReplaceSectionRequestFirstLine, MatchReplaceSectionRequestHeader, MatchReplaceSectionRequestMethod, MatchReplaceSectionRequestPath, MatchReplaceSectionRequestQuery, MatchReplaceSectionResponseBody, MatchReplaceSectionResponseFirstLine, MatchReplaceSectionResponseHeader, MatchReplaceSectionResponseStatusCode, MatchReplaceOperationStatusCode, MatchReplaceOperationStatusCodeUpdate, MatchReplaceOperationQuery, MatchReplaceOperationQueryRaw, MatchReplaceOperationQueryAdd, MatchReplaceOperationQueryRemove, MatchReplaceOperationQueryUpdate, MatchReplaceOperationPath, MatchReplaceOperationPathRaw, MatchReplaceOperationMethod, MatchReplaceOperationMethodUpdate, MatchReplaceOperationHeader, MatchReplaceOperationHeaderRaw, MatchReplaceOperationHeaderAdd, MatchReplaceOperationHeaderRemove, MatchReplaceOperationHeaderUpdate, MatchReplaceOperationBody, MatchReplaceOperationBodyRaw, MatchReplaceOperationFirstLine, MatchReplaceOperationFirstLineRaw, MatchReplaceReplacer, MatchReplaceReplacerTerm, MatchReplaceReplacerWorkflow, MatchReplaceMatcherName, MatchReplaceMatcherRaw, MatchReplaceMatcherRawFull, MatchReplaceMatcherRawRegex, MatchReplaceMatcherRawValue, } from "./types/matchReplace";
|
|
13
|
+
export type { Scope } from "./types/scopes";
|
|
14
|
+
export type { EnvironmentVariable } from "./types/environment";
|
|
15
|
+
export type { Workflow, WorkflowKind, OnCreatedWorkflowCallback, OnUpdatedWorkflowCallback, OnDeletedWorkflowCallback, } from "./types/workflows";
|
|
16
|
+
export type { ListenerHandle } from "./types/utils";
|
|
17
|
+
export type { API } from "./sdks";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Asset } from "../types/assets";
|
|
1
2
|
/**
|
|
2
3
|
* Utilities to interact with the plugin's static assets.
|
|
3
4
|
* @category Files
|
|
@@ -9,14 +10,3 @@ export type AssetsSDK = {
|
|
|
9
10
|
*/
|
|
10
11
|
get: (path: string) => Promise<Asset>;
|
|
11
12
|
};
|
|
12
|
-
/**
|
|
13
|
-
* A static asset.
|
|
14
|
-
* @category Files
|
|
15
|
-
*/
|
|
16
|
-
type Asset = {
|
|
17
|
-
asReadableStream: () => ReadableStream;
|
|
18
|
-
asArrayBuffer: () => Promise<ArrayBuffer>;
|
|
19
|
-
asString: () => Promise<string>;
|
|
20
|
-
asJson: <T = unknown>() => Promise<T>;
|
|
21
|
-
};
|
|
22
|
-
export {};
|
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
* Endpoints provided by the backend plugin.
|
|
4
|
-
* @category Backend
|
|
5
|
-
*/
|
|
6
|
-
export type BackendEndpoints = {
|
|
7
|
-
[key: string]: (...args: any[]) => any;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Events emitted by the backend plugin.
|
|
11
|
-
* @category Backend
|
|
12
|
-
*/
|
|
13
|
-
export type BackendEvents = {
|
|
14
|
-
[key: string]: (...args: any[]) => void;
|
|
15
|
-
};
|
|
1
|
+
import { type BackendEndpoints, type BackendEvents } from "../types/backend";
|
|
2
|
+
import type { PromisifiedReturnType } from "../types/utils";
|
|
16
3
|
/**
|
|
17
4
|
* Utilities to interact with the backend plugin.
|
|
18
5
|
* @category Backend
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type CommandID } from "../types/commands";
|
|
1
2
|
/**
|
|
2
3
|
* Utilities to interact with the command palette.
|
|
3
4
|
* @category Command Palette
|
|
@@ -5,8 +6,7 @@
|
|
|
5
6
|
export type CommandPaletteSDK = {
|
|
6
7
|
/**
|
|
7
8
|
* Register a command.
|
|
8
|
-
* @deprecated Use `sdk.commandPalette.addToSlot` instead.
|
|
9
9
|
* @param commandId The id of the command to register.
|
|
10
10
|
*/
|
|
11
|
-
register: (commandId:
|
|
11
|
+
register: (commandId: CommandID) => void;
|
|
12
12
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CommandContext, CommandID } from "../types/commands";
|
|
2
|
+
/**
|
|
3
|
+
* Utilities to interact with commands
|
|
4
|
+
* @category Commands
|
|
5
|
+
*/
|
|
6
|
+
export type CommandsSDK = {
|
|
7
|
+
/**
|
|
8
|
+
* Register a command.
|
|
9
|
+
* @param id The id of the command.
|
|
10
|
+
* @param options Options for the command.
|
|
11
|
+
* @param options.name The name of the command.
|
|
12
|
+
* @param options.run The function to run when the command is executed.
|
|
13
|
+
* @param options.group The group this command belongs to.
|
|
14
|
+
* @param options.when A function to determine if the command is available.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* sdk.commands.register("hello", {
|
|
19
|
+
* name: "Print to console.",
|
|
20
|
+
* run: () => console.log("Hello world!"),
|
|
21
|
+
* group: "Custom Commands",
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
register: (id: CommandID, options: {
|
|
26
|
+
name: string;
|
|
27
|
+
run: (context: CommandContext) => Promise<void> | void;
|
|
28
|
+
group?: string;
|
|
29
|
+
when?: (context: CommandContext) => Promise<boolean> | boolean;
|
|
30
|
+
}) => void;
|
|
31
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type EnvironmentVariable } from "../types/environment";
|
|
1
2
|
/**
|
|
2
3
|
* Utilities to interact with the environment.
|
|
3
4
|
* @category Environment
|
|
@@ -15,17 +16,3 @@ export type EnvironmentSDK = {
|
|
|
15
16
|
*/
|
|
16
17
|
getVars: () => EnvironmentVariable[];
|
|
17
18
|
};
|
|
18
|
-
export type EnvironmentVariable = {
|
|
19
|
-
/**
|
|
20
|
-
* The name of the environment variable.
|
|
21
|
-
*/
|
|
22
|
-
name: string;
|
|
23
|
-
/**
|
|
24
|
-
* The value of the environment variable.
|
|
25
|
-
*/
|
|
26
|
-
value: string;
|
|
27
|
-
/**
|
|
28
|
-
* Whether the environment variable is a secret.
|
|
29
|
-
*/
|
|
30
|
-
isSecret: boolean;
|
|
31
|
-
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type HostedFile } from "../types/files";
|
|
1
2
|
/**
|
|
2
3
|
* SDK for interacting with the Files page.
|
|
3
4
|
* @category Files
|
|
@@ -28,33 +29,3 @@ export type FilesSDK = {
|
|
|
28
29
|
*/
|
|
29
30
|
delete: (id: string) => Promise<void>;
|
|
30
31
|
};
|
|
31
|
-
/**
|
|
32
|
-
* A hosted file.
|
|
33
|
-
* @category Files
|
|
34
|
-
*/
|
|
35
|
-
export type HostedFile = {
|
|
36
|
-
/**
|
|
37
|
-
* The ID of the file.
|
|
38
|
-
*/
|
|
39
|
-
id: string;
|
|
40
|
-
/**
|
|
41
|
-
* The name of the file.
|
|
42
|
-
*/
|
|
43
|
-
name: string;
|
|
44
|
-
/**
|
|
45
|
-
* The size of the file in bytes.
|
|
46
|
-
*/
|
|
47
|
-
size: number;
|
|
48
|
-
/**
|
|
49
|
-
* The path of the file.
|
|
50
|
-
*/
|
|
51
|
-
path: string;
|
|
52
|
-
/**
|
|
53
|
-
* The date the file was created.
|
|
54
|
-
*/
|
|
55
|
-
createdAt: Date;
|
|
56
|
-
/**
|
|
57
|
-
* The date the file was updated.
|
|
58
|
-
*/
|
|
59
|
-
updatedAt: Date;
|
|
60
|
-
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type Filter } from "../types/filter";
|
|
2
|
+
import type { HTTPQL, ID } from "../types/utils";
|
|
2
3
|
/**
|
|
3
4
|
* SDK for interacting with the Filters page.
|
|
4
5
|
* @category Filters
|
|
@@ -45,26 +46,3 @@ export type FiltersSDK = {
|
|
|
45
46
|
*/
|
|
46
47
|
delete: (id: ID) => Promise<void>;
|
|
47
48
|
};
|
|
48
|
-
/**
|
|
49
|
-
* Represents a filter.
|
|
50
|
-
* @category Filters
|
|
51
|
-
*/
|
|
52
|
-
export type Filter = {
|
|
53
|
-
/**
|
|
54
|
-
* The ID of the filter.
|
|
55
|
-
*/
|
|
56
|
-
id: ID;
|
|
57
|
-
/**
|
|
58
|
-
* The name of the filter.
|
|
59
|
-
*/
|
|
60
|
-
name: string;
|
|
61
|
-
/**
|
|
62
|
-
* The alias of the filter.
|
|
63
|
-
* This alias is used when referencing the filter in an HTTPQL query (e.g. `preset:my-alias`).
|
|
64
|
-
*/
|
|
65
|
-
alias: string;
|
|
66
|
-
/**
|
|
67
|
-
* The HTTPQL expression of the filter.
|
|
68
|
-
*/
|
|
69
|
-
query: HTTPQL;
|
|
70
|
-
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Finding } from "../types/findings";
|
|
2
|
+
import type { ID } from "../types/utils";
|
|
2
3
|
/**
|
|
3
4
|
* Utilities to interact with findings
|
|
4
5
|
* @category Findings
|
|
@@ -21,34 +22,3 @@ export type FindingsSDK = {
|
|
|
21
22
|
dedupeKey?: string;
|
|
22
23
|
}) => Promise<Finding | undefined>;
|
|
23
24
|
};
|
|
24
|
-
/**
|
|
25
|
-
* Represents a {@link https://docs.caido.io/reference/features/logging/findings|Finding}.
|
|
26
|
-
* @category Findings
|
|
27
|
-
*/
|
|
28
|
-
type Finding = {
|
|
29
|
-
/**
|
|
30
|
-
* The ID of the finding.
|
|
31
|
-
*/
|
|
32
|
-
id: ID;
|
|
33
|
-
/**
|
|
34
|
-
* The title of the finding.
|
|
35
|
-
*/
|
|
36
|
-
title: string;
|
|
37
|
-
/**
|
|
38
|
-
* The description of the finding.
|
|
39
|
-
*/
|
|
40
|
-
description?: string;
|
|
41
|
-
/**
|
|
42
|
-
* The reporter of the finding.
|
|
43
|
-
*/
|
|
44
|
-
reporter: string;
|
|
45
|
-
/**
|
|
46
|
-
* The host of the request attached to this finding
|
|
47
|
-
*/
|
|
48
|
-
host: string;
|
|
49
|
-
/**
|
|
50
|
-
* The path of the request attached to this finding
|
|
51
|
-
*/
|
|
52
|
-
path: string;
|
|
53
|
-
};
|
|
54
|
-
export {};
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
|
|
3
|
-
readonly FooterSlotPrimary: "footer-primary";
|
|
4
|
-
readonly FooterSlotSecondary: "footer-secondary";
|
|
5
|
-
};
|
|
6
|
-
export type FooterSlot = (typeof FooterSlot)[keyof typeof FooterSlot];
|
|
1
|
+
import { type FooterSlotContent } from "../types/footer";
|
|
2
|
+
import { type DefineAddToSlotFn } from "../types/slots";
|
|
7
3
|
/**
|
|
8
4
|
* Utilities to interact with the footer.
|
|
9
5
|
* @category Footer
|
|
@@ -36,8 +32,5 @@ export type FooterSDK = {
|
|
|
36
32
|
* });
|
|
37
33
|
* ```
|
|
38
34
|
*/
|
|
39
|
-
addToSlot: DefineAddToSlotFn<
|
|
40
|
-
[FooterSlot.FooterSlotPrimary]: ButtonSlotContent | CustomSlotContent | CommandSlotContent;
|
|
41
|
-
[FooterSlot.FooterSlotSecondary]: ButtonSlotContent | CustomSlotContent | CommandSlotContent;
|
|
42
|
-
}>;
|
|
35
|
+
addToSlot: DefineAddToSlotFn<FooterSlotContent>;
|
|
43
36
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Extension } from "@codemirror/state";
|
|
2
|
-
import type { RequestViewModeOptions } from "
|
|
3
|
-
import type { HTTPQL, ID } from "
|
|
2
|
+
import type { RequestViewModeOptions } from "../types/request";
|
|
3
|
+
import type { HTTPQL, ID } from "../types/utils";
|
|
4
4
|
/**
|
|
5
5
|
* Utilities to interact with the HTTP History page.
|
|
6
6
|
* @category HTTP History
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import type { Sdk as GraphqlSDK } from "../__generated__/graphql-sdk";
|
|
2
|
+
import { type BackendEndpoints, type BackendEvents } from "../types/backend";
|
|
3
|
+
import type { AssetsSDK } from "./assets";
|
|
4
|
+
import type { BackendSDK } from "./backend";
|
|
5
|
+
import type { CommandPaletteSDK } from "./commandPalette";
|
|
6
|
+
import type { CommandsSDK } from "./commands";
|
|
7
|
+
import type { EnvironmentSDK } from "./environment";
|
|
8
|
+
import type { FilesSDK } from "./files";
|
|
9
|
+
import type { FiltersSDK } from "./filters";
|
|
10
|
+
import type { FindingsSDK } from "./findings";
|
|
11
|
+
import type { FooterSDK } from "./footer";
|
|
12
|
+
import type { HTTPHistorySDK } from "./httpHistory";
|
|
13
|
+
import type { InterceptSDK } from "./intercept";
|
|
14
|
+
import type { MatchReplaceSDK } from "./matchReplace";
|
|
15
|
+
import type { MenuSDK } from "./menu";
|
|
16
|
+
import type { NavigationSDK } from "./navigation";
|
|
17
|
+
import type { ReplaySDK } from "./replay";
|
|
18
|
+
import type { RuntimeSDK } from "./runtime";
|
|
19
|
+
import type { ScopesSDK } from "./scopes";
|
|
20
|
+
import type { SearchSDK } from "./search";
|
|
21
|
+
import type { ShortcutsSDK } from "./shortcuts";
|
|
22
|
+
import type { SidebarSDK } from "./sidebar";
|
|
23
|
+
import type { SitemapSDK } from "./sitemap";
|
|
24
|
+
import type { StorageSDK } from "./storage";
|
|
25
|
+
import type { UISDK } from "./ui";
|
|
26
|
+
import type { WindowSDK } from "./window";
|
|
27
|
+
import type { WorkflowSDK } from "./workflows";
|
|
28
|
+
/**
|
|
29
|
+
* Utilities for frontend plugins.
|
|
30
|
+
* @category SDK
|
|
31
|
+
*/
|
|
32
|
+
export type API<T extends BackendEndpoints = Record<string, never>, E extends BackendEvents = Record<string, never>> = {
|
|
33
|
+
/**
|
|
34
|
+
* Utilities to interact with the GraphQL API.
|
|
35
|
+
*/
|
|
36
|
+
graphql: GraphqlSDK;
|
|
37
|
+
/**
|
|
38
|
+
* Utilities to interact with the backend plugin.
|
|
39
|
+
*/
|
|
40
|
+
backend: BackendSDK<T, E>;
|
|
41
|
+
/**
|
|
42
|
+
* Utilities to create UI components.
|
|
43
|
+
*/
|
|
44
|
+
ui: UISDK;
|
|
45
|
+
/**
|
|
46
|
+
* Utilities to interact with scopes
|
|
47
|
+
*/
|
|
48
|
+
scopes: ScopesSDK;
|
|
49
|
+
/**
|
|
50
|
+
* Utilities to interact with findings
|
|
51
|
+
*/
|
|
52
|
+
findings: FindingsSDK;
|
|
53
|
+
/**
|
|
54
|
+
* Utilities to interact with commands
|
|
55
|
+
*/
|
|
56
|
+
commands: CommandsSDK;
|
|
57
|
+
/**
|
|
58
|
+
* Utilities to insert menu items and context-menus throughout the UI.
|
|
59
|
+
*/
|
|
60
|
+
menu: MenuSDK;
|
|
61
|
+
/**
|
|
62
|
+
* Utilities to interact with navigation.
|
|
63
|
+
*/
|
|
64
|
+
navigation: NavigationSDK;
|
|
65
|
+
/**
|
|
66
|
+
* Utilities to interact with the active page.
|
|
67
|
+
*/
|
|
68
|
+
window: WindowSDK;
|
|
69
|
+
/**
|
|
70
|
+
* Utilities to interact with frontend-plugin storage.
|
|
71
|
+
*/
|
|
72
|
+
storage: StorageSDK;
|
|
73
|
+
/**
|
|
74
|
+
* Utilities to interact with the plugin's static assets.
|
|
75
|
+
*/
|
|
76
|
+
assets: AssetsSDK;
|
|
77
|
+
/**
|
|
78
|
+
* Utilities to interact with shortcuts.
|
|
79
|
+
*/
|
|
80
|
+
shortcuts: ShortcutsSDK;
|
|
81
|
+
/**
|
|
82
|
+
* Utilities to interact with the command palette.
|
|
83
|
+
*/
|
|
84
|
+
commandPalette: CommandPaletteSDK;
|
|
85
|
+
/**
|
|
86
|
+
* Utilities to interact with the sidebar.
|
|
87
|
+
*/
|
|
88
|
+
sidebar: SidebarSDK;
|
|
89
|
+
/**
|
|
90
|
+
* Utilities to interact with the Replay page.
|
|
91
|
+
*/
|
|
92
|
+
replay: ReplaySDK;
|
|
93
|
+
/**
|
|
94
|
+
* Utilities to interact with the Search page.
|
|
95
|
+
*/
|
|
96
|
+
search: SearchSDK;
|
|
97
|
+
/**
|
|
98
|
+
* Utilities to interact with the HTTP History page.
|
|
99
|
+
*/
|
|
100
|
+
httpHistory: HTTPHistorySDK;
|
|
101
|
+
/**
|
|
102
|
+
* Utilities to interact with the Files page.
|
|
103
|
+
*/
|
|
104
|
+
files: FilesSDK;
|
|
105
|
+
/**
|
|
106
|
+
* Utilities to interact with Filters page.
|
|
107
|
+
*/
|
|
108
|
+
filters: FiltersSDK;
|
|
109
|
+
/**
|
|
110
|
+
* Utilities to interact with Match and Replace page.
|
|
111
|
+
*/
|
|
112
|
+
matchReplace: MatchReplaceSDK;
|
|
113
|
+
/**
|
|
114
|
+
* Utilities to interact with the environment.
|
|
115
|
+
*/
|
|
116
|
+
env: EnvironmentSDK;
|
|
117
|
+
/**
|
|
118
|
+
* Utilities to interact with the Sitemap page.
|
|
119
|
+
*/
|
|
120
|
+
sitemap: SitemapSDK;
|
|
121
|
+
/**
|
|
122
|
+
* Utilities to interact with the Intercept page.
|
|
123
|
+
*/
|
|
124
|
+
intercept: InterceptSDK;
|
|
125
|
+
/**
|
|
126
|
+
* Utilities to interact with the runtime.
|
|
127
|
+
*/
|
|
128
|
+
runtime: RuntimeSDK;
|
|
129
|
+
/**
|
|
130
|
+
* Utilities to interact with workflows.
|
|
131
|
+
*/
|
|
132
|
+
workflows: WorkflowSDK;
|
|
133
|
+
/**
|
|
134
|
+
* Utilities to interact with the footer.
|
|
135
|
+
*/
|
|
136
|
+
footer: FooterSDK;
|
|
137
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { type MatchReplaceCollection, type MatchReplaceRule, type MatchReplaceSection } from "../types/matchReplace";
|
|
2
|
+
import type { HTTPQL, ID } from "../types/utils";
|
|
3
|
+
/**
|
|
4
|
+
* Utilities to interact with the Match and Replace page.
|
|
5
|
+
* @category Match and Replace
|
|
6
|
+
*/
|
|
7
|
+
export type MatchReplaceSDK = {
|
|
8
|
+
/**
|
|
9
|
+
* Get all collections.
|
|
10
|
+
*/
|
|
11
|
+
getCollections: () => MatchReplaceCollection[];
|
|
12
|
+
/**
|
|
13
|
+
* Create a collection.
|
|
14
|
+
* @param options - The options for the collection.
|
|
15
|
+
* @param options.name - The name of the collection.
|
|
16
|
+
*/
|
|
17
|
+
createCollection: (options: {
|
|
18
|
+
name: string;
|
|
19
|
+
}) => Promise<MatchReplaceCollection>;
|
|
20
|
+
/**
|
|
21
|
+
* Update a collection.
|
|
22
|
+
* @param id - The ID of the collection.
|
|
23
|
+
* @param options - The new values for the collection.
|
|
24
|
+
* @param options.name - The new name of the collection.
|
|
25
|
+
*/
|
|
26
|
+
updateCollection: (id: ID, options: {
|
|
27
|
+
name: string;
|
|
28
|
+
}) => Promise<MatchReplaceCollection>;
|
|
29
|
+
/**
|
|
30
|
+
* Delete a collection.
|
|
31
|
+
* @param id - The ID of the collection.
|
|
32
|
+
*/
|
|
33
|
+
deleteCollection: (id: ID) => Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Get all rules.
|
|
36
|
+
* @returns All rules.
|
|
37
|
+
*/
|
|
38
|
+
getRules: () => MatchReplaceRule[];
|
|
39
|
+
/**
|
|
40
|
+
* Get all active rules.
|
|
41
|
+
* Rules are ordered in priority from highest to lowest.
|
|
42
|
+
* @returns All active rules.
|
|
43
|
+
*/
|
|
44
|
+
getActiveRules: () => MatchReplaceRule[];
|
|
45
|
+
/**
|
|
46
|
+
* Select a rule to be displayed in the UI.
|
|
47
|
+
* @param id - The ID of the rule, or undefined to clear the selection.
|
|
48
|
+
*/
|
|
49
|
+
selectRule: (id: ID | undefined) => void;
|
|
50
|
+
/**
|
|
51
|
+
* Create a rule.
|
|
52
|
+
* @param options - The options for the rule.
|
|
53
|
+
* @param options.name - The name of the rule.
|
|
54
|
+
* @param options.query - The HTTPQL query to match the rule against.
|
|
55
|
+
* @param options.collectionId - The ID of the collection the rule belongs to.
|
|
56
|
+
*/
|
|
57
|
+
createRule: (options: {
|
|
58
|
+
name: string;
|
|
59
|
+
query: HTTPQL;
|
|
60
|
+
section: MatchReplaceSection;
|
|
61
|
+
collectionId: ID;
|
|
62
|
+
}) => Promise<MatchReplaceRule>;
|
|
63
|
+
/**
|
|
64
|
+
* Update a rule.
|
|
65
|
+
* @param id - The ID of the rule.
|
|
66
|
+
* @param options - The new values for the rule.
|
|
67
|
+
* @param options.name - The new name of the rule.
|
|
68
|
+
* @param options.query - The new HTTPQL query of the rule.
|
|
69
|
+
* @param options.section - The new section of the rule.
|
|
70
|
+
*/
|
|
71
|
+
updateRule: (id: ID, options: {
|
|
72
|
+
name: string;
|
|
73
|
+
query?: HTTPQL;
|
|
74
|
+
section: MatchReplaceSection;
|
|
75
|
+
}) => Promise<MatchReplaceRule>;
|
|
76
|
+
/**
|
|
77
|
+
* Toggle a rule.
|
|
78
|
+
* @param id - The ID of the rule.
|
|
79
|
+
* @param enabled - Whether the rule should be enabled.
|
|
80
|
+
*/
|
|
81
|
+
toggleRule: (id: ID, enabled: boolean) => Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* Delete a rule.
|
|
84
|
+
* @param id - The ID of the rule.
|
|
85
|
+
*/
|
|
86
|
+
deleteRule: (id: ID) => Promise<void>;
|
|
87
|
+
};
|