Skip to content

OnlyWorlds Unity SDK 0.40.0

Choose a tag to compare

@tmoosting tmoosting released this 14 Nov 07:26
· 240 commits to main since this release

An address found in prose. OWAddress.ReadLinkAt reads an address inside other text from the index where its
prefix starts and says where it ends, as the address page's "An address in prose" rules (schema-dist serial 123), so
the address fixture's 61 prose cases now run here instead of being ignored. And a read-only sign-in: Sign in with
OnlyWorlds can ask for a token that reads and never writes, for a tool that only reads. A /changes row also reads
its updated_at, deleted_at and reason. A minor release: it adds public API.

Added

  • OWAddress.ReadLinkAt(text, index = 0) and its answer, OWAddressAt (Reading, End): the address that
    starts exactly at index in a text, and the index just past it, or null when the text there is not an address. The
    TypeScript SDK's readOwLinkAt and the Python package's read_ow_link_at. Both forms are found, the prefix as
    written. Where the address ends is the grammar's, never the next space's: after the path it continues only with @
    and a moment and then ?lens= and a lens; any other query key, a fragment and a full stop are prose. In the site's
    form the run after /w/ is read whole: exactly an id's form is the id, any other legal slug is the slug, else there
    is no address, and a run followed by a letter of any script, a combining mark or an underscore is cut inside a word
    and is no address (the character after it read as a whole code point, so a letter above U+FFFF cuts as any letter
    does). index and End are C# string indexes, UTF-16 code units, so they match string.IndexOf and
    string.Substring. A null text is an ArgumentNullException, a negative index an ArgumentOutOfRangeException,
    and an index past the end reads nothing. OWAddress.ParseLink is unchanged and still reads a string whole.
  • OWChange.UpdatedAt, OWChange.DeletedAt and OWChange.Reason: the three fields of a /changes row the
    client did not map, as the TypeScript SDK's OwChangeUpsert and OwChangeDelete read them. An upsert's
    updated_at; a delete's deleted_at (on a hidden row, when it was hidden); and a delete's reason: deleted
    (gone, a GET answers 410), hidden (hidden from this reader by the world's owner or a co-builder; it still exists
    and a GET answers 404) or out_of_view (declared, sent by nothing yet). Each is null on the other kind of row.
    Remove the element from the local copy whatever the reason.
  • OWClient.SignInWithOnlyWorlds(clientId, redirectUri, scope): a read-only sign-in, with scope set to
    OWSignIn.ReadScope ("world:read"). The token it gives reads everything the account reads, and every write
    (a world key minted, a world made, another token minted, an AI call) is refused with 403 permission_error, except
    revoking the token itself. The authorize URL carries scope=world%3Aread after its other parameters, and the
    pending sign-in keeps it as OWSignInBegun.Scope. Any other scope is an ArgumentException before anything is
    made or sent; null, the default, signs in as before, with a token that writes as the account does. The TypeScript
    SDK's signInWithOnlyWorlds({ scope: 'world:read' }) (4.164.0).
  • OWSignInResult.Scope: "world:read" when the server granted a read-only token, null when its answer carries
    no scope, so a tool that asked for read-only reads what it holds. A read-only sign-in gets no AI door token:
    CompleteSignInAsync with aiUses beside one is an ArgumentException before the code is spent, and the same
    return then completes without them.
  • OWAccountToken.Scope (and so OWMintedAiToken.Scope): "world:read" on a token a read-only sign-in minted,
    as ListAccountTokensAsync lists it; null on every other token.