export type DeleteApiProductsArgs = {id?: unknown | undefined, active?: unknown | undefined, name?: unknown | undefined, description?: unknown | undefined, image?: unknown | undefined, metadata?: unknown | undefined, Prefer?: ('return=representation' | 'return=minimal' | 'return=none') | undefined}; export type DeleteApiProductsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * DELETE /products */ export const deleteApiProducts = async (args: DeleteApiProductsArgs, options?: DeleteApiProductsOptions) => { const {baseUrl = "https://vnaabuozknwgxuvnfwjo.supabase.co:443", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.id != null) query.append("id", String(args.id)) if (args.active != null) query.append("active", String(args.active)) if (args.name != null) query.append("name", String(args.name)) if (args.description != null) query.append("description", String(args.description)) if (args.image != null) query.append("image", String(args.image)) if (args.metadata != null) query.append("metadata", String(args.metadata)) if (args.Prefer != null) headers.set("Prefer", String(args.Prefer)) const url = `${baseUrl.replace(/\/+$/, '')}/products${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };