export type Columns = {id: string, created_at: unknown, title: unknown, order?: number | undefined, table_id?: string | undefined, unit_amount?: number | undefined, expires_at?: unknown | undefined, type?: unknown | undefined, is_budget?: boolean | undefined, event_id?: string | undefined, color?: unknown | undefined, lucide_icon?: unknown | undefined, property_id?: string | undefined}; export type CreateApiColumnsArgs = {select?: string | undefined, Prefer?: ('return=representation' | 'return=minimal' | 'return=none' | 'resolution=ignore-duplicates' | 'resolution=merge-duplicates') | undefined, body: Columns}; export type CreateApiColumnsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /columns */ export const createApiColumns = async (args: CreateApiColumnsArgs, options?: CreateApiColumnsOptions) => { const {baseUrl = "https://vnaabuozknwgxuvnfwjo.supabase.co:443", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.select != null) query.append("select", String(args.select)) if (args.Prefer != null) headers.set("Prefer", String(args.Prefer)) const url = `${baseUrl.replace(/\/+$/, '')}/columns${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };