Files
Devin Zuczek f871736839 [api] player photo tagging setting
GET/PUT /api/players/v1/playerPhotoTaggingSetting, ported from the reference's
PlayerDB.Get/SetPlayerPhotoTaggingSetting. Backed by the shared player-settings
KV bag (owned by the `playersettings` worker) under a `PlayerPhotoTaggingSetting`
key rather than its own table.

The setting is served as the enum ORDINAL (0 Anyone / 1 Friends / 2 NoOne) — the
reference registers no JsonStringEnumConverter, so the client decodes a number.
Unset reads back 0; the PUT answers a bare true, or false when the body carries
no recognizable setting, as the reference's bool does.

The write merges into the player's settings map and seeds the `playersettings`
defaults when there is none yet, so writing this key can't cost a player the
seeding that worker's first read would have done.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-16 00:34:54 -04:00
..
2026-08-16 00:34:54 -04:00
2026-08-15 13:54:34 -04:00
2026-06-09 00:49:11 -04:00
2026-07-21 21:42:14 -04:00
2026-06-29 23:16:42 -04:00
2026-06-09 00:49:11 -04:00
2026-06-30 23:57:29 -04:00

api

Game API Worker served on the api subdomain. A Hono app serving the game's API surface. Database-backed queries and on-disk JSON files are stubbed for now — no real bindings yet.

Behavior

  • Auth-gated routes validate the Bearer JWT issued by the auth worker (same dev secret, see src/jwt.ts) and 401 when it's missing/invalid.
  • Static data is served verbatim:
    • src/default-avatar-items.tsGET /api/avatar/v4/items
    • src/default-settings.tsGET /api/settings/v2
  • DB-backed reads return empty collections / not-found.
  • File-backed reads return empty placeholders, each marked TODO: hydrate in src/api.app.ts (Workers have no filesystem — these will move to a binding or inline JSON later).

TODO before production

  • Wire a DB binding (D1/DO) for rooms, avatars, settings, gifts, balances, etc.
  • Hydrate the TODO: hydrate endpoints with real config/JSON.
  • Move the JWT secret to a shared secret binding (shared with auth).
  • Persist uploads from POST /api/images/v4/uploadsaved (e.g. R2).