minio / minio-js

MinIO Client SDK for Javascript
https://docs.min.io/docs/javascript-client-quickstart-guide.html
Apache License 2.0
951 stars 277 forks source link

missing possible parameters in client methods #1247

Open d-michail opened 11 months ago

d-michail commented 11 months ago

Hi,

I am experiencing a small issue with the minio client types. I am trying to call a few functions like getObject, listObjects and copyObject but the type definitions seem to be incomplete.

As an example I am using

client.getObject(bucket, uuId, { versionId: 'myversion' })

The underlying implementation supports the call, but the type does not, assuming that I always use a callback for the 3rd parameter. Am I missing something obvious here, or is it just a bug in the types definition? If it is, I can possibly send a PR.

aldy505 commented 11 months ago

This is supposed to be typing's mistake. But I can see that it should be fixed on https://github.com/minio/minio-js/pull/1186

prakashsvmx commented 11 months ago

Please use the latest async await /promise style. The callback style is deprecated. We are migrating to typescript, the migration is still in progress.

@d-michail

shirecoding commented 3 weeks ago

i can confirm this is still the case,

Expected 4 arguments, but got 3.ts(2554)
client.d.mts(314, 72): An argument for 'putOpts' was not provided.
(method) TypedClient.setObjectTagging(bucketName: string, objectName: string, tags: Tags, putOpts: TaggingOpts): Promise<void>

setObjectTagging(bucketName: string, objectName: string, tags: Tags, putOpts: TaggingOpts): Promise<void>;

putOpts in setObjectTagging is now not optional? it was optional in minio 7 and in the docs

woodytang commented 2 weeks ago

i can confirm this is still the case,

Expected 4 arguments, but got 3.ts(2554)
client.d.mts(314, 72): An argument for 'putOpts' was not provided.
(method) TypedClient.setObjectTagging(bucketName: string, objectName: string, tags: Tags, putOpts: TaggingOpts): Promise<void>

setObjectTagging(bucketName: string, objectName: string, tags: Tags, putOpts: TaggingOpts): Promise<void>;

putOpts in setObjectTagging is now not optional? it was optional in minio 7 and in the docs

exactly same here!

prakashsvmx commented 2 weeks ago

We will update it in a new PR. feel free to send a PR too.

async setObjectTagging(bucketName: string, objectName: string, tags: Tags, putOpts: TaggingOpts) {