@elastic/elasticsearch 8.17.1 → 9.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api/async_search.d.ts +16 -17
- package/lib/api/api/async_search.js +50 -20
- package/lib/api/api/async_search.js.map +1 -1
- package/lib/api/api/autoscaling.d.ts +16 -17
- package/lib/api/api/autoscaling.js +42 -12
- package/lib/api/api/autoscaling.js.map +1 -1
- package/lib/api/api/bulk.d.ts +4 -5
- package/lib/api/api/bulk.js +3 -3
- package/lib/api/api/bulk.js.map +1 -1
- package/lib/api/api/capabilities.d.ts +3 -4
- package/lib/api/api/capabilities.js +13 -3
- package/lib/api/api/capabilities.js.map +1 -1
- package/lib/api/api/cat.d.ts +104 -105
- package/lib/api/api/cat.js +338 -78
- package/lib/api/api/cat.js.map +1 -1
- package/lib/api/api/ccr.d.ts +52 -53
- package/lib/api/api/ccr.js +162 -64
- package/lib/api/api/ccr.js.map +1 -1
- package/lib/api/api/clear_scroll.d.ts +4 -5
- package/lib/api/api/clear_scroll.js +11 -9
- package/lib/api/api/clear_scroll.js.map +1 -1
- package/lib/api/api/close_point_in_time.d.ts +4 -5
- package/lib/api/api/close_point_in_time.js +11 -9
- package/lib/api/api/close_point_in_time.js.map +1 -1
- package/lib/api/api/cluster.d.ts +64 -65
- package/lib/api/api/cluster.js +200 -72
- package/lib/api/api/cluster.js.map +1 -1
- package/lib/api/api/connector.d.ts +132 -133
- package/lib/api/api/connector.js +402 -222
- package/lib/api/api/connector.js.map +1 -1
- package/lib/api/api/count.d.ts +5 -6
- package/lib/api/api/count.js +11 -9
- package/lib/api/api/count.js.map +1 -1
- package/lib/api/api/create.d.ts +5 -6
- package/lib/api/api/create.js +3 -3
- package/lib/api/api/create.js.map +1 -1
- package/lib/api/api/dangling_indices.d.ts +12 -13
- package/lib/api/api/dangling_indices.js +39 -9
- package/lib/api/api/dangling_indices.js.map +1 -1
- package/lib/api/api/delete.d.ts +4 -5
- package/lib/api/api/delete.js +13 -3
- package/lib/api/api/delete.js.map +1 -1
- package/lib/api/api/delete_by_query.d.ts +4 -5
- package/lib/api/api/delete_by_query.js +11 -9
- package/lib/api/api/delete_by_query.js.map +1 -1
- package/lib/api/api/delete_by_query_rethrottle.d.ts +4 -5
- package/lib/api/api/delete_by_query_rethrottle.js +13 -3
- package/lib/api/api/delete_by_query_rethrottle.js.map +1 -1
- package/lib/api/api/delete_script.d.ts +4 -5
- package/lib/api/api/delete_script.js +13 -3
- package/lib/api/api/delete_script.js.map +1 -1
- package/lib/api/api/enrich.d.ts +20 -21
- package/lib/api/api/enrich.js +63 -21
- package/lib/api/api/enrich.js.map +1 -1
- package/lib/api/api/eql.d.ts +16 -17
- package/lib/api/api/eql.js +51 -19
- package/lib/api/api/eql.js.map +1 -1
- package/lib/api/api/esql.d.ts +16 -17
- package/lib/api/api/esql.js +50 -26
- package/lib/api/api/esql.js.map +1 -1
- package/lib/api/api/exists.d.ts +4 -5
- package/lib/api/api/exists.js +13 -3
- package/lib/api/api/exists.js.map +1 -1
- package/lib/api/api/exists_source.d.ts +4 -5
- package/lib/api/api/exists_source.js +13 -3
- package/lib/api/api/exists_source.js.map +1 -1
- package/lib/api/api/explain.d.ts +5 -6
- package/lib/api/api/explain.js +11 -9
- package/lib/api/api/explain.js.map +1 -1
- package/lib/api/api/features.d.ts +8 -9
- package/lib/api/api/features.js +26 -6
- package/lib/api/api/features.js.map +1 -1
- package/lib/api/api/field_caps.d.ts +4 -5
- package/lib/api/api/field_caps.js +11 -9
- package/lib/api/api/field_caps.js.map +1 -1
- package/lib/api/api/fleet.d.ts +22 -23
- package/lib/api/api/fleet.js +66 -24
- package/lib/api/api/fleet.js.map +1 -1
- package/lib/api/api/get.d.ts +4 -5
- package/lib/api/api/get.js +13 -3
- package/lib/api/api/get.js.map +1 -1
- package/lib/api/api/get_script.d.ts +4 -5
- package/lib/api/api/get_script.js +13 -3
- package/lib/api/api/get_script.js.map +1 -1
- package/lib/api/api/get_script_context.d.ts +4 -5
- package/lib/api/api/get_script_context.js +13 -3
- package/lib/api/api/get_script_context.js.map +1 -1
- package/lib/api/api/get_script_languages.d.ts +4 -5
- package/lib/api/api/get_script_languages.js +13 -3
- package/lib/api/api/get_script_languages.js.map +1 -1
- package/lib/api/api/get_source.d.ts +4 -5
- package/lib/api/api/get_source.js +13 -3
- package/lib/api/api/get_source.js.map +1 -1
- package/lib/api/api/graph.d.ts +4 -5
- package/lib/api/api/graph.js +11 -9
- package/lib/api/api/graph.js.map +1 -1
- package/lib/api/api/health_report.d.ts +4 -5
- package/lib/api/api/health_report.js +13 -3
- package/lib/api/api/health_report.js.map +1 -1
- package/lib/api/api/ilm.d.ts +44 -45
- package/lib/api/api/ilm.js +137 -51
- package/lib/api/api/ilm.js.map +1 -1
- package/lib/api/api/index.d.ts +5 -6
- package/lib/api/api/index.js +3 -3
- package/lib/api/api/index.js.map +1 -1
- package/lib/api/api/indices.d.ts +264 -244
- package/lib/api/api/indices.js +837 -295
- package/lib/api/api/indices.js.map +1 -1
- package/lib/api/api/inference.d.ts +31 -25
- package/lib/api/api/inference.js +102 -30
- package/lib/api/api/inference.js.map +1 -1
- package/lib/api/api/info.d.ts +4 -5
- package/lib/api/api/info.js +13 -3
- package/lib/api/api/info.js.map +1 -1
- package/lib/api/api/ingest.d.ts +48 -49
- package/lib/api/api/ingest.js +140 -54
- package/lib/api/api/ingest.js.map +1 -1
- package/lib/api/api/knn_search.d.ts +5 -6
- package/lib/api/api/knn_search.js +11 -9
- package/lib/api/api/knn_search.js.map +1 -1
- package/lib/api/api/license.d.ts +28 -29
- package/lib/api/api/license.js +89 -27
- package/lib/api/api/license.js.map +1 -1
- package/lib/api/api/logstash.d.ts +12 -13
- package/lib/api/api/logstash.js +29 -9
- package/lib/api/api/logstash.js.map +1 -1
- package/lib/api/api/mget.d.ts +5 -6
- package/lib/api/api/mget.js +11 -9
- package/lib/api/api/mget.js.map +1 -1
- package/lib/api/api/migration.d.ts +12 -13
- package/lib/api/api/migration.js +39 -9
- package/lib/api/api/migration.js.map +1 -1
- package/lib/api/api/ml.d.ts +292 -293
- package/lib/api/api/ml.js +855 -441
- package/lib/api/api/ml.js.map +1 -1
- package/lib/api/api/monitoring.d.ts +4 -5
- package/lib/api/api/monitoring.js +3 -3
- package/lib/api/api/monitoring.js.map +1 -1
- package/lib/api/api/msearch.d.ts +4 -5
- package/lib/api/api/msearch.js +3 -3
- package/lib/api/api/msearch.js.map +1 -1
- package/lib/api/api/msearch_template.d.ts +5 -6
- package/lib/api/api/msearch_template.js +3 -3
- package/lib/api/api/msearch_template.js.map +1 -1
- package/lib/api/api/mtermvectors.d.ts +5 -6
- package/lib/api/api/mtermvectors.js +11 -9
- package/lib/api/api/mtermvectors.js.map +1 -1
- package/lib/api/api/nodes.d.ts +28 -29
- package/lib/api/api/nodes.js +89 -27
- package/lib/api/api/nodes.js.map +1 -1
- package/lib/api/api/open_point_in_time.d.ts +4 -5
- package/lib/api/api/open_point_in_time.js +11 -9
- package/lib/api/api/open_point_in_time.js.map +1 -1
- package/lib/api/api/ping.d.ts +4 -5
- package/lib/api/api/ping.js +13 -3
- package/lib/api/api/ping.js.map +1 -1
- package/lib/api/api/profiling.d.ts +16 -17
- package/lib/api/api/profiling.js +52 -12
- package/lib/api/api/profiling.js.map +1 -1
- package/lib/api/api/put_script.d.ts +4 -5
- package/lib/api/api/put_script.js +11 -9
- package/lib/api/api/put_script.js.map +1 -1
- package/lib/api/api/query_rules.d.ts +32 -33
- package/lib/api/api/query_rules.js +98 -42
- package/lib/api/api/query_rules.js.map +1 -1
- package/lib/api/api/rank_eval.d.ts +4 -5
- package/lib/api/api/rank_eval.js +11 -9
- package/lib/api/api/rank_eval.js.map +1 -1
- package/lib/api/api/reindex.d.ts +5 -6
- package/lib/api/api/reindex.js +11 -9
- package/lib/api/api/reindex.js.map +1 -1
- package/lib/api/api/reindex_rethrottle.d.ts +4 -5
- package/lib/api/api/reindex_rethrottle.js +13 -3
- package/lib/api/api/reindex_rethrottle.js.map +1 -1
- package/lib/api/api/render_search_template.d.ts +4 -5
- package/lib/api/api/render_search_template.js +13 -11
- package/lib/api/api/render_search_template.js.map +1 -1
- package/lib/api/api/rollup.d.ts +32 -33
- package/lib/api/api/rollup.js +100 -36
- package/lib/api/api/rollup.js.map +1 -1
- package/lib/api/api/scripts_painless_execute.d.ts +5 -6
- package/lib/api/api/scripts_painless_execute.js +11 -9
- package/lib/api/api/scripts_painless_execute.js.map +1 -1
- package/lib/api/api/scroll.d.ts +4 -5
- package/lib/api/api/scroll.js +11 -9
- package/lib/api/api/scroll.js.map +1 -1
- package/lib/api/api/search.d.ts +4 -5
- package/lib/api/api/search.js +11 -11
- package/lib/api/api/search.js.map +1 -1
- package/lib/api/api/search_application.d.ts +40 -41
- package/lib/api/api/search_application.js +106 -42
- package/lib/api/api/search_application.js.map +1 -1
- package/lib/api/api/search_mvt.d.ts +5 -6
- package/lib/api/api/search_mvt.js +11 -9
- package/lib/api/api/search_mvt.js.map +1 -1
- package/lib/api/api/search_shards.d.ts +5 -6
- package/lib/api/api/search_shards.js +13 -3
- package/lib/api/api/search_shards.js.map +1 -1
- package/lib/api/api/search_template.d.ts +4 -5
- package/lib/api/api/search_template.js +11 -9
- package/lib/api/api/search_template.js.map +1 -1
- package/lib/api/api/searchable_snapshots.d.ts +16 -17
- package/lib/api/api/searchable_snapshots.js +50 -18
- package/lib/api/api/searchable_snapshots.js.map +1 -1
- package/lib/api/api/security.d.ts +256 -257
- package/lib/api/api/security.js +756 -390
- package/lib/api/api/security.js.map +1 -1
- package/lib/api/api/shutdown.d.ts +12 -13
- package/lib/api/api/shutdown.js +37 -15
- package/lib/api/api/shutdown.js.map +1 -1
- package/lib/api/api/simulate.d.ts +4 -5
- package/lib/api/api/simulate.js +11 -9
- package/lib/api/api/simulate.js.map +1 -1
- package/lib/api/api/slm.d.ts +36 -37
- package/lib/api/api/slm.js +115 -33
- package/lib/api/api/slm.js.map +1 -1
- package/lib/api/api/snapshot.d.ts +56 -57
- package/lib/api/api/snapshot.js +154 -58
- package/lib/api/api/snapshot.js.map +1 -1
- package/lib/api/api/sql.d.ts +24 -25
- package/lib/api/api/sql.js +72 -36
- package/lib/api/api/sql.js.map +1 -1
- package/lib/api/api/ssl.d.ts +4 -5
- package/lib/api/api/ssl.js +13 -3
- package/lib/api/api/ssl.js.map +1 -1
- package/lib/api/api/synonyms.d.ts +28 -29
- package/lib/api/api/synonyms.js +87 -33
- package/lib/api/api/synonyms.js.map +1 -1
- package/lib/api/api/tasks.d.ts +12 -13
- package/lib/api/api/tasks.js +39 -9
- package/lib/api/api/tasks.js.map +1 -1
- package/lib/api/api/terms_enum.d.ts +5 -6
- package/lib/api/api/terms_enum.js +11 -9
- package/lib/api/api/terms_enum.js.map +1 -1
- package/lib/api/api/termvectors.d.ts +5 -6
- package/lib/api/api/termvectors.js +11 -9
- package/lib/api/api/termvectors.js.map +1 -1
- package/lib/api/api/text_structure.d.ts +16 -17
- package/lib/api/api/text_structure.js +38 -24
- package/lib/api/api/text_structure.js.map +1 -1
- package/lib/api/api/transform.d.ts +48 -49
- package/lib/api/api/transform.js +150 -54
- package/lib/api/api/transform.js.map +1 -1
- package/lib/api/api/update.d.ts +4 -5
- package/lib/api/api/update.js +11 -9
- package/lib/api/api/update.js.map +1 -1
- package/lib/api/api/update_by_query.d.ts +4 -5
- package/lib/api/api/update_by_query.js +11 -9
- package/lib/api/api/update_by_query.js.map +1 -1
- package/lib/api/api/update_by_query_rethrottle.d.ts +4 -5
- package/lib/api/api/update_by_query_rethrottle.js +13 -3
- package/lib/api/api/update_by_query_rethrottle.js.map +1 -1
- package/lib/api/api/watcher.d.ts +52 -53
- package/lib/api/api/watcher.js +161 -63
- package/lib/api/api/watcher.js.map +1 -1
- package/lib/api/api/xpack.d.ts +8 -9
- package/lib/api/api/xpack.js +26 -6
- package/lib/api/api/xpack.js.map +1 -1
- package/lib/api/types.d.ts +12987 -170
- package/lib/client.js +4 -12
- package/lib/client.js.map +1 -1
- package/lib/helpers.js +1 -1
- package/lib/helpers.js.map +1 -1
- package/package.json +6 -7
- package/renovate.json +26 -0
- package/lib/api/typesWithBodyKey.d.ts +0 -18871
- package/lib/api/typesWithBodyKey.js +0 -21
- package/lib/api/typesWithBodyKey.js.map +0 -1
package/lib/api/api/esql.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Transport, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, TransportResult } from '@elastic/transport';
|
|
2
2
|
import * as T from '../types';
|
|
3
|
-
import * as TB from '../typesWithBodyKey';
|
|
4
3
|
interface That {
|
|
5
4
|
transport: Transport;
|
|
6
5
|
}
|
|
@@ -9,31 +8,31 @@ export default class Esql {
|
|
|
9
8
|
constructor(transport: Transport);
|
|
10
9
|
/**
|
|
11
10
|
* Run an async ES|QL query. Asynchronously run an ES|QL (Elasticsearch query language) query, monitor its progress, and retrieve results when they become available. The API accepts the same parameters and request body as the synchronous query API, along with additional async related properties.
|
|
12
|
-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/
|
|
11
|
+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-api.html | Elasticsearch API documentation}
|
|
13
12
|
*/
|
|
14
|
-
asyncQuery(this: That, params: T.EsqlAsyncQueryRequest
|
|
15
|
-
asyncQuery(this: That, params: T.EsqlAsyncQueryRequest
|
|
16
|
-
asyncQuery(this: That, params: T.EsqlAsyncQueryRequest
|
|
13
|
+
asyncQuery(this: That, params: T.EsqlAsyncQueryRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EsqlAsyncQueryResponse>;
|
|
14
|
+
asyncQuery(this: That, params: T.EsqlAsyncQueryRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EsqlAsyncQueryResponse, unknown>>;
|
|
15
|
+
asyncQuery(this: That, params: T.EsqlAsyncQueryRequest, options?: TransportRequestOptions): Promise<T.EsqlAsyncQueryResponse>;
|
|
17
16
|
/**
|
|
18
17
|
* Delete an async ES|QL query. If the query is still running, it is cancelled. Otherwise, the stored results are deleted. If the Elasticsearch security features are enabled, only the following users can use this API to delete a query: * The authenticated user that submitted the original query request * Users with the `cancel_task` cluster privilege
|
|
19
|
-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/
|
|
18
|
+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-delete-api.html | Elasticsearch API documentation}
|
|
20
19
|
*/
|
|
21
|
-
asyncQueryDelete(this: That, params: T.EsqlAsyncQueryDeleteRequest
|
|
22
|
-
asyncQueryDelete(this: That, params: T.EsqlAsyncQueryDeleteRequest
|
|
23
|
-
asyncQueryDelete(this: That, params: T.EsqlAsyncQueryDeleteRequest
|
|
20
|
+
asyncQueryDelete(this: That, params: T.EsqlAsyncQueryDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EsqlAsyncQueryDeleteResponse>;
|
|
21
|
+
asyncQueryDelete(this: That, params: T.EsqlAsyncQueryDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EsqlAsyncQueryDeleteResponse, unknown>>;
|
|
22
|
+
asyncQueryDelete(this: That, params: T.EsqlAsyncQueryDeleteRequest, options?: TransportRequestOptions): Promise<T.EsqlAsyncQueryDeleteResponse>;
|
|
24
23
|
/**
|
|
25
24
|
* Get async ES|QL query results. Get the current status and available results or stored results for an ES|QL asynchronous query. If the Elasticsearch security features are enabled, only the user who first submitted the ES|QL query can retrieve the results using this API.
|
|
26
|
-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/
|
|
25
|
+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-get-api.html | Elasticsearch API documentation}
|
|
27
26
|
*/
|
|
28
|
-
asyncQueryGet(this: That, params: T.EsqlAsyncQueryGetRequest
|
|
29
|
-
asyncQueryGet(this: That, params: T.EsqlAsyncQueryGetRequest
|
|
30
|
-
asyncQueryGet(this: That, params: T.EsqlAsyncQueryGetRequest
|
|
27
|
+
asyncQueryGet(this: That, params: T.EsqlAsyncQueryGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EsqlAsyncQueryGetResponse>;
|
|
28
|
+
asyncQueryGet(this: That, params: T.EsqlAsyncQueryGetRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EsqlAsyncQueryGetResponse, unknown>>;
|
|
29
|
+
asyncQueryGet(this: That, params: T.EsqlAsyncQueryGetRequest, options?: TransportRequestOptions): Promise<T.EsqlAsyncQueryGetResponse>;
|
|
31
30
|
/**
|
|
32
31
|
* Run an ES|QL query. Get search results for an ES|QL (Elasticsearch query language) query.
|
|
33
|
-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/
|
|
32
|
+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-rest.html | Elasticsearch API documentation}
|
|
34
33
|
*/
|
|
35
|
-
query(this: That, params: T.EsqlQueryRequest
|
|
36
|
-
query(this: That, params: T.EsqlQueryRequest
|
|
37
|
-
query(this: That, params: T.EsqlQueryRequest
|
|
34
|
+
query(this: That, params: T.EsqlQueryRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EsqlQueryResponse>;
|
|
35
|
+
query(this: That, params: T.EsqlQueryRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EsqlQueryResponse, unknown>>;
|
|
36
|
+
query(this: That, params: T.EsqlQueryRequest, options?: TransportRequestOptions): Promise<T.EsqlQueryResponse>;
|
|
38
37
|
}
|
|
39
38
|
export {};
|
package/lib/api/api/esql.js
CHANGED
|
@@ -30,16 +30,18 @@ class Esql {
|
|
|
30
30
|
}
|
|
31
31
|
async asyncQuery(params, options) {
|
|
32
32
|
const acceptedPath = [];
|
|
33
|
-
const acceptedBody = ['columnar', 'filter', 'locale', 'params', 'profile', 'query', 'tables'
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
33
|
+
const acceptedBody = ['columnar', 'filter', 'locale', 'params', 'profile', 'query', 'tables'];
|
|
34
|
+
const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
|
|
35
|
+
const querystring = userQuery != null ? { ...userQuery } : {};
|
|
37
36
|
let body;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
38
|
+
if (userBody != null) {
|
|
39
|
+
if (typeof userBody === 'string') {
|
|
40
|
+
body = userBody;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
body = { ...userBody };
|
|
44
|
+
}
|
|
43
45
|
}
|
|
44
46
|
for (const key in params) {
|
|
45
47
|
if (acceptedBody.includes(key)) {
|
|
@@ -50,7 +52,7 @@ class Esql {
|
|
|
50
52
|
else if (acceptedPath.includes(key)) {
|
|
51
53
|
continue;
|
|
52
54
|
}
|
|
53
|
-
else if (key !== 'body') {
|
|
55
|
+
else if (key !== 'body' && key !== 'querystring') {
|
|
54
56
|
// @ts-expect-error
|
|
55
57
|
querystring[key] = params[key];
|
|
56
58
|
}
|
|
@@ -64,13 +66,23 @@ class Esql {
|
|
|
64
66
|
}
|
|
65
67
|
async asyncQueryDelete(params, options) {
|
|
66
68
|
const acceptedPath = ['id'];
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
+
const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
|
|
70
|
+
const querystring = userQuery != null ? { ...userQuery } : {};
|
|
71
|
+
let body;
|
|
72
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
73
|
+
if (userBody != null) {
|
|
74
|
+
if (typeof userBody === 'string') {
|
|
75
|
+
body = userBody;
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
body = { ...userBody };
|
|
79
|
+
}
|
|
80
|
+
}
|
|
69
81
|
for (const key in params) {
|
|
70
82
|
if (acceptedPath.includes(key)) {
|
|
71
83
|
continue;
|
|
72
84
|
}
|
|
73
|
-
else if (key !== 'body') {
|
|
85
|
+
else if (key !== 'body' && key !== 'querystring') {
|
|
74
86
|
// @ts-expect-error
|
|
75
87
|
querystring[key] = params[key];
|
|
76
88
|
}
|
|
@@ -87,13 +99,23 @@ class Esql {
|
|
|
87
99
|
}
|
|
88
100
|
async asyncQueryGet(params, options) {
|
|
89
101
|
const acceptedPath = ['id'];
|
|
90
|
-
const
|
|
91
|
-
const
|
|
102
|
+
const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
|
|
103
|
+
const querystring = userQuery != null ? { ...userQuery } : {};
|
|
104
|
+
let body;
|
|
105
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
106
|
+
if (userBody != null) {
|
|
107
|
+
if (typeof userBody === 'string') {
|
|
108
|
+
body = userBody;
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
body = { ...userBody };
|
|
112
|
+
}
|
|
113
|
+
}
|
|
92
114
|
for (const key in params) {
|
|
93
115
|
if (acceptedPath.includes(key)) {
|
|
94
116
|
continue;
|
|
95
117
|
}
|
|
96
|
-
else if (key !== 'body') {
|
|
118
|
+
else if (key !== 'body' && key !== 'querystring') {
|
|
97
119
|
// @ts-expect-error
|
|
98
120
|
querystring[key] = params[key];
|
|
99
121
|
}
|
|
@@ -110,16 +132,18 @@ class Esql {
|
|
|
110
132
|
}
|
|
111
133
|
async query(params, options) {
|
|
112
134
|
const acceptedPath = [];
|
|
113
|
-
const acceptedBody = ['columnar', 'filter', 'locale', 'params', 'profile', 'query', 'tables'
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
135
|
+
const acceptedBody = ['columnar', 'filter', 'locale', 'params', 'profile', 'query', 'tables'];
|
|
136
|
+
const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
|
|
137
|
+
const querystring = userQuery != null ? { ...userQuery } : {};
|
|
117
138
|
let body;
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
139
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
140
|
+
if (userBody != null) {
|
|
141
|
+
if (typeof userBody === 'string') {
|
|
142
|
+
body = userBody;
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
body = { ...userBody };
|
|
146
|
+
}
|
|
123
147
|
}
|
|
124
148
|
for (const key in params) {
|
|
125
149
|
if (acceptedBody.includes(key)) {
|
|
@@ -130,7 +154,7 @@ class Esql {
|
|
|
130
154
|
else if (acceptedPath.includes(key)) {
|
|
131
155
|
continue;
|
|
132
156
|
}
|
|
133
|
-
else if (key !== 'body') {
|
|
157
|
+
else if (key !== 'body' && key !== 'querystring') {
|
|
134
158
|
// @ts-expect-error
|
|
135
159
|
querystring[key] = params[key];
|
|
136
160
|
}
|
package/lib/api/api/esql.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esql.js","sourceRoot":"","sources":["../../../../src/api/api/esql.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;
|
|
1
|
+
{"version":3,"file":"esql.js","sourceRoot":"","sources":["../../../../src/api/api/esql.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;AAsBH,MAAqB,IAAI;IAEvB,YAAa,SAAoB;QADjC;;;;;WAAoB;QAElB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5B,CAAC;IASD,KAAK,CAAC,UAAU,CAAc,MAA+B,EAAE,OAAiC;QAC9F,MAAM,YAAY,GAAa,EAAE,CAAA;QACjC,MAAM,YAAY,GAAa,CAAC,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAA;QACvG,MAAM,SAAS,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,CAAA;QACrC,MAAM,WAAW,GAAwB,SAAS,IAAI,IAA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,CAAC,GAAG,CAAC,EAAE,CAAC;gBACtC,SAAQ;YACV,CAAC;iBAAM,IAAI,GAAG,KAAK,MAAM,IAAI,GAAG,KAAK,aAAa,EAAE,CAAC;gBACnD,mBAAmB;gBACnB,WAAW,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;YAChC,CAAC;QACH,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,CAAA;QACrB,MAAM,IAAI,GAAG,SAAS,CAAA;QACtB,MAAM,IAAI,GAA6B;YACrC,IAAI,EAAE,YAAY;SACnB,CAAA;QACD,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,CAAA;IACzF,CAAC;CACF;AAjLD,uBAiLC"}
|
package/lib/api/api/exists.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { Transport, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, TransportResult } from '@elastic/transport';
|
|
2
2
|
import * as T from '../types';
|
|
3
|
-
import * as TB from '../typesWithBodyKey';
|
|
4
3
|
interface That {
|
|
5
4
|
transport: Transport;
|
|
6
5
|
}
|
|
7
6
|
/**
|
|
8
7
|
* Check a document. Verify that a document exists. For example, check to see if a document with the `_id` 0 exists: ``` HEAD my-index-000001/_doc/0 ``` If the document exists, the API returns a status code of `200 - OK`. If the document doesn’t exist, the API returns `404 - Not Found`. **Versioning support** You can use the `version` parameter to check the document only if its current version is equal to the specified one. Internally, Elasticsearch has marked the old document as deleted and added an entirely new document. The old version of the document doesn't disappear immediately, although you won't be able to access it. Elasticsearch cleans up deleted documents in the background as you continue to index more data.
|
|
9
|
-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/
|
|
8
|
+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html | Elasticsearch API documentation}
|
|
10
9
|
*/
|
|
11
|
-
export default function ExistsApi(this: That, params: T.ExistsRequest
|
|
12
|
-
export default function ExistsApi(this: That, params: T.ExistsRequest
|
|
13
|
-
export default function ExistsApi(this: That, params: T.ExistsRequest
|
|
10
|
+
export default function ExistsApi(this: That, params: T.ExistsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ExistsResponse>;
|
|
11
|
+
export default function ExistsApi(this: That, params: T.ExistsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ExistsResponse, unknown>>;
|
|
12
|
+
export default function ExistsApi(this: That, params: T.ExistsRequest, options?: TransportRequestOptions): Promise<T.ExistsResponse>;
|
|
14
13
|
export {};
|
package/lib/api/api/exists.js
CHANGED
|
@@ -21,13 +21,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
21
21
|
exports.default = ExistsApi;
|
|
22
22
|
async function ExistsApi(params, options) {
|
|
23
23
|
const acceptedPath = ['id', 'index'];
|
|
24
|
-
const
|
|
25
|
-
const
|
|
24
|
+
const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
|
|
25
|
+
const querystring = userQuery != null ? { ...userQuery } : {};
|
|
26
|
+
let body;
|
|
27
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
28
|
+
if (userBody != null) {
|
|
29
|
+
if (typeof userBody === 'string') {
|
|
30
|
+
body = userBody;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
body = { ...userBody };
|
|
34
|
+
}
|
|
35
|
+
}
|
|
26
36
|
for (const key in params) {
|
|
27
37
|
if (acceptedPath.includes(key)) {
|
|
28
38
|
continue;
|
|
29
39
|
}
|
|
30
|
-
else if (key !== 'body') {
|
|
40
|
+
else if (key !== 'body' && key !== 'querystring') {
|
|
31
41
|
// @ts-expect-error
|
|
32
42
|
querystring[key] = params[key];
|
|
33
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exists.js","sourceRoot":"","sources":["../../../../src/api/api/exists.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SAAS,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAA;IAC/G,MAAM,IAAI,GAA6B;QACrC,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE;YACT,EAAE,EAAE,MAAM,CAAC,EAAE;YACb,KAAK,EAAE,MAAM,CAAC,KAAK;SACpB;KACF,CAAA;IACD,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,CAAA;AACzF,CAAC"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { Transport, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, TransportResult } from '@elastic/transport';
|
|
2
2
|
import * as T from '../types';
|
|
3
|
-
import * as TB from '../typesWithBodyKey';
|
|
4
3
|
interface That {
|
|
5
4
|
transport: Transport;
|
|
6
5
|
}
|
|
7
6
|
/**
|
|
8
7
|
* Check for a document source. Check whether a document source exists in an index. For example: ``` HEAD my-index-000001/_source/1 ``` A document's source is not available if it is disabled in the mapping.
|
|
9
|
-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/
|
|
8
|
+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html | Elasticsearch API documentation}
|
|
10
9
|
*/
|
|
11
|
-
export default function ExistsSourceApi(this: That, params: T.ExistsSourceRequest
|
|
12
|
-
export default function ExistsSourceApi(this: That, params: T.ExistsSourceRequest
|
|
13
|
-
export default function ExistsSourceApi(this: That, params: T.ExistsSourceRequest
|
|
10
|
+
export default function ExistsSourceApi(this: That, params: T.ExistsSourceRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ExistsSourceResponse>;
|
|
11
|
+
export default function ExistsSourceApi(this: That, params: T.ExistsSourceRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ExistsSourceResponse, unknown>>;
|
|
12
|
+
export default function ExistsSourceApi(this: That, params: T.ExistsSourceRequest, options?: TransportRequestOptions): Promise<T.ExistsSourceResponse>;
|
|
14
13
|
export {};
|
|
@@ -21,13 +21,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
21
21
|
exports.default = ExistsSourceApi;
|
|
22
22
|
async function ExistsSourceApi(params, options) {
|
|
23
23
|
const acceptedPath = ['id', 'index'];
|
|
24
|
-
const
|
|
25
|
-
const
|
|
24
|
+
const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
|
|
25
|
+
const querystring = userQuery != null ? { ...userQuery } : {};
|
|
26
|
+
let body;
|
|
27
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
28
|
+
if (userBody != null) {
|
|
29
|
+
if (typeof userBody === 'string') {
|
|
30
|
+
body = userBody;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
body = { ...userBody };
|
|
34
|
+
}
|
|
35
|
+
}
|
|
26
36
|
for (const key in params) {
|
|
27
37
|
if (acceptedPath.includes(key)) {
|
|
28
38
|
continue;
|
|
29
39
|
}
|
|
30
|
-
else if (key !== 'body') {
|
|
40
|
+
else if (key !== 'body' && key !== 'querystring') {
|
|
31
41
|
// @ts-expect-error
|
|
32
42
|
querystring[key] = params[key];
|
|
33
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exists_source.js","sourceRoot":"","sources":["../../../../src/api/api/exists_source.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;
|
|
1
|
+
{"version":3,"file":"exists_source.js","sourceRoot":"","sources":["../../../../src/api/api/exists_source.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;AA6BH,kCAkCC;AAlCc,KAAK,UAAU,eAAe,CAAc,MAA6B,EAAE,OAAiC;IACzH,MAAM,YAAY,GAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IAC9C,MAAM,SAAS,GAAG,MAAM,aA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I,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,CAAA;AACzF,CAAC"}
|
package/lib/api/api/explain.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { Transport, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, TransportResult } from '@elastic/transport';
|
|
2
2
|
import * as T from '../types';
|
|
3
|
-
import * as TB from '../typesWithBodyKey';
|
|
4
3
|
interface That {
|
|
5
4
|
transport: Transport;
|
|
6
5
|
}
|
|
7
6
|
/**
|
|
8
|
-
* Explain a document match result.
|
|
9
|
-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/
|
|
7
|
+
* Explain a document match result. Returns information about why a specific document matches, or doesn’t match, a query.
|
|
8
|
+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html | Elasticsearch API documentation}
|
|
10
9
|
*/
|
|
11
|
-
export default function ExplainApi<TDocument = unknown>(this: That, params: T.ExplainRequest
|
|
12
|
-
export default function ExplainApi<TDocument = unknown>(this: That, params: T.ExplainRequest
|
|
13
|
-
export default function ExplainApi<TDocument = unknown>(this: That, params: T.ExplainRequest
|
|
10
|
+
export default function ExplainApi<TDocument = unknown>(this: That, params: T.ExplainRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ExplainResponse<TDocument>>;
|
|
11
|
+
export default function ExplainApi<TDocument = unknown>(this: That, params: T.ExplainRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ExplainResponse<TDocument>, unknown>>;
|
|
12
|
+
export default function ExplainApi<TDocument = unknown>(this: That, params: T.ExplainRequest, options?: TransportRequestOptions): Promise<T.ExplainResponse<TDocument>>;
|
|
14
13
|
export {};
|
package/lib/api/api/explain.js
CHANGED
|
@@ -22,15 +22,17 @@ exports.default = ExplainApi;
|
|
|
22
22
|
async function ExplainApi(params, options) {
|
|
23
23
|
const acceptedPath = ['id', 'index'];
|
|
24
24
|
const acceptedBody = ['query'];
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
25
|
+
const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
|
|
26
|
+
const querystring = userQuery != null ? { ...userQuery } : {};
|
|
28
27
|
let body;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
29
|
+
if (userBody != null) {
|
|
30
|
+
if (typeof userBody === 'string') {
|
|
31
|
+
body = userBody;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
body = { ...userBody };
|
|
35
|
+
}
|
|
34
36
|
}
|
|
35
37
|
for (const key in params) {
|
|
36
38
|
if (acceptedBody.includes(key)) {
|
|
@@ -41,7 +43,7 @@ async function ExplainApi(params, options) {
|
|
|
41
43
|
else if (acceptedPath.includes(key)) {
|
|
42
44
|
continue;
|
|
43
45
|
}
|
|
44
|
-
else if (key !== 'body') {
|
|
46
|
+
else if (key !== 'body' && key !== 'querystring') {
|
|
45
47
|
// @ts-expect-error
|
|
46
48
|
querystring[key] = params[key];
|
|
47
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explain.js","sourceRoot":"","sources":["../../../../src/api/api/explain.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;
|
|
1
|
+
{"version":3,"file":"explain.js","sourceRoot":"","sources":["../../../../src/api/api/explain.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;AA6BH,6BAuCC;AAvCc,KAAK,UAAU,UAAU,CAAmC,MAAwB,EAAE,OAAiC;IACpI,MAAM,YAAY,GAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IAC9C,MAAM,YAAY,GAAa,CAAC,OAAO,CAAC,CAAA;IACxC,MAAM,SAAS,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,CAAA;IACrC,MAAM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A6B;QACrC,IAAI,EAAE,SAAS;QACf,SAAS,EAAE;YACT,EAAE,EAAE,MAAM,CAAC,EAAE;YACb,KAAK,EAAE,MAAM,CAAC,KAAK;SACpB;KACF,CAAA;IACD,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,CAAA;AACzF,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Transport, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, TransportResult } from '@elastic/transport';
|
|
2
2
|
import * as T from '../types';
|
|
3
|
-
import * as TB from '../typesWithBodyKey';
|
|
4
3
|
interface That {
|
|
5
4
|
transport: Transport;
|
|
6
5
|
}
|
|
@@ -9,17 +8,17 @@ export default class Features {
|
|
|
9
8
|
constructor(transport: Transport);
|
|
10
9
|
/**
|
|
11
10
|
* Get the features. Get a list of features that can be included in snapshots using the `feature_states` field when creating a snapshot. You can use this API to determine which feature states to include when taking a snapshot. By default, all feature states are included in a snapshot if that snapshot includes the global state, or none if it does not. A feature state includes one or more system indices necessary for a given feature to function. In order to ensure data integrity, all system indices that comprise a feature state are snapshotted and restored together. The features listed by this API are a combination of built-in features and features defined by plugins. In order for a feature state to be listed in this API and recognized as a valid feature state by the create snapshot API, the plugin that defines that feature must be installed on the master node.
|
|
12
|
-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/
|
|
11
|
+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/get-features-api.html | Elasticsearch API documentation}
|
|
13
12
|
*/
|
|
14
|
-
getFeatures(this: That, params?: T.FeaturesGetFeaturesRequest
|
|
15
|
-
getFeatures(this: That, params?: T.FeaturesGetFeaturesRequest
|
|
16
|
-
getFeatures(this: That, params?: T.FeaturesGetFeaturesRequest
|
|
13
|
+
getFeatures(this: That, params?: T.FeaturesGetFeaturesRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FeaturesGetFeaturesResponse>;
|
|
14
|
+
getFeatures(this: That, params?: T.FeaturesGetFeaturesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FeaturesGetFeaturesResponse, unknown>>;
|
|
15
|
+
getFeatures(this: That, params?: T.FeaturesGetFeaturesRequest, options?: TransportRequestOptions): Promise<T.FeaturesGetFeaturesResponse>;
|
|
17
16
|
/**
|
|
18
17
|
* Reset the features. Clear all of the state information stored in system indices by Elasticsearch features, including the security and machine learning indices. WARNING: Intended for development and testing use only. Do not reset features on a production cluster. Return a cluster to the same state as a new installation by resetting the feature state for all Elasticsearch features. This deletes all state information stored in system indices. The response code is HTTP 200 if the state is successfully reset for all features. It is HTTP 500 if the reset operation failed for any feature. Note that select features might provide a way to reset particular system indices. Using this API resets all features, both those that are built-in and implemented as plugins. To list the features that will be affected, use the get features API. IMPORTANT: The features installed on the node you submit this request to are the features that will be reset. Run on the master node if you have any doubts about which plugins are installed on individual nodes.
|
|
19
|
-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/
|
|
18
|
+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html | Elasticsearch API documentation}
|
|
20
19
|
*/
|
|
21
|
-
resetFeatures(this: That, params?: T.FeaturesResetFeaturesRequest
|
|
22
|
-
resetFeatures(this: That, params?: T.FeaturesResetFeaturesRequest
|
|
23
|
-
resetFeatures(this: That, params?: T.FeaturesResetFeaturesRequest
|
|
20
|
+
resetFeatures(this: That, params?: T.FeaturesResetFeaturesRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FeaturesResetFeaturesResponse>;
|
|
21
|
+
resetFeatures(this: That, params?: T.FeaturesResetFeaturesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FeaturesResetFeaturesResponse, unknown>>;
|
|
22
|
+
resetFeatures(this: That, params?: T.FeaturesResetFeaturesRequest, options?: TransportRequestOptions): Promise<T.FeaturesResetFeaturesResponse>;
|
|
24
23
|
}
|
|
25
24
|
export {};
|
package/lib/api/api/features.js
CHANGED
|
@@ -30,14 +30,24 @@ class Features {
|
|
|
30
30
|
}
|
|
31
31
|
async getFeatures(params, options) {
|
|
32
32
|
const acceptedPath = [];
|
|
33
|
-
const
|
|
34
|
-
const
|
|
33
|
+
const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
|
|
34
|
+
const querystring = userQuery != null ? { ...userQuery } : {};
|
|
35
|
+
let body;
|
|
36
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
37
|
+
if (userBody != null) {
|
|
38
|
+
if (typeof userBody === 'string') {
|
|
39
|
+
body = userBody;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
body = { ...userBody };
|
|
43
|
+
}
|
|
44
|
+
}
|
|
35
45
|
params = params !== null && params !== void 0 ? params : {};
|
|
36
46
|
for (const key in params) {
|
|
37
47
|
if (acceptedPath.includes(key)) {
|
|
38
48
|
continue;
|
|
39
49
|
}
|
|
40
|
-
else if (key !== 'body') {
|
|
50
|
+
else if (key !== 'body' && key !== 'querystring') {
|
|
41
51
|
// @ts-expect-error
|
|
42
52
|
querystring[key] = params[key];
|
|
43
53
|
}
|
|
@@ -51,14 +61,24 @@ class Features {
|
|
|
51
61
|
}
|
|
52
62
|
async resetFeatures(params, options) {
|
|
53
63
|
const acceptedPath = [];
|
|
54
|
-
const
|
|
55
|
-
const
|
|
64
|
+
const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
|
|
65
|
+
const querystring = userQuery != null ? { ...userQuery } : {};
|
|
66
|
+
let body;
|
|
67
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
68
|
+
if (userBody != null) {
|
|
69
|
+
if (typeof userBody === 'string') {
|
|
70
|
+
body = userBody;
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
body = { ...userBody };
|
|
74
|
+
}
|
|
75
|
+
}
|
|
56
76
|
params = params !== null && params !== void 0 ? params : {};
|
|
57
77
|
for (const key in params) {
|
|
58
78
|
if (acceptedPath.includes(key)) {
|
|
59
79
|
continue;
|
|
60
80
|
}
|
|
61
|
-
else if (key !== 'body') {
|
|
81
|
+
else if (key !== 'body' && key !== 'querystring') {
|
|
62
82
|
// @ts-expect-error
|
|
63
83
|
querystring[key] = params[key];
|
|
64
84
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features.js","sourceRoot":"","sources":["../../../../src/api/api/features.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;
|
|
1
|
+
{"version":3,"file":"features.js","sourceRoot":"","sources":["../../../../src/api/api/features.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;AAsBH,MAAqB,QAAQ;IAE3B,YAAa,SAAoB;QADjC;;;;;WAAoB;QAElB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5B,CAAC;IASD,KAAK,CAAC,WAAW,CAAc,MAAqC,EAAE,OAAiC;QACrG,MAAM,YAAY,GAAa,EAAE,CAAA;QACjC,MAAM,SAAS,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,CAAA;QACrC,MAAM,WAAW,GAAwB,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;QAElF,IAAI,IAA8C,CAAA;QAClD,MAAM,QAAQ,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAA;QAC7B,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACrB,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;gBACjC,IAAI,GAAG,QAAQ,CAAA;YACjB,CAAC;iBAAM,CAAC;gBACN,IAAI,GAAG,EAAE,GAAG,QAAQ,EAAE,CAAA;YACxB,CAAC;QACH,CAAC;QAED,MAAM,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EA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aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,CAAA;QACrB,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;YACzB,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC/B,SAAQ;YACV,CAAC;iBAAM,IAAI,GAAG,KAAK,MAAM,IAAI,GAAG,KAAK,aAAa,EAAE,CAAC;gBACnD,mBAAmB;gBACnB,WAAW,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;YAChC,CAAC;QACH,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,CAAA;QACrB,MAAM,IAAI,GAAG,mBAAmB,CAAA;QAChC,MAAM,IAAI,GAA6B;YACrC,IAAI,EAAE,yBAAyB;SAChC,CAAA;QACD,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,CAAA;IACzF,CAAC;CACF;AArFD,2BAqFC"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { Transport, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, TransportResult } from '@elastic/transport';
|
|
2
2
|
import * as T from '../types';
|
|
3
|
-
import * as TB from '../typesWithBodyKey';
|
|
4
3
|
interface That {
|
|
5
4
|
transport: Transport;
|
|
6
5
|
}
|
|
7
6
|
/**
|
|
8
7
|
* Get the field capabilities. Get information about the capabilities of fields among multiple indices. For data streams, the API returns field capabilities among the stream’s backing indices. It returns runtime fields like any other field. For example, a runtime field with a type of keyword is returned the same as any other field that belongs to the `keyword` family.
|
|
9
|
-
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/
|
|
8
|
+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html | Elasticsearch API documentation}
|
|
10
9
|
*/
|
|
11
|
-
export default function FieldCapsApi(this: That, params?: T.FieldCapsRequest
|
|
12
|
-
export default function FieldCapsApi(this: That, params?: T.FieldCapsRequest
|
|
13
|
-
export default function FieldCapsApi(this: That, params?: T.FieldCapsRequest
|
|
10
|
+
export default function FieldCapsApi(this: That, params?: T.FieldCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FieldCapsResponse>;
|
|
11
|
+
export default function FieldCapsApi(this: That, params?: T.FieldCapsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FieldCapsResponse, unknown>>;
|
|
12
|
+
export default function FieldCapsApi(this: That, params?: T.FieldCapsRequest, options?: TransportRequestOptions): Promise<T.FieldCapsResponse>;
|
|
14
13
|
export {};
|
|
@@ -22,15 +22,17 @@ exports.default = FieldCapsApi;
|
|
|
22
22
|
async function FieldCapsApi(params, options) {
|
|
23
23
|
const acceptedPath = ['index'];
|
|
24
24
|
const acceptedBody = ['fields', 'index_filter', 'runtime_mappings'];
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
25
|
+
const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
|
|
26
|
+
const querystring = userQuery != null ? { ...userQuery } : {};
|
|
28
27
|
let body;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
29
|
+
if (userBody != null) {
|
|
30
|
+
if (typeof userBody === 'string') {
|
|
31
|
+
body = userBody;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
body = { ...userBody };
|
|
35
|
+
}
|
|
34
36
|
}
|
|
35
37
|
params = params !== null && params !== void 0 ? params : {};
|
|
36
38
|
for (const key in params) {
|
|
@@ -42,7 +44,7 @@ async function FieldCapsApi(params, options) {
|
|
|
42
44
|
else if (acceptedPath.includes(key)) {
|
|
43
45
|
continue;
|
|
44
46
|
}
|
|
45
|
-
else if (key !== 'body') {
|
|
47
|
+
else if (key !== 'body' && key !== 'querystring') {
|
|
46
48
|
// @ts-expect-error
|
|
47
49
|
querystring[key] = params[key];
|
|
48
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field_caps.js","sourceRoot":"","sources":["../../../../src/api/api/field_caps.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;
|
|
1
|
+
{"version":3,"file":"field_caps.js","sourceRoot":"","sources":["../../../../src/api/api/field_caps.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;AA6BH,+BA8CC;AA9Cc,KAAK,UAAU,YAAY,CAAc,MAA2B,EAAE,OAAiC;IACpH,MAAM,YAAY,GAAa,CAAC,OAAO,CAAC,CAAA;IACxC,MAAM,YAAY,GAAa,CAAC,QAAQ,EAAE,cAAc,EAAE,kBAAkB,CAAC,CAAA;IAC7E,MAAM,SAAS,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,CAAA;IACrC,MAAM,WAAW,GAAwB,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAElF,IAAI,IAA8C,CAAA;IAClD,MAAM,QAAQ,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAA;IAC7B,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;QACrB,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;YACjC,IAAI,GAAG,QAAQ,CAAA;QACjB,CAAC;aAAM,CAAC;YACN,IAAI,GAAG,EAAE,GAAG,QAAQ,EAAE,CAAA;QACxB,CAAC;IACH,CAAC;IAED,MAAM,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,CAAA;IACrB,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC/B,IA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