const { AwsSigv4Signer } = require('@opensearch-project/opensearch/aws-v3'); // use aws-v3 import path if you are using aws-sdk v3
I'm currently using @opensearch-project/opensearch 2.8.0 which introduced these changes, but it doesn't work:
Type error: Could not find a declaration file for module '@opensearch-project/opensearch/aws-v3'. 'XXX/node_modules/@opensearch-project/opensearch/lib/aws/index-v3.js' implicitly has an 'any' type.
If the '@opensearch-project/opensearch' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module '@opensearch-project/opensearch/aws-v3';`
3 | import { defaultProvider } from "@aws-sdk/credential-provider-node";
4 | import { Client } from "@opensearch-project/opensearch";
> 5 | import { AwsSigv4Signer } from "@opensearch-project/opensearch/aws-v3";
| ^
6 |
7 | const osClient = new Client({
8 | ...AwsSigv4Signer({
error Command failed with exit code 1.
Following https://github.com/opensearch-project/opensearch-js/blob/fb91e38130f1ccdddbe7e709f547b1fe5a58d591/USER_GUIDE.md#using-aws-v3-sdk
It shows:
I'm currently using
@opensearch-project/opensearch 2.8.0
which introduced these changes, but it doesn't work:It's missing the equivalent of https://github.com/opensearch-project/opensearch-js/blob/main/lib/aws/index.d.ts