Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/reference/sdks/frontend/findings.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

> **Finding** = `object`

Represents a [https://docs.caido.io/reference/features/logging/findings\|Finding](https://docs.caido.io/reference/features/logging/findings|Finding).
Represents a [https://docs.caido.io/app/quickstart/findings.html\|Finding](https://docs.caido.io/app/quickstart/findings.html|Finding).

#### Properties

Expand Down
6 changes: 6 additions & 0 deletions src/reference/sdks/frontend/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@ Utilities to interact with frontend-plugin storage.

Utilities to create UI components.

##### websocket

> **websocket**: [`WebsocketSDK`](websockets.md#websocketsdk)

Utilities to interact with the Websocket page.

##### window

> **window**: [`WindowSDK`](window.md#windowsdk)
Expand Down
76 changes: 71 additions & 5 deletions src/reference/sdks/frontend/match-and-replace.md
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,36 @@ An operation to update the response status code.

***

### MatchReplaceOperationWebsocket

> **MatchReplaceOperationWebsocket** = [`KeepOperation`](other.md#keepoperation)\<[`MatchReplaceOperationWebsocketRaw`](#matchreplaceoperationwebsocketraw)\>

An operation for the response websocket section.

***

### MatchReplaceOperationWebsocketRaw

> **MatchReplaceOperationWebsocketRaw** = `object`

A raw operation for the response websocket section.

#### Properties

##### kind

> **kind**: `"OperationWebsocketRaw"`

##### matcher

> **matcher**: [`MatchReplaceMatcherRaw`](#matchreplacematcherraw)

##### replacer

> **replacer**: [`MatchReplaceReplacer`](#matchreplacereplacer)

***

### MatchReplacePageContext

> **MatchReplacePageContext** = `object`
Expand Down Expand Up @@ -712,10 +742,10 @@ Create a rule.

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `options` | \{ `collectionId`: [`ID`](utils.md#id); `name`: `string`; `query`: [`HTTPQL`](utils.md#httpql); `section`: [`MatchReplaceSection`](#matchreplacesection); `sources`: [`Source`](#source)[]; \} | The options for the rule. |
| `options` | \{ `collectionId`: [`ID`](utils.md#id); `name`: `string`; `query`: [`QueryInput`](utils.md#queryinput); `section`: [`MatchReplaceSection`](#matchreplacesection); `sources`: [`Source`](#source)[]; \} | The options for the rule. |
| `options.collectionId` | [`ID`](utils.md#id) | The ID of the collection the rule belongs to. |
| `options.name` | `string` | The name of the rule. |
| `options.query` | [`HTTPQL`](utils.md#httpql) | The HTTPQL query to match the rule against. |
| `options.query` | [`QueryInput`](utils.md#queryinput) | The query to match the rule against. |
| `options.section` | [`MatchReplaceSection`](#matchreplacesection) | - |
| `options.sources` | [`Source`](#source)[] | The sources the rule belongs to. |

Expand Down Expand Up @@ -893,9 +923,9 @@ Update a rule.
| Parameter | Type | Description |
| ------ | ------ | ------ |
| `id` | [`ID`](utils.md#id) | The ID of the rule. |
| `options` | \{ `name`: `string`; `query?`: [`HTTPQL`](utils.md#httpql); `section`: [`MatchReplaceSection`](#matchreplacesection); `sources`: [`Source`](#source)[]; \} | The new values for the rule. |
| `options` | \{ `name`: `string`; `query?`: [`QueryInput`](utils.md#queryinput); `section`: [`MatchReplaceSection`](#matchreplacesection); `sources`: [`Source`](#source)[]; \} | The new values for the rule. |
| `options.name` | `string` | The new name of the rule. |
| `options.query?` | [`HTTPQL`](utils.md#httpql) | The new HTTPQL query of the rule. |
| `options.query?` | [`QueryInput`](utils.md#queryinput) | The new query of the rule. |
| `options.section` | [`MatchReplaceSection`](#matchreplacesection) | The new section of the rule. |
| `options.sources` | [`Source`](#source)[] | The new sources of the rule. |

Expand All @@ -907,7 +937,7 @@ Update a rule.

### MatchReplaceSection

> **MatchReplaceSection** = [`MatchReplaceSectionRequestAll`](#matchreplacesectionrequestall) \| [`MatchReplaceSectionRequestBody`](#matchreplacesectionrequestbody) \| [`MatchReplaceSectionRequestFirstLine`](#matchreplacesectionrequestfirstline) \| [`MatchReplaceSectionRequestHeader`](#matchreplacesectionrequestheader) \| [`MatchReplaceSectionRequestMethod`](#matchreplacesectionrequestmethod) \| [`MatchReplaceSectionRequestPath`](#matchreplacesectionrequestpath) \| [`MatchReplaceSectionRequestQuery`](#matchreplacesectionrequestquery) \| [`MatchReplaceSectionRequestSNI`](#matchreplacesectionrequestsni) \| [`MatchReplaceSectionResponseAll`](#matchreplacesectionresponseall) \| [`MatchReplaceSectionResponseBody`](#matchreplacesectionresponsebody) \| [`MatchReplaceSectionResponseFirstLine`](#matchreplacesectionresponsefirstline) \| [`MatchReplaceSectionResponseHeader`](#matchreplacesectionresponseheader) \| [`MatchReplaceSectionResponseStatusCode`](#matchreplacesectionresponsestatuscode)
> **MatchReplaceSection** = [`MatchReplaceSectionRequestAll`](#matchreplacesectionrequestall) \| [`MatchReplaceSectionRequestBody`](#matchreplacesectionrequestbody) \| [`MatchReplaceSectionRequestFirstLine`](#matchreplacesectionrequestfirstline) \| [`MatchReplaceSectionRequestHeader`](#matchreplacesectionrequestheader) \| [`MatchReplaceSectionRequestMethod`](#matchreplacesectionrequestmethod) \| [`MatchReplaceSectionRequestPath`](#matchreplacesectionrequestpath) \| [`MatchReplaceSectionRequestQuery`](#matchreplacesectionrequestquery) \| [`MatchReplaceSectionRequestSNI`](#matchreplacesectionrequestsni) \| [`MatchReplaceSectionResponseAll`](#matchreplacesectionresponseall) \| [`MatchReplaceSectionResponseBody`](#matchreplacesectionresponsebody) \| [`MatchReplaceSectionResponseFirstLine`](#matchreplacesectionresponsefirstline) \| [`MatchReplaceSectionResponseHeader`](#matchreplacesectionresponseheader) \| [`MatchReplaceSectionResponseStatusCode`](#matchreplacesectionresponsestatuscode) \| [`MatchReplaceSectionResponseWebsocket`](#matchreplacesectionresponsewebsocket) \| [`MatchReplaceSectionRequestWebsocket`](#matchreplacesectionrequestwebsocket)

A discriminated union of all possible match and replace sections.

Expand Down Expand Up @@ -1057,6 +1087,24 @@ A section for the request SNI.

***

### MatchReplaceSectionRequestWebsocket

> **MatchReplaceSectionRequestWebsocket** = `object`

A section for the request websocket.

#### Properties

##### kind

> **kind**: `"SectionRequestWebsocket"`

##### operation

> **operation**: [`MatchReplaceOperationWebsocket`](#matchreplaceoperationwebsocket)

***

### MatchReplaceSectionResponseAll

> **MatchReplaceSectionResponseAll** = `object`
Expand Down Expand Up @@ -1147,6 +1195,24 @@ A section for the response status code.

***

### MatchReplaceSectionResponseWebsocket

> **MatchReplaceSectionResponseWebsocket** = `object`

A section for the response websocket.

#### Properties

##### kind

> **kind**: `"SectionResponseWebsocket"`

##### operation

> **operation**: [`MatchReplaceOperationWebsocket`](#matchreplaceoperationwebsocket)

***

### MatchReplaceSlotContent

> **MatchReplaceSlotContent** = `object`
Expand Down
105 changes: 38 additions & 67 deletions src/reference/sdks/frontend/replay.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
# Replay

### ConnectionInfo

> **ConnectionInfo** = `object`

The connection information to use for the request.

#### Properties

##### host

> **host**: `string`

The host to use for the request.

##### isTLS

> **isTLS**: `boolean`

Whether the request is TLS.

##### port

> **port**: `number`

The port to use for the request.

##### SNI?

> `optional` **SNI**: `string`

The SNI to use for the request.
If not provided, the SNI will be inferred from the host.

***

### CurrentReplaySessionChangeEvent

> **CurrentReplaySessionChangeEvent** = `object`
Expand Down Expand Up @@ -611,7 +646,7 @@ sendRequest(sessionId, {

##### showEntry()

> **showEntry**: (`sessionId`: [`ID`](utils.md#id), `entryId`: [`ID`](utils.md#id), `options?`: `object`) => `Promise`\<`void`\>
> **showEntry**: (`sessionId`: [`ID`](utils.md#id), `entryId`: [`ID`](utils.md#id)) => `Promise`\<`void`\>

Show a specific entry in a replay session.
This will open the session tab if not already open, set it as the selected session, and display the specified entry.
Expand All @@ -622,8 +657,6 @@ This will open the session tab if not already open, set it as the selected sessi
| ------ | ------ | ------ |
| `sessionId` | [`ID`](utils.md#id) | The ID of the session containing the entry. |
| `entryId` | [`ID`](utils.md#id) | The ID of the entry to show. |
| `options?` | \{ `overwriteDraft?`: `boolean`; \} | The options for showing the entry. |
| `options.overwriteDraft?` | `boolean` | Whether to overwrite the request draft. If true, the draft will be removed and the entry's raw request will be shown. If false, the draft will be kept. |

###### Returns

Expand All @@ -632,9 +665,7 @@ This will open the session tab if not already open, set it as the selected sessi
###### Example

```ts
await sdk.replay.showEntry(sessionId, entryId, {
overwriteDraft: true,
});
await sdk.replay.showEntry(sessionId, entryId);
```

***
Expand Down Expand Up @@ -721,7 +752,7 @@ The ID of the session associated with this tab.

### RequestSource

> **RequestSource** = \{ `connectionInfo`: [`SendRequestOptions`](#sendrequestoptions)\[`"connectionInfo"`\]; `raw`: `string`; `type`: `"Raw"`; \} \| \{ `id`: `string`; `type`: `"ID"`; \}
> **RequestSource** = \{ `connectionInfo`: [`ConnectionInfo`](#connectioninfo); `raw`: `string`; `type`: `"Raw"`; \} \| \{ `id`: `string`; `type`: `"ID"`; \}

#### Remarks

Expand Down Expand Up @@ -764,66 +795,6 @@ If true, the request will not update the UI.
If false, the UI will be updated to display the session and the new request.
Defaults to false.

##### connectionClose?

> `optional` **connectionClose**: `boolean`

Whether to force close the connection by setting Connection: close header.
Defaults to true.

##### connectionInfo

> **connectionInfo**: `object`

The connection information to use for the request.

###### host

> **host**: `string`

The host to use for the request.

###### isTLS

> **isTLS**: `boolean`

Whether the request is TLS.

###### port

> **port**: `number`

The port to use for the request.

###### SNI?

> `optional` **SNI**: `string`

The SNI to use for the request.
If not provided, the SNI will be inferred from the host.

##### overwriteDraft?

> `optional` **overwriteDraft**: `boolean`

Whether to overwrite the editor's draft content.
If true, draft content will be overwritten with the new request.
If false, the draft will be kept.
Defaults to true.

##### raw

> **raw**: `string`

The raw request to send.

##### updateContentLength?

> `optional` **updateContentLength**: `boolean`

Whether to update the content length automatically to match the body.
Defaults to true.

***

### ReplaySlot
Expand Down
38 changes: 38 additions & 0 deletions src/reference/sdks/frontend/utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,24 @@ Utility type for converting endpoint return types to promises.

***

### QueryInput

> **QueryInput** = [`HTTPQL`](#httpql) \| [`StreamQL`](#streamql)

A query input.

#### Examples

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

```ts
`"ws.raw.cont:'hello'"`
```

***

### Selection

> **Selection**\<`TId`\> = \{ `kind`: `"Empty"`; \} \| \{ `kind`: `"Selected"`; `main`: `TId`; `secondary`: `TId`[]; \}
Expand All @@ -193,3 +211,23 @@ Main represents the primary selected item, secondary represents additional selec
| Type Parameter |
| ------ |
| `TId` |

***

### StreamQL

> **StreamQL** = `string` & `object`

A STREAMQL expression.

#### Type Declaration

##### \_\_streamql?

> `optional` **\_\_streamql**: `never`

#### Example

```ts
`ws.raw.cont:"hello"`
```
Loading
Loading