// TODO: Write a simple rust crate that generates these from the OpenAPI spec import { z } from 'zod' if (process.env.NEXT_PUBLIC_API_URL === undefined) { throw new Error('Expected API url environment variable') } export const API_BASE = new URL(process.env.NEXT_PUBLIC_API_URL) export const EventInput = z.object({ name: z.string().optional(), times: z.string().array(), timezone: z.string(), }) export type EventInput = z.infer export const EventResponse = z.object({ id: z.string(), name: z.string(), times: z.string().array(), timezone: z.string(), created_at: z.number(), }) export type EventResponse = z.infer export const PersonInput = z.object({ availability: z.string().array(), }) export type PersonInput = z.infer export const PersonResponse = z.object({ name: z.string(), availability: z.string().array(), created_at: z.number(), }) export type PersonResponse = z.infer export const StatsResponse = z.object({ event_count: z.number(), person_count: z.number(), version: z.string(), }) export type StatsResponse = z.infer