@caido/sdk-frontend 0.54.2-beta.1 → 0.54.2-beta.10
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/__generated__/graphql-sdk.d.ts +457 -113
- package/src/types/index.d.ts +26 -2
- package/src/types/private/analytics.d.ts +29 -0
- package/src/types/sdks/automate.d.ts +37 -0
- package/src/types/sdks/findings.d.ts +6 -0
- package/src/types/sdks/httpHistory.d.ts +6 -0
- package/src/types/sdks/index.d.ts +11 -0
- package/src/types/sdks/matchReplace.d.ts +19 -1
- package/src/types/sdks/replay.d.ts +19 -1
- package/src/types/sdks/search.d.ts +6 -0
- package/src/types/sdks/settings.d.ts +22 -0
- package/src/types/sdks/sitemap.d.ts +52 -1
- package/src/types/sdks/window.d.ts +13 -2
- package/src/types/types/assistant.d.ts +7 -0
- package/src/types/types/automate.d.ts +56 -0
- package/src/types/types/backups.d.ts +7 -0
- package/src/types/types/certificate.d.ts +7 -0
- package/src/types/types/environment.d.ts +9 -0
- package/src/types/types/exports.d.ts +7 -0
- package/src/types/types/files.d.ts +7 -0
- package/src/types/types/filter.d.ts +9 -1
- package/src/types/types/findings.d.ts +9 -1
- package/src/types/types/httpHistory.d.ts +9 -0
- package/src/types/types/intercept.d.ts +19 -0
- package/src/types/types/matchReplace.d.ts +9 -1
- package/src/types/types/projects.d.ts +7 -0
- package/src/types/types/replay.d.ts +17 -1
- package/src/types/types/response.d.ts +27 -0
- package/src/types/types/scopes.d.ts +9 -1
- package/src/types/types/search.d.ts +7 -0
- package/src/types/types/settings.d.ts +25 -0
- package/src/types/types/sitemap.d.ts +96 -0
- package/src/types/types/utils.d.ts +28 -0
- package/src/types/types/websocket.d.ts +7 -0
- package/src/types/types/window.d.ts +31 -0
- package/src/types/types/workflows.d.ts +7 -0
package/src/types/index.d.ts
CHANGED
|
@@ -1,25 +1,49 @@
|
|
|
1
1
|
export { FooterSlot, type FooterSlotContent } from "./types/footer";
|
|
2
2
|
export type { DialogOptions } from "./types/window";
|
|
3
|
+
export type { _AnalyticsSDK } from "./private/analytics";
|
|
3
4
|
export type { CommandContext, CommandContextRequest, CommandContextRequestRow, CommandContextResponse, CommandContextBase, } from "./types/commands";
|
|
4
5
|
export type { MenuItem } from "./types/menu";
|
|
5
6
|
export { type ReplayTab, type ReplaySession, type ReplayEntry, type ReplayCollection, type SendRequestOptions, ReplaySlot, type ReplaySlotContent, type RequestSource, type CurrentReplaySessionChangeEvent, } from "./types/replay";
|
|
7
|
+
export type { AutomateSession, AutomateEntry } from "./types/automate";
|
|
8
|
+
export type { SitemapEntry, SitemapRootEntry, ChildState, } from "./types/sitemap";
|
|
6
9
|
export { SearchSlot, type SearchSlotContent } from "./types/search";
|
|
7
10
|
export type { HostedFile } from "./types/files";
|
|
8
11
|
export { FilterSlot, type Filter, type FilterSlotContent, type CurrentFilterChangeEvent, } from "./types/filter";
|
|
9
|
-
export type { HTTPQL, ID, ComponentDefinition } from "./types/utils";
|
|
12
|
+
export type { HTTPQL, ID, ComponentDefinition, Selection } from "./types/utils";
|
|
10
13
|
export type { JSONValue, JSONCompatible } from "./types/json";
|
|
11
14
|
export type { SlotContent, ButtonSlotContent, CustomSlotContent, CommandSlotContent, } from "./types/slots";
|
|
12
15
|
export type { RequestViewModeOptions, RequestFull, RequestDraft, RequestMeta, } from "./types/request";
|
|
16
|
+
export type { ResponseViewModeOptions, ResponseFull } from "./types/response";
|
|
13
17
|
export type { CurrentMatchReplaceRuleChangeEvent, MatchReplaceRule, MatchReplaceCollection, MatchReplaceSection, MatchReplaceSectionRequestAll, MatchReplaceSectionRequestBody, MatchReplaceSectionRequestFirstLine, MatchReplaceSectionRequestHeader, MatchReplaceSectionRequestMethod, MatchReplaceSectionRequestPath, MatchReplaceSectionRequestQuery, MatchReplaceSectionRequestSNI, MatchReplaceSectionResponseAll, MatchReplaceSectionResponseBody, MatchReplaceSectionResponseFirstLine, MatchReplaceSectionResponseHeader, MatchReplaceSectionResponseStatusCode, MatchReplaceOperationStatusCode, MatchReplaceOperationStatusCodeUpdate, MatchReplaceOperationQuery, MatchReplaceOperationQueryRaw, MatchReplaceOperationQueryAdd, MatchReplaceOperationQueryRemove, MatchReplaceOperationQueryUpdate, MatchReplaceOperationPath, MatchReplaceOperationPathRaw, MatchReplaceOperationAll, MatchReplaceOperationAllRaw, MatchReplaceOperationMethod, MatchReplaceOperationMethodUpdate, MatchReplaceOperationHeader, MatchReplaceOperationHeaderRaw, MatchReplaceOperationHeaderAdd, MatchReplaceOperationHeaderRemove, MatchReplaceOperationHeaderUpdate, MatchReplaceOperationBody, MatchReplaceOperationBodyRaw, MatchReplaceOperationFirstLine, MatchReplaceOperationFirstLineRaw, MatchReplaceOperationSNI, MatchReplaceOperationSNIRaw, MatchReplaceReplacer, MatchReplaceReplacerTerm, MatchReplaceReplacerWorkflow, MatchReplaceMatcherName, MatchReplaceMatcherRaw, MatchReplaceMatcherRawFull, MatchReplaceMatcherRawRegex, MatchReplaceMatcherRawValue, } from "./types/matchReplace";
|
|
14
18
|
export { MatchReplaceSlot, type MatchReplaceSlotContent, } from "./types/matchReplace";
|
|
15
19
|
export { ScopeSlot, type CurrentScopeChangeEvent, type Scope, type ScopeSlotContent, } from "./types/scopes";
|
|
16
20
|
export { HTTPHistorySlot, type HTTPHistorySlotContent, } from "./types/httpHistory";
|
|
21
|
+
export { SettingsSlot, type SettingsSlotContent, type SettingsPluginSlotContent, } from "./types/settings";
|
|
17
22
|
export type { EnvironmentVariable } from "./types/environment";
|
|
18
23
|
export type { Workflow, WorkflowKind, OnCreatedWorkflowCallback, OnUpdatedWorkflowCallback, OnDeletedWorkflowCallback, } from "./types/workflows";
|
|
19
|
-
export type { ListenerHandle } from "./types/utils";
|
|
24
|
+
export type { ListenerHandle, AddIndicatorOptions, Indicator, } from "./types/utils";
|
|
20
25
|
export type { AIProvider, AILanguageModelSettings, AIReasoningSettings, AIUpstreamProvider, AIUpstreamProviderId, AIUpstreamProviderStatus, } from "./types/ai";
|
|
21
26
|
export type { SelectedProjectChangeEvent } from "./types/projects";
|
|
22
27
|
export type { CommandPaletteView } from "./sdks/commandPalette";
|
|
23
28
|
export type { LogSDK } from "./sdks/log";
|
|
24
29
|
export type { API } from "./sdks";
|
|
25
30
|
export { Routes } from "./types/navigation";
|
|
31
|
+
export { type GlobalContext, type PageContext } from "./types/window";
|
|
32
|
+
export type { AssistantPageContext } from "./types/assistant";
|
|
33
|
+
export type { AutomatePageContext } from "./types/automate";
|
|
34
|
+
export type { BackupsPageContext } from "./types/backups";
|
|
35
|
+
export type { CertificatePageContext } from "./types/certificate";
|
|
36
|
+
export type { EnvironmentPageContext } from "./types/environment";
|
|
37
|
+
export type { ExportsPageContext } from "./types/exports";
|
|
38
|
+
export type { FilesPageContext } from "./types/files";
|
|
39
|
+
export type { FilterPageContext } from "./types/filter";
|
|
40
|
+
export type { FindingsPageContext } from "./types/findings";
|
|
41
|
+
export type { HTTPHistoryPageContext } from "./types/httpHistory";
|
|
42
|
+
export type { InterceptPageContext } from "./types/intercept";
|
|
43
|
+
export type { ProjectsPageContext } from "./types/projects";
|
|
44
|
+
export type { ReplayPageContext } from "./types/replay";
|
|
45
|
+
export type { ScopePageContext } from "./types/scopes";
|
|
46
|
+
export type { SearchPageContext } from "./types/search";
|
|
47
|
+
export type { SitemapPageContext } from "./types/sitemap";
|
|
48
|
+
export type { MatchReplacePageContext } from "./types/matchReplace";
|
|
49
|
+
export type { WorkflowsPageContext } from "./types/workflows";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @private
|
|
3
|
+
* Generic analytics event input for tracking.
|
|
4
|
+
*/
|
|
5
|
+
type AnalyticsEventInput = {
|
|
6
|
+
/**
|
|
7
|
+
* @private
|
|
8
|
+
* The name/kind of the analytics event.
|
|
9
|
+
*/
|
|
10
|
+
name: string;
|
|
11
|
+
/**
|
|
12
|
+
* @private
|
|
13
|
+
* The payload data for the analytics event.
|
|
14
|
+
*/
|
|
15
|
+
payload: Record<string, unknown>;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* @private
|
|
19
|
+
* Utilities to track analytics events.
|
|
20
|
+
*/
|
|
21
|
+
export type _AnalyticsSDK = {
|
|
22
|
+
/**
|
|
23
|
+
* @private
|
|
24
|
+
* Track an analytics event.
|
|
25
|
+
* @param event The analytics event to track.
|
|
26
|
+
*/
|
|
27
|
+
track: (event: AnalyticsEventInput) => Promise<void>;
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { Extension } from "@codemirror/state";
|
|
2
|
+
import type { AutomateEntry, AutomateSession } from "../types/automate";
|
|
2
3
|
import type { RequestViewModeOptions } from "../types/request";
|
|
4
|
+
import type { ResponseViewModeOptions } from "../types/response";
|
|
5
|
+
import type { AddIndicatorOptions, ID, Indicator } from "../types/utils";
|
|
3
6
|
/**
|
|
4
7
|
* Utilities to interact with the Automate page.
|
|
5
8
|
* @category Automate
|
|
@@ -15,4 +18,38 @@ export type AutomateSDK = {
|
|
|
15
18
|
* @param options The view mode options.
|
|
16
19
|
*/
|
|
17
20
|
addRequestViewMode: (options: RequestViewModeOptions) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Add a custom response view mode.
|
|
23
|
+
* @param options The view mode options.
|
|
24
|
+
*/
|
|
25
|
+
addResponseViewMode: (options: ResponseViewModeOptions) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Get the list of all automate sessions.
|
|
28
|
+
* @returns The list of all automate sessions.
|
|
29
|
+
*/
|
|
30
|
+
getSessions: () => AutomateSession[];
|
|
31
|
+
/**
|
|
32
|
+
* Get the list of all automate entries.
|
|
33
|
+
* @param sessionId The ID of the session to get the entries of.
|
|
34
|
+
* @returns The list of all automate entries.
|
|
35
|
+
*/
|
|
36
|
+
getEntries: (sessionId: ID) => AutomateEntry[];
|
|
37
|
+
/**
|
|
38
|
+
* Add an indicator to an automate entry.
|
|
39
|
+
* Indicators are displayed next to the entry name in the collections tree.
|
|
40
|
+
* @param entryId The ID of the entry to add the indicator to.
|
|
41
|
+
* @param indicator The indicator configuration.
|
|
42
|
+
* @returns A handle object with a `remove` method to remove the indicator.
|
|
43
|
+
* @example
|
|
44
|
+
*
|
|
45
|
+
* const indicator = sdk.automate.addEntryIndicator(entryId, {
|
|
46
|
+
* icon: "fas fa-exclamation-triangle",
|
|
47
|
+
* description: "Security warning",
|
|
48
|
+
* });
|
|
49
|
+
*
|
|
50
|
+
* // Later, remove the indicator
|
|
51
|
+
* indicator.remove();
|
|
52
|
+
*
|
|
53
|
+
*/
|
|
54
|
+
addEntryIndicator: (entryId: ID, indicator: AddIndicatorOptions) => Indicator;
|
|
18
55
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Extension } from "@codemirror/state";
|
|
2
2
|
import { type Finding } from "../types/findings";
|
|
3
3
|
import type { RequestViewModeOptions } from "../types/request";
|
|
4
|
+
import type { ResponseViewModeOptions } from "../types/response";
|
|
4
5
|
import type { ID } from "../types/utils";
|
|
5
6
|
/**
|
|
6
7
|
* Utilities to interact with findings
|
|
@@ -33,4 +34,9 @@ export type FindingsSDK = {
|
|
|
33
34
|
* @param options The view mode options.
|
|
34
35
|
*/
|
|
35
36
|
addRequestViewMode: (options: RequestViewModeOptions) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Add a custom response view mode.
|
|
39
|
+
* @param options The view mode options.
|
|
40
|
+
*/
|
|
41
|
+
addResponseViewMode: (options: ResponseViewModeOptions) => void;
|
|
36
42
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Extension } from "@codemirror/state";
|
|
2
2
|
import type { HTTPHistorySlotContent } from "../types/httpHistory";
|
|
3
3
|
import type { RequestViewModeOptions } from "../types/request";
|
|
4
|
+
import type { ResponseViewModeOptions } from "../types/response";
|
|
4
5
|
import { type DefineAddToSlotFn } from "../types/slots";
|
|
5
6
|
import type { HTTPQL, ID } from "../types/utils";
|
|
6
7
|
/**
|
|
@@ -43,6 +44,11 @@ export type HTTPHistorySDK = {
|
|
|
43
44
|
* @param options The view mode options.
|
|
44
45
|
*/
|
|
45
46
|
addRequestViewMode: (options: RequestViewModeOptions) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Add a custom response view mode.
|
|
49
|
+
* @param options The view mode options.
|
|
50
|
+
*/
|
|
51
|
+
addResponseViewMode: (options: ResponseViewModeOptions) => void;
|
|
46
52
|
/**
|
|
47
53
|
* Scrolls the HTTP History table to a specific entry.
|
|
48
54
|
* @param id The ID of the entry to scroll to.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Sdk as GraphqlSDK } from "../__generated__/graphql-sdk";
|
|
2
|
+
import type { _AnalyticsSDK } from "../private/analytics";
|
|
2
3
|
import { type BackendEndpoints, type BackendEvents } from "../types/backend";
|
|
3
4
|
import type { AiSDK } from "./ai";
|
|
4
5
|
import type { AssetsSDK } from "./assets";
|
|
@@ -22,6 +23,7 @@ import type { ReplaySDK } from "./replay";
|
|
|
22
23
|
import type { RuntimeSDK } from "./runtime";
|
|
23
24
|
import type { ScopesSDK } from "./scopes";
|
|
24
25
|
import type { SearchSDK } from "./search";
|
|
26
|
+
import type { SettingsSDK } from "./settings";
|
|
25
27
|
import type { ShortcutsSDK } from "./shortcuts";
|
|
26
28
|
import type { SidebarSDK } from "./sidebar";
|
|
27
29
|
import type { SitemapSDK } from "./sitemap";
|
|
@@ -154,4 +156,13 @@ export type API<T extends BackendEndpoints = Record<string, never>, E extends Ba
|
|
|
154
156
|
* Utilities for logging messages to the console.
|
|
155
157
|
*/
|
|
156
158
|
log: LogSDK;
|
|
159
|
+
/**
|
|
160
|
+
* Utilities to interact with the settings page.
|
|
161
|
+
*/
|
|
162
|
+
settings: SettingsSDK;
|
|
163
|
+
/**
|
|
164
|
+
* @private
|
|
165
|
+
* Utilities to track analytics events.
|
|
166
|
+
*/
|
|
167
|
+
_analytics: _AnalyticsSDK;
|
|
157
168
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type CurrentMatchReplaceRuleChangeEvent, type MatchReplaceCollection, type MatchReplaceRule, type MatchReplaceSection, type MatchReplaceSlotContent, type Source } from "../types/matchReplace";
|
|
2
2
|
import { type DefineAddToSlotFn } from "../types/slots";
|
|
3
|
-
import type { HTTPQL, ID, ListenerHandle } from "../types/utils";
|
|
3
|
+
import type { AddIndicatorOptions, HTTPQL, ID, Indicator, ListenerHandle } from "../types/utils";
|
|
4
4
|
/**
|
|
5
5
|
* Utilities to interact with the Match and Replace page.
|
|
6
6
|
* @category Match and Replace
|
|
@@ -138,4 +138,22 @@ export type MatchReplaceSDK = {
|
|
|
138
138
|
* ```
|
|
139
139
|
*/
|
|
140
140
|
addToSlot: DefineAddToSlotFn<MatchReplaceSlotContent>;
|
|
141
|
+
/**
|
|
142
|
+
* Add an indicator to a rule.
|
|
143
|
+
* Indicators are displayed next to the session name in the collections tree.
|
|
144
|
+
* @param ruleId The ID of the rule to add the indicator to.
|
|
145
|
+
* @param indicator The indicator configuration.
|
|
146
|
+
* @returns A handle object with a `remove` method to remove the indicator.
|
|
147
|
+
* @example
|
|
148
|
+
*
|
|
149
|
+
* const indicator = sdk.matchReplace.addRuleIndicator(ruleId, {
|
|
150
|
+
* icon: "fas fa-exclamation-triangle",
|
|
151
|
+
* description: "Security warning",
|
|
152
|
+
* });
|
|
153
|
+
*
|
|
154
|
+
* // Later, remove the indicator
|
|
155
|
+
* indicator.remove();
|
|
156
|
+
*
|
|
157
|
+
*/
|
|
158
|
+
addRuleIndicator: (ruleId: ID, indicator: AddIndicatorOptions) => Indicator;
|
|
141
159
|
};
|
|
@@ -2,7 +2,7 @@ import { type Extension } from "@codemirror/state";
|
|
|
2
2
|
import { type CurrentReplaySessionChangeEvent, type OpenTabOptions, type ReplayCollection, type ReplayCollectionCreatedEvent, type ReplayEntry, type ReplaySession, type ReplaySessionCreatedEvent, type ReplaySlotContent, type ReplayTab, type RequestSource, type SendRequestOptions } from "../types/replay";
|
|
3
3
|
import type { RequestViewModeOptions } from "../types/request";
|
|
4
4
|
import { type DefineAddToSlotFn } from "../types/slots";
|
|
5
|
-
import type { ID, ListenerHandle } from "../types/utils";
|
|
5
|
+
import type { AddIndicatorOptions, ID, Indicator, ListenerHandle } from "../types/utils";
|
|
6
6
|
/**
|
|
7
7
|
* Utilities to interact with Replay.
|
|
8
8
|
* @category Replay
|
|
@@ -224,4 +224,22 @@ export type ReplaySDK = {
|
|
|
224
224
|
* ```
|
|
225
225
|
*/
|
|
226
226
|
onCollectionCreate: (callback: (event: ReplayCollectionCreatedEvent) => void) => ListenerHandle;
|
|
227
|
+
/**
|
|
228
|
+
* Add an indicator to a replay session.
|
|
229
|
+
* Indicators are displayed next to the session name in the collections tree.
|
|
230
|
+
* @param sessionId The ID of the session to add the indicator to.
|
|
231
|
+
* @param indicator The indicator configuration.
|
|
232
|
+
* @returns A handle object with a `remove` method to remove the indicator.
|
|
233
|
+
* @example
|
|
234
|
+
*
|
|
235
|
+
* const indicator = sdk.replay.addSessionIndicator(sessionId, {
|
|
236
|
+
* icon: "fas fa-exclamation-triangle",
|
|
237
|
+
* description: "Security warning",
|
|
238
|
+
* });
|
|
239
|
+
*
|
|
240
|
+
* // Later, remove the indicator
|
|
241
|
+
* indicator.remove();
|
|
242
|
+
*
|
|
243
|
+
*/
|
|
244
|
+
addSessionIndicator: (sessionId: ID, indicator: AddIndicatorOptions) => Indicator;
|
|
227
245
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Extension } from "@codemirror/state";
|
|
2
2
|
import type { RequestViewModeOptions } from "../types/request";
|
|
3
|
+
import type { ResponseViewModeOptions } from "../types/response";
|
|
3
4
|
import type { SearchSlot, SearchSlotContent } from "../types/search";
|
|
4
5
|
import type { HTTPQL, ID } from "../types/utils";
|
|
5
6
|
/**
|
|
@@ -37,6 +38,11 @@ export type SearchSDK = {
|
|
|
37
38
|
* @param options The view mode options.
|
|
38
39
|
*/
|
|
39
40
|
addRequestViewMode: (options: RequestViewModeOptions) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Add a custom response view mode.
|
|
43
|
+
* @param options The view mode options.
|
|
44
|
+
*/
|
|
45
|
+
addResponseViewMode: (options: ResponseViewModeOptions) => void;
|
|
40
46
|
/**
|
|
41
47
|
* Scrolls the Search table to a specific request.
|
|
42
48
|
* @param id The ID of the request to scroll to.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { SettingsSlotContent } from "../types/settings";
|
|
2
|
+
import type { DefineAddToSlotFn } from "../types/slots";
|
|
3
|
+
/**
|
|
4
|
+
* Utilities to interact with the settings page.
|
|
5
|
+
* @category Settings
|
|
6
|
+
*/
|
|
7
|
+
export type SettingsSDK = {
|
|
8
|
+
/**
|
|
9
|
+
* Add a component to a slot.
|
|
10
|
+
* @param slot The slot to add the component to.
|
|
11
|
+
* @param content The content to add to the slot.
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* sdk.settings.addToSlot(SettingsSlot.PluginsSection, {
|
|
15
|
+
* type: "Custom",
|
|
16
|
+
* name: "My Plugin Settings",
|
|
17
|
+
* definition: MySettingsComponent,
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
addToSlot: DefineAddToSlotFn<SettingsSlotContent>;
|
|
22
|
+
};
|
|
@@ -1,11 +1,39 @@
|
|
|
1
1
|
import type { Extension } from "@codemirror/state";
|
|
2
2
|
import type { RequestViewModeOptions } from "../types/request";
|
|
3
|
-
import type {
|
|
3
|
+
import type { ResponseViewModeOptions } from "../types/response";
|
|
4
|
+
import type { SitemapEntry, SitemapEntryChildStateUpdateEvent, SitemapRootEntry } from "../types/sitemap";
|
|
5
|
+
import type { AddIndicatorOptions, ID, Indicator, ListenerHandle } from "../types/utils";
|
|
4
6
|
/**
|
|
5
7
|
* Utilities to interact with the Sitemap page.
|
|
6
8
|
* @category Sitemap
|
|
7
9
|
*/
|
|
8
10
|
export type SitemapSDK = {
|
|
11
|
+
/**
|
|
12
|
+
* Listen for child state updates on a sitemap entry.
|
|
13
|
+
* @param callback The callback function that receives the entry ID and new child state.
|
|
14
|
+
* @returns A handle object with a `stop` method to stop listening.
|
|
15
|
+
* @example
|
|
16
|
+
*
|
|
17
|
+
* const handle = sdk.sitemap.onEntryChildStateUpdate((entryId, newChildState) => {
|
|
18
|
+
* console.log(`Entry ${entryId} child state changed:`, newChildState);
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* // Later, stop listening
|
|
22
|
+
* handle.stop();
|
|
23
|
+
*/
|
|
24
|
+
onEntryChildStateUpdate: (callback: (event: SitemapEntryChildStateUpdateEvent) => void) => ListenerHandle;
|
|
25
|
+
/**
|
|
26
|
+
* Get the list of all sitemap entries in tree format.
|
|
27
|
+
* @returns The list of all sitemap entries.
|
|
28
|
+
*/
|
|
29
|
+
getTreeEntries: () => SitemapRootEntry[];
|
|
30
|
+
/**
|
|
31
|
+
* Load children for a sitemap entry.
|
|
32
|
+
* This will fetch and load children if they haven't been loaded yet.
|
|
33
|
+
* @param entryId The ID of the entry to load children for.
|
|
34
|
+
* @returns Promise that resolves when children are loaded.
|
|
35
|
+
*/
|
|
36
|
+
getChildren: (entryId: ID) => Promise<SitemapEntry[]>;
|
|
9
37
|
/**
|
|
10
38
|
* Get the current scope ID.
|
|
11
39
|
* @returns The current scope ID.
|
|
@@ -26,4 +54,27 @@ export type SitemapSDK = {
|
|
|
26
54
|
* @param options The view mode options.
|
|
27
55
|
*/
|
|
28
56
|
addRequestViewMode: (options: RequestViewModeOptions) => void;
|
|
57
|
+
/**
|
|
58
|
+
* Add a custom response view mode.
|
|
59
|
+
* @param options The view mode options.
|
|
60
|
+
*/
|
|
61
|
+
addResponseViewMode: (options: ResponseViewModeOptions) => void;
|
|
62
|
+
/**
|
|
63
|
+
* Add an indicator to a sitemap session.
|
|
64
|
+
* Indicators are displayed next to the entry name in the collections tree.
|
|
65
|
+
* @param entryId The ID of the entry to add the indicator to.
|
|
66
|
+
* @param indicator The indicator configuration.
|
|
67
|
+
* @returns A handle object with a `remove` method to remove the indicator.
|
|
68
|
+
* @example
|
|
69
|
+
*
|
|
70
|
+
* const indicator = sdk.sitemap.addEntryIndicator(entryId, {
|
|
71
|
+
* icon: "fas fa-exclamation-triangle",
|
|
72
|
+
* description: "Security warning",
|
|
73
|
+
* });
|
|
74
|
+
*
|
|
75
|
+
* // Later, remove the indicator
|
|
76
|
+
* indicator.remove();
|
|
77
|
+
*
|
|
78
|
+
*/
|
|
79
|
+
addEntryIndicator: (entryId: ID, indicator: AddIndicatorOptions) => Indicator;
|
|
29
80
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Editor } from "../types/editor";
|
|
2
|
-
import type { ComponentDefinition } from "../types/utils";
|
|
3
|
-
import { type Dialog, type DialogOptions } from "../types/window";
|
|
2
|
+
import type { ComponentDefinition, ListenerHandle } from "../types/utils";
|
|
3
|
+
import { type Dialog, type DialogOptions, type GlobalContext } from "../types/window";
|
|
4
4
|
/**
|
|
5
5
|
* Utilities to interact with the active page.
|
|
6
6
|
* @category Window
|
|
@@ -35,4 +35,15 @@ export type WindowSDK = {
|
|
|
35
35
|
* @returns A dialog object that can be used to close the dialog.
|
|
36
36
|
*/
|
|
37
37
|
showDialog: (component: ComponentDefinition, options?: DialogOptions) => Dialog;
|
|
38
|
+
/**
|
|
39
|
+
* Get the current global context.
|
|
40
|
+
* @returns The current global context.
|
|
41
|
+
*/
|
|
42
|
+
getContext: () => GlobalContext;
|
|
43
|
+
/**
|
|
44
|
+
* Subscribe to global context changes.
|
|
45
|
+
* @param callback The callback to call when the context changes.
|
|
46
|
+
* @returns An object with a `stop` method that can be called to stop listening to context changes.
|
|
47
|
+
*/
|
|
48
|
+
onContextChange: (callback: (context: GlobalContext) => void) => ListenerHandle;
|
|
38
49
|
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type ID, type Selection } from "./utils";
|
|
2
|
+
/**
|
|
3
|
+
* A automate session.
|
|
4
|
+
* @category Automate
|
|
5
|
+
*/
|
|
6
|
+
export type AutomateSession = {
|
|
7
|
+
/**
|
|
8
|
+
* The ID of the session.
|
|
9
|
+
*/
|
|
10
|
+
id: ID;
|
|
11
|
+
/**
|
|
12
|
+
* The name of the session.
|
|
13
|
+
*/
|
|
14
|
+
name: string;
|
|
15
|
+
/**
|
|
16
|
+
* The date the session was created.
|
|
17
|
+
*/
|
|
18
|
+
createdAt: Date;
|
|
19
|
+
/**
|
|
20
|
+
* The IDs of all entries in this session.
|
|
21
|
+
*/
|
|
22
|
+
entryIds: ID[];
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* A automate entry.
|
|
26
|
+
* @category Automate
|
|
27
|
+
*/
|
|
28
|
+
export type AutomateEntry = {
|
|
29
|
+
/**
|
|
30
|
+
* The ID of the entry.
|
|
31
|
+
*/
|
|
32
|
+
id: ID;
|
|
33
|
+
/**
|
|
34
|
+
* The name of the entry.
|
|
35
|
+
*/
|
|
36
|
+
name: string;
|
|
37
|
+
/**
|
|
38
|
+
* The date the entry was created.
|
|
39
|
+
*/
|
|
40
|
+
createdAt: Date;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Automate page context.
|
|
44
|
+
* @category Automate
|
|
45
|
+
*/
|
|
46
|
+
export type AutomatePageContext = {
|
|
47
|
+
kind: "Automate";
|
|
48
|
+
requestSelection: Selection<ID>;
|
|
49
|
+
selection: Selection<{
|
|
50
|
+
kind: "AutomateSession";
|
|
51
|
+
id: ID;
|
|
52
|
+
} | {
|
|
53
|
+
kind: "AutomateEntry";
|
|
54
|
+
id: ID;
|
|
55
|
+
}>;
|
|
56
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ID, type Selection } from "./utils";
|
|
1
2
|
/**
|
|
2
3
|
* Represents an environment variable.
|
|
3
4
|
* @category Environment
|
|
@@ -16,3 +17,11 @@ export type EnvironmentVariable = {
|
|
|
16
17
|
*/
|
|
17
18
|
isSecret: boolean;
|
|
18
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* Environment page context.
|
|
22
|
+
* @category Environment
|
|
23
|
+
*/
|
|
24
|
+
export type EnvironmentPageContext = {
|
|
25
|
+
kind: "Environment";
|
|
26
|
+
selection: Selection<ID>;
|
|
27
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent } from "./slots";
|
|
2
|
-
import { type HTTPQL, type ID } from "./utils";
|
|
2
|
+
import { type HTTPQL, type ID, type Selection } from "./utils";
|
|
3
3
|
/**
|
|
4
4
|
* Represents a filter.
|
|
5
5
|
* @category Filters
|
|
@@ -56,3 +56,11 @@ export type CurrentFilterChangeEvent = {
|
|
|
56
56
|
*/
|
|
57
57
|
filterId: ID | undefined;
|
|
58
58
|
};
|
|
59
|
+
/**
|
|
60
|
+
* Filter page context.
|
|
61
|
+
* @category Filters
|
|
62
|
+
*/
|
|
63
|
+
export type FilterPageContext = {
|
|
64
|
+
kind: "Filter";
|
|
65
|
+
selection: Selection<ID>;
|
|
66
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ID } from "./utils";
|
|
1
|
+
import { type ID, type Selection } from "./utils";
|
|
2
2
|
/**
|
|
3
3
|
* Represents a {@link https://docs.caido.io/reference/features/logging/findings|Finding}.
|
|
4
4
|
* @category Findings
|
|
@@ -29,3 +29,11 @@ export type Finding = {
|
|
|
29
29
|
*/
|
|
30
30
|
path: string;
|
|
31
31
|
};
|
|
32
|
+
/**
|
|
33
|
+
* Findings page context.
|
|
34
|
+
* @category Findings
|
|
35
|
+
*/
|
|
36
|
+
export type FindingsPageContext = {
|
|
37
|
+
kind: "Findings";
|
|
38
|
+
selection: Selection<ID>;
|
|
39
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent } from "./slots";
|
|
2
|
+
import { type ID, type Selection } from "./utils";
|
|
2
3
|
/**
|
|
3
4
|
* The slots in the HTTP History UI.
|
|
4
5
|
* @category HTTP History
|
|
@@ -13,3 +14,11 @@ export type HTTPHistorySlot = (typeof HTTPHistorySlot)[keyof typeof HTTPHistoryS
|
|
|
13
14
|
export type HTTPHistorySlotContent = {
|
|
14
15
|
[HTTPHistorySlot.ToolbarPrimary]: ButtonSlotContent | CustomSlotContent | CommandSlotContent;
|
|
15
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* HTTP history page context.
|
|
19
|
+
* @category HTTP History
|
|
20
|
+
*/
|
|
21
|
+
export type HTTPHistoryPageContext = {
|
|
22
|
+
kind: "HTTPHistory";
|
|
23
|
+
selection: Selection<ID>;
|
|
24
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type Selection } from "./utils";
|
|
2
|
+
/**
|
|
3
|
+
* A unique intercept message identifier.
|
|
4
|
+
* @category Intercept
|
|
5
|
+
*/
|
|
6
|
+
type InterceptMessageId = string & {
|
|
7
|
+
__interceptMessageId?: never;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Intercept page context.
|
|
11
|
+
* @category Intercept
|
|
12
|
+
*/
|
|
13
|
+
export type InterceptPageContext = {
|
|
14
|
+
kind: "Intercept";
|
|
15
|
+
requestSelection: Selection<InterceptMessageId>;
|
|
16
|
+
responseSelection: Selection<InterceptMessageId>;
|
|
17
|
+
websocketSelection: Selection<InterceptMessageId>;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent } from "./slots";
|
|
2
|
-
import { type HTTPQL, type ID } from "./utils";
|
|
2
|
+
import { type HTTPQL, type ID, type Selection } from "./utils";
|
|
3
3
|
/**
|
|
4
4
|
* A rule in Match and Replace.
|
|
5
5
|
* @category Match and Replace
|
|
@@ -432,4 +432,12 @@ export type CurrentMatchReplaceRuleChangeEvent = {
|
|
|
432
432
|
*/
|
|
433
433
|
ruleId: ID | undefined;
|
|
434
434
|
};
|
|
435
|
+
/**
|
|
436
|
+
* Match and Replace page context.
|
|
437
|
+
* @category Match and Replace
|
|
438
|
+
*/
|
|
439
|
+
export type MatchReplacePageContext = {
|
|
440
|
+
kind: "MatchReplace";
|
|
441
|
+
selection: Selection<ID>;
|
|
442
|
+
};
|
|
435
443
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent } from "./slots";
|
|
2
|
-
import { type ID } from "./utils";
|
|
2
|
+
import { type ID, type Selection } from "./utils";
|
|
3
3
|
/**
|
|
4
4
|
* The slots in the Replay UI.
|
|
5
5
|
* @category Replay
|
|
@@ -218,3 +218,19 @@ export type ReplayCollectionCreatedEvent = {
|
|
|
218
218
|
*/
|
|
219
219
|
collection: ReplayCollection;
|
|
220
220
|
};
|
|
221
|
+
/**
|
|
222
|
+
* Replay page context.
|
|
223
|
+
* @category Replay
|
|
224
|
+
*/
|
|
225
|
+
export type ReplayPageContext = {
|
|
226
|
+
kind: "Replay";
|
|
227
|
+
selection: Selection<ReplaySessionId>;
|
|
228
|
+
};
|
|
229
|
+
/**
|
|
230
|
+
* A unique replay session identifier.
|
|
231
|
+
* @category Replay
|
|
232
|
+
*/
|
|
233
|
+
type ReplaySessionId = string & {
|
|
234
|
+
__replaySessionId?: never;
|
|
235
|
+
};
|
|
236
|
+
export {};
|