Skip to content

@caido/sdk-frontend

This is the reference for the frontend SDK used by frontend plugins. Caido is the main interface that provides access to various services and functionalities.

SDK

Caido<T, E>

Caido<T, E>: object

Utilities for frontend plugins.

Type Parameters

Type ParameterDefault type
T extends BackendEndpointsRecord<string, never>
E extends BackendEventsRecord<string, never>

Type declaration

backend

backend: BackendSDK<T, E>

Utilities to interact with the backend plugin.

commandPalette

commandPalette: CommandPaletteSDK

Utilities to interact with the command palette.

commands

commands: CommandsSDK

Utilities to interact with commands

env

env: EnvironmentSDK

Utilities to interact with the environment.

files

files: FilesSDK

Utilities to interact with the Files page.

filters

filters: FiltersSDK

Utilities to interact with Filters page.

findings

findings: FindingsSDK

Utilities to interact with findings

graphql

graphql: GraphqlSDK

Utilities to interact with the GraphQL API.

httpHistory

httpHistory: HTTPHistorySDK

Utilities to interact with the HTTP History page.

matchReplace

matchReplace: MatchReplaceSDK

Utilities to interact with Match and Replace page.

menu: MenuSDK

Utilities to insert menu items and context-menus throughout the UI.

navigation: NavigationSDK

Utilities to interact with navigation.

replay

replay: ReplaySDK

Utilities to interact with the Replay page.

scopes

scopes: ScopesSDK

Utilities to interact with scopes

search: SearchSDK

Utilities to interact with the Search page.

shortcuts

shortcuts: ShortcutsSDK

Utilities to interact with shortcuts.

sidebar: SidebarSDK

Utilities to interact with the sidebar.

storage

storage: StorageSDK

Utilities to interact with frontend-plugin storage.

ui

ui: UISDK

Utilities to create UI components.

window

window: WindowSDK

Utilities to interact with the active page.

Backend

BackendEndpoints

BackendEndpoints: object

Endpoints provided by the backend plugin.

Index Signature

[key: string]: (...args: any[]) => any


BackendEvents

BackendEvents: object

Events emitted by the backend plugin.

Index Signature

[key: string]: (...args: any[]) => void


BackendSDK<T, E>

BackendSDK<T, E>: { [K in keyof T]: Function } & object

Utilities to interact with the backend plugin.

Type declaration

onEvent()

onEvent: <K>(event: K, callback: E[K]) => object

Subscribe to a backend event.

Type Parameters
Type Parameter
K extends keyof E
Parameters
ParameterTypeDescription
eventKThe event to subscribe to.
callbackE[K]The callback to call when the event is emitted.
Returns

object

An object with a stop method that can be called to stop listening to the event.

stop()

stop: () => void

Returns

void

Type Parameters

Type Parameter
T extends BackendEndpoints
E extends BackendEvents

UI

UISDK

UISDK: object

Utilities to create UI components.

Type declaration

button()

button: (options?: object) => HTMLElement

Create a button.

Parameters
ParameterTypeDescription
options?objectOptions for the button.
options.label?stringThe label of the button.
options.leadingIcon?IconThe leading icon of the button.
options.size?"small" | "medium" | "large"The size of the button.
options.trailingIcon?IconThe trailing icon of the button.
options.variant?"primary" | "secondary" | "tertiary"The variant of the button.
Returns

HTMLElement

The button element.

Example
ts
const deleteButton = sdk.ui.button({
  variant: "primary",
  label: "Delete",
  trailingIcon: "fas fa-trash-can",
  size: "small",
});
card()

card: (options?: object) => HTMLElement

Create a card.

Parameters
ParameterTypeDescription
options?objectOptions for the card.
options.body?HTMLElementThe body of the card.
options.footer?HTMLElementThe footer of the card.
options.header?HTMLElementThe header of the card.
Returns

HTMLElement

The card element.

httpRequestEditor()

httpRequestEditor: () => HTTPRequestEditor

Create an HTTP request editor

