From 2ec66798977bf807307ca0543842380c935faa82 Mon Sep 17 00:00:00 2001 From: Caido Bot Date: Tue, 1 Jul 2025 15:57:05 +0000 Subject: [PATCH] Update SDK Documentation --- src/reference/sdks/backend/index.md | 68 ++++++++ src/reference/sdks/frontend/index.md | 252 ++++++++++++++++++++++++++- src/reference/sdks/workflow/index.md | 68 ++++++++ 3 files changed, 387 insertions(+), 1 deletion(-) diff --git a/src/reference/sdks/backend/index.md b/src/reference/sdks/backend/index.md index e3f6be6..e52550d 100644 --- a/src/reference/sdks/backend/index.md +++ b/src/reference/sdks/backend/index.md @@ -80,6 +80,12 @@ The SDK for the Requests service. The SDK for the runtime information. +##### scope + +> **scope**: [`ScopeSDK`](index.md#scopesdk) + +The SDK for the Scope service. + ## Meta ### MetaSDK @@ -1764,6 +1770,14 @@ The name of the reporter. `string` +##### getRequestId() + +The ID of the associated [Request](index.md#request-1). + +###### Returns + +`string` + ##### getTitle() The title of the finding. @@ -2706,3 +2720,57 @@ Get the current version of Caido. ###### Returns `string` + +## Scope + +### Scope + +> **Scope**: `object` + +A saved immutable Scope. + +#### Type declaration + +##### allowlist + +> `readonly` **allowlist**: `string`[] + +The allowlist of the scope. + +##### denylist + +> `readonly` **denylist**: `string`[] + +The denylist of the scope. + +##### id + +> `readonly` **id**: [`ID`](index.md#id) + +The unique Caido [ID](index.md#id) of the scope. + +##### name + +> `readonly` **name**: `string` + +The name of the scope. + +*** + +### ScopeSDK + +> **ScopeSDK**: `object` + +The SDK for the Scope service. + +#### Type declaration + +##### getAll() + +Get all the scopes. + +###### Returns + +`Promise`\<[`Scope`](index.md#scope-1)[]\> + +An array of [Scope](index.md#scope-1) diff --git a/src/reference/sdks/frontend/index.md b/src/reference/sdks/frontend/index.md index 3f24455..3b99029 100644 --- a/src/reference/sdks/frontend/index.md +++ b/src/reference/sdks/frontend/index.md @@ -1126,7 +1126,7 @@ Utilities to interact with the command palette. #### Type declaration -##### register() +##### ~~register()~~ > **register**: (`commandId`: `string`) => `void` @@ -1142,6 +1142,10 @@ Register a command. `void` +###### Deprecated + +Use `sdk.commandPalette.addToSlot` instead. + ## Sidebar ### SidebarItem @@ -1247,6 +1251,60 @@ Utilities to interact with Replay. #### Type declaration +##### addRequestEditorExtension() + +> **addRequestEditorExtension**: (`extension`: `Extension`) => `void` + +Add an extension to the request editor. + +###### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `extension` | `Extension` | The extension to add. | + +###### Returns + +`void` + +##### addToSlot + +> **addToSlot**: [`DefineAddToSlotFn`](index.md#defineaddtoslotfntmap)\<\{ `session-toolbar-primary`: [`ButtonSlotContent`](index.md#buttonslotcontent) \| [`CustomSlotContent`](index.md#customslotcontenttprops) \| [`CommandSlotContent`](index.md#commandslotcontent); `session-toolbar-secondary`: [`ButtonSlotContent`](index.md#buttonslotcontent) \| [`CustomSlotContent`](index.md#customslotcontenttprops) \| [`CommandSlotContent`](index.md#commandslotcontent); `topbar`: [`ButtonSlotContent`](index.md#buttonslotcontent) \| [`CustomSlotContent`](index.md#customslotcontenttprops) \| [`CommandSlotContent`](index.md#commandslotcontent); \}\> + +Add a component to a slot. + +###### Param + +The slot to add the component to. + +###### Param + +The content to add to the slot. + +###### Example + +```ts +addToSlot(ReplaySlot.SessionToolbarPrimary, { + kind: "Command", + commandId: "my-command", + icon: "my-icon", +}); + +addToSlot(ReplaySlot.SessionToolbarSecondary, { + kind: "Custom", + component: MyComponent, +}); + +addToSlot(ReplaySlot.Topbar, { + kind: "Button", + label: "My Button", + icon: "my-icon", + onClick: () => { + console.log("Button clicked"); + }, +}); +``` + ##### closeTab() > **closeTab**: (`sessionId`: [`ID`](index.md#id-3)) => `void` @@ -1263,6 +1321,56 @@ Close a replay tab for the given session. `void` +##### createCollection() + +> **createCollection**: (`name`: `string`) => `Promise`\<[`ReplayCollection`](index.md#replaycollection)\> + +Create a new collection. + +###### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `name` | `string` | The name of the collection to create. | + +###### Returns + +`Promise`\<[`ReplayCollection`](index.md#replaycollection)\> + +##### deleteCollection() + +> **deleteCollection**: (`id`: [`ID`](index.md#id-3)) => `Promise`\<`boolean`\> + +Delete a collection. + +###### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `id` | [`ID`](index.md#id-3) | The ID of the collection to delete. | + +###### Returns + +`Promise`\<`boolean`\> + +Whether the collection was deleted. + +##### deleteSessions() + +> **deleteSessions**: (`sessionIds`: [`ID`](index.md#id-3)[]) => `Promise`\<[`ID`](index.md#id-3)[]\> + +Delete a session. + +###### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `sessionIds` | [`ID`](index.md#id-3)[] | The IDs of the sessions to delete. | + +###### Returns + +`Promise`\<[`ID`](index.md#id-3)[]\> + ##### getCollections() > **getCollections**: () => [`ReplayCollection`](index.md#replaycollection)[] @@ -1299,6 +1407,25 @@ Get the list of all open replay tabs. The list of all open replay tabs. +##### moveSession() + +> **moveSession**: (`sessionId`: [`ID`](index.md#id-3), `collectionId`: [`ID`](index.md#id-3)) => `Promise`\<[`ReplaySession`](index.md#replaysession)\> + +Move a session to a different collection. + +###### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `sessionId` | [`ID`](index.md#id-3) | The ID of the session to move. | +| `collectionId` | [`ID`](index.md#id-3) | The ID of the collection to move the session to. | + +###### Returns + +`Promise`\<[`ReplaySession`](index.md#replaysession)\> + +The updated session. + ##### openTab() > **openTab**: (`sessionId`: [`ID`](index.md#id-3)) => `void` @@ -1315,6 +1442,25 @@ Open a replay tab for the given session. `void` +##### renameCollection() + +> **renameCollection**: (`id`: [`ID`](index.md#id-3), `name`: `string`) => `Promise`\<[`ReplayCollection`](index.md#replaycollection)\> + +Rename a collection. + +###### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `id` | [`ID`](index.md#id-3) | The ID of the collection to rename. | +| `name` | `string` | The new name of the collection. | + +###### Returns + +`Promise`\<[`ReplayCollection`](index.md#replaycollection)\> + +The updated collection. + ##### renameSession() > **renameSession**: (`id`: [`ID`](index.md#id-3), `name`: `string`) => `Promise`\<[`ReplaySession`](index.md#replaysession)\> @@ -2391,6 +2537,12 @@ A section for the response first line. ## Other +### ButtonSlotContent + +> **ButtonSlotContent**: [`DefineSlotContent`](index.md#defineslotcontentttype-p)\<`"Button"`, \{ `icon`: `string`; `label`: `string`; `onClick`: () => `void`; \}\> + +*** + ### CommandID > **CommandID**: `string` & `object` @@ -2411,6 +2563,72 @@ A unique command identifier. *** +### CommandSlotContent + +> **CommandSlotContent**: [`DefineSlotContent`](index.md#defineslotcontentttype-p)\<`"Command"`, \{ `commandId`: [`CommandID`](index.md#commandid); `icon`: `string`; \}\> + +*** + +### CustomSlotContent\ + +> **CustomSlotContent**\<`TProps`\>: [`DefineSlotContent`](index.md#defineslotcontentttype-p)\<`"Custom"`, \{ `component`: `Component`\<`TProps`\>; \}\> + +#### Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `TProps` *extends* `Record`\<`string`, `unknown`\> | `Record`\<`string`, `unknown`\> | + +*** + +### DefineAddToSlotFn()\ + +> **DefineAddToSlotFn**\<`TMap`\>: \<`K`\>(`slot`: `K`, `spec`: `TMap`\[`K`\]) => `void` + +#### Type Parameters + +| Type Parameter | +| ------ | +| `TMap` *extends* `Record`\<`string`, [`DefineSlotContent`](index.md#defineslotcontentttype-p)\<`string`, `Record`\<`string`, `unknown`\>\>\> | + +#### Type Parameters + +| Type Parameter | +| ------ | +| `K` *extends* `string` \| `number` \| `symbol` | + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `slot` | `K` | +| `spec` | `TMap`\[`K`\] | + +#### Returns + +`void` + +*** + +### DefineSlotContent\ + +> **DefineSlotContent**\<`TType`, `P`\>: `object` & `P` + +#### Type declaration + +##### type + +> **type**: `TType` + +#### Type Parameters + +| Type Parameter | +| ------ | +| `TType` *extends* `string` | +| `P` *extends* `Record`\<`string`, `unknown`\> | + +*** + ### Editor > **Editor**: `object` @@ -3142,6 +3360,38 @@ Stop the listener. *** +### ReplaySlot + +> **ReplaySlot**: *typeof* [`ReplaySlot`](index.md#replayslot-1)\[keyof *typeof* [`ReplaySlot`](index.md#replayslot-1)\] + +*** + +### SlotContent + +> **SlotContent**: [`ButtonSlotContent`](index.md#buttonslotcontent) \| [`CustomSlotContent`](index.md#customslotcontenttprops) \| [`CommandSlotContent`](index.md#commandslotcontent) + +*** + +### ReplaySlot + +> `const` **ReplaySlot**: `object` + +#### Type declaration + +##### SessionToolbarPrimary + +> `readonly` **SessionToolbarPrimary**: `"session-toolbar-primary"` + +##### SessionToolbarSecondary + +> `readonly` **SessionToolbarSecondary**: `"session-toolbar-secondary"` + +##### Topbar + +> `readonly` **Topbar**: `"topbar"` + +*** + ### API Renames and re-exports [Caido](index.md#caidot-e) diff --git a/src/reference/sdks/workflow/index.md b/src/reference/sdks/workflow/index.md index ed1a166..d6cc66a 100644 --- a/src/reference/sdks/workflow/index.md +++ b/src/reference/sdks/workflow/index.md @@ -57,6 +57,12 @@ The SDK for the Requests service. The SDK for the runtime information. +##### scope + +> **scope**: [`ScopeSDK`](index.md#scopesdk) + +The SDK for the Scope service. + ##### asString() Converts bytes to a string. @@ -1616,6 +1622,14 @@ The name of the reporter. `string` +##### getRequestId() + +The ID of the associated [Request](index.md#request-2). + +###### Returns + +`string` + ##### getTitle() The title of the finding. @@ -2277,3 +2291,57 @@ Get the current version of Caido. ###### Returns `string` + +## Scope + +### Scope + +> **Scope**: `object` + +A saved immutable Scope. + +#### Type declaration + +##### allowlist + +> `readonly` **allowlist**: `string`[] + +The allowlist of the scope. + +##### denylist + +> `readonly` **denylist**: `string`[] + +The denylist of the scope. + +##### id + +> `readonly` **id**: [`ID`](index.md#id) + +The unique Caido [ID](index.md#id) of the scope. + +##### name + +> `readonly` **name**: `string` + +The name of the scope. + +*** + +### ScopeSDK + +> **ScopeSDK**: `object` + +The SDK for the Scope service. + +#### Type declaration + +##### getAll() + +Get all the scopes. + +###### Returns + +`Promise`\<[`Scope`](index.md#scope)[]\> + +An array of [Scope](index.md#scope)