export type DeleteApiV1FilesIdArgs = {id: string}; export type DeleteApiV1FilesIdOptions = {baseUrl?: string | undefined, defaultValue?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a file * * DELETE /v1/files/{id} */ export const deleteApiV1FilesId = async (args: DeleteApiV1FilesIdArgs, options?: DeleteApiV1FilesIdOptions) => { const {baseUrl = "https://api.airtop.ai/api", fetch: fetchFn = fetch, defaultValue} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (defaultValue !== undefined) headers.set('authorization', `Bearer ${defaultValue}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/files/${encodeURIComponent(String(args.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 };