Skip to content

@onlyworlds/sdk 4.88.0

Choose a tag to compare

@github-actions github-actions released this 27 Oct 08:04
· 378 commits to main since this release

Added

  • world, a constructor option: an account token, or no key, reads the world it names. new OwV2Client({ apiKey: 'ow_a_…', world: id }) sends world=<id> (URL-encoded, beside the call's own parameters, on every page of listAll) with the Bearer and no API-Key or PIN on list, listAll, get and getWorld, and keel answers as that account's own access in the world: the owner reads it whole, a member as its member key reads, any other account as the public reads (a world not open to the public is a 404). new OwV2Client({ world: id }) with no key sends the same four reads with no credential at all, keel's public reader. The account calls (/account routes, sign-in, key and link management) work on the same client as before. Refused with a TypeError before anything is sent: world with a world key (ow_w_, ow_r_, a seat's key, a 10-digit key) or as anything but a non-empty string, at construction; on an account client, every call that needs a world key (element writes, hide, the change feed, the draught, files, images, proposals, me, members), which keel answered with a 401 before; on an account client without world, the four reads; and world inside a list or listAll filter, on any client. The rule sits in request(), read from the request: an /account route, or a GET marked worldRead (a new request() option, which adds world= on such a client). A client with no key and no world refuses as before, and its message now names the four reads.
  • signal on list, listAll, get and getWorld: an AbortSignal passed to fetch as given; on listAll it covers every page of the walk. A time limit per request goes in the client's own fetch.
  • counts on OwWorldMeta: a keyless world read's count of what the public reads, in all and per type ({ total, types }), absent with a key; patchWorld never sends it back.
  • isRateLimited and isServedTrimmedNotWritable on OwApiError: a 429 too_many_requests (over the request budget; wait retryAfter), told from a daily allowance's quota_exceeded; and a 422 served_trimmed_not_writable, a write that carried the mark keel serves on a body it trimmed for its reader. The mark is left in an echoed body on purpose: the refusal is the signal.
  • The message profile's serial 76 readers (schema-dist v0.33.0-dist.76). hasUnseenRecipients(message, { keyless }): true when the server left out recipients this reader may not see (x_served_trimmed names characters), never who or how many; null for a body read with no credential. editedBy(message, members) returns OwEdited, { edited, by }: whether a later hand changed the message (changed_by present and not equal to created_by) and that membership's Character, or null when it plays none, is off the members list or there is no list. NOTE_PAIR (generated from the dist), isNote(element) and noteOf(narratives, characterId, members): a Note is a member's own line, never a message, and noteOf gives the id of the Character's newest own-hand Note that is neither hidden (hidden: true) nor proposed (x_review_proposed an object), or null; on the wire only a verified sender's Note counts, in a folder its narrator is trusted.
  • OwElementBase declares x_served_trimmed?: string[], the mark the server sets on a message whose characters or narrator lost ids this reader may not see. It is served only, and a write that carries it is refused by name (422 served_trimmed_not_writable); the client leaves it in a body you hand back, unlike known_of, so that refusal is the signal and nothing is dropped silently.

Changed

  • Schema repinned to schema-dist v0.33.0-dist.76 (from dist.75; the same canonical 00.33.00, so ONLYWORLDS_VERSION stays '00.33.00' and no element field moved). Serial 76 changes only the message profile and its fixture (55 to 81 cases, all run as the message test).
  • An empty characters with x_served_trimmed naming characters is to someone the reader cannot see: isAddressedTo is false for every Character and isToEveryone false; a list that still holds ids beside the mark addresses those ids. isToEveryone(message, { keyless: true }) is never true, since a body served with no credential carries no mark. Passing anything but an options object (a bare true) or a keyless that is not a boolean is a TypeError, never read as false.
  • senderStatus answers unseen for a message with no narrator whose x_served_trimmed names narrator (show "from someone you cannot see", never "from nobody"); without the mark it stays unverifiable.
  • A Note is addressed to nobody on every reader: recipientsOf gives [], isAddressedTo, isToEveryone and hasUnseenRecipients (keyless or not) are false, unreadFor never lists one, and threadOf never includes one, though a chain of parent_narrative walks through it.
  • Order by created_at reads one rule, the same as the Python package's: an RFC 3339 date-time (YYYY-MM-DDTHH:MM:SS, an optional fraction, Z or an offset; T and Z in either case), or one with no zone, read as UTC; the date must exist, hours 00 to 23, minutes and seconds 00 to 59. Anything else (absent, null, 09:61, a word, a date alone, a space for the T, surrounding spaces) comes after every readable time, in the list's order. Before, Date.parse decided: a time with no zone was read in the machine's local time, and a date alone or other forms it accepts sorted as times. readMarkOf reads updated_at by the same rule.

Fixed

  • listAll stops when a page hands back the cursor it was sent with more to come, with an OwNetworkError, instead of reading the same page forever. What it yielded before stays with the caller.