@onlyworlds/sdk 4.58.0 → 4.59.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.
- package/AGENTS.md +2 -1
- package/CHANGELOG.md +7 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.js +3 -1
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -148,4 +148,5 @@ against live data). The v1 surface (`OnlyWorldsClient`, the `ElementType` enum)
|
|
|
148
148
|
|
|
149
149
|
**Auth**: prefixed keys — `ow_w_` (read+write), `ow_r_` (read-only, no PIN — the share
|
|
150
150
|
primitive), `ow_a_` (account Bearer). Demo keys `0000000000`–`0000000009` are read-only
|
|
151
|
-
test credentials against real data.
|
|
151
|
+
test credentials against real data. A configured `apiPin` is sent only where keel checks it:
|
|
152
|
+
on writes, on `me()`, and on every request of a 10-digit legacy key; other reads go without it.
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,13 @@ earlier history lives in git log only.
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [4.59.0] - 2026-10-22
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **`API-Pin` is sent only where keel checks it** (Skeld's ruling, OW Keel h29 #10663). keel verifies a PIN wherever one is sent (argon2, 64 MiB each), and on 2026-10-22 scripts reading with the PIN OOM-killed staging on a cold cache after a restart. The client used to send a configured `apiPin` on every request. It now sends it on every request whose method is not GET (every write: elements, links, bulk, adopt, hide and unhide, media and file tickets, seats, world links, proposals, `setMyCharacter`, `mintWorldKey`, `patchWorld`, and any route added later), on `GET /me` (`me()`, the connection test: keel checks a PIN there when sent, keel #314, D93), and on every request of a 10-digit legacy key (v1 parity, keel #421: such a key needs the PIN on reads of a world with a PIN). Any other read from an `ow_w_`, `ow_r_` or member key goes without it; an account token never sent it and still does not. The rule is derived in `request()` from the method and path, so a raw `request()` call follows it too. No API changed.
|
|
13
|
+
- Tests: `test/api-pin.test.mjs`, five, on a recorded fetch: eight reads, `me()` and ten writes across POST, PATCH, PUT and DELETE, for an `ow_w_` key with a PIN, a legacy key with a PIN, an `ow_r_` key with none and an account token with one configured; and raw `request()` GETs to other paths, `/me` and other methods. Two existing tests that expected the PIN on a GET now expect none. Mutants: the PIN on every request again fails four tests; without the `/me` clause, three; without the legacy clause, one.
|
|
14
|
+
|
|
8
15
|
## [4.58.0] - 2026-10-22
|
|
9
16
|
|
|
10
17
|
### Added
|
package/dist/index.d.ts
CHANGED
|
@@ -2924,8 +2924,11 @@ interface OwClientConfig {
|
|
|
2924
2924
|
*/
|
|
2925
2925
|
apiKey?: string;
|
|
2926
2926
|
/**
|
|
2927
|
-
* The PIN, needed for writes when the world has one, and for
|
|
2928
|
-
*
|
|
2927
|
+
* The PIN (or an agent seat's `ow_s_` secret), needed for writes when the world has one, and for
|
|
2928
|
+
* legacy-key reads of a world with a PIN. Sent as `API-Pin` only where keel checks it: on every
|
|
2929
|
+
* write (any method but GET), on GET /me (me(), the connection test), and on every request of a
|
|
2930
|
+
* 10-digit legacy key. A prefixed key's other reads go without it, and an account token never
|
|
2931
|
+
* sends it. A string, not a number: '0123' !== 123.
|
|
2929
2932
|
*/
|
|
2930
2933
|
apiPin?: string;
|
|
2931
2934
|
/** The API's base URL, default https://www.onlyworlds.com/api/v2. */
|
package/dist/index.js
CHANGED
|
@@ -1725,7 +1725,9 @@ var OwV2Client = class {
|
|
|
1725
1725
|
headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
1726
1726
|
} else {
|
|
1727
1727
|
headers["API-Key"] = this.apiKey;
|
|
1728
|
-
|
|
1728
|
+
const read = method.toUpperCase() === "GET";
|
|
1729
|
+
const me = path === "/me/" || path === "/me";
|
|
1730
|
+
if (this.apiPin && (!read || me || this.keyKind === "legacy")) headers["API-Pin"] = this.apiPin;
|
|
1729
1731
|
}
|
|
1730
1732
|
}
|
|
1731
1733
|
if (opts.body !== void 0) headers["Content-Type"] = "application/json";
|