feat: add API method for replacing source files in documents

This commit is contained in:
CaptainB 2025-10-20 15:51:04 +08:00
parent 620d4ff996
commit aa42c6f76f
2 changed files with 22 additions and 0 deletions

View File

@ -134,6 +134,16 @@ const getDownloadSourceFile: (knowledge_id: string, document_id: string, documen
return exportFile(document_name, `${prefix}/${knowledge_id}/document/${document_id}/download_source_file`, {}, undefined)
}
const postReplaceSourceFile: (knowledge_id: string, document_id: string, data: any) => Promise<Result<any>> = (
knowledge_id,
document_id,
data,
) => {
return post(`${prefix}/${knowledge_id}/document/${document_id}/replace_source_file`, data, {}, undefined)
}
/**
*
* @param document_name
@ -567,6 +577,7 @@ export default {
putBatchCancelTask,
putCancelTask,
getDownloadSourceFile,
postReplaceSourceFile,
exportDocument,
exportDocumentZip,
putDocumentRefresh,

View File

@ -134,6 +134,16 @@ const getDownloadSourceFile: (knowledge_id: string, document_id: string, documen
return exportFile(document_name, `${prefix}/${knowledge_id}/document/${document_id}/download_source_file`, {}, undefined)
}
const postReplaceSourceFile: (knowledge_id: string, document_id: string, data: any) => Promise<Result<any>> = (
knowledge_id,
document_id,
data,
) => {
return post(`${prefix}/${knowledge_id}/document/${document_id}/replace_source_file`, data, {}, undefined)
}
/**
*
* @param document_name
@ -568,6 +578,7 @@ export default {
putBatchCancelTask,
putCancelTask,
getDownloadSourceFile,
postReplaceSourceFile,
exportDocument,
exportDocumentZip,
putDocumentRefresh,