chargebee / chargebee-typescript

Typescript library for the Chargebee API.
https://apidocs.chargebee.com/docs/api?lang=typescript
MIT License
22 stars 16 forks source link

[Types] Add return types to api requests #7

Closed L-U-C-K-Y closed 2 years ago

L-U-C-K-Y commented 3 years ago

Hi Chargebee Team

Thank you for adding typescript support, it's a huge help for us already!

Currently, the API methods in the library do not have return types and are all wrapped in the RequestWrapper class. While working, it passes on quite a big part where Typescript can help us to develop more safely and efficiently.

I would appreciate if you add return types to all API calls.

Thanks and kind regards

Lucky

ibratoev commented 3 years ago

The current TypeScript implementation is of amazingly bad quality. Not having typed return types defeats the whole purpose of using TypeScript.

sebastien-lb commented 2 years ago

Hello ChargeBee Team ! Do you plan to add the return types of the API in the lib? I think this is a huge use case of the API. Thanks :)

cb-khushbubibay commented 2 years ago

This has been merged in v2.4.0.

ifeelfishy commented 2 years ago

This has been merged in v2.4.0.

Has it? How do we access them?

ralphstodomingo commented 2 years ago

I don't see the return types as well - everything's still returning RequestWrapper types.

ibratoev commented 2 years ago

@cb-khushbubibay The types were not really added. Looking at the commit (https://github.com/chargebee/chargebee-typescript/commit/24c3398b08dbcf5f166abf583ecaf0872ce57997) it just adds RequestWrapper explicitly for the return type. This is not what this 1+ year issue is about. It is about typing the actual return types. Please, reopen.

wodka commented 2 years ago

Hi, I've just created a PR as it is really annoying to not have types on the requests. I did update all places that were returning a RequestWrapper and extended RequestWrapper to per default return a Model

L-U-C-K-Y commented 2 years ago

@cb-khushbubibay @cb-rakesh @cb-goutham @cb-yateshmathuria @cb-navaneedhan

Please review, fix and merge the PR from @wodka (great username btw).

Having a 'RequestWrapper' return type on its own is useless.

https://github.com/chargebee/chargebee-typescript/pull/23

Thanks!