@outl/plugin-sdk 0.12.0-beta.216 → 0.13.0-beta.318
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/index.ts +15 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@outl/plugin-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0-beta.318",
|
|
4
4
|
"description": "TypeScript SDK for authoring outl plugins. Types-only contract — the host implementation is injected by the outl runtime (Boa/Rust) at load time.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://outl.app/docs/query#plugin-sdk-api-outlquery",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
],
|
|
30
30
|
"repository": {
|
|
31
31
|
"type": "git",
|
|
32
|
-
"url": "https://github.com/outlmd/outl",
|
|
32
|
+
"url": "git+https://github.com/outlmd/outl.git",
|
|
33
33
|
"directory": "plugin-sdk"
|
|
34
34
|
}
|
|
35
35
|
}
|
package/src/index.ts
CHANGED
|
@@ -146,6 +146,20 @@ export interface FetchOptions {
|
|
|
146
146
|
body?: string;
|
|
147
147
|
/** Hard timeout in milliseconds. Required: no unbounded fetches. */
|
|
148
148
|
timeoutMs: number;
|
|
149
|
+
/**
|
|
150
|
+
* How the **response** body is handed back. Defaults to `"text"`.
|
|
151
|
+
*
|
|
152
|
+
* A body crosses into JS inside a JSON string, so bytes that are not valid
|
|
153
|
+
* UTF-8 cannot survive as text — a text read replaces each one with U+FFFD,
|
|
154
|
+
* irreversibly. `"base64"` is therefore the only way to read a binary
|
|
155
|
+
* response (a cipher text, an image, a compressed stream): `text()` then
|
|
156
|
+
* returns the base64, which you decode yourself.
|
|
157
|
+
*
|
|
158
|
+
* The response-size cap is measured on the raw bytes, before encoding, so
|
|
159
|
+
* this cannot be used to pull a bigger body through. The string that holds
|
|
160
|
+
* it is a third longer, which is the cost of reading bytes at all.
|
|
161
|
+
*/
|
|
162
|
+
encoding?: "text" | "base64";
|
|
149
163
|
}
|
|
150
164
|
|
|
151
165
|
/** A minimal response shape returned by `ctx.net.fetch`. */
|
|
@@ -153,7 +167,7 @@ export interface FetchResponse {
|
|
|
153
167
|
status: number;
|
|
154
168
|
ok: boolean;
|
|
155
169
|
headers: Record<string, string>;
|
|
156
|
-
/** Resolve the body as text
|
|
170
|
+
/** Resolve the body as text — the base64 string when `encoding: "base64"`. */
|
|
157
171
|
text(): Promise<string>;
|
|
158
172
|
/** Resolve and parse the body as JSON. */
|
|
159
173
|
json<T = unknown>(): Promise<T>;
|