Returns

HTTPRequestEditor

The HTTP request editor.

httpResponseEditor()

httpResponseEditor: () => HTTPResponseEditor

Create an HTTP response editor

Returns

HTTPResponseEditor

The HTTP response editor.

well()

well: (options?: object) => HTMLElement

Create a well.

Parameters
ParameterTypeDescription
options?objectOptions for the well.
options.body?HTMLElementThe body of the well.
options.footer?HTMLElementThe footer of the well.
options.header?HTMLElementThe header of the well.
Returns

HTMLElement

The well element.

Scopes

Scope

Scope: object

Represents a scope.

Type declaration

allowlist

allowlist: string[]

The list of included items.

denylist

denylist: string[]

The list of excluded items.

id

id: ID

The unique ID of the scope.

name

name: string

The name of the scope.


ScopesSDK

ScopesSDK: object

Utilities to interact with scopes

Type declaration

createScope()

createScope: (options: object) => Promise<Scope | undefined>

Create a scope.

Parameters
ParameterTypeDescription
optionsobjectOptions for the scope.
options.allowliststring[]The list of included items in the scope.
options.denyliststring[]The list of excluded items in the scope.
options.namestringThe name of the scope.
Returns

Promise<Scope | undefined>

The created scope.

Example
ts
const newScope = await sdk.scopes.createScope({
  name: "Example",
  allowlist: ["*example.com", "*github.com"],
  denylist: ["*caido.io"],
});
deleteScope()

deleteScope: (id: ID) => Promise<boolean>

Delete a scope.

Parameters
ParameterTypeDescription
idIDThe id of the scope to delete.
Returns

Promise<boolean>

Whether the scope was deleted.

getScopes()

getScopes: () => Scope[]

Get all scopes.

Returns

Scope[]

A list of scopes.

updateScope()

updateScope: (id: ID, options: object) => Promise<Scope | undefined>

Update a scope.

Parameters
ParameterTypeDescription
idIDThe id of the scope to update.
optionsobjectOptions for the scope.
options.allowlist?string[]The list of included items in the scope.
options.denylist?string[]The list of excluded items in the scope.
options.name?stringThe name of the scope.
Returns

Promise<Scope | undefined>

The updated scope.

Findings

Finding

Finding: object

Represents a https://docs.caido.io/reference/features/logging/findings|Finding.

Type declaration

description?

optional description: string

The description of the finding.

host

host: string

The host of the request attached to this finding

id

id: ID

The ID of the finding.

path

path: string

The path of the request attached to this finding

reporter

reporter: string

The reporter of the finding.

title

title: string

The title of the finding.


FindingsSDK

FindingsSDK: object

Utilities to interact with findings

Type declaration

createFinding()

createFinding: (requestId: ID, options: object) => Promise<Finding | undefined>

Create a Finding.

Parameters
ParameterTypeDescription
requestIdIDThe id of the request the finding is associated with.
optionsobjectOptions for the finding.
options.dedupeKey?stringIf a finding with the same deduplication key already exists, it will not create a new finding.
options.description?stringThe description of the finding.
options.reporterstringThe reporter of the finding.
options.titlestringThe title of the finding.
Returns

Promise<Finding | undefined>

The created finding.

Commands

CommandContext

CommandContext: CommandContextBase | CommandContextRequestRow | CommandContextRequest | CommandContextResponse

Represents the context in which a command is executed.


CommandContextBase

CommandContextBase: object

The base context for a command. This context is used for commands that are not executed in a specific context, such as via shortcuts and the command palette.

Type declaration

type

type: "BaseContext"


CommandContextRequest

CommandContextRequest: object

The context for a command that is executed on a request pane.

Type declaration

request

request: object

The request that is currently open in the request pane.

request.host

host: string

request.isTls

isTls: boolean

request.path

path: string

request.port

port: number

request.query

query: string

request.raw

raw: string

selection

selection: string

The currently selected text in the request pane.

type

type: "RequestContext"


