@onlyworlds/sdk 4.89.0 → 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 +12 -0
- package/dist/index.d.ts +7 -12
- package/dist/index.js +11 -3
- 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.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
|
+
|
|
14
|
+
## [4.89.1] - 2026-10-27
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- **`noteOf` reads the hidden mark as every other reader in the package does**: any `hidden` but absent, null or false leaves a Note out (it read only `true`), so a doubt is left out, as the review and world-file readers already decide. The shared edge case moves with it, in both packages.
|
|
19
|
+
|
|
8
20
|
## [4.89.0] - 2026-10-27
|
|
9
21
|
|
|
10
22
|
### Added
|
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
|
|
@@ -4791,17 +4797,6 @@ declare function unreadFor<T extends object>(messages: readonly T[], characterId
|
|
|
4791
4797
|
* `parent_narrative` like any other (a reply to a Note that answers the root is in the thread).
|
|
4792
4798
|
*/
|
|
4793
4799
|
declare function threadOf<T extends object>(messages: readonly T[], rootId: string): T[];
|
|
4794
|
-
/**
|
|
4795
|
-
* The Character's line: the id of the Character's newest own-hand Note among the given
|
|
4796
|
-
* Narratives, or null when it has none (always null for an empty id). A Note (`isNote`) counts
|
|
4797
|
-
* when its `narrator` is the Character, it is in its author's hand (no `created_by` key, a folder:
|
|
4798
|
-
* the narrator is trusted; with `created_by`, the wire: `senderStatus` against `members` is
|
|
4799
|
-
* `verified`, so a mismatch or an unverifiable Note is nobody's), it is not hidden
|
|
4800
|
-
* (`hidden: true`) and not proposed (`x_review_proposed` an object, the review profile), and its
|
|
4801
|
-
* id is a string. Of those, the newest by `created_at` (the last in `created_at` order among those
|
|
4802
|
-
* whose time can be read; equal times: the later in the list), or the last in the list when none
|
|
4803
|
-
* can be read. A Note is never a message: it is never unread and in no thread.
|
|
4804
|
-
*/
|
|
4805
4800
|
declare function noteOf(narratives: readonly object[], characterId: string, members: Members): string | null;
|
|
4806
4801
|
|
|
4807
4802
|
/**
|
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
|
/**
|
|
@@ -3925,6 +3932,7 @@ function threadOf(messages, rootId) {
|
|
|
3925
3932
|
};
|
|
3926
3933
|
return inCreatedOrder(messages.filter((m) => isBody(m) && !isNote(m) && reaches(m)));
|
|
3927
3934
|
}
|
|
3935
|
+
var isHiddenMark = (value) => value !== void 0 && value !== null && value !== false;
|
|
3928
3936
|
function noteOf(narratives, characterId, members) {
|
|
3929
3937
|
if (!Array.isArray(narratives) || typeof characterId !== "string" || characterId === "") return null;
|
|
3930
3938
|
let line = null;
|
|
@@ -3934,7 +3942,7 @@ function noteOf(narratives, characterId, members) {
|
|
|
3934
3942
|
const note = el;
|
|
3935
3943
|
const id = idOf(note);
|
|
3936
3944
|
if (typeof id !== "string" || id === "" || note.narrator !== characterId) continue;
|
|
3937
|
-
if (note.hidden
|
|
3945
|
+
if (isHiddenMark(note.hidden) || proposedMarkOf(note) !== null || !isOwnHand(note, characterId, members)) continue;
|
|
3938
3946
|
const key = timeKey(note.created_at);
|
|
3939
3947
|
if (line === null || (key !== null ? lineKey === null || compareKeys(key, lineKey) >= 0 : lineKey === null)) {
|
|
3940
3948
|
line = id;
|