export type PatchApiV3MeArgs = {body: BodyInit}; export type PatchApiV3MeOptions = {baseUrl?: string | undefined, Token?: string | undefined, fetch?: typeof fetch | undefined}; /** * Updates your profile. * * PATCH /v3/me */ export const patchApiV3Me = async (args: PatchApiV3MeArgs, options?: PatchApiV3MeOptions) => { const {baseUrl = "https://api.sketchfab.com", fetch: fetchFn = fetch, Token} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (Token !== undefined) headers.set("Authorization", Token) const url = `${baseUrl.replace(/\/+$/, '')}/v3/me${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers, body: args.body}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };