@caido/sdk-frontend 0.57.2-beta.3 → 0.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,10 @@
1
- import type { DefineComponent } from "vue";
2
- import type { HTTPQLEditorProps } from "./types/httpqlEditor";
3
1
  export { FooterSlot, type FooterSlotContent } from "./types/footer";
4
2
  export type { DialogOptions, DialogComponent } from "./types/window";
5
- export type { Editor } from "./types/editor";
6
3
  export type { _AnalyticsSDK } from "./private/analytics";
7
4
  export type { MessageViewModeOptions, StreamWsMessageMeta, MessageViewModePropsInternal, MessageViewModeProps, } from "./types/websocket";
8
5
  export type { CommandContext, CommandContextRequest, CommandContextRequestRow, CommandContextResponse, CommandContextBase, } from "./types/commands";
9
6
  export type { MenuItem } from "./types/menu";
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";
7
+ export { type AddCollectionIndicatorOptions, type AddSessionIndicatorOptions, type ReplayTab, type ReplaySession, type ReplayEntry, type ReplayCollection, type SendRequestOptions, ReplaySlot, type ReplaySlotContent, type RequestSource, type CurrentReplaySessionChangeEvent, } from "./types/replay";
11
8
  export type { AutomateSession, AutomateEntry } from "./types/automate";
12
9
  export type { SitemapEntry, SitemapRootEntry, ChildState, } from "./types/sitemap";
13
10
  export { SearchSlot, type SearchSlotContent } from "./types/search";
