stripe / stripe-node

Node.js library for the Stripe API.
https://stripe.com
MIT License
3.89k stars 753 forks source link

Remove empty resources created for service groupings #2215

Closed jar-stripe closed 2 weeks ago

jar-stripe commented 4 weeks ago

Why?

The code generator had previously generated resources for V2 services that only contain other services, like V2.Billing, V2.Core, etc. This is undesirable because it produces strangely named files and confusing empty types. This PR updates contains generated code after modifying the code generator to treat these services like namespaces instead of resource-ful services.

This could be a breaking change as the CoreResource.d.ts and BillingResource.d.ts type definitions are being removed. The following therefore would be a type error after this change:

  const billing: Stripe.V2.BillingResource = client.v2.billing;
  const meters = await billing.meterEvents.create({

It does not change the access path through StripeClient or the interface of the services, though.

What?

See also

http://go/j/DEVSDK-2196

Changelog

helenye-stripe commented 4 weeks ago

Can we rebase this off of master to remove the non-related changes? Other than that 👍

jar-stripe commented 4 weeks ago

Can we rebase this off of master to remove the non-related changes? Other than that 👍

Done! But this includes a file that shouldn't be there (Margins.d.ts) and will continue to generate until we update the openapi version, so I think this probably needs to wait until that is resolved before we merge.