@caido/sdk-frontend 0.58.2 → 0.58.3-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,13 @@
1
+ import type { DefineComponent } from "vue";
2
+ import type { HTTPQLEditorProps } from "./types/httpqlEditor";
1
3
  export { FooterSlot, type FooterSlotContent } from "./types/footer";
2
4
  export type { DialogOptions, DialogComponent } from "./types/window";
5
+ export type { Editor } from "./types/editor";
3
6
  export type { _AnalyticsSDK } from "./private/analytics";
4
7
  export type { MessageViewModeOptions, StreamWsMessageMeta, MessageViewModePropsInternal, MessageViewModeProps, } from "./types/websocket";
5
8
  export type { CommandContext, CommandContextRequest, CommandContextRequestRow, CommandContextResponse, CommandContextBase, } from "./types/commands";
6
9
  export type { MenuItem } from "./types/menu";
7
- export { type AddCollectionIndicatorOptions, type AddSessionIndicatorOptions, type ReplayTab, type ReplaySession, type ReplayEntry, type ReplayCollection, type SendRequestOptions, ReplaySlot, type ReplaySlotContent, type RequestSource, type CurrentReplaySessionChangeEvent, } from "./types/replay";
10
+ export { type AddCollectionIndicatorOptions, type AddSessionIndicatorOptions, type ReplayTab, type ReplaySession, type ReplayEntry, type ReplaySelectedExchange, type ReplayWebSocketMessage, type ReplayCollection, type SendRequestOptions, ReplaySlot, type ReplaySlotContent, type RequestSource, type CurrentReplaySessionChangeEvent, ReplaySessionKind, type ReplayPageContext, } from "./types/replay";
8
11
  export type { AutomateSession, AutomateEntry } from "./types/automate";
9
12
  export type { SitemapEntry, SitemapRootEntry, ChildState, } from "./types/sitemap";
10
13
  export { SearchSlot, type SearchSlotContent } from "./types/search";
@@ -12,6 +15,7 @@ export type { HostedFile } from "./types/files";
12
15
  export { FilterSlot, type Filter, type FilterSlotContent, type CurrentFilterChangeEvent, } from "./types/filter";
13
16
  export type { HTTPQL, StreamQL, ID, ComponentDefinition, Selection, QueryInput, } from "./types/utils";
14
17
  export type { JSONValue, JSONCompatible } from "./types/json";
18
+ export type { KVValue, KVEvents } from "./types/kv";
15
19
  export type { SlotContent, ButtonSlotContent, CustomSlotContent, CommandSlotContent, SlotContentPropsInternal, SlotContentProps, } from "./types/slots";
16
20
  export type { RequestViewModeOptions, RequestWritableViewModeProps, RequestReadableViewModeProps, RequestReadableViewModePropsInternal, RequestWritableViewModePropsInternal, RequestViewModeProps, RequestFull, RequestDraft, RequestMeta, } from "./types/request";
17
21
  export type { ResponseViewModePropsInternal, ResponseViewModeOptions, ResponseViewModeProps, ResponseFull, } from "./types/response";
