-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add typing to all requests #23
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this does not account for lists and their specific format in chargebee, or am i mistaken?
I think you are right - will add that as well |
You are a hero! Also the properties |
@ifeelfishy I've updated the types now - I actually missed how the Result / ListResult is built and updated that logic now to reflect the types. |
I missed that too. Very nice. |
Getting this merged would be a huge win for our team/company. We are ChargeBee paying customers and have had to write a lot of manual typescript to handle the issue of |
@wodka Also, how does it play with the lazy loading feature of this library? From what i see in the usage
will return {list: [{},{},{} ...], next_offset}, with list of empty objects |
@ifeelfishy I guess you just did a console.log on it right? It does look super strange when doing a console.log on it - but this change doesn't modify that behaviour import { ListResult } from './lib/list_result'
import { ChargeBee } from './src/chargebee'
(async () => {
console.log('just to check!!')
const c = new ChargeBee()
c.configure()
const result = await c.addon.list().request()
console.log(result)
console.log(result.list[0].addon)
})() will reduce the following: |
@cb-khushbubibay @cb-rakesh @cb-goutham @cb-yateshmathuria @cb-navaneedhan We are also paying customers and our main integration issues would be solved with this PR, please help and merge. |
@L-U-C-K-Y |
out of curiosity - what are you working on there? I see the main reason for pull requests that the community (I am a paying customer as well) prepares the changes in the way you also like them so it can easily be added to the project. |
@wodka |
thank you @cb-yateshmathuria and @cb-khushbubibay for reviewing and merging :) |
yes, thats what i did... super wierd |
I am working on a project that uses chargebee-typscript v2.33, and don't see any (usable) types on API responses from Chargebee. Take this example: const { subscription } = await client.subscription.retrieve(userId).request(); VSCode believes If I understand this PR correctly, it was meant to add proper types to responses. Were these types later lost in a regression? Or is this happening only on my machine due to some unfortunate combination of packages installed or similar? |
Hi @schourode, thanks for raising this. Yes, this seems to be broken. We're looking into this. Will keep this thread posted. |
fixes #7