five-on-it / apps/api/src/postgres / PostgresStore
Interface: PostgresStore
Defined in: apps/api/src/postgres.ts:399
A store in Postgres, and how to let go of its connections.
Extends
Methods
accountEntitlement()
accountEntitlement(
account):Promise<Entitlement|undefined>
Defined in: apps/api/src/store.ts:960
The entitlement of the Steam account that signs in to an account, if one does.
Parameters
account
string
Returns
Promise<Entitlement | undefined>
Inherited from
addRunPlayer()
addRunPlayer(
player):Promise<boolean>
Defined in: apps/api/src/store.ts:992
Adds a seat to an open run's roster (a player placed in it under way, joinInProgress): false when the run is not open any more, the seat is taken, or the account has a seat of the run already (nothing added).
Parameters
player
Returns
Promise<boolean>
Inherited from
appendAudit()
appendAudit(
entry):Promise<void>
Defined in: apps/api/src/store.ts:827
Adds a decision to the audit log.
Parameters
entry
Returns
Promise<void>
Inherited from
applyStanding()
applyStanding(
lines,fresh):Promise<{applied:StandingLine[];standings:PlayerStanding[]; }>
Defined in: apps/api/src/store.ts:1018
Applies lines to their accounts' standings, atomically each, once each (a line whose id is in the ledger already is left out): its Respect added (to its season's too), its conduct moved and kept in 0–10,000, its skill set when it carries one, its name kept; an account without a standing starts at fresh's. Answers the lines applied and the standings after.
Parameters
lines
readonly StandingLine[]
fresh
(account, name) => PlayerStanding
Returns
Promise<{ applied: StandingLine[]; standings: PlayerStanding[]; }>
Inherited from
auditLog()
auditLog(
limit,action?):Promise<AuditEntry[]>
Defined in: apps/api/src/store.ts:829
The audit log, newest first, at most limit entries: every one, or those of one action.
Parameters
limit
number
action?
"conduct" | "delete" | "settings" | "takedown" | "restore" | "feature" | "unfeature" | "dismiss" | "uphold" | "limits" | "erase"
Returns
Promise<AuditEntry[]>
Inherited from
cancelJob()
cancelJob(
id,at):Promise<Job|undefined>
Defined in: apps/api/src/store.ts:913
Cancels a job that is queued, running or waiting at a time (ISO), atomically: it is over (cancelled, no lease), so a claim never takes it and the attempt running it can renew or settle nothing. Answers the job as it was before, or undefined when there is none or it was over already.
Parameters
id
string
at
string
Returns
Promise<Job | undefined>
Inherited from
claimJob()
claimJob(
kind,at,leaseUntil,options?):Promise<Job|undefined>
Defined in: apps/api/src/store.ts:885
Claims the next queued job of a kind at a time (ISO), atomically, so two processes never claim the same one: the highest priority first, then the owner with the fewest jobs of that kind started that day (UTC), then the oldest (queue.ts's order). A creation (create) of an owner who has one running already waits (one at a time each, which Postgres's index holds too). It answers the job as claimed (running, its attempts counted, held until leaseUntil), or undefined when none is queued.
Parameters
kind
at
string
leaseUntil
string
options?
ClaimOptions
Returns
Promise<Job | undefined>
Inherited from
close()
close():
Promise<void>
Defined in: apps/api/src/postgres.ts:401
Closes the connection pool.
Returns
Promise<void>
consents()
consents(
account):Promise<Consent[]>
Defined in: apps/api/src/store.ts:833
An account's acceptances, newest first.
Parameters
account
string
Returns
Promise<Consent[]>
Inherited from
countMissionRun()
countMissionRun(
run):Promise<boolean>
Defined in: apps/api/src/store.ts:1043
Counts a run in its mission version's tally, once (by the run's id): a settled run, a completion when it completed, its accounts among the distinct players. False when it was counted already.
Parameters
run
MissionRun
Returns
Promise<boolean>
Inherited from
deleteDraft()
deleteDraft(
id):Promise<boolean>
Defined in: apps/api/src/store.ts:795
Forgets a draft and its builds' records (their artifacts stay: they are content-addressed); false when there was none.
Parameters
id
string
Returns
Promise<boolean>
Inherited from
deleteLimits()
deleteLimits(
account):Promise<void>
Defined in: apps/api/src/store.ts:941
Forgets the limits an admin set an account: it has the defaults again.
Parameters
account
string
Returns
Promise<void>
Inherited from
deleteOAuthGrant()
deleteOAuthGrant(
id):Promise<void>
Defined in: apps/api/src/store.ts:860
Revokes a grant: forgets it and its refresh tokens.
Parameters
id
string
Returns
Promise<void>
Inherited from
deleteSettings()
deleteSettings():
Promise<void>
Defined in: apps/api/src/store.ts:949
Forgets the platform's settings: the configuration's defaults again.
Returns
Promise<void>
Inherited from
endorsements()
endorsements(
query):Promise<Endorsement[]>
Defined in: apps/api/src/store.ts:1062
The endorsements of a run, or those given or received by an account since a time.
Parameters
query
account?
string
run?
string
since?
string
Returns
Promise<Endorsement[]>
Inherited from
endRun()
endRun(
ended):Promise<boolean>
Defined in: apps/api/src/store.ts:1007
Ends a run that is still open, atomically: the run as ended says (its state, result, end); false when it had ended already (it is left as it was).
Parameters
ended
Returns
Promise<boolean>
Inherited from
eraseStanding()
eraseStanding(
account):Promise<void>
Defined in: apps/api/src/store.ts:1076
Forgets an account's standing: its standing, its ledger, the endorsements it gave and got, its ratings of missions, and its account among the missions' players (each kept as an anonymous one, so the missions' counts stay).
Parameters
account
string
Returns
Promise<void>
Inherited from
expireJobs()
expireJobs(
kind,at,attempts):Promise<Job[]>
Defined in: apps/api/src/store.ts:906
The running jobs of a kind whose lease ran out before a time (ISO): queued again while they had fewer than attempts attempts, failed after that; answered as they are now.
Parameters
kind
at
string
attempts
number
Returns
Promise<Job[]>
Inherited from
findAccounts()
findAccounts(
q,limit):Promise<KnownAccount[]>
Defined in: apps/api/src/store.ts:954
The accounts the API has seen (drafts' owners, quotas' spenders, accounts with limits) whose id or name holds q (any case), by id, at most limit.
Parameters
q
string
limit
number
Returns
Promise<KnownAccount[]>
Inherited from
findJobs()
findJobs(
query):Promise<Job[]>
Defined in: apps/api/src/store.ts:921
The jobs a query asks for, whole, the newest first.
Parameters
query
JobQuery
Returns
Promise<Job[]>
Inherited from
getBuild()
getBuild(
id):Promise<Build|undefined>
Defined in: apps/api/src/store.ts:799
A build by id.
Parameters
id
string
Returns
Promise<Build | undefined>
Inherited from
getDraft()
getDraft(
id):Promise<Draft|undefined>
Defined in: apps/api/src/store.ts:791
A draft by id.
Parameters
id
string
Returns
Promise<Draft | undefined>
Inherited from
getEntitlement()
getEntitlement(
steamid):Promise<Entitlement|undefined>
Defined in: apps/api/src/store.ts:958
A Steam account's entitlement by its SteamID64.
Parameters
steamid
string
Returns
Promise<Entitlement | undefined>
Inherited from
getJob()
getJob(
id):Promise<Job|undefined>
Defined in: apps/api/src/store.ts:872
A job by id.
Parameters
id
string
Returns
Promise<Job | undefined>
Inherited from
getLimits()
getLimits(
account):Promise<AccountLimits|undefined>
Defined in: apps/api/src/store.ts:939
The limits an admin set an account, if any.
Parameters
account
string
Returns
Promise<AccountLimits | undefined>
Inherited from
getMissionRating()
getMissionRating(
key,account):Promise<MissionRating|undefined>
Defined in: apps/api/src/store.ts:1066
An account's rating of a mission's version.
Parameters
key
account
string
Returns
Promise<MissionRating | undefined>
Inherited from
getOAuthClient()
getOAuthClient(
id):Promise<OAuthClient|undefined>
Defined in: apps/api/src/store.ts:847
An OAuth client by id.
Parameters
id
string
Returns
Promise<OAuthClient | undefined>
Inherited from
getOAuthGrant()
getOAuthGrant(
id):Promise<OAuthGrant|undefined>
Defined in: apps/api/src/store.ts:858
A grant by id; undefined once revoked or forgotten.
Parameters
id
string
Returns
Promise<OAuthGrant | undefined>
Inherited from
getOAuthRefresh()
getOAuthRefresh(
hash):Promise<OAuthRefresh|undefined>
Defined in: apps/api/src/store.ts:864
A refresh token by the hash of its value.
Parameters
hash
string
Returns
Promise<OAuthRefresh | undefined>
Inherited from
getPlayerStanding()
getPlayerStanding(
account):Promise<PlayerStanding|undefined>
Defined in: apps/api/src/store.ts:1009
An account's standing, if it has one.
Parameters
account
string
Returns
Promise<PlayerStanding | undefined>
Inherited from
getRating()
getRating(
game,account):Promise<Rating|undefined>
Defined in: apps/api/src/store.ts:813
An account's rating of a game.
Parameters
game
string
account
string
Returns
Promise<Rating | undefined>
Inherited from
getReport()
getReport(
id):Promise<Report|undefined>
Defined in: apps/api/src/store.ts:819
A report by id.
Parameters
id
string
Returns
Promise<Report | undefined>
Inherited from
getRun()
getRun(
id):Promise<Run|undefined>
Defined in: apps/api/src/store.ts:996
A run by its id.
Parameters
id
string
Returns
Promise<Run | undefined>
Inherited from
getSettings()
getSettings():
Promise<PlatformSettings|undefined>
Defined in: apps/api/src/store.ts:945
The platform's settings an admin set, if any.
Returns
Promise<PlatformSettings | undefined>
Inherited from
getTranscript()
getTranscript(
job):Promise<Transcript|undefined>
Defined in: apps/api/src/store.ts:982
A creation's transcript, while it is kept.
Parameters
job
string
Returns
Promise<Transcript | undefined>
Inherited from
jobsStarted()
jobsStarted(
kind,since):Promise<Map<string,number>>
Defined in: apps/api/src/store.ts:876
How many jobs of a kind each owner had started since a time (ISO).
Parameters
kind
since
string
Returns
Promise<Map<string, number>>
Inherited from
latestBuild()
latestBuild(
draft):Promise<Build|undefined>
Defined in: apps/api/src/store.ts:803
A draft's latest build.
Parameters
draft
string
Returns
Promise<Build | undefined>
Inherited from
latestVersions()
latestVersions():
Promise<GameVersion[]>
Defined in: apps/api/src/store.ts:809
The latest version of every game, newest first.
Returns
Promise<GameVersion[]>
Inherited from
leaderboard()
leaderboard(
season,limit):Promise<LeaderboardLine[]>
Defined in: apps/api/src/store.ts:1058
The leaderboard: the accounts by the Respect earned in a season (all: their Respect), the most first, at most limit (none with nothing).
Parameters
season
string
limit
number
Returns
Promise<LeaderboardLine[]>
Inherited from
ledgerTotals()
ledgerTotals(
since,until?):Promise<LedgerTotals>
Defined in: apps/api/src/store.ts:978
What the lines claimed from since (and before until) spent, and hold reserved.
Parameters
since
string
until?
string
Returns
Promise<LedgerTotals>
Inherited from
listDrafts()
listDrafts(
owner):Promise<Draft[]>
Defined in: apps/api/src/store.ts:797
An owner's drafts, newest first.
Parameters
owner
string
Returns
Promise<Draft[]>
Inherited from
listJobs()
listJobs(
kind,states):Promise<JobSummary[]>
Defined in: apps/api/src/store.ts:874
The jobs of a kind in the states given, without their documents, in the order they were queued.
Parameters
kind
states
readonly ("done" | "failed" | "waiting" | "running" | "queued" | "cancelled")[]
Returns
Promise<JobSummary[]>
Inherited from
listLimits()
listLimits():
Promise<AccountLimits[]>
Defined in: apps/api/src/store.ts:943
Every account's limits an admin set, the latest set first.
Returns
Promise<AccountLimits[]>
Inherited from
listReports()
listReports(
state?):Promise<Report[]>
Defined in: apps/api/src/store.ts:821
The reports, newest first: every one, or those in one state.
Parameters
state?
"open" | "actioned" | "dismissed"
Returns
Promise<Report[]>
Inherited from
markRunPaid()
markRunPaid(
run,at):Promise<void>
Defined in: apps/api/src/store.ts:1047
Marks a run's seats paid (once: a later mark keeps the first time).
Parameters
run
string
at
string
Returns
Promise<void>
Inherited from
missionRatings()
missionRatings(
key):Promise<{average:number;count:number; }>
Defined in: apps/api/src/store.ts:1068
A mission version's ratings: how many, their mean (two decimals; 0 without any).
Parameters
key
Returns
Promise<{ average: number; count: number; }>
Inherited from
missionRatingsBy()
missionRatingsBy(
account):Promise<MissionRating[]>
Defined in: apps/api/src/store.ts:1070
An account's ratings of missions, the newest first (its data's export).
Parameters
account
string
Returns
Promise<MissionRating[]>
Inherited from
missionTally()
missionTally(
key):Promise<{completions:number;players:number;runs:number; }>
Defined in: apps/api/src/store.ts:1049
A mission version's tally.
Parameters
key
Returns
Promise<{ completions: number; players: number; runs: number; }>
Inherited from
mostWanted()
mostWanted(
limit):Promise<NotorietyRecord[]>
Defined in: apps/api/src/store.ts:1090
The Most wanted board: the records with a star, by the most stars, then the longest stretch at ten, then the account; at most limit.
Parameters
limit
number
Returns
Promise<NotorietyRecord[]>
Inherited from
moveJob()
moveJob(
job,from):Promise<boolean>
Defined in: apps/api/src/store.ts:919
Saves a job as given (no lease) when it is still in the state from, atomically: a creation's conversation moved on (waiting to queued when its owner says more, waiting to done when it went quiet) never overwrites a cancel or a claim. False when it was not.
Parameters
job
from
"done" | "failed" | "waiting" | "running" | "queued" | "cancelled"
Returns
Promise<boolean>
Inherited from
openRuns()
openRuns():
Promise<Run[]>
Defined in: apps/api/src/store.ts:1000
The runs still open, the oldest first: what the sweep looks at.
Returns
Promise<Run[]>
Inherited from
openRunsOf()
openRunsOf(
account):Promise<Run[]>
Defined in: apps/api/src/store.ts:1002
The runs still open an account has a seat in, the oldest first.
Parameters
account
string
Returns
Promise<Run[]>
Inherited from
playerStandings()
playerStandings(
accounts):Promise<PlayerStanding[]>
Defined in: apps/api/src/store.ts:1011
The standings of the accounts given that have one.
Parameters
accounts
readonly string[]
Returns
Promise<PlayerStanding[]>
Inherited from
purgeOAuth()
purgeOAuth(
before):Promise<number>
Defined in: apps/api/src/store.ts:868
Forgets the codes, refresh tokens and grants that expired before a time (ISO); returns how many.
Parameters
before
string
Returns
Promise<number>
Inherited from
purgeTelemetry()
purgeTelemetry(
before):Promise<number>
Defined in: apps/api/src/store.ts:843
Forgets the telemetry records older than a time (ISO); returns how many.
Parameters
before
string
Returns
Promise<number>
Inherited from
purgeTranscripts()
purgeTranscripts(
before):Promise<number>
Defined in: apps/api/src/store.ts:984
Forgets the transcripts kept before a time (ISO); returns how many.
Parameters
before
string
Returns
Promise<number>
Inherited from
putBuild()
putBuild(
build):Promise<void>
Defined in: apps/api/src/store.ts:801
Saves a build (insert or replace).
Parameters
build
Returns
Promise<void>
Inherited from
putConsent()
putConsent(
consent):Promise<void>
Defined in: apps/api/src/store.ts:831
Records an account's acceptance of a version of the terms (again: the latest time).
Parameters
consent
Returns
Promise<void>
Inherited from
putDraft()
putDraft(
draft):Promise<void>
Defined in: apps/api/src/store.ts:793
Saves a draft (insert or replace).
Parameters
draft
Returns
Promise<void>
Inherited from
putEndorsement()
putEndorsement(
endorsement):Promise<boolean>
Defined in: apps/api/src/store.ts:1060
Keeps an endorsement, once per run, giver and receiver: false when it was given already.
Parameters
endorsement
Endorsement
Returns
Promise<boolean>
Inherited from
putEntitlement()
putEntitlement(
entitlement):Promise<void>
Defined in: apps/api/src/store.ts:956
Saves a Steam account's entitlement (insert or replace; one Steam account per account).
Parameters
entitlement
Returns
Promise<void>
Inherited from
putJob()
putJob(
job):Promise<void>
Defined in: apps/api/src/store.ts:870
Saves a job (insert or replace).
Parameters
job
Returns
Promise<void>
Inherited from
putLedger()
putLedger(
entry):Promise<void>
Defined in: apps/api/src/store.ts:971
Saves a creation's line in the ledger (insert or replace).
Parameters
entry
Returns
Promise<void>
Inherited from
putLimits()
putLimits(
limits):Promise<void>
Defined in: apps/api/src/store.ts:937
Saves the limits an admin set an account (insert or replace).
Parameters
limits
Returns
Promise<void>
Inherited from
putMissionRating()
putMissionRating(
rating):Promise<void>
Defined in: apps/api/src/store.ts:1064
Keeps a player's rating of a mission's version (again: replaced).
Parameters
rating
Returns
Promise<void>
Inherited from
putOAuthClient()
putOAuthClient(
client):Promise<void>
Defined in: apps/api/src/store.ts:845
Saves an OAuth client.
Parameters
client
Returns
Promise<void>
Inherited from
putOAuthCode()
putOAuthCode(
code):Promise<void>
Defined in: apps/api/src/store.ts:849
Saves an authorization code.
Parameters
code
Returns
Promise<void>
Inherited from
putOAuthGrant()
putOAuthGrant(
grant):Promise<void>
Defined in: apps/api/src/store.ts:856
Saves a grant (insert or replace).
Parameters
grant
Returns
Promise<void>
Inherited from
putOAuthRefresh()
putOAuthRefresh(
token):Promise<void>
Defined in: apps/api/src/store.ts:862
Saves a refresh token.
Parameters
token
Returns
Promise<void>
Inherited from
putRating()
putRating(
rating):Promise<void>
Defined in: apps/api/src/store.ts:811
Saves a rating (one per game and account: a new one replaces the old).
Parameters
rating
Returns
Promise<void>
Inherited from
putReport()
putReport(
report):Promise<void>
Defined in: apps/api/src/store.ts:817
Saves a report (insert or replace; a replaced one keeps its place in the list).
Parameters
report
Returns
Promise<void>
Inherited from
putRun()
putRun(
run,players):Promise<void>
Defined in: apps/api/src/store.ts:986
Saves a run and its roster (insert; the roster as it is given, by seat).
Parameters
run
players
readonly RunPlayer[]
Returns
Promise<void>
Inherited from
putSettings()
putSettings(
settings):Promise<void>
Defined in: apps/api/src/store.ts:947
Saves the platform's settings (replacing them).
Parameters
settings
Returns
Promise<void>
Inherited from
putStanding()
putStanding(
standing):Promise<void>
Defined in: apps/api/src/store.ts:823
Saves a game's standing (insert or replace).
Parameters
standing
Returns
Promise<void>
Inherited from
putTelemetry()
putTelemetry(
record):Promise<void>
Defined in: apps/api/src/store.ts:835
Keeps a telemetry record.
Parameters
record
Returns
Promise<void>
Inherited from
putTranscript()
putTranscript(
transcript):Promise<void>
Defined in: apps/api/src/store.ts:980
Keeps a creation's transcript (insert or replace).
Parameters
transcript
Returns
Promise<void>
Inherited from
putVersion()
putVersion(
version):Promise<void>
Defined in: apps/api/src/store.ts:805
Saves a game version.
Parameters
version
Returns
Promise<void>
Inherited from
quotaUsage()
quotaUsage(
account,day):Promise<Partial<Record<QuotaKind,number>>>
Defined in: apps/api/src/store.ts:935
An account's uses of its quotas on a day (YYYY-MM-DD); a quota it did not use is left out.
Parameters
account
string
day
string
Returns
Promise<Partial<Record<QuotaKind, number>>>
Inherited from
ratingSummaries()
ratingSummaries(
games):Promise<Map<string,RatingSummary>>
Defined in: apps/api/src/store.ts:815
The ratings of the games given, summed up; a game nobody rated is left out.
Parameters
games
readonly string[]
Returns
Promise<Map<string, RatingSummary>>
Inherited from
recordNotoriety()
recordNotoriety(
report,at):Promise<NotorietyRecord>
Defined in: apps/api/src/store.ts:1082
Keeps a game server's report of an account's notoriety: the most stars and the longest stretch at ten each the best of the record's and the report's (a report never lowers one), the name the report's. Answers the record after.
Parameters
report
account
string
name
string
stars
number
tenStarSeconds
number
at
string
Returns
Promise<NotorietyRecord>
Inherited from
refundQuota()
refundQuota(
account,what,day):Promise<number>
Defined in: apps/api/src/store.ts:933
Gives back one use of an account's quota on a day, when it used any: its uses that day now.
Parameters
account
string
what
day
string
Returns
Promise<number>
Inherited from
removeRunPlayer()
removeRunPlayer(
run,seat):Promise<void>
Defined in: apps/api/src/store.ts:994
Takes a seat filled under way off a run's roster again (its server refused it); nothing for a seat it has not.
Parameters
run
string
seat
number
Returns
Promise<void>
Inherited from
renewJob()
renewJob(
id,attempt,leaseUntil,step?):Promise<boolean>
Defined in: apps/api/src/store.ts:895
Extends the lease of a running job's attempt, and says what it is doing now when step is given; false when that attempt no longer holds it.
Parameters
id
string
attempt
number
leaseUntil
string
step?
string
Returns
Promise<boolean>
Inherited from
runPlayers()
runPlayers(
run):Promise<RunPlayer[]>
Defined in: apps/api/src/store.ts:998
A run's roster, by seat.
Parameters
run
string
Returns
Promise<RunPlayer[]>
Inherited from
runStandingLines()
runStandingLines(
run):Promise<StandingLine[]>
Defined in: apps/api/src/store.ts:1053
The lines of one run's ledger (every account's).
Parameters
run
string
Returns
Promise<StandingLine[]>
Inherited from
settleJob()
settleJob(
job):Promise<boolean>
Defined in: apps/api/src/store.ts:901
Ends a running job's attempt, saving it as given (done, failed or cancelled, no lease), when that attempt (job.attempts) still holds it; false otherwise (its lease ran out and another process took it, or it was cancelled).
Parameters
job
Returns
Promise<boolean>
Inherited from
spendLedger()
spendLedger(
job,spent,settledAt?):Promise<void>
Defined in: apps/api/src/store.ts:976
Records what a creation spent so far (never less than it had), and settles it when settledAt is given (a settled line keeps its first settling time).
Parameters
job
string
spent
number
settledAt?
string
Returns
Promise<void>
Inherited from
spendQuota()
spendQuota(
account,what,day,limit):Promise<number|undefined>
Defined in: apps/api/src/store.ts:926
Counts one use of an account's quota on a day (YYYY-MM-DD, UTC), atomically, when it has used fewer than limit: its uses that day now, or undefined when none are left.
Parameters
account
string
what
day
string
limit
number
Returns
Promise<number | undefined>
Inherited from
staleEntitlements()
staleEntitlements(
seenSince,checkedBefore,limit):Promise<Entitlement[]>
Defined in: apps/api/src/store.ts:965
The entitlements signed in with since a time and last checked before another (ISO), the longest unchecked first, at most limit: what the daily sweep asks Steam again.
Parameters
seenSince
string
checkedBefore
string
limit
number
Returns
Promise<Entitlement[]>
Inherited from
standingLines()
standingLines(
account,query):Promise<StandingLine[]>
Defined in: apps/api/src/store.ts:1051
An account's ledger lines a query asks for, the newest first.
Parameters
account
string
query
StandingQuery
Returns
Promise<StandingLine[]>
Inherited from
standings()
standings():
Promise<Map<string,GameStanding>>
Defined in: apps/api/src/store.ts:825
Every game's standing that a moderator ever set.
Returns
Promise<Map<string, GameStanding>>
Inherited from
telemetry()
telemetry(
kind,since,limit):Promise<TelemetryRecord[]>
Defined in: apps/api/src/store.ts:837
The telemetry records of a kind since a time (ISO), newest first, at most limit.
Parameters
kind
"event" | "crash"
since
string
limit
number
Returns
Promise<TelemetryRecord[]>
Inherited from
unpaidRuns()
unpaidRuns(
endedSince,limit):Promise<Run[]>
Defined in: apps/api/src/store.ts:1045
The settled runs that count (not playtests, not abandoned nor lost) ended since a time (ISO) whose seats were not paid yet, the oldest first, at most limit.
Parameters
endedSince
string
limit
number
Returns
Promise<Run[]>
Inherited from
useOAuthCode()
useOAuthCode(
hash,at):Promise<OAuthCode|undefined>
Defined in: apps/api/src/store.ts:854
Marks a code used at a time (ISO), once: the code as it was before (usedAt set when it had been used already), or undefined when there is none.
Parameters
hash
string
at
string
Returns
Promise<OAuthCode | undefined>
Inherited from
useOAuthRefresh()
useOAuthRefresh(
hash,at):Promise<OAuthRefresh|undefined>
Defined in: apps/api/src/store.ts:866
Marks a refresh token used at a time (ISO), once: the token as it was before, as useOAuthCode.
Parameters
hash
string
at
string
Returns
Promise<OAuthRefresh | undefined>
Inherited from
versions()
versions(
gameId):Promise<GameVersion[]>
Defined in: apps/api/src/store.ts:807
A game's versions, oldest first.
Parameters
gameId
string
Returns
Promise<GameVersion[]>
Inherited from
withStanding()
withStanding(
account,name,fresh,work):Promise<{applied:boolean;standing:PlayerStanding; }>
Defined in: apps/api/src/store.ts:1029
Pays one account's seat of a run atomically (respect.ts): its standing (a new one's, fresh, when it has none) held while work reads the account's ledger (lines, inside the same transaction: the day's repeat counted where nothing can change it meanwhile) and returns the line to apply; the line applied once (by its id) and the standing after. Postgres runs it in one transaction holding the account's row (SELECT … FOR UPDATE).
Parameters
account
string
name
string
fresh
(account, name) => PlayerStanding
work
(standing, lines) => Promise<StandingLine | undefined>
Returns
Promise<{ applied: boolean; standing: PlayerStanding; }>