@@ -26,7 +23,7 @@ export { SettingsSlot, type SettingsSlotContent, type SettingsPluginSlotContent,
26
23
  export type { EnvironmentVariable } from "./types/environment";
27
24
  export type { Workflow, WorkflowKind, OnCreatedWorkflowCallback, OnUpdatedWorkflowCallback, OnDeletedWorkflowCallback, } from "./types/workflows";
28
25
  export type { ListenerHandle, AddIndicatorOptions, Indicator, ComponentProps, ComponentPropsWithSdk, } from "./types/utils";
29
- export type { AIProvider, AILanguageModelSettings, AIReasoningSettings, AIUpstreamProvider, AIUpstreamProviderApi, AIUpstreamProviderId, } from "./types/ai";
26
+ export type { AIProvider, AILanguageModelSettings, AIReasoningSettings, AIUpstreamProvider, AIUpstreamProviderId, AIUpstreamProviderStatus, } from "./types/ai";
30
27
  export type { SelectedProjectChangeEvent } from "./types/projects";
31
28
  export type { CommandPaletteViewProps, CommandPaletteViewPropsInternal, } from "./types/commandPalette";
32
29
  export type { CommandPaletteView } from "./sdks/commandPalette";
@@ -46,12 +43,9 @@ export type { FindingsPageContext } from "./types/findings";
46
43
  export type { HTTPHistoryPageContext } from "./types/httpHistory";
47
44
  export type { InterceptPageContext } from "./types/intercept";
48
45
  export type { ProjectsPageContext } from "./types/projects";
46
+ export type { ReplayPageContext } from "./types/replay";
49
47
  export type { ScopePageContext } from "./types/scopes";
50
48
  export type { SearchPageContext } from "./types/search";
51
49
  export type { SitemapPageContext } from "./types/sitemap";
52
50
  export type { MatchReplacePageContext } from "./types/matchReplace";
53
51
  export type { WorkflowsPageContext } from "./types/workflows";
54
- export type { HTTPQLEditorProps };
55
- export declare const HTTPQLEditor: DefineComponent<HTTPQLEditorProps & {
56
- modelValue?: string;
57
- }>;
@@ -10,8 +10,8 @@ export type AiSDK = {
10
10
  */
11
11
  createProvider: () => AIProvider;
12
12
  /**
13
- * Gets the list of configured upstream AI providers.
14
- * @returns An array of configured AI upstream providers.
13
+ * Gets the list of upstream AI providers with their configuration status.
14
+ * @returns An array of AI upstream providers with their configuration status.
15
15
  */
16
16
  getUpstreamProviders: () => AIUpstreamProvider[];
17
17
  };
@@ -1,23 +1,13 @@
1
1
  import type { Extension } from "@codemirror/state";
2
2
  import type { AutomateEntry, AutomateSession } from "../types/automate";
3
- import type { RequestFull, RequestReadableViewModeProps, RequestViewModeOptions } from "../types/request";
4
- import type { ResponseFull, ResponseViewModeOptions, ResponseViewModeProps } 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.
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;
21
11
  /**
22
12
  * Add an extension to the request editor.
23
13
  * @param extension The extension to add.
@@ -1,7 +1,7 @@
1
1
  import type { Extension } from "@codemirror/state";
2
2
  import { type Finding } from "../types/findings";
3
- import type { RequestFull, RequestReadableViewModeProps, RequestViewModeOptions } from "../types/request";
4
- import type { ResponseFull, ResponseViewModeOptions, ResponseViewModeProps } 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
@@ -24,16 +24,6 @@ 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;
37
27
  /**
38
28
  * Add an extension to the request editor.
39
29
  * @param extension The extension to add.
@@ -1,7 +1,7 @@
1
1
  import type { Extension } from "@codemirror/state";
2
2
  import type { HTTPHistorySlotContent } from "../types/httpHistory";
3
- import type { RequestFull, RequestReadableViewModeProps, RequestViewModeOptions } from "../types/request";
4
- import type { ResponseFull, ResponseViewModeOptions, ResponseViewModeProps } 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
  /**
@@ -24,16 +24,6 @@ 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;
37
27
  /**
38
28
  * Set the current scope.
39
29
  * @param id The ID of the scope to set.
@@ -39,23 +39,6 @@ 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
- * ```
59
42
  */
60
43
  graphql: GraphqlSDK;
61
44
  /**
@@ -1,5 +1,5 @@
1
- import type { RequestFull, RequestViewModeOptions, RequestWritableViewModeProps } from "../types/request";
2
- import type { ResponseFull, ResponseViewModeOptions, ResponseViewModeProps } 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.
@@ -11,16 +11,6 @@ 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;
24
14
  /**
25
15
  * Set the current scope.
26
16
  * @param scopeId The ID of the scope to set.
@@ -1,10 +1,9 @@
1
1
  import { type Extension } from "@codemirror/state";
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";
2
+ import { type AddCollectionIndicatorOptions, type AddSessionIndicatorOptions, 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";
5
5
  import { type DefineAddToSlotFn } from "../types/slots";
6
6
  import type { ID, Indicator, ListenerHandle } from "../types/utils";
7
- import type { MessageViewModeOptions, MessageViewModeProps } from "../types/websocket";
8
7
  /**
9
8
  * Utilities to interact with Replay.
10
9
  * @category Replay
@@ -28,13 +27,9 @@ export type ReplaySDK = {
28
27
  getTabs: () => ReplayTab[];
29
28
  /**
30
29
  * 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.
33
30
  * @returns The list of all replay sessions.
34
31
  */
35
- getSessions: (options?: {
36
- collectionId?: ID;
37
- }) => ReplaySession[];
32
+ getSessions: () => ReplaySession[];
38
33
  /**
39
34
  * Get the currently selected replay session.
40
35
  * @returns The currently selected replay session, or undefined if no session is selected.
@@ -63,21 +58,6 @@ export type ReplaySDK = {
63
58
  * ```
64
59
  */
65
60
  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;
81
61
  /**
82
62
  * Rename a session.
83
63
  * @param id The ID of the session to rename.
@@ -99,22 +79,10 @@ export type ReplaySDK = {
99
79
  deleteSessions: (sessionIds: ID[]) => Promise<ID[]>;
100
80
  /**
101
81
  * Create a session.
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
- * ```
82
+ * @param sessionId The ID of the request to add.
83
+ * @param collectionId The ID of the collection to add the request.
116
84
  */
117
- createSession: (source: RequestSource, collectionId?: ID, sessionKind?: ReplaySessionKind) => Promise<ReplaySession>;
85
+ createSession: (source: RequestSource, collectionId?: ID) => Promise<void>;
118
86
  /**
119
87
  * Get the list of all replay collections.
120
88
  * @returns The list of all replay collections.
@@ -181,11 +149,6 @@ export type ReplaySDK = {
181
149
  * @param options The view mode options.
182
150
  */
183
151
  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;
189
152
  /**
190
153
  * Send a request to the Replay backend.
191
154
  * @param request The request to send.
@@ -1,6 +1,6 @@
1
1
  import type { Extension } from "@codemirror/state";
2
- import type { RequestFull, RequestReadableViewModeProps, RequestViewModeOptions } from "../types/request";
3
- import type { ResponseFull, ResponseViewModeOptions, ResponseViewModeProps } 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
  /**
@@ -23,16 +23,6 @@ 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;
36
26
  /**
37
27
  * Set the current scope.
38
28
  * @param id The ID of the scope to set.
@@ -1,6 +1,6 @@
1
1
  import type { Extension } from "@codemirror/state";
2
- import type { RequestFull, RequestReadableViewModeProps, RequestViewModeOptions } from "../types/request";
3
- import type { ResponseFull, ResponseViewModeOptions, ResponseViewModeProps } 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
  /**
@@ -39,16 +39,6 @@ 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;
52
42
  /**
53
43
  * Set the current scope.
54
44
  * @param id The ID of the scope to set.
@@ -11,16 +11,6 @@ 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;
24
14
  /**
25
15
  * Show a toast message.
26
16
  * @param message The message to show.
@@ -26,18 +26,19 @@ export type AIProvider = ProviderV3 & ((modelId: string, settings?: AILanguageMo
26
26
  * AI upstream provider ID.
27
27
  * @category AI
28
28
  */
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";
29
+ export type AIUpstreamProviderId = "anthropic" | "google" | "openai" | "openrouter";
35
30
  /**
36
31
  * AI upstream provider information.
37
- * Only configured providers are returned.
38
32
  * @category AI
39
33
  */
40
34
  export type AIUpstreamProvider = {
41
35
  id: AIUpstreamProviderId;
42
- api: AIUpstreamProviderApi;
36
+ status: AIUpstreamProviderStatus;
43
37
  };
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";
@@ -1,5 +1,3 @@
1
- import type { RequestFull } from "./request";
2
- import type { ResponseFull } from "./response";
3
1
  import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent, type SlotContentProps, type SlotContentPropsGroup } from "./slots";
