export type DeleteApiProfilePublicIdOptions = {baseUrl?: string | undefined, BearerAdmin?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Profile * * DELETE /profile/{public_id}/ * * Also accepts auth: BearerProfile */ export const deleteApiProfilePublicId = async (options?: DeleteApiProfilePublicIdOptions) => { const {baseUrl = "https://api.wefitter.com/api/v1", fetch: fetchFn = fetch, BearerAdmin} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (BearerAdmin !== undefined) headers.set("Authorization", BearerAdmin) const url = `${baseUrl.replace(/\/+$/, '')}/profile/${encodeURIComponent(String(args.public_id))}/${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 };