@@ -23,11 +27,12 @@ export { SettingsSlot, type SettingsSlotContent, type SettingsPluginSlotContent,
23
27
  export type { EnvironmentVariable } from "./types/environment";
24
28
  export type { Workflow, WorkflowKind, OnCreatedWorkflowCallback, OnUpdatedWorkflowCallback, OnDeletedWorkflowCallback, } from "./types/workflows";
25
29
  export type { ListenerHandle, AddIndicatorOptions, Indicator, ComponentProps, ComponentPropsWithSdk, } from "./types/utils";
26
- export type { AIProvider, AILanguageModelSettings, AIReasoningSettings, AIUpstreamProvider, AIUpstreamProviderId, AIUpstreamProviderStatus, } from "./types/ai";
30
+ export type { AIProvider, AILanguageModelSettings, AIReasoningSettings, AIUpstreamProvider, AIUpstreamProviderApi, AIUpstreamProviderId, } from "./types/ai";
27
31
  export type { SelectedProjectChangeEvent } from "./types/projects";
28
32
  export type { CommandPaletteViewProps, CommandPaletteViewPropsInternal, } from "./types/commandPalette";
29
33
  export type { CommandPaletteView } from "./sdks/commandPalette";
30
34
  export type { LogSDK } from "./sdks/log";
35
+ export type { KVSDK, KVDefineOptions } from "./sdks/kv";
31
36
  export type { API } from "./sdks";
32
37
  export { Routes } from "./types/navigation";
33
38
  export { type GlobalContext, type PageContext } from "./types/window";
@@ -43,9 +48,12 @@ export type { FindingsPageContext } from "./types/findings";
43
48
  export type { HTTPHistoryPageContext } from "./types/httpHistory";
44
49
  export type { InterceptPageContext } from "./types/intercept";
45
50
  export type { ProjectsPageContext } from "./types/projects";
46
- export type { ReplayPageContext } from "./types/replay";
47
51
  export type { ScopePageContext } from "./types/scopes";
48
52
  export type { SearchPageContext } from "./types/search";
49
53
  export type { SitemapPageContext } from "./types/sitemap";
50
54
  export type { MatchReplacePageContext } from "./types/matchReplace";
51
55
  export type { WorkflowsPageContext } from "./types/workflows";
56
+ export type { HTTPQLEditorProps };
57
+ export declare const HTTPQLEditor: DefineComponent<HTTPQLEditorProps & {
58
+ modelValue?: string;
59
+ }>;
@@ -10,8 +10,8 @@ export type AiSDK = {
10
10
  */
11
11
  createProvider: () => AIProvider;
12
12
  /**
13
- * Gets the list of upstream AI providers with their configuration status.
14
- * @returns An array of AI upstream providers with their configuration status.
13
+ * Gets the list of configured upstream AI providers.
14
+ * @returns An array of configured AI upstream providers.
15
15
  */
16
16
  getUpstreamProviders: () => AIUpstreamProvider[];
17
17
  };
@@ -1,13 +1,23 @@
1
1
  import type { Extension } from "@codemirror/state";
2
2
  import type { AutomateEntry, AutomateSession } from "../types/automate";
3
- import type { RequestReadableViewModeProps, RequestViewModeOptions } from "../types/request";
4
- import type { ResponseViewModeOptions, ResponseViewModeProps } from "../types/response";
3
+ import type { RequestFull, RequestReadableViewModeProps, RequestViewModeOptions } from "../types/request";
4
+ import type { ResponseFull, ResponseViewModeOptions, ResponseViewModeProps } from "../types/response";
5
5
  import type { AddIndicatorOptions, ID, Indicator } from "../types/utils";
6
6
  /**
7
7
  * Utilities to interact with the Automate page.
8
8
  * @category Automate
9
9
  */
10
10
  export type AutomateSDK = {
11
+ /**
12
+ * Get the currently selected request.
13
+ * @returns The currently selected request.
14
+ */
15
+ getSelectedRequest: () => RequestFull | undefined;
16
+ /**
17
+ * Get the currently selected response.
18
+ * @returns The currently selected response.
19
+ */
20
+ getSelectedResponse: () => ResponseFull | undefined;
11
21
  /**
12
22
  * Add an extension to the request editor.
13
23
  * @param extension The extension to add.
@@ -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 { RequestFull, RequestReadableViewModeProps, RequestViewModeOptions } from "../types/request";
4
+ import type { ResponseFull, ResponseViewModeOptions, ResponseViewModeProps } from "../types/response";
5
5
  import type { ID } from "../types/utils";
6
6
  /**
7
7
  * Utilities to interact with findings
@@ -24,6 +24,16 @@ export type FindingsSDK = {
24
24
  reporter: string;
25
25
  dedupeKey?: string;
26
26
  }) => Promise<Finding | undefined>;
27
+ /**
28
+ * Get the currently selected request.
29
+ * @returns The currently selected request.
30
+ */
31
+ getSelectedRequest: () => RequestFull | undefined;
32
+ /**
33
+ * Get the currently selected response.
34
+ * @returns The currently selected response.
35
+ */
36
+ getSelectedResponse: () => ResponseFull | undefined;
27
37
  /**
28
38
  * Add an extension to the request editor.
29
39
  * @param extension The extension to add.
@@ -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 { RequestFull, RequestReadableViewModeProps, RequestViewModeOptions } from "../types/request";
4
+ import type { ResponseFull, ResponseViewModeOptions, ResponseViewModeProps } from "../types/response";
5
5
  import { type DefineAddToSlotFn } from "../types/slots";
6
6
  import type { HTTPQL, ID } from "../types/utils";
7
7
  /**
@@ -24,6 +24,16 @@ export type HTTPHistorySDK = {
24
24
  * @returns The current scope ID.
25
25
  */
26
26
  getScopeId: () => ID | undefined;
27
+ /**
28
+ * Get the currently selected request.
29
+ * @returns The currently selected request.
30
+ */
31
+ getSelectedRequest: () => RequestFull | undefined;
32
+ /**
33
+ * Get the currently selected response.
34
+ * @returns The currently selected response.
35
+ */
36
+ getSelectedResponse: () => ResponseFull | undefined;
27
37
  /**
28
38
  * Set the current scope.
29
39
  * @param id The ID of the scope to set.
@@ -14,6 +14,7 @@ import type { FindingsSDK } from "./findings";
14
14
  import type { FooterSDK } from "./footer";
15
15
  import type { HTTPHistorySDK } from "./httpHistory";
16
16
  import type { InterceptSDK } from "./intercept";
17
+ import type { KVSDK } from "./kv";
17
18
  import type { LogSDK } from "./log";
18
19
  import type { MatchReplaceSDK } from "./matchReplace";
19
20
  import type { MenuSDK } from "./menu";
@@ -39,6 +40,23 @@ import type { WorkflowSDK } from "./workflows";
39
40
  export type API<T extends BackendEndpoints | BackendSpec = Record<string, never>, E extends BackendEvents = Record<string, never>> = {
40
41
  /**
41
42
  * Utilities to interact with the GraphQL API.
43
+ *
44
+ * Queries and mutations return a promise; subscriptions return an
45
+ * `AsyncIterable`. On success they resolve with the response data or yield
46
+ * it. On failure (network error or any GraphQL errors returned by the
47
+ * server) the promise rejects, or the iterator throws into the `for await`
48
+ * loop, with the underlying error. Failures can be handled with `try`/
49
+ * `catch` or `.catch()`.
50
+ *
51
+ * @example
52
+ * ```ts
53
+ * try {
54
+ * const result = await sdk.graphql.automateEntry({ id: "1" });
55
+ * // use result
56
+ * } catch (err) {
57
+ * // err.message, err.graphQLErrors, err.networkError
58
+ * }
59
+ * ```
42
60
  */
43
61
  graphql: GraphqlSDK;
44
62
  /**
@@ -85,6 +103,10 @@ export type API<T extends BackendEndpoints | BackendSpec = Record<string, never>
85
103
  * Utilities to interact with frontend-plugin storage.
86
104
  */
87
105
  storage: StorageSDK;
106
+ /**
107
+ * Utilities to interact with plugin package data (key-value store).
108
+ */
109
+ kv: KVSDK;
88
110
  /**
89
111
  * Utilities to interact with the plugin's static assets.
90
112
  */
@@ -1,5 +1,5 @@
1
- import type { RequestViewModeOptions, RequestWritableViewModeProps } from "../types/request";
2
- import type { ResponseViewModeOptions, ResponseViewModeProps } from "../types/response";
1
+ import type { RequestFull, RequestViewModeOptions, RequestWritableViewModeProps } from "../types/request";
2
+ import type { ResponseFull, ResponseViewModeOptions, ResponseViewModeProps } from "../types/response";
3
3
  import type { ID } from "../types/utils";
4
4
  /**
5
5
  * Utilities to interact with the Intercept page.
@@ -11,6 +11,16 @@ export type InterceptSDK = {
11
11
  * @returns The current scope ID.
12
12
  */
13
13
  getScopeId: () => ID | undefined;
14
+ /**
15
+ * Get the currently selected request.
16
+ * @returns The currently selected request.
17
+ */
18
+ getSelectedRequest: () => RequestFull | undefined;
19
+ /**
20
+ * Get the currently selected response.
21
+ * @returns The currently selected response.
22
+ */
23
+ getSelectedResponse: () => ResponseFull | undefined;
14
24
  /**
15
25
  * Set the current scope.
16
26
  * @param scopeId The ID of the scope to set.
@@ -0,0 +1,69 @@
1
+ import type { KVEvents, KVValue } from "../types/kv";
2
+ import type { ListenerHandle } from "../types/utils";
3
+ /**
4
+ * Options for defining a key-value pair.
5
+ * @category KV
6
+ */
7
+ export type KVDefineOptions = {
8
+ /**
9
+ * Whether the key-value pair is exportable.
10
+ *
11
+ * Usually this should be true for keys that are settings that you would want to
12
+ * transfer between Caido instances.
13
+ *
14
+ * @default false
15
+ */
16
+ exportable?: boolean | undefined;
17
+ };
18
+ /**
19
+ * The SDK for the key-value store.
20
+ *
21
+ * Plugin package data shared across frontend and backend surfaces of the same
22
+ * plugin package. Not per-user; separate from {@link StorageSDK}.
23
+ *
24
+ * @category KV
25
+ */
26
+ export type KVSDK = {
27
+ /**
28
+ * Defines a new key-value pair. Only call this once per key.
29
+ * If the key is not defined, it will be created at first set with default options.
30
+ * Defining a key alone does not notify listeners.
31
+ *
32
+ * @param key The key to define.
33
+ * @param options The options for the key.
34
+ */
35
+ define: (key: string, options: KVDefineOptions) => Promise<void>;
36
+ /**
37
+ * Gets a value from the key-value store.
38
+ *
39
+ * @param key The key to get.
40
+ * @returns The stored value (including null) or undefined if the key is not defined.
41
+ */
42
+ get: <T extends KVValue>(key: string) => Promise<T | undefined>;
43
+ /**
44
+ * Sets a value in the key-value store.
45
+ *
46
+ * @param key The key to set.
47
+ * @param value The value to set.
48
+ */
49
+ set: <T extends KVValue>(key: string, value: T) => Promise<void>;
50
+ /**
51
+ * Deletes a key-value pair from the key-value store.
52
+ *
53
+ * No-op if the key is not defined.
54
+ *
55
+ * @param key The key to delete.
56
+ */
57
+ del: (key: string) => Promise<void>;
58
+ /**
59
+ * Registers a callback for when a key-value pair is set.
60
+ *
61
+ * Fires for writes from any surface of the plugin package, including the
62
+ * local writer.
63
+ *
64
+ * @param event The event to register for.
65
+ * @param callback The callback to register.
66
+ * @returns A handle to stop listening.
67
+ */
68
+ on: <E extends keyof KVEvents>(event: E, callback: KVEvents[E]) => ListenerHandle;
69
+ };
@@ -1,9 +1,10 @@
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 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";
2
+ import { type AddCollectionIndicatorOptions, type AddSessionIndicatorOptions, type CurrentReplaySessionChangeEvent, type OpenTabOptions, type ReplayCollection, type ReplayCollectionCreatedEvent, type ReplayEntry, type ReplaySelectedExchange, type ReplaySession, type ReplaySessionCreatedEvent, type ReplaySessionKind, type ReplaySlotContent, type ReplayTab, type RequestSource, type SendRequestOptions } from "../types/replay";
3
+ import type { RequestFull, RequestViewModeOptions, RequestWritableViewModeProps } from "../types/request";
4
+ import type { ResponseFull, ResponseViewModeOptions, ResponseViewModeProps } from "../types/response";
5
5
  import { type DefineAddToSlotFn } from "../types/slots";
6
6
  import type { ID, Indicator, ListenerHandle } from "../types/utils";
7
+ import type { MessageViewModeOptions, MessageViewModeProps } from "../types/websocket";
7
8
  /**
8
9
  * Utilities to interact with Replay.
9
10
  * @category Replay
@@ -27,9 +28,13 @@ export type ReplaySDK = {
27
28
  getTabs: () => ReplayTab[];
28
29
  /**
29
30
  * Get the list of all replay sessions.
31
+ * @param options The options for getting the sessions.
32
+ * @param options.collectionId The ID of the collection to get the sessions for.
30
33
  * @returns The list of all replay sessions.
31
34
  */
32
- getSessions: () => ReplaySession[];
35
+ getSessions: (options?: {
36
+ collectionId?: ID;
37
+ }) => ReplaySession[];
33
38
  /**
34
39
  * Get the currently selected replay session.
35
40
  * @returns The currently selected replay session, or undefined if no session is selected.
@@ -58,6 +63,21 @@ export type ReplaySDK = {
58
63
  * ```
59
64
  */
60
65
  getCurrentEntry: () => ReplayEntry | undefined;
66
+ /**
67
+ * Get the currently selected Replay exchange.
68
+ * @returns The currently selected Replay exchange.
69
+ */
70
+ getSelectedExchange: () => ReplaySelectedExchange | undefined;
71
+ /**
72
+ * Get the currently selected request.
73
+ * @returns The currently selected request.
74
+ */
75
+ getSelectedRequest: () => RequestFull | undefined;
76
+ /**
77
+ * Get the currently selected response.
78
+ * @returns The currently selected response.
79
+ */
80
+ getSelectedResponse: () => ResponseFull | undefined;
61
81
  /**
62
82
  * Rename a session.
63
83
  * @param id The ID of the session to rename.
@@ -79,10 +99,22 @@ export type ReplaySDK = {
79
99
  deleteSessions: (sessionIds: ID[]) => Promise<ID[]>;
80
100
  /**
81
101
  * Create a session.
82
- * @param sessionId The ID of the request to add.
83
- * @param collectionId The ID of the collection to add the request.
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
+ * ```
84
116
  */
85
- createSession: (source: RequestSource, collectionId?: ID) => Promise<void>;
117
+ createSession: (source: RequestSource, collectionId?: ID, sessionKind?: ReplaySessionKind) => Promise<ReplaySession>;
86
118
  /**
87
119
  * Get the list of all replay collections.
88
120
  * @returns The list of all replay collections.
@@ -149,6 +181,11 @@ export type ReplaySDK = {
149
181
  * @param options The view mode options.
150
182
  */
151
183
  addResponseViewMode: (options: ResponseViewModeOptions<ResponseViewModeProps>) => void;
184
+ /**
185
+ * Add a custom WebSocket message view mode.
186
+ * @param options The view mode options.
187
+ */
188
+ addWebsocketMessageViewMode: (options: MessageViewModeOptions<MessageViewModeProps>) => void;
152
189
  /**
153
190
  * Send a request to the Replay backend.
154
191
  * @param request The request to send.
@@ -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 { RequestFull, RequestReadableViewModeProps, RequestViewModeOptions } from "../types/request";
3
+ import type { ResponseFull, ResponseViewModeOptions, ResponseViewModeProps } from "../types/response";
4
4
  import type { SearchSlot, SearchSlotContent } from "../types/search";
5
5
  import type { HTTPQL, ID } from "../types/utils";
6
6
  /**
@@ -23,6 +23,16 @@ export type SearchSDK = {
23
23
  * @returns The current scope ID.
24
24
  */
25
25
  getScopeId: () => ID | undefined;
26
+ /**
27
+ * Get the currently selected request.
28
+ * @returns The currently selected request.
29
+ */
30
+ getSelectedRequest: () => RequestFull | undefined;
31
+ /**
32
+ * Get the currently selected response.
33
+ * @returns The currently selected response.
34
+ */
35
+ getSelectedResponse: () => ResponseFull | undefined;
26
36
  /**
27
37
  * Set the current scope.
28
38
  * @param id The ID of the scope to set.
@@ -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 { RequestFull, RequestReadableViewModeProps, RequestViewModeOptions } from "../types/request";
3
+ import type { ResponseFull, ResponseViewModeOptions, ResponseViewModeProps } from "../types/response";
4
4
  import type { SitemapEntry, SitemapEntryChildStateUpdateEvent, SitemapRootEntry } from "../types/sitemap";
5
5
  import type { AddIndicatorOptions, ID, Indicator, ListenerHandle } from "../types/utils";
6
6
  /**
@@ -39,6 +39,16 @@ export type SitemapSDK = {
39
39
  * @returns The current scope ID.
40
40
  */
41
41
  getScopeId: () => ID | undefined;
42
+ /**
43
+ * Get the currently selected request.
44
+ * @returns The currently selected request.
45
+ */
46
+ getSelectedRequest: () => RequestFull | undefined;
47
+ /**
48
+ * Get the currently selected response.
49
+ * @returns The currently selected response.
50
+ */
51
+ getSelectedResponse: () => ResponseFull | undefined;
42
52
  /**
43
53
  * Set the current scope.
44
54
  * @param id The ID of the scope to set.
@@ -11,6 +11,16 @@ export type WindowSDK = {
11
11
  * @returns The active editor.
12
12
  */
13
13
  getActiveEditor: () => Editor | undefined;
14
+ /**
15
+ * Get the active request editor.
16
+ * @returns The active request editor.
17
+ */
18
+ getActiveRequestEditor: () => Editor | undefined;
19
+ /**
20
+ * Get the active response editor.
21
+ * @returns The active response editor.
22
+ */
23
+ getActiveResponseEditor: () => Editor | undefined;
14
24
  /**
15
25
  * Show a toast message.
16
26
  * @param message The message to show.
@@ -26,19 +26,18 @@ export type AIProvider = ProviderV3 & ((modelId: string, settings?: AILanguageMo
26
26
  * AI upstream provider ID.
27
27
  * @category AI
28
28
  */
29
- export type AIUpstreamProviderId = "anthropic" | "google" | "openai" | "openrouter";
29
+ export type AIUpstreamProviderId = string;
30
+ /**
31
+ * The response API a provider speaks.
32
+ * @category AI
33
+ */
34
+ export type AIUpstreamProviderApi = "ANTHROPIC" | "GEMINI" | "OPENAI_COMPLETION" | "OPENAI_RESPONSE" | "OPENROUTER";
30
35
  /**
31
36
  * AI upstream provider information.
37
+ * Only configured providers are returned.
32
38
  * @category AI
33
39
  */
34
40
  export type AIUpstreamProvider = {
35
41
  id: AIUpstreamProviderId;
36
- status: AIUpstreamProviderStatus;
42
+ api: AIUpstreamProviderApi;
37
43
  };
38
- /**
39
- * AI upstream provider status.
40
- * Ready: The upstream provider is ready to use.
41
- * Missing: The upstream provider is not configured.
42
- * @category AI
43
- */
44
- export type AIUpstreamProviderStatus = "Ready" | "Missing";
@@ -0,0 +1,3 @@
1
+ export type HTTPQLEditorProps = {
2
+ isReadOnly?: boolean;
3
+ };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Represents any valid value for the key-value store.
3
+ * It needs to be serializable to JSON.
4
+ * @category KV
5
+ */
6
+ export type KVValue = string | number | boolean | KVValue[] | null | {
7
+ [key: string]: KVValue;
8
+ };
9
+ /**
10
+ * Represents the events that can be emitted by the key-value store.
11
+ * @category KV
12
+ */
13
+ export type KVEvents = {
14
+ set: <T extends KVValue>(key: string, value: T) => Promise<void> | void;
15
+ delete: (key: string) => Promise<void> | void;
16
+ };
@@ -1,3 +1,5 @@
1
+ import type { RequestFull } from "./request";
2
+ import type { ResponseFull } from "./response";
1
3
  import { type ButtonSlotContent, type CommandSlotContent, type CustomSlotContent, type SlotContentProps, type SlotContentPropsGroup } from "./slots";
2
4
  import { type AddIndicatorOptions, type ID, type Selection } from "./utils";
3
5
  /**
@@ -110,6 +112,35 @@ export type ReplayEntry = {
110
112
  */
111
113
  requestId?: ID;
112
114
  };
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
+ };
113
144
  /**
114
145
  * A collection in Replay.
115
146
  * @category Replay
@@ -224,6 +255,19 @@ export type AddSessionIndicatorOptions = AddIndicatorOptions & {
224
255
  * @category Replay
225
256
  */
226
257
  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];
227
271
  /**
228
272
  * A unique replay session identifier.
229
273
  * @category Replay