plugin-elastic-report 0.0.0-stage → 0.1.1
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/ai/skills/elastic-report/SKILLS.md +32 -0
- package/client-v2.d.ts +2 -0
- package/client-v2.js +1 -0
- package/client.d.ts +2 -0
- package/client.js +1 -0
- package/dist/client/index.js +10 -0
- package/dist/client-v2/851.488fdbf5bc5b6a36.js +10 -0
- package/dist/client-v2/index.js +10 -0
- package/dist/externalVersion.js +20 -0
- package/dist/index.js +48 -0
- package/dist/locale/en-US.json +99 -0
- package/dist/locale/vi-VN.json +99 -0
- package/dist/locale/zh-CN.json +99 -0
- package/dist/node_modules/@elastic/elasticsearch/.dockerignore +11 -0
- package/dist/node_modules/@elastic/elasticsearch/LICENSE +202 -0
- package/dist/node_modules/@elastic/elasticsearch/NOTICE.txt +2 -0
- package/dist/node_modules/@elastic/elasticsearch/catalog-info.yaml +50 -0
- package/dist/node_modules/@elastic/elasticsearch/codecov.yml +14 -0
- package/dist/node_modules/@elastic/elasticsearch/index.d.ts +28 -0
- package/dist/node_modules/@elastic/elasticsearch/index.js +85525 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/async_search.d.ts +39 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/async_search.js +155 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/autoscaling.d.ts +39 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/autoscaling.js +130 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/bulk.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/bulk.js +60 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/capabilities.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/capabilities.js +43 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/cat.d.ts +193 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/cat.js +766 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ccr.d.ts +102 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ccr.js +395 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/clear_scroll.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/clear_scroll.js +60 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/close_point_in_time.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/close_point_in_time.js +56 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/cluster.d.ts +123 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/cluster.js +482 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/connector.d.ts +245 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/connector.js +1121 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/count.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/count.js +68 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/create.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/create.js +53 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/dangling_indices.d.ts +32 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/dangling_indices.js +100 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete.js +46 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete_by_query.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete_by_query.js +59 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete_by_query_rethrottle.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete_by_query_rethrottle.js +45 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete_script.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete_script.js +45 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/enrich.d.ts +46 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/enrich.js +169 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/eql.d.ts +39 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/eql.js +139 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/esql.d.ts +46 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/esql.js +170 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/exists.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/exists.js +46 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/exists_source.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/exists_source.js +46 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/explain.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/explain.js +60 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/features.d.ts +25 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/features.js +75 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/field_caps.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/field_caps.js +68 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/fleet.d.ts +50 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/fleet.js +211 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get.js +46 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_script.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_script.js +45 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_script_context.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_script_context.js +43 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_script_languages.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_script_languages.js +43 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_source.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_source.js +46 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/graph.d.ts +18 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/graph.js +70 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/health_report.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/health_report.js +54 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ilm.d.ts +88 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ilm.js +329 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/index.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/index.js +61 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/indices.d.ts +494 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/indices.js +2133 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/inference.d.ts +221 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/inference.js +1167 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/info.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/info.js +43 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ingest.d.ts +95 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ingest.js +389 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/knn_search.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/knn_search.js +59 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/license.d.ts +60 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/license.js +194 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/logstash.d.ts +32 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/logstash.js +118 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/mget.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/mget.js +68 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/migration.d.ts +32 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/migration.js +107 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ml.d.ts +522 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ml.js +2468 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/monitoring.d.ts +18 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/monitoring.js +60 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/msearch.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/msearch.js +60 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/msearch_template.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/msearch_template.js +60 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/mtermvectors.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/mtermvectors.js +68 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/nodes.d.ts +60 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/nodes.js +290 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/open_point_in_time.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/open_point_in_time.js +59 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ping.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ping.js +43 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/profiling.d.ts +39 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/profiling.js +135 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/put_script.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/put_script.js +68 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/query_rules.d.ts +67 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/query_rules.js +260 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/rank_eval.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/rank_eval.js +67 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/reindex.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/reindex.js +56 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/reindex_rethrottle.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/reindex_rethrottle.js +45 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/render_search_template.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/render_search_template.js +68 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/rollup.d.ts +67 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/rollup.js +263 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/scripts_painless_execute.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/scripts_painless_execute.js +57 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/scroll.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/scroll.js +59 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search.js +75 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_application.d.ts +81 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_application.js +313 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_mvt.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_mvt.js +63 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_shards.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_shards.js +54 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_template.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_template.js +68 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/searchable_snapshots.d.ts +39 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/searchable_snapshots.js +167 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/security.d.ts +459 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/security.js +1982 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/shutdown.d.ts +32 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/shutdown.js +125 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/simulate.d.ts +18 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/simulate.js +78 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/slm.d.ts +74 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/slm.js +253 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/snapshot.d.ts +102 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/snapshot.js +410 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/sql.d.ts +53 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/sql.js +205 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ssl.d.ts +18 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ssl.js +54 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/streams.d.ts +32 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/streams.js +96 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/synonyms.d.ts +60 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/synonyms.js +223 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/tasks.d.ts +32 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/tasks.js +109 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/terms_enum.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/terms_enum.js +59 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/termvectors.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/termvectors.js +68 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/text_structure.d.ts +39 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/text_structure.js +148 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/transform.d.ts +101 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/transform.js +386 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/update.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/update.js +60 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/update_by_query.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/update_by_query.js +59 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/update_by_query_rethrottle.d.ts +14 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/update_by_query_rethrottle.js +45 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/watcher.d.ts +102 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/watcher.js +405 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/xpack.d.ts +25 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/api/xpack.js +75 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/index.d.ts +265 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/index.js +632 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/types.d.ts +19933 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/types.js +21 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/typesWithBodyKey.d.ts +20606 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/api/typesWithBodyKey.js +21 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/client.d.ts +152 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/client.js +369 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/helpers.d.ts +184 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/helpers.js +889 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/sniffingTransport.d.ts +4 -0
- package/dist/node_modules/@elastic/elasticsearch/lib/sniffingTransport.js +56 -0
- package/dist/node_modules/@elastic/elasticsearch/node_modules/.bin/arrow2csv +15 -0
- package/dist/node_modules/@elastic/elasticsearch/node_modules/.bin/arrow2csv.cmd +7 -0
- package/dist/node_modules/@elastic/elasticsearch/package.json +1 -0
- package/dist/node_modules/@elastic/elasticsearch/tsconfig.json +38 -0
- package/dist/server/acl-guard.js +107 -0
- package/dist/server/collections/es-report-data-views.js +79 -0
- package/dist/server/collections/es-reports.js +95 -0
- package/dist/server/index.js +58 -0
- package/dist/server/mcp/ElasticReportMcpServer.js +344 -0
- package/dist/server/mcp/ElasticReportToolCatalog.js +417 -0
- package/dist/server/plugin.js +395 -0
- package/dist/server/services/ElasticReportService.js +263 -0
- package/dist/server/services/ElasticsearchConnectionService.js +332 -0
- package/dist/server/services/ReportQueryCompiler.js +858 -0
- package/dist/shared/constants.js +81 -0
- package/dist/shared/types.js +24 -0
- package/package.json +61 -4
- package/server.d.ts +2 -0
- package/server.js +1 -0
- package/src/client/index.tsx +19 -0
- package/src/client-v2/__tests__/elastic-report.test.tsx +311 -0
- package/src/client-v2/api.ts +224 -0
- package/src/client-v2/components/ElasticBasicCharts.tsx +399 -0
- package/src/client-v2/components/ElasticReportBlock.tsx +160 -0
- package/src/client-v2/components/ElasticReportRenderer.tsx +707 -0
- package/src/client-v2/components/HighlightText.tsx +50 -0
- package/src/client-v2/components/ReportSelect.tsx +72 -0
- package/src/client-v2/index.tsx +14 -0
- package/src/client-v2/locale.ts +23 -0
- package/src/client-v2/models/ElasticReportBlockModel.tsx +85 -0
- package/src/client-v2/pages/ElasticReportManager.tsx +1047 -0
- package/src/client-v2/plugin.tsx +52 -0
- package/src/index.ts +11 -0
- package/src/locale/en-US.json +99 -0
- package/src/locale/vi-VN.json +99 -0
- package/src/locale/zh-CN.json +99 -0
- package/src/server/__tests__/query-compiler.test.ts +231 -0
- package/src/server/__tests__/report-mcp-acl.integration.test.ts +377 -0
- package/src/server/acl-guard.ts +103 -0
- package/src/server/collections/es-report-data-views.ts +58 -0
- package/src/server/collections/es-reports.ts +74 -0
- package/src/server/index.ts +15 -0
- package/src/server/mcp/ElasticReportMcpServer.ts +391 -0
- package/src/server/mcp/ElasticReportToolCatalog.ts +417 -0
- package/src/server/plugin.ts +431 -0
- package/src/server/services/ElasticReportService.ts +326 -0
- package/src/server/services/ElasticsearchConnectionService.ts +401 -0
- package/src/server/services/ReportQueryCompiler.ts +1017 -0
- package/src/shared/constants.ts +29 -0
- package/src/shared/types.ts +175 -0
- package/README.md +0 -3
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Licensed to Elasticsearch B.V. under one or more contributor
|
|
4
|
+
* license agreements. See the NOTICE file distributed with
|
|
5
|
+
* this work for additional information regarding copyright
|
|
6
|
+
* ownership. Elasticsearch B.V. licenses this file to you under
|
|
7
|
+
* the Apache License, Version 2.0 (the "License"); you may
|
|
8
|
+
* not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing,
|
|
14
|
+
* software distributed under the License is distributed on an
|
|
15
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
+
* KIND, either express or implied. See the License for the
|
|
17
|
+
* specific language governing permissions and limitations
|
|
18
|
+
* under the License.
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
class Enrich {
|
|
22
|
+
constructor(transport) {
|
|
23
|
+
Object.defineProperty(this, "transport", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true,
|
|
27
|
+
value: void 0
|
|
28
|
+
});
|
|
29
|
+
this.transport = transport;
|
|
30
|
+
}
|
|
31
|
+
async deletePolicy(params, options) {
|
|
32
|
+
const acceptedPath = ['name'];
|
|
33
|
+
const querystring = {};
|
|
34
|
+
const body = undefined;
|
|
35
|
+
for (const key in params) {
|
|
36
|
+
if (acceptedPath.includes(key)) {
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
else if (key !== 'body') {
|
|
40
|
+
// @ts-expect-error
|
|
41
|
+
querystring[key] = params[key];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const method = 'DELETE';
|
|
45
|
+
const path = `/_enrich/policy/${encodeURIComponent(params.name.toString())}`;
|
|
46
|
+
const meta = {
|
|
47
|
+
name: 'enrich.delete_policy',
|
|
48
|
+
pathParts: {
|
|
49
|
+
name: params.name
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
return await this.transport.request({ path, method, querystring, body, meta }, options);
|
|
53
|
+
}
|
|
54
|
+
async executePolicy(params, options) {
|
|
55
|
+
const acceptedPath = ['name'];
|
|
56
|
+
const querystring = {};
|
|
57
|
+
const body = undefined;
|
|
58
|
+
for (const key in params) {
|
|
59
|
+
if (acceptedPath.includes(key)) {
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
else if (key !== 'body') {
|
|
63
|
+
// @ts-expect-error
|
|
64
|
+
querystring[key] = params[key];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
const method = 'PUT';
|
|
68
|
+
const path = `/_enrich/policy/${encodeURIComponent(params.name.toString())}/_execute`;
|
|
69
|
+
const meta = {
|
|
70
|
+
name: 'enrich.execute_policy',
|
|
71
|
+
pathParts: {
|
|
72
|
+
name: params.name
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
return await this.transport.request({ path, method, querystring, body, meta }, options);
|
|
76
|
+
}
|
|
77
|
+
async getPolicy(params, options) {
|
|
78
|
+
const acceptedPath = ['name'];
|
|
79
|
+
const querystring = {};
|
|
80
|
+
const body = undefined;
|
|
81
|
+
params = params !== null && params !== void 0 ? params : {};
|
|
82
|
+
for (const key in params) {
|
|
83
|
+
if (acceptedPath.includes(key)) {
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
else if (key !== 'body') {
|
|
87
|
+
// @ts-expect-error
|
|
88
|
+
querystring[key] = params[key];
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
let method = '';
|
|
92
|
+
let path = '';
|
|
93
|
+
if (params.name != null) {
|
|
94
|
+
method = 'GET';
|
|
95
|
+
path = `/_enrich/policy/${encodeURIComponent(params.name.toString())}`;
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
method = 'GET';
|
|
99
|
+
path = '/_enrich/policy';
|
|
100
|
+
}
|
|
101
|
+
const meta = {
|
|
102
|
+
name: 'enrich.get_policy',
|
|
103
|
+
pathParts: {
|
|
104
|
+
name: params.name
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
return await this.transport.request({ path, method, querystring, body, meta }, options);
|
|
108
|
+
}
|
|
109
|
+
async putPolicy(params, options) {
|
|
110
|
+
const acceptedPath = ['name'];
|
|
111
|
+
const acceptedBody = ['geo_match', 'match', 'range'];
|
|
112
|
+
const querystring = {};
|
|
113
|
+
// @ts-expect-error
|
|
114
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
115
|
+
let body;
|
|
116
|
+
if (typeof userBody === 'string') {
|
|
117
|
+
body = userBody;
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
121
|
+
}
|
|
122
|
+
for (const key in params) {
|
|
123
|
+
if (acceptedBody.includes(key)) {
|
|
124
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
125
|
+
// @ts-expect-error
|
|
126
|
+
body[key] = params[key];
|
|
127
|
+
}
|
|
128
|
+
else if (acceptedPath.includes(key)) {
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
else if (key !== 'body') {
|
|
132
|
+
// @ts-expect-error
|
|
133
|
+
querystring[key] = params[key];
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
const method = 'PUT';
|
|
137
|
+
const path = `/_enrich/policy/${encodeURIComponent(params.name.toString())}`;
|
|
138
|
+
const meta = {
|
|
139
|
+
name: 'enrich.put_policy',
|
|
140
|
+
pathParts: {
|
|
141
|
+
name: params.name
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
return await this.transport.request({ path, method, querystring, body, meta }, options);
|
|
145
|
+
}
|
|
146
|
+
async stats(params, options) {
|
|
147
|
+
const acceptedPath = [];
|
|
148
|
+
const querystring = {};
|
|
149
|
+
const body = undefined;
|
|
150
|
+
params = params !== null && params !== void 0 ? params : {};
|
|
151
|
+
for (const key in params) {
|
|
152
|
+
if (acceptedPath.includes(key)) {
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
else if (key !== 'body') {
|
|
156
|
+
// @ts-expect-error
|
|
157
|
+
querystring[key] = params[key];
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
const method = 'GET';
|
|
161
|
+
const path = '/_enrich/_stats';
|
|
162
|
+
const meta = {
|
|
163
|
+
name: 'enrich.stats'
|
|
164
|
+
};
|
|
165
|
+
return await this.transport.request({ path, method, querystring, body, meta }, options);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
exports.default = Enrich;
|
|
169
|
+
//# sourceMappingURL=enrich.js.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Transport, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, TransportResult } from '@elastic/transport';
|
|
2
|
+
import * as T from '../types';
|
|
3
|
+
import * as TB from '../typesWithBodyKey';
|
|
4
|
+
interface That {
|
|
5
|
+
transport: Transport;
|
|
6
|
+
}
|
|
7
|
+
export default class Eql {
|
|
8
|
+
transport: Transport;
|
|
9
|
+
constructor(transport: Transport);
|
|
10
|
+
/**
|
|
11
|
+
* Delete an async EQL search. Delete an async EQL search or a stored synchronous EQL search. The API also deletes results for the search.
|
|
12
|
+
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v8/operation/operation-eql-delete | Elasticsearch API documentation}
|
|
13
|
+
*/
|
|
14
|
+
delete(this: That, params: T.EqlDeleteRequest | TB.EqlDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EqlDeleteResponse>;
|
|
15
|
+
delete(this: That, params: T.EqlDeleteRequest | TB.EqlDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EqlDeleteResponse, unknown>>;
|
|
16
|
+
delete(this: That, params: T.EqlDeleteRequest | TB.EqlDeleteRequest, options?: TransportRequestOptions): Promise<T.EqlDeleteResponse>;
|
|
17
|
+
/**
|
|
18
|
+
* Get async EQL search results. Get the current status and available results for an async EQL search or a stored synchronous EQL search.
|
|
19
|
+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/get-async-eql-search-api.html | Elasticsearch API documentation}
|
|
20
|
+
*/
|
|
21
|
+
get<TEvent = unknown>(this: That, params: T.EqlGetRequest | TB.EqlGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EqlGetResponse<TEvent>>;
|
|
22
|
+
get<TEvent = unknown>(this: That, params: T.EqlGetRequest | TB.EqlGetRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EqlGetResponse<TEvent>, unknown>>;
|
|
23
|
+
get<TEvent = unknown>(this: That, params: T.EqlGetRequest | TB.EqlGetRequest, options?: TransportRequestOptions): Promise<T.EqlGetResponse<TEvent>>;
|
|
24
|
+
/**
|
|
25
|
+
* Get the async EQL status. Get the current status for an async EQL search or a stored synchronous EQL search without returning results.
|
|
26
|
+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/get-async-eql-status-api.html | Elasticsearch API documentation}
|
|
27
|
+
*/
|
|
28
|
+
getStatus(this: That, params: T.EqlGetStatusRequest | TB.EqlGetStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EqlGetStatusResponse>;
|
|
29
|
+
getStatus(this: That, params: T.EqlGetStatusRequest | TB.EqlGetStatusRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EqlGetStatusResponse, unknown>>;
|
|
30
|
+
getStatus(this: That, params: T.EqlGetStatusRequest | TB.EqlGetStatusRequest, options?: TransportRequestOptions): Promise<T.EqlGetStatusResponse>;
|
|
31
|
+
/**
|
|
32
|
+
* Get EQL search results. Returns search results for an Event Query Language (EQL) query. EQL assumes each document in a data stream or index corresponds to an event.
|
|
33
|
+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/eql-search-api.html | Elasticsearch API documentation}
|
|
34
|
+
*/
|
|
35
|
+
search<TEvent = unknown>(this: That, params: T.EqlSearchRequest | TB.EqlSearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EqlSearchResponse<TEvent>>;
|
|
36
|
+
search<TEvent = unknown>(this: That, params: T.EqlSearchRequest | TB.EqlSearchRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EqlSearchResponse<TEvent>, unknown>>;
|
|
37
|
+
search<TEvent = unknown>(this: That, params: T.EqlSearchRequest | TB.EqlSearchRequest, options?: TransportRequestOptions): Promise<T.EqlSearchResponse<TEvent>>;
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Licensed to Elasticsearch B.V. under one or more contributor
|
|
4
|
+
* license agreements. See the NOTICE file distributed with
|
|
5
|
+
* this work for additional information regarding copyright
|
|
6
|
+
* ownership. Elasticsearch B.V. licenses this file to you under
|
|
7
|
+
* the Apache License, Version 2.0 (the "License"); you may
|
|
8
|
+
* not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing,
|
|
14
|
+
* software distributed under the License is distributed on an
|
|
15
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
+
* KIND, either express or implied. See the License for the
|
|
17
|
+
* specific language governing permissions and limitations
|
|
18
|
+
* under the License.
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
class Eql {
|
|
22
|
+
constructor(transport) {
|
|
23
|
+
Object.defineProperty(this, "transport", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true,
|
|
27
|
+
value: void 0
|
|
28
|
+
});
|
|
29
|
+
this.transport = transport;
|
|
30
|
+
}
|
|
31
|
+
async delete(params, options) {
|
|
32
|
+
const acceptedPath = ['id'];
|
|
33
|
+
const querystring = {};
|
|
34
|
+
const body = undefined;
|
|
35
|
+
for (const key in params) {
|
|
36
|
+
if (acceptedPath.includes(key)) {
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
else if (key !== 'body') {
|
|
40
|
+
// @ts-expect-error
|
|
41
|
+
querystring[key] = params[key];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const method = 'DELETE';
|
|
45
|
+
const path = `/_eql/search/${encodeURIComponent(params.id.toString())}`;
|
|
46
|
+
const meta = {
|
|
47
|
+
name: 'eql.delete',
|
|
48
|
+
pathParts: {
|
|
49
|
+
id: params.id
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
return await this.transport.request({ path, method, querystring, body, meta }, options);
|
|
53
|
+
}
|
|
54
|
+
async get(params, options) {
|
|
55
|
+
const acceptedPath = ['id'];
|
|
56
|
+
const querystring = {};
|
|
57
|
+
const body = undefined;
|
|
58
|
+
for (const key in params) {
|
|
59
|
+
if (acceptedPath.includes(key)) {
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
else if (key !== 'body') {
|
|
63
|
+
// @ts-expect-error
|
|
64
|
+
querystring[key] = params[key];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
const method = 'GET';
|
|
68
|
+
const path = `/_eql/search/${encodeURIComponent(params.id.toString())}`;
|
|
69
|
+
const meta = {
|
|
70
|
+
name: 'eql.get',
|
|
71
|
+
pathParts: {
|
|
72
|
+
id: params.id
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
return await this.transport.request({ path, method, querystring, body, meta }, options);
|
|
76
|
+
}
|
|
77
|
+
async getStatus(params, options) {
|
|
78
|
+
const acceptedPath = ['id'];
|
|
79
|
+
const querystring = {};
|
|
80
|
+
const body = undefined;
|
|
81
|
+
for (const key in params) {
|
|
82
|
+
if (acceptedPath.includes(key)) {
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
else if (key !== 'body') {
|
|
86
|
+
// @ts-expect-error
|
|
87
|
+
querystring[key] = params[key];
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
const method = 'GET';
|
|
91
|
+
const path = `/_eql/search/status/${encodeURIComponent(params.id.toString())}`;
|
|
92
|
+
const meta = {
|
|
93
|
+
name: 'eql.get_status',
|
|
94
|
+
pathParts: {
|
|
95
|
+
id: params.id
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
return await this.transport.request({ path, method, querystring, body, meta }, options);
|
|
99
|
+
}
|
|
100
|
+
async search(params, options) {
|
|
101
|
+
const acceptedPath = ['index'];
|
|
102
|
+
const acceptedBody = ['query', 'case_sensitive', 'event_category_field', 'tiebreaker_field', 'timestamp_field', 'fetch_size', 'filter', 'keep_alive', 'keep_on_completion', 'wait_for_completion_timeout', 'allow_partial_search_results', 'allow_partial_sequence_results', 'size', 'fields', 'result_position', 'runtime_mappings', 'max_samples_per_key'];
|
|
103
|
+
const querystring = {};
|
|
104
|
+
// @ts-expect-error
|
|
105
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
106
|
+
let body;
|
|
107
|
+
if (typeof userBody === 'string') {
|
|
108
|
+
body = userBody;
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
112
|
+
}
|
|
113
|
+
for (const key in params) {
|
|
114
|
+
if (acceptedBody.includes(key)) {
|
|
115
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
116
|
+
// @ts-expect-error
|
|
117
|
+
body[key] = params[key];
|
|
118
|
+
}
|
|
119
|
+
else if (acceptedPath.includes(key)) {
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
else if (key !== 'body') {
|
|
123
|
+
// @ts-expect-error
|
|
124
|
+
querystring[key] = params[key];
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
const method = body != null ? 'POST' : 'GET';
|
|
128
|
+
const path = `/${encodeURIComponent(params.index.toString())}/_eql/search`;
|
|
129
|
+
const meta = {
|
|
130
|
+
name: 'eql.search',
|
|
131
|
+
pathParts: {
|
|
132
|
+
index: params.index
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
return await this.transport.request({ path, method, querystring, body, meta }, options);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
exports.default = Eql;
|
|
139
|
+
//# sourceMappingURL=eql.js.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Transport, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, TransportResult } from '@elastic/transport';
|
|
2
|
+
import * as T from '../types';
|
|
3
|
+
import * as TB from '../typesWithBodyKey';
|
|
4
|
+
interface That {
|
|
5
|
+
transport: Transport;
|
|
6
|
+
}
|
|
7
|
+
export default class Esql {
|
|
8
|
+
transport: Transport;
|
|
9
|
+
constructor(transport: Transport);
|
|
10
|
+
/**
|
|
11
|
+
* 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/8.19/esql-async-query-api.html | Elasticsearch API documentation}
|
|
13
|
+
*/
|
|
14
|
+
asyncQuery(this: That, params: T.EsqlAsyncQueryRequest | TB.EsqlAsyncQueryRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EsqlAsyncQueryResponse>;
|
|
15
|
+
asyncQuery(this: That, params: T.EsqlAsyncQueryRequest | TB.EsqlAsyncQueryRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EsqlAsyncQueryResponse, unknown>>;
|
|
16
|
+
asyncQuery(this: That, params: T.EsqlAsyncQueryRequest | TB.EsqlAsyncQueryRequest, options?: TransportRequestOptions): Promise<T.EsqlAsyncQueryResponse>;
|
|
17
|
+
/**
|
|
18
|
+
* 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/8.19/esql-async-query-delete-api.html | Elasticsearch API documentation}
|
|
20
|
+
*/
|
|
21
|
+
asyncQueryDelete(this: That, params: T.EsqlAsyncQueryDeleteRequest | TB.EsqlAsyncQueryDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EsqlAsyncQueryDeleteResponse>;
|
|
22
|
+
asyncQueryDelete(this: That, params: T.EsqlAsyncQueryDeleteRequest | TB.EsqlAsyncQueryDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EsqlAsyncQueryDeleteResponse, unknown>>;
|
|
23
|
+
asyncQueryDelete(this: That, params: T.EsqlAsyncQueryDeleteRequest | TB.EsqlAsyncQueryDeleteRequest, options?: TransportRequestOptions): Promise<T.EsqlAsyncQueryDeleteResponse>;
|
|
24
|
+
/**
|
|
25
|
+
* 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/8.19/esql-async-query-get-api.html | Elasticsearch API documentation}
|
|
27
|
+
*/
|
|
28
|
+
asyncQueryGet(this: That, params: T.EsqlAsyncQueryGetRequest | TB.EsqlAsyncQueryGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EsqlAsyncQueryGetResponse>;
|
|
29
|
+
asyncQueryGet(this: That, params: T.EsqlAsyncQueryGetRequest | TB.EsqlAsyncQueryGetRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EsqlAsyncQueryGetResponse, unknown>>;
|
|
30
|
+
asyncQueryGet(this: That, params: T.EsqlAsyncQueryGetRequest | TB.EsqlAsyncQueryGetRequest, options?: TransportRequestOptions): Promise<T.EsqlAsyncQueryGetResponse>;
|
|
31
|
+
/**
|
|
32
|
+
* Stop async ES|QL query. This API interrupts the query execution and returns the results so far. If the Elasticsearch security features are enabled, only the user who first submitted the ES|QL query can stop it.
|
|
33
|
+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/esql-async-query-stop-api.html | Elasticsearch API documentation}
|
|
34
|
+
*/
|
|
35
|
+
asyncQueryStop(this: That, params: T.EsqlAsyncQueryStopRequest | TB.EsqlAsyncQueryStopRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EsqlAsyncQueryStopResponse>;
|
|
36
|
+
asyncQueryStop(this: That, params: T.EsqlAsyncQueryStopRequest | TB.EsqlAsyncQueryStopRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EsqlAsyncQueryStopResponse, unknown>>;
|
|
37
|
+
asyncQueryStop(this: That, params: T.EsqlAsyncQueryStopRequest | TB.EsqlAsyncQueryStopRequest, options?: TransportRequestOptions): Promise<T.EsqlAsyncQueryStopResponse>;
|
|
38
|
+
/**
|
|
39
|
+
* Run an ES|QL query. Get search results for an ES|QL (Elasticsearch query language) query.
|
|
40
|
+
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/esql-rest.html | Elasticsearch API documentation}
|
|
41
|
+
*/
|
|
42
|
+
query(this: That, params: T.EsqlQueryRequest | TB.EsqlQueryRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.EsqlQueryResponse>;
|
|
43
|
+
query(this: That, params: T.EsqlQueryRequest | TB.EsqlQueryRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EsqlQueryResponse, unknown>>;
|
|
44
|
+
query(this: That, params: T.EsqlQueryRequest | TB.EsqlQueryRequest, options?: TransportRequestOptions): Promise<T.EsqlQueryResponse>;
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Licensed to Elasticsearch B.V. under one or more contributor
|
|
4
|
+
* license agreements. See the NOTICE file distributed with
|
|
5
|
+
* this work for additional information regarding copyright
|
|
6
|
+
* ownership. Elasticsearch B.V. licenses this file to you under
|
|
7
|
+
* the Apache License, Version 2.0 (the "License"); you may
|
|
8
|
+
* not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing,
|
|
14
|
+
* software distributed under the License is distributed on an
|
|
15
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
+
* KIND, either express or implied. See the License for the
|
|
17
|
+
* specific language governing permissions and limitations
|
|
18
|
+
* under the License.
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
class Esql {
|
|
22
|
+
constructor(transport) {
|
|
23
|
+
Object.defineProperty(this, "transport", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true,
|
|
27
|
+
value: void 0
|
|
28
|
+
});
|
|
29
|
+
this.transport = transport;
|
|
30
|
+
}
|
|
31
|
+
async asyncQuery(params, options) {
|
|
32
|
+
const acceptedPath = [];
|
|
33
|
+
const acceptedBody = ['columnar', 'filter', 'locale', 'params', 'profile', 'query', 'tables', 'include_ccs_metadata', 'wait_for_completion_timeout', 'keep_alive', 'keep_on_completion'];
|
|
34
|
+
const querystring = {};
|
|
35
|
+
// @ts-expect-error
|
|
36
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
37
|
+
let body;
|
|
38
|
+
if (typeof userBody === 'string') {
|
|
39
|
+
body = userBody;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
43
|
+
}
|
|
44
|
+
for (const key in params) {
|
|
45
|
+
if (acceptedBody.includes(key)) {
|
|
46
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
47
|
+
// @ts-expect-error
|
|
48
|
+
body[key] = params[key];
|
|
49
|
+
}
|
|
50
|
+
else if (acceptedPath.includes(key)) {
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
else if (key !== 'body') {
|
|
54
|
+
// @ts-expect-error
|
|
55
|
+
querystring[key] = params[key];
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const method = 'POST';
|
|
59
|
+
const path = '/_query/async';
|
|
60
|
+
const meta = {
|
|
61
|
+
name: 'esql.async_query'
|
|
62
|
+
};
|
|
63
|
+
return await this.transport.request({ path, method, querystring, body, meta }, options);
|
|
64
|
+
}
|
|
65
|
+
async asyncQueryDelete(params, options) {
|
|
66
|
+
const acceptedPath = ['id'];
|
|
67
|
+
const querystring = {};
|
|
68
|
+
const body = undefined;
|
|
69
|
+
for (const key in params) {
|
|
70
|
+
if (acceptedPath.includes(key)) {
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
else if (key !== 'body') {
|
|
74
|
+
// @ts-expect-error
|
|
75
|
+
querystring[key] = params[key];
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const method = 'DELETE';
|
|
79
|
+
const path = `/_query/async/${encodeURIComponent(params.id.toString())}`;
|
|
80
|
+
const meta = {
|
|
81
|
+
name: 'esql.async_query_delete',
|
|
82
|
+
pathParts: {
|
|
83
|
+
id: params.id
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
return await this.transport.request({ path, method, querystring, body, meta }, options);
|
|
87
|
+
}
|
|
88
|
+
async asyncQueryGet(params, options) {
|
|
89
|
+
const acceptedPath = ['id'];
|
|
90
|
+
const querystring = {};
|
|
91
|
+
const body = undefined;
|
|
92
|
+
for (const key in params) {
|
|
93
|
+
if (acceptedPath.includes(key)) {
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
else if (key !== 'body') {
|
|
97
|
+
// @ts-expect-error
|
|
98
|
+
querystring[key] = params[key];
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
const method = 'GET';
|
|
102
|
+
const path = `/_query/async/${encodeURIComponent(params.id.toString())}`;
|
|
103
|
+
const meta = {
|
|
104
|
+
name: 'esql.async_query_get',
|
|
105
|
+
pathParts: {
|
|
106
|
+
id: params.id
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
return await this.transport.request({ path, method, querystring, body, meta }, options);
|
|
110
|
+
}
|
|
111
|
+
async asyncQueryStop(params, options) {
|
|
112
|
+
const acceptedPath = ['id'];
|
|
113
|
+
const querystring = {};
|
|
114
|
+
const body = undefined;
|
|
115
|
+
for (const key in params) {
|
|
116
|
+
if (acceptedPath.includes(key)) {
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
else if (key !== 'body') {
|
|
120
|
+
// @ts-expect-error
|
|
121
|
+
querystring[key] = params[key];
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
const method = 'POST';
|
|
125
|
+
const path = `/_query/async/${encodeURIComponent(params.id.toString())}/stop`;
|
|
126
|
+
const meta = {
|
|
127
|
+
name: 'esql.async_query_stop',
|
|
128
|
+
pathParts: {
|
|
129
|
+
id: params.id
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
return await this.transport.request({ path, method, querystring, body, meta }, options);
|
|
133
|
+
}
|
|
134
|
+
async query(params, options) {
|
|
135
|
+
const acceptedPath = [];
|
|
136
|
+
const acceptedBody = ['columnar', 'filter', 'locale', 'params', 'profile', 'query', 'tables', 'include_ccs_metadata'];
|
|
137
|
+
const querystring = {};
|
|
138
|
+
// @ts-expect-error
|
|
139
|
+
const userBody = params === null || params === void 0 ? void 0 : params.body;
|
|
140
|
+
let body;
|
|
141
|
+
if (typeof userBody === 'string') {
|
|
142
|
+
body = userBody;
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
body = userBody != null ? { ...userBody } : undefined;
|
|
146
|
+
}
|
|
147
|
+
for (const key in params) {
|
|
148
|
+
if (acceptedBody.includes(key)) {
|
|
149
|
+
body = body !== null && body !== void 0 ? body : {};
|
|
150
|
+
// @ts-expect-error
|
|
151
|
+
body[key] = params[key];
|
|
152
|
+
}
|
|
153
|
+
else if (acceptedPath.includes(key)) {
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
else if (key !== 'body') {
|
|
157
|
+
// @ts-expect-error
|
|
158
|
+
querystring[key] = params[key];
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
const method = 'POST';
|
|
162
|
+
const path = '/_query';
|
|
163
|
+
const meta = {
|
|
164
|
+
name: 'esql.query'
|
|
165
|
+
};
|
|
166
|
+
return await this.transport.request({ path, method, querystring, body, meta }, options);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
exports.default = Esql;
|
|
170
|
+
//# sourceMappingURL=esql.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Transport, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, TransportResult } from '@elastic/transport';
|
|
2
|
+
import * as T from '../types';
|
|
3
|
+
import * as TB from '../typesWithBodyKey';
|
|
4
|
+
interface That {
|
|
5
|
+
transport: Transport;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* 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.19/docs-get.html | Elasticsearch API documentation}
|
|
10
|
+
*/
|
|
11
|
+
export default function ExistsApi(this: That, params: T.ExistsRequest | TB.ExistsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ExistsResponse>;
|
|
12
|
+
export default function ExistsApi(this: That, params: T.ExistsRequest | TB.ExistsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ExistsResponse, unknown>>;
|
|
13
|
+
export default function ExistsApi(this: That, params: T.ExistsRequest | TB.ExistsRequest, options?: TransportRequestOptions): Promise<T.ExistsResponse>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Licensed to Elasticsearch B.V. under one or more contributor
|
|
4
|
+
* license agreements. See the NOTICE file distributed with
|
|
5
|
+
* this work for additional information regarding copyright
|
|
6
|
+
* ownership. Elasticsearch B.V. licenses this file to you under
|
|
7
|
+
* the Apache License, Version 2.0 (the "License"); you may
|
|
8
|
+
* not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing,
|
|
14
|
+
* software distributed under the License is distributed on an
|
|
15
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
+
* KIND, either express or implied. See the License for the
|
|
17
|
+
* specific language governing permissions and limitations
|
|
18
|
+
* under the License.
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.default = ExistsApi;
|
|
22
|
+
async function ExistsApi(params, options) {
|
|
23
|
+
const acceptedPath = ['id', 'index'];
|
|
24
|
+
const querystring = {};
|
|
25
|
+
const body = undefined;
|
|
26
|
+
for (const key in params) {
|
|
27
|
+
if (acceptedPath.includes(key)) {
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
else if (key !== 'body') {
|
|
31
|
+
// @ts-expect-error
|
|
32
|
+
querystring[key] = params[key];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const method = 'HEAD';
|
|
36
|
+
const path = `/${encodeURIComponent(params.index.toString())}/_doc/${encodeURIComponent(params.id.toString())}`;
|
|
37
|
+
const meta = {
|
|
38
|
+
name: 'exists',
|
|
39
|
+
pathParts: {
|
|
40
|
+
id: params.id,
|
|
41
|
+
index: params.index
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
return await this.transport.request({ path, method, querystring, body, meta }, options);
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=exists.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Transport, TransportRequestOptions, TransportRequestOptionsWithMeta, TransportRequestOptionsWithOutMeta, TransportResult } from '@elastic/transport';
|
|
2
|
+
import * as T from '../types';
|
|
3
|
+
import * as TB from '../typesWithBodyKey';
|
|
4
|
+
interface That {
|
|
5
|
+
transport: Transport;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* 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.19/docs-get.html | Elasticsearch API documentation}
|
|
10
|
+
*/
|
|
11
|
+
export default function ExistsSourceApi(this: That, params: T.ExistsSourceRequest | TB.ExistsSourceRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ExistsSourceResponse>;
|
|
12
|
+
export default function ExistsSourceApi(this: That, params: T.ExistsSourceRequest | TB.ExistsSourceRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ExistsSourceResponse, unknown>>;
|
|
13
|
+
export default function ExistsSourceApi(this: That, params: T.ExistsSourceRequest | TB.ExistsSourceRequest, options?: TransportRequestOptions): Promise<T.ExistsSourceResponse>;
|
|
14
|
+
export {};
|