@onlyworlds/sdk 4.115.0 → 4.116.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/AGENTS.md CHANGED
@@ -77,8 +77,8 @@ against live data). The v1 surface (`OnlyWorldsClient`, the `ElementType` enum)
77
77
  world's Charter with up to five skill Objects: an agent reads `charter` first. `reading_aids`
78
78
  (since 4.100.0, also on an agent's join) is the world's three things to read first:
79
79
  `charter` (`{ id, name, rules, skill }`), `guide` and `domains` (`{ id, name, sentence, hubs }`);
80
- `charterOf(world, reader)` reads the same packet from a snapshot or a folder. `client.members()` is the roster's rows. An
81
- account token is a TypeError.
80
+ `charterOf(world, reader)` reads the same packet from a snapshot or a folder. `client.members()` is the roster's rows; an
81
+ account token reads it with the client's `world` set (as its grant there), and without it is a TypeError.
82
82
  - Lenses chosen (a world key, or an account token): `worldLenses(worldId, { resolve })` lists the
83
83
  world's lenses; `setMyLenses(lensIds)` sets the ones you start with (an account token needs the
84
84
  client's `world`). With an account token, `setMemberLenses(worldId, memberId, lensIds)` sets a
package/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ earlier history lives in git log only.
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [4.116.0] - 2026-10-30
9
+
10
+ ### Changed
11
+
12
+ - **`members()` works on an account token.** On a client holding an `ow_a_` token with `world` set (`new OwV2Client({ apiKey, world })`), it sends `GET /members/?world=<id>` with the Bearer token and no PIN, and reads the roster with the token's grant in that world: the owner's token as the owner, a member's as its own member key. A world where the token has no grant answers 404. Without `world` set it is a TypeError before anything is sent, naming the option; before, every account token was refused. A world key's call is unchanged (no `world`, no PIN on the read), and a client with no key is still refused before sending: the roster has no public reader.
13
+
8
14
  ## [4.115.0] - 2026-10-30
9
15
 
10
16
  ### Added
package/README.md CHANGED
@@ -177,7 +177,7 @@ const me = await client.me(); // { world, scope, kind, role, membershi
177
177
  const roster = await client.members(); // [{ id, kind, role, character, status }], the owner's id is null
178
178
  ```
179
179
 
180
- `me.membership` is what `created_by` holds on the elements this key creates; `me.role` decides what it may change.
180
+ An account token reads the roster too, of the world the client's `world` names, with the token's grant there (since 4.116.0); `me()` stays a world key's. `me.membership` is what `created_by` holds on the elements this key creates; `me.role` decides what it may change.
181
181
 
182
182
  ## Sync
183
183
 
package/dist/index.d.ts CHANGED
@@ -3498,7 +3498,8 @@ interface OwClientConfig {
3498
3498
  * `get` and `getWorld` then read that world, sending `world=<id>`: an account token reads it as
3499
3499
  * that account's own access there (the owner the whole world, a member its member key's view,
3500
3500
  * anyone else the public view), and no key reads it as the public does. An account token also
3501
- * sets its own lenses there with `setMyLenses` (`world=<id>`), the one write it names. On such a
3501
+ * sets its own lenses there with `setMyLenses` (`world=<id>`), the one write it names, and reads
3502
+ * the world's roster with `members` (`world=<id>`) as its grant there. On such a
3502
3503
  * client every other world call is a TypeError before sending; the account calls and
3503
3504
  * `worldLenses` (the world in its path) work as without it. Given with a world key, or as
3504
3505
  * anything but a non-empty string, it is a TypeError when the client is constructed.
@@ -4042,7 +4043,12 @@ declare class OwV2Client {
4042
4043
  /**
4043
4044
  * GET /members -- the world's roster: each member's id (null for the owner), kind, role,
4044
4045
  * Character and status (`removed` rows stay, so their elements keep `created_by`). Returns
4045
- * the rows; keel sends them as `{ data }` with no paging. A world key's call.
4046
+ * the rows; keel sends them as `{ data }` with no paging. A world key reads its own world's
4047
+ * roster and sends no `world`. An account token reads the roster of the world the client's
4048
+ * `world` names (`world=<id>`, the Bearer token, no PIN), with the token's grant there: the
4049
+ * owner's token as the owner, a member's as its own member key; a world where it has none is a
4050
+ * 404. Without `world` set it is a TypeError before sending. A client with no key is refused
4051
+ * before sending: the roster has no public reader.
4046
4052
  */
4047
4053
  members(): Promise<OwMember[]>;
4048
4054
  /**
@@ -4833,7 +4839,7 @@ declare class OwV2Client {
4833
4839
  worldRead?: boolean;
4834
4840
  /**
4835
4841
  * A route keel's document declares the account token on beside the world key (worldLenses,
4836
- * setMyLenses): an account client sends it with its Bearer token. `'path'`: the path names the
4842
+ * setMyLenses, members): an account client sends it with its Bearer token. `'path'`: the path names the
4837
4843
  * world, and nothing is added. `'world'`: the world is named with `world=<id>`, added from the
4838
4844
  * client's `world`, and an account client without `world` set is a TypeError before sending.
4839
4845
  * A world key sends as without it; a keyless client is still refused.
package/dist/index.js CHANGED
@@ -827,13 +827,15 @@ var OwV2Client = class {
827
827
  /**
828
828
  * GET /members -- the world's roster: each member's id (null for the owner), kind, role,
829
829
  * Character and status (`removed` rows stay, so their elements keep `created_by`). Returns
830
- * the rows; keel sends them as `{ data }` with no paging. A world key's call.
830
+ * the rows; keel sends them as `{ data }` with no paging. A world key reads its own world's
831
+ * roster and sends no `world`. An account token reads the roster of the world the client's
832
+ * `world` names (`world=<id>`, the Bearer token, no PIN), with the token's grant there: the
833
+ * owner's token as the owner, a member's as its own member key; a world where it has none is a
834
+ * 404. Without `world` set it is a TypeError before sending. A client with no key is refused
835
+ * before sending: the roster has no public reader.
831
836
  */
832
837
  async members() {
833
- if (this.keyKind === "account") {
834
- throw new TypeError("members needs a world key: an account token is not a member of one world");
835
- }
836
- const page = await this.request("GET", "/members/");
838
+ const page = await this.request("GET", "/members/", { accountToken: "world" });
837
839
  return page.data ?? [];
838
840
  }
839
841
  // -- Element CRUD --------------------------------------------------------
@@ -2056,7 +2058,7 @@ var OwV2Client = class {
2056
2058
  }
2057
2059
  if (opts.auth !== false && this.keyKind === "account" && !ACCOUNT_ROUTE.test(path)) {
2058
2060
  if (!worldRead && accountToken === void 0) {
2059
- throw new TypeError(`${method} ${path} needs a world key: an account token sends the /account routes, worldLenses and setMyLenses, and with \`world\` set reads a world through list, listAll, get and getWorld only. Nothing was sent.`);
2061
+ throw new TypeError(`${method} ${path} needs a world key: an account token sends the /account routes, worldLenses, setMyLenses and members, and with \`world\` set reads a world through list, listAll, get and getWorld only. Nothing was sent.`);
2060
2062
  }
2061
2063
  if (worldRead && this.world === void 0) {
2062
2064
  throw new TypeError(`${method} ${path}: an account token reads a world only with \`world\` set (new OwV2Client({ apiKey, world })), through list, listAll, get and getWorld. Nothing was sent.`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlyworlds/sdk",
3
- "version": "4.115.0",
3
+ "version": "4.116.0",
4
4
  "description": "TypeScript SDK for the OnlyWorlds API - build world-building applications with type safety",
5
5
  "type": "module",
6
6
  "exports": {