@onlyworlds/sdk 4.65.0 → 4.67.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
@@ -73,6 +73,10 @@ against live data). The v1 surface (`OnlyWorldsClient`, the `ElementType` enum)
73
73
  tokenName })` (or `username`) mints an `ow_a_` account token named for the device and ends
74
74
  the sign-in session; only the token comes back. Refusals: `OwSignInError` with `reason`
75
75
  (`invalid_credentials`, `email_unverified`, `rate_limited`, `offline`, `mint_failed`, `failed`).
76
+ - A new world (since 4.66.0, account token): `account.createAccountWorld({ name, pin?, keyName?,
77
+ source?, producer? })` makes it with one write key, returned once in `key`. `pin` only while
78
+ the account has none (it becomes the account PIN); either mistake is a 422 with
79
+ `err.param === 'pin'`, so send without it first and again with it on that 422.
76
80
  - Invite links (since 4.12.0): `previewJoin(code)` (no credential sent) shows who invites, to
77
81
  which world, in what role; `acceptJoin(code)` with an `ow_a_` account token joins. Bad code:
78
82
  `err.isNotFound`; `err.isAlreadyMember`, `err.isPinRequired` for the two 409s.
@@ -126,7 +130,11 @@ against live data). The v1 surface (`OnlyWorldsClient`, the `ElementType` enum)
126
130
  co-builder decides: `acceptProposal(type, id, pid)` (the write is theirs; 409 `stale_proposal`,
127
131
  an `OwStaleProposalError` with `conflicts` and `current`, when a proposed field moved since),
128
132
  `declineProposal(type, id, pid, { reason? })`; the proposer may `withdrawProposal`. Lists:
129
- `listProposals(type, id)`, `worldProposals({ state?, element? })`. When the world's
133
+ `listProposals(type, id)`, `worldProposals({ state?, element? })`; the world's queue (since
134
+ 4.66.0, keel #565) also lists each new element written as proposed (`kind: 'new_element'`
135
+ beside `kind: 'proposal'`), which a keeper settles with `reviewNewElement(type, id, { decision:
136
+ 'accept' | 'decline', reason? })` (decline deletes it; 422 `err.isNotProposed` when unmarked).
137
+ A row's `fields` holds only what differs; `omitted` names what an upsert left empty. When the world's
130
138
  `agent_writes_proposed` is on, an agent seat's `patch`, `upsert` or `editLinks` on an existing
131
139
  element throws `OwProposedError` (status 202, `err.isProposed`, the row under `err.proposal`):
132
140
  the element did not change, so do not report it as changed. A `bulk` slot says `status: 202`
package/CHANGELOG.md CHANGED
@@ -5,6 +5,32 @@ earlier history lives in git log only.
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [4.67.0] - 2026-10-23
9
+
10
+ ### Added
11
+
12
+ - **The draught's `room` and `proposed` components**: `OwDraughtComponent` is now keel's thirteen, in its order. `room` (keel #556) is the room profile's other elements that reach her (a board entry, a spec, a heart, a vote, a sitting, a member card, a work item that is not open or taken), each there or nowhere; the type missed it since keel shipped it. `proposed` (keel #580, live 2026-10-23) is every element carrying `x_review_proposed` that reaches her, there or nowhere, whatever section would have held it; `cut.proposed` counts the ones left out, the component unnamed or its budget spent, so a tool handing a draught on can say so. Both are off unless named, as `messages` is: `draught(id, { components: [..., 'room', 'proposed'] })`. `OwDraught.room` and `OwDraught.proposed` are typed.
13
+
14
+ ### Fixed
15
+
16
+ - **`OwDraughtItem` nests the element**: keel has served each draught row as `{ via, circles?, her_links, grade, dated?, element }` since the route shipped (keel PR 155), and the type spread the element's fields onto the row instead. Read `row.element.name`, not `row.name` (which was `undefined` at runtime all along); TypeScript code that read the spread form now fails to compile where it was already wrong. In the same way `OwDraught.character` is `{ self, grade, element }`, and optional (absent unless `self` is served), `work` rows carry `packet` (the work item's `x_packet_elements`), `messages` rows carry `author` (`membership`, `kind`, `role`), and rows may carry `circles`. Read from keel's `elements/draught.py` and its OpenAPI `Draught` schema; nothing at runtime changed.
17
+ - Tests: `components: ['room', 'proposed']` is sent as `components=room,proposed`; the published `OwDraughtComponent` lists keel's COMPONENTS in order; the nested rows, `cut.proposed`, `character.element`, `packet`, `author` and `circles` compile against the built `.d.ts`, and a spread read and an unknown component do not. Watched failing with `'proposed'` cut from the type.
18
+
19
+ ## [4.66.0] - 2026-10-23
20
+
21
+ ### Added
22
+
23
+ - **`createAccountWorld({ name, pin?, keyName?, source?, producer? })`** (account token): `POST /account/worlds` makes a world on the account with its one write key. Sent in keel's spelling, only the keys given (`keyName` as `key_name`, keel #363: 1 to 80 characters, trimmed, `null` for none; `source` and `producer`, keel #571: the folder format's provenance lines, each an object or `null`, kept on the World and served by `getWorld()` as `origin`). `pin` only while the account has no PIN (it becomes the account PIN); an account with one must leave it out. Either mistake is a 422 with `err.param === 'pin'` and nothing made, so a tool that cannot tell which account it holds sends without `pin` first and again with it on that 422, as Atlas's Make online does. Returns `OwCreatedAccountWorld`: the world's row as `listAccountWorlds` lists it, plus the full write key once in `key`. No Idempotency-Key (the document declares none), and neither `X-OW-Agent` nor `X-OW-Client` (it declares neither here). keel's document gives the 201 no schema, so the type is read from keel's handler. A world key is a `TypeError`, as is an unknown option or a missing `name`, before anything is sent. Atlas can retire its own `AccountClient.createWorld` for it.
24
+ - **The world's queue lists new elements written as proposed** (keel #565, live 2026-10-23): `worldProposals()` now returns `OwWorldProposalList`, whose rows are `OwWorldProposalRow`, told apart by `kind`: `OwProposal` (`kind: 'proposal'`) or `OwProposedNewElement` (`kind: 'new_element'`: an element carrying `x_review_proposed`, its `by`, `evidence` and `expires` the mark's words, `state` `open` or `lapsed`). One order, newest first by `created_at`; the cursor is opaque and goes back as it came (an old bare proposal id still reads). `listProposals` keeps `OwProposalList`: one element's proposals only.
25
+ - **`reviewNewElement(type, id, { decision, reason? })`**: `POST /{type}/{id}/review`, a keeper (the owner or a co-builder, with the PIN) settles a new element written as proposed. `accept` clears the mark and returns `{ element }`; `decline` deletes the element and returns `{ deleted }` (its id); the reason is answered back and kept nowhere. Sends `X-OW-Client`, as the document lists, and no `X-OW-Agent`. A `decision` other than `accept` or `decline`, or an unknown key, is a `TypeError` before sending. Type `OwReviewed`, options `OwReviewInput`.
26
+ - **`err.isNotProposed`**: 422 `not_proposed`, the element carries no mark to settle. `isProposedOnly` (403) also answers the seat the mark names.
27
+ - **`OwProposal.kind`** (`'proposal'`) and **`OwProposal.omitted`** (keel #565): a row's `fields` now holds only what differs from the element when proposed, and `omitted` names the fields an upsert left out that were not empty (each in `fields` at its empty value, so an accept empties it; `[]` for a patch, a link edit or `propose`). A propose with nothing new is a 422 with `param: 'fields'`; a seat's write that changes nothing under the world's switch answers 200 with the element and makes no row.
28
+
29
+ ### Changed
30
+
31
+ - `worldProposals()`'s answer type is `OwWorldProposalList` instead of `OwProposalList`: TypeScript code that reads a proposal's own keys (`fields`, `base`) off a queue row now narrows on `row.kind === 'proposal'` first. The wire changed under it on keel's side: the 4.65.0 type described rows keel no longer sends alone.
32
+ - Tests: the body sent for each `createAccountWorld` option alone and together, `null` included, an `undefined` option left out; the PIN dance's 422 surfacing with `err.param` `'pin'`, then the retry with it; the headers on the create (no agent, client or idempotency header); the queue's two kinds and its cursor; both review decisions, their headers and their refusals; the published types. Watched failing on 30 mutants, each restored byte for byte.
33
+
8
34
  ## [4.65.0] - 2026-10-23
9
35
 
10
36
  ### Fixed
package/README.md CHANGED
@@ -140,6 +140,14 @@ const account = new OwV2Client({ apiKey: token }); // keep the token; the passwo
140
140
 
141
141
  The SDK signs in, mints the token, and ends the sign-in session. A refusal is an `OwSignInError` whose `reason` is `invalid_credentials`, `email_unverified`, `rate_limited` (see `retryAfter`), `offline`, `mint_failed` or `failed`.
142
142
 
143
+ The account token lists the account's worlds (`listAccountWorlds()`), mints a key for one (`mintWorldKey(worldId, { scope, name })`), and makes a new one with its write key (since 4.66.0):
144
+
145
+ ```typescript
146
+ const world = await account.createAccountWorld({ name: 'Ostvik', keyName: 'My app' }); // world.key: shown once
147
+ ```
148
+
149
+ An account's first world sends `pin` too, which becomes the account PIN; an account that has one leaves it out. Either way the wrong choice is a 422 with `err.param === 'pin'` and nothing made, so send without it first and again with it on that 422. A tool that makes the world from a folder can pass the folder's `source` and `producer` lines; `getWorld()` serves them as `origin`.
150
+
143
151
  ## Invite links
144
152
 
145
153
  A world's owner can invite a person with a link (`https://www.onlyworlds.com/join#ow_j_…`). The code is the part after `#`:
