Skip to content

five-on-it / apps/api/src/app / AppDeps

Interface: AppDeps ​

Defined in: apps/api/src/app.ts:147

What the API is built from.

Properties ​

admins? ​

optional admins?: readonly string[]

Defined in: apps/api/src/app.ts:175

The admins' account ids (FOI_ADMINS): they set the accounts' limits.


artifacts ​

artifacts: ArtifactStore

Defined in: apps/api/src/app.ts:150


auth ​

auth: Auth

Defined in: apps/api/src/app.ts:148


bundledGame ​

bundledGame: (level) => { blurb?: string; id: string; level: string; missions: object[]; paths: Record<string, { gates: string[]; laps: number; } | { loop: boolean; patrol: string[]; }>; places: Record<string, { kind?: "extraction" | "safehouse" | "sniperRoof" | "roadblockSpot" | "swatStaging"; name?: string; role?: "players" | "police" | "traffic" | "guards" | "hospital"; tags?: string[]; x: number; y?: number; yaw?: number; z: number; }>; rules: { chaos: { billboards: boolean; bridges: boolean; riot?: string; }; clock?: { pace: number; start: string; }; dropMissionItems: boolean; extractions?: string[]; fallDamage: boolean; garages?: { respray?: number; store?: number; }; ghostSeconds: number; loadout?: object[]; maxPlayers: number; maxStars: number; mode?: "solo" | "coop" | "versus"; partyRewards: "split" | "shared"; phone: boolean; playerDamage: "on" | "off" | "rivals"; police: boolean; prices?: Record<string, number>; respawn: "hospital" | "mission"; safehouses?: string[]; safeZones: string[]; traffic: number; vehicleFire: boolean; weather?: { changes: boolean; climate?: "none" | "temperate" | "meadow" | "forest" | "alpine" | "farmland" | "steppe" | "desert" | "autumn" | "coast"; intensity: number; start?: "clear" | "overcast" | "rain" | "storm" | "fog" | "snow"; }; }; schemaVersion?: number; state?: { counters: Record<string, number>; flags: string[]; }; title: string; zones: Record<string, { kind?: "pickup" | "spawn" | "safe" | "restricted" | "race_gate" | "checkpoint" | "dropoff"; place: string; radius: number; raises?: "alert" | "heat"; role?: "players" | "police" | "traffic" | "guards" | "hospital"; } | { kind?: "pickup" | "spawn" | "safe" | "restricted" | "race_gate" | "checkpoint" | "dropoff"; polygon: object[]; raises?: "alert" | "heat"; role?: "players" | "police" | "traffic" | "guards" | "hospital"; y?: number; }>; } | undefined

Defined in: apps/api/src/app.ts:165

The bundled games by level name (their places and zones help a creator start).

Parameters ​

level ​

string

Returns ​

Type Literal ​

{ blurb?: string; id: string; level: string; missions: object[]; paths: Record<string, { gates: string[]; laps: number; } | { loop: boolean; patrol: string[]; }>; places: Record<string, { kind?: "extraction" | "safehouse" | "sniperRoof" | "roadblockSpot" | "swatStaging"; name?: string; role?: "players" | "police" | "traffic" | "guards" | "hospital"; tags?: string[]; x: number; y?: number; yaw?: number; z: number; }>; rules: { chaos: { billboards: boolean; bridges: boolean; riot?: string; }; clock?: { pace: number; start: string; }; dropMissionItems: boolean; extractions?: string[]; fallDamage: boolean; garages?: { respray?: number; store?: number; }; ghostSeconds: number; loadout?: object[]; maxPlayers: number; maxStars: number; mode?: "solo" | "coop" | "versus"; partyRewards: "split" | "shared"; phone: boolean; playerDamage: "on" | "off" | "rivals"; police: boolean; prices?: Record<string, number>; respawn: "hospital" | "mission"; safehouses?: string[]; safeZones: string[]; traffic: number; vehicleFire: boolean; weather?: { changes: boolean; climate?: "none" | "temperate" | "meadow" | "forest" | "alpine" | "farmland" | "steppe" | "desert" | "autumn" | "coast"; intensity: number; start?: "clear" | "overcast" | "rain" | "storm" | "fog" | "snow"; }; }; schemaVersion?: number; state?: { counters: Record<string, number>; flags: string[]; }; title: string; zones: Record<string, { kind?: "pickup" | "spawn" | "safe" | "restricted" | "race_gate" | "checkpoint" | "dropoff"; place: string; radius: number; raises?: "alert" | "heat"; role?: "players" | "police" | "traffic" | "guards" | "hospital"; } | { kind?: "pickup" | "spawn" | "safe" | "restricted" | "race_gate" | "checkpoint" | "dropoff"; polygon: object[]; raises?: "alert" | "heat"; role?: "players" | "police" | "traffic" | "guards" | "hospital"; y?: number; }>; }

