Synchronous path + rendering for the surface/waytype breakdown: - map-core `computeSurfaceBreakdown(coords, surfaces, highways)` → distance- weighted metres per surface + waytype category (unit-tested); - `SurfaceBreakdownSchema` in @trails-cool/api; - nullable `surfaceBreakdown` jsonb on routes + activities; - Planner `SaveToJournalButton` computes it from the BRouter waytags already in routeData and sends it; `api.save-to-journal` forwards it; the journal route callback validates + persists (journal is the authoritative validator); - `SurfaceBreakdown` component (stacked bars per dimension, map-core palettes, legend category · % · km largest-first, unknown → "other", hidden when empty) on route + activity detail; journal gains a @trails-cool/map-core dep; - i18n journal.surface.* (en + de). Phase 2 (async Overpass backfill + SSE for imports/uploads, and the e2e that seeds a breakdown) follows in a separate PR. Tests: computeSurfaceBreakdown unit (map-core 36); SurfaceBreakdown component (jsdom, journal 326). typecheck + lint green; verified in the browser. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
65 lines
1.8 KiB
TypeScript
65 lines
1.8 KiB
TypeScript
export { API_VERSION } from "./version.ts";
|
|
export { ENDPOINTS } from "./endpoints.ts";
|
|
|
|
// Error schemas
|
|
export {
|
|
ApiErrorResponseSchema, FieldErrorSchema, ERROR_CODES,
|
|
zodIssuesToFieldErrors,
|
|
type ApiErrorResponse, type FieldError,
|
|
} from "./errors.ts";
|
|
|
|
// Pagination
|
|
export {
|
|
PaginationQuerySchema, PaginatedResponseSchema,
|
|
type PaginationQuery, type PaginatedResponse,
|
|
} from "./pagination.ts";
|
|
|
|
// Discovery
|
|
export {
|
|
DiscoveryResponseSchema,
|
|
type DiscoveryResponse,
|
|
} from "./discovery.ts";
|
|
|
|
// Auth
|
|
export {
|
|
TokenExchangeRequestSchema, TokenResponseSchema,
|
|
DeviceSchema, DeviceListResponseSchema,
|
|
type TokenExchangeRequest, type TokenResponse,
|
|
type Device, type DeviceListResponse,
|
|
} from "./auth.ts";
|
|
|
|
// Routes
|
|
export {
|
|
RouteSummarySchema, RouteDetailSchema, RouteVersionSchema,
|
|
RouteListResponseSchema,
|
|
CreateRouteRequestSchema, UpdateRouteRequestSchema,
|
|
CreateRouteResponseSchema,
|
|
ComputeRouteRequestSchema,
|
|
type RouteSummary, type RouteDetail, type RouteVersion,
|
|
type RouteListResponse,
|
|
type CreateRouteRequest, type UpdateRouteRequest,
|
|
type CreateRouteResponse,
|
|
type ComputeRouteRequest,
|
|
} from "./routes.ts";
|
|
|
|
// Surface / waytype breakdown
|
|
export { SurfaceBreakdownSchema, type SurfaceBreakdown } from "./surface-breakdown.ts";
|
|
|
|
// Activities
|
|
export {
|
|
ActivitySummarySchema, ActivityDetailSchema,
|
|
ActivityListResponseSchema,
|
|
CreateActivityRequestSchema, CreateActivityResponseSchema,
|
|
SPORT_TYPES, SportTypeSchema,
|
|
type ActivitySummary, type ActivityDetail,
|
|
type ActivityListResponse,
|
|
type CreateActivityRequest, type CreateActivityResponse,
|
|
type SportType,
|
|
} from "./activities.ts";
|
|
|
|
// Uploads
|
|
export {
|
|
PresignedUploadRequestSchema, PresignedUploadResponseSchema,
|
|
ALLOWED_UPLOAD_CONTENT_TYPES, sanitizeUploadFilename,
|
|
type PresignedUploadRequest, type PresignedUploadResponse,
|
|
} from "./uploads.ts";
|