@vornrun/connector-sdk 0.7.1-beta.3 → 0.7.1-beta.5
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/README.md +2 -0
- package/dist/{chunk-727CYX57.js → chunk-F3JWXPNU.js} +5 -3
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -229,6 +229,8 @@ Add `headers` to `check` for a site whose reads need one, such as a CSRF flag. H
|
|
|
229
229
|
|
|
230
230
|
Vorn opens a window on a browser profile that belongs to one connection, and the person signs in there. The connector's code then gets `ctx.session.fetch` beside `ctx.fetch`. A call through `ctx.session.fetch` runs inside that signed-in window as a same-origin request, so the service sees its own page asking and no cookie reaches the connector. Calls outside `origins` are refused. `ctx.fetch` stays a plain fetch for public reads, such as a feed, which work before anyone signs in. A `browser` connector's declared `request` actions go through the window.
|
|
231
231
|
|
|
232
|
+
Answers come back as bytes, so `await res.arrayBuffer()` reads an image or any file the signed-in page can open, up to 16 MiB; a bigger answer is refused rather than cut short. This needs Vorn 0.7.1-beta.4 or later.
|
|
233
|
+
|
|
232
234
|
`--mock` serves signed-in calls from the same routes as every other call. A `--live` run from a terminal has no window, so it skips them.
|
|
233
235
|
|
|
234
236
|
## Dedupe strategies
|
|
@@ -80,7 +80,8 @@ function createSessionFetch(options = {}) {
|
|
|
80
80
|
url: request.url,
|
|
81
81
|
method: request.method,
|
|
82
82
|
headers: Object.fromEntries(request.headers),
|
|
83
|
-
...body !== void 0 && { body }
|
|
83
|
+
...body !== void 0 && { body },
|
|
84
|
+
binaryBody: true
|
|
84
85
|
}),
|
|
85
86
|
signal: AbortSignal.any([request.signal, AbortSignal.timeout(SESSION_TIMEOUT_MS)])
|
|
86
87
|
});
|
|
@@ -96,7 +97,8 @@ function createSessionFetch(options = {}) {
|
|
|
96
97
|
);
|
|
97
98
|
}
|
|
98
99
|
const reply2 = readReply(text2);
|
|
99
|
-
|
|
100
|
+
const content = reply2.bodyBase64 !== void 0 ? Buffer.from(reply2.bodyBase64, "base64") : reply2.body ?? "";
|
|
101
|
+
return new Response(NULL_BODY_STATUSES.has(reply2.status) ? null : content, {
|
|
100
102
|
status: reply2.status,
|
|
101
103
|
...reply2.headers && { headers: reply2.headers }
|
|
102
104
|
});
|
|
@@ -3355,7 +3357,7 @@ function scaffoldFiles(options) {
|
|
|
3355
3357
|
}
|
|
3356
3358
|
|
|
3357
3359
|
// src/server.ts
|
|
3358
|
-
var SDK_VERSION = true ? "0.7.1-beta.
|
|
3360
|
+
var SDK_VERSION = true ? "0.7.1-beta.5" : "0.0.0-source";
|
|
3359
3361
|
var InvalidParams = class extends Error {
|
|
3360
3362
|
};
|
|
3361
3363
|
function text(params, key) {
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED