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

Typing issue: `chargebee.customer.contacts_for_customer` #30

Closed pchab closed 2 years ago

pchab commented 2 years ago

Hi! ๐Ÿ‘‹

Firstly, thanks for your work on this project! ๐Ÿ™‚

Today I used patch-package to patch chargebee-typescript@2.7.1 for the project I'm working on.

The method contacts_for_customer for the endpoint Customers returns a list (as per your API doc) but the typing says it's a Result instead of a ListResult.

Here is the diff that solved my problem:

diff --git a/node_modules/chargebee-typescript/lib/resources/customer.d.ts b/node_modules/chargebee-typescript/lib/resources/customer.d.ts
index 3101356..83f95e4 100644
--- a/node_modules/chargebee-typescript/lib/resources/customer.d.ts
+++ b/node_modules/chargebee-typescript/lib/resources/customer.d.ts
@@ -69,7 +69,7 @@ export declare class Customer extends Model {
     static update(customer_id: string, params?: _customer.update_params): RequestWrapper;
     static update_payment_method(customer_id: string, params?: _customer.update_payment_method_params): RequestWrapper;
     static update_billing_info(customer_id: string, params?: _customer.update_billing_info_params): RequestWrapper;
-    static contacts_for_customer(customer_id: string, params?: any): RequestWrapper;
+    static contacts_for_customer(customer_id: string, params?: any): RequestWrapper<ListResult>;
     static assign_payment_role(customer_id: string, params?: _customer.assign_payment_role_params): RequestWrapper;
     static add_contact(customer_id: string, params?: _customer.add_contact_params): RequestWrapper;
     static update_contact(customer_id: string, params?: _customer.update_contact_params): RequestWrapper;

This issue body was partially generated by patch-package.

cb-khushbubibay commented 2 years ago

Hi @pchab, Thanks for your patience. This issue has been addressed at typescript v2.8.0. Hence closing this issue.