@onlyworlds/sdk 4.44.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,12 @@ 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
+
8
14
  ## [4.44.0] - 2026-10-22
9
15
 
10
16
  ### 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;
@@ -3427,6 +3460,32 @@ declare class OwV2Client {
3427
3460
  * goes with it, any other stays. Needs the client's `ow_a_` token.
3428
3461
  */
3429
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>;
3430
3489
  /**
3431
3490
  * POST /account/ask -- a question about a world the account owns or is in, answered by
3432
3491
  * keel's AI proxy from `context` only (build it with buildAskContext from the elements
@@ -4469,4 +4528,4 @@ declare class TokenResource {
4469
4528
  getEncryptionInfo(): Promise<EncryptionInfo>;
4470
4529
  }
4471
4530
 
4472
- 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
@@ -1134,6 +1134,49 @@ var OwV2Client = class {
1134
1134
  }
1135
1135
  await this.request("DELETE", `/account/worlds/${encodeURIComponent(worldId)}/seats/${encodeURIComponent(seatId)}`);
1136
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
+ }
1137
1180
  // -- Ask your world (keel #159) -------------------------------------------
1138
1181
  /**
1139
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.44.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": {