CommandContextRequestRow

CommandContextRequestRow: object

The context for a command that is executed on a row in the request table.

Type declaration

requests

requests: object[]

The requests that are selected in the request table.

type

type: "RequestRowContext"


CommandContextResponse

CommandContextResponse: object

The context for a command that is executed on a response pane.

Type declaration

request

request: object

The request that is associated with the response.

request.host

host: string

request.id

id: ID

request.isTls

isTls: boolean

request.path

path: string

request.port

port: number

request.query

query: string

response

response: object

The response that is currently open in the response pane.

response.id

id: ID

response.raw

raw: string

response.roundtripTime

roundtripTime: number

response.statusCode

statusCode: number

selection

selection: string

The currently selected text in the response pane.

type

type: "ResponseContext"


CommandsSDK

CommandsSDK: object

Utilities to interact with commands

Type declaration

register()

register: (id: CommandID, options: object) => void

Register a command.

Parameters
ParameterTypeDescription
idCommandIDThe id of the command.
optionsobjectOptions for the command.
options.group?stringThe group this command belongs to.
options.namestringThe name of the command.
options.run(context: CommandContext) => voidThe function to run when the command is executed.
options.when?(context: CommandContext) => booleanA function to determine if the command is available.
Returns

void

Example
ts
sdk.commands.register("hello", {
  name: "Print to console.",
  run: () => console.log("Hello world!"),
  group: "Custom Commands",
});

MenuItem: RequestRowMenuItem | SettingsMenuItem | RequestMenuItem | ResponseMenuItem

A content-menu item.


MenuSDK: object

Utilities to insert menu items and context-menus throughout the UI.

Type declaration

registerItem()

registerItem: (item: MenuItem) => void

Register a menu item.

Parameters
ParameterTypeDescription
itemMenuItemThe menu item to register.
Returns

void

Example
ts
sdk.menu.registerItem({
  type: "Request",
  commandId: "hello",
  leadingIcon: "fas fa-hand",
});

RequestMenuItem

RequestMenuItem: object

A context-menu item that appears when right-clicking a request pane.

Type declaration

commandId

commandId: CommandID

The command ID to execute when the menu item is clicked.

leadingIcon?

optional leadingIcon: string

The icon to display to the left of the menu item.

type

type: "Request"


RequestRowMenuItem

RequestRowMenuItem: object

A context-menu item that appears when right-clicking a request row.

Type declaration

commandId

commandId: CommandID

The command ID to execute when the menu item is clicked.

leadingIcon?

optional leadingIcon: string

The icon to display to the left of the menu item.

type

type: "RequestRow"


ResponseMenuItem

ResponseMenuItem: object

A context-menu item that appears when right-clicking a response pane.

Type declaration

commandId

commandId: CommandID

The command ID to execute when the menu item is

leadingIcon?

optional leadingIcon: string

The icon to display to the left of the menu item.

type

type: "Response"


SettingsMenuItem

SettingsMenuItem: object

A menu item that appears in the settings menu.

Type declaration

label

label: string

The label of the menu item.

leadingIcon?

optional leadingIcon: Icon

The Icon to display to the left of the menu item.

path

path: string

The path that the user will be navigated to when the menu item is clicked The path must start with "/settings/".

type

type: "Settings"

NavigationSDK: object

Utilities to interact with navigation.

Type declaration

addPage()

addPage: (path: string, options: object) => void

Add a page to the navigation.

Parameters
ParameterTypeDescription
pathstringThe path of the page.
optionsobjectOptions for the page.
options.bodyHTMLElementThe body of the page.
options.onEnter?() => voidThe callback to execute when the page is entered.
options.topbar?HTMLElementThe topbar of the page.
Returns

void

goTo()

goTo: (path: string) => void

Navigate to a path.

Parameters
ParameterTypeDescription
pathstringThe path to navigate to.
Returns

void

Example
ts
sdk.navigation.goTo("/my-plugin-page");

Window

WindowSDK

WindowSDK: object

