export type DeleteApiDocumentsV2FilesFileIdArgs = {file_id: string}; export type DeleteApiDocumentsV2FilesFileIdOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * DELETE /documents/v2/files/{file_id} */ export const deleteApiDocumentsV2FilesFileId = async (args: DeleteApiDocumentsV2FilesFileIdArgs, options?: DeleteApiDocumentsV2FilesFileIdOptions) => { const {baseUrl = "https://api.tensorlake.ai", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/documents/v2/files/${encodeURIComponent(String(args.file_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 };