@caido/sdk-frontend 0.54.2-beta.9 → 0.55.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.
- package/package.json +2 -2
- package/src/types/__generated__/graphql-sdk.d.ts +1042 -228
- package/src/types/index.d.ts +1 -0
- package/src/types/sdks/index.d.ts +5 -0
- package/src/types/sdks/intercept.d.ts +6 -0
- package/src/types/sdks/replay.d.ts +6 -0
- package/src/types/sdks/settings.d.ts +22 -0
- package/src/types/types/ai.d.ts +2 -2
- package/src/types/types/request.d.ts +4 -0
- package/src/types/types/response.d.ts +5 -0
- package/src/types/types/settings.d.ts +25 -0
package/src/types/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export type { CurrentMatchReplaceRuleChangeEvent, MatchReplaceRule, MatchReplace
|
|
|
18
18
|
export { MatchReplaceSlot, type MatchReplaceSlotContent, } from "./types/matchReplace";
|
|
19
19
|
export { ScopeSlot, type CurrentScopeChangeEvent, type Scope, type ScopeSlotContent, } from "./types/scopes";
|
|
20
20
|
export { HTTPHistorySlot, type HTTPHistorySlotContent, } from "./types/httpHistory";
|
|
21
|
+
export { SettingsSlot, type SettingsSlotContent, type SettingsPluginSlotContent, } from "./types/settings";
|
|
21
22
|
export type { EnvironmentVariable } from "./types/environment";
|
|
22
23
|
export type { Workflow, WorkflowKind, OnCreatedWorkflowCallback, OnUpdatedWorkflowCallback, OnDeletedWorkflowCallback, } from "./types/workflows";
|
|
23
24
|
export type { ListenerHandle, AddIndicatorOptions, Indicator, } from "./types/utils";
|
|
@@ -23,6 +23,7 @@ import type { ReplaySDK } from "./replay";
|
|
|
23
23
|
import type { RuntimeSDK } from "./runtime";
|
|
24
24
|
import type { ScopesSDK } from "./scopes";
|
|
25
25
|
import type { SearchSDK } from "./search";
|
|
26
|
+
import type { SettingsSDK } from "./settings";
|
|
26
27
|
import type { ShortcutsSDK } from "./shortcuts";
|
|
27
28
|
import type { SidebarSDK } from "./sidebar";
|
|
28
29
|
import type { SitemapSDK } from "./sitemap";
|
|
@@ -155,6 +156,10 @@ export type API<T extends BackendEndpoints = Record<string, never>, E extends Ba
|
|
|
155
156
|
* Utilities for logging messages to the console.
|
|
156
157
|
*/
|
|
157
158
|
log: LogSDK;
|
|
159
|
+
/**
|
|
160
|
+
* Utilities to interact with the settings page.
|
|
161
|
+
*/
|
|
162
|
+
settings: SettingsSDK;
|
|
158
163
|
/**
|
|
159
164
|
* @private
|
|
160
165
|
* Utilities to track analytics events.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { RequestViewModeOptions } from "../types/request";
|
|
2
|
+
import type { ResponseViewModeOptions } from "../types/response";
|
|
2
3
|
import type { ID } from "../types/utils";
|
|
3
4
|
/**
|
|
4
5
|
* Utilities to interact with the Intercept page.
|
|
@@ -20,4 +21,9 @@ export type InterceptSDK = {
|
|
|
20
21
|
* @param options The view mode options.
|
|
21
22
|
*/
|
|
22
23
|
addRequestViewMode: (options: RequestViewModeOptions) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Add a custom response view mode.
|
|
26
|
+
* @param options The view mode options.
|
|
27
|
+
*/
|
|
28
|
+
addResponseViewMode: (options: ResponseViewModeOptions) => void;
|
|
23
29
|
};
|
|
@@ -1,6 +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
3
|
import type { RequestViewModeOptions } from "../types/request";
|
|
4
|
+
import type { ResponseViewModeOptions } from "../types/response";
|
|
4
5
|
import { type DefineAddToSlotFn } from "../types/slots";
|
|
5
6
|
import type { AddIndicatorOptions, ID, Indicator, ListenerHandle } from "../types/utils";
|
|
6
7
|
/**
|
|
@@ -129,6 +130,11 @@ export type ReplaySDK = {
|
|
|
129
130
|
* @param options The view mode options.
|
|
130
131
|
*/
|
|
131
132
|
addRequestViewMode: (options: RequestViewModeOptions) => void;
|
|
133
|
+
/**
|
|
134
|
+
* Add a custom response view mode.
|
|
135
|
+
* @param options The view mode options.
|
|
136
|
+
*/
|
|
137
|
+
addResponseViewMode: (options: ResponseViewModeOptions) => void;
|
|
132
138
|
/**
|
|
133
139
|
* Send a request to the Replay backend.
|
|
134
140
|
* @param request The request to send.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { SettingsSlotContent } from "../types/settings";
|
|
2
|
+
import type { DefineAddToSlotFn } from "../types/slots";
|
|
3
|
+
/**
|
|
4
|
+
* Utilities to interact with the settings page.
|
|
5
|
+
* @category Settings
|
|
6
|
+
*/
|
|
7
|
+
export type SettingsSDK = {
|
|
8
|
+
/**
|
|
9
|
+
* Add a component to a slot.
|
|
10
|
+
* @param slot The slot to add the component to.
|
|
11
|
+
* @param content The content to add to the slot.
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* sdk.settings.addToSlot(SettingsSlot.PluginsSection, {
|
|
15
|
+
* type: "Custom",
|
|
16
|
+
* name: "My Plugin Settings",
|
|
17
|
+
* definition: MySettingsComponent,
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
addToSlot: DefineAddToSlotFn<SettingsSlotContent>;
|
|
22
|
+
};
|
package/src/types/types/ai.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type LanguageModelV3, type ProviderV3 } from "@ai-sdk/provider";
|
|
2
2
|
/**
|
|
3
3
|
* Settings for AI reasoning.
|
|
4
4
|
* @category AI
|
|
@@ -21,7 +21,7 @@ export type AILanguageModelSettings = {
|
|
|
21
21
|
* Official AI Provider to be used by the [ai](https://ai-sdk.dev/) library.
|
|
22
22
|
* @category AI
|
|
23
23
|
*/
|
|
24
|
-
export type AIProvider =
|
|
24
|
+
export type AIProvider = ProviderV3 & ((modelId: string, settings?: AILanguageModelSettings) => LanguageModelV3);
|
|
25
25
|
/**
|
|
26
26
|
* AI upstream provider ID.
|
|
27
27
|
* @category AI
|
|
@@ -51,4 +51,8 @@ export type RequestViewModeOptions = {
|
|
|
51
51
|
* The component to render when the view mode is selected.
|
|
52
52
|
*/
|
|
53
53
|
view: ComponentDefinition;
|
|
54
|
+
/**
|
|
55
|
+
* A function that determines if the view mode should be shown for a given request.
|
|
56
|
+
*/
|
|
57
|
+
when?: (request: RequestFull | RequestDraft) => boolean;
|
|
54
58
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { RequestFull, RequestMeta } from "./request";
|
|
1
2
|
import type { As, ComponentDefinition, ID, Prettify } from "./utils";
|
|
2
3
|
/**
|
|
3
4
|
* A complete response with all metadata and raw content.
|
|
@@ -24,4 +25,8 @@ export type ResponseViewModeOptions = {
|
|
|
24
25
|
* The component to render when the view mode is selected.
|
|
25
26
|
*/
|
|
26
27
|
view: ComponentDefinition;
|
|
28
|
+
/**
|
|
29
|
+
* A function that determines if the view mode should be shown for a given response.
|
|
30
|
+
*/
|
|
31
|
+
when?: (response: ResponseFull, request: RequestMeta | RequestFull) => boolean;
|
|
27
32
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type CustomSlotContent } from "./slots";
|
|
2
|
+
/**
|
|
3
|
+
* The slots in the Settings UI.
|
|
4
|
+
* @category Settings
|
|
5
|
+
*/
|
|
6
|
+
export declare const SettingsSlot: {
|
|
7
|
+
/**
|
|
8
|
+
* The plugins section in the settings sidebar.
|
|
9
|
+
*/
|
|
10
|
+
readonly PluginsSection: "plugins-section";
|
|
11
|
+
};
|
|
12
|
+
export type SettingsSlot = (typeof SettingsSlot)[keyof typeof SettingsSlot];
|
|
13
|
+
/**
|
|
14
|
+
* Content for a settings plugin slot.
|
|
15
|
+
* @category Settings
|
|
16
|
+
*/
|
|
17
|
+
export type SettingsPluginSlotContent = CustomSlotContent & {
|
|
18
|
+
/**
|
|
19
|
+
* The name of the plugin settings page displayed in the sidebar.
|
|
20
|
+
*/
|
|
21
|
+
name: string;
|
|
22
|
+
};
|
|
23
|
+
export type SettingsSlotContent = {
|
|
24
|
+
[SettingsSlot.PluginsSection]: SettingsPluginSlotContent;
|
|
25
|
+
};
|