[helpers] add support for transport options to all helpers (#1400)

Co-authored-by: spalger <spalger@users.noreply.github.com>
This commit is contained in:
Spencer
2021-02-18 07:33:08 -08:00
committed by GitHub
parent 2b084dbadc
commit 973a98180a
4 changed files with 112 additions and 8 deletions

4
lib/Helpers.d.ts vendored
View File

@ -25,8 +25,8 @@ export default class Helpers {
search<TDocument = unknown, TRequestBody extends RequestBody = Record<string, any>>(params: Search<TRequestBody>, options?: TransportRequestOptions): Promise<TDocument[]>
scrollSearch<TDocument = unknown, TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: Search<TRequestBody>, options?: TransportRequestOptions): AsyncIterable<ScrollSearchResponse<TDocument, TResponse, TContext>>
scrollDocuments<TDocument = unknown, TRequestBody extends RequestBody = Record<string, any>>(params: Search<TRequestBody>, options?: TransportRequestOptions): AsyncIterable<TDocument>
msearch(options?: MsearchHelperOptions): MsearchHelper
bulk<TDocument = unknown>(options: BulkHelperOptions<TDocument>): BulkHelper<BulkStats>
msearch(options?: MsearchHelperOptions, reqOptions?: TransportRequestOptions): MsearchHelper
bulk<TDocument = unknown>(options: BulkHelperOptions<TDocument>, reqOptions?: TransportRequestOptions): BulkHelper<BulkStats>
}
export interface ScrollSearchResponse<TDocument = unknown, TResponse = Record<string, any>, TContext = Context> extends ApiResponse<TResponse, TContext> {