@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 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
- return new Response(NULL_BODY_STATUSES.has(reply2.status) ? null : reply2.body ?? "", {
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.3" : "0.0.0-source";
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
@@ -10,7 +10,7 @@ import {
10
10
  runPoll,
11
11
  scaffoldFiles,
12
12
  serveConnector
13
- } from "./chunk-727CYX57.js";
13
+ } from "./chunk-F3JWXPNU.js";
14
14
 
15
15
  // src/cli.ts
16
16
  import { fileURLToPath, pathToFileURL } from "url";
package/dist/index.js CHANGED
@@ -67,7 +67,7 @@ import {
67
67
  valueAt,
68
68
  withMockHttp,
69
69
  withinOrigins
70
- } from "./chunk-727CYX57.js";
70
+ } from "./chunk-F3JWXPNU.js";
71
71
  export {
72
72
  ActionArgumentError,
73
73
  BROWSER_HOST_ENV,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vornrun/connector-sdk",
3
- "version": "0.7.1-beta.3",
3
+ "version": "0.7.1-beta.5",
4
4
  "description": "Build and share Vorn pull connectors as ordinary npm packages",
5
5
  "type": "module",
6
6
  "license": "MIT",