Skip to content
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

multiple identically named classes + proposal to export interfaces #9

Open
burner-account opened this issue Nov 12, 2020 · 1 comment
Assignees

Comments

@burner-account
Copy link

I cannot tell if anybody stumbles over this like i do, but:

  • Why are there multiple identical definitions of some types? e.g. class ContractTerm, found 3 times

Maybe i am lacking the typescript and/or chargebee knowledge to get your intention, but to me it seems like "roll your dice to import".


Since users are pointed here when it comes to typescript typings:

  • Would you please consider providing types as exported interfaces?

Your classes can implement those interfaces. This would be helpful for users like me who only want some type info without actually using typescript to perform API calls.

@dybzon
Copy link

dybzon commented Sep 12, 2021

Just bumping this up as it seems abandoned. I've just started integrating our site with Chargebee, and the typescript project seems like a mess:

  • Why aren't the types exported from your project? E.g. ChargeBee.subscription returns a Subscription type, and that type is defined in your project, but it's not exported. The same goes for lots of other types. This means anyone integrating with your ts library has to do stuff like this:
type Subscription = typeof chargebeeService.subscription;
const subscription: Subscription = result.subscription;
  • Lots of entites aren't typed at all. E.g. the ChargeBee.subscription.create().request() takes two untyped arguments.
  • When configuring a chargebee service I have to make a call to ChargeBee.configure(). This takes a configuration object, but this is untyped. I can tell from your examples that the configuration should be of type = { site: string; api_key: string; }. This is different from the configuration used when initializing a chargebee instance. Here the type is type = { site: string; publishableKey: string; }. Why is the configuration type not the same across these libs?

All this makes me wonder if it's safe to integrate with Chargebee at all. Is your library stable? Or should I start looking for a different subscription service?

Please put some effort into this issue. It's been open for almost a year without a single response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants