export type Properties = {id: string, created_at: unknown, name?: unknown | undefined, type?: ('text' | 'select' | 'number' | 'user' | 'link' | 'date' | 'checkbox' | 'column') | undefined, updated_at?: unknown | undefined, is_visible?: boolean | undefined, order?: number | undefined, budget_id?: string | undefined, columns: unknown, is_immutable?: boolean | undefined, options: unknown, table_id?: string | undefined, currency?: unknown | undefined, number_format?: ('number' | 'currency') | undefined}; export type CreateApiPropertiesArgs = {select?: string | undefined, Prefer?: ('return=representation' | 'return=minimal' | 'return=none' | 'resolution=ignore-duplicates' | 'resolution=merge-duplicates') | undefined, body: Properties}; export type CreateApiPropertiesOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /properties */ export const createApiProperties = async (args: CreateApiPropertiesArgs, options?: CreateApiPropertiesOptions) => { 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(/\/+$/, '')}/properties${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 };