blurb? ​

optional blurb?: string

id ​

id: string

level ​

level: string

missions ​

missions: object[]

paths ​

paths: Record<string, { gates: string[]; laps: number; } | { loop: boolean; patrol: string[]; }>

places ​

places: Record<string, { kind?: "extraction" | "safehouse" | "sniperRoof" | "roadblockSpot" | "swatStaging"; name?: string; role?: "players" | "police" | "traffic" | "guards" | "hospital"; tags?: string[]; x: number; y?: number; yaw?: number; z: number; }>

rules ​

rules: object

rules.chaos ​

chaos: object

The city's big events the game lets loose by itself (GAME_DESIGN §12, chaos): whether a wanted driver's approach raises the bascule bridges, whether the billboards show a wanted player's face (from six stars), and a place where a riot runs from the start. A mission's chaos sets one off where it says.

rules.chaos.billboards ​

billboards: boolean

rules.chaos.bridges ​

bridges: boolean

rules.chaos.riot? ​

optional riot?: string

rules.clock? ​

optional clock?: object

The room clock (GAME_DESIGN §5.7): the time the room starts at and its pace, game minutes per real second (1 is an hour a minute, a day in 24 minutes; 0 stops it; up to 60 for a day in 24 seconds).

rules.clock.pace ​

pace: number

rules.clock.start ​

start: string

rules.dropMissionItems ​

dropMissionItems: boolean

Whether a character that dies drops the items a mission defined that it carried, where it fell (GAME_DESIGN §7.4).

rules.extractions? ​

optional extractions?: string[]

Places that are extraction points (GAME_DESIGN §12), besides the places of the kind extraction: held 30 s at 9 stars or more, they lose the police.

rules.fallDamage ​

fallDamage: boolean

Whether a long fall hurts (from about 4 m) and a very long one kills (from about 12 m).

rules.garages? ​

optional garages?: object

What every garage of the level charges ($), over the level's own prices (GAME_DESIGN §5.5).

rules.garages.respray? ​

optional respray?: number

rules.garages.store? ​

optional store?: number

rules.ghostSeconds ​

ghostSeconds: number

Seconds a player is a ghost after coming back (passing through cars and people, taking no harm).

rules.loadout? ​

optional loadout?: object[]

What every player starts with (GAME_DESIGN §7.4): stacks of items by id (weapons and their ammunition are items), each in the slot of the strip it names (1 to 16; the number keys select the first nine, and the slot a key selects is the weapon held) or the first free one. Absent: free roam's arsenal, the fists' slot 1 left empty, the pistol, shotgun, rifle, rocket launcher, grenades and tranquilizer on 2 to 7 and the guns' ammunition from 9 on; an empty list: nothing but the phone.

rules.maxPlayers ​

maxPlayers: number

How many players a room of this game takes.

rules.maxStars ​

maxStars: number

The most stars a player may have (GAME_DESIGN §12, 0 to 10): five come from the Heat, six to ten from escalations; a lower cap holds the police's response there (4: no drone).

rules.mode? ​

optional mode?: "solo" | "coop" | "versus"

How the game is played, one mode for all its missions (its creator's pick): single player (solo: no mission has a play, and every room of it is its opener's alone), co-op (coop: every mission is co-op, played by a crew in a run's room from a lobby) or versus (versus: every mission pits two teams or more against each other). Absent: the missions say, each its own (a curated game's mix).

rules.partyRewards ​

partyRewards: "split" | "shared"

How a party's mission reward is paid: each member the whole of it (shared), or the reward divided among them (split).

rules.phone ​

phone: boolean

Whether every character starts with a phone (GAME_DESIGN §7.5); a mission may give one.

rules.playerDamage ​

playerDamage: "on" | "off" | "rivals"

