watson-developer-cloud / node-sdk

:comet: Node.js library to access IBM Watson services.
https://www.npmjs.com/package/ibm-watson
Apache License 2.0
1.48k stars 668 forks source link

languageTranslator.getTranslatedDocument's result is not pipeable/readable #1041

Closed LuisPeregrinaPSL closed 3 years ago

LuisPeregrinaPSL commented 4 years ago

Remember, an issue is not the place to ask questions. If you have issues with the APIs or have a question about the Watson services, see Stack Overflow.

Before you open an issue, please check if a similar issue already exists or has been closed before.

Check service status

  1. For service issues or 5xx errors, first, go to the IBM Cloud status page and check the status of the service.
  2. If the service status is OK, continue with a bug report.

Overview Following Language Translator Getting Started

Expected behavior File gets written to.

Actual behavior error: TypeError: result.pipe is not a function

How to reproduce A document has been requested to translate, document id has been created, status is 'available'

SDK Version "ibm-watson": "^5.5.0",

Additional information:

Additional context All of the other methods work, seems the problem is in the result, which is also circular (revealed via JSON.stringify).

dpopp07 commented 4 years ago

Thanks for the issue, I will look into this today

LuisPeregrinaPSL commented 4 years ago

Turn's out it's result's result (result['result'] or result.result). Maybe something changed in the Promise and the doc has not been updated.

dpopp07 commented 4 years ago

Yep, just realized the same. The documentation is out of date. I will fix that ASAP. Thanks for bringing this to our attention!

LuisPeregrinaPSL commented 4 years ago

Also, Promise<LanguageTranslatorV3.Response<NodeJS.ReadableStream | Buffer>> It seems that the Response was refactored to include the buffer inside the response, instead of extending, as I understand, in the typing (v3.d.ts).

dpopp07 commented 4 years ago

Indeed

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs. Thank you for your contributions.