jira-node / node-jira-client

A Node.js wrapper for the Jira REST API
https://jira-node.github.io/
MIT License
450 stars 169 forks source link

createVersion and updateVersion Implementation and Types #306

Closed dougmaitelli closed 4 years ago

dougmaitelli commented 4 years ago

Looking at the source code here: https://github.com/jira-node/node-jira-client/blob/22b39c6844d43b898b9976cbc86ac1b0f53549ba/src/jira.js#L532

It seems there is some unclear information between the methods createVersion and updateVersion, the first says on comments the parameter is an object, the second says it is a string. But looking at the code it seems both are actually expecting an object in fact.

This caused the types from DefinitelyTyped to list both of them as string somehow, and when using this library on typescript it is impossible to use the createVersion method.

Can you please provide some light on that?

pioug commented 4 years ago

@dougmaitelli Seems like a mistake. Can you create a PR to change string to object?

dougmaitelli commented 4 years ago

You mean like this? https://github.com/jira-node/node-jira-client/pull/309 That would be a simple / short comment doc change then.

dougmaitelli commented 4 years ago

Does anyone have experience contributing to DefinitelyTyped to fix the types there? https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/jira-client/index.d.ts#L59

pioug commented 4 years ago

Thanks for the PR. I updated the package.

I personnaly never contributed to DefinitelyTyped. It's out of our control, so you have to check with them directly 💦