Closed
Description
Question
Background
We operate a project that uses Typescript, Lambda and Elasticsearch. We've been using your elasticsearch
package for some time, and recently I have been working to upgrade our local version to your latest - 8.17.0
from 8.15.1
.
The problem
We have declarations like the following that no longer work (Typescript throws a compiler error):
import { IndexRequest, SearchResponse } from '@elastic/elasticsearch/lib/api/types';
// ...
const params: IndexRequest<AuthorizedClient> = {
index: AUTH_DOCUMENT_INDEX,
id: client.id,
document: client,
};
The above used to be fine with tsc
, but now it throws an error:
error TS2307: Cannot find module '@elastic/elasticsearch/lib/api/types' or its corresponding type declarations.
Any reason this works in 8.15.1
but not in 8.17.0
? Can we still import types or no?
Things tried
- Using
@types/elasticsearch
, this works to bring in types, but that package is missingIndexRequest
among other types and at least theSearchResponse
type is incompatible with the official@elastic/elasticsearch
exported API.