From 122cd790299eba9cc40a575b74a654c965aab244 Mon Sep 17 00:00:00 2001 From: Junte Zhang Date: Thu, 7 Sep 2023 07:00:14 +0200 Subject: [PATCH] feat: Make Query public to allow custom query extensions (#184) --- src/index.d.ts | 2 +- src/index.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/index.d.ts b/src/index.d.ts index 394c117..98dd16a 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -317,7 +317,7 @@ declare namespace esb { * * @param {string} queryType */ - class Query { + export class Query { constructor(queryType: string); /** diff --git a/src/index.js b/src/index.js index 1867218..ea465fd 100644 --- a/src/index.js +++ b/src/index.js @@ -13,6 +13,7 @@ const { Rescore, InnerHits, SearchTemplate, + Query, util: { constructorWrapper } } = require('./core'); @@ -167,6 +168,9 @@ exports.requestBodySearch = constructorWrapper(RequestBodySearch); /* ============ ============ ============ */ /* ============== Queries =============== */ /* ============ ============ ============ */ +exports.Query = Query; +exports.query = constructorWrapper(Query); + exports.MatchAllQuery = MatchAllQuery; exports.matchAllQuery = constructorWrapper(MatchAllQuery);