@workerdeck/client 0.13.0 → 0.15.0

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.
Files changed (2) hide show
  1. package/README.md +16 -0
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -84,6 +84,22 @@ The queue stream has no replay: on (re)connect, re-list jobs and treat the strea
84
84
  - Browsers cannot set WS headers: authenticate the socket with a ticket query param via
85
85
  `buildWsUrl(sessionId, afterSeq)` (and `buildQueueWsUrl`) or with cookies.
86
86
 
87
+ ## Rules you cannot infer from the types
88
+
89
+ - **One client per gateway.** Session ids are unique within a gateway, not across them; two
90
+ clients for one gateway means two of everything that is meant to be shared.
91
+ - **A refused call throws `WorkerDeckError`, and its `status` is the useful part.** 404 means this
92
+ gateway has no such route — stop asking, disable the feature — while 413 means that one file was
93
+ too big. Collapsing them into "request failed" is how a client ends up polling a route that will
94
+ never exist.
95
+ - **Browsers cannot header a WebSocket upgrade.** Same-origin gateways authenticate the socket
96
+ with the login cookie; a gateway on another origin needs the key in the query string
97
+ (`hostAuth()` builds both forms), and its REST calls additionally need the gateway to run with
98
+ `--cors-origin`.
99
+ - **`apiUrl`/`isLoopbackHost` decide from the URL, never by probing.** What the operator typed
100
+ becomes a `baseUrl` by one rule, in one place — because the same gateway normalised two ways is
101
+ two gateways, with two sets of unread marks.
102
+
87
103
  ## License
88
104
 
89
105
  MIT © Tobias Strebitzer — see
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workerdeck/client",
3
- "version": "0.13.0",
3
+ "version": "0.15.0",
4
4
  "type": "module",
5
5
  "description": "Typed WorkerDeck protocol client for browsers and Node: REST session management plus a WebSocket attach with auto-reconnect and replay-from-last-seq. Uses the platform's fetch and WebSocket; zero runtime deps.",
6
6
  "license": "MIT",
@@ -17,7 +17,7 @@
17
17
  }
18
18
  },
19
19
  "dependencies": {
20
- "@workerdeck/protocol": "0.13.0"
20
+ "@workerdeck/protocol": "0.15.0"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@types/node": "^22.10.0",
@@ -26,8 +26,8 @@
26
26
  "tsdown": "^0.21.10",
27
27
  "vitest": "^3.2.7",
28
28
  "ws": "^8.21.1",
29
- "@workerdeck/core": "0.13.0",
30
- "@workerdeck/server": "0.13.0"
29
+ "@workerdeck/core": "0.15.0",
30
+ "@workerdeck/server": "0.15.0"
31
31
  },
32
32
  "author": "Tobias Strebitzer",
33
33
  "repository": {