2

I am attempting to follow the AWS documentation for using the Node SDK to perform a signed HTTP request to Elasticsearch (https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-request-signing.html#es-request-signing-node).

In the example, they use a class Aws.HttpClient to actually execute the request. But I have installed aws-sdk version 2.517.0 and HttpClient is not exposed by the aws-sdk object I import. My TypeScript autocompletion only indicates HttpRequest and HttpResponse and I can't compile if I use Aws.HttpClient.

But if I dig into node_modules/aws-sdk/lib/http.js I can see AWS.HttpClient.

What do I have to do to access it? Or is the documentation outdated?

John D.
  • 2,521
  • 3
  • 24
  • 45

1 Answers1

4

Found this old issue: https://github.com/aws/aws-sdk-js/issues/1278

You can always add // @ts-ignore above relevant lines, or even create a index.d.ts file with type definitions.

Erez
  • 1,690
  • 8
  • 9
  • Using ts-ignore worked! Thanks. I wish they would make type definitions though, as they use HttpClient as an example in their official documentation. – John D. Aug 27 '19 at 18:37