Whether players hurt each other: never, only rivals (players outside one's party), or always.

rules.police ​

police: boolean

Whether the room has police: crimes raise a Wanted level and police cars come (GAME_DESIGN §12).

rules.prices? ​

optional prices?: Record<string, number>

What the shops charge ($), by item id, over the items' own prices (GAME_DESIGN §14).

rules.respawn ​

respawn: "hospital" | "mission"

Where a player who went down comes back: the nearest spawn point (hospital), or where their mission started (mission).

rules.safehouses? ​

optional safehouses?: string[]

Places that are safe houses' doors, besides the places of the kind safehouse: rented for cash, the Heat cools three times as fast inside.

rules.safeZones ​

safeZones: string[]

The game's zones where players cannot hurt each other and no car is carjacked.

rules.traffic ​

traffic: number

Ambient cars driving the level's roads around the players: none unless the game asks (at most 64).

rules.vehicleFire ​

vehicleFire: boolean

Whether a car brought low catches fire, burns and blows up, its blast lighting the cars beside it.

rules.weather? ​

optional weather?: object

The room's weather (GAME_DESIGN §5.7): its climate (the level's by default: a region's biome, temperate for a town; none is always clear), the weather it opens with (start, at an intensity), and whether it changes on its own from there (a front every half an hour, by the climate's odds) or holds. Missions change it (setWeather).

rules.weather.changes ​

changes: boolean

rules.weather.climate? ​

optional climate?: "none" | "temperate" | "meadow" | "forest" | "alpine" | "farmland" | "steppe" | "desert" | "autumn" | "coast"

rules.weather.intensity ​

intensity: number

rules.weather.start? ​

optional start?: "clear" | "overcast" | "rain" | "storm" | "fog" | "snow"

schemaVersion? ​

optional schemaVersion?: number

The document's format (migrate.ts): 1 when absent; a newer one is migrated away before this reads it.

state? ​

optional state?: object

state.counters ​

counters: Record<string, number>

state.flags ​

flags: string[]

title ​

title: string

zones ​

zones: Record<string, { kind?: "pickup" | "spawn" | "safe" | "restricted" | "race_gate" | "checkpoint" | "dropoff"; place: string; radius: number; raises?: "alert" | "heat"; role?: "players" | "police" | "traffic" | "guards" | "hospital"; } | { kind?: "pickup" | "spawn" | "safe" | "restricted" | "race_gate" | "checkpoint" | "dropoff"; polygon: object[]; raises?: "alert" | "heat"; role?: "players" | "police" | "traffic" | "guards" | "hospital"; y?: number; }>


undefined


chatModerator? ​

optional chatModerator?: Moderator

Defined in: apps/api/src/app.ts:159

What checks a public room's chat (POST /moderation/chat): moderator when not given; with FOI_MODERATION=openrouter the word list alone, so the chat never spends the platform model's budget (createChatModerator).


creator? ​

optional creator?: object

Defined in: apps/api/src/app.ts:220

The platform's own model creating games (FOI_CREATOR on): the runners' secret, the month's cap (USD), how often runners' lost leases are swept and how long a claim holds (ms). None: creation is off, /jobs says so.

builds? ​

optional builds?: number

choices? ​

optional choices?: readonly string[]

The models an owner may pick, the first the default (FOI_CREATOR_CHOICES; none: the runners pick by tier).

jobUsd? ​

optional jobUsd?: number

What one creation may spend (USD) and the builds it may run, but for an admin's override.

leaseMs? ​

optional leaseMs?: number

mode? ​

optional mode?: "claude" | "openrouter" | "fake"

The runners' model (FOI_CREATOR): with claude, a model offered must have a list price.

monthlyUsd ​

monthlyUsd: number

secret ​

secret: string

sweepMs? ​

optional sweepMs?: number


curated? ​

optional curated?: (level) => boolean

Defined in: apps/api/src/app.ts:193

Which levels' bundled games are curated games with pages and runs (the levels that ship, main-*, by default).

Parameters ​

level ​

string

Returns ​

boolean


debug? ​

optional debug?: boolean

Defined in: apps/api/src/app.ts:206

The debug routes (FOI_DEBUG=1): the tests set a standing (PUT /debug/standing/:id), and anyone starts a draft on a grid-town or a region (else an admin alone).


entitlement? ​

optional entitlement?: EntitlementMode

Defined in: apps/api/src/app.ts:191

Who the platform is for (FOI_ENTITLEMENT): anyone (the default), or the owners of the game on Steam.


fleet ​

fleet: Fleet

Defined in: apps/api/src/app.ts:152


fleetRegistry? ​

optional fleetRegistry?: object

Defined in: apps/api/src/app.ts:183

