@caido/sdk-frontend 0.56.1-beta.5 → 0.56.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.
@@ -1,7 +1,6 @@
1
1
  export { FooterSlot, type FooterSlotContent } from "./types/footer";
2
- export type { DialogOptions, DialogComponent } from "./types/window";
2
+ export type { DialogOptions } from "./types/window";
3
3
  export type { _AnalyticsSDK } from "./private/analytics";
4
- export type { MessageViewModeOptions, StreamWsMessageMeta, MessageViewModePropsInternal, MessageViewModeProps, } from "./types/websocket";
5
4
  export type { CommandContext, CommandContextRequest, CommandContextRequestRow, CommandContextResponse, CommandContextBase, } from "./types/commands";
6
5
  export type { MenuItem } from "./types/menu";
7
6
  export { type ReplayTab, type ReplaySession, type ReplayEntry, type ReplayCollection, type SendRequestOptions, ReplaySlot, type ReplaySlotContent, type RequestSource, type CurrentReplaySessionChangeEvent, } from "./types/replay";
@@ -10,22 +9,21 @@ export type { SitemapEntry, SitemapRootEntry, ChildState, } from "./types/sitema
10
9
  export { SearchSlot, type SearchSlotContent } from "./types/search";
11
10
  export type { HostedFile } from "./types/files";
12
11
  export { FilterSlot, type Filter, type FilterSlotContent, type CurrentFilterChangeEvent, } from "./types/filter";
13
- export type { HTTPQL, StreamQL, ID, ComponentDefinition, Selection, QueryInput, } from "./types/utils";
12
+ export type { HTTPQL, ID, ComponentDefinition, Selection } from "./types/utils";
14
13
  export type { JSONValue, JSONCompatible } from "./types/json";
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";
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";
19
18
  export { MatchReplaceSlot, type MatchReplaceSlotContent, } from "./types/matchReplace";
20
19
  export { ScopeSlot, type CurrentScopeChangeEvent, type Scope, type ScopeSlotContent, } from "./types/scopes";
21
20
  export { HTTPHistorySlot, type HTTPHistorySlotContent, } from "./types/httpHistory";
22
21
  export { SettingsSlot, type SettingsSlotContent, type SettingsPluginSlotContent, } from "./types/settings";
23
22
  export type { EnvironmentVariable } from "./types/environment";
24
23
  export type { Workflow, WorkflowKind, OnCreatedWorkflowCallback, OnUpdatedWorkflowCallback, OnDeletedWorkflowCallback, } from "./types/workflows";
25
- export type { ListenerHandle, AddIndicatorOptions, Indicator, ComponentProps, ComponentPropsWithSdk, } from "./types/utils";
24
+ export type { ListenerHandle, AddIndicatorOptions, Indicator, } from "./types/utils";
26
25
  export type { AIProvider, AILanguageModelSettings, AIReasoningSettings, AIUpstreamProvider, AIUpstreamProviderId, AIUpstreamProviderStatus, } from "./types/ai";
27
26
  export type { SelectedProjectChangeEvent } from "./types/projects";
28
- export type { CommandPaletteViewProps, CommandPaletteViewPropsInternal, } from "./types/commandPalette";
29
27
  export type { CommandPaletteView } from "./sdks/commandPalette";
30
28
  export type { LogSDK } from "./sdks/log";
31
29
  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 { RequestReadableViewModeProps, RequestViewModeOptions } from "../types/request";
