mirror of
https://github.com/djdevin/recflare.git
synced 2026-09-08 14:41:28 -07:00
178d3b5b0e
* [auth][api] accept the 20250424.01 client * [2025] unstable * 20250718.0 * correct one this time * stubs * more stubs * more stubs * [lists] add worker * [ai] route stubs * [api] player photo setting * [econ] add roomEconConfig route * [infra] update worker generators * [worker] add cards/moderation/platformnotification workers * [lists] updates to some endpoints * [clubs] stub out announcement endpoint, for now * [econ] stub out season endpoints for now * [chat] apps/chat stub out party endpoint not sure the shape yet * [api] stub out statsig and lockeditems * [doc] new services * [lists] stub the bulk endpoint * [datacollection] add placeholder service until we can kill it * [api] set gifting to lvl5 * update lock * [cdn] enable cache * [match] matchmake v2 * [lists] stub some lists * [ai] stubs * [rooms] new subroom save endpoint * [econ] add bulk purchase endpoint * [discovery] update featured creator to 1 for fun * [api] add photo settings flag * [chat] fixup chat permissions (sorta) * [auth] restrictions endpoint * [rooms] contributed endpoint * [api] fix outfit endpoint * [discovery] attempt to fix store * [chat] privacy endpoints * [api] cheered images * [rooms] add xp endpoint (disbaled) * [rooms] add xp endpoint (disabled) * update images-db for cheers * [rooms] add autocomplete endpoint * [cdn/img] increase cache ttl for statics * [api] bulk route for images * [accounts] add banner image * [api] add misc missing endpoints * [discovery] remove AI tab * [platformnotifications] stub some endpoints * [lists] add some more lists * [rooms] additional endpoints * [chat] stub a few privacy endpoints * [econ] stub some endpoints * misc db fixes * [api] tweak shape for images v6 * [rooms] dont show trending RROs
59 lines
2.1 KiB
Markdown
59 lines
2.1 KiB
Markdown
# rooms
|
|
|
|
Room Worker served on the `rooms` subdomain (`rooms.recflare.net`) — a Hono app owning
|
|
room storage, the browse/search feeds, per-player cheers and favorites, the owner's room
|
|
settings, and subrooms.
|
|
|
|
Rooms live in the shared `recflare` D1 as one JSON blob per room (queryable fields are
|
|
SQLite generated columns); reads serve that blob verbatim, which is why every shape is
|
|
the client's PascalCase one. Subrooms are their own table — their ids come from a single
|
|
global sequence, not per room — and are re-attached to each room on read. The seed rooms,
|
|
including the dorm, come from `static/ImportRooms.json`.
|
|
|
|
## API documentation
|
|
|
|
`GET /openapi.json` serves a spec generated from `describeRoute` blocks that sit
|
|
alongside each handler, with the schemas in `src/openapi.ts`. It's also aggregated into
|
|
the docs page www serves at `/docs`.
|
|
|
|
**The spec is descriptive, not enforced** — same rationale as the `auth`/`match`/`clubs`
|
|
workers: a reverse-engineered protocol, lenient handlers, no runtime validation. A test
|
|
asserts every route appears in the spec, so adding one without documenting it fails.
|
|
|
|
## Response envelopes
|
|
|
|
Two envelopes appear side by side, and which one a route uses is dictated by the client's
|
|
deserializer for that call — not a choice, and not something to unify:
|
|
|
|
- `{ Success, Value, ErrorId, Error }` (PascalCase) — a bare result with a message.
|
|
- `{ success, error, value }` (lowercase) — carries the updated room, which the client
|
|
re-renders from.
|
|
|
|
Both answer HTTP 200 even for a rejection: the client reads the flag, not the status.
|
|
Only a missing or invalid token is a real 401, and only the owner/co-owner gate is a 403.
|
|
|
|
Reads are the exception: they carry no envelope at all. A paged read (the save history at
|
|
`…/subrooms/{subRoomId}/saves` and its lighter `…/saves/no_unity_assets` twin) is a bare
|
|
`{ Results, TotalResults, TotalCount }` wrapper — `TotalResults` and `TotalCount` are the
|
|
same number, because the client's paged DTO and the reference disagree on the name.
|
|
|
|
## Development
|
|
|
|
### Run in dev mode
|
|
|
|
```sh
|
|
pnpm dev
|
|
```
|
|
|
|
### Run tests
|
|
|
|
```sh
|
|
pnpm test
|
|
```
|
|
|
|
### Deploy
|
|
|
|
```sh
|
|
pnpm turbo deploy
|
|
```
|