@caido/sdk-frontend 0.54.2-beta.3 → 0.54.2-beta.5
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 +21 -1
- package/src/types/sdks/automate.d.ts +6 -0
- package/src/types/sdks/findings.d.ts +6 -0
- package/src/types/sdks/httpHistory.d.ts +6 -0
- package/src/types/sdks/search.d.ts +6 -0
- package/src/types/sdks/sitemap.d.ts +6 -0
- 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 +16 -1
- 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/sitemap.d.ts +10 -1
- package/src/types/types/utils.d.ts +12 -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/package.json
CHANGED
package/src/types/index.d.ts
CHANGED
|
@@ -8,10 +8,11 @@ export type { SitemapEntry, SitemapRootEntry, ChildState, } from "./types/sitema
|
|
|
8
8
|
export { SearchSlot, type SearchSlotContent } from "./types/search";
|
|
9
9
|
export type { HostedFile } from "./types/files";
|
|
10
10
|
export { FilterSlot, type Filter, type FilterSlotContent, type CurrentFilterChangeEvent, } from "./types/filter";
|
|
11
|
-
export type { HTTPQL, ID, ComponentDefinition } from "./types/utils";
|
|
11
|
+
export type { HTTPQL, ID, ComponentDefinition, Selection } from "./types/utils";
|
|
12
12
|
export type { JSONValue, JSONCompatible } from "./types/json";
|
|
13
13
|
export type { SlotContent, ButtonSlotContent, CustomSlotContent, CommandSlotContent, } from "./types/slots";
|
|
14
14
|
export type { RequestViewModeOptions, RequestFull, RequestDraft, RequestMeta, } from "./types/request";
|
|
15
|
+
export type { ResponseViewModeOptions, ResponseFull } from "./types/response";
|
|
15
16
|
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";
|
|
16
17
|
export { MatchReplaceSlot, type MatchReplaceSlotContent, } from "./types/matchReplace";
|
|
17
18
|
export { ScopeSlot, type CurrentScopeChangeEvent, type Scope, type ScopeSlotContent, } from "./types/scopes";
|
|
@@ -25,3 +26,22 @@ export type { CommandPaletteView } from "./sdks/commandPalette";
|
|
|
25
26
|
export type { LogSDK } from "./sdks/log";
|
|
26
27
|
export type { API } from "./sdks";
|
|
27
28
|
export { Routes } from "./types/navigation";
|
|
29
|
+
export { type GlobalContext, type PageContext } from "./types/window";
|
|
30
|
+
export type { AssistantPageContext } from "./types/assistant";
|
|
31
|
+
export type { AutomatePageContext } from "./types/automate";
|
|
32
|
+
export type { BackupsPageContext } from "./types/backups";
|
|
33
|
+
export type { CertificatePageContext } from "./types/certificate";
|
|
34
|
+
export type { EnvironmentPageContext } from "./types/environment";
|
|
35
|
+
export type { ExportsPageContext } from "./types/exports";
|
|
36
|
+
export type { FilesPageContext } from "./types/files";
|
|
37
|
+
export type { FilterPageContext } from "./types/filter";
|
|
38
|
+
export type { FindingsPageContext } from "./types/findings";
|
|
39
|
+
export type { HTTPHistoryPageContext } from "./types/httpHistory";
|
|
40
|
+
export type { InterceptPageContext } from "./types/intercept";
|
|
41
|
+
export type { ProjectsPageContext } from "./types/projects";
|
|
42
|
+
export type { ReplayPageContext } from "./types/replay";
|
|
43
|
+
export type { ScopePageContext } from "./types/scopes";
|
|
44
|
+
export type { SearchPageContext } from "./types/search";
|
|
45
|
+
export type { SitemapPageContext } from "./types/sitemap";
|
|
46
|
+
export type { MatchReplacePageContext } from "./types/matchReplace";
|
|
47
|
+
export type { WorkflowsPageContext } from "./types/workflows";
|
|
@@ -2,6 +2,7 @@ import type { Extension } from "@codemirror/state";
|
|
|
2
2
|
import type { AutomateEntry, AutomateSession } from "src/types/automate";
|
|
3
3
|
import type { AddIndicatorOptions, ID, Indicator } from "src/types/utils";
|
|
4
4
|
import type { RequestViewModeOptions } from "../types/request";
|
|
5
|
+
import type { ResponseViewModeOptions } from "../types/response";
|
|
5
6
|
/**
|
|
6
7
|
* Utilities to interact with the Automate page.
|
|
7
8
|
* @category Automate
|
|
@@ -17,6 +18,11 @@ export type AutomateSDK = {
|
|
|
17
18
|
* @param options The view mode options.
|
|
18
19
|
*/
|
|
19
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;
|
|
20
26
|
/**
|
|
21
27
|
* Get the list of all automate sessions.
|
|
22
28
|
* @returns The list of all automate sessions.
|
|
@@ -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,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.
|
|
@@ -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 { SitemapEntry, SitemapEntryChildStateUpdateEvent, SitemapRootEntry } from "../types/sitemap";
|
|
4
5
|
import type { AddIndicatorOptions, ID, Indicator, ListenerHandle } from "../types/utils";
|
|
5
6
|
/**
|
|
@@ -53,6 +54,11 @@ export type SitemapSDK = {
|
|
|
53
54
|
* @param options The view mode options.
|
|
54
55
|
*/
|
|
55
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;
|
|
56
62
|
/**
|
|
57
63
|
* Add an indicator to a sitemap session.
|
|
58
64
|
* Indicators are displayed next to the entry name in the collections tree.
|
|
@@ -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
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ID, type Selection } from "./utils";
|
|
2
2
|
/**
|
|
3
3
|
* A automate session.
|
|
4
4
|
* @category Automate
|
|
@@ -39,3 +39,18 @@ export type AutomateEntry = {
|
|
|
39
39
|
*/
|
|
40
40
|
createdAt: Date;
|
|
41
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 {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { As, ComponentDefinition, ID, Prettify } from "./utils";
|
|
2
|
+
/**
|
|
3
|
+
* A complete response with all metadata and raw content.
|
|
4
|
+
* @category Response
|
|
5
|
+
*/
|
|
6
|
+
export type ResponseFull = Prettify<As<"ResponseFull"> & {
|
|
7
|
+
id: ID;
|
|
8
|
+
raw: string;
|
|
9
|
+
statusCode: number;
|
|
10
|
+
roundtripTime: number;
|
|
11
|
+
length: number;
|
|
12
|
+
createdAt: Date;
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* Options for defining a custom response view mode.
|
|
16
|
+
* @category Response
|
|
17
|
+
*/
|
|
18
|
+
export type ResponseViewModeOptions = {
|
|
19
|
+
/**
|
|
20
|
+
* The label of the view mode.
|
|
21
|
+
*/
|
|
22
|
+
label: string;
|
|
23
|
+
/**
|
|
24
|
+
* The component to render when the view mode is selected.
|
|
25
|
+
*/
|
|
26
|
+
view: ComponentDefinition;
|
|
27
|
+
};
|
|
@@ -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
|
* Represents a scope.
|
|
5
5
|
* @category Scopes
|
|
@@ -51,3 +51,11 @@ export type CurrentScopeChangeEvent = {
|
|
|
51
51
|
*/
|
|
52
52
|
scopeId: ID | undefined;
|
|
53
53
|
};
|
|
54
|
+
/**
|
|
55
|
+
* Scope page context.
|
|
56
|
+
* @category Scopes
|
|
57
|
+
*/
|
|
58
|
+
export type ScopePageContext = {
|
|
59
|
+
kind: "Scope";
|
|
60
|
+
selection: Selection<ID>;
|
|
61
|
+
};
|
|
@@ -13,3 +13,10 @@ export type SearchSlot = (typeof SearchSlot)[keyof typeof SearchSlot];
|
|
|
13
13
|
export type SearchSlotContent = {
|
|
14
14
|
[SearchSlot.ToolbarPrimary]: ButtonSlotContent | CustomSlotContent | CommandSlotContent;
|
|
15
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* Search page context.
|
|
18
|
+
* @category Search
|
|
19
|
+
*/
|
|
20
|
+
export type SearchPageContext = {
|
|
21
|
+
kind: "Search";
|
|
22
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ID } from "./utils";
|
|
1
|
+
import { type ID, type Selection } from "./utils";
|
|
2
2
|
/**
|
|
3
3
|
* An entry in sitemap.
|
|
4
4
|
* @category Sitemap
|
|
@@ -85,3 +85,12 @@ export type SitemapEntryChildStateUpdateEvent = {
|
|
|
85
85
|
*/
|
|
86
86
|
newChildState: ChildState;
|
|
87
87
|
};
|
|
88
|
+
/**
|
|
89
|
+
* Sitemap page context.
|
|
90
|
+
* @category Sitemap
|
|
91
|
+
*/
|
|
92
|
+
export type SitemapPageContext = {
|
|
93
|
+
kind: "Sitemap";
|
|
94
|
+
entrySelection: Selection<ID>;
|
|
95
|
+
requestSelection: Selection<ID>;
|
|
96
|
+
};
|
|
@@ -60,6 +60,18 @@ export type Prettify<T> = {
|
|
|
60
60
|
export type As<TType extends string> = {
|
|
61
61
|
type: TType;
|
|
62
62
|
};
|
|
63
|
+
/**
|
|
64
|
+
* Generic selection type with main and secondary items.
|
|
65
|
+
* Main represents the primary selected item, secondary represents additional selected items.
|
|
66
|
+
* @category Utils
|
|
67
|
+
*/
|
|
68
|
+
export type Selection<TId> = {
|
|
69
|
+
kind: "Empty";
|
|
70
|
+
} | {
|
|
71
|
+
kind: "Selected";
|
|
72
|
+
main: TId;
|
|
73
|
+
secondary: TId[];
|
|
74
|
+
};
|
|
63
75
|
/**
|
|
64
76
|
* Visual indicator displayed next to a item label in a tree component.
|
|
65
77
|
* Includes an icon and an associated description.
|
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
import type { AssistantPageContext } from "./assistant";
|
|
2
|
+
import type { AutomatePageContext } from "./automate";
|
|
3
|
+
import type { BackupsPageContext } from "./backups";
|
|
4
|
+
import type { CertificatePageContext } from "./certificate";
|
|
5
|
+
import type { EnvironmentPageContext } from "./environment";
|
|
6
|
+
import type { ExportsPageContext } from "./exports";
|
|
7
|
+
import type { FilesPageContext } from "./files";
|
|
8
|
+
import type { FilterPageContext } from "./filter";
|
|
9
|
+
import type { FindingsPageContext } from "./findings";
|
|
10
|
+
import type { HTTPHistoryPageContext } from "./httpHistory";
|
|
11
|
+
import type { InterceptPageContext } from "./intercept";
|
|
12
|
+
import type { MatchReplacePageContext } from "./matchReplace";
|
|
13
|
+
import type { ProjectsPageContext } from "./projects";
|
|
14
|
+
import type { ReplayPageContext } from "./replay";
|
|
15
|
+
import type { ScopePageContext } from "./scopes";
|
|
16
|
+
import type { SearchPageContext } from "./search";
|
|
17
|
+
import type { SitemapPageContext } from "./sitemap";
|
|
18
|
+
import { type WebsocketPageContext } from "./websocket";
|
|
19
|
+
import type { WorkflowsPageContext } from "./workflows";
|
|
1
20
|
/**
|
|
2
21
|
* Options for configuring a dialog.
|
|
3
22
|
* @category Window
|
|
@@ -17,3 +36,15 @@ export type DialogOptions = {
|
|
|
17
36
|
export type Dialog = {
|
|
18
37
|
close: () => void;
|
|
19
38
|
};
|
|
39
|
+
/**
|
|
40
|
+
* Represents the context of the current page.
|
|
41
|
+
* @category Window
|
|
42
|
+
*/
|
|
43
|
+
export type PageContext = AssistantPageContext | AutomatePageContext | BackupsPageContext | CertificatePageContext | ExportsPageContext | EnvironmentPageContext | FilterPageContext | FindingsPageContext | HTTPHistoryPageContext | ReplayPageContext | ScopePageContext | SearchPageContext | WorkflowsPageContext | ProjectsPageContext | FilesPageContext | MatchReplacePageContext | InterceptPageContext | SitemapPageContext | WebsocketPageContext;
|
|
44
|
+
/**
|
|
45
|
+
* Represents the global context of the application.
|
|
46
|
+
* @category Window
|
|
47
|
+
*/
|
|
48
|
+
export type GlobalContext = {
|
|
49
|
+
page?: PageContext;
|
|
50
|
+
};
|
|
@@ -35,3 +35,10 @@ export type OnUpdatedWorkflowCallback = (event: {
|
|
|
35
35
|
export type OnDeletedWorkflowCallback = (event: {
|
|
36
36
|
id: ID;
|
|
37
37
|
}) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Workflows page context.
|
|
40
|
+
* @category Workflows
|
|
41
|
+
*/
|
|
42
|
+
export type WorkflowsPageContext = {
|
|
43
|
+
kind: "Workflows";
|
|
44
|
+
};
|