Skip to content

OnlyWorlds Unity SDK 0.27.0

Choose a tag to compare

@tmoosting tmoosting released this 31 Oct 04:07
· 263 commits to main since this release

Serials 97 to 100 in Unity, with the strand profile's reader (OWStrand.Of) and the strand on the front door
(OWReadingAids.Strand), and most of the TypeScript SDK's client calls that Unity never had: the roster, health,
upsert, adopt, the hidden mark, the member's own Character, typed get and list options, the account's worlds and
keys, invite links and seats, and images and files through a ticket and the upload host. A minor release because it
adds public API (below). A transport of your own must now send OWRequest.BodyBytes, or an upload goes out empty.

Added

  • OWReadingAids.Strand: the world's strand on the front door (serial 100), as keel serves it in reading_aids
    beside the Charter, the Guide and the Domains on GET /me (OWReadingAids.Of) and an agent's join answer
    (OWJoined.ReadingAids): an OWStrand read as served, each slot {id, name} or null and Same as served. Six null
    slots read as an empty strand (IsEmpty), the world having none or its story being out of the key's view; a packet
    with no strand (an older keel) reads Strand null. ToJson writes the packet back in the charter profile's
    order, the strand fourth, and only when it was served.
  • OWStrand.Of(world, elements, reader, open, hiddenIds): the strand profile's reader (serial 98), a world's strand
    as one reader sees it through the lens reader's own view: the story the World's x_strand names (Narrative), one
    of its events (Event), that event's place (Location), the story's protagonist (Character), where the hero is
    now (Now), and whether then and now are one place by id (Same). Each slot {id, name} or null, ToJson() the
    profile's six keys. A slot holds only its own kind, no slot is filled from another, a list's order is never read,
    and a story the reader knows only as a stub fills its own slot alone. Only the story's id is required (serial 99):
    the event and the place null or absent read as unset, a place with no event is an empty place, and any other value
    there (an empty string, a number, an object) is no mark, as is a story that is not a string. A multi-link that is
    not a list lists nothing; a nameless slot reads an empty string; the public rung reads only a world open to anyone.
    The fixture's cases pass by name, the same bytes as the TypeScript SDK's and the Python package's.
  • OWOpenerSurface.Online (default true; online in OWOpenerSurface.FromJson, refused by name when not a
    boolean): with no connection, every row whose href is a web address (http: or https:, in any case, read from the
    row's own filled href) says OWOpenerState.NeedsAConnection, "Needs a connection", the site's own row included,
    which had no word before. The words in order, the first that holds: "You are here", then "Needs a connection", then
    the account, browser and phone words, then "Opens the world". A row whose link opens an app on the device keeps its
    own word, and every row keeps its href. The shared fixture moves to 54 cases (sha256 5a9ebbc8…), the same bytes as
    the TypeScript SDK 4.118.0's and the Python package 0.96.0's.
  • OWClient.GetMembersAsync (GET /members): the world's roster, the rows a message reader takes as members
    (OWMessage.SenderStatus, ReadMarkOf), each row's id (null for the owner), kind, role, Character, status (removed
    rows stay), lenses and, where this key is served it, name. A world key reads its own world's, with no world and no
    PIN; an account token the world World names (world=<id>, its Bearer), refused before sending without World; a
    keyless client is refused, since the roster has no public reader. Mirrors the TypeScript SDK's members() (4.22.0;
    on an account token from 4.116.0).
  • OWClient.HealthAsync (GET /health): keel's liveness answer, as served. Sent with no credential on every client (no
    key, PIN or Bearer, and no world), so an account token and a keyless client call it too. Mirrors the TypeScript
    SDK's health() (3.0.0; on a keyless client from 4.30.0).
  • OWClient.UpsertAsync<T> (PUT /{type}/{id}/): creates the element under the caller's own id, or writes it whole.
    The body is cleaned as every element write's is (the read-only fields left out, a null scalar string sent as ""),
    sent with the PIN, X-OW-Client and, on an agent client, X-OW-Agent; a known-of stub is refused before sending,
    and an agent seat's PUT that became a proposal (202) throws OWProposedError. Mirrors the TypeScript SDK's
    upsert() (3.0.0).
  • OWClient.AdoptAsync<T> (POST /{type}/{id}/adopt {member}): changes who made an element, to a membership id of
    the world or owner (created_by null); returns the element as written. The owner's key or a co-builder's, with
    its PIN; an element write, so X-OW-Client goes with it and X-OW-Agent on an agent client. A null or empty member
    is refused before sending. Mirrors the TypeScript SDK's adopt() (4.43.0).
  • The hidden mark on the client: OWClient.HideAsync (PUT /{type}/{id}/hidden, {}) and UnhideAsync (DELETE
    /{type}/{id}/hidden), the owner's key or a co-builder's with its PIN, a 204; and ListHiddenAsync (GET
    /world/hidden), every hidden element newest first as OWHiddenRows (Type, Id, SetAt, SetBy, null when the
    owner hid it), a read of the owner's or a co-builder's key. keel's document declares no header on the hide or the
    unhide, so neither X-OW-Agent nor X-OW-Client goes there; the TypeScript SDK sends neither since 4.120.0.
    Mirrors the TypeScript SDK's hide(), unhide() (4.45.0) and listHidden() (4.48.0).
  • OWClient.SetMyCharacterAsync (PUT /me/character {character}): a person member picks the roster Character that is
    them in this world, or none (null, sent as null); answers GET /me's body. With the PIN, and without X-OW-Agent
    or X-OW-Client, which keel's document declares on neither (the TypeScript SDK sends neither since 4.120.0). An
    account token and a keyless client are refused before sending. Mirrors the TypeScript SDK's
    setMyCharacter() (4.50.0).
  • The account's worlds and their keys, on an account token: OWClient.ListAccountWorldsAsync (GET /account/worlds),
    every world the account owns or is a member of as OWAccountWorld rows (Role owner or collaborator,
    MemberRole on a collaborator's, PublicRead, the Keys by name and last four); MintWorldKeyAsync(worldId)
    (POST /account/worlds/{id}/keys), a key for the owner or bound to a member's own membership, answered once in full
    as OWMintedKey.Key beside its row (Id, Last4, Scope, Member, Kept); and
    RevokeWorldKeyAsync(worldId, keyId) (DELETE …/keys/{key_id}), a 204 that answers the same for a key already
    revoked. Each sends the Bearer alone, never a PIN or a write header, and any other key is refused before sending.
    The mint takes scope (read or write, r and w the same, in any case; a write key by default), name (as the
    key list shows it) and keep (kept across a sign-out), after ct, as keel's document declares its body: each sent
    only when given, as given; with none given no body is sent and keel mints a write key with no name, not kept (the
    TypeScript SDK sends {}, the same mint). A scope keel refuses, or a name past 80 characters once trimmed (keel's
    trim and count, Python's whitespace and code points), is an ArgumentException before sending.
    OWApiError.IsPinRequired (409 pin_required) reads a member's mint on an account with no PIN. Mirrors the
    TypeScript SDK's listAccountWorlds(), mintWorldKey() (4.45.0; without X-OW-Agent, as 4.120.0 sends it) and
    revokeWorldKey() (4.78.0).
  • OWClient.AcceptJoinAsync(code) (POST /account/join {code}): an account token accepts a person's invite link and
    becomes a member with the link's role, answered as OWJoinedMembership (Id, WorldId, WorldName, Role,
    JoinedAt, RosterCharacter). No PIN is needed to accept. A refusal leaves the code unspent: every bad code, and an
    agent's, is a 404 (IsNotFound), an account already in the world a 409 (OWApiError.IsAlreadyMember, new). Any
    other key, and a null or empty code, is refused before sending; a player's or an agent's code is still redeemed
    with no key through OWJoin.RedeemAsync. Mirrors the TypeScript SDK's acceptJoin() (4.12.0).
  • A world's invite links, for its owner on an account token: OWClient.CreateWorldLinkAsync(worldId, link) (POST
    /account/worlds/{id}/links) from an OWWorldLinkCreate (Reader person, agent or player, required; Role,
    Days, InviterName, WithCharacter, Character, Preview, MaxUses and a table's Characters, each sent
    only when given, in keel's spelling), answered as OWWorldLinkCreated with the code, the link and the line to
    send, shown this once; ListWorldLinksAsync(worldId), the links as OWWorldLink rows with no code (Status,
    Uses, a player link's Character, a table's MaxUses, Characters and IsTable); and
    RevokeWorldLinkAsync(worldId, linkId), a 204. The Bearer alone; any other key, a null link and a link with no
    reader are refused before sending. Mirrors the TypeScript SDK's createWorldLink(), listWorldLinks() and
    revokeWorldLink() (4.24.0).
  • Seats for your own AI, on an account token: OWClient.CreateSeatAsync(worldId, name, role, character) (POST
    /account/worlds/{id}/seats {name, role?, character?}, character new, none or mine) and
    RekeySeatAsync(worldId, seatId) (POST …/seats/{seat_id}/key, no body: the old key and secret stop at once), each
    answered as OWSeatCreated with the seat, its write key, its ow_s_ secret and the .env lines, shown this
    once; ListSeatsAsync(worldId), the live seats as OWSeat rows with no key (Name, Role, Character,
    Sponsor, JoinedAt, LastActive); and RemoveSeatAsync(worldId, seatId), a 204. The Bearer alone, no
    Idempotency-Key (keel takes none: a lost answer is mended with a rekey); any other key, and a seat with no name,
    is refused before sending. Mirrors the TypeScript SDK's createSeat(), listSeats(), removeSeat() (4.28.0) and
    rekeySeat() (4.29.0).
  • Images, in two steps: a ticket from keel, then one POST to the upload host the ticket names, with the ticket alone
    as its Bearer. OWClient.CreateMediaTicketAsync() (POST /media/ticket, no body) answers an OWMediaTicket
    (Ticket, UploadUrl, Prefix, MaxBytes, Exp, Uses, IssuedTo); UploadImageAsync(bytes, key, ticket) asks
    for one (or uses the one given) and POSTs the raw bytes to its UploadUrl with X-Key when a key is given,
    answering the host's OWUploadedImage (Url, the permanent public URL to set as image_url, Key, Bytes,
    Type, Etag). CreateRemovalTicketAsync(keyOrUrl) (POST /media/remove-ticket {key}, a whole image_url cut to
    its key) answers an OWRemovalTicket (Ticket, RemoveUrl, Exp, Key, Referenced), and
    RemoveImageAsync(keyOrUrl, ticket) spends one at its RemoveUrl, answering OWRemovedImage (Removed, Bytes,
    Cache). keel's requests go with the key and its PIN and no write header (keel's document lists none there); the
    host's carry the ticket and nothing of this client's: no key, PIN, Bearer token, write header or Content-Type.
    Bytes past the ticket's MaxBytes are a 413 too_large before any is sent; the host's refusals arrive as
    OWApiError with its code (ticket_used, exists, unsupported_type, not_removable, ...); a host that does not
    answer is an OWTransportError naming its host, never the ticket. A null image, an empty key and a ticket with no
    ticket or no absolute http(s) URL are refused before sending. Mirrors the TypeScript SDK's createMediaTicket(),
    uploadImage() (4.6.0), createRemovalTicket() and removeImage() (4.8.0).
  • Files on elements: OWClient.ListFilesAsync(type, id) (GET /{type}/{id}/files), the element's files newest first
    as OWFileRows (Id, Name, Kind, Size, Label, AddedBy with Name, Membership and Agent, AddedAt);
    WorldFilesAsync() (GET /world/files), every file the key may see as OWWorldFileRows (the row and its
    ElementType and ElementId) with the world's UsedBytes of CapBytes; CreateFileTicketAsync(type, id, name, size, kind, label) (POST /{type}/{id}/files {name, kind, size, label?}), an OWFileTicket (the image ticket's
    shape, with its Key, Kind and FileId); UploadFileAsync(type, id, bytes, name, kind, label, ticket, onProgress),
    the ticket (with the bytes' length as its size) and then the raw bytes to its UploadUrl with the ticket alone,
    answering the host's OWUploadedFile (Key, Fid, Bytes, Type, Etag); FileDownloadLinkAsync(type, id, fileId) (GET …/files/{file_id}/download), an OWFileDownload whose Url is the credential until Exp; and
    RemoveFileAsync(type, id, fileId) (DELETE …/files/{file_id}), a 204. The element's and the file's ids are
    escaped. The ticket carries the PIN, no Idempotency-Key (keel's rule) and no X-OW-Client, and on an agent client
    X-OW-Agent, the one files route keel's document lists it on; the other files routes and the upload host get no
    write header. The kind is read from the name as keel reads it (OWFileKinds.Of, over OWFileKinds.Extensions:
    .yml is yaml, .markdown md, case and folders ignored), and a name keel takes no file with, or none, is an
    ArgumentException naming the extensions, before sending. onProgress is called once, with the total, when the
    host has stored the file. OWApiError.IsFileTooLarge (413 file_too_large), IsFilesFull (403 files_full) and
    IsQuotaExceeded (429 quota_exceeded) are new. Mirrors the TypeScript SDK's listFiles(), worldFiles(),
    createFileTicket(), uploadFile(), fileDownloadLink() and removeFile() (4.32.0; X-OW-Agent on the ticket
    from 4.33.1), and its FILE_EXTENSIONS and fileKindOf (4.33.0).

Changed

  • OWRequest.BodyBytes: a request may carry raw bytes instead of a JSON Body, set only on an upload to the media
    host. UnityWebRequestTransport sends them as the body; a transport of your own must too, or an upload goes out
    empty. The JSON path is unchanged.
  • An error answer whose error is a string ({"error": "ticket_used"}, the upload host's shape) reads the string as
    OWApiError.Code, as the TypeScript SDK's parseErrorEnvelope does; keel's envelope reads as before.
  • Schema pin to v0.33.0-dist.100: the strand on the front door. The strand profile's rule 2 says the server's front
    door (GET /me and an agent's join reply) serves reading_aids.strand, the six slots of the strand as that key
    reads the world, six null slots when the world has none or its story is out of the key's view; the charter
    profile's rule 2 orders the aids the Charter, the Guide, the Domains, then the strand. No fixture or schema file
    moved; the generated models' headers move with the serial.
  • Schema pin to v0.33.0-dist.99: the strand profile's mark relaxed (only the story's id required; the event and
    the place null or absent read as unset, any other value there no mark) and its readings for a non-list multi-link,
    a nameless slot and the public rung, nine new cases (26). OWStrand.Of already answered them so.
  • Schema pin to v0.33.0-dist.98: the strand profile, new (profiles/strand.md and its fixture, 17 cases): one
    story in a world in miniature, named on the World by x_strand's three ids and read through four existing links.
    No schema file moved; the generated models' headers move with the serial.
  • OWClient.GetAsync<T> takes expand, fields and viewAs, after ct so a caller passing it by position keeps
    working: sent as expand and fields (joined by commas) and as, in the TypeScript SDK's order, beside world=
    on a client with World set; null or empty sends nothing. Until now a single get could send none of them. Mirrors
    the TypeScript SDK's get options (viewAs from 4.37.0).
  • OWListParams takes Expand, Ids, CreatedBy and ViewAs, so ListAsync and every page of ListAllAsync send
    expand and ids (joined by commas), created_by (a membership id or owner) and as (view as), in the
    TypeScript SDK's order (limit, cursor, expand, fields, ids, created_by, the filters, as last), beside
    world= on a client with World set; null or empty sends nothing. Until now they went only through Filter,
    untyped. A Filter key that a typed member sends in the same request (limit, always; ids with Ids set; as
    with ViewAs; and so on) is now an ArgumentException before sending, where it went out twice; one whose member is
    not set still goes once. Mirrors the TypeScript SDK's list options ids, createdBy, expand and viewAs
    (viewAs from 4.37.0).
  • OWListParams.Filter refuses a world key with an ArgumentException before sending, on every client and on
    every page of ListAllAsync: it would go out beside the client's own world=, or to a world key that answers 422.
    The world an account token or a keyless client reads is OWClientConfig.World. Mirrors the TypeScript SDK's
    list() refusal (4.88.0).
  • OWClient.SetMyLensesAsync and SetMemberLensesAsync take a null list: sent as {"lenses": null}, it puts the
    list back to never chosen, so a seat playing a Character starts with its Titles' lenses again, while an empty list
    keeps it off them (on the owner's own list null is the empty list). Until now a null was an
    ArgumentNullException, so a list once chosen could not be put back from Unity. Mirrors the TypeScript SDK's
    setMyLenses(null) and setMemberLenses(world, member, null) (4.99.0).
  • OWClient.ChangesAsync takes after (a DateTimeOffset, last, so a caller passing ct by position keeps
    working): only the changes made at or after that time, sent as after in UTC to the microsecond (a finer fraction
    is cut, never rounded up), beside since and limit. A filter, not a position: pass each page's cursor back with
    the same after to read the whole window. With headOnly it is an ArgumentException before sending. Mirrors the
    TypeScript SDK's after on changes() (4.44.0).
  • Schema pin to v0.33.0-dist.97: the address profile's four format cases on an empty string, one per part (an
    empty world, type, id or lens refuses by that part's own reason; only null or a missing key is absent), which
    OWAddress already answered so.