@caido/sdk-frontend 0.56.1 → 0.56.3-beta.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.
- package/package.json +1 -1
- package/src/types/__generated__/graphql-sdk.d.ts +31140 -2015
- package/src/types/index.d.ts +9 -7
- package/src/types/sdks/automate.d.ts +4 -4
- package/src/types/sdks/backend.d.ts +11 -4
- package/src/types/sdks/commandPalette.d.ts +2 -1
- package/src/types/sdks/findings.d.ts +4 -4
- package/src/types/sdks/httpHistory.d.ts +4 -4
- package/src/types/sdks/index.d.ts +7 -2
- package/src/types/sdks/intercept.d.ts +4 -4
- package/src/types/sdks/matchReplace.d.ts +5 -5
- package/src/types/sdks/replay.d.ts +6 -12
- package/src/types/sdks/search.d.ts +4 -4
- package/src/types/sdks/sitemap.d.ts +4 -4
- package/src/types/sdks/websocket.d.ts +12 -0
- package/src/types/sdks/window.d.ts +3 -3
- package/src/types/types/backend.d.ts +8 -0
- package/src/types/types/commandPalette.d.ts +22 -0
- package/src/types/types/filter.d.ts +3 -4
- package/src/types/types/findings.d.ts +1 -1
- package/src/types/types/footer.d.ts +3 -4
- package/src/types/types/httpHistory.d.ts +7 -3
- package/src/types/types/matchReplace.d.ts +34 -5
- package/src/types/types/replay.d.ts +31 -49
- package/src/types/types/request.d.ts +40 -2
- package/src/types/types/response.d.ts +19 -2
- package/src/types/types/scopes.d.ts +7 -4
- package/src/types/types/search.d.ts +7 -3
- package/src/types/types/slots.d.ts +21 -3
- package/src/types/types/utils.d.ts +31 -3
- package/src/types/types/websocket.d.ts +48 -0
- package/src/types/types/window.d.ts +6 -0
package/src/types/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { FooterSlot, type FooterSlotContent } from "./types/footer";
|
|
2
|
-
export type { DialogOptions } from "./types/window";
|
|
2
|
+
export type { DialogOptions, DialogComponent } from "./types/window";
|
|
3
3
|
export type { _AnalyticsSDK } from "./private/analytics";
|
|
4
|
+
export type { MessageViewModeOptions, StreamWsMessageMeta, MessageViewModePropsInternal, MessageViewModeProps, } from "./types/websocket";
|
|
4
5
|
export type { CommandContext, CommandContextRequest, CommandContextRequestRow, CommandContextResponse, CommandContextBase, } from "./types/commands";
|
|
5
6
|
export type { MenuItem } from "./types/menu";
|
|
6
7
|
export { type ReplayTab, type ReplaySession, type ReplayEntry, type ReplayCollection, type SendRequestOptions, ReplaySlot, type ReplaySlotContent, type RequestSource, type CurrentReplaySessionChangeEvent, } from "./types/replay";
|
|
@@ -9,21 +10,22 @@ export type { SitemapEntry, SitemapRootEntry, ChildState, } from "./types/sitema
|
|
|
9
10
|
export { SearchSlot, type SearchSlotContent } from "./types/search";
|
|
10
11
|
export type { HostedFile } from "./types/files";
|
|
11
12
|
export { FilterSlot, type Filter, type FilterSlotContent, type CurrentFilterChangeEvent, } from "./types/filter";
|
|
12
|
-
export type { HTTPQL, ID, ComponentDefinition, Selection } from "./types/utils";
|
|
13
|
+
export type { HTTPQL, StreamQL, ID, ComponentDefinition, Selection, QueryInput, } from "./types/utils";
|
|
13
14
|
export type { JSONValue, JSONCompatible } from "./types/json";
|
|
14
|
-
export type { SlotContent, ButtonSlotContent, CustomSlotContent, CommandSlotContent, } from "./types/slots";
|
|
15
|
-
export type { RequestViewModeOptions, RequestFull, RequestDraft, RequestMeta, } from "./types/request";
|
|
16
|
-
export type { ResponseViewModeOptions, ResponseFull } from "./types/response";
|
|
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";
|
|
15
|
+
export type { SlotContent, ButtonSlotContent, CustomSlotContent, CommandSlotContent, SlotContentPropsInternal, SlotContentProps, } from "./types/slots";
|
|
16
|
+
export type { RequestViewModeOptions, RequestWritableViewModeProps, RequestReadableViewModeProps, RequestReadableViewModePropsInternal, RequestWritableViewModePropsInternal, RequestViewModeProps, RequestFull, RequestDraft, RequestMeta, } from "./types/request";
|
|
17
|
+
export type { ResponseViewModePropsInternal, ResponseViewModeOptions, ResponseViewModeProps, ResponseFull, } from "./types/response";
|
|
18
|
+
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, MatchReplaceSectionResponseWebsocket, MatchReplaceSectionRequestWebsocket, MatchReplaceOperationWebsocket, MatchReplaceOperationWebsocketRaw, } from "./types/matchReplace";
|
|
18
19
|
export { MatchReplaceSlot, type MatchReplaceSlotContent, } from "./types/matchReplace";
|
|
19
20
|
export { ScopeSlot, type CurrentScopeChangeEvent, type Scope, type ScopeSlotContent, } from "./types/scopes";
|
|
20
21
|
export { HTTPHistorySlot, type HTTPHistorySlotContent, } from "./types/httpHistory";
|
|
21
22
|
export { SettingsSlot, type SettingsSlotContent, type SettingsPluginSlotContent, } from "./types/settings";
|
|
22
23
|
export type { EnvironmentVariable } from "./types/environment";
|
|
23
24
|
export type { Workflow, WorkflowKind, OnCreatedWorkflowCallback, OnUpdatedWorkflowCallback, OnDeletedWorkflowCallback, } from "./types/workflows";
|
|
24
|
-
export type { ListenerHandle, AddIndicatorOptions, Indicator, } from "./types/utils";
|
|
25
|
+
export type { ListenerHandle, AddIndicatorOptions, Indicator, ComponentProps, ComponentPropsWithSdk, } from "./types/utils";
|
|
25
26
|
export type { AIProvider, AILanguageModelSettings, AIReasoningSettings, AIUpstreamProvider, AIUpstreamProviderId, AIUpstreamProviderStatus, } from "./types/ai";
|
|
26
27
|
export type { SelectedProjectChangeEvent } from "./types/projects";
|
|
28
|
+
export type { CommandPaletteViewProps, CommandPaletteViewPropsInternal, } from "./types/commandPalette";
|
|
27
29
|
export type { CommandPaletteView } from "./sdks/commandPalette";
|
|
28
30
|
export type { LogSDK } from "./sdks/log";
|
|
29
31
|
export type { API } from "./sdks";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Extension } from "@codemirror/state";
|
|
2
2
|
import type { AutomateEntry, AutomateSession } from "../types/automate";
|
|
3
|
-
import type { RequestViewModeOptions } from "../types/request";
|
|
4
|
-
import type { ResponseViewModeOptions } from "../types/response";
|
|
3
|
+
import type { RequestReadableViewModeProps, RequestViewModeOptions } from "../types/request";
|
|
4
|
+
import type { ResponseViewModeOptions, ResponseViewModeProps } from "../types/response";
|
|
5
5
|
import type { AddIndicatorOptions, ID, Indicator } from "../types/utils";
|
|
6
6
|
/**
|
|
7
7
|
* Utilities to interact with the Automate page.
|
|
@@ -17,12 +17,12 @@ export type AutomateSDK = {
|
|
|
17
17
|
* Add a custom request view mode.
|
|
18
18
|
* @param options The view mode options.
|
|
19
19
|
*/
|
|
20
|
-
addRequestViewMode: (options: RequestViewModeOptions) => void;
|
|
20
|
+
addRequestViewMode: (options: RequestViewModeOptions<RequestReadableViewModeProps>) => void;
|
|
21
21
|
/**
|
|
22
22
|
* Add a custom response view mode.
|
|
23
23
|
* @param options The view mode options.
|
|
24
24
|
*/
|
|
25
|
-
addResponseViewMode: (options: ResponseViewModeOptions) => void;
|
|
25
|
+
addResponseViewMode: (options: ResponseViewModeOptions<ResponseViewModeProps>) => void;
|
|
26
26
|
/**
|
|
27
27
|
* Get the list of all automate sessions.
|
|
28
28
|
* @returns The list of all automate sessions.
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import { type BackendEndpoints, type BackendEvents } from "../types/backend";
|
|
1
|
+
import { type BackendEndpoints, type BackendEvents, type BackendSpec } from "../types/backend";
|
|
2
2
|
import type { PromisifiedReturnType } from "../types/utils";
|
|
3
|
+
type ResolvedAPI<T> = T extends {
|
|
4
|
+
api: infer A;
|
|
5
|
+
} ? A : T;
|
|
6
|
+
type ResolvedEvents<T, E> = T extends {
|
|
7
|
+
events: infer A;
|
|
8
|
+
} ? A : E;
|
|
3
9
|
/**
|
|
4
10
|
* Utilities to interact with the backend plugin.
|
|
5
11
|
* @category Backend
|
|
6
12
|
*/
|
|
7
|
-
export type BackendSDK<T extends BackendEndpoints, E extends BackendEvents> = {
|
|
8
|
-
[K in keyof T]: (...args: Parameters<T[K]>) => PromisifiedReturnType<T[K]>;
|
|
13
|
+
export type BackendSDK<T extends BackendEndpoints | BackendSpec, E extends BackendEvents> = {
|
|
14
|
+
[K in keyof ResolvedAPI<T>]: (...args: Parameters<ResolvedAPI<T>[K]>) => PromisifiedReturnType<ResolvedAPI<T>[K]>;
|
|
9
15
|
} & {
|
|
10
16
|
/**
|
|
11
17
|
* Subscribe to a backend event.
|
|
@@ -13,7 +19,8 @@ export type BackendSDK<T extends BackendEndpoints, E extends BackendEvents> = {
|
|
|
13
19
|
* @param callback The callback to call when the event is emitted.
|
|
14
20
|
* @returns An object with a `stop` method that can be called to stop listening to the event.
|
|
15
21
|
*/
|
|
16
|
-
onEvent: <K extends keyof E
|
|
22
|
+
onEvent: <K extends keyof ResolvedEvents<T, E>>(event: K, callback: ResolvedEvents<T, E>[K]) => {
|
|
17
23
|
stop: () => void;
|
|
18
24
|
};
|
|
19
25
|
};
|
|
26
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type CommandPaletteViewProps } from "../types/commandPalette";
|
|
1
2
|
import { type CommandID } from "../types/commands";
|
|
2
3
|
import { type ComponentDefinition } from "../types/utils";
|
|
3
4
|
/**
|
|
@@ -6,7 +7,7 @@ import { type ComponentDefinition } from "../types/utils";
|
|
|
6
7
|
*/
|
|
7
8
|
export type CommandPaletteView = {
|
|
8
9
|
type: "Custom";
|
|
9
|
-
definition: ComponentDefinition
|
|
10
|
+
definition: ComponentDefinition<CommandPaletteViewProps>;
|
|
10
11
|
};
|
|
11
12
|
/**
|
|
12
13
|
* Utilities to interact with the command palette.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Extension } from "@codemirror/state";
|
|
2
2
|
import { type Finding } from "../types/findings";
|
|
3
|
-
import type { RequestViewModeOptions } from "../types/request";
|
|
4
|
-
import type { ResponseViewModeOptions } from "../types/response";
|
|
3
|
+
import type { RequestReadableViewModeProps, RequestViewModeOptions } from "../types/request";
|
|
4
|
+
import type { ResponseViewModeOptions, ResponseViewModeProps } from "../types/response";
|
|
5
5
|
import type { ID } from "../types/utils";
|
|
6
6
|
/**
|
|
7
7
|
* Utilities to interact with findings
|
|
@@ -33,10 +33,10 @@ export type FindingsSDK = {
|
|
|
33
33
|
* Add a custom request view mode.
|
|
34
34
|
* @param options The view mode options.
|
|
35
35
|
*/
|
|
36
|
-
addRequestViewMode: (options: RequestViewModeOptions) => void;
|
|
36
|
+
addRequestViewMode: (options: RequestViewModeOptions<RequestReadableViewModeProps>) => void;
|
|
37
37
|
/**
|
|
38
38
|
* Add a custom response view mode.
|
|
39
39
|
* @param options The view mode options.
|
|
40
40
|
*/
|
|
41
|
-
addResponseViewMode: (options: ResponseViewModeOptions) => void;
|
|
41
|
+
addResponseViewMode: (options: ResponseViewModeOptions<ResponseViewModeProps>) => void;
|
|
42
42
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Extension } from "@codemirror/state";
|
|
2
2
|
import type { HTTPHistorySlotContent } from "../types/httpHistory";
|
|
3
|
-
import type { RequestViewModeOptions } from "../types/request";
|
|
4
|
-
import type { ResponseViewModeOptions } from "../types/response";
|
|
3
|
+
import type { RequestReadableViewModeProps, RequestViewModeOptions } from "../types/request";
|
|
4
|
+
import type { ResponseViewModeOptions, ResponseViewModeProps } from "../types/response";
|
|
5
5
|
import { type DefineAddToSlotFn } from "../types/slots";
|
|
6
6
|
import type { HTTPQL, ID } from "../types/utils";
|
|
7
7
|
/**
|
|
@@ -43,12 +43,12 @@ export type HTTPHistorySDK = {
|
|
|
43
43
|
* Add a custom request view mode.
|
|
44
44
|
* @param options The view mode options.
|
|
45
45
|
*/
|
|
46
|
-
addRequestViewMode: (options: RequestViewModeOptions) => void;
|
|
46
|
+
addRequestViewMode: (options: RequestViewModeOptions<RequestReadableViewModeProps>) => void;
|
|
47
47
|
/**
|
|
48
48
|
* Add a custom response view mode.
|
|
49
49
|
* @param options The view mode options.
|
|
50
50
|
*/
|
|
51
|
-
addResponseViewMode: (options: ResponseViewModeOptions) => void;
|
|
51
|
+
addResponseViewMode: (options: ResponseViewModeOptions<ResponseViewModeProps>) => void;
|
|
52
52
|
/**
|
|
53
53
|
* Scrolls the HTTP History table to a specific entry.
|
|
54
54
|
* @param id The ID of the entry to scroll to.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Sdk as GraphqlSDK } from "../__generated__/graphql-sdk";
|
|
2
2
|
import type { _AnalyticsSDK } from "../private/analytics";
|
|
3
|
-
import { type BackendEndpoints, type BackendEvents } from "../types/backend";
|
|
3
|
+
import { type BackendEndpoints, type BackendEvents, type BackendSpec } from "../types/backend";
|
|
4
4
|
import type { AiSDK } from "./ai";
|
|
5
5
|
import type { AssetsSDK } from "./assets";
|
|
6
6
|
import type { AutomateSDK } from "./automate";
|
|
@@ -29,13 +29,14 @@ import type { SidebarSDK } from "./sidebar";
|
|
|
29
29
|
import type { SitemapSDK } from "./sitemap";
|
|
30
30
|
import type { StorageSDK } from "./storage";
|
|
31
31
|
import type { UISDK } from "./ui";
|
|
32
|
+
import type { WebsocketSDK } from "./websocket";
|
|
32
33
|
import type { WindowSDK } from "./window";
|
|
33
34
|
import type { WorkflowSDK } from "./workflows";
|
|
34
35
|
/**
|
|
35
36
|
* Utilities for frontend plugins.
|
|
36
37
|
* @category SDK
|
|
37
38
|
*/
|
|
38
|
-
export type API<T extends BackendEndpoints = Record<string, never>, E extends BackendEvents = Record<string, never>> = {
|
|
39
|
+
export type API<T extends BackendEndpoints | BackendSpec = Record<string, never>, E extends BackendEvents = Record<string, never>> = {
|
|
39
40
|
/**
|
|
40
41
|
* Utilities to interact with the GraphQL API.
|
|
41
42
|
*/
|
|
@@ -160,6 +161,10 @@ export type API<T extends BackendEndpoints = Record<string, never>, E extends Ba
|
|
|
160
161
|
* Utilities to interact with the settings page.
|
|
161
162
|
*/
|
|
162
163
|
settings: SettingsSDK;
|
|
164
|
+
/**
|
|
165
|
+
* Utilities to interact with the Websocket page.
|
|
166
|
+
*/
|
|
167
|
+
websocket: WebsocketSDK;
|
|
163
168
|
/**
|
|
164
169
|
* @private
|
|
165
170
|
* Utilities to track analytics events.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { RequestViewModeOptions } from "../types/request";
|
|
2
|
-
import type { ResponseViewModeOptions } from "../types/response";
|
|
1
|
+
import type { RequestViewModeOptions, RequestWritableViewModeProps } from "../types/request";
|
|
2
|
+
import type { ResponseViewModeOptions, ResponseViewModeProps } from "../types/response";
|
|
3
3
|
import type { ID } from "../types/utils";
|
|
4
4
|
/**
|
|
5
5
|
* Utilities to interact with the Intercept page.
|
|
@@ -20,10 +20,10 @@ export type InterceptSDK = {
|
|
|
20
20
|
* Add a custom request view mode.
|
|
21
21
|
* @param options The view mode options.
|
|
22
22
|
*/
|
|
23
|
-
addRequestViewMode: (options: RequestViewModeOptions) => void;
|
|
23
|
+
addRequestViewMode: (options: RequestViewModeOptions<RequestWritableViewModeProps>) => void;
|
|
24
24
|
/**
|
|
25
25
|
* Add a custom response view mode.
|
|
26
26
|
* @param options The view mode options.
|
|
27
27
|
*/
|
|
28
|
-
addResponseViewMode: (options: ResponseViewModeOptions) => void;
|
|
28
|
+
addResponseViewMode: (options: ResponseViewModeOptions<ResponseViewModeProps>) => void;
|
|
29
29
|
};
|
|
@@ -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 { AddIndicatorOptions,
|
|
3
|
+
import type { AddIndicatorOptions, ID, Indicator, ListenerHandle, QueryInput } from "../types/utils";
|
|
4
4
|
/**
|
|
5
5
|
* Utilities to interact with the Match and Replace page.
|
|
6
6
|
* @category Match and Replace
|
|
@@ -73,13 +73,13 @@ export type MatchReplaceSDK = {
|
|
|
73
73
|
* Create a rule.
|
|
74
74
|
* @param options - The options for the rule.
|
|
75
75
|
* @param options.name - The name of the rule.
|
|
76
|
-
* @param options.query - The
|
|
76
|
+
* @param options.query - The query to match the rule against.
|
|
77
77
|
* @param options.collectionId - The ID of the collection the rule belongs to.
|
|
78
78
|
* @param options.sources - The sources the rule belongs to.
|
|
79
79
|
*/
|
|
80
80
|
createRule: (options: {
|
|
81
81
|
name: string;
|
|
82
|
-
query:
|
|
82
|
+
query: QueryInput;
|
|
83
83
|
section: MatchReplaceSection;
|
|
84
84
|
collectionId: ID;
|
|
85
85
|
sources: Array<Source>;
|
|
@@ -89,13 +89,13 @@ export type MatchReplaceSDK = {
|
|
|
89
89
|
* @param id - The ID of the rule.
|
|
90
90
|
* @param options - The new values for the rule.
|
|
91
91
|
* @param options.name - The new name of the rule.
|
|
92
|
-
* @param options.query - The new
|
|
92
|
+
* @param options.query - The new query of the rule.
|
|
93
93
|
* @param options.section - The new section of the rule.
|
|
94
94
|
* @param options.sources - The new sources of the rule.
|
|
95
95
|
*/
|
|
96
96
|
updateRule: (id: ID, options: {
|
|
97
97
|
name: string;
|
|
98
|
-
query?:
|
|
98
|
+
query?: QueryInput;
|
|
99
99
|
section: MatchReplaceSection;
|
|
100
100
|
sources: Array<Source>;
|
|
101
101
|
}) => Promise<MatchReplaceRule>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
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
|
-
import type { RequestViewModeOptions } from "../types/request";
|
|
4
|
-
import type { ResponseViewModeOptions } from "../types/response";
|
|
3
|
+
import type { RequestViewModeOptions, RequestWritableViewModeProps } from "../types/request";
|
|
4
|
+
import type { ResponseViewModeOptions, ResponseViewModeProps } from "../types/response";
|
|
5
5
|
import { type DefineAddToSlotFn } from "../types/slots";
|
|
6
6
|
import type { AddIndicatorOptions, ID, Indicator, ListenerHandle } from "../types/utils";
|
|
7
7
|
/**
|
|
@@ -129,12 +129,12 @@ export type ReplaySDK = {
|
|
|
129
129
|
* Add a custom view mode for requests.
|
|
130
130
|
* @param options The view mode options.
|
|
131
131
|
*/
|
|
132
|
-
addRequestViewMode: (options: RequestViewModeOptions) => void;
|
|
132
|
+
addRequestViewMode: (options: RequestViewModeOptions<RequestWritableViewModeProps>) => void;
|
|
133
133
|
/**
|
|
134
134
|
* Add a custom response view mode.
|
|
135
135
|
* @param options The view mode options.
|
|
136
136
|
*/
|
|
137
|
-
addResponseViewMode: (options: ResponseViewModeOptions) => void;
|
|
137
|
+
addResponseViewMode: (options: ResponseViewModeOptions<ResponseViewModeProps>) => void;
|
|
138
138
|
/**
|
|
139
139
|
* Send a request to the Replay backend.
|
|
140
140
|
* @param request The request to send.
|
|
@@ -159,18 +159,12 @@ export type ReplaySDK = {
|
|
|
159
159
|
* This will open the session tab if not already open, set it as the selected session, and display the specified entry.
|
|
160
160
|
* @param sessionId The ID of the session containing the entry.
|
|
161
161
|
* @param entryId The ID of the entry to show.
|
|
162
|
-
* @param options The options for showing the entry.
|
|
163
|
-
* @param options.overwriteDraft Whether to overwrite the request draft. If true, the draft will be removed and the entry's raw request will be shown. If false, the draft will be kept.
|
|
164
162
|
* @example
|
|
165
163
|
* ```ts
|
|
166
|
-
* await sdk.replay.showEntry(sessionId, entryId
|
|
167
|
-
* overwriteDraft: true,
|
|
168
|
-
* });
|
|
164
|
+
* await sdk.replay.showEntry(sessionId, entryId);
|
|
169
165
|
* ```
|
|
170
166
|
*/
|
|
171
|
-
showEntry: (sessionId: ID, entryId: ID
|
|
172
|
-
overwriteDraft?: boolean;
|
|
173
|
-
}) => Promise<void>;
|
|
167
|
+
showEntry: (sessionId: ID, entryId: ID) => Promise<void>;
|
|
174
168
|
/**
|
|
175
169
|
* Get a replay entry by its ID.
|
|
176
170
|
* @param entryId The ID of the entry to get.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Extension } from "@codemirror/state";
|
|
2
|
-
import type { RequestViewModeOptions } from "../types/request";
|
|
3
|
-
import type { ResponseViewModeOptions } from "../types/response";
|
|
2
|
+
import type { RequestReadableViewModeProps, RequestViewModeOptions } from "../types/request";
|
|
3
|
+
import type { ResponseViewModeOptions, ResponseViewModeProps } from "../types/response";
|
|
4
4
|
import type { SearchSlot, SearchSlotContent } from "../types/search";
|
|
5
5
|
import type { HTTPQL, ID } from "../types/utils";
|
|
6
6
|
/**
|
|
@@ -37,12 +37,12 @@ export type SearchSDK = {
|
|
|
37
37
|
* Add a custom request view mode.
|
|
38
38
|
* @param options The view mode options.
|
|
39
39
|
*/
|
|
40
|
-
addRequestViewMode: (options: RequestViewModeOptions) => void;
|
|
40
|
+
addRequestViewMode: (options: RequestViewModeOptions<RequestReadableViewModeProps>) => void;
|
|
41
41
|
/**
|
|
42
42
|
* Add a custom response view mode.
|
|
43
43
|
* @param options The view mode options.
|
|
44
44
|
*/
|
|
45
|
-
addResponseViewMode: (options: ResponseViewModeOptions) => void;
|
|
45
|
+
addResponseViewMode: (options: ResponseViewModeOptions<ResponseViewModeProps>) => void;
|
|
46
46
|
/**
|
|
47
47
|
* Scrolls the Search table to a specific request.
|
|
48
48
|
* @param id The ID of the request to scroll to.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Extension } from "@codemirror/state";
|
|
2
|
-
import type { RequestViewModeOptions } from "../types/request";
|
|
3
|
-
import type { ResponseViewModeOptions } from "../types/response";
|
|
2
|
+
import type { RequestReadableViewModeProps, RequestViewModeOptions } from "../types/request";
|
|
3
|
+
import type { ResponseViewModeOptions, ResponseViewModeProps } from "../types/response";
|
|
4
4
|
import type { SitemapEntry, SitemapEntryChildStateUpdateEvent, SitemapRootEntry } from "../types/sitemap";
|
|
5
5
|
import type { AddIndicatorOptions, ID, Indicator, ListenerHandle } from "../types/utils";
|
|
6
6
|
/**
|
|
@@ -53,12 +53,12 @@ export type SitemapSDK = {
|
|
|
53
53
|
* Add a custom request view mode.
|
|
54
54
|
* @param options The view mode options.
|
|
55
55
|
*/
|
|
56
|
-
addRequestViewMode: (options: RequestViewModeOptions) => void;
|
|
56
|
+
addRequestViewMode: (options: RequestViewModeOptions<RequestReadableViewModeProps>) => void;
|
|
57
57
|
/**
|
|
58
58
|
* Add a custom response view mode.
|
|
59
59
|
* @param options The view mode options.
|
|
60
60
|
*/
|
|
61
|
-
addResponseViewMode: (options: ResponseViewModeOptions) => void;
|
|
61
|
+
addResponseViewMode: (options: ResponseViewModeOptions<ResponseViewModeProps>) => void;
|
|
62
62
|
/**
|
|
63
63
|
* Add an indicator to a sitemap session.
|
|
64
64
|
* Indicators are displayed next to the entry name in the collections tree.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { MessageViewModeOptions, MessageViewModeProps } from "../types/websocket";
|
|
2
|
+
/**
|
|
3
|
+
* Utilities to interact with websockets
|
|
4
|
+
* @category Websockets
|
|
5
|
+
*/
|
|
6
|
+
export type WebsocketSDK = {
|
|
7
|
+
/**
|
|
8
|
+
* Add a custom message view mode.
|
|
9
|
+
* @param options The view mode options.
|
|
10
|
+
*/
|
|
11
|
+
addMessageViewMode: (options: MessageViewModeOptions<MessageViewModeProps>) => void;
|
|
12
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Editor } from "../types/editor";
|
|
2
|
-
import type {
|
|
3
|
-
import { type Dialog, type DialogOptions, type GlobalContext } from "../types/window";
|
|
2
|
+
import type { ListenerHandle } from "../types/utils";
|
|
3
|
+
import { type Dialog, type DialogComponent, type DialogOptions, type GlobalContext } from "../types/window";
|
|
4
4
|
/**
|
|
5
5
|
* Utilities to interact with the active page.
|
|
6
6
|
* @category Window
|
|
@@ -34,7 +34,7 @@ export type WindowSDK = {
|
|
|
34
34
|
* @param options.closable Whether the close icon is hidden . Defaults to false
|
|
35
35
|
* @returns A dialog object that can be used to close the dialog.
|
|
36
36
|
*/
|
|
37
|
-
showDialog: (component:
|
|
37
|
+
showDialog: (component: DialogComponent, options?: DialogOptions) => Dialog;
|
|
38
38
|
/**
|
|
39
39
|
* Get the current global context.
|
|
40
40
|
* @returns The current global context.
|
|
@@ -12,3 +12,11 @@ export type BackendEndpoints = {
|
|
|
12
12
|
export type BackendEvents = {
|
|
13
13
|
[key: string]: (...args: any[]) => void;
|
|
14
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* A specification for the backend plugin.
|
|
17
|
+
* @category Backend
|
|
18
|
+
*/
|
|
19
|
+
export type BackendSpec = {
|
|
20
|
+
api: BackendEndpoints;
|
|
21
|
+
events: BackendEvents;
|
|
22
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type API } from "../sdks";
|
|
2
|
+
/**
|
|
3
|
+
* The internal props for the command palette view.
|
|
4
|
+
* @category Command Palette
|
|
5
|
+
*/
|
|
6
|
+
export type CommandPaletteViewPropsInternal = {
|
|
7
|
+
/**
|
|
8
|
+
* The function to call when the command palette is closed.
|
|
9
|
+
*/
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
/**
|
|
12
|
+
* The function to call when the command palette is backed.
|
|
13
|
+
*/
|
|
14
|
+
onBack: () => void;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* The props for the command palette view.
|
|
18
|
+
* @category Command Palette
|
|
19
|
+
*/
|
|
20
|
+
export type CommandPaletteViewProps = CommandPaletteViewPropsInternal & {
|
|
21
|
+
sdk: API;
|
|
22
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent } from "./slots";
|
|
1
|
+
import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent, type SlotContentProps, type SlotContentPropsGroup } from "./slots";
|
|
2
2
|
import { type HTTPQL, type ID, type Selection } from "./utils";
|
|
3
3
|
/**
|
|
4
4
|
* Represents a filter.
|
|
@@ -42,9 +42,8 @@ export type FilterSlot = (typeof FilterSlot)[keyof typeof FilterSlot];
|
|
|
42
42
|
* Content that can be added to filter slots.
|
|
43
43
|
* @category Filter
|
|
44
44
|
*/
|
|
45
|
-
export type FilterSlotContent = {
|
|
46
|
-
[FilterSlot
|
|
47
|
-
[FilterSlot.CreateHeader]: ButtonSlotContent | CustomSlotContent | CommandSlotContent;
|
|
45
|
+
export type FilterSlotContent<TProps extends SlotContentPropsGroup = SlotContentProps> = {
|
|
46
|
+
[K in FilterSlot]: ButtonSlotContent | CustomSlotContent<TProps> | CommandSlotContent;
|
|
48
47
|
};
|
|
49
48
|
/**
|
|
50
49
|
* Event fired when the current filter changes.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ID, type Selection } from "./utils";
|
|
2
2
|
/**
|
|
3
|
-
* Represents a {@link https://docs.caido.io/
|
|
3
|
+
* Represents a {@link https://docs.caido.io/app/quickstart/findings.html|Finding}.
|
|
4
4
|
* @category Findings
|
|
5
5
|
*/
|
|
6
6
|
export type Finding = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent } from "./slots";
|
|
1
|
+
import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent, type SlotContentProps, type SlotContentPropsGroup } from "./slots";
|
|
2
2
|
/**
|
|
3
3
|
* The slots in the Footer UI.
|
|
4
4
|
* @category Footer
|
|
@@ -12,7 +12,6 @@ export type FooterSlot = (typeof FooterSlot)[keyof typeof FooterSlot];
|
|
|
12
12
|
* Content that can be added to footer slots.
|
|
13
13
|
* @category Footer
|
|
14
14
|
*/
|
|
15
|
-
export type FooterSlotContent = {
|
|
16
|
-
[FooterSlot
|
|
17
|
-
[FooterSlot.FooterSlotSecondary]: ButtonSlotContent | CustomSlotContent | CommandSlotContent;
|
|
15
|
+
export type FooterSlotContent<TProps extends SlotContentPropsGroup = SlotContentProps> = {
|
|
16
|
+
[K in FooterSlot]: ButtonSlotContent | CustomSlotContent<TProps> | CommandSlotContent;
|
|
18
17
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent } from "./slots";
|
|
1
|
+
import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent, type SlotContentProps, type SlotContentPropsGroup } from "./slots";
|
|
2
2
|
import { type ID, type Selection } from "./utils";
|
|
3
3
|
/**
|
|
4
4
|
* The slots in the HTTP History UI.
|
|
@@ -11,8 +11,12 @@ export declare const HTTPHistorySlot: {
|
|
|
11
11
|
readonly ToolbarPrimary: "toolbar-primary";
|
|
12
12
|
};
|
|
13
13
|
export type HTTPHistorySlot = (typeof HTTPHistorySlot)[keyof typeof HTTPHistorySlot];
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Content that can be added to HTTP history slots.
|
|
16
|
+
* @category HTTP History
|
|
17
|
+
*/
|
|
18
|
+
export type HTTPHistorySlotContent<TProps extends SlotContentPropsGroup = SlotContentProps> = {
|
|
19
|
+
[K in HTTPHistorySlot]: ButtonSlotContent | CustomSlotContent<TProps> | CommandSlotContent;
|
|
16
20
|
};
|
|
17
21
|
/**
|
|
18
22
|
* HTTP history page context.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent } from "./slots";
|
|
1
|
+
import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent, type SlotContentProps, type SlotContentPropsGroup } from "./slots";
|
|
2
2
|
import { type HTTPQL, type ID, type Selection } from "./utils";
|
|
3
3
|
/**
|
|
4
4
|
* A rule in Match and Replace.
|
|
@@ -48,7 +48,7 @@ export type Source = (typeof Source)[keyof typeof Source];
|
|
|
48
48
|
* A discriminated union of all possible match and replace sections.
|
|
49
49
|
* @category Match and Replace
|
|
50
50
|
*/
|
|
51
|
-
export type MatchReplaceSection = MatchReplaceSectionRequestAll | MatchReplaceSectionRequestBody | MatchReplaceSectionRequestFirstLine | MatchReplaceSectionRequestHeader | MatchReplaceSectionRequestMethod | MatchReplaceSectionRequestPath | MatchReplaceSectionRequestQuery | MatchReplaceSectionRequestSNI | MatchReplaceSectionResponseAll | MatchReplaceSectionResponseBody | MatchReplaceSectionResponseFirstLine | MatchReplaceSectionResponseHeader | MatchReplaceSectionResponseStatusCode;
|
|
51
|
+
export type MatchReplaceSection = MatchReplaceSectionRequestAll | MatchReplaceSectionRequestBody | MatchReplaceSectionRequestFirstLine | MatchReplaceSectionRequestHeader | MatchReplaceSectionRequestMethod | MatchReplaceSectionRequestPath | MatchReplaceSectionRequestQuery | MatchReplaceSectionRequestSNI | MatchReplaceSectionResponseAll | MatchReplaceSectionResponseBody | MatchReplaceSectionResponseFirstLine | MatchReplaceSectionResponseHeader | MatchReplaceSectionResponseStatusCode | MatchReplaceSectionResponseWebsocket | MatchReplaceSectionRequestWebsocket;
|
|
52
52
|
/**
|
|
53
53
|
* A section for the entire request.
|
|
54
54
|
* @category Match and Replace
|
|
@@ -100,6 +100,36 @@ export type MatchReplaceOperationStatusCodeUpdate = {
|
|
|
100
100
|
kind: "OperationStatusCodeUpdate";
|
|
101
101
|
replacer: MatchReplaceReplacer;
|
|
102
102
|
};
|
|
103
|
+
/**
|
|
104
|
+
* A section for the response websocket.
|
|
105
|
+
* @category Match and Replace
|
|
106
|
+
*/
|
|
107
|
+
export type MatchReplaceSectionResponseWebsocket = {
|
|
108
|
+
kind: "SectionResponseWebsocket";
|
|
109
|
+
operation: MatchReplaceOperationWebsocket;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* A section for the request websocket.
|
|
113
|
+
* @category Match and Replace
|
|
114
|
+
*/
|
|
115
|
+
export type MatchReplaceSectionRequestWebsocket = {
|
|
116
|
+
kind: "SectionRequestWebsocket";
|
|
117
|
+
operation: MatchReplaceOperationWebsocket;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* An operation for the response websocket section.
|
|
121
|
+
* @category Match and Replace
|
|
122
|
+
*/
|
|
123
|
+
export type MatchReplaceOperationWebsocket = KeepOperation<MatchReplaceOperationWebsocketRaw>;
|
|
124
|
+
/**
|
|
125
|
+
* A raw operation for the response websocket section.
|
|
126
|
+
* @category Match and Replace
|
|
127
|
+
*/
|
|
128
|
+
export type MatchReplaceOperationWebsocketRaw = {
|
|
129
|
+
kind: "OperationWebsocketRaw";
|
|
130
|
+
matcher: MatchReplaceMatcherRaw;
|
|
131
|
+
replacer: MatchReplaceReplacer;
|
|
132
|
+
};
|
|
103
133
|
/**
|
|
104
134
|
* A section for the request query string.
|
|
105
135
|
* @category Match and Replace
|
|
@@ -418,9 +448,8 @@ export type MatchReplaceSlot = (typeof MatchReplaceSlot)[keyof typeof MatchRepla
|
|
|
418
448
|
* Content that can be added to match and replace slots.
|
|
419
449
|
* @category Match and Replace
|
|
420
450
|
*/
|
|
421
|
-
export type MatchReplaceSlotContent = {
|
|
422
|
-
[MatchReplaceSlot
|
|
423
|
-
[MatchReplaceSlot.CreateHeader]: ButtonSlotContent | CustomSlotContent | CommandSlotContent;
|
|
451
|
+
export type MatchReplaceSlotContent<TProps extends SlotContentPropsGroup = SlotContentProps> = {
|
|
452
|
+
[K in MatchReplaceSlot]: ButtonSlotContent | CustomSlotContent<TProps> | CommandSlotContent;
|
|
424
453
|
};
|
|
425
454
|
/**
|
|
426
455
|
* Event fired when the current match and replace rule changes.
|