@caido/sdk-frontend 0.57.1 → 0.57.2-beta.1
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 +2 -2
- package/src/types/__generated__/graphql-sdk.d.ts +87069 -17674
- package/src/types/index.d.ts +16 -9
- package/src/types/sdks/ai.d.ts +2 -2
- package/src/types/sdks/automate.d.ts +14 -4
- package/src/types/sdks/commandPalette.d.ts +2 -1
- package/src/types/sdks/files.d.ts +1 -1
- package/src/types/sdks/findings.d.ts +14 -4
- package/src/types/sdks/httpHistory.d.ts +14 -4
- package/src/types/sdks/index.d.ts +17 -0
- package/src/types/sdks/intercept.d.ts +14 -4
- package/src/types/sdks/replay.d.ts +81 -11
- package/src/types/sdks/search.d.ts +14 -4
- package/src/types/sdks/sitemap.d.ts +14 -4
- package/src/types/sdks/websocket.d.ts +2 -2
- package/src/types/sdks/window.d.ts +13 -3
- package/src/types/types/ai.d.ts +8 -9
- package/src/types/types/commandPalette.d.ts +22 -0
- package/src/types/types/filter.d.ts +3 -4
- package/src/types/types/footer.d.ts +3 -4
- package/src/types/types/httpHistory.d.ts +7 -3
- package/src/types/types/httpqlEditor.d.ts +3 -0
- package/src/types/types/matchReplace.d.ts +3 -4
- package/src/types/types/replay.d.ts +68 -6
- 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 +16 -3
- package/src/types/types/websocket.d.ts +17 -3
- package/src/types/types/window.d.ts +6 -0
package/src/types/index.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import type { DefineComponent } from "vue";
|
|
2
|
+
import type { HTTPQLEditorProps } from "./types/httpqlEditor";
|
|
1
3
|
export { FooterSlot, type FooterSlotContent } from "./types/footer";
|
|
2
|
-
export type { DialogOptions } from "./types/window";
|
|
4
|
+
export type { DialogOptions, DialogComponent } from "./types/window";
|
|
5
|
+
export type { Editor } from "./types/editor";
|
|
3
6
|
export type { _AnalyticsSDK } from "./private/analytics";
|
|
4
|
-
export type { MessageViewModeOptions, StreamWsMessageMeta, } from "./types/websocket";
|
|
7
|
+
export type { MessageViewModeOptions, StreamWsMessageMeta, MessageViewModePropsInternal, MessageViewModeProps, } from "./types/websocket";
|
|
5
8
|
export type { CommandContext, CommandContextRequest, CommandContextRequestRow, CommandContextResponse, CommandContextBase, } from "./types/commands";
|
|
6
9
|
export type { MenuItem } from "./types/menu";
|
|
7
|
-
export { type ReplayTab, type ReplaySession, type ReplayEntry, type ReplayCollection, type SendRequestOptions, ReplaySlot, type ReplaySlotContent, type RequestSource, type CurrentReplaySessionChangeEvent, } from "./types/replay";
|
|
10
|
+
export { type AddCollectionIndicatorOptions, type AddSessionIndicatorOptions, type ReplayTab, type ReplaySession, type ReplayEntry, type ReplaySelectedExchange, type ReplayWebSocketMessage, type ReplayCollection, type SendRequestOptions, ReplaySlot, type ReplaySlotContent, type RequestSource, type CurrentReplaySessionChangeEvent, ReplaySessionKind, type ReplayPageContext, } from "./types/replay";
|
|
8
11
|
export type { AutomateSession, AutomateEntry } from "./types/automate";
|
|
9
12
|
export type { SitemapEntry, SitemapRootEntry, ChildState, } from "./types/sitemap";
|
|
10
13
|
export { SearchSlot, type SearchSlotContent } from "./types/search";
|
|
@@ -12,9 +15,9 @@ export type { HostedFile } from "./types/files";
|
|
|
12
15
|
export { FilterSlot, type Filter, type FilterSlotContent, type CurrentFilterChangeEvent, } from "./types/filter";
|
|
13
16
|
export type { HTTPQL, StreamQL, ID, ComponentDefinition, Selection, QueryInput, } from "./types/utils";
|
|
14
17
|
export type { JSONValue, JSONCompatible } from "./types/json";
|
|
15
|
-
export type { SlotContent, ButtonSlotContent, CustomSlotContent, CommandSlotContent, } from "./types/slots";
|
|
16
|
-
export type { RequestViewModeOptions, RequestFull, RequestDraft, RequestMeta, } from "./types/request";
|
|
17
|
-
export type { ResponseViewModeOptions, ResponseFull } from "./types/response";
|
|
18
|
+
export type { SlotContent, ButtonSlotContent, CustomSlotContent, CommandSlotContent, SlotContentPropsInternal, SlotContentProps, } from "./types/slots";
|
|
19
|
+
export type { RequestViewModeOptions, RequestWritableViewModeProps, RequestReadableViewModeProps, RequestReadableViewModePropsInternal, RequestWritableViewModePropsInternal, RequestViewModeProps, RequestFull, RequestDraft, RequestMeta, } from "./types/request";
|
|
20
|
+
export type { ResponseViewModePropsInternal, ResponseViewModeOptions, ResponseViewModeProps, ResponseFull, } from "./types/response";
|
|
18
21
|
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";
|
|
19
22
|
export { MatchReplaceSlot, type MatchReplaceSlotContent, } from "./types/matchReplace";
|
|
20
23
|
export { ScopeSlot, type CurrentScopeChangeEvent, type Scope, type ScopeSlotContent, } from "./types/scopes";
|
|
@@ -22,9 +25,10 @@ export { HTTPHistorySlot, type HTTPHistorySlotContent, } from "./types/httpHisto
|
|
|
22
25
|
export { SettingsSlot, type SettingsSlotContent, type SettingsPluginSlotContent, } from "./types/settings";
|
|
23
26
|
export type { EnvironmentVariable } from "./types/environment";
|
|
24
27
|
export type { Workflow, WorkflowKind, OnCreatedWorkflowCallback, OnUpdatedWorkflowCallback, OnDeletedWorkflowCallback, } from "./types/workflows";
|
|
25
|
-
export type { ListenerHandle, AddIndicatorOptions, Indicator, } from "./types/utils";
|
|
26
|
-
export type { AIProvider, AILanguageModelSettings, AIReasoningSettings, AIUpstreamProvider,
|
|
28
|
+
export type { ListenerHandle, AddIndicatorOptions, Indicator, ComponentProps, ComponentPropsWithSdk, } from "./types/utils";
|
|
29
|
+
export type { AIProvider, AILanguageModelSettings, AIReasoningSettings, AIUpstreamProvider, AIUpstreamProviderApi, AIUpstreamProviderId, } from "./types/ai";
|
|
27
30
|
export type { SelectedProjectChangeEvent } from "./types/projects";
|
|
31
|
+
export type { CommandPaletteViewProps, CommandPaletteViewPropsInternal, } from "./types/commandPalette";
|
|
28
32
|
export type { CommandPaletteView } from "./sdks/commandPalette";
|
|
29
33
|
export type { LogSDK } from "./sdks/log";
|
|
30
34
|
export type { API } from "./sdks";
|
|
@@ -42,9 +46,12 @@ export type { FindingsPageContext } from "./types/findings";
|
|
|
42
46
|
export type { HTTPHistoryPageContext } from "./types/httpHistory";
|
|
43
47
|
export type { InterceptPageContext } from "./types/intercept";
|
|
44
48
|
export type { ProjectsPageContext } from "./types/projects";
|
|
45
|
-
export type { ReplayPageContext } from "./types/replay";
|
|
46
49
|
export type { ScopePageContext } from "./types/scopes";
|
|
47
50
|
export type { SearchPageContext } from "./types/search";
|
|
48
51
|
export type { SitemapPageContext } from "./types/sitemap";
|
|
49
52
|
export type { MatchReplacePageContext } from "./types/matchReplace";
|
|
50
53
|
export type { WorkflowsPageContext } from "./types/workflows";
|
|
54
|
+
export type { HTTPQLEditorProps };
|
|
55
|
+
export declare const HTTPQLEditor: DefineComponent<HTTPQLEditorProps & {
|
|
56
|
+
modelValue?: string;
|
|
57
|
+
}>;
|
package/src/types/sdks/ai.d.ts
CHANGED
|
@@ -10,8 +10,8 @@ export type AiSDK = {
|
|
|
10
10
|
*/
|
|
11
11
|
createProvider: () => AIProvider;
|
|
12
12
|
/**
|
|
13
|
-
* Gets the list of upstream AI providers
|
|
14
|
-
* @returns An array of AI upstream providers
|
|
13
|
+
* Gets the list of configured upstream AI providers.
|
|
14
|
+
* @returns An array of configured AI upstream providers.
|
|
15
15
|
*/
|
|
16
16
|
getUpstreamProviders: () => AIUpstreamProvider[];
|
|
17
17
|
};
|
|
@@ -1,13 +1,23 @@
|
|
|
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 { RequestFull, RequestReadableViewModeProps, RequestViewModeOptions } from "../types/request";
|
|
4
|
+
import type { ResponseFull, 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.
|
|
8
8
|
* @category Automate
|
|
9
9
|
*/
|
|
10
10
|
export type AutomateSDK = {
|
|
11
|
+
/**
|
|
12
|
+
* Get the currently selected request.
|
|
13
|
+
* @returns The currently selected request.
|
|
14
|
+
*/
|
|
15
|
+
getSelectedRequest: () => RequestFull | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Get the currently selected response.
|
|
18
|
+
* @returns The currently selected response.
|
|
19
|
+
*/
|
|
20
|
+
getSelectedResponse: () => ResponseFull | undefined;
|
|
11
21
|
/**
|
|
12
22
|
* Add an extension to the request editor.
|
|
13
23
|
* @param extension The extension to add.
|
|
@@ -17,12 +27,12 @@ export type AutomateSDK = {
|
|
|
17
27
|
* Add a custom request view mode.
|
|
18
28
|
* @param options The view mode options.
|
|
19
29
|
*/
|
|
20
|
-
addRequestViewMode: (options: RequestViewModeOptions) => void;
|
|
30
|
+
addRequestViewMode: (options: RequestViewModeOptions<RequestReadableViewModeProps>) => void;
|
|
21
31
|
/**
|
|
22
32
|
* Add a custom response view mode.
|
|
23
33
|
* @param options The view mode options.
|
|
24
34
|
*/
|
|
25
|
-
addResponseViewMode: (options: ResponseViewModeOptions) => void;
|
|
35
|
+
addResponseViewMode: (options: ResponseViewModeOptions<ResponseViewModeProps>) => void;
|
|
26
36
|
/**
|
|
27
37
|
* Get the list of all automate sessions.
|
|
28
38
|
* @returns The list of all automate sessions.
|
|
@@ -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 { RequestFull, RequestReadableViewModeProps, RequestViewModeOptions } from "../types/request";
|
|
4
|
+
import type { ResponseFull, ResponseViewModeOptions, ResponseViewModeProps } from "../types/response";
|
|
5
5
|
import type { ID } from "../types/utils";
|
|
6
6
|
/**
|
|
7
7
|
* Utilities to interact with findings
|
|
@@ -24,6 +24,16 @@ export type FindingsSDK = {
|
|
|
24
24
|
reporter: string;
|
|
25
25
|
dedupeKey?: string;
|
|
26
26
|
}) => Promise<Finding | undefined>;
|
|
27
|
+
/**
|
|
28
|
+
* Get the currently selected request.
|
|
29
|
+
* @returns The currently selected request.
|
|
30
|
+
*/
|
|
31
|
+
getSelectedRequest: () => RequestFull | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Get the currently selected response.
|
|
34
|
+
* @returns The currently selected response.
|
|
35
|
+
*/
|
|
36
|
+
getSelectedResponse: () => ResponseFull | undefined;
|
|
27
37
|
/**
|
|
28
38
|
* Add an extension to the request editor.
|
|
29
39
|
* @param extension The extension to add.
|
|
@@ -33,10 +43,10 @@ export type FindingsSDK = {
|
|
|
33
43
|
* Add a custom request view mode.
|
|
34
44
|
* @param options The view mode options.
|
|
35
45
|
*/
|
|
36
|
-
addRequestViewMode: (options: RequestViewModeOptions) => void;
|
|
46
|
+
addRequestViewMode: (options: RequestViewModeOptions<RequestReadableViewModeProps>) => void;
|
|
37
47
|
/**
|
|
38
48
|
* Add a custom response view mode.
|
|
39
49
|
* @param options The view mode options.
|
|
40
50
|
*/
|
|
41
|
-
addResponseViewMode: (options: ResponseViewModeOptions) => void;
|
|
51
|
+
addResponseViewMode: (options: ResponseViewModeOptions<ResponseViewModeProps>) => void;
|
|
42
52
|
};
|
|
@@ -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 { RequestFull, RequestReadableViewModeProps, RequestViewModeOptions } from "../types/request";
|
|
4
|
+
import type { ResponseFull, ResponseViewModeOptions, ResponseViewModeProps } from "../types/response";
|
|
5
5
|
import { type DefineAddToSlotFn } from "../types/slots";
|
|
6
6
|
import type { HTTPQL, ID } from "../types/utils";
|
|
7
7
|
/**
|
|
@@ -24,6 +24,16 @@ export type HTTPHistorySDK = {
|
|
|
24
24
|
* @returns The current scope ID.
|
|
25
25
|
*/
|
|
26
26
|
getScopeId: () => ID | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Get the currently selected request.
|
|
29
|
+
* @returns The currently selected request.
|
|
30
|
+
*/
|
|
31
|
+
getSelectedRequest: () => RequestFull | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Get the currently selected response.
|
|
34
|
+
* @returns The currently selected response.
|
|
35
|
+
*/
|
|
36
|
+
getSelectedResponse: () => ResponseFull | undefined;
|
|
27
37
|
/**
|
|
28
38
|
* Set the current scope.
|
|
29
39
|
* @param id The ID of the scope to set.
|
|
@@ -43,12 +53,12 @@ export type HTTPHistorySDK = {
|
|
|
43
53
|
* Add a custom request view mode.
|
|
44
54
|
* @param options The view mode options.
|
|
45
55
|
*/
|
|
46
|
-
addRequestViewMode: (options: RequestViewModeOptions) => void;
|
|
56
|
+
addRequestViewMode: (options: RequestViewModeOptions<RequestReadableViewModeProps>) => void;
|
|
47
57
|
/**
|
|
48
58
|
* Add a custom response view mode.
|
|
49
59
|
* @param options The view mode options.
|
|
50
60
|
*/
|
|
51
|
-
addResponseViewMode: (options: ResponseViewModeOptions) => void;
|
|
61
|
+
addResponseViewMode: (options: ResponseViewModeOptions<ResponseViewModeProps>) => void;
|
|
52
62
|
/**
|
|
53
63
|
* Scrolls the HTTP History table to a specific entry.
|
|
54
64
|
* @param id The ID of the entry to scroll to.
|
|
@@ -39,6 +39,23 @@ import type { WorkflowSDK } from "./workflows";
|
|
|
39
39
|
export type API<T extends BackendEndpoints | BackendSpec = Record<string, never>, E extends BackendEvents = Record<string, never>> = {
|
|
40
40
|
/**
|
|
41
41
|
* Utilities to interact with the GraphQL API.
|
|
42
|
+
*
|
|
43
|
+
* Queries and mutations return a promise; subscriptions return an
|
|
44
|
+
* `AsyncIterable`. On success they resolve with the response data or yield
|
|
45
|
+
* it. On failure (network error or any GraphQL errors returned by the
|
|
46
|
+
* server) the promise rejects, or the iterator throws into the `for await`
|
|
47
|
+
* loop, with the underlying error. Failures can be handled with `try`/
|
|
48
|
+
* `catch` or `.catch()`.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* try {
|
|
53
|
+
* const result = await sdk.graphql.automateEntry({ id: "1" });
|
|
54
|
+
* // use result
|
|
55
|
+
* } catch (err) {
|
|
56
|
+
* // err.message, err.graphQLErrors, err.networkError
|
|
57
|
+
* }
|
|
58
|
+
* ```
|
|
42
59
|
*/
|
|
43
60
|
graphql: GraphqlSDK;
|
|
44
61
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { RequestViewModeOptions } from "../types/request";
|
|
2
|
-
import type { ResponseViewModeOptions } from "../types/response";
|
|
1
|
+
import type { RequestFull, RequestViewModeOptions, RequestWritableViewModeProps } from "../types/request";
|
|
2
|
+
import type { ResponseFull, ResponseViewModeOptions, ResponseViewModeProps } from "../types/response";
|
|
3
3
|
import type { ID } from "../types/utils";
|
|
4
4
|
/**
|
|
5
5
|
* Utilities to interact with the Intercept page.
|
|
@@ -11,6 +11,16 @@ export type InterceptSDK = {
|
|
|
11
11
|
* @returns The current scope ID.
|
|
12
12
|
*/
|
|
13
13
|
getScopeId: () => ID | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Get the currently selected request.
|
|
16
|
+
* @returns The currently selected request.
|
|
17
|
+
*/
|
|
18
|
+
getSelectedRequest: () => RequestFull | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Get the currently selected response.
|
|
21
|
+
* @returns The currently selected response.
|
|
22
|
+
*/
|
|
23
|
+
getSelectedResponse: () => ResponseFull | undefined;
|
|
14
24
|
/**
|
|
15
25
|
* Set the current scope.
|
|
16
26
|
* @param scopeId The ID of the scope to set.
|
|
@@ -20,10 +30,10 @@ export type InterceptSDK = {
|
|
|
20
30
|
* Add a custom request view mode.
|
|
21
31
|
* @param options The view mode options.
|
|
22
32
|
*/
|
|
23
|
-
addRequestViewMode: (options: RequestViewModeOptions) => void;
|
|
33
|
+
addRequestViewMode: (options: RequestViewModeOptions<RequestWritableViewModeProps>) => void;
|
|
24
34
|
/**
|
|
25
35
|
* Add a custom response view mode.
|
|
26
36
|
* @param options The view mode options.
|
|
27
37
|
*/
|
|
28
|
-
addResponseViewMode: (options: ResponseViewModeOptions) => void;
|
|
38
|
+
addResponseViewMode: (options: ResponseViewModeOptions<ResponseViewModeProps>) => void;
|
|
29
39
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { type Extension } from "@codemirror/state";
|
|
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";
|
|
2
|
+
import { type AddCollectionIndicatorOptions, type AddSessionIndicatorOptions, type CurrentReplaySessionChangeEvent, type OpenTabOptions, type ReplayCollection, type ReplayCollectionCreatedEvent, type ReplayEntry, type ReplaySelectedExchange, type ReplaySession, type ReplaySessionCreatedEvent, type ReplaySessionKind, type ReplaySlotContent, type ReplayTab, type RequestSource, type SendRequestOptions } from "../types/replay";
|
|
3
|
+
import type { RequestFull, RequestViewModeOptions, RequestWritableViewModeProps } from "../types/request";
|
|
4
|
+
import type { ResponseFull, ResponseViewModeOptions, ResponseViewModeProps } from "../types/response";
|
|
5
5
|
import { type DefineAddToSlotFn } from "../types/slots";
|
|
6
|
-
import type {
|
|
6
|
+
import type { ID, Indicator, ListenerHandle } from "../types/utils";
|
|
7
|
+
import type { MessageViewModeOptions, MessageViewModeProps } from "../types/websocket";
|
|
7
8
|
/**
|
|
8
9
|
* Utilities to interact with Replay.
|
|
9
10
|
* @category Replay
|
|
@@ -27,9 +28,13 @@ export type ReplaySDK = {
|
|
|
27
28
|
getTabs: () => ReplayTab[];
|
|
28
29
|
/**
|
|
29
30
|
* Get the list of all replay sessions.
|
|
31
|
+
* @param options The options for getting the sessions.
|
|
32
|
+
* @param options.collectionId The ID of the collection to get the sessions for.
|
|
30
33
|
* @returns The list of all replay sessions.
|
|
31
34
|
*/
|
|
32
|
-
getSessions: (
|
|
35
|
+
getSessions: (options?: {
|
|
36
|
+
collectionId?: ID;
|
|
37
|
+
}) => ReplaySession[];
|
|
33
38
|
/**
|
|
34
39
|
* Get the currently selected replay session.
|
|
35
40
|
* @returns The currently selected replay session, or undefined if no session is selected.
|
|
@@ -44,6 +49,35 @@ export type ReplaySDK = {
|
|
|
44
49
|
* ```
|
|
45
50
|
*/
|
|
46
51
|
getCurrentSession: () => ReplaySession | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Get the entry currently displayed in the active replay session.
|
|
54
|
+
* @returns The active entry, or undefined if no entry is currently loaded.
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const currentEntry = sdk.replay.getCurrentEntry();
|
|
58
|
+
* if (currentEntry) {
|
|
59
|
+
* console.log(`Currently viewing entry ${currentEntry.id}`);
|
|
60
|
+
* } else {
|
|
61
|
+
* console.log("No entry is currently displayed");
|
|
62
|
+
* }
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
getCurrentEntry: () => ReplayEntry | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Get the currently selected Replay exchange.
|
|
68
|
+
* @returns The currently selected Replay exchange.
|
|
69
|
+
*/
|
|
70
|
+
getSelectedExchange: () => ReplaySelectedExchange | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Get the currently selected request.
|
|
73
|
+
* @returns The currently selected request.
|
|
74
|
+
*/
|
|
75
|
+
getSelectedRequest: () => RequestFull | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* Get the currently selected response.
|
|
78
|
+
* @returns The currently selected response.
|
|
79
|
+
*/
|
|
80
|
+
getSelectedResponse: () => ResponseFull | undefined;
|
|
47
81
|
/**
|
|
48
82
|
* Rename a session.
|
|
49
83
|
* @param id The ID of the session to rename.
|
|
@@ -65,10 +99,22 @@ export type ReplaySDK = {
|
|
|
65
99
|
deleteSessions: (sessionIds: ID[]) => Promise<ID[]>;
|
|
66
100
|
/**
|
|
67
101
|
* Create a session.
|
|
68
|
-
* @param
|
|
69
|
-
* @param collectionId The ID of the collection to add the
|
|
102
|
+
* @param source The source of the session to create.
|
|
103
|
+
* @param collectionId The ID of the collection to add the session to.
|
|
104
|
+
* @example
|
|
105
|
+
* ```ts
|
|
106
|
+
* sdk.replay.createSession({
|
|
107
|
+
* type: "Raw",
|
|
108
|
+
* raw: "GET / HTTP/1.1\r\nHost: example.com\r\n\r\n",
|
|
109
|
+
* connectionInfo: {
|
|
110
|
+
* host: "example.com",
|
|
111
|
+
* port: 443,
|
|
112
|
+
* isTLS: true,
|
|
113
|
+
* },
|
|
114
|
+
* });
|
|
115
|
+
* ```
|
|
70
116
|
*/
|
|
71
|
-
createSession: (source: RequestSource, collectionId?: ID) => Promise<
|
|
117
|
+
createSession: (source: RequestSource, collectionId?: ID, sessionKind?: ReplaySessionKind) => Promise<ReplaySession>;
|
|
72
118
|
/**
|
|
73
119
|
* Get the list of all replay collections.
|
|
74
120
|
* @returns The list of all replay collections.
|
|
@@ -129,12 +175,17 @@ export type ReplaySDK = {
|
|
|
129
175
|
* Add a custom view mode for requests.
|
|
130
176
|
* @param options The view mode options.
|
|
131
177
|
*/
|
|
132
|
-
addRequestViewMode: (options: RequestViewModeOptions) => void;
|
|
178
|
+
addRequestViewMode: (options: RequestViewModeOptions<RequestWritableViewModeProps>) => void;
|
|
133
179
|
/**
|
|
134
180
|
* Add a custom response view mode.
|
|
135
181
|
* @param options The view mode options.
|
|
136
182
|
*/
|
|
137
|
-
addResponseViewMode: (options: ResponseViewModeOptions) => void;
|
|
183
|
+
addResponseViewMode: (options: ResponseViewModeOptions<ResponseViewModeProps>) => void;
|
|
184
|
+
/**
|
|
185
|
+
* Add a custom WebSocket message view mode.
|
|
186
|
+
* @param options The view mode options.
|
|
187
|
+
*/
|
|
188
|
+
addWebsocketMessageViewMode: (options: MessageViewModeOptions<MessageViewModeProps>) => void;
|
|
138
189
|
/**
|
|
139
190
|
* Send a request to the Replay backend.
|
|
140
191
|
* @param request The request to send.
|
|
@@ -235,11 +286,30 @@ export type ReplaySDK = {
|
|
|
235
286
|
* const indicator = sdk.replay.addSessionIndicator(sessionId, {
|
|
236
287
|
* icon: "fas fa-exclamation-triangle",
|
|
237
288
|
* description: "Security warning",
|
|
289
|
+
* showTabIcon: true,
|
|
290
|
+
* });
|
|
291
|
+
*
|
|
292
|
+
* // Later, remove the indicator
|
|
293
|
+
* indicator.remove();
|
|
294
|
+
*
|
|
295
|
+
*/
|
|
296
|
+
addSessionIndicator: (sessionId: ID, indicator: AddSessionIndicatorOptions) => Indicator;
|
|
297
|
+
/**
|
|
298
|
+
* Add an indicator to a replay collection.
|
|
299
|
+
* Indicators are displayed next to the collection name in the collections tree.
|
|
300
|
+
* @param collectionId The ID of the collection to add the indicator to.
|
|
301
|
+
* @param indicator The indicator configuration.
|
|
302
|
+
* @returns A handle object with a `remove` method to remove the indicator.
|
|
303
|
+
* @example
|
|
304
|
+
*
|
|
305
|
+
* const indicator = sdk.replay.addCollectionIndicator(collectionId, {
|
|
306
|
+
* icon: "fas fa-folder-open",
|
|
307
|
+
* description: "Has unresolved findings",
|
|
238
308
|
* });
|
|
239
309
|
*
|
|
240
310
|
* // Later, remove the indicator
|
|
241
311
|
* indicator.remove();
|
|
242
312
|
*
|
|
243
313
|
*/
|
|
244
|
-
|
|
314
|
+
addCollectionIndicator: (collectionId: ID, indicator: AddCollectionIndicatorOptions) => Indicator;
|
|
245
315
|
};
|
|
@@ -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 { RequestFull, RequestReadableViewModeProps, RequestViewModeOptions } from "../types/request";
|
|
3
|
+
import type { ResponseFull, 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
|
/**
|
|
@@ -23,6 +23,16 @@ export type SearchSDK = {
|
|
|
23
23
|
* @returns The current scope ID.
|
|
24
24
|
*/
|
|
25
25
|
getScopeId: () => ID | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Get the currently selected request.
|
|
28
|
+
* @returns The currently selected request.
|
|
29
|
+
*/
|
|
30
|
+
getSelectedRequest: () => RequestFull | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Get the currently selected response.
|
|
33
|
+
* @returns The currently selected response.
|
|
34
|
+
*/
|
|
35
|
+
getSelectedResponse: () => ResponseFull | undefined;
|
|
26
36
|
/**
|
|
27
37
|
* Set the current scope.
|
|
28
38
|
* @param id The ID of the scope to set.
|
|
@@ -37,12 +47,12 @@ export type SearchSDK = {
|
|
|
37
47
|
* Add a custom request view mode.
|
|
38
48
|
* @param options The view mode options.
|
|
39
49
|
*/
|
|
40
|
-
addRequestViewMode: (options: RequestViewModeOptions) => void;
|
|
50
|
+
addRequestViewMode: (options: RequestViewModeOptions<RequestReadableViewModeProps>) => void;
|
|
41
51
|
/**
|
|
42
52
|
* Add a custom response view mode.
|
|
43
53
|
* @param options The view mode options.
|
|
44
54
|
*/
|
|
45
|
-
addResponseViewMode: (options: ResponseViewModeOptions) => void;
|
|
55
|
+
addResponseViewMode: (options: ResponseViewModeOptions<ResponseViewModeProps>) => void;
|
|
46
56
|
/**
|
|
47
57
|
* Scrolls the Search table to a specific request.
|
|
48
58
|
* @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 { RequestFull, RequestReadableViewModeProps, RequestViewModeOptions } from "../types/request";
|
|
3
|
+
import type { ResponseFull, 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
|
/**
|
|
@@ -39,6 +39,16 @@ export type SitemapSDK = {
|
|
|
39
39
|
* @returns The current scope ID.
|
|
40
40
|
*/
|
|
41
41
|
getScopeId: () => ID | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Get the currently selected request.
|
|
44
|
+
* @returns The currently selected request.
|
|
45
|
+
*/
|
|
46
|
+
getSelectedRequest: () => RequestFull | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Get the currently selected response.
|
|
49
|
+
* @returns The currently selected response.
|
|
50
|
+
*/
|
|
51
|
+
getSelectedResponse: () => ResponseFull | undefined;
|
|
42
52
|
/**
|
|
43
53
|
* Set the current scope.
|
|
44
54
|
* @param id The ID of the scope to set.
|
|
@@ -53,12 +63,12 @@ export type SitemapSDK = {
|
|
|
53
63
|
* Add a custom request view mode.
|
|
54
64
|
* @param options The view mode options.
|
|
55
65
|
*/
|
|
56
|
-
addRequestViewMode: (options: RequestViewModeOptions) => void;
|
|
66
|
+
addRequestViewMode: (options: RequestViewModeOptions<RequestReadableViewModeProps>) => void;
|
|
57
67
|
/**
|
|
58
68
|
* Add a custom response view mode.
|
|
59
69
|
* @param options The view mode options.
|
|
60
70
|
*/
|
|
61
|
-
addResponseViewMode: (options: ResponseViewModeOptions) => void;
|
|
71
|
+
addResponseViewMode: (options: ResponseViewModeOptions<ResponseViewModeProps>) => void;
|
|
62
72
|
/**
|
|
63
73
|
* Add an indicator to a sitemap session.
|
|
64
74
|
* Indicators are displayed next to the entry name in the collections tree.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MessageViewModeOptions } from "../types/websocket";
|
|
1
|
+
import type { MessageViewModeOptions, MessageViewModeProps } from "../types/websocket";
|
|
2
2
|
/**
|
|
3
3
|
* Utilities to interact with websockets
|
|
4
4
|
* @category Websockets
|
|
@@ -8,5 +8,5 @@ export type WebsocketSDK = {
|
|
|
8
8
|
* Add a custom message view mode.
|
|
9
9
|
* @param options The view mode options.
|
|
10
10
|
*/
|
|
11
|
-
addMessageViewMode: (options: MessageViewModeOptions) => void;
|
|
11
|
+
addMessageViewMode: (options: MessageViewModeOptions<MessageViewModeProps>) => void;
|
|
12
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
|
|
@@ -11,6 +11,16 @@ export type WindowSDK = {
|
|
|
11
11
|
* @returns The active editor.
|
|
12
12
|
*/
|
|
13
13
|
getActiveEditor: () => Editor | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Get the active request editor.
|
|
16
|
+
* @returns The active request editor.
|
|
17
|
+
*/
|
|
18
|
+
getActiveRequestEditor: () => Editor | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Get the active response editor.
|
|
21
|
+
* @returns The active response editor.
|
|
22
|
+
*/
|
|
23
|
+
getActiveResponseEditor: () => Editor | undefined;
|
|
14
24
|
/**
|
|
15
25
|
* Show a toast message.
|
|
16
26
|
* @param message The message to show.
|
|
@@ -34,7 +44,7 @@ export type WindowSDK = {
|
|
|
34
44
|
* @param options.closable Whether the close icon is hidden . Defaults to false
|
|
35
45
|
* @returns A dialog object that can be used to close the dialog.
|
|
36
46
|
*/
|
|
37
|
-
showDialog: (component:
|
|
47
|
+
showDialog: (component: DialogComponent, options?: DialogOptions) => Dialog;
|
|
38
48
|
/**
|
|
39
49
|
* Get the current global context.
|
|
40
50
|
* @returns The current global context.
|
package/src/types/types/ai.d.ts
CHANGED
|
@@ -26,19 +26,18 @@ export type AIProvider = ProviderV3 & ((modelId: string, settings?: AILanguageMo
|
|
|
26
26
|
* AI upstream provider ID.
|
|
27
27
|
* @category AI
|
|
28
28
|
*/
|
|
29
|
-
export type AIUpstreamProviderId =
|
|
29
|
+
export type AIUpstreamProviderId = string;
|
|
30
|
+
/**
|
|
31
|
+
* The response API a provider speaks.
|
|
32
|
+
* @category AI
|
|
33
|
+
*/
|
|
34
|
+
export type AIUpstreamProviderApi = "ANTHROPIC" | "GEMINI" | "OPENAI_COMPLETION" | "OPENAI_RESPONSE" | "OPENROUTER";
|
|
30
35
|
/**
|
|
31
36
|
* AI upstream provider information.
|
|
37
|
+
* Only configured providers are returned.
|
|
32
38
|
* @category AI
|
|
33
39
|
*/
|
|
34
40
|
export type AIUpstreamProvider = {
|
|
35
41
|
id: AIUpstreamProviderId;
|
|
36
|
-
|
|
42
|
+
api: AIUpstreamProviderApi;
|
|
37
43
|
};
|
|
38
|
-
/**
|
|
39
|
-
* AI upstream provider status.
|
|
40
|
-
* Ready: The upstream provider is ready to use.
|
|
41
|
-
* Missing: The upstream provider is not configured.
|
|
42
|
-
* @category AI
|
|
43
|
-
*/
|
|
44
|
-
export type AIUpstreamProviderStatus = "Ready" | "Missing";
|
|
@@ -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,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
|
};
|