@onlyworlds/sdk 4.43.0 → 4.45.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.45.0] - 2026-10-22
9
+
10
+ ### Added
11
+ - `hide(type, id)` and `unhide(type, id)`: the hidden mark's writes, `PUT` and `DELETE /{type}/{id}/hidden` (keel #421), for the parlor (Temper, h66 #9720). 204; the element's body and `change_seq` do not move.
12
+ - `listAccountWorlds()` (`GET /account/worlds`, `OwAccountWorld[]`: owned and shared worlds with their keys by name and last four) and `mintWorldKey(worldId, { scope, name })` (`POST /account/worlds/{id}/keys`, `OwMintedKey` with the full key once), the two account routes Atlas and the parlor hand-rolled. Account token only.
13
+
14
+ ## [4.44.0] - 2026-10-22
15
+
16
+ ### Added
17
+ - `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`.
18
+
8
19
  ## [4.43.0] - 2026-10-22
9
20
 
10
21
  ### Added
package/dist/index.d.ts CHANGED
@@ -2426,6 +2426,39 @@ interface OwSignedIn {
2426
2426
  last4: string;
2427
2427
  }
2428
2428
  /** One live agent seat, as GET /account/worlds/{id}/seats lists it (keel #355, D106). No key or secret. */
2429
+ /**
2430
+ * One world of the account, from GET /account/worlds: owned (`role: 'owner'`) or shared
2431
+ * (`'collaborator'`, with `member_role` the membership's role). Keys by name and last four only,
2432
+ * never the key; on a shared world only the member's own keys (keel H8).
2433
+ */
2434
+ interface OwAccountWorld {
2435
+ id: string;
2436
+ name: string;
2437
+ role: 'owner' | 'collaborator';
2438
+ member_role?: OwMemberRole;
2439
+ public_read: boolean;
2440
+ keys: Array<{
2441
+ name: string;
2442
+ last4: string;
2443
+ scope: 'READ' | 'WRITE';
2444
+ revoked: boolean;
2445
+ }>;
2446
+ }
2447
+ /**
2448
+ * A world key as minted by POST /account/worlds/{id}/keys: the row the account's key list shows,
2449
+ * plus the full key once in `key` (never shown again). A member's key carries its `member` label
2450
+ * (keel D72); an owner's row has no such field.
2451
+ */
2452
+ interface OwMintedKey {
2453
+ id: string;
2454
+ name: string;
2455
+ last4: string;
2456
+ scope: 'READ' | 'WRITE';
2457
+ last_used_at: string | null;
2458
+ revoked: boolean;
2459
+ key: string;
2460
+ member?: Record<string, unknown>;
2461
+ }
2429
2462
  interface OwSeat {
2430
2463
  /** The seat's membership id: removeSeat takes it, and GET /members names the seat by it. */
2431
2464
  id: string;
@@ -3075,10 +3108,17 @@ declare class OwV2Client {
3075
3108
  * Citizenship: heaviest route on the platform; default page size is polite.
3076
3109
  * keel sends the cursor of a page at the head as a number (an empty page, for a key
3077
3110
  * whose cursor carries no epoch); it is handed back as a string, like every cursor here.
3111
+ * `after` (keel #514, D142): only the changes made at or after an ISO 8601 time (`updated_at` of an
3112
+ * upsert, `deleted_at` of a delete; no offset means UTC). A filter, not a position: the order,
3113
+ * `cursor`, `has_more` and `head` are as without it, so to read the whole window pass the cursor
3114
+ * back as `since` with the same `after` until `has_more` is false (`changesAll` does). "Since
3115
+ * yesterday" by the clock; a kept cursor is still the exact "since my last visit". Anything
3116
+ * that is not a date and time is a 422 naming `after`.
3078
3117
  */
3079
3118
  changes(opts?: {
3080
3119
  since?: string;
3081
3120
  limit?: number;
3121
+ after?: string;
3082
3122
  }): Promise<OwChangesPage>;
3083
3123
  /**
3084
3124
  * GET /changes?head=true -- where the feed is now, without a page: no element is read.
@@ -3105,7 +3145,9 @@ declare class OwV2Client {
3105
3145
  * return value; persist it for the next incremental pull (with the last page's
3106
3146
  * `head` and `epoch`: the view epoch the walk ran under, for a guest or a contributor).
3107
3147
  */
3108
- changesAll(since?: string): AsyncGenerator<OwChange, {
3148
+ changesAll(since?: string, opts?: {
3149
+ after?: string;
3150
+ }): AsyncGenerator<OwChange, {
3109
3151
  cursor: string;
3110
3152
  head: number;
3111
3153
  epoch: number | null;
@@ -3418,6 +3460,32 @@ declare class OwV2Client {
3418
3460
  * goes with it, any other stays. Needs the client's `ow_a_` token.
3419
3461
  */
3420
3462
  removeSeat(worldId: string, seatId: string): Promise<void>;
3463
+ /**
3464
+ * PUT /{type}/{id}/hidden -- hide an element (keel #421). The owner's key or a co-builder's
3465
+ * (a person's or a seat's) with its PIN; hiding a hidden element again changes nothing, and
3466
+ * the element's body and `change_seq` do not move. Hidden, it is seen only by the owner, the
3467
+ * co-builders and the member who created it; to every other key it is a 404, left out of
3468
+ * lists, search, counts and the link arrays that name it. 204, no body. No Idempotency-Key.
3469
+ */
3470
+ hide(type: ElementType | string, id: string): Promise<void>;
3471
+ /** DELETE /{type}/{id}/hidden -- clear the mark; an element that is not hidden stays as it is. 204. */
3472
+ unhide(type: ElementType | string, id: string): Promise<void>;
3473
+ /**
3474
+ * GET /account/worlds -- every world the account owns or is a member of, with its keys by
3475
+ * name and last four (a member sees only their own keys on a shared world). Account token only.
3476
+ */
3477
+ listAccountWorlds(): Promise<OwAccountWorld[]>;
3478
+ /**
3479
+ * POST /account/worlds/{id}/keys -- mint a world key, `scope` `'write'` (the default) or
3480
+ * `'read'`, `name` as the key list shows it (at most 255 characters). The full key comes back
3481
+ * once in `key`. The owner mints a world key; a member mints their own member key, 409
3482
+ * `pin_required` (`err.isPinRequired`) for a write key while the account has no PIN. Account
3483
+ * token only; no Idempotency-Key.
3484
+ */
3485
+ mintWorldKey(worldId: string, opts?: {
3486
+ scope?: 'read' | 'write';
3487
+ name?: string;
3488
+ }): Promise<OwMintedKey>;
3421
3489
  /**
3422
3490
  * POST /account/ask -- a question about a world the account owns or is in, answered by
3423
3491
  * keel's AI proxy from `context` only (build it with buildAskContext from the elements
@@ -4460,4 +4528,4 @@ declare class TokenResource {
4460
4528
  getEncryptionInfo(): Promise<EncryptionInfo>;
4461
4529
  }
4462
4530
 
4463
- 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 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 OwElement, type OwElementBase, type OwErrorBody, type OwFileAddedBy, type OwFileDownload, type OwFileKind, type OwFileRow, type OwFileTicket, 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, OwNetworkError, type OwPage, type OwPhotoOptions, type OwPhotoPlan, type OwPlayerJoined, OwPreconditionFailedError, type OwPreparedPhoto, type OwReadWorldFile, type OwReadWorldFileOptions, type OwRemovalTicket, type OwRemovedImage, type OwRenderOptions, type OwResyncReason, type OwSeat, type OwSeatCreated, OwSignInError, type OwSignInReason, type OwSignedIn, type OwSortAddToRow, type OwSortAnswer, type OwSortAskRow, type OwSortLinkRow, type OwSortMakeRow, type OwSortNote, type OwSortRef, type OwSortRow, type OwUploadedFile, type OwUploadedImage, OwV2Client, type OwWorldFileEntry, OwWorldFileError, type OwWorldFileReason, type OwWorldFileRow, type OwWorldFiles, type OwWorldIndex, type OwWorldLink, type OwWorldMeta, type OwWriteDoor, PHOTO_MAX_BYTES, PHOTO_TYPES, PUBLIC_FIELDS, type ParseError, type ParseOptions, type ParseResult, 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, type WorldCalendar, absYearForEraYear, absoluteYear, approxYearLength, breakdownStep, buildAskContext, buildWorldIndex, detectKeyKind, displayYear, elementColor, eraForStep, errorFromResponse, familyOf, fieldLabel, fileKindOf, floorDiv, floorMod, formatDuration, formatMidLabel, formatStep, formatYearLabel, getElementIcon, getElementLabel, isAgentDoor, isDemoKey, isKnownOf, isLeapYear, isParseError, kindCanWrite, lookupWorld, monthStartSteps, parseDate, parseErrorEnvelope, pinExpectation, planPhoto, preparePhoto, readCalendarConfig, readCalendarValue, readWorldFile, renderElement, resolveCalendarLens, resolveEraDomains, validateCalendarConfig, weekdayForStep, worldCalendars, writeWorldFile, yearLength, yearStartStep };
4531
+ 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 OwElement, type OwElementBase, type OwErrorBody, type OwFileAddedBy, type OwFileDownload, type OwFileKind, type OwFileRow, type OwFileTicket, 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, OwNetworkError, type OwPage, type OwPhotoOptions, type OwPhotoPlan, type OwPlayerJoined, OwPreconditionFailedError, type OwPreparedPhoto, type OwReadWorldFile, type OwReadWorldFileOptions, type OwRemovalTicket, type OwRemovedImage, type OwRenderOptions, type OwResyncReason, type OwSeat, type OwSeatCreated, OwSignInError, type OwSignInReason, type OwSignedIn, type OwSortAddToRow, type OwSortAnswer, type OwSortAskRow, type OwSortLinkRow, type OwSortMakeRow, type OwSortNote, type OwSortRef, type OwSortRow, type OwUploadedFile, type OwUploadedImage, OwV2Client, type OwWorldFileEntry, OwWorldFileError, type OwWorldFileReason, type OwWorldFileRow, type OwWorldFiles, type OwWorldIndex, type OwWorldLink, type OwWorldMeta, type OwWriteDoor, PHOTO_MAX_BYTES, PHOTO_TYPES, PUBLIC_FIELDS, type ParseError, type ParseOptions, type ParseResult, 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, type WorldCalendar, absYearForEraYear, absoluteYear, approxYearLength, breakdownStep, buildAskContext, buildWorldIndex, detectKeyKind, displayYear, elementColor, eraForStep, errorFromResponse, familyOf, fieldLabel, fileKindOf, floorDiv, floorMod, formatDuration, formatMidLabel, formatStep, formatYearLabel, getElementIcon, getElementLabel, isAgentDoor, isDemoKey, isKnownOf, isLeapYear, isParseError, kindCanWrite, lookupWorld, monthStartSteps, parseDate, parseErrorEnvelope, pinExpectation, planPhoto, preparePhoto, readCalendarConfig, readCalendarValue, readWorldFile, renderElement, resolveCalendarLens, resolveEraDomains, validateCalendarConfig, weekdayForStep, worldCalendars, writeWorldFile, yearLength, yearStartStep };
package/dist/index.js CHANGED
@@ -558,9 +558,15 @@ var OwV2Client = class {
558
558
  * Citizenship: heaviest route on the platform; default page size is polite.
559
559
  * keel sends the cursor of a page at the head as a number (an empty page, for a key
560
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`.
561
567
  */
562
568
  async changes(opts = {}) {
563
- 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 });
564
570
  const page = await this.request("GET", "/changes/", { query });
565
571
  return { ...page, cursor: String(page.cursor) };
566
572
  }
@@ -589,11 +595,11 @@ var OwV2Client = class {
589
595
  * return value; persist it for the next incremental pull (with the last page's
590
596
  * `head` and `epoch`: the view epoch the walk ran under, for a guest or a contributor).
591
597
  */
592
- async *changesAll(since) {
598
+ async *changesAll(since, opts = {}) {
593
599
  let cursor = since;
594
600
  let page;
595
601
  do {
596
- page = await this.changes({ since: cursor });
602
+ page = await this.changes({ since: cursor, after: opts.after });
597
603
  for (const op of page.changes) yield op;
598
604
  cursor = page.cursor;
599
605
  } while (page.has_more);
@@ -1128,6 +1134,49 @@ var OwV2Client = class {
1128
1134
  }
1129
1135
  await this.request("DELETE", `/account/worlds/${encodeURIComponent(worldId)}/seats/${encodeURIComponent(seatId)}`);
1130
1136
  }
1137
+ // -- The hidden mark (keel #421) ------------------------------------------
1138
+ /**
1139
+ * PUT /{type}/{id}/hidden -- hide an element (keel #421). The owner's key or a co-builder's
1140
+ * (a person's or a seat's) with its PIN; hiding a hidden element again changes nothing, and
1141
+ * the element's body and `change_seq` do not move. Hidden, it is seen only by the owner, the
1142
+ * co-builders and the member who created it; to every other key it is a 404, left out of
1143
+ * lists, search, counts and the link arrays that name it. 204, no body. No Idempotency-Key.
1144
+ */
1145
+ async hide(type, id) {
1146
+ await this.request("PUT", `/${type}/${id}/hidden`, { write: true, body: {}, allowEmpty: true });
1147
+ }
1148
+ /** DELETE /{type}/{id}/hidden -- clear the mark; an element that is not hidden stays as it is. 204. */
1149
+ async unhide(type, id) {
1150
+ await this.request("DELETE", `/${type}/${id}/hidden`, { write: true, allowEmpty: true });
1151
+ }
1152
+ // -- The account's worlds and keys (account token) -----------------------
1153
+ /**
1154
+ * GET /account/worlds -- every world the account owns or is a member of, with its keys by
1155
+ * name and last four (a member sees only their own keys on a shared world). Account token only.
1156
+ */
1157
+ async listAccountWorlds() {
1158
+ if (this.keyKind !== "account") {
1159
+ throw new TypeError("listAccountWorlds needs an account token (ow_a_)");
1160
+ }
1161
+ const page = await this.request("GET", "/account/worlds");
1162
+ return page.data;
1163
+ }
1164
+ /**
1165
+ * POST /account/worlds/{id}/keys -- mint a world key, `scope` `'write'` (the default) or
1166
+ * `'read'`, `name` as the key list shows it (at most 255 characters). The full key comes back
1167
+ * once in `key`. The owner mints a world key; a member mints their own member key, 409
1168
+ * `pin_required` (`err.isPinRequired`) for a write key while the account has no PIN. Account
1169
+ * token only; no Idempotency-Key.
1170
+ */
1171
+ async mintWorldKey(worldId, opts = {}) {
1172
+ if (this.keyKind !== "account") {
1173
+ throw new TypeError("mintWorldKey needs an account token (ow_a_)");
1174
+ }
1175
+ const body = {};
1176
+ if (opts.scope !== void 0) body.scope = opts.scope;
1177
+ if (opts.name !== void 0) body.name = opts.name;
1178
+ return this.request("POST", `/account/worlds/${encodeURIComponent(worldId)}/keys`, { write: true, body });
1179
+ }
1131
1180
  // -- Ask your world (keel #159) -------------------------------------------
1132
1181
  /**
1133
1182
  * POST /account/ask -- a question about a world the account owns or is in, answered by
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlyworlds/sdk",
3
- "version": "4.43.0",
3
+ "version": "4.45.0",
4
4
  "description": "TypeScript SDK for the OnlyWorlds API - build world-building applications with type safety",
5
5
  "type": "module",
6
6
  "exports": {