Single source of truth for the Journal REST API: - API_VERSION semver constant (1.0.0) - Endpoint path constants (routes, activities, auth, uploads, push) - Zod schemas for all request/response shapes: - Routes: list, detail, create, update, compute - Activities: list, detail, create - Auth: token exchange, refresh, device management - Discovery: instance info + API version - Uploads: presigned URL flow - Errors: structured error response with field-level details - Cursor-based pagination schemas - TypeScript types inferred from Zod (z.infer) Used by Journal server (validation) and mobile client (type safety). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
56 lines
1.5 KiB
TypeScript
56 lines
1.5 KiB
TypeScript
export { API_VERSION } from "./version.ts";
|
|
export { ENDPOINTS } from "./endpoints.ts";
|
|
|
|
// Error schemas
|
|
export {
|
|
ApiErrorResponseSchema, FieldErrorSchema, ERROR_CODES,
|
|
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,
|
|
ComputeRouteRequestSchema,
|
|
type RouteSummary, type RouteDetail, type RouteVersion,
|
|
type RouteListResponse,
|
|
type CreateRouteRequest, type UpdateRouteRequest,
|
|
type ComputeRouteRequest,
|
|
} from "./routes.ts";
|
|
|
|
// Activities
|
|
export {
|
|
ActivitySummarySchema, ActivityDetailSchema,
|
|
ActivityListResponseSchema,
|
|
CreateActivityRequestSchema,
|
|
type ActivitySummary, type ActivityDetail,
|
|
type ActivityListResponse,
|
|
type CreateActivityRequest,
|
|
} from "./activities.ts";
|
|
|
|
// Uploads
|
|
export {
|
|
PresignedUploadRequestSchema, PresignedUploadResponseSchema,
|
|
type PresignedUploadRequest, type PresignedUploadResponse,
|
|
} from "./uploads.ts";
|