@onlyworlds/sdk 4.77.0 → 4.78.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 CHANGED
@@ -5,6 +5,12 @@ earlier history lives in git log only.
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [4.78.0] - 2026-10-26
9
+
10
+ ### Added
11
+
12
+ - **`revokeWorldKey(worldId, keyId)`**: revoke a world key by the `id` `mintWorldKey` returned (`DELETE /account/worlds/{id}/keys/{key_id}`, account token only). The key then answers 401 `key_revoked`. The owner revokes any of the world's keys, a member only their own; any other id is a 404. Revoking a revoked key answers the same 204, so a tool that mints a key when a person signs in can revoke it when they sign out without tracking whether it already did.
13
+
8
14
  ## [4.77.0] - 2026-10-26
9
15
 
10
16
  ### Added
package/dist/index.d.ts CHANGED
@@ -4296,6 +4296,14 @@ declare class OwV2Client {
4296
4296
  scope?: 'read' | 'write';
4297
4297
  name?: string;
4298
4298
  }): Promise<OwMintedKey>;
4299
+ /**
4300
+ * DELETE /account/worlds/{worldId}/keys/{keyId} -- revoke a world key, by the `id` mintWorldKey
4301
+ * returned: from then on it answers 401 `key_revoked`. The owner revokes any of the world's keys,
4302
+ * a member only their own; any other id is a 404 (`err.isNotFound`). Revoking a revoked key
4303
+ * changes nothing and answers the same 204, so a tool that signs out can revoke its key without
4304
+ * knowing whether it already did. Account token only.
4305
+ */
4306
+ revokeWorldKey(worldId: string, keyId: string): Promise<void>;
4299
4307
  /**
4300
4308
  * Start Sign in with OnlyWorlds from a tool's page: mint `state` and a PKCE verifier, keep them
4301
4309
  * under `clientId` in `storage` (sessionStorage by default; in Node pass one), and send the
package/dist/index.js CHANGED
@@ -1727,6 +1727,19 @@ var OwV2Client = class {
1727
1727
  if (opts.name !== void 0) body.name = opts.name;
1728
1728
  return this.request("POST", `/account/worlds/${encodeURIComponent(worldId)}/keys`, { write: true, body });
1729
1729
  }
1730
+ /**
1731
+ * DELETE /account/worlds/{worldId}/keys/{keyId} -- revoke a world key, by the `id` mintWorldKey
1732
+ * returned: from then on it answers 401 `key_revoked`. The owner revokes any of the world's keys,
1733
+ * a member only their own; any other id is a 404 (`err.isNotFound`). Revoking a revoked key
1734
+ * changes nothing and answers the same 204, so a tool that signs out can revoke its key without
1735
+ * knowing whether it already did. Account token only.
1736
+ */
1737
+ async revokeWorldKey(worldId, keyId) {
1738
+ if (this.keyKind !== "account") {
1739
+ throw new TypeError("revokeWorldKey needs an account token (ow_a_)");
1740
+ }
1741
+ await this.request("DELETE", `/account/worlds/${encodeURIComponent(worldId)}/keys/${encodeURIComponent(keyId)}`);
1742
+ }
1730
1743
  // -- Sign in with OnlyWorlds (OAuth 2.1 code + PKCE, keel PR 154) ---------
1731
1744
  /**
1732
1745
  * Start Sign in with OnlyWorlds from a tool's page: mint `state` and a PKCE verifier, keep them
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlyworlds/sdk",
3
- "version": "4.77.0",
3
+ "version": "4.78.0",
4
4
  "description": "TypeScript SDK for the OnlyWorlds API - build world-building applications with type safety",
5
5
  "type": "module",
6
6
  "exports": {