export type DeleteApiV1LibrariesLibraryIdDocumentsDocumentIdArgs = {library_id: string, document_id: string}; export type DeleteApiV1LibrariesLibraryIdDocumentsDocumentIdOptions = {baseUrl?: string | undefined, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a document. * * DELETE /v1/libraries/{library_id}/documents/{document_id} */ export const deleteApiV1LibrariesLibraryIdDocumentsDocumentId = async (args: DeleteApiV1LibrariesLibraryIdDocumentsDocumentIdArgs, options?: DeleteApiV1LibrariesLibraryIdDocumentsDocumentIdOptions) => { const {baseUrl = "https://api.mistral.ai", fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiKey !== undefined) headers.set('authorization', `Bearer ${ApiKey}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/libraries/${encodeURIComponent(String(args.library_id))}/documents/${encodeURIComponent(String(args.document_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 };