@onlyworlds/sdk 4.76.2 → 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 +12 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +25 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,18 @@ 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
|
+
|
|
14
|
+
## [4.77.0] - 2026-10-26
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- **`isCharacterPlayed`** on `OwApiError`: a delete (or a review's decline) of a Character someone plays on the roster, the world's `owner_character` or a live member's, an AI seat's or a player's, answers 422 `character_played` (`param` id) and deletes nothing. The predicate tells it from a malformed id's 422, which carries the same `param`. The way out is to re-point that member to another Character, or remove the member, then delete.
|
|
19
|
+
|
|
8
20
|
## [4.76.2] - 2026-10-25
|
|
9
21
|
|
|
10
22
|
### Changed
|
package/dist/index.d.ts
CHANGED
|
@@ -3336,6 +3336,16 @@ declare class OwApiError extends Error {
|
|
|
3336
3336
|
* `character_taken` (see isCharacterTaken).
|
|
3337
3337
|
*/
|
|
3338
3338
|
get isCharacterInvalid(): boolean;
|
|
3339
|
+
/**
|
|
3340
|
+
* delete, or reviewNewElement's decline: the Character is one someone plays on the roster, the
|
|
3341
|
+
* world's `owner_character` or a live member's, an AI seat's or a player's Character (422
|
|
3342
|
+
* `character_played`, `param` id). Nothing was deleted; the message says who plays it, never by
|
|
3343
|
+
* email or username. Re-point that member to another Character (the owner's own through
|
|
3344
|
+
* patchWorld's `owner_character`, a seat's by the owner on the member PATCH, a person's own
|
|
3345
|
+
* through setMyCharacter), or remove the member, then delete. Never true for a malformed id's
|
|
3346
|
+
* 422, which carries the same `param`.
|
|
3347
|
+
*/
|
|
3348
|
+
get isCharacterPlayed(): boolean;
|
|
3339
3349
|
/**
|
|
3340
3350
|
* redeemJoin: the world already has its 50 live players (422 `world_full`),
|
|
3341
3351
|
* at any player link, a table's or a link for one's. Nothing is spent; a place frees when the
|
|
@@ -4286,6 +4296,14 @@ declare class OwV2Client {
|
|
|
4286
4296
|
scope?: 'read' | 'write';
|
|
4287
4297
|
name?: string;
|
|
4288
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>;
|
|
4289
4307
|
/**
|
|
4290
4308
|
* Start Sign in with OnlyWorlds from a tool's page: mint `state` and a PKCE verifier, keep them
|
|
4291
4309
|
* under `clientId` in `storage` (sessionStorage by default; in Node pass one), and send the
|
package/dist/index.js
CHANGED
|
@@ -223,6 +223,18 @@ var OwApiError = class extends Error {
|
|
|
223
223
|
get isCharacterInvalid() {
|
|
224
224
|
return this.status === 422 && this.code === "invalid_request" && this.param === "character";
|
|
225
225
|
}
|
|
226
|
+
/**
|
|
227
|
+
* delete, or reviewNewElement's decline: the Character is one someone plays on the roster, the
|
|
228
|
+
* world's `owner_character` or a live member's, an AI seat's or a player's Character (422
|
|
229
|
+
* `character_played`, `param` id). Nothing was deleted; the message says who plays it, never by
|
|
230
|
+
* email or username. Re-point that member to another Character (the owner's own through
|
|
231
|
+
* patchWorld's `owner_character`, a seat's by the owner on the member PATCH, a person's own
|
|
232
|
+
* through setMyCharacter), or remove the member, then delete. Never true for a malformed id's
|
|
233
|
+
* 422, which carries the same `param`.
|
|
234
|
+
*/
|
|
235
|
+
get isCharacterPlayed() {
|
|
236
|
+
return this.status === 422 && this.code === "character_played";
|
|
237
|
+
}
|
|
226
238
|
/**
|
|
227
239
|
* redeemJoin: the world already has its 50 live players (422 `world_full`),
|
|
228
240
|
* at any player link, a table's or a link for one's. Nothing is spent; a place frees when the
|
|
@@ -1715,6 +1727,19 @@ var OwV2Client = class {
|
|
|
1715
1727
|
if (opts.name !== void 0) body.name = opts.name;
|
|
1716
1728
|
return this.request("POST", `/account/worlds/${encodeURIComponent(worldId)}/keys`, { write: true, body });
|
|
1717
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
|
+
}
|
|
1718
1743
|
// -- Sign in with OnlyWorlds (OAuth 2.1 code + PKCE, keel PR 154) ---------
|
|
1719
1744
|
/**
|
|
1720
1745
|
* Start Sign in with OnlyWorlds from a tool's page: mint `state` and a PKCE verifier, keep them
|