Skip to content

Commit d8788b2

Browse files
committed
Update SDK Documentation
1 parent 7d52ec4 commit d8788b2

File tree

6 files changed

+226
-73
lines changed

6 files changed

+226
-73
lines changed

src/reference/sdks/frontend/findings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
> **Finding** = `object`
66
7-
Represents a [https://docs.caido.io/reference/features/logging/findings\|Finding](https://docs.caido.io/reference/features/logging/findings|Finding).
7+
Represents a [https://docs.caido.io/app/quickstart/findings.html\|Finding](https://docs.caido.io/app/quickstart/findings.html|Finding).
88

99
#### Properties
1010

src/reference/sdks/frontend/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,12 @@ Utilities to interact with frontend-plugin storage.
194194
195195
Utilities to create UI components.
196196

197+
##### websocket
198+
199+
> **websocket**: [`WebsocketSDK`](websockets.md#websocketsdk)
200+
201+
Utilities to interact with the Websocket page.
202+
197203
##### window
198204

199205
> **window**: [`WindowSDK`](window.md#windowsdk)

src/reference/sdks/frontend/match-and-replace.md

Lines changed: 71 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,36 @@ An operation to update the response status code.
496496
497497
***
498498

499+
### MatchReplaceOperationWebsocket
500+
501+
> **MatchReplaceOperationWebsocket** = [`KeepOperation`](other.md#keepoperation)\<[`MatchReplaceOperationWebsocketRaw`](#matchreplaceoperationwebsocketraw)\>
502+
503+
An operation for the response websocket section.
504+
505+
***
506+
507+
### MatchReplaceOperationWebsocketRaw
508+
509+
> **MatchReplaceOperationWebsocketRaw** = `object`
510+
511+
A raw operation for the response websocket section.
512+
513+
#### Properties
514+
515+
##### kind
516+
517+
> **kind**: `"OperationWebsocketRaw"`
518+
519+
##### matcher
520+
521+
> **matcher**: [`MatchReplaceMatcherRaw`](#matchreplacematcherraw)
522+
523+
##### replacer
524+
525+
> **replacer**: [`MatchReplaceReplacer`](#matchreplacereplacer)
526+
527+
***
528+
499529
### MatchReplacePageContext
500530

501531
> **MatchReplacePageContext** = `object`
@@ -712,10 +742,10 @@ Create a rule.
712742

713743
| Parameter | Type | Description |
714744
| ------ | ------ | ------ |
715-
| `options` | \{ `collectionId`: [`ID`](utils.md#id); `name`: `string`; `query`: [`HTTPQL`](utils.md#httpql); `section`: [`MatchReplaceSection`](#matchreplacesection); `sources`: [`Source`](#source)[]; \} | The options for the rule. |
745+
| `options` | \{ `collectionId`: [`ID`](utils.md#id); `name`: `string`; `query`: [`QueryInput`](utils.md#queryinput); `section`: [`MatchReplaceSection`](#matchreplacesection); `sources`: [`Source`](#source)[]; \} | The options for the rule. |
716746
| `options.collectionId` | [`ID`](utils.md#id) | The ID of the collection the rule belongs to. |
717747
| `options.name` | `string` | The name of the rule. |
718-
| `options.query` | [`HTTPQL`](utils.md#httpql) | The HTTPQL query to match the rule against. |
748+
| `options.query` | [`QueryInput`](utils.md#queryinput) | The query to match the rule against. |
719749
| `options.section` | [`MatchReplaceSection`](#matchreplacesection) | - |
720750
| `options.sources` | [`Source`](#source)[] | The sources the rule belongs to. |
721751

@@ -893,9 +923,9 @@ Update a rule.
893923
| Parameter | Type | Description |
894924
| ------ | ------ | ------ |
895925
| `id` | [`ID`](utils.md#id) | The ID of the rule. |
896-
| `options` | \{ `name`: `string`; `query?`: [`HTTPQL`](utils.md#httpql); `section`: [`MatchReplaceSection`](#matchreplacesection); `sources`: [`Source`](#source)[]; \} | The new values for the rule. |
926+
| `options` | \{ `name`: `string`; `query?`: [`QueryInput`](utils.md#queryinput); `section`: [`MatchReplaceSection`](#matchreplacesection); `sources`: [`Source`](#source)[]; \} | The new values for the rule. |
897927
| `options.name` | `string` | The new name of the rule. |
898-
| `options.query?` | [`HTTPQL`](utils.md#httpql) | The new HTTPQL query of the rule. |
928+
| `options.query?` | [`QueryInput`](utils.md#queryinput) | The new query of the rule. |
899929
| `options.section` | [`MatchReplaceSection`](#matchreplacesection) | The new section of the rule. |
900930
| `options.sources` | [`Source`](#source)[] | The new sources of the rule. |
901931

@@ -907,7 +937,7 @@ Update a rule.
907937

908938
### MatchReplaceSection
909939

910-
> **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)
940+
> **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)
911941

912942
A discriminated union of all possible match and replace sections.
913943

@@ -1057,6 +1087,24 @@ A section for the request SNI.
10571087
10581088
***
10591089

1090+
### MatchReplaceSectionRequestWebsocket
1091+
1092+
> **MatchReplaceSectionRequestWebsocket** = `object`
1093+
1094+
A section for the request websocket.
1095+
1096+
#### Properties
1097+
1098+
##### kind
1099+
1100+
> **kind**: `"SectionRequestWebsocket"`
1101+
1102+
##### operation
1103+
1104+
> **operation**: [`MatchReplaceOperationWebsocket`](#matchreplaceoperationwebsocket)
1105+
1106+
***
1107+
10601108
### MatchReplaceSectionResponseAll
10611109

10621110
> **MatchReplaceSectionResponseAll** = `object`
@@ -1147,6 +1195,24 @@ A section for the response status code.
11471195
11481196
***
11491197

1198+
### MatchReplaceSectionResponseWebsocket
1199+
1200+
> **MatchReplaceSectionResponseWebsocket** = `object`
1201+
1202+
A section for the response websocket.
1203+
1204+
#### Properties
1205+
1206+
##### kind
1207+
1208+
> **kind**: `"SectionResponseWebsocket"`
1209+
1210+
##### operation
1211+
1212+
> **operation**: [`MatchReplaceOperationWebsocket`](#matchreplaceoperationwebsocket)
1213+
1214+
***
1215+
11501216
### MatchReplaceSlotContent
11511217

11521218
> **MatchReplaceSlotContent** = `object`

src/reference/sdks/frontend/replay.md

Lines changed: 38 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,40 @@
11
# Replay
22

3+
### ConnectionInfo
4+
5+
> **ConnectionInfo** = `object`
6+
7+
The connection information to use for the request.
8+
9+
#### Properties
10+
11+
##### host
12+
13+
> **host**: `string`
14+
15+
The host to use for the request.
16+
17+
##### isTLS
18+
19+
> **isTLS**: `boolean`
20+
21+
Whether the request is TLS.
22+
23+
##### port
24+
25+
> **port**: `number`
26+
27+
The port to use for the request.
28+
29+
##### SNI?
30+
31+
> `optional` **SNI**: `string`
32+
33+
The SNI to use for the request.
34+
If not provided, the SNI will be inferred from the host.
35+
36+
***
37+
338
### CurrentReplaySessionChangeEvent
439

540
> **CurrentReplaySessionChangeEvent** = `object`
@@ -611,7 +646,7 @@ sendRequest(sessionId, {
611646

612647
##### showEntry()
613648

614-
> **showEntry**: (`sessionId`: [`ID`](utils.md#id), `entryId`: [`ID`](utils.md#id), `options?`: `object`) => `Promise`\<`void`\>
649+
> **showEntry**: (`sessionId`: [`ID`](utils.md#id), `entryId`: [`ID`](utils.md#id)) => `Promise`\<`void`\>
615650
616651
Show a specific entry in a replay session.
617652
This will open the session tab if not already open, set it as the selected session, and display the specified entry.
@@ -622,8 +657,6 @@ This will open the session tab if not already open, set it as the selected sessi
622657
| ------ | ------ | ------ |
623658
| `sessionId` | [`ID`](utils.md#id) | The ID of the session containing the entry. |
624659
| `entryId` | [`ID`](utils.md#id) | The ID of the entry to show. |
625-
| `options?` | \{ `overwriteDraft?`: `boolean`; \} | The options for showing the entry. |
626-
| `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. |
627660

628661
###### Returns
629662

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

634667
```ts
635-
await sdk.replay.showEntry(sessionId, entryId, {
636-
overwriteDraft: true,
637-
});
668+
await sdk.replay.showEntry(sessionId, entryId);
638669
```
639670

640671
***
@@ -721,7 +752,7 @@ The ID of the session associated with this tab.
721752

722753
### RequestSource
723754

724-
> **RequestSource** = \{ `connectionInfo`: [`SendRequestOptions`](#sendrequestoptions)\[`"connectionInfo"`\]; `raw`: `string`; `type`: `"Raw"`; \} \| \{ `id`: `string`; `type`: `"ID"`; \}
755+
> **RequestSource** = \{ `connectionInfo`: [`ConnectionInfo`](#connectioninfo); `raw`: `string`; `type`: `"Raw"`; \} \| \{ `id`: `string`; `type`: `"ID"`; \}
725756
726757
#### Remarks
727758

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

767-
##### connectionClose?
768-
769-
> `optional` **connectionClose**: `boolean`
770-
771-
Whether to force close the connection by setting Connection: close header.
772-
Defaults to true.
773-
774-
##### connectionInfo
775-
776-
> **connectionInfo**: `object`
777-
778-
The connection information to use for the request.
779-
780-
###### host
781-
782-
> **host**: `string`
783-
784-
The host to use for the request.
785-
786-
###### isTLS
787-
788-
> **isTLS**: `boolean`
789-
790-
Whether the request is TLS.
791-
792-
###### port
793-
794-
> **port**: `number`
795-
796-
The port to use for the request.
797-
798-
###### SNI?
799-
800-
> `optional` **SNI**: `string`
801-
802-
The SNI to use for the request.
803-
If not provided, the SNI will be inferred from the host.
804-
805-
##### overwriteDraft?
806-
807-
> `optional` **overwriteDraft**: `boolean`
808-
809-
Whether to overwrite the editor's draft content.
810-
If true, draft content will be overwritten with the new request.
811-
If false, the draft will be kept.
812-
Defaults to true.
813-
814-
##### raw
815-
816-
> **raw**: `string`
817-
818-
The raw request to send.
819-
820-
##### updateContentLength?
821-
822-
> `optional` **updateContentLength**: `boolean`
823-
824-
Whether to update the content length automatically to match the body.
825-
Defaults to true.
826-
827798
***
828799

829800
### ReplaySlot

src/reference/sdks/frontend/utils.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,24 @@ Utility type for converting endpoint return types to promises.
181181

182182
***
183183

184+
### QueryInput
185+
186+
> **QueryInput** = [`HTTPQL`](#httpql) \| [`StreamQL`](#streamql)
187+
188+
A query input.
189+
190+
#### Examples
191+
192+
```ts
193+
`"req.method.eq:'POST'"`
194+
```
195+
196+
```ts
197+
`"ws.raw.cont:'hello'"`
198+
```
199+
200+
***
201+
184202
### Selection
185203

186204
> **Selection**\<`TId`\> = \{ `kind`: `"Empty"`; \} \| \{ `kind`: `"Selected"`; `main`: `TId`; `secondary`: `TId`[]; \}
@@ -193,3 +211,23 @@ Main represents the primary selected item, secondary represents additional selec
193211
| Type Parameter |
194212
| ------ |
195213
| `TId` |
214+
215+
***
216+
217+
### StreamQL
218+
219+
> **StreamQL** = `string` & `object`
220+
221+
A STREAMQL expression.
222+
223+
#### Type Declaration
224+
225+
##### \_\_streamql?
226+
227+
> `optional` **\_\_streamql**: `never`
228+
229+
#### Example
230+
231+
```ts
232+
`ws.raw.cont:"hello"`
233+
```

0 commit comments

Comments
 (0)