1.) Wrong type definition
The autocomplete from my IDE (PHPStorm) suggests the following:

However, the data returned looks like this:
{
_index: 'db',
_id: 8865561979561969000,
created: false,
result: 'updated',
status: 200
}
The attribute found from the type definition is not present in the data and the attribute status from the data is not present in the type definition.
2.) Missing type definition
When the query does not succeed the returned data is something like this:
{
error: {
type: "table 'main' absent, or does not support INSERT",
index: 'main'
},
status: 409
}
The return type of the type definition does not mention this. AFAICT the method need to return Promise<SuccessResponse | ErrorResponse> and not only Promise<SuccessResponse>.
This may occur on more than just this method. At least IndexApi.insert() seems to have the same problem.
1.) Wrong type definition
The autocomplete from my IDE (PHPStorm) suggests the following:
However, the data returned looks like this:
The attribute
foundfrom the type definition is not present in the data and the attributestatusfrom the data is not present in the type definition.2.) Missing type definition
When the query does not succeed the returned data is something like this:
The return type of the type definition does not mention this. AFAICT the method need to return
Promise<SuccessResponse | ErrorResponse>and not onlyPromise<SuccessResponse>.This may occur on more than just this method. At least IndexApi.insert() seems to have the same problem.