sendgrid / sendgrid-nodejs

The Official Twilio SendGrid Led, Community Driven Node.js API Library
https://sendgrid.com
MIT License
2.98k stars 781 forks source link

fix: typings for Client.setDefaultRequest #1383

Open brettwillis opened 1 year ago

brettwillis commented 1 year ago

Fixes

The ClientRequest type (alias of RequestOptions) in Client.setDefaultRequest has required field url.

This means, when using Client.setDefaultRequest({ httpsAgent: new https.Agent() }), for example, TypeScript will error with field url is missing.

This PR makes the type partial, so all fields are optional which reflects the actual behaviour.

Checklist

brettwillis commented 1 year ago

Also, why are issues disabled on this repo?

ank1995it commented 10 months ago

Facing this sonar issue : Cross-site Request Forgery (CSRF) [High Severity][https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459] in axios@0.26.1 introduced by @sendgrid/mail@7.7.0 > @sendgrid/client@7.7.0 > axios@0.26.1