@onlyworlds/sdk 4.104.0 → 4.104.2
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 +13 -0
- package/dist/index.d.ts +14 -6
- package/dist/index.js +11 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,19 @@ earlier history lives in git log only.
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [4.104.2] - 2026-10-29
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **`completeSignIn` keeps a sign-in pending when a return carries another state.** It cleared the pending record before checking the state, so any page that opened a native app's custom scheme (`obsidian://onlyworlds-signin?state=anything`) could cancel a sign-in in flight. Now a return whose state does not match leaves the record as it is, and the real return still signs in. Once a return carries the sign-in's own state, the record is cleared whatever follows: a refusal, a cancel on the consent page, or the wrong page.
|
|
13
|
+
- **`OwMember.sponsor_member`**, which the server now serves on agent rows of `members()`: who answers for the AI, as a membership id on the same list, `owner`, or null (a seat made from a link for an email address, or a sponsor with no live membership). Person and player rows carry none.
|
|
14
|
+
|
|
15
|
+
## [4.104.1] - 2026-10-29
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- `worldProposals` and `listProposals` say who reads the review queue as the server now answers: the owner's read key (or the write key, with no PIN) reads every row, and a demo key and the keyless public view get a 404. No code changed.
|
|
20
|
+
|
|
8
21
|
## [4.104.0] - 2026-10-29
|
|
9
22
|
|
|
10
23
|
### Added
|
package/dist/index.d.ts
CHANGED
|
@@ -2723,6 +2723,13 @@ interface OwMember {
|
|
|
2723
2723
|
lenses: string[];
|
|
2724
2724
|
/** Where `lenses` comes from: `chosen` (the row's own list, empty for none) or `titles` (it chose none, and its Character's Titles bring these). */
|
|
2725
2725
|
lenses_from: 'chosen' | 'titles';
|
|
2726
|
+
/**
|
|
2727
|
+
* Agent rows only: who answers for this AI, as the roster names them: the sponsor's membership id
|
|
2728
|
+
* (the `id` of their row here), `owner` when the world's owner answers for it, or null for a seat
|
|
2729
|
+
* made from a link for an email address and for a sponsor with no live membership here. Every
|
|
2730
|
+
* reader reads it; person and player rows carry no `sponsor_member`.
|
|
2731
|
+
*/
|
|
2732
|
+
sponsor_member?: string | null;
|
|
2726
2733
|
/**
|
|
2727
2734
|
* Served only, never written: present only when `lenses` was served with a lens left out, one this
|
|
2728
2735
|
* key cannot see; then it names `lenses`. Saving the list you were shown keeps that lens where it stands.
|
|
@@ -3853,8 +3860,8 @@ declare function pinExpectation(kind: OwKeyKind): 'never' | 'optional' | 'requir
|
|
|
3853
3860
|
* callback page: it checks `state` and that the page is the registered return address, takes the
|
|
3854
3861
|
* code out of the address bar, trades it at `POST /api/v2/auth/token` with no credential, and
|
|
3855
3862
|
* returns the token with the account and the `resume` the tool parked before the redirect. The
|
|
3856
|
-
* SDK keeps nothing: the record is cleared
|
|
3857
|
-
* to store.
|
|
3863
|
+
* SDK keeps nothing: the record is cleared once a return carries its state (success or refusal; a
|
|
3864
|
+
* return with another state leaves it pending), and the token is the tool's to store.
|
|
3858
3865
|
*/
|
|
3859
3866
|
/** Where the pending sign-in's record lives between the two pages: string in, string out. */
|
|
3860
3867
|
interface OwSignInStorage {
|
|
@@ -4604,7 +4611,7 @@ declare class OwV2Client {
|
|
|
4604
4611
|
* owner's and a co-builder's keys, a member's own for any other. `state` is `open` by keel's
|
|
4605
4612
|
* default (not past `expires`), or `lapsed`, `accepted`, `declined`, `all`; `since` keeps rows
|
|
4606
4613
|
* whose `updated_at` is at or after it; `limit` defaults to the client's pageSize. Any member
|
|
4607
|
-
* key that reads the element, a read key included.
|
|
4614
|
+
* key that reads the element, a read key included; the owner's read key reads every row.
|
|
4608
4615
|
*/
|
|
4609
4616
|
listProposals(type: ElementType | string, id: string, opts?: OwProposalQuery): Promise<OwProposalList>;
|
|
4610
4617
|
/**
|
|
@@ -4615,8 +4622,8 @@ declare class OwV2Client {
|
|
|
4615
4622
|
* `open`, `lapsed` and `all`, never `accepted` or `declined`; keel reads at most the 500 newest.
|
|
4616
4623
|
* Every row for the owner's and a co-builder's keys, a member's own for any other. The query is
|
|
4617
4624
|
* listProposals', plus `element` (one element's rows, by id). The cursor is opaque: pass
|
|
4618
|
-
* `next_cursor` back as it came. Any member key, a read key included;
|
|
4619
|
-
*
|
|
4625
|
+
* `next_cursor` back as it came. Any member key, a read key included; the owner's read key (or
|
|
4626
|
+
* write key, no PIN needed) reads every row; a demo key and the keyless public view get a 404.
|
|
4620
4627
|
*/
|
|
4621
4628
|
worldProposals(opts?: OwWorldProposalQuery): Promise<OwWorldProposalList>;
|
|
4622
4629
|
/**
|
|
@@ -4728,7 +4735,8 @@ declare class OwV2Client {
|
|
|
4728
4735
|
* `code` and `state` out of the address bar (only when `url` is not given: a native app passes
|
|
4729
4736
|
* the address its loopback server or scheme handler received), trade
|
|
4730
4737
|
* the code once at `POST /auth/token` with the PKCE verifier and no credential, and return the
|
|
4731
|
-
* `ow_a_` token with the account and `resume`. The record is cleared
|
|
4738
|
+
* `ow_a_` token with the account and `resume`. The record is cleared once a return carries its
|
|
4739
|
+
* state, on success and on refusal; a return with another state leaves the sign-in pending;
|
|
4732
4740
|
* the SDK keeps no token: the tool does. Refusals are `OwSignInError`: `state_mismatch` (no
|
|
4733
4741
|
* pending sign-in, a different state, or the wrong page; nothing sent), `invalid_grant` (keel's
|
|
4734
4742
|
* 400: used, expired, or another client's code), `rate_limited`, `offline`, `failed`.
|
package/dist/index.js
CHANGED
|
@@ -608,7 +608,6 @@ async function completeSignIn(baseUrl, fetchImpl, opts) {
|
|
|
608
608
|
}
|
|
609
609
|
const key = RECORD_PREFIX + clientId;
|
|
610
610
|
const raw = storage.get(key);
|
|
611
|
-
storage.remove(key);
|
|
612
611
|
let record = null;
|
|
613
612
|
try {
|
|
614
613
|
record = raw ? JSON.parse(raw) : null;
|
|
@@ -616,9 +615,14 @@ async function completeSignIn(baseUrl, fetchImpl, opts) {
|
|
|
616
615
|
record = null;
|
|
617
616
|
}
|
|
618
617
|
if (!record || typeof record.state !== "string" || typeof record.verifier !== "string" || typeof record.redirectUri !== "string") {
|
|
618
|
+
storage.remove(key);
|
|
619
619
|
throw new OwSignInError("state_mismatch", "No sign-in is pending for this tool here: start again from the sign-in button.");
|
|
620
620
|
}
|
|
621
|
-
if (
|
|
621
|
+
if (state !== record.state) {
|
|
622
|
+
throw new OwSignInError("state_mismatch", "This page was not reached from the sign-in that was started here: start again.");
|
|
623
|
+
}
|
|
624
|
+
storage.remove(key);
|
|
625
|
+
if (!code) {
|
|
622
626
|
throw new OwSignInError("state_mismatch", "This page was not reached from the sign-in that was started here: start again.");
|
|
623
627
|
}
|
|
624
628
|
if (!samePage(here, record.redirectUri)) {
|
|
@@ -1738,7 +1742,7 @@ var OwV2Client = class {
|
|
|
1738
1742
|
* owner's and a co-builder's keys, a member's own for any other. `state` is `open` by keel's
|
|
1739
1743
|
* default (not past `expires`), or `lapsed`, `accepted`, `declined`, `all`; `since` keeps rows
|
|
1740
1744
|
* whose `updated_at` is at or after it; `limit` defaults to the client's pageSize. Any member
|
|
1741
|
-
* key that reads the element, a read key included.
|
|
1745
|
+
* key that reads the element, a read key included; the owner's read key reads every row.
|
|
1742
1746
|
*/
|
|
1743
1747
|
async listProposals(type, id, opts = {}) {
|
|
1744
1748
|
only("listProposals", opts, ["state", "since", "limit", "cursor"]);
|
|
@@ -1753,8 +1757,8 @@ var OwV2Client = class {
|
|
|
1753
1757
|
* `open`, `lapsed` and `all`, never `accepted` or `declined`; keel reads at most the 500 newest.
|
|
1754
1758
|
* Every row for the owner's and a co-builder's keys, a member's own for any other. The query is
|
|
1755
1759
|
* listProposals', plus `element` (one element's rows, by id). The cursor is opaque: pass
|
|
1756
|
-
* `next_cursor` back as it came. Any member key, a read key included;
|
|
1757
|
-
*
|
|
1760
|
+
* `next_cursor` back as it came. Any member key, a read key included; the owner's read key (or
|
|
1761
|
+
* write key, no PIN needed) reads every row; a demo key and the keyless public view get a 404.
|
|
1758
1762
|
*/
|
|
1759
1763
|
async worldProposals(opts = {}) {
|
|
1760
1764
|
only("worldProposals", opts, ["state", "since", "element", "limit", "cursor"]);
|
|
@@ -1940,7 +1944,8 @@ var OwV2Client = class {
|
|
|
1940
1944
|
* `code` and `state` out of the address bar (only when `url` is not given: a native app passes
|
|
1941
1945
|
* the address its loopback server or scheme handler received), trade
|
|
1942
1946
|
* the code once at `POST /auth/token` with the PKCE verifier and no credential, and return the
|
|
1943
|
-
* `ow_a_` token with the account and `resume`. The record is cleared
|
|
1947
|
+
* `ow_a_` token with the account and `resume`. The record is cleared once a return carries its
|
|
1948
|
+
* state, on success and on refusal; a return with another state leaves the sign-in pending;
|
|
1944
1949
|
* the SDK keeps no token: the tool does. Refusals are `OwSignInError`: `state_mismatch` (no
|
|
1945
1950
|
* pending sign-in, a different state, or the wrong page; nothing sent), `invalid_grant` (keel's
|
|
1946
1951
|
* 400: used, expired, or another client's code), `rate_limited`, `offline`, `failed`.
|