nodejs-storage icon indicating copy to clipboard operation
nodejs-storage copied to clipboard

file.move return type (MoveResponse) is mostly un-typed

Open mgabeler-lee-6rs opened this issue 2 years ago • 3 comments

Environment details

  • OS: n/a
  • Node.js version: n/a
  • npm version: n/a
  • @google-cloud/storage version: 7.6.0

Steps to reproduce

  1. Install the library
  2. Observe the Promise-ified return type of file.move

The MoveResponse type (defined at https://github.com/googleapis/nodejs-storage/blob/v7.6.0/src/file.ts#L266) is just [unknown]. This doesn't seem correct, and is certainly unhelpful.

From the definition of MoveCallback (at https://github.com/googleapis/nodejs-storage/blob/v7.6.0/src/file.ts#L268-L274), it seems like it should be something like [File, unknown] matching destinationFile, apiResponse for the non-error version of the callback args.

mgabeler-lee-6rs avatar Nov 14 '23 22:11 mgabeler-lee-6rs

Thanks for opening an issue @mgabeler-lee-6rs. We are in the process of cleaning up / more strongly typing things within the library. Looking back at the history MoveResponse was originally [Metadata] where Metadata = any. There are quiet a few places where the callback versions don't necessarily align with the promisified version. We intend to clean those up as well. Unfortunately, more strongly typing things / changing signatures are a breaking change that will have to wait until the next major revision of the library.

ddelgrosso1 avatar Nov 15 '23 14:11 ddelgrosso1

Any updates on this?

crossan007 avatar Oct 18 '24 15:10 crossan007

@crossan007 our next major version is currently being worked on and this should be part of that release. No firm timeline on the date for release but I'll update accordingly.

ddelgrosso1 avatar Oct 18 '24 16:10 ddelgrosso1

Any idea if this has been released yet?

crossan007 avatar Jan 22 '25 23:01 crossan007

@crossan007 it has not been released as of yet. Work is still being done to prepare the next major revision of this library.

ddelgrosso1 avatar Feb 03 '25 21:02 ddelgrosso1