The fleet's registry and its secret, when it is on (FOI_FLEET_SECRET).

registry ​

registry: FleetRegistry

secret ​

secret: string


gameUrl? ​

optional gameUrl?: string

Defined in: apps/api/src/app.ts:181

Where players join the cities' rooms (the first game server's public …/game); /info says it.


generator ​

generator: LevelGenerator

Defined in: apps/api/src/app.ts:161

Where spec drafts' levels are generated (the build queue uses it; /health names it).


guestSignups? ​

optional guestSignups?: number

Defined in: apps/api/src/app.ts:234

The new guest accounts one address may make in an hour (FOI_GUEST_SIGNUPS; none or 0: no limit).


jobs ​

jobs: Jobs

Defined in: apps/api/src/app.ts:151


join? ​

optional join?: "open" | "token"

Defined in: apps/api/src/app.ts:208

Whether the game servers ask every player for a join token (FOI_JOIN; /info says it, /play signs one).


optional legal?: LegalInfo

Defined in: apps/api/src/app.ts:187

Who runs the platform (/info says it, the privacy policy and the terms name them).


levels ​

levels: object

Defined in: apps/api/src/app.ts:163

The bundled levels by name, and their names.

names ​

names: readonly string[]

get() ​

get(name): Level | undefined

Parameters ​
name ​

string

Returns ​

Level | undefined


lobbyCoalesceMs? ​

optional lobbyCoalesceMs?: number

Defined in: apps/api/src/app.ts:199

How long a lobby's changes are gathered into one push to its members (ms; 250 by default).


lobbyTickMs? ​

optional lobbyTickMs?: number

Defined in: apps/api/src/app.ts:197

How often the lobbies' clocks are looked at (ms; a second by default): countdowns, votes, members gone.


logger? ​

optional logger?: boolean

Defined in: apps/api/src/app.ts:238

Fastify's logger (off in the tests).


metrics? ​

optional metrics?: ApiMetrics

Defined in: apps/api/src/app.ts:185

Prometheus's metrics (GET /metrics), when kept.


moderator ​

moderator: Moderator

Defined in: apps/api/src/app.ts:153


moderators? ​

optional moderators?: readonly string[]

Defined in: apps/api/src/app.ts:173

The moderators' account ids (FOI_MODERATORS).


now? ​

optional now?: () => Date

Defined in: apps/api/src/app.ts:236

The clock (tests set it).

Returns ​

Date


oauthIssuer? ​

optional oauthIssuer?: string

Defined in: apps/api/src/app.ts:169

The OAuth issuer, where creators sign in for the MCP server (FOI_PUBLIC_URL); url when absent.


quotas ​

quotas: object

Defined in: apps/api/src/app.ts:171

Builds, rooms and creations per account and day, but for an admin's override (creations: 5 when not given).

builds ​

builds: number

creations? ​

optional creations?: number

rooms ​

rooms: number


respect? ​

optional respect?: RespectMode

Defined in: apps/api/src/app.ts:201

Respect (FOI_RESPECT): shown and gating (the default), computed in the shadow, or off.


roomSecret? ​

optional roomSecret?: string

Defined in: apps/api/src/app.ts:179

The room secret: the game servers ask POST /moderation/chat with it.


runSweepMs? ​

optional runSweepMs?: number

Defined in: apps/api/src/app.ts:195

How often the open runs are swept for the lost (ms; a minute by default).


social? ​

optional social?: SocialHub

Defined in: apps/api/src/app.ts:177

Friends, presence, parties and messages (dev friends in memory by default).


steam? ​

optional steam?: SteamApi

Defined in: apps/api/src/app.ts:210

Steam, which signs players in (FOI_STEAM: none by default).


steamStoreUrl? ​

optional steamStoreUrl?: string

Defined in: apps/api/src/app.ts:212

The game's page on the Steam store (FOI_STEAM_STORE_URL), where those without a copy are sent.


store ​

store: Store

Defined in: apps/api/src/app.ts:149


telemetryDays? ​

optional telemetryDays?: number

Defined in: apps/api/src/app.ts:189

How long the players' telemetry is kept (days; /info says it for the privacy policy).


url ​

url: string

Defined in: apps/api/src/app.ts:167

The API's own public URL: artifacts are fetched from it.


webOrigins? ​

optional webOrigins?: readonly string[]

Defined in: apps/api/src/app.ts:214

More origins a Steam sign-in may go back to (FOI_WEB_ORIGINS).