five-on-it / apps/client/src/ui/platform / Platform
Interface: Platform
Defined in: apps/client/src/ui/platform.ts:227
The calls the Games tab and the game pages make.
Properties
base
readonlybase:string
Defined in: apps/client/src/ui/platform.ts:229
The API's base URL.
Methods
account()
account():
Promise<PlatformAccount>
Defined in: apps/client/src/ui/platform.ts:253
The account the calls are made as: the device's guest unless signed in.
Returns
Promise<PlatformAccount>
drafts()
drafts():
Promise<PlatformDraft[]>
Defined in: apps/client/src/ui/platform.ts:233
The caller's drafts (a creator's), each with its last build and playtest rooms.
Returns
Promise<PlatformDraft[]>
game()
game(
id):Promise<PlatformGamePage>
Defined in: apps/client/src/ui/platform.ts:235
A game's page.
Parameters
id
string
Returns
Promise<PlatformGamePage>
games()
games(
q?,sort?,list?):Promise<PlatformGame[]>
Defined in: apps/client/src/ui/platform.ts:231
The public games (and the caller's own), the words found, in the order asked; or one of the LISTS.
Parameters
q?
string
sort?
"top" | "new" | "featured"
list?
"mine" | "friends"
Returns
Promise<PlatformGame[]>
guestRefusal()
guestRefusal():
PlatformRefusal|undefined
Defined in: apps/client/src/ui/platform.ts:274
Why the platform signed no guest in for this page, once it refused one: steam (a platform for the game's owners), guest-limit (the player's network made too many new guests this hour: signing in with an e-mail still works).
Returns
PlatformRefusal | undefined
info()
info():
Promise<PlatformInfo>
Defined in: apps/client/src/ui/platform.ts:266
What the platform says of itself (/info), asked once.
Returns
Promise<PlatformInfo>
isAdmin()
isAdmin():
Promise<boolean>
Defined in: apps/client/src/ui/platform.ts:260
Whether the session the page keeps is an admin's: false without one (no guest is signed in to ask) or when the platform does not answer.
Returns
Promise<boolean>
join()
join(
room):Promise<string>
Defined in: apps/client/src/ui/platform.ts:245
The URL that joins an open room.
Parameters
room
string
Returns
Promise<string>
linkSteam()
linkSteam(
proof,credentials?):Promise<PlatformAccount>
Defined in: apps/client/src/ui/platform.ts:286
Links a Steam account (the code of a sign-in through it, or the app's ticket) to an e-mail account: the session's, or the one its e-mail and password sign in (then signed in as it). The account's drafts and games stay its own; signing in through Steam lands in it.
Parameters
proof
{ code: string; } | { ticket: string; }
credentials?
email
string
password
string
Returns
Promise<PlatformAccount>
login()
login(
password,terms?):Promise<PlatformAccount>
Defined in: apps/client/src/ui/platform.ts:262
Signs in with an email and a password (and the version of the terms the form showed, kept as accepted); the calls are made as that account from now on.
Parameters
email
string
password
string
terms?
string
Returns
Promise<PlatformAccount>
logout()
logout():
void
Defined in: apps/client/src/ui/platform.ts:264
Signs out: the next call is made as the device's guest again.
Returns
void
me()
me():
Promise<PlatformMe>
Defined in: apps/client/src/ui/platform.ts:255
Who the calls are made as, with the account's roles and limits (/me): the device's guest unless signed in.
Returns
Promise<PlatformMe>
play()
play(
game):Promise<string>
Defined in: apps/client/src/ui/platform.ts:241
Opens a room of a game; the URL that joins it.
Parameters
game
string
Returns
Promise<string>
previewUrl()
previewUrl(
id):string
Defined in: apps/client/src/ui/platform.ts:237
Where a game's preview picture is.
Parameters
id
string
Returns
string
rate()
rate(
game,stars):Promise<{mine:number;rating:PlatformRating; }>
Defined in: apps/client/src/ui/platform.ts:247
Rates a game; its rating now.
Parameters
game
string
stars
number
Returns
Promise<{ mine: number; rating: PlatformRating; }>
remix()
remix(
game):Promise<string>
Defined in: apps/client/src/ui/platform.ts:251
Remixes a game into a draft of the account's; the draft's id.
Parameters
game
string
Returns
Promise<string>
report()
report(
game,reason,text?):Promise<void>
Defined in: apps/client/src/ui/platform.ts:249
Reports a game to the moderators.
Parameters
game
string
reason
"broken" | "other" | "offensive" | "real-people" | "sexual" | "spam"
text?
string
Returns
Promise<void>
request()
request<
T>(path,method?,body?):Promise<T>
Defined in: apps/client/src/ui/platform.ts:291
Any call as the session's account (a JSON body and answer; none for a 204); throws on a refusal.
Type Parameters
T
T
Parameters
path
string
method?
string
body?
unknown
Returns
Promise<T>
rooms()
rooms(
game):Promise<PlatformRoom[]>
Defined in: apps/client/src/ui/platform.ts:239
A game's open rooms.
Parameters
game
string
Returns
Promise<PlatformRoom[]>
runMission()
runMission(
game,mission):Promise<string>
Defined in: apps/client/src/ui/platform.ts:243
Opens a run of one of a game's missions (the caller's, or their party's co-op one); the URL that joins it.
Parameters
game
string
mission
string
Returns
Promise<string>
session()
session():
string|undefined
Defined in: apps/client/src/ui/platform.ts:268
The session the page keeps, if any (none is made: no guest is signed in to ask).
Returns
string | undefined
steamExchange()
steamExchange(
code):Promise<PlatformAccount>
Defined in: apps/client/src/ui/platform.ts:278
Exchanges the one-time code a Steam sign-in came back with for a session; refused with why (PlatformRefusal).
Parameters
code
string
Returns
Promise<PlatformAccount>
steamStartUrl()
steamStartUrl(
returnTo):string
Defined in: apps/client/src/ui/platform.ts:276
Where a browser starts signing in through Steam, to come back to returnTo (a page of this platform).
Parameters
returnTo
string
Returns
string
steamTicket()
steamTicket(
ticket):Promise<PlatformAccount>
Defined in: apps/client/src/ui/platform.ts:280
Signs in with the desktop app's Steam ticket (hex); refused with why.
Parameters
ticket
string
Returns
Promise<PlatformAccount>