-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
🚀 Feature: Add return types to @novu/node #6611
Comments
@KamalAman can I work on these ? |
Yeah for sure! Let me know if you need any feedback, but once you select the codegen, the rest should be pretty easy to just call the appropriate method. You will probably want to keep the fetcher standardized to axios. |
Thanks for the feedback. I agree, node sdk should have types as well. We are working on this. |
I would recommend you to look into other issues, as it will be handled by our team |
@jainpawan21 thank you for the info man and I wil . |
🔖 Feature description
It seems like @novu/node returns
AxiosResponse<any, any>
for all of the network requests. Subscriber.tsCan we get it to be with proper return types?
Your api is well documented https://docs.novu.co/api-reference/subscribers/get-subscriber.
🎤 Why is this feature needed ?
I need proper types when developing or else everything goes to hell.
✌️ How do you aim to achieve this?
You should be able to return codegen to generate all of the response types and the methods as well
I've used hay-api before, and its really simple: https://heyapi.vercel.app/openapi-ts/get-started.html
Just hook this script into your build process, it will generate a
services.gen.ts
with proper types. It'll generate the .ts. api based your openapi schema. Call those functions instead of axios directly.🔄️ Additional Information
No response
👀 Have you spent some time to check if this feature request has been raised before?
🏢 Have you read the Code of Conduct?
Are you willing to submit PR?
Yes I am willing to submit a PR!
The text was updated successfully, but these errors were encountered: