Yuri-Lima / woocommerce-rest-api-ts-lib

This is some improvements for the oficial WooCommerce repo. https://github.com/woocommerce/woocommerce-rest-api-js-lib I hope they merge or accept it as new repo. soon. Please few free to contact me.
MIT License
29 stars 8 forks source link

Deletion of WooEndpoint types #34

Closed PiotrPisz closed 1 year ago

PiotrPisz commented 1 year ago

The application can make calls to many endpoints that are not listed here, and listing each of them may turn out to be a constant battle with windmills - it will require updating each time you change/add/remove each endpoint. Currently, the library does not allow calls to, for example, 'products/attributes', 'orders/', 'data/countries' or 'products//variations'. My suggestion is to remove the declaration of allowable values, define the type as a string, and if you want it to be declared, convert it to a class, which will allow you to declare dynamic data.

PiotrPisz commented 1 year ago

I made a mistake suggesting a solution without a declaration. Of course, TS won't allow it. But I hope my message will be understood. Maybe use LiteralUnion?

Yuri-Lima commented 1 year ago

Hi, @PiotrPisz sorry my late reply. Im working on a different project which get most of my time. So, if you have a better solution to that case would be very great to take a look at.

Thank you in advance.