@onlyworlds/sdk 4.42.4 → 4.44.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 +11 -0
- package/dist/index.d.ts +28 -3
- package/dist/index.js +30 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,17 @@ earlier history lives in git log only.
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [4.44.0] - 2026-10-22
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- `changes({ after })` and `changesAll(since, { after })`: keel #514 (PR 152, D142, live 2026-10-22 00:55), `GET /changes?after=<ISO time>` returns only the changes made at or after that time, a filter and not a position: order, `cursor`, `has_more` and `head` are unchanged, and the window is read by passing the cursor back as `since` with the same `after`. A bad value is a 422 naming `after`.
|
|
12
|
+
|
|
13
|
+
## [4.43.0] - 2026-10-22
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
- `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`.
|
|
17
|
+
- `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.
|
|
18
|
+
|
|
8
19
|
## [4.42.4] - 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);
|
|
@@ -3062,10 +3075,17 @@ declare class OwV2Client {
|
|
|
3062
3075
|
* Citizenship: heaviest route on the platform; default page size is polite.
|
|
3063
3076
|
* keel sends the cursor of a page at the head as a number (an empty page, for a key
|
|
3064
3077
|
* whose cursor carries no epoch); it is handed back as a string, like every cursor here.
|
|
3078
|
+
* `after` (keel #514, D142): only the changes made at or after an ISO 8601 time (`updated_at` of an
|
|
3079
|
+
* upsert, `deleted_at` of a delete; no offset means UTC). A filter, not a position: the order,
|
|
3080
|
+
* `cursor`, `has_more` and `head` are as without it, so to read the whole window pass the cursor
|
|
3081
|
+
* back as `since` with the same `after` until `has_more` is false (`changesAll` does). "Since
|
|
3082
|
+
* yesterday" by the clock; a kept cursor is still the exact "since my last visit". Anything
|
|
3083
|
+
* that is not a date and time is a 422 naming `after`.
|
|
3065
3084
|
*/
|
|
3066
3085
|
changes(opts?: {
|
|
3067
3086
|
since?: string;
|
|
3068
3087
|
limit?: number;
|
|
3088
|
+
after?: string;
|
|
3069
3089
|
}): Promise<OwChangesPage>;
|
|
3070
3090
|
/**
|
|
3071
3091
|
* GET /changes?head=true -- where the feed is now, without a page: no element is read.
|
|
@@ -3092,7 +3112,9 @@ declare class OwV2Client {
|
|
|
3092
3112
|
* return value; persist it for the next incremental pull (with the last page's
|
|
3093
3113
|
* `head` and `epoch`: the view epoch the walk ran under, for a guest or a contributor).
|
|
3094
3114
|
*/
|
|
3095
|
-
changesAll(since?: string
|
|
3115
|
+
changesAll(since?: string, opts?: {
|
|
3116
|
+
after?: string;
|
|
3117
|
+
}): AsyncGenerator<OwChange, {
|
|
3096
3118
|
cursor: string;
|
|
3097
3119
|
head: number;
|
|
3098
3120
|
epoch: number | null;
|
|
@@ -3332,8 +3354,11 @@ declare class OwV2Client {
|
|
|
3332
3354
|
* whoever opens the link first reads as it, until removed. `preview` (person and player links,
|
|
3333
3355
|
* keel #422) to false: true puts the world's id in the link's path, so a chat that unfurls it
|
|
3334
3356
|
* shows the world's name and picture (the code stays after `#`); true on an agent link is
|
|
3335
|
-
* 422, param `preview`. `maxUses` (player links
|
|
3336
|
-
*
|
|
3357
|
+
* 422, param `preview`. `maxUses` (person and player links; an agent link takes none) to 1, a
|
|
3358
|
+
* link for one. On a person link (keel #390, D140) 2 to 50 lets in that many accounts, each
|
|
3359
|
+
* joining once with the link's role, until every use is taken, it expires or it is revoked;
|
|
3360
|
+
* who already joined stays. On a player link (keel #422 PR 2) 2 to 50 makes a table, one
|
|
3361
|
+
* link that seats that many players, each picking one of
|
|
3337
3362
|
* `characters` (Character ids of the world, in the order a pick screen shows them; a hidden
|
|
3338
3363
|
* one is 422, param `characters`). `characters` empty or left out: each player names a fresh
|
|
3339
3364
|
* 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
|
|
@@ -542,9 +558,15 @@ var OwV2Client = class {
|
|
|
542
558
|
* Citizenship: heaviest route on the platform; default page size is polite.
|
|
543
559
|
* keel sends the cursor of a page at the head as a number (an empty page, for a key
|
|
544
560
|
* whose cursor carries no epoch); it is handed back as a string, like every cursor here.
|
|
561
|
+
* `after` (keel #514, D142): only the changes made at or after an ISO 8601 time (`updated_at` of an
|
|
562
|
+
* upsert, `deleted_at` of a delete; no offset means UTC). A filter, not a position: the order,
|
|
563
|
+
* `cursor`, `has_more` and `head` are as without it, so to read the whole window pass the cursor
|
|
564
|
+
* back as `since` with the same `after` until `has_more` is false (`changesAll` does). "Since
|
|
565
|
+
* yesterday" by the clock; a kept cursor is still the exact "since my last visit". Anything
|
|
566
|
+
* that is not a date and time is a 422 naming `after`.
|
|
545
567
|
*/
|
|
546
568
|
async changes(opts = {}) {
|
|
547
|
-
const query = buildQuery({ since: opts.since, limit: opts.limit ?? this.changesPageSize });
|
|
569
|
+
const query = buildQuery({ since: opts.since, limit: opts.limit ?? this.changesPageSize, after: opts.after });
|
|
548
570
|
const page = await this.request("GET", "/changes/", { query });
|
|
549
571
|
return { ...page, cursor: String(page.cursor) };
|
|
550
572
|
}
|
|
@@ -573,11 +595,11 @@ var OwV2Client = class {
|
|
|
573
595
|
* return value; persist it for the next incremental pull (with the last page's
|
|
574
596
|
* `head` and `epoch`: the view epoch the walk ran under, for a guest or a contributor).
|
|
575
597
|
*/
|
|
576
|
-
async *changesAll(since) {
|
|
598
|
+
async *changesAll(since, opts = {}) {
|
|
577
599
|
let cursor = since;
|
|
578
600
|
let page;
|
|
579
601
|
do {
|
|
580
|
-
page = await this.changes({ since: cursor });
|
|
602
|
+
page = await this.changes({ since: cursor, after: opts.after });
|
|
581
603
|
for (const op of page.changes) yield op;
|
|
582
604
|
cursor = page.cursor;
|
|
583
605
|
} while (page.has_more);
|
|
@@ -1003,8 +1025,11 @@ var OwV2Client = class {
|
|
|
1003
1025
|
* whoever opens the link first reads as it, until removed. `preview` (person and player links,
|
|
1004
1026
|
* keel #422) to false: true puts the world's id in the link's path, so a chat that unfurls it
|
|
1005
1027
|
* shows the world's name and picture (the code stays after `#`); true on an agent link is
|
|
1006
|
-
* 422, param `preview`. `maxUses` (player links
|
|
1007
|
-
*
|
|
1028
|
+
* 422, param `preview`. `maxUses` (person and player links; an agent link takes none) to 1, a
|
|
1029
|
+
* link for one. On a person link (keel #390, D140) 2 to 50 lets in that many accounts, each
|
|
1030
|
+
* joining once with the link's role, until every use is taken, it expires or it is revoked;
|
|
1031
|
+
* who already joined stays. On a player link (keel #422 PR 2) 2 to 50 makes a table, one
|
|
1032
|
+
* link that seats that many players, each picking one of
|
|
1008
1033
|
* `characters` (Character ids of the world, in the order a pick screen shows them; a hidden
|
|
1009
1034
|
* one is 422, param `characters`). `characters` empty or left out: each player names a fresh
|
|
1010
1035
|
* Character after themselves. A table takes no `character`, not even `new` (422, param
|