4
2
  import { type AddIndicatorOptions, type ID, type Selection } from "./utils";
5
3
  /**
@@ -112,35 +110,6 @@ export type ReplayEntry = {
112
110
  */
113
111
  requestId?: ID;
114
112
  };
115
- /**
116
- * The currently selected Replay exchange.
117
- * @category Replay
118
- */
119
- export type ReplaySelectedExchange = {
120
- kind: typeof ReplaySessionKind.Http;
121
- entryId: ID;
122
- sessionId: ID;
123
- request: RequestFull;
124
- response?: ResponseFull;
125
- } | {
126
- kind: typeof ReplaySessionKind.Ws;
127
- entryId: ID;
128
- sessionId: ID;
129
- streamId?: ID;
130
- activeTab: "http-upgrade" | "messages";
131
- upgradeRequest?: RequestFull;
132
- upgradeResponse?: ResponseFull;
133
- message?: ReplayWebSocketMessage;
134
- };
135
- /**
136
- * The currently edited WebSocket message in Replay.
137
- * @category Replay
138
- */
139
- export type ReplayWebSocketMessage = {
140
- raw: string;
141
- direction: "CLIENT" | "SERVER";
142
- format: "BINARY" | "CLOSE" | "PING" | "PONG" | "TEXT";
143
- };
144
113
  /**
145
114
  * A collection in Replay.
146
115
  * @category Replay
@@ -255,19 +224,6 @@ export type AddSessionIndicatorOptions = AddIndicatorOptions & {
255
224
  * @category Replay
256
225
  */
257
226
  export type AddCollectionIndicatorOptions = AddIndicatorOptions;
258
- /**
259
- * The kind of a replay session.
260
- * @category Replay
261
- */
262
- export declare const ReplaySessionKind: {
263
- readonly Http: "HTTP";
264
- readonly Ws: "WS";
265
- };
266
- /**
267
- * The kind of a replay session.
268
- * @category Replay
269
- */
270
- export type ReplaySessionKind = (typeof ReplaySessionKind)[keyof typeof ReplaySessionKind];
271
227
  /**
272
228
  * A unique replay session identifier.
273
229
  * @category Replay
@@ -1,3 +0,0 @@
1
- export type HTTPQLEditorProps = {
2
- isReadOnly?: boolean;
3
- };