@Yovira
Yes, the response is correct. As the API response is multipart, you need to parse it to get the resultant document. For example, please check the sample Node.js code to compare two word documents from the local drive. It will give you an idea of how to resolve your issue.
const { WordsApi, CompareData, CompareDocumentOnlineRequest } = require("asposewordscloud");
var fs = require('fs');
const compare = async () => {
// Get Client ID and Secret from https://dashboard.aspose.cloud/
wordsApi = new WordsApi("xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "xxxxxxxxxxxxxxxxxxxxxxxxx");
try {
const requestDocument = fs.createReadStream("compareTestDoc1.doc");
const requestCompareData = new CompareData({
author: "author"
})
const requestComparingDocument = fs.createReadStream("compareTestDoc2.doc");
const compareRequest = new CompareDocumentOnlineRequest({
document: requestDocument,
compareData: requestCompareData,
comparingDocument: requestComparingDocument
//destFileName: "CompareDocumentOut.doc"
});
wordsApi.compareDocumentOnline(compareRequest)
.then((compareRequestResult) => {
// tslint:disable-next-line:no-console
const compareOutputDocument =compareRequestResult.body.document.entries().next().value[1];
fs.writeFileSync("CompareDocumentOut.doc", compareOutputDocument);
});
} catch (err) {
throw err;
}
}
compare()
.then(() => {
console.log("documents compared.... successfully");
})
.catch((err) => {
console.log("Error occurred while comparing the documents:", err);
})
Furthermore, please note that the Aspose.Words Cloud SDK for Node.js has .ts files; you can use the SDK with typescript. However, if you are having some issues using it, then please share some details of the issues. We will look into these and help you use the SDK.