Utilities to interact with the active page.

Type declaration

getActiveEditor()

getActiveEditor: () => Editor | undefined

Get the active editor.

Returns

Editor | undefined

The active editor.

showToast()

showToast: (message: string, options?: object) => void

Show a toast message.

Parameters
ParameterTypeDescription
messagestringThe message to show.
options?objectOptions for the toast message.
options.duration?numberThe duration of the toast message in milliseconds.
options.variant?"success" | "error" | "warning" | "info"The variant of the toast message.
Returns

void

Storage

StorageSDK

StorageSDK: object

Utilities to interact with frontend-plugin storage.

Type declaration

get()

get: () => JSONValue

Get the storage.

Returns

JSONValue

The storage.

onChange()

onChange: (callback: (value: JSONValue) => void) => void

Subscribe to storage changes.

Parameters
ParameterTypeDescription
callback(value: JSONValue) => voidThe callback to call when the storage changes.
Returns

void

set()

set: <T>(value: JSONCompatible<T>) => Promise<void>

Set the storage.

Type Parameters
Type Parameter
T
Parameters
ParameterTypeDescription
valueJSONCompatible<T>The value to set the storage to
Returns

Promise<void>

A promise that resolves when the storage has been set.

Shortcuts

ShortcutsSDK

ShortcutsSDK: object

Utilities to interact with shortcuts.

Type declaration

register()

register: (commandId: CommandID, keys: string[]) => void

Register a shortcut.

Parameters
ParameterTypeDescription
commandIdCommandIDThe id of the command to run when the shortcut is triggered.
keysstring[]The keys of the shortcut. Check out hotkeys-js for the list of supported keys.
Returns

void

Command Palette

CommandPaletteSDK

CommandPaletteSDK: object

Utilities to interact with the command palette.

Type declaration

register()

register: (commandId: string) => void

Register a command.

Parameters
ParameterTypeDescription
commandIdstringThe id of the command to register.
Returns

void

SidebarItem

SidebarItem: object

Represents a sidebar item.

Type declaration

setCount()

setCount: (count: number) => void

Set the value of a notification badge next to the sidebar item.

Parameters
ParameterTypeDescription
countnumberThe number to display in the badge. A value of 0 will hide the badge.
Returns

void


SidebarSDK

SidebarSDK: object

Utilities to interact with the sidebar.

Type declaration

registerItem()

registerItem: (name: string, path: string, options?: object) => SidebarItem

Register a sidebar item.

Parameters
ParameterTypeDescription
namestringThe name of the sidebar item.
pathstringThe path that the user will be navigated to when the sidebar item is clicked.
options?objectOptions for the sidebar item.
options.group?stringThe group the sidebar item belongs to.
options.icon?IconThe Icon of the sidebar item.
options.isExternal?booleanWhether the path points to an external URL.
Returns

SidebarItem

The created sidebar item.

Example
ts
sdk.sidebar.registerItem("My Plugin", "/my-plugin-page", {
  icon: "fas fa-rocket",
});

Replay

ReplayCollection

ReplayCollection: object

A collection in Replay.

Type declaration

id

id: ID

The ID of the collection.

name

name: string

The name of the collection.

sessionIds

sessionIds: ID[]

The sessions in the collection.


ReplaySDK

ReplaySDK: object

Utilities to interact with Replay.

Type declaration

closeTab()

closeTab: (sessionId: ID) => void

Close a replay tab for the given session.

Parameters
ParameterTypeDescription
sessionIdIDThe ID of the session to close.
Returns

void

getCollections()

getCollections: () => ReplayCollection[]

Get the list of all replay collections.

Returns

ReplayCollection[]

The list of all replay collections.

getSessions()

getSessions: () => ReplaySession[]

Get the list of all replay sessions.

Returns

ReplaySession[]

The list of all replay sessions.

getTabs()

getTabs: () => ReplayTab[]

Get the list of all open replay tabs.

Returns

ReplayTab[]

The list of all open replay tabs.

openTab()