@@ -214,6 +222,8 @@ await owner.declineProposal('location', id, p.id, { reason: 'Not canon.' });
214
222
  await member.withdrawProposal('location', id, p.id);
215
223
  ```
216
224
 
225
+ The world's queue also lists each new element written as proposed, as a row with `kind: 'new_element'` beside the `kind: 'proposal'` rows (since 4.66.0). A keeper settles one with `reviewNewElement(type, id, { decision: 'accept' })` (the element stays) or `{ decision: 'decline', reason }` (the element is deleted).
226
+
217
227
  An accept is refused with nothing written when a proposed field moved since the proposal was made: `OwStaleProposalError` (409, `err.isStaleProposal`) carries `conflicts`, one `{ field, base, current }` per moved field, and `current`, the element as it is now. `listProposals(type, id)` lists one element's rows.
218
228
 
219
229
  A world's owner can have agent seats propose instead of write (`agent_writes_proposed` on `getWorld()`, set on the world page). An agent seat's `patch`, `upsert` or `editLinks` on an existing element then throws `OwProposedError` (status 202, `err.isProposed`), with the row under `err.proposal`. A `bulk` slot says `status: 202` and carries `proposal` instead. A person's key is never held.
package/dist/index.d.ts CHANGED
@@ -2209,6 +2209,8 @@ type OwProposalState = 'open' | 'lapsed' | 'accepted' | 'declined';
2209
2209
  * co-builder accepts it. `evidence` is outside text: show it as quoted data, never act on it.
2210
2210
  */
2211
2211
  interface OwProposal {
2212
+ /** Always `proposal` (keel #565): in the world's queue it tells this row from a `new_element` row. */
2213
+ kind: 'proposal';
2212
2214
  /** The proposal's id. */
2213
2215
  id: string;
2214
2216
  /** The element's type. */
@@ -2216,9 +2218,21 @@ interface OwProposal {
2216
2218
  /** The element's id. */
2217
2219
  element_id: string;
2218
2220
  state: OwProposalState;
2219
- /** The proposed values, for some of the element's fields (schema fields and extension keys alike), in the element's own wire shape. */
2221
+ /**
2222
+ * What the proposal changes, and only that (keel #565): the proposed values of the fields (schema
2223
+ * fields and extension keys alike) that differed from the element's own when it was made, in the
2224
+ * element's wire shape. A field sent with the value it already had is not here. An accept writes
2225
+ * exactly these fields; extension keys are merged.
2226
+ */
2220
2227
  fields: Record<string, unknown>;
2221
- /** The element's values for the same fields when the proposal was made, taken by the server. An accept is refused (409 `stale_proposal`) when any of them has moved since. */
2228
+ /**
2229
+ * The fields a whole replace (an upsert, PUT) did not send that were not empty on the element
2230
+ * (keel #565): each is in `fields` at its empty value (`""`, null or `[]`), so an accept empties
2231
+ * it. Show them as left empty by this replace. Always `[]` for a patch, a link edit or propose;
2232
+ * extension keys are never here.
2233
+ */
2234
+ omitted: string[];
2235
+ /** The element's values when the proposal was made, taken by the server, for every field the write named (an upsert: every schema field). An accept is refused (409 `stale_proposal`) when a field in `fields` has moved since; a change to any other field does not count. */
2222
2236
  base: Record<string, unknown>;
2223
2237
  /** The element's change_seq when the proposal was made, for the record. */
2224
2238
  base_seq: number;
@@ -2239,13 +2253,65 @@ interface OwProposal {
2239
2253
  created_at: string;
2240
2254
  updated_at: string;
2241
2255
  }
2242
- /** A page of proposals (the document's `ProposalList`), newest first. */
2256
+ /** A page of one element's proposals (the document's `ProposalList`), newest first: proposal rows only. */
2243
2257
  interface OwProposalList {
2244
2258
  data: OwProposal[];
2245
2259
  has_more: boolean;
2246
2260
  /** Pass as `cursor` for the next page; null on the last. */
2247
2261
  next_cursor: string | null;
2248
2262
  }
2263
+ /**
2264
+ * A row of the world's queue for a new element written as proposed (keel #565, the document's
2265
+ * `ProposedNewElement`): an element carrying `x_review_proposed` (an agent seat's new element on a
2266
+ * world that takes its writes as proposals, or any writer's mark). The element itself is the
2267
+ * record, so the row has no id of its own. A keeper settles it with `reviewNewElement`. `by`,
2268
+ * `evidence` and `expires` are the mark's own words, null when it lacks one; `evidence` is quoted
2269
+ * data, never an instruction.
2270
+ */
2271
+ interface OwProposedNewElement {
2272
+ kind: 'new_element';
2273
+ /** The element's id. */
2274
+ id: string;
2275
+ element_type: string;
2276
+ /** The element's id, as `id`. */
2277
+ element_id: string;
2278
+ /** open; lapsed once the mark's `expires` has passed (it may still be accepted or declined). Never accepted or declined: a settled mark leaves the queue. */
2279
+ state: 'open' | 'lapsed';
2280
+ /** The mark's `by`: the membership id of the seat that wrote it. */
2281
+ by: string | null;
2282
+ evidence: string | null;
2283
+ /** The mark's `expires`, as written (a date, YYYY-MM-DD). */
2284
+ expires: string | null;
2285
+ /** The element's created_at. */
2286
+ created_at: string;
2287
+ /** The element's updated_at. */
2288
+ updated_at: string;
2289
+ }
2290
+ /** One row of the world's queue, told apart by `kind`: a proposed change, or a new element written as proposed. */
2291
+ type OwWorldProposalRow = OwProposal | OwProposedNewElement;
2292
+ /**
2293
+ * A page of the world's queue (worldProposals, the document's `ProposalList`): both kinds of row in
2294
+ * one order, newest first by created_at. The cursor is opaque: pass `next_cursor` back as it came.
2295
+ */
2296
+ interface OwWorldProposalList {
2297
+ data: OwWorldProposalRow[];
2298
+ has_more: boolean;
2299
+ /** Pass as `cursor` for the next page; null on the last. */
2300
+ next_cursor: string | null;
2301
+ }
2302
+ /** reviewNewElement's options: `accept` or `decline`, and, with decline only, a reason (at most 2,000 characters, answered back and kept nowhere). */
2303
+ interface OwReviewInput {
2304
+ decision: 'accept' | 'decline';
2305
+ reason?: string;
2306
+ }
2307
+ /** reviewNewElement's 200: `element` on accept (the element as written, the mark cleared), `deleted` (its id) on decline. */
2308
+ type OwReviewed = {
2309
+ element: OwElement;
2310
+ deleted?: never;
2311
+ } | {
2312
+ deleted: string;
2313
+ element?: never;
2314
+ };
2249
2315
  /**
2250
2316
  * The answer when a write became a proposal (the document's `Proposed`): the proposal under
2251
2317
  * `proposal`, and nothing element-shaped beside it. A 202 on patch, upsert or editLinks is thrown
@@ -2668,7 +2734,7 @@ interface OwSignedIn {
2668
2734
  */
2669
2735
  /** The draught's policy (keel PR 155, D143): what GET /character/{id}/context serves and how. */
2670
2736
  interface OwDraughtPolicy {
2671
- /** Sections to serve; default every one but `messages`. */
2737
+ /** Sections to serve; default every one but `messages`, `room` and `proposed`, each served only when named. */
2672
2738
  components?: OwDraughtComponent[];
2673
2739
  /** `voice`: her slice, as she would read (default). `act`: through the caller's own view. */
2674
2740
  mode?: 'voice' | 'act';
@@ -2683,17 +2749,27 @@ interface OwDraughtPolicy {
2683
2749
  /** The sheet's reach: 1 (default) what her own element links to, 0 none. */
2684
2750
  depth?: 0 | 1;
2685
2751
  }
2686
- type OwDraughtComponent = 'self' | 'role' | 'work' | 'style' | 'events' | 'knowledge' | 'names' | 'sheet' | 'recent' | 'messages' | 'roster';
2687
- /** An element as the draught serves it: the list route's body plus how it got here. */
2688
- type OwDraughtItem = OwElement & {
2689
- /** The link fields that brought it (on the element, or on her own element in `sheet`). */
2752
+ /**
2753
+ * A section of the draught, in the packet's order (keel's COMPONENTS). `messages`, `room` (keel #556:
2754
+ * the room profile's other elements) and `proposed` (keel #580: elements carrying `x_review_proposed`)
2755
+ * are off unless named.
2756
+ */
2757
+ type OwDraughtComponent = 'self' | 'role' | 'work' | 'style' | 'events' | 'knowledge' | 'names' | 'sheet' | 'recent' | 'messages' | 'room' | 'proposed' | 'roster';
2758
+ /** One row of the draught: an element as the list route serves it to the same reader, and how it got here. */
2759
+ interface OwDraughtItem {
2760
+ /** The link fields that brought it (on the element, or on her own element in `sheet`); empty for a `proposed` row that came only through `recent`. */
2690
2761
  via: string[];
2762
+ /** With `via` collectives: her circles it is held by. */
2763
+ circles?: string[];
2691
2764
  /** How many of the packet's elements link to it. */
2692
2765
  her_links: number;
2766
+ /** `known_of`: a stub this reader knows of but does not see whole (its other fields read empty). */
2693
2767
  grade: 'whole' | 'known_of';
2694
- /** On an Event: false when it carries no date (ranked after the dated). */
2768
+ /** In `events` and `knowledge`: false when it carries no date (ranked after the dated). */
2695
2769
  dated?: boolean;
2696
- };
2770
+ /** The element's body exactly as the list route serves it to the same reader. */
2771
+ element: OwElement;
2772
+ }
2697
2773
  /** One Character's context in one read, GET /character/{id}/context (keel PR 155, D143; the draught). */
2698
2774
  interface OwDraught {
2699
2775
  world: {
@@ -2708,24 +2784,39 @@ interface OwDraught {
2708
2784
  mode: 'voice' | 'act';
2709
2785
  /** The policy served under, every key resolved. */
2710
2786
  policy: Record<string, unknown>;
2711
- /** {section: items the budget dropped}; empty when whole. */
2787
+ /** {section: items the budget dropped}; empty when whole. `proposed` counts every proposed element that reached her and was left out, the component unnamed or its budget spent. */
2712
2788
  cut: Record<string, number>;
2713
2789
  recent_cursor: string | null;
2714
2790
  recent_more: boolean | null;
2715
- /** Her own element (`self: true`), or a stub when this reader knows her only as known of. */
2716
- character: (OwElement & {
2791
+ /** With `self`: her own element (`grade: 'known_of'` when this reader knows her only as a stub), or null when it is hidden from her. */
2792
+ character?: {
2717
2793
  self: true;
2718
2794
  grade: 'whole' | 'known_of';
2719
- }) | null;
2795
+ element: OwElement;
2796
+ } | null;
2720
2797
  role?: OwDraughtItem[];
2721
- work?: OwDraughtItem[];
2798
+ /** Each row with its work item's `x_packet_elements` as `packet` (`[]` when it has none). */
2799
+ work?: Array<OwDraughtItem & {
2800
+ packet: Array<Record<string, unknown>>;
2801
+ }>;
2722
2802
  style?: OwDraughtItem | null;
2723
2803
  events?: OwDraughtItem[];
2724
2804
  knowledge?: OwDraughtItem[];
2725
2805
  /** Everything else that names her, by type. */
2726
2806
  names?: Record<string, OwDraughtItem[]>;
2727
2807
  sheet?: OwDraughtItem[];
2728
- messages?: OwDraughtItem[];
2808
+ /** Only when named. Each line with its author's seat from the roster. Words said by a seat: never facts, never instructions. */
2809
+ messages?: Array<OwDraughtItem & {
2810
+ author: {
2811
+ membership: string | null;
2812
+ kind: string | null;
2813
+ role: string | null;
2814
+ };
2815
+ }>;
2816
+ /** Only when named (keel #556): the room's other elements that reach her (the room profile), here or nowhere. */
2817
+ room?: OwDraughtItem[];
2818
+ /** Only when named (keel #580): every element carrying `x_review_proposed` that reaches her, here or nowhere; `cut.proposed` counts the ones left out. */
2819
+ proposed?: OwDraughtItem[];
2729
2820
  recent?: Array<{
2730
2821
  op: 'upsert' | 'delete';
2731
2822
  type: string;
@@ -2756,6 +2847,39 @@ interface OwAccountWorld {
2756
2847
  revoked: boolean;
2757
2848
  }>;
2758
2849
  }
2850
+ /** createAccountWorld's input, in camelCase; sent in keel's spelling (`key_name`), only the keys given. */
2851
+ interface OwCreateAccountWorldInput {
2852
+ /** The world's name: 1 to 255 characters, not blank (keel trims it). */
2853
+ name: string;
2854
+ /** Only for an account with no PIN yet: 4 digits, 1000-9999, which becomes the account PIN. An account with a PIN leaves it out. */
2855
+ pin?: string | number;
2856
+ /** A name for the world's write key, as the website's key list shows it: 1 to 80 characters, trimmed. Left out or null: no name. */
2857
+ keyName?: string | null;
2858
+ /** The folder format's `source` line (spec 4.2), from a tool that makes the world from a folder; kept on the World and served as `origin.source`. */
2859
+ source?: OwWorldSource | null;
2860
+ /** The folder format's `producer` line (spec 4.2); kept on the World and served as `origin.producer`. */
2861
+ producer?: OwWorldProducer | null;
2862
+ }
2863
+ /**
2864
+ * createAccountWorld's 201: the world's row as listAccountWorlds lists it, plus the full write key
2865
+ * once in `key` (never shown again). keel's document gives this answer no schema; the keys are
2866
+ * keel's handler's (`accounts/api.py`, `create_world`: the list row plus `key`).
2867
+ */
2868
+ interface OwCreatedAccountWorld {
2869
+ id: string;
2870
+ name: string;
2871
+ role: 'owner';
2872
+ public_read: boolean;
2873
+ /** The world's one key, by name and last four. */
2874
+ keys: Array<{
2875
+ name: string;
2876
+ last4: string;
2877
+ scope: 'READ' | 'WRITE';
2878
+ revoked: boolean;
2879
+ }>;
2880
+ /** The full `ow_w_` write key, shown in this answer only. */
2881
+ key: string;
2882
+ }
2759
2883
  /**
2760
2884
  * A world key as minted by POST /account/worlds/{id}/keys: the row the account's key list shows,
2761
2885
  * plus the full key once in `key` (never shown again). A member's key carries its `member` label
@@ -3240,7 +3364,8 @@ declare class OwApiError extends Error {
3240
3364
  /**
3241
3365
  * While the world takes agent seats' writes as proposals (keel #519), an agent seat's key tried
3242
3366
  * what it may not: delete an element it did not create, or accept or decline a proposal (403
3243
- * `proposed_only`). Retrying will not help; a person decides.
3367
+ * `proposed_only`). On any world, reviewNewElement by the member the mark names is the same 403
3368
+ * (keel #565). Retrying will not help; a person decides.
3244
3369
  */
3245
3370
  get isProposedOnly(): boolean;
3246
3371
  /**
@@ -3248,6 +3373,11 @@ declare class OwApiError extends Error {
3248
3373
  * another keeper (the owner or a co-builder) decides it. Retrying will not help.
3249
3374
  */
3250
3375
  get isOwnProposal(): boolean;
3376
+ /**
3377
+ * reviewNewElement on an element that carries no `x_review_proposed` mark (422 `not_proposed`,
3378
+ * keel #565): nothing to settle. Someone settled it already, or it was never written as proposed.
3379
+ */
3380
+ get isNotProposed(): boolean;
3251
3381
  }
3252
3382
  /**
3253
3383
  * 412 `precondition_failed` (keel #210): the element changed since the `change_seq` sent as
@@ -3494,11 +3624,14 @@ declare class OwV2Client {
3494
3624
  * recorded world holds it, in one read: her element, what she holds and sits in, her open work,
3495
3625
  * how she works, the Events she was in, the Narratives she knows, everything else that names
3496
3626
  * her, her sheet, what changed around her (`since`), and who plays whom; the world's name and
3497
- * calendar beside. Every body is the list route's for the same reader, with `via`, `her_links`
3627
+ * calendar beside; the room's messages (`messages`), its other elements (`room`, keel #556) and
3628
+ * elements written as proposed (`proposed`, keel #580) only when `components` names them. Each
3629
+ * row carries the list route's body for the same reader as `element`, beside `via`, `her_links`
3498
3630
  * and `grade`; nothing is inferred. The owner's keys, co-builders and contributors for any
3499
3631
  * Character they can see; a player seat or a guest for its own Character only (another id is
3500
3632
  * 404). `asOf` is a filter on the elements' own dates, not time travel. A `cut` that is not
3501
- * empty means the serving is partial. Served `Cache-Control: private, no-store`.
3633
+ * empty means the serving is partial (`cut.proposed` also counts proposed elements left out because
3634
+ * the component was not named). Served `Cache-Control: private, no-store`.
3502
3635
  */
3503
3636
  draught(characterId: string, policy?: OwDraughtPolicy): Promise<OwDraught>;
3504
3637
  /** Cursor-walk every page of a type. Politeness: uses config pageSize. */
@@ -4029,12 +4162,17 @@ declare class OwV2Client {
4029
4162
  */
4030
4163
  listProposals(type: ElementType | string, id: string, opts?: OwProposalQuery): Promise<OwProposalList>;
4031
4164
  /**
4032
- * GET /world/proposals -- the world's queue, newest first: every proposal for the owner's and a
4033
- * co-builder's keys, a member's own for any other. The query is listProposals', plus `element`
4034
- * (one element's rows, by id). Any member key, a read key included; a read key with no member
4165
+ * GET /world/proposals -- the world's queue, newest first by created_at, two kinds of row told
4166
+ * apart by `kind` (keel #565): `proposal`, a proposed change to an element (OwProposal), and
4167
+ * `new_element`, an element written as proposed, carrying `x_review_proposed`
4168
+ * (OwProposedNewElement: settle it with reviewNewElement). A marked element is listed under
4169
+ * `open`, `lapsed` and `all`, never `accepted` or `declined`; keel reads at most the 500 newest.
4170
+ * Every row for the owner's and a co-builder's keys, a member's own for any other. The query is
4171
+ * listProposals', plus `element` (one element's rows, by id). The cursor is opaque: pass
4172
+ * `next_cursor` back as it came. Any member key, a read key included; a read key with no member
4035
4173
  * (a demo key, the owner's read key) and the keyless public view get a 404.
4036
4174
  */
4037
- worldProposals(opts?: OwWorldProposalQuery): Promise<OwProposalList>;
4175
+ worldProposals(opts?: OwWorldProposalQuery): Promise<OwWorldProposalList>;
4038
4176
  /**
4039
4177
  * POST /{type}/{id}/proposals/{pid}/accept -- write the proposal's fields to the element as one
4040
4178
  * ordinary write by this key (`changed_by` is the keeper, a new change_seq, a /changes row), and
@@ -4061,11 +4199,40 @@ declare class OwV2Client {
4061
4199
  * any other key a 404; a decided row a 422.
4062
4200
  */
4063
4201
  withdrawProposal(type: ElementType | string, id: string, pid: string): Promise<void>;
4202
+ /**
4203
+ * POST /{type}/{id}/review -- settle a new element written as proposed, one carrying
4204
+ * `x_review_proposed` (the queue's `new_element` row, keel #565). The owner's key or a
4205
+ * co-builder's, with its PIN. `{ decision: 'accept' }` clears the mark (a write by you: a new
4206
+ * change_seq, one /changes row) and answers `{ element }`; `{ decision: 'decline', reason? }`
4207
+ * deletes the element (a tombstone, the links to it scrubbed, its open proposals dropped) and
4208
+ * answers `{ deleted }`, its id; the reason is answered back and kept nowhere. Refusals: 422
4209
+ * `not_proposed` (`err.isNotProposed`: the element carries no mark), 403 `proposed_only`
4210
+ * (`err.isProposedOnly`: the seat the mark names, or an agent seat under the world's switch), 403
4211
+ * for any key but a keeper's. A proposed change to an existing element is decided with
4212
+ * acceptProposal or declineProposal instead.
4213
+ */
4214
+ reviewNewElement(type: ElementType | string, id: string, opts: OwReviewInput): Promise<OwReviewed>;
4064
4215
  /**
4065
4216
  * GET /account/worlds -- every world the account owns or is a member of, with its keys by
4066
4217
  * name and last four (a member sees only their own keys on a shared world). Account token only.
4067
4218
  */
4068
4219
  listAccountWorlds(): Promise<OwAccountWorld[]>;
4220
+ /**
4221
+ * POST /account/worlds -- make a world on the account, with its one write key. `name` is required
4222
+ * (1 to 255 characters, not blank; keel trims it). `pin` only while the account has no PIN (4
4223
+ * digits, 1000-9999): it becomes the account PIN and the write wall on every world of the
4224
+ * account. An account with a PIN must leave it out. Either mistake is a 422 with `param: 'pin'`
4225
+ * (`err.param`) and nothing made, so a tool that cannot tell which account it holds sends without
4226
+ * `pin` first and, on that 422, again with it. `keyName` names the write key as the website's key
4227
+ * list shows it (1 to 80 characters, trimmed; null or left out: no name). `source` and `producer`
4228
+ * are the folder format's provenance lines (spec 4.2), each an object or null, from a tool that
4229
+ * makes the world from a folder: kept on the World as given, served by getWorld() as `origin`.
4230
+ * Only the keys given are sent, `keyName` as `key_name`. 201: the world's row, as
4231
+ * listAccountWorlds lists it, with the full write key once in `key`. Account token only; no
4232
+ * Idempotency-Key (keel's document declares none): if the answer is lost, the world is in
4233
+ * listAccountWorlds, and mintWorldKey gives it a key.
4234
+ */
4235
+ createAccountWorld(opts: OwCreateAccountWorldInput): Promise<OwCreatedAccountWorld>;
4069
4236
  /**
4070
4237
  * POST /account/worlds/{id}/keys -- mint a world key, `scope` `'write'` (the default) or
4071
4238
  * `'read'`, `name` as the key list shows it (at most 255 characters). The full key comes back
@@ -5261,4 +5428,4 @@ declare class TokenResource {
5261
5428
  getEncryptionInfo(): Promise<EncryptionInfo>;
5262
5429
  }
5263
5430
 
5264
- export { AGENT_DOORS, ASK_LIMITS, type AccessKeyResponse, CALENDAR_FIELD, CALENDAR_SUPERTYPE, type CalendarConfig, type CalendarEra, type CalendarIntercalary, type CalendarMonths, type CalendarWeek, ELEMENT_FAMILIES, ELEMENT_ICONS, ELEMENT_LABELS, ELEMENT_SECTIONS, ELEMENT_TYPES, type ElementFamily, type ElementType, type EncryptionInfo, type EraDomain, FAMILY_COLORS, FAMILY_ORDER, FIELD_ACRONYMS, FIELD_SCHEMA, FILE_EXTENSIONS, type FieldInfo, type FieldType, GameTier, type ListParams, ONLYWORLDS_VERSION, type OwAccountWorld, type OwAgentJoined, type OwAllowance, OwApiError, type OwAskAnswer, type OwAskContext, type OwAuthErrorCode, type OwBulkItem, type OwBulkItemResult, type OwBulkResponse, type OwCalendarElement, type OwChange, type OwChangeDelete, type OwChangeUpsert, type OwChangesPage, type OwClientConfig, type OwCreatedWorldLink, type OwDeleteReason, type OwDraught, type OwDraughtComponent, type OwDraughtItem, type OwDraughtPolicy, type OwElement, type OwElementBase, type OwErrorBody, type OwFileAddedBy, type OwFileDownload, type OwFileKind, type OwFileRow, type OwFileTicket, type OwFrontDoor, type OwHiddenRow, type OwJoinPreview, type OwJoined, type OwJoinedMembership, type OwKeyKind, type OwLinkEdit, type OwLookupElement, type OwLookupHit, type OwLookupLink, type OwLookupOptions, type OwLookupReason, type OwMe, type OwMediaTicket, type OwMember, type OwMemberRole, type OwMintedKey, type OwNamesMap, OwNetworkError, type OwPage, type OwPhotoOptions, type OwPhotoPlan, type OwPlayerJoined, OwPreconditionFailedError, type OwPreparedPhoto, type OwProposal, type OwProposalAccepted, type OwProposalConflict, type OwProposalList, type OwProposalQuery, type OwProposalState, type OwProposeInput, type OwProposed, OwProposedError, type OwReadWorldFile, type OwReadWorldFileOptions, type OwRemovalTicket, type OwRemovedImage, type OwRenderOptions, type OwResyncReason, type OwSeat, type OwSeatCreated, type OwSignInBegin, type OwSignInBegun, type OwSignInComplete, OwSignInError, type OwSignInReason, type OwSignInResult, type OwSignInStorage, type OwSignedIn, type OwSortAddToRow, type OwSortAnswer, type OwSortAskRow, type OwSortLinkRow, type OwSortMakeRow, type OwSortNote, type OwSortRef, type OwSortRow, OwStaleProposalError, type OwUploadedFile, type OwUploadedImage, OwV2Client, type OwWordPair, type OwWorldFileEntry, OwWorldFileError, type OwWorldFileReason, type OwWorldFileRow, type OwWorldFiles, type OwWorldIndex, type OwWorldLink, type OwWorldMeta, type OwWorldOrigin, type OwWorldProducer, type OwWorldProposalQuery, type OwWorldPublicPage, type OwWorldSource, type OwWriteDoor, type OwWriteWorldFileOptions, PHOTO_MAX_BYTES, PHOTO_TYPES, PUBLIC_FIELDS, type ParseError, type ParseOptions, type ParseResult, ROOM_PAIRS, type RevokeAllSessionsResponse, type RevokeSessionResponse, SPATIAL_TYPES, type SectionInfo, type StepBreakdown, type TokenConsumeParams, type TokenConsumeResponse, TokenResource, type TokenStatus, type TokenTransport, WORLD_FILE_MAX_BYTES, WORLD_FILE_MAX_ENTRIES, WORLD_FILE_MEDIA_TYPE, type WorldCalendar, absYearForEraYear, absoluteYear, approxYearLength, base64url, breakdownStep, buildAskContext, buildWorldIndex, detectKeyKind, displayYear, elementColor, eraForStep, errorFromResponse, familyOf, fieldLabel, fileKindOf, floorDiv, floorMod, formatDuration, formatMidLabel, formatStep, formatYearLabel, getElementIcon, getElementLabel, isAgentDoor, isDemoKey, isKnownOf, isLeapYear, isParseError, isRoomElement, kindCanWrite, lookupWorld, monthStartSteps, parseDate, parseErrorEnvelope, pinExpectation, pkceChallenge, planPhoto, preparePhoto, readCalendarConfig, readCalendarValue, readWorldFile, renderElement, resolveCalendarLens, resolveEraDomains, simpleCaseFold, typeWord, validateCalendarConfig, weekdayForStep, worldCalendars, writeWorldFile, yearLength, yearStartStep };
5431
+ export { AGENT_DOORS, ASK_LIMITS, type AccessKeyResponse, CALENDAR_FIELD, CALENDAR_SUPERTYPE, type CalendarConfig, type CalendarEra, type CalendarIntercalary, type CalendarMonths, type CalendarWeek, ELEMENT_FAMILIES, ELEMENT_ICONS, ELEMENT_LABELS, ELEMENT_SECTIONS, ELEMENT_TYPES, type ElementFamily, type ElementType, type EncryptionInfo, type EraDomain, FAMILY_COLORS, FAMILY_ORDER, FIELD_ACRONYMS, FIELD_SCHEMA, FILE_EXTENSIONS, type FieldInfo, type FieldType, GameTier, type ListParams, ONLYWORLDS_VERSION, type OwAccountWorld, type OwAgentJoined, type OwAllowance, OwApiError, type OwAskAnswer, type OwAskContext, type OwAuthErrorCode, type OwBulkItem, type OwBulkItemResult, type OwBulkResponse, type OwCalendarElement, type OwChange, type OwChangeDelete, type OwChangeUpsert, type OwChangesPage, type OwClientConfig, type OwCreateAccountWorldInput, type OwCreatedAccountWorld, type OwCreatedWorldLink, type OwDeleteReason, type OwDraught, type OwDraughtComponent, type OwDraughtItem, type OwDraughtPolicy, type OwElement, type OwElementBase, type OwErrorBody, type OwFileAddedBy, type OwFileDownload, type OwFileKind, type OwFileRow, type OwFileTicket, type OwFrontDoor, type OwHiddenRow, type OwJoinPreview, type OwJoined, type OwJoinedMembership, type OwKeyKind, type OwLinkEdit, type OwLookupElement, type OwLookupHit, type OwLookupLink, type OwLookupOptions, type OwLookupReason, type OwMe, type OwMediaTicket, type OwMember, type OwMemberRole, type OwMintedKey, type OwNamesMap, OwNetworkError, type OwPage, type OwPhotoOptions, type OwPhotoPlan, type OwPlayerJoined, OwPreconditionFailedError, type OwPreparedPhoto, type OwProposal, type OwProposalAccepted, type OwProposalConflict, type OwProposalList, type OwProposalQuery, type OwProposalState, type OwProposeInput, type OwProposed, OwProposedError, type OwProposedNewElement, type OwReadWorldFile, type OwReadWorldFileOptions, type OwRemovalTicket, type OwRemovedImage, type OwRenderOptions, type OwResyncReason, type OwReviewInput, type OwReviewed, type OwSeat, type OwSeatCreated, type OwSignInBegin, type OwSignInBegun, type OwSignInComplete, OwSignInError, type OwSignInReason, type OwSignInResult, type OwSignInStorage, type OwSignedIn, type OwSortAddToRow, type OwSortAnswer, type OwSortAskRow, type OwSortLinkRow, type OwSortMakeRow, type OwSortNote, type OwSortRef, type OwSortRow, OwStaleProposalError, type OwUploadedFile, type OwUploadedImage, OwV2Client, type OwWordPair, type OwWorldFileEntry, OwWorldFileError, type OwWorldFileReason, type OwWorldFileRow, type OwWorldFiles, type OwWorldIndex, type OwWorldLink, type OwWorldMeta, type OwWorldOrigin, type OwWorldProducer, type OwWorldProposalList, type OwWorldProposalQuery, type OwWorldProposalRow, type OwWorldPublicPage, type OwWorldSource, type OwWriteDoor, type OwWriteWorldFileOptions, PHOTO_MAX_BYTES, PHOTO_TYPES, PUBLIC_FIELDS, type ParseError, type ParseOptions, type ParseResult, ROOM_PAIRS, type RevokeAllSessionsResponse, type RevokeSessionResponse, SPATIAL_TYPES, type SectionInfo, type StepBreakdown, type TokenConsumeParams, type TokenConsumeResponse, TokenResource, type TokenStatus, type TokenTransport, WORLD_FILE_MAX_BYTES, WORLD_FILE_MAX_ENTRIES, WORLD_FILE_MEDIA_TYPE, type WorldCalendar, absYearForEraYear, absoluteYear, approxYearLength, base64url, breakdownStep, buildAskContext, buildWorldIndex, detectKeyKind, displayYear, elementColor, eraForStep, errorFromResponse, familyOf, fieldLabel, fileKindOf, floorDiv, floorMod, formatDuration, formatMidLabel, formatStep, formatYearLabel, getElementIcon, getElementLabel, isAgentDoor, isDemoKey, isKnownOf, isLeapYear, isParseError, isRoomElement, kindCanWrite, lookupWorld, monthStartSteps, parseDate, parseErrorEnvelope, pinExpectation, pkceChallenge, planPhoto, preparePhoto, readCalendarConfig, readCalendarValue, readWorldFile, renderElement, resolveCalendarLens, resolveEraDomains, simpleCaseFold, typeWord, validateCalendarConfig, weekdayForStep, worldCalendars, writeWorldFile, yearLength, yearStartStep };
package/dist/index.js CHANGED
@@ -308,7 +308,8 @@ var OwApiError = class extends Error {
308
308
  /**
309
309
  * While the world takes agent seats' writes as proposals (keel #519), an agent seat's key tried
310
310
  * what it may not: delete an element it did not create, or accept or decline a proposal (403
311
- * `proposed_only`). Retrying will not help; a person decides.
311
+ * `proposed_only`). On any world, reviewNewElement by the member the mark names is the same 403
312
+ * (keel #565). Retrying will not help; a person decides.
312
313
  */
313
314
  get isProposedOnly() {
314
315
  return this.status === 403 && this.code === "proposed_only";
@@ -320,6 +321,13 @@ var OwApiError = class extends Error {
320
321
  get isOwnProposal() {
321
322
  return this.status === 403 && this.code === "own_proposal";
322
323
  }
324
+ /**
325
+ * reviewNewElement on an element that carries no `x_review_proposed` mark (422 `not_proposed`,
326
+ * keel #565): nothing to settle. Someone settled it already, or it was never written as proposed.
327
+ */
328
+ get isNotProposed() {
329
+ return this.status === 422 && this.code === "not_proposed";
330
+ }
323
331
  };
324
332
  var OwPreconditionFailedError = class extends OwApiError {
325
333
  constructor(status, code, message, docUrl, detail, type = null, param = null, retryAfter = null) {
@@ -687,11 +695,14 @@ var OwV2Client = class {
687
695
  * recorded world holds it, in one read: her element, what she holds and sits in, her open work,
688
696
  * how she works, the Events she was in, the Narratives she knows, everything else that names
689
697
  * her, her sheet, what changed around her (`since`), and who plays whom; the world's name and
690
- * calendar beside. Every body is the list route's for the same reader, with `via`, `her_links`
698
+ * calendar beside; the room's messages (`messages`), its other elements (`room`, keel #556) and
699
+ * elements written as proposed (`proposed`, keel #580) only when `components` names them. Each
700
+ * row carries the list route's body for the same reader as `element`, beside `via`, `her_links`
691
701
  * and `grade`; nothing is inferred. The owner's keys, co-builders and contributors for any
692
702
  * Character they can see; a player seat or a guest for its own Character only (another id is
693
703
  * 404). `asOf` is a filter on the elements' own dates, not time travel. A `cut` that is not
694
- * empty means the serving is partial. Served `Cache-Control: private, no-store`.
704
+ * empty means the serving is partial (`cut.proposed` also counts proposed elements left out because
705
+ * the component was not named). Served `Cache-Control: private, no-store`.
695
706
  */
696
707
  async draught(characterId, policy = {}) {
697
708
  only("draught", policy, ["components", "mode", "asOf", "undated", "since", "budget", "depth"]);
@@ -1571,9 +1582,14 @@ var OwV2Client = class {
1571
1582
  return this.request("GET", proposalsPath(type, id), { query });
1572
1583
  }
1573
1584
  /**
1574
- * GET /world/proposals -- the world's queue, newest first: every proposal for the owner's and a
1575
- * co-builder's keys, a member's own for any other. The query is listProposals', plus `element`
1576
- * (one element's rows, by id). Any member key, a read key included; a read key with no member
1585
+ * GET /world/proposals -- the world's queue, newest first by created_at, two kinds of row told
1586
+ * apart by `kind` (keel #565): `proposal`, a proposed change to an element (OwProposal), and
1587
+ * `new_element`, an element written as proposed, carrying `x_review_proposed`
1588
+ * (OwProposedNewElement: settle it with reviewNewElement). A marked element is listed under
1589
+ * `open`, `lapsed` and `all`, never `accepted` or `declined`; keel reads at most the 500 newest.
1590
+ * Every row for the owner's and a co-builder's keys, a member's own for any other. The query is
1591
+ * listProposals', plus `element` (one element's rows, by id). The cursor is opaque: pass
1592
+ * `next_cursor` back as it came. Any member key, a read key included; a read key with no member
1577
1593
  * (a demo key, the owner's read key) and the keyless public view get a 404.
1578
1594
  */
1579
1595
  async worldProposals(opts = {}) {
@@ -1620,6 +1636,27 @@ var OwV2Client = class {
1620
1636
  async withdrawProposal(type, id, pid) {
1621
1637
  await this.request("DELETE", `${proposalsPath(type, id)}/${encodeURIComponent(pid)}`, { allowEmpty: true });
1622
1638
  }
1639
+ /**
1640
+ * POST /{type}/{id}/review -- settle a new element written as proposed, one carrying
1641
+ * `x_review_proposed` (the queue's `new_element` row, keel #565). The owner's key or a
1642
+ * co-builder's, with its PIN. `{ decision: 'accept' }` clears the mark (a write by you: a new
1643
+ * change_seq, one /changes row) and answers `{ element }`; `{ decision: 'decline', reason? }`
1644
+ * deletes the element (a tombstone, the links to it scrubbed, its open proposals dropped) and
1645
+ * answers `{ deleted }`, its id; the reason is answered back and kept nowhere. Refusals: 422
1646
+ * `not_proposed` (`err.isNotProposed`: the element carries no mark), 403 `proposed_only`
1647
+ * (`err.isProposedOnly`: the seat the mark names, or an agent seat under the world's switch), 403
1648
+ * for any key but a keeper's. A proposed change to an existing element is decided with
1649
+ * acceptProposal or declineProposal instead.
1650
+ */
1651
+ async reviewNewElement(type, id, opts) {
1652
+ only("reviewNewElement", opts, ["decision", "reason"], "The review is { decision, reason? }.");
1653
+ if (opts?.decision !== "accept" && opts?.decision !== "decline") {
1654
+ throw new TypeError(`reviewNewElement: decision must be 'accept' or 'decline', got ${JSON.stringify(opts?.decision) ?? String(opts?.decision)}. Nothing was sent.`);
1655
+ }
1656
+ const body = { decision: opts.decision };
1657
+ if (opts.reason !== void 0) body.reason = opts.reason;
1658
+ return this.request("POST", `/${type}/${encodeURIComponent(id)}/review`, { elementWrite: true, body });
1659
+ }
1623
1660
  // -- The account's worlds and keys (account token) -----------------------
1624
1661
  /**
1625
1662
  * GET /account/worlds -- every world the account owns or is a member of, with its keys by
@@ -1632,6 +1669,36 @@ var OwV2Client = class {
1632
1669
  const page = await this.request("GET", "/account/worlds");
1633
1670
  return page.data;
1634
1671
  }
1672
+ /**
1673
+ * POST /account/worlds -- make a world on the account, with its one write key. `name` is required
1674
+ * (1 to 255 characters, not blank; keel trims it). `pin` only while the account has no PIN (4
1675
+ * digits, 1000-9999): it becomes the account PIN and the write wall on every world of the
1676
+ * account. An account with a PIN must leave it out. Either mistake is a 422 with `param: 'pin'`
1677
+ * (`err.param`) and nothing made, so a tool that cannot tell which account it holds sends without
1678
+ * `pin` first and, on that 422, again with it. `keyName` names the write key as the website's key
1679
+ * list shows it (1 to 80 characters, trimmed; null or left out: no name). `source` and `producer`
1680
+ * are the folder format's provenance lines (spec 4.2), each an object or null, from a tool that
1681
+ * makes the world from a folder: kept on the World as given, served by getWorld() as `origin`.
1682
+ * Only the keys given are sent, `keyName` as `key_name`. 201: the world's row, as
1683
+ * listAccountWorlds lists it, with the full write key once in `key`. Account token only; no
1684
+ * Idempotency-Key (keel's document declares none): if the answer is lost, the world is in
1685
+ * listAccountWorlds, and mintWorldKey gives it a key.
1686
+ */
1687
+ async createAccountWorld(opts) {
1688
+ only("createAccountWorld", opts, ["name", "pin", "keyName", "source", "producer"]);
1689
+ if (this.keyKind !== "account") {
1690
+ throw new TypeError("createAccountWorld needs an account token (ow_a_)");
1691
+ }
1692
+ if (typeof opts?.name !== "string") {
1693
+ throw new TypeError("createAccountWorld: name is required, the world's name as a string. Nothing was sent.");
1694
+ }
1695
+ const body = { name: opts.name };
1696
+ if (opts.pin !== void 0) body.pin = opts.pin;
1697
+ if (opts.keyName !== void 0) body.key_name = opts.keyName;
1698
+ if (opts.source !== void 0) body.source = opts.source;
1699
+ if (opts.producer !== void 0) body.producer = opts.producer;
1700
+ return this.request("POST", "/account/worlds", { body });
1701
+ }
1635
1702
  /**
1636
1703
  * POST /account/worlds/{id}/keys -- mint a world key, `scope` `'write'` (the default) or
1637
1704
  * `'read'`, `name` as the key list shows it (at most 255 characters). The full key comes back
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlyworlds/sdk",
3
- "version": "4.65.0",
3
+ "version": "4.67.0",
4
4
  "description": "TypeScript SDK for the OnlyWorlds API - build world-building applications with type safety",
5
5
  "type": "module",
6
6
  "exports": {