An installation now asks for its TREK services key a few minutes after it starts, and the daily check registers a missing key as well as renewing a due one. Until now nothing happened before someone searched for a place or opened the admin settings, so "Share place details" stayed unavailable on a fresh or updated instance. When an admin agrees to share place details, what users typed into places since TREK 5.1.0 goes out too, not only what they type from then on. The origin of every field is recorded since 5.1.0 whatever the decision, so a catch-up walks those places page by page before each send run: only values that are still the ones a user typed, only for fields switched on, only for places the service can key, and only while the queue holds fewer than 200 values. It goes on where it stopped after a restart, never replaces a newer value a save queued, and ends on switching off, declining or withdrawing everything. A field switched on later catches up as well, under an agreement given with the new prompt sentence that says so; an agreement from 5.1.0 does not. Queuing moves into PlaceContribQueue so a save and the catch-up take the same path.
@trek/shared
Single source of truth for TREK's API contracts, expressed as Zod schemas and consumed by both the server (request validation + inferred DTO types) and the client (typed requests/responses).
This package is part of the incremental NestJS + React 19 migration (see the "Brownfield Rewrite" board). It is intentionally dormant until modules start importing it — adding it changes nothing for users.
Rules
- One folder per domain:
src/<domain>/<domain>.schema.ts(+.spec.ts). - Domain-agnostic building blocks live in
src/common/. - A route is only considered migrated once its contract lives here.
- Schemas are the source of truth; server DTOs and client types are inferred from them
(
z.infer<typeof schema>), never hand-duplicated.
Consumption (dev)
Both apps resolve @trek/shared to this package's TypeScript source:
- Server (
tsx): viapathsinserver/tsconfig.json. - Client (
vite): viaresolve.aliasinclient/vite.config.ts(+pathsfor the type-checker).
Production packaging (Docker / workspace wiring) is introduced in card F2, when the server first depends on this package at runtime. Until then prod builds are untouched.
Not yet here
The canonical error envelope is finalised in card F5 (it must match TREK's current Express error responses byte-for-byte), so it is deliberately not invented in F1.