openTab: (sessionId: ID) => void

Open a replay tab for the given session.

Parameters
ParameterTypeDescription
sessionIdIDThe ID of the session to open.
Returns

void

renameSession()

renameSession: (id: ID, name: string) => Promise<ReplaySession>

Rename a session.

Parameters
ParameterTypeDescription
idIDThe ID of the session to rename.
namestringThe new name of the session.
Returns

Promise<ReplaySession>

The updated session.


ReplaySession

ReplaySession: object

A session in Replay.

Type declaration

collectionId

collectionId: ID

The ID of the collection the session belongs to.

id

id: ID

The ID of the session.

name

name: string

The name of the session.


ReplayTab

ReplayTab: object

A replay tab.

Type declaration

sessionId

sessionId: ID

The ID of the session associated with this tab.

HTTP History

HTTPHistorySDK

HTTPHistorySDK: object

Utilities to interact with the HTTP History page.

Type declaration

getQuery()

getQuery: () => HTTPQL

Get the current HTTPQL query.

Returns

HTTPQL

The current HTTPQL query.

setQuery()

setQuery: (query: HTTPQL) => void

Set the HTTPQL query that will be applied on the HTTP History table results.

Parameters
ParameterTypeDescription
queryHTTPQLThe HTTPQL query.
Returns

void

Search

SearchSDK

SearchSDK: object

Utilities to interact with the Search page.

Type declaration

getQuery()

getQuery: () => HTTPQL

Get the current HTTPQL query.

Returns

HTTPQL

The current HTTPQL query.

setQuery()

setQuery: (query: HTTPQL) => void

Set the HTTPQL query that will be applied on the search table results.

Parameters
ParameterTypeDescription
queryHTTPQLThe HTTPQL query.
Returns

void

Files

FilesSDK

FilesSDK: object

SDK for interacting with the Files page.

Type declaration

create()

create: (file: File) => Promise<HostedFile>

Uploads a file to the host.

Parameters
ParameterTypeDescription
fileFileThe file to upload.
Returns

Promise<HostedFile>

The uploaded file.

delete()

delete: (id: string) => Promise<void>

Deletes a file from the host.

Parameters
ParameterTypeDescription
idstringThe ID of the file to delete.
Returns

Promise<void>

The deleted file.

getAll()

getAll: () => HostedFile[]

Gets all hosted files.

Returns

HostedFile[]

The files.

rename()

rename: (id: string, name: string) => Promise<HostedFile>

Renames a file on the host.

Parameters
ParameterTypeDescription
idstringThe ID of the file to rename.
namestringThe new name of the file.
Returns

Promise<HostedFile>

The renamed file.


HostedFile

HostedFile: object

A hosted file.

Type declaration

createdAt

createdAt: Date

The date the file was created.

id

id: string

The ID of the file.

name

name: string

The name of the file.

path

path: string

The path of the file.

size

size: number

The size of the file in bytes.

updatedAt

updatedAt: Date

The date the file was updated.

Environment

EnvironmentSDK

EnvironmentSDK: object

Utilities to interact with the environment.

Type declaration

getVar()

getVar: (name: string) => string | undefined

Get the value of an environment variable.

Parameters
ParameterTypeDescription
namestringThe name of the environment variable.
Returns

string | undefined

The value of the environment variable.

Filters

Filter

Filter: object

Represents a filter.

Type declaration

alias

alias: string

The alias of the filter. This alias is used when referencing the filter in an HTTPQL query (e.g. preset:my-alias).

id

id: ID

The ID of the filter.

name

name: string

The name of the filter.

query

query: HTTPQL

The HTTPQL expression of the filter.


FiltersSDK

FiltersSDK: object

SDK for interacting with the Filters page.

Type declaration

create()

create: (options: object) => Promise<Filter>

Creates a filter.

