export type Tables = {id: string, created_at: unknown, title: unknown, organization_id: string, color?: unknown | undefined, eventspace_id: string, icon?: unknown | undefined, archived_at?: unknown | undefined, archived_by?: string | undefined, created_by?: string | undefined, due_date?: unknown | undefined, is_archived?: boolean | undefined, selected_view_id?: string | undefined, start_date?: unknown | undefined, status_property_id?: string | undefined, tool_type?: ('task' | 'budget') | undefined, updated_at?: unknown | undefined, updated_by?: string | undefined}; export type PatchApiTablesArgs = {id?: string | undefined, created_at?: unknown | undefined, title?: unknown | undefined, organization_id?: string | undefined, color?: unknown | undefined, eventspace_id?: string | undefined, icon?: unknown | undefined, archived_at?: unknown | undefined, archived_by?: string | undefined, created_by?: string | undefined, due_date?: unknown | undefined, is_archived?: unknown | undefined, selected_view_id?: string | undefined, start_date?: unknown | undefined, status_property_id?: string | undefined, tool_type?: unknown | undefined, updated_at?: unknown | undefined, updated_by?: string | undefined, Prefer?: ('return=representation' | 'return=minimal' | 'return=none') | undefined, body: Tables}; export type PatchApiTablesOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * PATCH /tables */ export const patchApiTables = async (args: PatchApiTablesArgs, options?: PatchApiTablesOptions) => { 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.id != null) query.append("id", String(args.id)) if (args.created_at != null) query.append("created_at", String(args.created_at)) if (args.title != null) query.append("title", String(args.title)) if (args.organization_id != null) query.append("organization_id", String(args.organization_id)) if (args.color != null) query.append("color", String(args.color)) if (args.eventspace_id != null) query.append("eventspace_id", String(args.eventspace_id)) if (args.icon != null) query.append("icon", String(args.icon)) if (args.archived_at != null) query.append("archived_at", String(args.archived_at)) if (args.archived_by != null) query.append("archived_by", String(args.archived_by)) if (args.created_by != null) query.append("created_by", String(args.created_by)) if (args.due_date != null) query.append("due_date", String(args.due_date)) if (args.is_archived != null) query.append("is_archived", String(args.is_archived)) if (args.selected_view_id != null) query.append("selected_view_id", String(args.selected_view_id)) if (args.start_date != null) query.append("start_date", String(args.start_date)) if (args.status_property_id != null) query.append("status_property_id", String(args.status_property_id)) if (args.tool_type != null) query.append("tool_type", String(args.tool_type)) if (args.updated_at != null) query.append("updated_at", String(args.updated_at)) if (args.updated_by != null) query.append("updated_by", String(args.updated_by)) if (args.Prefer != null) headers.set("Prefer", String(args.Prefer)) const url = `${baseUrl.replace(/\/+$/, '')}/tables${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 };