When trying to follow v3/api example and passing in a request object to sendgrid.emptyRequest
the typescript checker is giving me errors for missing parameters which are not shown in the example
eg. host,header. Are they optional if yes they should be typed as optional parameters.
//api example from sendgrid docs
var request = sg.emptyRequest({
method: 'POST',
path: '/v3/mail/send',
body: mail.toJSON(),
});
//code
let req = {
method : post,
path : "/v3/mail/send",
body : mail.toJSON()
}
//message from ide
Argument of type '{ method: "POST"; path: string; body: { from: any; personalizations: any[]; subject: string; cont...' is not assignable to parameter of type 'Request'.
Property 'host' is missing in type '{ method: "POST"; path: string; body: { from: any; personalizations: any[]; subject: string; cont...'.
@sheyaweidberg,
Thanks for taking the time to report this issue. We will investigate.
@SPARTAN563 thoughts?
With Best Regards,
Elmer
This is entirely correct and an oversight in my implementation of the type - well spotted and thanks for bringing it up. I'll try and get a patch put together tomorrow and let you guys know when it's done.
Regards,
Benjamin
@thinkingserious what is the ETA on this getting merged in? Anything I can do to help push this through and get a release pushed? Would love to drop my fork ASAP
@jpinkster,
The only think that can help move this PR to the top of our backlog currently is more votes/comments on the issue.
Thanks for asking!
+1
+1
+1
+1
Thanks for the votes everyone! They have been counted.
Awesome @thinkingserious!
Most helpful comment
+1