Parameters
ParameterTypeDescription
optionsobjectOptions for the filter.
options.aliasstringThe alias of the filter. Used when referencing the filter in an HTTPQL query (e.g. preset:my-alias). Should be unique and follow the format [a-zA-Z0-9_-]+.
options.namestringThe name of the filter. Should be unique.
options.queryHTTPQLThe HTTPQL query of the filter.
Returns

Promise<Filter>

The created filter.

delete()

delete: (id: ID) => Promise<void>

Deletes a filter.

Parameters
ParameterTypeDescription
idIDThe ID of the filter to delete.
Returns

Promise<void>

getAll()

getAll: () => Filter[]

Gets all filters.

Returns

Filter[]

The filters.

update()

update: (id: ID, options: object) => Promise<Filter>

Updates a filter.

Parameters
ParameterTypeDescription
idIDThe ID of the filter to update.
optionsobjectOptions for the filter.
options.aliasstringThe alias of the filter.
options.namestringThe name of the filter.
options.queryHTTPQLThe HTTPQL query of the filter.
Returns

Promise<Filter>

The updated filter.

Match and Replace

MatchReplaceCollection

MatchReplaceCollection: object

A collection in Match and Replace.

Type declaration

id

id: ID

name

name: string

ruleIds

ruleIds: ID[]


MatchReplaceRule

MatchReplaceRule: object

A rule in Match and Replace.

Type declaration

collectionId

collectionId: ID

The ID of the collection the rule belongs to.

id

id: ID

The ID of the rule.

isEnabled

isEnabled: boolean

Whether the rule is enabled.

isRegex

isRegex: boolean

Whether the match term is a regex.

matchTerm

matchTerm: string

The match term of the rule.

name

name: string

The name of the rule.

query

query: HTTPQL

The HTTPQL query to match the rule against. Only requests that match the query will be affected by the rule.

replaceTerm

replaceTerm: string

The replace term of the rule.

strategy

strategy: MatchReplaceStrategy

The strategy of the rule.


MatchReplaceSDK

MatchReplaceSDK: object

Utilities to interact with the Match and Replace page.

Type declaration

createCollection()

createCollection: (options: object) => Promise<MatchReplaceCollection>

Create a collection.

Parameters
ParameterTypeDescription
optionsobjectThe options for the collection.
options.namestringThe name of the collection.
Returns

Promise<MatchReplaceCollection>

createRule()

createRule: (options: object) => Promise<MatchReplaceRule>

Create a rule.

Parameters
ParameterTypeDescription
optionsobjectThe options for the rule.
options.collectionIdIDThe ID of the collection the rule belongs to.
options.isEnabledbooleanWhether the rule is enabled.
options.isRegexbooleanWhether the match term is a regex.
options.matchTermstringThe match term of the rule.
options.namestringThe name of the rule.
options.queryHTTPQLThe HTTPQL query to match the rule against.
options.replaceTermstringThe replace term of the rule.
options.strategyMatchReplaceStrategyThe strategy of the rule.
Returns

Promise<MatchReplaceRule>

deleteCollection()

deleteCollection: (id: ID) => Promise<void>

Delete a collection.

Parameters
ParameterTypeDescription
idIDThe ID of the collection.
Returns

Promise<void>

deleteRule()

deleteRule: (id: ID) => Promise<void>

Delete a rule.

Parameters
ParameterTypeDescription
idIDThe ID of the rule.
Returns

Promise<void>

getActiveRules()

getActiveRules: () => MatchReplaceRule[]

Get all active rules. Rules are ordered in priority from highest to lowest.

Returns

MatchReplaceRule[]

All active rules.

getCollections()

getCollections: () => MatchReplaceCollection[]

Get all collections.

Returns

MatchReplaceCollection[]

getRules()

getRules: () => MatchReplaceRule[]

Get all rules.

Returns

MatchReplaceRule[]

All rules.

selectRule()

selectRule: (id: ID | undefined) => void

Select a rule to be displayed in the UI.

Parameters
ParameterTypeDescription
idID | undefinedThe ID of the rule, or undefined to clear the selection.
Returns

void

updateCollection()

