five-on-it / apps/api/src/postgres / PostgresStore
Interface: PostgresStore
Defined in: apps/api/src/postgres.ts:387
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:945
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:977
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:812
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:1003
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:814
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:898
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:870
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:389
Closes the connection pool.
Returns
Promise<void>
consents()
consents(
account):Promise<Consent[]>
Defined in: apps/api/src/store.ts:818
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:1028
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:780
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:926
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:845
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:934
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:1047
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:992
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:1061
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:891
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:939
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:906
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:784
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:776
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:943
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:857
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:924
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:1051
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:832
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:843
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:849
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:994
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:798
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:804
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:981
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:930
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:967
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:861
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:788
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:794
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:1043
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:963
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:782
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:859
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:928
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:806
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:1032
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:1053
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:1055
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:1034
A mission version's tally.
Parameters
key
Returns
Promise<{ completions: number; players: number; runs: number; }>
Inherited from
moveJob()
moveJob(
job,from):Promise<boolean>
Defined in: apps/api/src/store.ts:904
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:985
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:987
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:996
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:853
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:828
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:969
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:786
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:816
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:778
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:1045
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:941
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:855
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:956
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:922
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:1049
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:830
Saves an OAuth client.
Parameters
client
Returns
Promise<void>
Inherited from
putOAuthCode()
putOAuthCode(
code):Promise<void>
Defined in: apps/api/src/store.ts:834
Saves an authorization code.
Parameters
code
Returns
Promise<void>
Inherited from
putOAuthGrant()
putOAuthGrant(
grant):Promise<void>
Defined in: apps/api/src/store.ts:841
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:847
Saves a refresh token.
Parameters
token
Returns
Promise<void>
Inherited from
putRating()
putRating(
rating):Promise<void>
Defined in: apps/api/src/store.ts:796
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:802
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:971
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:932
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:808
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:820
Keeps a telemetry record.
Parameters
record
Returns
Promise<void>
Inherited from
putTranscript()
putTranscript(
transcript):Promise<void>
Defined in: apps/api/src/store.ts:965
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:790
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:920
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:800
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
refundQuota()
refundQuota(
account,what,day):Promise<number>
Defined in: apps/api/src/store.ts:918
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:979
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:880
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:983
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:1038
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:886
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:961
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:911
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:950
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:1036
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:810
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:822
The telemetry records of a kind since a time (ISO), newest first, at most limit.
Parameters
kind
"crash" | "event"
since
string
limit
number
Returns
Promise<TelemetryRecord[]>
Inherited from
unpaidRuns()
unpaidRuns(
endedSince,limit):Promise<Run[]>
Defined in: apps/api/src/store.ts:1030
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:839
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:851
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:792
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:1014
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; }>