export type CreateApiRpcGetUserIdArgs = {Prefer?: 'params=single-object' | undefined, body: {apikey: unknown}}; export type CreateApiRpcGetUserIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /rpc/get_user_id */ export const createApiRpcGetUserId = async (args: CreateApiRpcGetUserIdArgs, options?: CreateApiRpcGetUserIdOptions) => { 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.Prefer != null) headers.set("Prefer", String(args.Prefer)) const url = `${baseUrl.replace(/\/+$/, '')}/rpc/get_user_id${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 };