Skip to content

Commit f3ac873

Browse files
authored
Update SDK Documentation (#40)
1 parent 6a48c9d commit f3ac873

3 files changed

Lines changed: 1103 additions & 68 deletions

File tree

src/reference/sdks/backend/index.md

Lines changed: 80 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ The SDK for the Replay service.
7474
7575
The SDK for the Requests service.
7676

77+
##### runtime
78+
79+
> **runtime**: [`RuntimeSDK`](index.md#runtimesdk)
80+
81+
The SDK for the runtime information.
82+
7783
## Meta
7884

7985
### MetaSDK
@@ -84,6 +90,16 @@ The SDK for metadata information about the plugin.
8490

8591
#### Type declaration
8692

93+
##### assetsPath()
94+
95+
The directory of the plugin's assets in Caido Data.
96+
You can read static data from your plugin in this directory.
97+
You shouldn't write anything there, as the contents can be reset at any time.
98+
99+
###### Returns
100+
101+
`string`
102+
87103
##### db()
88104

89105
Get a sqlite database for the plugin stored in Caido Data.
@@ -305,13 +321,13 @@ Calling `to<FORMAT>` will try to convert the body to the desired format.
305321

306322
##### toJson()
307323

308-
> **toJson**(): `any`
324+
> **toJson**(): `unknown`
309325
310326
Try to parse the body as JSON.
311327

312328
###### Returns
313329

314-
`any`
330+
`unknown`
315331

316332
###### Throws
317333

@@ -785,6 +801,8 @@ Set if the request uses TLS (HTTPS).
785801

786802
##### parse()
787803

804+
###### Call Signature
805+
788806
> `static` **parse**(`bytes`: [`Bytes`](index.md#bytes)): [`RequestSpec`](index.md#requestspec)
789807
790808
Parses raw bytes into a [RequestSpec](index.md#requestspec).
@@ -813,6 +831,26 @@ const specRaw = spec.getRaw();
813831
const rawOutput = specRaw.getRaw(); // Will contain the new header
814832
```
815833

834+
###### Call Signature
835+
836+
> `static` **parse**(`raw`: [`RequestSpecRaw`](index.md#requestspecraw)): [`RequestSpec`](index.md#requestspec)
837+
838+
Parses the raw bytes of a [RequestSpecRaw](index.md#requestspecraw) into a [RequestSpec](index.md#requestspec).
839+
840+
###### Parameters
841+
842+
| Parameter | Type |
843+
| ------ | ------ |
844+
| `raw` | [`RequestSpecRaw`](index.md#requestspecraw) |
845+
846+
###### Returns
847+
848+
[`RequestSpec`](index.md#requestspec)
849+
850+
###### Throws
851+
852+
If the bytes are not a valid HTTP request.
853+
816854
***
817855

818856
### RequestSpecRaw
@@ -879,6 +917,24 @@ Get the raw bytes of the request.
879917

880918
`Uint8Array`
881919

920+
##### getSpec()
921+
922+
> **getSpec**(): [`RequestSpec`](index.md#requestspec)
923+
924+
This methods converts the [RequestSpecRaw](index.md#requestspecraw) to a [RequestSpec](index.md#requestspec).
925+
926+
###### Returns
927+
928+
[`RequestSpec`](index.md#requestspec)
929+
930+
###### Throws
931+
932+
If the bytes are not a valid HTTP request.
933+
934+
###### See
935+
936+
[RequestSpec.parse](index.md#parse)
937+
882938
##### getTls()
883939

884940
> **getTls**(): `boolean`
@@ -2621,3 +2677,25 @@ Information on the current page of paginated data.
26212677
##### lastInsertRowid
26222678

26232679
> **lastInsertRowid**: `number`
2680+
2681+
## Runtime
2682+
2683+
### RuntimeSDK
2684+
2685+
> **RuntimeSDK**: `object`
2686+
2687+
The SDK for the runtime information.
2688+
2689+
#### Type declaration
2690+
2691+
##### version
2692+
2693+
###### Get Signature
2694+
2695+
> **get** **version**(): `string`
2696+
2697+
Get the current version of Caido.
2698+
2699+
###### Returns
2700+
2701+
`string`

0 commit comments

Comments
 (0)