five-on-it / apps/api/src/store
apps/api/src/store
What the platform keeps (TECHNICAL_SPECS §9.10): drafts (a game being made, by its owner), builds (a draft's revision checked and, when it passes, stored as an artifact) and published games (versions of a game, each pinned to an artifact); around the games, the players' ratings, their reports, each game's standing (featured, taken down) and the audit log of every moderator's decision (§9.9) and every admin's change of an account's limits; the terms each account accepted, the players' telemetry, OAuth's clients, codes, grants and refresh tokens (oauth.ts: the codes and tokens by the SHA-256 of their values only); the jobs of the durable queue (queue.ts: claimed one at a time, held by a lease), each account's use of its daily quotas and the limits an admin set it; the Steam accounts, each with the account it signs in to and what Steam last said of its copy of the game (entitlement.ts); and the ledger of what the platform's model spent on each creation (creations.ts), and each creation's transcript (kept 30 days for the moderators); and the runs (runs.ts: a mission played in a room of its own), each with its roster, open until its result or the sweep ends it; and each account's standing (respect.ts: its Respect, conduct and hidden skill, the ledger of every change and why, keyed so that a run pays an account once), the endorsements players gave each other, each mission version's tally (its settled runs, completions and distinct players) and its players' ratings of it. The interface has two implementations here, in memory (the tests) and a JSON file (local development, so drafts survive a restart), and one in postgres.ts (the Compose stack). Every one keeps a document whole, fields it does not know included.
Interfaces
- AccountLimits
- AuditEntry
- Build
- Consent
- Draft
- Entitlement
- GameStanding
- GameVersion
- Job
- KnownAccount
- LeaderboardLine
- LedgerEntry
- LedgerTotals
- MissionKey
- MissionRating
- OAuthClient
- OAuthCode
- OAuthGrant
- OAuthRefresh
- PlayerStanding
- Rating
- RatingSummary
- Report
- Run
- RunPlayer
- StandingLine
- Store
- TelemetryRecord
- Transcript