@onlyworlds/sdk 4.42.3 → 4.43.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 CHANGED
@@ -5,6 +5,17 @@ earlier history lives in git log only.
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [4.43.0] - 2026-10-22
9
+
10
+ ### Added
11
+ - `adopt(type, id, member)`: change who made an element, `POST /{type}/{id}/adopt` with `{member}` (keel #427, D141, live 2026-10-22 00:43). `member` is a membership id of the world or `'owner'` (`created_by` null). The owner's key or a co-builder's with its PIN; a contributor's is 403 `not_author` (`isNotAuthor`). Returns the updated element; the write takes a new `change_seq` and the feed carries the element with its new `created_by`.
12
+ - `createWorldLink`'s `maxUses` is documented for person links too (keel #390, D140, live the same hour): 2 to 50 lets in that many accounts, each joining once with the link's role. The client sent it already; the comment said player links only.
13
+
14
+ ## [4.42.4] - 2026-10-21
15
+
16
+ ### Fixed
17
+ - **`parseDate` refuses a date the typed era does not hold**, rather than reading its number as an absolute year in another era. With a down era Before Gate turning on 6 Frost, "10 Thaw, 1 BG" read as step 39 ("10 Thaw, 2 AG") and "3 Frost, 0 BG" as "3 Frost, 1 BG"; both now answer `not a date in Before Gate`. The absolute reading stays for a step in no era, where `formatStep` prints the absolute year. No date `formatStep` prints changes how it parses: 20,826 round trips over the profile fixture's calendars read the same before and after. Found by Temper in Atlas 1.67.1 (OW Council h58 #9304).
18
+
8
19
  ## [4.42.3] - 2026-10-21
9
20
 
10
21
  ### Fixed
package/dist/index.d.ts CHANGED
@@ -3028,6 +3028,19 @@ declare class OwV2Client {
3028
3028
  editLinks(type: ElementType | string, id: string, field: string, edit: OwLinkEdit, opts?: {
3029
3029
  ifMatch?: number;
3030
3030
  }): Promise<OwElement>;
3031
+ /**
3032
+ * POST /{type}/{id}/adopt with {member} -- change who made an element (keel #427, D141).
3033
+ * `member` is a membership id of this world (a person or an AI seat, as `members()` lists
3034
+ * them) or `'owner'`, which sets `created_by` to null. The world's owner key or a
3035
+ * co-builder's (a person's or a seat's) with its PIN; a contributor's is 403 `not_author`
3036
+ * (`err.isNotAuthor`), a member id the world lacks 404. Nothing else in the element changes,
3037
+ * but the write stamps `changed_by` and `changed_via` and takes a new `change_seq`, so the
3038
+ * feed carries the element with its new `created_by`. Returns the updated element. A
3039
+ * contributor only changes what it created, so this hands it an element someone else made,
3040
+ * or takes one back; when the element is hidden, or the member is a guest, the old and the
3041
+ * new maker may each get a `view` reset on the feed.
3042
+ */
3043
+ adopt(type: ElementType | string, id: string, member: string | 'owner'): Promise<OwElement>;
3031
3044
  /**
3032
3045
  * POST /bulk -- up to ~1000 items. Partial success by default (HTTP 200
3033
3046
  * always; inspect per-slot numeric `status` + top-level `errors` flag);
@@ -3332,8 +3345,11 @@ declare class OwV2Client {
3332
3345
  * whoever opens the link first reads as it, until removed. `preview` (person and player links,
3333
3346
  * keel #422) to false: true puts the world's id in the link's path, so a chat that unfurls it
3334
3347
  * shows the world's name and picture (the code stays after `#`); true on an agent link is
3335
- * 422, param `preview`. `maxUses` (player links only, keel #422 PR 2) to 1, a link for one:
3336
- * 2 to 50 makes a table, one link that seats that many players, each picking one of
3348
+ * 422, param `preview`. `maxUses` (person and player links; an agent link takes none) to 1, a
3349
+ * link for one. On a person link (keel #390, D140) 2 to 50 lets in that many accounts, each
3350
+ * joining once with the link's role, until every use is taken, it expires or it is revoked;
3351
+ * who already joined stays. On a player link (keel #422 PR 2) 2 to 50 makes a table, one
3352
+ * link that seats that many players, each picking one of
3337
3353
  * `characters` (Character ids of the world, in the order a pick screen shows them; a hidden
3338
3354
  * one is 422, param `characters`). `characters` empty or left out: each player names a fresh
3339
3355
  * Character after themselves. A table takes no `character`, not even `new` (422, param
package/dist/index.js CHANGED
@@ -491,6 +491,22 @@ var OwV2Client = class {
491
491
  async editLinks(type, id, field, edit, opts = {}) {
492
492
  return this.request("POST", `/${type}/${id}/links/${field}`, { write: true, body: edit, ifMatch: opts.ifMatch });
493
493
  }
494
+ /**
495
+ * POST /{type}/{id}/adopt with {member} -- change who made an element (keel #427, D141).
496
+ * `member` is a membership id of this world (a person or an AI seat, as `members()` lists
497
+ * them) or `'owner'`, which sets `created_by` to null. The world's owner key or a
498
+ * co-builder's (a person's or a seat's) with its PIN; a contributor's is 403 `not_author`
499
+ * (`err.isNotAuthor`), a member id the world lacks 404. Nothing else in the element changes,
500
+ * but the write stamps `changed_by` and `changed_via` and takes a new `change_seq`, so the
501
+ * feed carries the element with its new `created_by`. Returns the updated element. A
502
+ * contributor only changes what it created, so this hands it an element someone else made,
503
+ * or takes one back; when the element is hidden, or the member is a guest, the old and the
504
+ * new maker may each get a `view` reset on the feed.
505
+ */
506
+ async adopt(type, id, member) {
507
+ if (typeof member !== "string" || member === "") throw new TypeError('adopt: member must be a membership id or "owner"');
508
+ return this.request("POST", `/${type}/${id}/adopt`, { write: true, body: { member } });
509
+ }
494
510
  // -- Bulk ----------------------------------------------------------------
495
511
  /**
496
512
  * POST /bulk -- up to ~1000 items. Partial success by default (HTTP 200
@@ -1003,8 +1019,11 @@ var OwV2Client = class {
1003
1019
  * whoever opens the link first reads as it, until removed. `preview` (person and player links,
1004
1020
  * keel #422) to false: true puts the world's id in the link's path, so a chat that unfurls it
1005
1021
  * shows the world's name and picture (the code stays after `#`); true on an agent link is
1006
- * 422, param `preview`. `maxUses` (player links only, keel #422 PR 2) to 1, a link for one:
1007
- * 2 to 50 makes a table, one link that seats that many players, each picking one of
1022
+ * 422, param `preview`. `maxUses` (person and player links; an agent link takes none) to 1, a
1023
+ * link for one. On a person link (keel #390, D140) 2 to 50 lets in that many accounts, each
1024
+ * joining once with the link's role, until every use is taken, it expires or it is revoked;
1025
+ * who already joined stays. On a player link (keel #422 PR 2) 2 to 50 makes a table, one
1026
+ * link that seats that many players, each picking one of
1008
1027
  * `characters` (Character ids of the world, in the order a pick screen shows them; a hidden
1009
1028
  * one is 422, param `characters`). `characters` empty or left out: each player names a fresh
1010
1029
  * Character after themselves. A table takes no `character`, not even `new` (422, param
@@ -3348,7 +3367,11 @@ function parseDate(cfg, input, opts = {}) {
3348
3367
  const viaEra = resolveInYear(absYearForEraYear(cfg, target, year));
3349
3368
  if (isParseError(viaEra)) return viaEra;
3350
3369
  if (eraForStep(cfg, viaEra.step) === target) return viaEra;
3351
- return resolveInYear(year);
3370
+ const viaAbs = resolveInYear(year);
3371
+ if (era && !isParseError(viaAbs) && eraForStep(cfg, viaAbs.step) !== null) {
3372
+ return { error: `not a date in ${era.name}` };
3373
+ }
3374
+ return viaAbs;
3352
3375
  }
3353
3376
  function isParseError(r) {
3354
3377
  return r.error !== void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlyworlds/sdk",
3
- "version": "4.42.3",
3
+ "version": "4.43.0",
4
4
  "description": "TypeScript SDK for the OnlyWorlds API - build world-building applications with type safety",
5
5
  "type": "module",
6
6
  "exports": {