Skip to content
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

TypeScript type for RequestValidatorOptions is incorrect according to documentation #376

Closed
jgornick opened this issue Aug 27, 2018 · 1 comment

Comments

@jgornick
Copy link

Version: 3.19.2

Code Snippet

  const isRequestValid = twilio.validateExpressRequest(
    req,
    process.env.TWILIO_AUTH_TOKEN,
    { url: process.env.TWILIO_WEBHOOK_URL }
  );

Exception/Log

Argument of type '{ url: string; }' is not assignable to parameter of type 'RequestValidatorOptions'.
  Property 'host' is missing in type '{ url: string; }'.

Expected Results

The documentation for url in RequestValidatorOptions has:

The full URL (with query string) you used to configure the webhook with Twilio - overrides host/protocol options

Because it says it overrides host and protocol options, I would expect all of the RequestValidatorOptions interface members to be optional:

export interface RequestValidatorOptions {
  /**
   * The full URL (with query string) you used to configure the webhook with Twilio - overrides host/protocol options
   */
  url?: string;
  /**
   * Manually specify the host name used by Twilio in a number's webhook config
   */
  host?: string;
  /**
   * Manually specify the protocol used by Twilio in a number's webhook config
   */
  protocol?: string;
}
@et
Copy link

et commented Sep 5, 2018

Can this issue be closed now that #377 was merged?

@jgornick jgornick closed this as completed Sep 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants