five-on-it / apps/client/src/ui/platform / Platform
Interface: Platform
Defined in: apps/client/src/ui/platform.ts:206
The calls the Games tab and the game pages make.
Properties
base
readonlybase:string
Defined in: apps/client/src/ui/platform.ts:208
The API's base URL.
Methods
account()
account():
Promise<PlatformAccount>
Defined in: apps/client/src/ui/platform.ts:232
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:212
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:214
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:210
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[]>
info()
info():
Promise<PlatformInfo>
Defined in: apps/client/src/ui/platform.ts:245
What the platform says of itself (/info), asked once.
Returns
Promise<PlatformInfo>
isAdmin()
isAdmin():
Promise<boolean>
Defined in: apps/client/src/ui/platform.ts:239
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:224
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:259
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:241
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:243
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:234
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:220
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:216
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:226
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:230
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:228
Reports a game to the moderators.
Parameters
game
string
reason
"offensive" | "real-people" | "sexual" | "broken" | "spam" | "other"
text?
string
Returns
Promise<void>
request()
request<
T>(path,method?,body?):Promise<T>
Defined in: apps/client/src/ui/platform.ts:264
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:218
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:222
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:247
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:251
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:249
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:253
Signs in with the desktop app's Steam ticket (hex); refused with why.
Parameters
ticket
string
Returns
Promise<PlatformAccount>