@onlyworlds/sdk 4.89.1 → 4.90.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/CHANGELOG.md +6 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.js +9 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ earlier history lives in git log only.
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [4.90.0] - 2026-10-27
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **`mintWorldKey(worldId, { keep: true })`**: the key is kept across a sign-out, so revoking the token that minted it leaves it live, for a tool that stores a key on the device; disconnecting the tool, or a replayed sign-in code, still takes it. `OwMintedKey.kept` says so. Without `keep`, revoking a token revokes the keys it minted unless the tool holds another live token of its own; a token made by hand, or one of a tool that asks each time, never takes its keys. A `keep` that is not true or false is a TypeError before anything is sent.
|
|
13
|
+
|
|
8
14
|
## [4.89.1] - 2026-10-27
|
|
9
15
|
|
|
10
16
|
### Fixed
|
package/dist/index.d.ts
CHANGED
|
@@ -2973,6 +2973,8 @@ interface OwMintedKey {
|
|
|
2973
2973
|
revoked: boolean;
|
|
2974
2974
|
key: string;
|
|
2975
2975
|
member?: Record<string, unknown>;
|
|
2976
|
+
/** True when minted with `keep: true`: no revoke of the token that minted it takes it (a sign-out keeps it). */
|
|
2977
|
+
kept?: boolean;
|
|
2976
2978
|
}
|
|
2977
2979
|
interface OwSeat {
|
|
2978
2980
|
/** The seat's membership id: removeSeat takes it, and GET /members names the seat by it. */
|
|
@@ -4380,11 +4382,15 @@ declare class OwV2Client {
|
|
|
4380
4382
|
* `'read'`, `name` as the key list shows it (at most 255 characters). The full key comes back
|
|
4381
4383
|
* once in `key`. The owner mints a world key; a member mints their own member key, 409
|
|
4382
4384
|
* `pin_required` (`err.isPinRequired`) for a write key while the account has no PIN. Account
|
|
4383
|
-
* token only; no Idempotency-Key.
|
|
4385
|
+
* token only; no Idempotency-Key. `keep: true` keeps the key across a sign-out: revoking the token
|
|
4386
|
+
* that minted it leaves it live (a tool that stores a key on the device passes it), while
|
|
4387
|
+
* disconnecting the tool, or a replayed sign-in code, still takes it; the answer says `kept`.
|
|
4388
|
+
* Without it, revoking the token revokes the keys it minted unless the tool holds another live token.
|
|
4384
4389
|
*/
|
|
4385
4390
|
mintWorldKey(worldId: string, opts?: {
|
|
4386
4391
|
scope?: 'read' | 'write';
|
|
4387
4392
|
name?: string;
|
|
4393
|
+
keep?: boolean;
|
|
4388
4394
|
}): Promise<OwMintedKey>;
|
|
4389
4395
|
/**
|
|
4390
4396
|
* DELETE /account/worlds/{worldId}/keys/{keyId} -- revoke a world key, by the `id` mintWorldKey
|
package/dist/index.js
CHANGED
|
@@ -1748,16 +1748,23 @@ var OwV2Client = class {
|
|
|
1748
1748
|
* `'read'`, `name` as the key list shows it (at most 255 characters). The full key comes back
|
|
1749
1749
|
* once in `key`. The owner mints a world key; a member mints their own member key, 409
|
|
1750
1750
|
* `pin_required` (`err.isPinRequired`) for a write key while the account has no PIN. Account
|
|
1751
|
-
* token only; no Idempotency-Key.
|
|
1751
|
+
* token only; no Idempotency-Key. `keep: true` keeps the key across a sign-out: revoking the token
|
|
1752
|
+
* that minted it leaves it live (a tool that stores a key on the device passes it), while
|
|
1753
|
+
* disconnecting the tool, or a replayed sign-in code, still takes it; the answer says `kept`.
|
|
1754
|
+
* Without it, revoking the token revokes the keys it minted unless the tool holds another live token.
|
|
1752
1755
|
*/
|
|
1753
1756
|
async mintWorldKey(worldId, opts = {}) {
|
|
1754
|
-
only("mintWorldKey", opts, ["scope", "name"]);
|
|
1757
|
+
only("mintWorldKey", opts, ["scope", "name", "keep"]);
|
|
1758
|
+
if (opts.keep !== void 0 && typeof opts.keep !== "boolean") {
|
|
1759
|
+
throw new TypeError(`mintWorldKey: keep is true or false, got ${JSON.stringify(opts.keep)}. Nothing was sent.`);
|
|
1760
|
+
}
|
|
1755
1761
|
if (this.keyKind !== "account") {
|
|
1756
1762
|
throw new TypeError("mintWorldKey needs an account token (ow_a_)");
|
|
1757
1763
|
}
|
|
1758
1764
|
const body = {};
|
|
1759
1765
|
if (opts.scope !== void 0) body.scope = opts.scope;
|
|
1760
1766
|
if (opts.name !== void 0) body.name = opts.name;
|
|
1767
|
+
if (opts.keep !== void 0) body.keep = opts.keep;
|
|
1761
1768
|
return this.request("POST", `/account/worlds/${encodeURIComponent(worldId)}/keys`, { write: true, body });
|
|
1762
1769
|
}
|
|
1763
1770
|
/**
|