@caido/sdk-frontend 0.56.1-beta.4 → 0.56.1-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/types/index.d.ts +7 -6
- package/src/types/sdks/automate.d.ts +4 -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/intercept.d.ts +4 -4
- package/src/types/sdks/replay.d.ts +4 -4
- 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 +2 -2
- package/src/types/sdks/window.d.ts +3 -3
- 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/matchReplace.d.ts +3 -4
- package/src/types/types/replay.d.ts +7 -5
- 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/package.json
CHANGED
package/src/types/index.d.ts
CHANGED
|
@@ -1,7 +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, } from "./types/websocket";
|
|
4
|
+
export type { MessageViewModeOptions, StreamWsMessageMeta, MessageViewModePropsInternal, MessageViewModeProps, } from "./types/websocket";
|
|
5
5
|
export type { CommandContext, CommandContextRequest, CommandContextRequestRow, CommandContextResponse, CommandContextBase, } from "./types/commands";
|
|
6
6
|
export type { MenuItem } from "./types/menu";
|
|
7
7
|
export { type ReplayTab, type ReplaySession, type ReplayEntry, type ReplayCollection, type SendRequestOptions, ReplaySlot, type ReplaySlotContent, type RequestSource, type CurrentReplaySessionChangeEvent, } from "./types/replay";
|
|
@@ -12,9 +12,9 @@ export type { HostedFile } from "./types/files";
|
|
|
12
12
|
export { FilterSlot, type Filter, type FilterSlotContent, type CurrentFilterChangeEvent, } from "./types/filter";
|
|
13
13
|
export type { HTTPQL, StreamQL, ID, ComponentDefinition, Selection, QueryInput, } from "./types/utils";
|
|
14
14
|
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";
|
|
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
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";
|
|
19
19
|
export { MatchReplaceSlot, type MatchReplaceSlotContent, } from "./types/matchReplace";
|
|
20
20
|
export { ScopeSlot, type CurrentScopeChangeEvent, type Scope, type ScopeSlotContent, } from "./types/scopes";
|
|
@@ -22,9 +22,10 @@ export { HTTPHistorySlot, type HTTPHistorySlotContent, } from "./types/httpHisto
|
|
|
22
22
|
export { SettingsSlot, type SettingsSlotContent, type SettingsPluginSlotContent, } from "./types/settings";
|
|
23
23
|
export type { EnvironmentVariable } from "./types/environment";
|
|
24
24
|
export type { Workflow, WorkflowKind, OnCreatedWorkflowCallback, OnUpdatedWorkflowCallback, OnDeletedWorkflowCallback, } from "./types/workflows";
|
|
25
|
-
export type { ListenerHandle, AddIndicatorOptions, Indicator, } from "./types/utils";
|
|
25
|
+
export type { ListenerHandle, AddIndicatorOptions, Indicator, ComponentProps, ComponentPropsWithSdk, } from "./types/utils";
|
|
26
26
|
export type { AIProvider, AILanguageModelSettings, AIReasoningSettings, AIUpstreamProvider, AIUpstreamProviderId, AIUpstreamProviderStatus, } from "./types/ai";
|
|
27
27
|
export type { SelectedProjectChangeEvent } from "./types/projects";
|
|
28
|
+
export type { CommandPaletteViewProps, CommandPaletteViewPropsInternal, } from "./types/commandPalette";
|
|
28
29
|
export type { CommandPaletteView } from "./sdks/commandPalette";
|
|
29
30
|
export type { LogSDK } from "./sdks/log";
|
|
30
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,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,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,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.
|
|
@@ -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.
|
|
@@ -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
|
|
@@ -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.
|
|
@@ -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
|
};
|
|
@@ -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.
|
|
@@ -448,9 +448,8 @@ export type MatchReplaceSlot = (typeof MatchReplaceSlot)[keyof typeof MatchRepla
|
|
|
448
448
|
* Content that can be added to match and replace slots.
|
|
449
449
|
* @category Match and Replace
|
|
450
450
|
*/
|
|
451
|
-
export type MatchReplaceSlotContent = {
|
|
452
|
-
[MatchReplaceSlot
|
|
453
|
-
[MatchReplaceSlot.CreateHeader]: ButtonSlotContent | CustomSlotContent | CommandSlotContent;
|
|
451
|
+
export type MatchReplaceSlotContent<TProps extends SlotContentPropsGroup = SlotContentProps> = {
|
|
452
|
+
[K in MatchReplaceSlot]: ButtonSlotContent | CustomSlotContent<TProps> | CommandSlotContent;
|
|
454
453
|
};
|
|
455
454
|
/**
|
|
456
455
|
* Event fired when the current match and replace rule 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
|
import { type ID, type Selection } from "./utils";
|
|
3
3
|
/**
|
|
4
4
|
* The connection information to use for the request.
|
|
@@ -42,10 +42,12 @@ export declare const ReplaySlot: {
|
|
|
42
42
|
readonly Topbar: "topbar";
|
|
43
43
|
};
|
|
44
44
|
export type ReplaySlot = (typeof ReplaySlot)[keyof typeof ReplaySlot];
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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;
|
|
49
51
|
};
|
|
50
52
|
/**
|
|
51
53
|
* Options for opening a tab.
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type EditorView } from "@codemirror/view";
|
|
2
|
+
import { type API } from "../sdks";
|
|
1
3
|
import { type As, type ComponentDefinition, type ID, type Prettify } from "./utils";
|
|
2
4
|
/**
|
|
3
5
|
* A draft request that has not yet been saved to the database.
|
|
@@ -38,11 +40,47 @@ export type RequestFull = Prettify<As<"RequestFull"> & {
|
|
|
38
40
|
streamId: ID | undefined;
|
|
39
41
|
raw: string;
|
|
40
42
|
}>;
|
|
43
|
+
/**
|
|
44
|
+
* The internal props for the request read-only view mode.
|
|
45
|
+
* @category Request
|
|
46
|
+
*/
|
|
47
|
+
export type RequestReadableViewModePropsInternal = {
|
|
48
|
+
request: RequestFull;
|
|
49
|
+
view: EditorView;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* The internal props for the request writable view mode.
|
|
53
|
+
* @category Request
|
|
54
|
+
*/
|
|
55
|
+
export type RequestWritableViewModePropsInternal = {
|
|
56
|
+
request: RequestFull | undefined;
|
|
57
|
+
draft: RequestDraft;
|
|
58
|
+
view: EditorView;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* The props for the request writable view mode.
|
|
62
|
+
* @category Request
|
|
63
|
+
*/
|
|
64
|
+
export type RequestWritableViewModeProps = RequestWritableViewModePropsInternal & {
|
|
65
|
+
sdk: API;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* The props for the request read-only view mode.
|
|
69
|
+
* @category Request
|
|
70
|
+
*/
|
|
71
|
+
export type RequestReadableViewModeProps = RequestReadableViewModePropsInternal & {
|
|
72
|
+
sdk: API;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* The props group for the request view mode.
|
|
76
|
+
* @category Request
|
|
77
|
+
*/
|
|
78
|
+
export type RequestViewModeProps = RequestReadableViewModeProps | RequestWritableViewModeProps | RequestReadableViewModePropsInternal | RequestWritableViewModePropsInternal;
|
|
41
79
|
/**
|
|
42
80
|
* Options for defining a custom request view mode.
|
|
43
81
|
* @category Request
|
|
44
82
|
*/
|
|
45
|
-
export type RequestViewModeOptions = {
|
|
83
|
+
export type RequestViewModeOptions<TProps extends RequestViewModeProps> = {
|
|
46
84
|
/**
|
|
47
85
|
* The label of the view mode.
|
|
48
86
|
*/
|
|
@@ -50,7 +88,7 @@ export type RequestViewModeOptions = {
|
|
|
50
88
|
/**
|
|
51
89
|
* The component to render when the view mode is selected.
|
|
52
90
|
*/
|
|
53
|
-
view: ComponentDefinition
|
|
91
|
+
view: ComponentDefinition<TProps>;
|
|
54
92
|
/**
|
|
55
93
|
* A function that determines if the view mode should be shown for a given request.
|
|
56
94
|
*/
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type EditorView } from "@codemirror/view";
|
|
2
|
+
import { type API } from "../sdks";
|
|
1
3
|
import type { RequestFull, RequestMeta } from "./request";
|
|
2
4
|
import type { As, ComponentDefinition, ID, Prettify } from "./utils";
|
|
3
5
|
/**
|
|
@@ -12,11 +14,26 @@ export type ResponseFull = Prettify<As<"ResponseFull"> & {
|
|
|
12
14
|
length: number;
|
|
13
15
|
createdAt: Date;
|
|
14
16
|
}>;
|
|
17
|
+
/**
|
|
18
|
+
* The internal props for the response view mode.
|
|
19
|
+
* @category Response
|
|
20
|
+
*/
|
|
21
|
+
export type ResponseViewModePropsInternal = {
|
|
22
|
+
response: ResponseFull;
|
|
23
|
+
view: EditorView;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* The props for the response view mode.
|
|
27
|
+
* @category Response
|
|
28
|
+
*/
|
|
29
|
+
export type ResponseViewModeProps = ResponseViewModePropsInternal & {
|
|
30
|
+
sdk: API;
|
|
31
|
+
};
|
|
15
32
|
/**
|
|
16
33
|
* Options for defining a custom response view mode.
|
|
17
34
|
* @category Response
|
|
18
35
|
*/
|
|
19
|
-
export type ResponseViewModeOptions = {
|
|
36
|
+
export type ResponseViewModeOptions<TProps extends ResponseViewModeProps | ResponseViewModePropsInternal> = {
|
|
20
37
|
/**
|
|
21
38
|
* The label of the view mode.
|
|
22
39
|
*/
|
|
@@ -24,7 +41,7 @@ export type ResponseViewModeOptions = {
|
|
|
24
41
|
/**
|
|
25
42
|
* The component to render when the view mode is selected.
|
|
26
43
|
*/
|
|
27
|
-
view: ComponentDefinition
|
|
44
|
+
view: ComponentDefinition<TProps>;
|
|
28
45
|
/**
|
|
29
46
|
* A function that determines if the view mode should be shown for a given response.
|
|
30
47
|
*/
|
|
@@ -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
|
* Represents a scope.
|
|
@@ -37,9 +37,12 @@ export declare const ScopeSlot: {
|
|
|
37
37
|
readonly CreateHeader: "create-header";
|
|
38
38
|
};
|
|
39
39
|
export type ScopeSlot = (typeof ScopeSlot)[keyof typeof ScopeSlot];
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Content that can be added to scope slots.
|
|
42
|
+
* @category Scopes
|
|
43
|
+
*/
|
|
44
|
+
export type ScopeSlotContent<TProps extends SlotContentPropsGroup = SlotContentProps> = {
|
|
45
|
+
[K in ScopeSlot]: ButtonSlotContent | CustomSlotContent<TProps> | CommandSlotContent;
|
|
43
46
|
};
|
|
44
47
|
/**
|
|
45
48
|
* Event fired when the current scope 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 Search UI.
|
|
4
4
|
* @category Search
|
|
@@ -10,8 +10,12 @@ export declare const SearchSlot: {
|
|
|
10
10
|
readonly ToolbarPrimary: "search-toolbar-primary";
|
|
11
11
|
};
|
|
12
12
|
export type SearchSlot = (typeof SearchSlot)[keyof typeof SearchSlot];
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Content that can be added to search slots.
|
|
15
|
+
* @category Search
|
|
16
|
+
*/
|
|
17
|
+
export type SearchSlotContent<TProps extends SlotContentPropsGroup = SlotContentProps> = {
|
|
18
|
+
[K in SearchSlot]: ButtonSlotContent | CustomSlotContent<TProps> | CommandSlotContent;
|
|
15
19
|
};
|
|
16
20
|
/**
|
|
17
21
|
* Search page context.
|
|
@@ -1,8 +1,26 @@
|
|
|
1
|
+
import { type API } from "../sdks";
|
|
1
2
|
import { type CommandID } from "./commands";
|
|
2
3
|
import { type ComponentDefinition, type Prettify } from "./utils";
|
|
3
4
|
type DefineSlotContent<TType extends string, P extends Record<string, unknown>> = Prettify<{
|
|
4
5
|
type: TType;
|
|
5
6
|
} & P>;
|
|
7
|
+
/**
|
|
8
|
+
* The internal props for a slot content.
|
|
9
|
+
* @category Slots
|
|
10
|
+
*/
|
|
11
|
+
export type SlotContentPropsInternal = {};
|
|
12
|
+
/**
|
|
13
|
+
* The props for a slot content.
|
|
14
|
+
* @category Slots
|
|
15
|
+
*/
|
|
16
|
+
export type SlotContentProps = SlotContentPropsInternal & {
|
|
17
|
+
sdk: API;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* The props group for a slot content.
|
|
21
|
+
* @category Slots
|
|
22
|
+
*/
|
|
23
|
+
export type SlotContentPropsGroup = SlotContentProps | SlotContentPropsInternal;
|
|
6
24
|
/**
|
|
7
25
|
* Content for a button slot.
|
|
8
26
|
* @category Slots
|
|
@@ -16,8 +34,8 @@ export type ButtonSlotContent = DefineSlotContent<"Button", {
|
|
|
16
34
|
* Content for a custom component slot.
|
|
17
35
|
* @category Slots
|
|
18
36
|
*/
|
|
19
|
-
export type CustomSlotContent = DefineSlotContent<"Custom", {
|
|
20
|
-
definition: ComponentDefinition
|
|
37
|
+
export type CustomSlotContent<TProps extends SlotContentPropsGroup = SlotContentProps> = DefineSlotContent<"Custom", {
|
|
38
|
+
definition: ComponentDefinition<TProps>;
|
|
21
39
|
}>;
|
|
22
40
|
/**
|
|
23
41
|
* Content for a command slot.
|
|
@@ -31,7 +49,7 @@ export type CommandSlotContent = DefineSlotContent<"Command", {
|
|
|
31
49
|
* Union type of all possible slot content types.
|
|
32
50
|
* @category Slots
|
|
33
51
|
*/
|
|
34
|
-
export type SlotContent = ButtonSlotContent | CustomSlotContent | CommandSlotContent;
|
|
52
|
+
export type SlotContent<TProps extends SlotContentPropsGroup = SlotContentProps> = ButtonSlotContent | CustomSlotContent<TProps> | CommandSlotContent;
|
|
35
53
|
/**
|
|
36
54
|
* A function type for adding content to slots.
|
|
37
55
|
* @category Slots
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Component as VueComponent } from "vue";
|
|
2
|
+
import { type API } from "../index";
|
|
2
3
|
/**
|
|
3
4
|
* A unique Caido identifier per type.
|
|
4
5
|
* @category Utils
|
|
@@ -37,13 +38,25 @@ export type QueryInput = HTTPQL | StreamQL;
|
|
|
37
38
|
export type Icon = string & {
|
|
38
39
|
__icon?: never;
|
|
39
40
|
};
|
|
41
|
+
/**
|
|
42
|
+
* A set of properties that can be passed to a component.
|
|
43
|
+
* @category Utils
|
|
44
|
+
*/
|
|
45
|
+
export type ComponentProps = Record<string, unknown>;
|
|
46
|
+
/**
|
|
47
|
+
* A set of properties that can be passed to a component definition with the SDK.
|
|
48
|
+
* @category Utils
|
|
49
|
+
*/
|
|
50
|
+
export type ComponentPropsWithSdk<TProps extends ComponentProps> = TProps & {
|
|
51
|
+
sdk: API;
|
|
52
|
+
};
|
|
40
53
|
/**
|
|
41
54
|
* A custom component that will be rendered in the UI.
|
|
42
55
|
* @category Utils
|
|
43
56
|
*/
|
|
44
|
-
export type ComponentDefinition = {
|
|
45
|
-
component: VueComponent
|
|
46
|
-
props?:
|
|
57
|
+
export type ComponentDefinition<TProps = ComponentProps> = {
|
|
58
|
+
component: VueComponent<TProps>;
|
|
59
|
+
props?: ComponentProps;
|
|
47
60
|
events?: Record<string, (...args: unknown[]) => void>;
|
|
48
61
|
};
|
|
49
62
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type EditorView } from "@codemirror/view";
|
|
2
|
+
import type { As, ComponentDefinition, ComponentPropsWithSdk, ID, Prettify } from "./utils";
|
|
2
3
|
/**
|
|
3
4
|
* Certificate page context.
|
|
4
5
|
* @category Websockets
|
|
@@ -21,11 +22,24 @@ export type StreamWsMessageMeta = Prettify<As<"StreamWsMessageMeta"> & {
|
|
|
21
22
|
createdAt: Date;
|
|
22
23
|
};
|
|
23
24
|
}>;
|
|
25
|
+
/**
|
|
26
|
+
* The internal props for the message view mode.
|
|
27
|
+
* @category Websockets
|
|
28
|
+
*/
|
|
29
|
+
export type MessageViewModePropsInternal = {
|
|
30
|
+
message: StreamWsMessageMeta;
|
|
31
|
+
view: EditorView;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* The props for the message view mode.
|
|
35
|
+
* @category Websockets
|
|
36
|
+
*/
|
|
37
|
+
export type MessageViewModeProps = ComponentPropsWithSdk<MessageViewModePropsInternal>;
|
|
24
38
|
/**
|
|
25
39
|
* Options for defining a custom message view mode.
|
|
26
40
|
* @category Websockets
|
|
27
41
|
*/
|
|
28
|
-
export type MessageViewModeOptions = {
|
|
42
|
+
export type MessageViewModeOptions<TProps extends MessageViewModeProps | MessageViewModePropsInternal> = {
|
|
29
43
|
/**
|
|
30
44
|
* The label of the view mode.
|
|
31
45
|
*/
|
|
@@ -33,7 +47,7 @@ export type MessageViewModeOptions = {
|
|
|
33
47
|
/**
|
|
34
48
|
* The component to render when the view mode is selected.
|
|
35
49
|
*/
|
|
36
|
-
view: ComponentDefinition
|
|
50
|
+
view: ComponentDefinition<TProps>;
|
|
37
51
|
/**
|
|
38
52
|
* A function that determines if the view mode should be shown for a given message.
|
|
39
53
|
*/
|
|
@@ -15,6 +15,7 @@ import type { ReplayPageContext } from "./replay";
|
|
|
15
15
|
import type { ScopePageContext } from "./scopes";
|
|
16
16
|
import type { SearchPageContext } from "./search";
|
|
17
17
|
import type { SitemapPageContext } from "./sitemap";
|
|
18
|
+
import type { ComponentDefinition, ComponentProps, ComponentPropsWithSdk } from "./utils";
|
|
18
19
|
import { type WebsocketPageContext } from "./websocket";
|
|
19
20
|
import type { WorkflowsPageContext } from "./workflows";
|
|
20
21
|
/**
|
|
@@ -29,6 +30,11 @@ export type DialogOptions = {
|
|
|
29
30
|
modal?: boolean;
|
|
30
31
|
position?: "left" | "right" | "top" | "bottom" | "center" | "topleft" | "topright" | "bottomleft" | "bottomright";
|
|
31
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* The component definition for a dialog.
|
|
35
|
+
* @category Window
|
|
36
|
+
*/
|
|
37
|
+
export type DialogComponent = ComponentDefinition<ComponentPropsWithSdk<ComponentProps>>;
|
|
32
38
|
/**
|
|
33
39
|
* A dialog instance that can be closed programmatically.
|
|
34
40
|
* @category Window
|