Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

680 B
Raw Blame
import { compactValhallaRequest, type ValhallaRelayAction } from '@trek/shared';
import { postValhallaRelay } from '../api/valhallaRelay';

/**
 * Routing through the TREK services. **Deliberately online-only and without a
 * Dexie table:** a route is asked for while planning, and the routes worth
 * keeping are kept by the route cache, whichever router drew them. A line to
 * describe goes as a polyline, which keeps a long one under the relay's limit.
 */
export const valhallaRelayRepo = {
  ask(action: ValhallaRelayAction, body: object, signal?: AbortSignal): Promise<Response> {
    return postValhallaRelay(action, compactValhallaRequest(action, body), signal);
  },
};