4
- import type { ResponseViewModeOptions, ResponseViewModeProps } from "../types/response";
3
+ import type { RequestViewModeOptions } from "../types/request";
4
+ import type { ResponseViewModeOptions } 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<RequestReadableViewModeProps>) => void;
20
+ addRequestViewMode: (options: RequestViewModeOptions) => 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<ResponseViewModeProps>) => void;
25
+ addResponseViewMode: (options: ResponseViewModeOptions) => void;
26
26
  /**
27
27
  * Get the list of all automate sessions.
28
28
  * @returns The list of all automate sessions.
@@ -1,17 +1,11 @@
1
- import { type BackendEndpoints, type BackendEvents, type BackendSpec } from "../types/backend";
1
+ import { type BackendEndpoints, type BackendEvents } 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;
9
3
  /**
10
4
  * Utilities to interact with the backend plugin.
11
5
  * @category Backend
12
6
  */
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]>;
7
+ export type BackendSDK<T extends BackendEndpoints, E extends BackendEvents> = {
8
+ [K in keyof T]: (...args: Parameters<T[K]>) => PromisifiedReturnType<T[K]>;
15
9
  } & {
16
10
  /**
17
11
  * Subscribe to a backend event.
@@ -19,8 +13,7 @@ export type BackendSDK<T extends BackendEndpoints | BackendSpec, E extends Backe
19
13
  * @param callback The callback to call when the event is emitted.
20
14
  * @returns An object with a `stop` method that can be called to stop listening to the event.
21
15
  */
22
- onEvent: <K extends keyof ResolvedEvents<T, E>>(event: K, callback: ResolvedEvents<T, E>[K]) => {
16
+ onEvent: <K extends keyof E>(event: K, callback: E[K]) => {
23
17
  stop: () => void;
24
18
  };
25
19
  };
26
- export {};
@@ -1,4 +1,3 @@
1
- import { type CommandPaletteViewProps } from "../types/commandPalette";
2
1
  import { type CommandID } from "../types/commands";
3
2
  import { type ComponentDefinition } from "../types/utils";
4
3
  /**
@@ -7,7 +6,7 @@ import { type ComponentDefinition } from "../types/utils";
7
6
  */
8
7
  export type CommandPaletteView = {
9
8
  type: "Custom";
10
- definition: ComponentDefinition<CommandPaletteViewProps>;
9
+ definition: ComponentDefinition;
11
10
  };
12
11
  /**
13
12
  * 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 { RequestReadableViewModeProps, RequestViewModeOptions } from "../types/request";
4
- import type { ResponseViewModeOptions, ResponseViewModeProps } from "../types/response";
3
+ import type { RequestViewModeOptions } from "../types/request";
4
+ import type { ResponseViewModeOptions } 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<RequestReadableViewModeProps>) => void;
36
+ addRequestViewMode: (options: RequestViewModeOptions) => 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<ResponseViewModeProps>) => void;
41
+ addResponseViewMode: (options: ResponseViewModeOptions) => 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 { RequestReadableViewModeProps, RequestViewModeOptions } from "../types/request";
4
- import type { ResponseViewModeOptions, ResponseViewModeProps } from "../types/response";
3
+ import type { RequestViewModeOptions } from "../types/request";
4
+ import type { ResponseViewModeOptions } 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<RequestReadableViewModeProps>) => void;
46
+ addRequestViewMode: (options: RequestViewModeOptions) => 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<ResponseViewModeProps>) => void;
51
+ addResponseViewMode: (options: ResponseViewModeOptions) => 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, type BackendSpec } from "../types/backend";
3
+ import { type BackendEndpoints, type BackendEvents } 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,14 +29,13 @@ 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";
33
32
  import type { WindowSDK } from "./window";
34
33
  import type { WorkflowSDK } from "./workflows";
35
34
  /**
36
35
  * Utilities for frontend plugins.
37
36
  * @category SDK
38
37
  */
39
- export type API<T extends BackendEndpoints | BackendSpec = Record<string, never>, E extends BackendEvents = Record<string, never>> = {
38
+ export type API<T extends BackendEndpoints = Record<string, never>, E extends BackendEvents = Record<string, never>> = {
40
39
  /**
41
40
  * Utilities to interact with the GraphQL API.
42
41
  */
@@ -161,10 +160,6 @@ export type API<T extends BackendEndpoints | BackendSpec = Record<string, never>
161
160
  * Utilities to interact with the settings page.
162
161
  */
163
162
  settings: SettingsSDK;
164
- /**
165
- * Utilities to interact with the Websocket page.
166
- */
167
- websocket: WebsocketSDK;
168
163
  /**
169
164
  * @private
170
165
  * Utilities to track analytics events.
@@ -1,5 +1,5 @@
1
- import type { RequestViewModeOptions, RequestWritableViewModeProps } from "../types/request";
2
- import type { ResponseViewModeOptions, ResponseViewModeProps } from "../types/response";
1
+ import type { RequestViewModeOptions } from "../types/request";
2
+ import type { ResponseViewModeOptions } 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<RequestWritableViewModeProps>) => void;
23
+ addRequestViewMode: (options: RequestViewModeOptions) => 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<ResponseViewModeProps>) => void;
28
+ addResponseViewMode: (options: ResponseViewModeOptions) => 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, ID, Indicator, ListenerHandle, QueryInput } from "../types/utils";
3
+ import type { AddIndicatorOptions, HTTPQL, ID, Indicator, ListenerHandle } from "../types/utils";
4
4
  /**
5
5
  * Utilities to interact with the Match and Replace page.
6
6
  * @category Match and Replace
@@ -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 query to match the rule against.
76
+ * @param options.query - The HTTPQL 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: QueryInput;
82
+ query: HTTPQL;
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 query of the rule.
92
+ * @param options.query - The new HTTPQL 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?: QueryInput;
98
+ query?: HTTPQL;
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, RequestWritableViewModeProps } from "../types/request";
4
- import type { ResponseViewModeOptions, ResponseViewModeProps } from "../types/response";
3
+ import type { RequestViewModeOptions } from "../types/request";
4
+ import type { ResponseViewModeOptions } 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<RequestWritableViewModeProps>) => void;
132
+ addRequestViewMode: (options: RequestViewModeOptions) => 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<ResponseViewModeProps>) => void;
137
+ addResponseViewMode: (options: ResponseViewModeOptions) => void;
138
138
  /**
139
139
  * Send a request to the Replay backend.
140
140
  * @param request The request to send.
@@ -159,12 +159,18 @@ 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.
162
164
  * @example
163
165
  * ```ts
164
- * await sdk.replay.showEntry(sessionId, entryId);
166
+ * await sdk.replay.showEntry(sessionId, entryId, {
167
+ * overwriteDraft: true,
168
+ * });
165
169
  * ```
166
170
  */
167
- showEntry: (sessionId: ID, entryId: ID) => Promise<void>;
171
+ showEntry: (sessionId: ID, entryId: ID, options?: {
172
+ overwriteDraft?: boolean;
173
+ }) => Promise<void>;
168
174
  /**
169
175
  * Get a replay entry by its ID.
170
176
  * @param entryId The ID of the entry to get.
@@ -1,6 +1,6 @@
1
1
  import type { Extension } from "@codemirror/state";
2
- import type { RequestReadableViewModeProps, RequestViewModeOptions } from "../types/request";
3
- import type { ResponseViewModeOptions, ResponseViewModeProps } from "../types/response";
2
+ import type { RequestViewModeOptions } from "../types/request";
3
+ import type { ResponseViewModeOptions } 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<RequestReadableViewModeProps>) => void;
40
+ addRequestViewMode: (options: RequestViewModeOptions) => 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<ResponseViewModeProps>) => void;
45
+ addResponseViewMode: (options: ResponseViewModeOptions) => 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 { RequestReadableViewModeProps, RequestViewModeOptions } from "../types/request";
3
- import type { ResponseViewModeOptions, ResponseViewModeProps } from "../types/response";
2
+ import type { RequestViewModeOptions } from "../types/request";
3
+ import type { ResponseViewModeOptions } 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<RequestReadableViewModeProps>) => void;
56
+ addRequestViewMode: (options: RequestViewModeOptions) => 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<ResponseViewModeProps>) => void;
61
+ addResponseViewMode: (options: ResponseViewModeOptions) => 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.
@@ -1,6 +1,6 @@
1
1
  import type { Editor } from "../types/editor";
2
- import type { ListenerHandle } from "../types/utils";
3
- import { type Dialog, type DialogComponent, type DialogOptions, type GlobalContext } 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
@@ -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: DialogComponent, options?: DialogOptions) => Dialog;
37
+ showDialog: (component: ComponentDefinition, options?: DialogOptions) => Dialog;
38
38
  /**
39
39
  * Get the current global context.
40
40
  * @returns The current global context.
@@ -12,11 +12,3 @@ 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
- };
@@ -1,4 +1,4 @@
1
- import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent, type SlotContentProps, type SlotContentPropsGroup } from "./slots";
1
+ import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent } from "./slots";
2
2
  import { type HTTPQL, type ID, type Selection } from "./utils";
3
3
  /**
4
4
  * Represents a filter.
@@ -42,8 +42,9 @@ 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<TProps extends SlotContentPropsGroup = SlotContentProps> = {
46
- [K in FilterSlot]: ButtonSlotContent | CustomSlotContent<TProps> | CommandSlotContent;
45
+ export type FilterSlotContent = {
46
+ [FilterSlot.UpdateHeader]: ButtonSlotContent | CustomSlotContent | CommandSlotContent;
47
+ [FilterSlot.CreateHeader]: ButtonSlotContent | CustomSlotContent | CommandSlotContent;
47
48
  };
48
49
  /**
49
50
  * 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/app/quickstart/findings.html|Finding}.
3
+ * Represents a {@link https://docs.caido.io/reference/features/logging/findings|Finding}.
4
4
  * @category Findings
5
5
  */
6
6
  export type Finding = {
@@ -1,4 +1,4 @@
1
- import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent, type SlotContentProps, type SlotContentPropsGroup } from "./slots";
1
+ import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent } from "./slots";
2
2
  /**
3
3
  * The slots in the Footer UI.
4
4
  * @category Footer
@@ -12,6 +12,7 @@ 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<TProps extends SlotContentPropsGroup = SlotContentProps> = {
16
- [K in FooterSlot]: ButtonSlotContent | CustomSlotContent<TProps> | CommandSlotContent;
15
+ export type FooterSlotContent = {
16
+ [FooterSlot.FooterSlotPrimary]: ButtonSlotContent | CustomSlotContent | CommandSlotContent;
17
+ [FooterSlot.FooterSlotSecondary]: ButtonSlotContent | CustomSlotContent | CommandSlotContent;
17
18
  };
@@ -1,4 +1,4 @@
1
- import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent, type SlotContentProps, type SlotContentPropsGroup } from "./slots";
1
+ import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent } from "./slots";
2
2
  import { type ID, type Selection } from "./utils";
3
3
  /**
4
4
  * The slots in the HTTP History UI.
@@ -11,12 +11,8 @@ export declare const HTTPHistorySlot: {
11
11
  readonly ToolbarPrimary: "toolbar-primary";
12
12
  };
13
13
  export type HTTPHistorySlot = (typeof HTTPHistorySlot)[keyof typeof HTTPHistorySlot];
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;
14
+ export type HTTPHistorySlotContent = {
15
+ [HTTPHistorySlot.ToolbarPrimary]: ButtonSlotContent | CustomSlotContent | CommandSlotContent;
20
16
  };
21
17
  /**
22
18
  * HTTP history page context.
@@ -1,4 +1,4 @@
1
- import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent, type SlotContentProps, type SlotContentPropsGroup } from "./slots";
1
+ import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent } 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 | MatchReplaceSectionResponseWebsocket | MatchReplaceSectionRequestWebsocket;
51
+ export type MatchReplaceSection = MatchReplaceSectionRequestAll | MatchReplaceSectionRequestBody | MatchReplaceSectionRequestFirstLine | MatchReplaceSectionRequestHeader | MatchReplaceSectionRequestMethod | MatchReplaceSectionRequestPath | MatchReplaceSectionRequestQuery | MatchReplaceSectionRequestSNI | MatchReplaceSectionResponseAll | MatchReplaceSectionResponseBody | MatchReplaceSectionResponseFirstLine | MatchReplaceSectionResponseHeader | MatchReplaceSectionResponseStatusCode;
52
52
  /**
53
53
  * A section for the entire request.
54
54
  * @category Match and Replace
@@ -100,36 +100,6 @@ 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
- };
133
103
  /**
134
104
  * A section for the request query string.
135
105
  * @category Match and Replace
@@ -448,8 +418,9 @@ export type MatchReplaceSlot = (typeof MatchReplaceSlot)[keyof typeof MatchRepla
448
418
  * Content that can be added to match and replace slots.
449
419
  * @category Match and Replace
450
420
  */
451
- export type MatchReplaceSlotContent<TProps extends SlotContentPropsGroup = SlotContentProps> = {
452
- [K in MatchReplaceSlot]: ButtonSlotContent | CustomSlotContent<TProps> | CommandSlotContent;
421
+ export type MatchReplaceSlotContent = {
422
+ [MatchReplaceSlot.UpdateHeader]: ButtonSlotContent | CustomSlotContent | CommandSlotContent;
423
+ [MatchReplaceSlot.CreateHeader]: ButtonSlotContent | CustomSlotContent | CommandSlotContent;
453
424
  };
454
425
  /**
455
426
  * Event fired when the current match and replace rule changes.
@@ -1,28 +1,5 @@
1
- import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent, type SlotContentProps, type SlotContentPropsGroup } from "./slots";
1
+ import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent } from "./slots";
2
2
  import { type ID, type Selection } from "./utils";
3
- /**
4
- * The connection information to use for the request.
5
- * @category Replay
6
- */
7
- type ConnectionInfo = {
8
- /**
9
- * The host to use for the request.
10
- */
11
- host: string;
12
- /**
13
- * The port to use for the request.
14
- */
15
- port: number;
16
- /**
17
- * Whether the request is TLS.
18
- */
19
- isTLS: boolean;
20
- /**
21
- * The SNI to use for the request.
22
- * If not provided, the SNI will be inferred from the host.
23
- */
24
- SNI?: string;
25
- };
26
3
  /**
27
4
  * The slots in the Replay UI.
28
5
  * @category Replay
@@ -42,12 +19,10 @@ export declare const ReplaySlot: {
42
19
  readonly Topbar: "topbar";
43
20
  };
44
21
  export type ReplaySlot = (typeof ReplaySlot)[keyof typeof ReplaySlot];
45
- /**
46
- * Content that can be added to replay slots.
47
- * @category Replay
48
- */
49
- export type ReplaySlotContent<TProps extends SlotContentPropsGroup = SlotContentProps> = {
50
- [K in ReplaySlot]: ButtonSlotContent | CustomSlotContent<TProps> | CommandSlotContent;
22
+ export type ReplaySlotContent = {
23
+ [ReplaySlot.SessionToolbarPrimary]: ButtonSlotContent | CustomSlotContent | CommandSlotContent;
24
+ [ReplaySlot.SessionToolbarSecondary]: ButtonSlotContent | CustomSlotContent | CommandSlotContent;
25
+ [ReplaySlot.Topbar]: ButtonSlotContent | CustomSlotContent | CommandSlotContent;
51
26
  };
52
27
  /**
53
28
  * Options for opening a tab.
@@ -133,6 +108,49 @@ export type ReplayCollection = {
133
108
  * @category Replay
134
109
  */
135
110
  export type SendRequestOptions = {
111
+ /**
112
+ * The connection information to use for the request.
113
+ */
114
+ connectionInfo: {
115
+ /**
116
+ * The host to use for the request.
117
+ */
118
+ host: string;
119
+ /**
120
+ * The port to use for the request.
121
+ */
122
+ port: number;
123
+ /**
124
+ * Whether the request is TLS.
125
+ */
126
+ isTLS: boolean;
127
+ /**
128
+ * The SNI to use for the request.
129
+ * If not provided, the SNI will be inferred from the host.
130
+ */
131
+ SNI?: string;
132
+ };
133
+ /**
134
+ * The raw request to send.
135
+ */
136
+ raw: string;
137
+ /**
138
+ * Whether to update the content length automatically to match the body.
139
+ * Defaults to true.
140
+ */
141
+ updateContentLength?: boolean;
142
+ /**
143
+ * Whether to force close the connection by setting Connection: close header.
144
+ * Defaults to true.
145
+ */
146
+ connectionClose?: boolean;
147
+ /**
148
+ * Whether to overwrite the editor's draft content.
149
+ * If true, draft content will be overwritten with the new request.
150
+ * If false, the draft will be kept.
151
+ * Defaults to true.
152
+ */
153
+ overwriteDraft?: boolean;
136
154
  /**
137
155
  * Whether to send the request in the background without updating the UI.
138
156
  * If true, the request will not update the UI.
@@ -165,7 +183,7 @@ export type SendRequestOptions = {
165
183
  export type RequestSource = {
166
184
  type: "Raw";
167
185
  raw: string;
168
- connectionInfo: ConnectionInfo;
186
+ connectionInfo: SendRequestOptions["connectionInfo"];
169
187
  } | {
170
188
  type: "ID";
171
189
  id: string;