updateCollection: (id: ID, options: object) => Promise<MatchReplaceCollection>

Update a collection.

Parameters
ParameterTypeDescription
idIDThe ID of the collection.
optionsobjectThe new values for the collection.
options.namestringThe new name of the collection.
Returns

Promise<MatchReplaceCollection>

updateRule()

updateRule: (id: ID, options: object) => Promise<MatchReplaceRule>

Update a rule.

Parameters
ParameterTypeDescription
idIDThe ID of the rule.
optionsobjectThe new values for the rule.
options.isEnabledbooleanWhether the rule is enabled.
options.isRegexbooleanWhether the match term is a regex.
options.matchTermstringThe new match term of the rule.
options.namestringThe new name of the rule.
options.queryHTTPQLThe new HTTPQL query of the rule.
options.replaceTermstringThe new replace term of the rule.
options.strategyMatchReplaceStrategyThe new strategy of the rule.
Returns

Promise<MatchReplaceRule>

Other

CommandID

CommandID: string & object

A unique command identifier.

Type declaration

__commandId?

optional __commandId: never

Example

ts
"my-super-command"

Editor

Editor: object

Generic editor interface.

Type declaration

focus()

focus: () => void

Focus the editor.

Returns

void

getEditorView()

getEditorView: () => EditorView

Get the editor view.

Returns

EditorView

The CodeMirror EditorView.

getSelectedText()

getSelectedText: () => string

Get the currently selected text of the editor.

Returns

string

isReadOnly()

isReadOnly: () => boolean

Check whether the editor is read-only.

Returns

boolean

Whether the editor is read-only.

replaceSelectedText()

replaceSelectedText: (text: string) => void

Replace the currently selected text of the editor.

Parameters
ParameterTypeDescription
textstringThe text to replace the selection with.
Returns

void


HTTPQL

HTTPQL: string & object

An HTTPQL expression.

Type declaration

__httpql?

optional __httpql: never

Example

ts
`req.method.eq:"POST"`

HTTPRequestEditor

HTTPRequestEditor: object

Type declaration

getEditorView()

getEditorView: () => EditorView

Get the editor view.

Returns

EditorView

The CodeMirror EditorView.

getElement()

getElement: () => HTMLElement

Get the editor element. Append this to your DOM to display the editor.

Returns

HTMLElement

The editor element.


HTTPResponseEditor

HTTPResponseEditor: object

Type declaration

getEditorView()

getEditorView: () => EditorView

Get the editor view.

Returns

EditorView

The CodeMirror EditorView.

getElement()

getElement: () => HTMLElement

Get the editor element. Append this to your DOM to display the editor.

Returns

HTMLElement

The editor element.


Icon

Icon: string & object

A https://fontawesome.com/icons|FontAwesome icon class.

Type declaration

__icon?

optional __icon: never

Example

ts
"fas fa-rocket"

ID

ID: string & object

A unique Caido identifier per type.

Type declaration

__id?

optional __id: never


JSONCompatible<T>

JSONCompatible<T>: unknown extends T ? never : { [P in keyof T]: T[P] extends JSONValue ? T[P] : T[P] extends NotAssignableToJson ? never : JSONCompatible<T[P]> }

Type Parameters

Type Parameter
T

JSONPrimitive

JSONPrimitive: string | number | boolean | null | undefined


JSONValue

JSONValue: JSONPrimitive | JSONValue[] | object


MatchReplaceStrategy

MatchReplaceStrategy: "REQUEST_FIRST_LINE" | "REQUEST_HEADER" | "REQUEST_BODY" | "RESPONSE_FIRST_LINE" | "RESPONSE_HEADER" | "RESPONSE_BODY"


NotAssignableToJson

NotAssignableToJson: bigint | symbol | Function


PromisifiedReturnType<T>

PromisifiedReturnType<T>: ReturnType<T> extends Promise<infer U> ? Promise<U> : Promise<ReturnType<T>>

Type Parameters

Type Parameter
T extends (...args: unknown[]) => unknown