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.
Files changed (257) hide show
  1. package/ai/skills/elastic-report/SKILLS.md +32 -0
  2. package/client-v2.d.ts +2 -0
  3. package/client-v2.js +1 -0
  4. package/client.d.ts +2 -0
  5. package/client.js +1 -0
  6. package/dist/client/index.js +10 -0
  7. package/dist/client-v2/851.488fdbf5bc5b6a36.js +10 -0
  8. package/dist/client-v2/index.js +10 -0
  9. package/dist/externalVersion.js +20 -0
  10. package/dist/index.js +48 -0
  11. package/dist/locale/en-US.json +99 -0
  12. package/dist/locale/vi-VN.json +99 -0
  13. package/dist/locale/zh-CN.json +99 -0
  14. package/dist/node_modules/@elastic/elasticsearch/.dockerignore +11 -0
  15. package/dist/node_modules/@elastic/elasticsearch/LICENSE +202 -0
  16. package/dist/node_modules/@elastic/elasticsearch/NOTICE.txt +2 -0
  17. package/dist/node_modules/@elastic/elasticsearch/catalog-info.yaml +50 -0
  18. package/dist/node_modules/@elastic/elasticsearch/codecov.yml +14 -0
  19. package/dist/node_modules/@elastic/elasticsearch/index.d.ts +28 -0
  20. package/dist/node_modules/@elastic/elasticsearch/index.js +85525 -0
  21. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/async_search.d.ts +39 -0
  22. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/async_search.js +155 -0
  23. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/autoscaling.d.ts +39 -0
  24. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/autoscaling.js +130 -0
  25. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/bulk.d.ts +14 -0
  26. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/bulk.js +60 -0
  27. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/capabilities.d.ts +14 -0
  28. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/capabilities.js +43 -0
  29. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/cat.d.ts +193 -0
  30. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/cat.js +766 -0
  31. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ccr.d.ts +102 -0
  32. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ccr.js +395 -0
  33. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/clear_scroll.d.ts +14 -0
  34. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/clear_scroll.js +60 -0
  35. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/close_point_in_time.d.ts +14 -0
  36. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/close_point_in_time.js +56 -0
  37. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/cluster.d.ts +123 -0
  38. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/cluster.js +482 -0
  39. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/connector.d.ts +245 -0
  40. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/connector.js +1121 -0
  41. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/count.d.ts +14 -0
  42. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/count.js +68 -0
  43. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/create.d.ts +14 -0
  44. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/create.js +53 -0
  45. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/dangling_indices.d.ts +32 -0
  46. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/dangling_indices.js +100 -0
  47. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete.d.ts +14 -0
  48. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete.js +46 -0
  49. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete_by_query.d.ts +14 -0
  50. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete_by_query.js +59 -0
  51. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete_by_query_rethrottle.d.ts +14 -0
  52. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete_by_query_rethrottle.js +45 -0
  53. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete_script.d.ts +14 -0
  54. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete_script.js +45 -0
  55. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/enrich.d.ts +46 -0
  56. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/enrich.js +169 -0
  57. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/eql.d.ts +39 -0
  58. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/eql.js +139 -0
  59. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/esql.d.ts +46 -0
  60. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/esql.js +170 -0
  61. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/exists.d.ts +14 -0
  62. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/exists.js +46 -0
  63. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/exists_source.d.ts +14 -0
  64. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/exists_source.js +46 -0
  65. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/explain.d.ts +14 -0
  66. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/explain.js +60 -0
  67. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/features.d.ts +25 -0
  68. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/features.js +75 -0
  69. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/field_caps.d.ts +14 -0
  70. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/field_caps.js +68 -0
  71. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/fleet.d.ts +50 -0
  72. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/fleet.js +211 -0
  73. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get.d.ts +14 -0
  74. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get.js +46 -0
  75. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_script.d.ts +14 -0
  76. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_script.js +45 -0
  77. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_script_context.d.ts +14 -0
  78. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_script_context.js +43 -0
  79. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_script_languages.d.ts +14 -0
  80. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_script_languages.js +43 -0
  81. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_source.d.ts +14 -0
  82. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_source.js +46 -0
  83. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/graph.d.ts +18 -0
  84. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/graph.js +70 -0
  85. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/health_report.d.ts +14 -0
  86. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/health_report.js +54 -0
  87. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ilm.d.ts +88 -0
  88. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ilm.js +329 -0
  89. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/index.d.ts +14 -0
  90. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/index.js +61 -0
  91. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/indices.d.ts +494 -0
  92. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/indices.js +2133 -0
  93. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/inference.d.ts +221 -0
  94. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/inference.js +1167 -0
  95. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/info.d.ts +14 -0
  96. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/info.js +43 -0
  97. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ingest.d.ts +95 -0
  98. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ingest.js +389 -0
  99. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/knn_search.d.ts +14 -0
  100. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/knn_search.js +59 -0
  101. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/license.d.ts +60 -0
  102. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/license.js +194 -0
  103. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/logstash.d.ts +32 -0
  104. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/logstash.js +118 -0
  105. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/mget.d.ts +14 -0
  106. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/mget.js +68 -0
  107. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/migration.d.ts +32 -0
  108. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/migration.js +107 -0
  109. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ml.d.ts +522 -0
  110. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ml.js +2468 -0
  111. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/monitoring.d.ts +18 -0
  112. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/monitoring.js +60 -0
  113. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/msearch.d.ts +14 -0
  114. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/msearch.js +60 -0
  115. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/msearch_template.d.ts +14 -0
  116. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/msearch_template.js +60 -0
  117. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/mtermvectors.d.ts +14 -0
  118. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/mtermvectors.js +68 -0
  119. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/nodes.d.ts +60 -0
  120. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/nodes.js +290 -0
  121. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/open_point_in_time.d.ts +14 -0
  122. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/open_point_in_time.js +59 -0
  123. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ping.d.ts +14 -0
  124. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ping.js +43 -0
  125. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/profiling.d.ts +39 -0
  126. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/profiling.js +135 -0
  127. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/put_script.d.ts +14 -0
  128. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/put_script.js +68 -0
  129. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/query_rules.d.ts +67 -0
  130. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/query_rules.js +260 -0
  131. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/rank_eval.d.ts +14 -0
  132. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/rank_eval.js +67 -0
  133. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/reindex.d.ts +14 -0
  134. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/reindex.js +56 -0
  135. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/reindex_rethrottle.d.ts +14 -0
  136. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/reindex_rethrottle.js +45 -0
  137. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/render_search_template.d.ts +14 -0
  138. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/render_search_template.js +68 -0
  139. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/rollup.d.ts +67 -0
  140. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/rollup.js +263 -0
  141. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/scripts_painless_execute.d.ts +14 -0
  142. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/scripts_painless_execute.js +57 -0
  143. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/scroll.d.ts +14 -0
  144. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/scroll.js +59 -0
  145. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search.d.ts +14 -0
  146. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search.js +75 -0
  147. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_application.d.ts +81 -0
  148. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_application.js +313 -0
  149. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_mvt.d.ts +14 -0
  150. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_mvt.js +63 -0
  151. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_shards.d.ts +14 -0
  152. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_shards.js +54 -0
  153. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_template.d.ts +14 -0
  154. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_template.js +68 -0
  155. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/searchable_snapshots.d.ts +39 -0
  156. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/searchable_snapshots.js +167 -0
  157. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/security.d.ts +459 -0
  158. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/security.js +1982 -0
  159. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/shutdown.d.ts +32 -0
  160. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/shutdown.js +125 -0
  161. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/simulate.d.ts +18 -0
  162. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/simulate.js +78 -0
  163. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/slm.d.ts +74 -0
  164. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/slm.js +253 -0
  165. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/snapshot.d.ts +102 -0
  166. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/snapshot.js +410 -0
  167. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/sql.d.ts +53 -0
  168. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/sql.js +205 -0
  169. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ssl.d.ts +18 -0
  170. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ssl.js +54 -0
  171. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/streams.d.ts +32 -0
  172. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/streams.js +96 -0
  173. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/synonyms.d.ts +60 -0
  174. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/synonyms.js +223 -0
  175. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/tasks.d.ts +32 -0
  176. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/tasks.js +109 -0
  177. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/terms_enum.d.ts +14 -0
  178. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/terms_enum.js +59 -0
  179. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/termvectors.d.ts +14 -0
  180. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/termvectors.js +68 -0
  181. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/text_structure.d.ts +39 -0
  182. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/text_structure.js +148 -0
  183. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/transform.d.ts +101 -0
  184. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/transform.js +386 -0
  185. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/update.d.ts +14 -0
  186. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/update.js +60 -0
  187. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/update_by_query.d.ts +14 -0
  188. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/update_by_query.js +59 -0
  189. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/update_by_query_rethrottle.d.ts +14 -0
  190. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/update_by_query_rethrottle.js +45 -0
  191. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/watcher.d.ts +102 -0
  192. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/watcher.js +405 -0
  193. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/xpack.d.ts +25 -0
  194. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/xpack.js +75 -0
  195. package/dist/node_modules/@elastic/elasticsearch/lib/api/index.d.ts +265 -0
  196. package/dist/node_modules/@elastic/elasticsearch/lib/api/index.js +632 -0
  197. package/dist/node_modules/@elastic/elasticsearch/lib/api/types.d.ts +19933 -0
  198. package/dist/node_modules/@elastic/elasticsearch/lib/api/types.js +21 -0
  199. package/dist/node_modules/@elastic/elasticsearch/lib/api/typesWithBodyKey.d.ts +20606 -0
  200. package/dist/node_modules/@elastic/elasticsearch/lib/api/typesWithBodyKey.js +21 -0
  201. package/dist/node_modules/@elastic/elasticsearch/lib/client.d.ts +152 -0
  202. package/dist/node_modules/@elastic/elasticsearch/lib/client.js +369 -0
  203. package/dist/node_modules/@elastic/elasticsearch/lib/helpers.d.ts +184 -0
  204. package/dist/node_modules/@elastic/elasticsearch/lib/helpers.js +889 -0
  205. package/dist/node_modules/@elastic/elasticsearch/lib/sniffingTransport.d.ts +4 -0
  206. package/dist/node_modules/@elastic/elasticsearch/lib/sniffingTransport.js +56 -0
  207. package/dist/node_modules/@elastic/elasticsearch/node_modules/.bin/arrow2csv +15 -0
  208. package/dist/node_modules/@elastic/elasticsearch/node_modules/.bin/arrow2csv.cmd +7 -0
  209. package/dist/node_modules/@elastic/elasticsearch/package.json +1 -0
  210. package/dist/node_modules/@elastic/elasticsearch/tsconfig.json +38 -0
  211. package/dist/server/acl-guard.js +107 -0
  212. package/dist/server/collections/es-report-data-views.js +79 -0
  213. package/dist/server/collections/es-reports.js +95 -0
  214. package/dist/server/index.js +58 -0
  215. package/dist/server/mcp/ElasticReportMcpServer.js +344 -0
  216. package/dist/server/mcp/ElasticReportToolCatalog.js +417 -0
  217. package/dist/server/plugin.js +395 -0
  218. package/dist/server/services/ElasticReportService.js +263 -0
  219. package/dist/server/services/ElasticsearchConnectionService.js +332 -0
  220. package/dist/server/services/ReportQueryCompiler.js +858 -0
  221. package/dist/shared/constants.js +81 -0
  222. package/dist/shared/types.js +24 -0
  223. package/package.json +61 -4
  224. package/server.d.ts +2 -0
  225. package/server.js +1 -0
  226. package/src/client/index.tsx +19 -0
  227. package/src/client-v2/__tests__/elastic-report.test.tsx +311 -0
  228. package/src/client-v2/api.ts +224 -0
  229. package/src/client-v2/components/ElasticBasicCharts.tsx +399 -0
  230. package/src/client-v2/components/ElasticReportBlock.tsx +160 -0
  231. package/src/client-v2/components/ElasticReportRenderer.tsx +707 -0
  232. package/src/client-v2/components/HighlightText.tsx +50 -0
  233. package/src/client-v2/components/ReportSelect.tsx +72 -0
  234. package/src/client-v2/index.tsx +14 -0
  235. package/src/client-v2/locale.ts +23 -0
  236. package/src/client-v2/models/ElasticReportBlockModel.tsx +85 -0
  237. package/src/client-v2/pages/ElasticReportManager.tsx +1047 -0
  238. package/src/client-v2/plugin.tsx +52 -0
  239. package/src/index.ts +11 -0
  240. package/src/locale/en-US.json +99 -0
  241. package/src/locale/vi-VN.json +99 -0
  242. package/src/locale/zh-CN.json +99 -0
  243. package/src/server/__tests__/query-compiler.test.ts +231 -0
  244. package/src/server/__tests__/report-mcp-acl.integration.test.ts +377 -0
  245. package/src/server/acl-guard.ts +103 -0
  246. package/src/server/collections/es-report-data-views.ts +58 -0
  247. package/src/server/collections/es-reports.ts +74 -0
  248. package/src/server/index.ts +15 -0
  249. package/src/server/mcp/ElasticReportMcpServer.ts +391 -0
  250. package/src/server/mcp/ElasticReportToolCatalog.ts +417 -0
  251. package/src/server/plugin.ts +431 -0
  252. package/src/server/services/ElasticReportService.ts +326 -0
  253. package/src/server/services/ElasticsearchConnectionService.ts +401 -0
  254. package/src/server/services/ReportQueryCompiler.ts +1017 -0
  255. package/src/shared/constants.ts +29 -0
  256. package/src/shared/types.ts +175 -0
  257. package/README.md +0 -3
@@ -0,0 +1,2133 @@
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 Indices {
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 addBlock(params, options) {
32
+ const acceptedPath = ['index', 'block'];
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 = 'PUT';
45
+ const path = `/${encodeURIComponent(params.index.toString())}/_block/${encodeURIComponent(params.block.toString())}`;
46
+ const meta = {
47
+ name: 'indices.add_block',
48
+ pathParts: {
49
+ index: params.index,
50
+ block: params.block
51
+ }
52
+ };
53
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
54
+ }
55
+ async analyze(params, options) {
56
+ const acceptedPath = ['index'];
57
+ const acceptedBody = ['analyzer', 'attributes', 'char_filter', 'explain', 'field', 'filter', 'normalizer', 'text', 'tokenizer'];
58
+ const querystring = {};
59
+ // @ts-expect-error
60
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
61
+ let body;
62
+ if (typeof userBody === 'string') {
63
+ body = userBody;
64
+ }
65
+ else {
66
+ body = userBody != null ? { ...userBody } : undefined;
67
+ }
68
+ params = params !== null && params !== void 0 ? params : {};
69
+ for (const key in params) {
70
+ if (acceptedBody.includes(key)) {
71
+ body = body !== null && body !== void 0 ? body : {};
72
+ // @ts-expect-error
73
+ body[key] = params[key];
74
+ }
75
+ else if (acceptedPath.includes(key)) {
76
+ continue;
77
+ }
78
+ else if (key !== 'body') {
79
+ // @ts-expect-error
80
+ querystring[key] = params[key];
81
+ }
82
+ }
83
+ let method = '';
84
+ let path = '';
85
+ if (params.index != null) {
86
+ method = body != null ? 'POST' : 'GET';
87
+ path = `/${encodeURIComponent(params.index.toString())}/_analyze`;
88
+ }
89
+ else {
90
+ method = body != null ? 'POST' : 'GET';
91
+ path = '/_analyze';
92
+ }
93
+ const meta = {
94
+ name: 'indices.analyze',
95
+ pathParts: {
96
+ index: params.index
97
+ }
98
+ };
99
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
100
+ }
101
+ async cancelMigrateReindex(params, options) {
102
+ const acceptedPath = ['index'];
103
+ const querystring = {};
104
+ const body = undefined;
105
+ for (const key in params) {
106
+ if (acceptedPath.includes(key)) {
107
+ continue;
108
+ }
109
+ else if (key !== 'body') {
110
+ // @ts-expect-error
111
+ querystring[key] = params[key];
112
+ }
113
+ }
114
+ const method = 'POST';
115
+ const path = `/_migration/reindex/${encodeURIComponent(params.index.toString())}/_cancel`;
116
+ const meta = {
117
+ name: 'indices.cancel_migrate_reindex',
118
+ pathParts: {
119
+ index: params.index
120
+ }
121
+ };
122
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
123
+ }
124
+ async clearCache(params, options) {
125
+ const acceptedPath = ['index'];
126
+ const querystring = {};
127
+ const body = undefined;
128
+ params = params !== null && params !== void 0 ? params : {};
129
+ for (const key in params) {
130
+ if (acceptedPath.includes(key)) {
131
+ continue;
132
+ }
133
+ else if (key !== 'body') {
134
+ // @ts-expect-error
135
+ querystring[key] = params[key];
136
+ }
137
+ }
138
+ let method = '';
139
+ let path = '';
140
+ if (params.index != null) {
141
+ method = 'POST';
142
+ path = `/${encodeURIComponent(params.index.toString())}/_cache/clear`;
143
+ }
144
+ else {
145
+ method = 'POST';
146
+ path = '/_cache/clear';
147
+ }
148
+ const meta = {
149
+ name: 'indices.clear_cache',
150
+ pathParts: {
151
+ index: params.index
152
+ }
153
+ };
154
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
155
+ }
156
+ async clone(params, options) {
157
+ const acceptedPath = ['index', 'target'];
158
+ const acceptedBody = ['aliases', 'settings'];
159
+ const querystring = {};
160
+ // @ts-expect-error
161
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
162
+ let body;
163
+ if (typeof userBody === 'string') {
164
+ body = userBody;
165
+ }
166
+ else {
167
+ body = userBody != null ? { ...userBody } : undefined;
168
+ }
169
+ for (const key in params) {
170
+ if (acceptedBody.includes(key)) {
171
+ body = body !== null && body !== void 0 ? body : {};
172
+ // @ts-expect-error
173
+ body[key] = params[key];
174
+ }
175
+ else if (acceptedPath.includes(key)) {
176
+ continue;
177
+ }
178
+ else if (key !== 'body') {
179
+ // @ts-expect-error
180
+ querystring[key] = params[key];
181
+ }
182
+ }
183
+ const method = 'PUT';
184
+ const path = `/${encodeURIComponent(params.index.toString())}/_clone/${encodeURIComponent(params.target.toString())}`;
185
+ const meta = {
186
+ name: 'indices.clone',
187
+ pathParts: {
188
+ index: params.index,
189
+ target: params.target
190
+ }
191
+ };
192
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
193
+ }
194
+ async close(params, options) {
195
+ const acceptedPath = ['index'];
196
+ const querystring = {};
197
+ const body = undefined;
198
+ for (const key in params) {
199
+ if (acceptedPath.includes(key)) {
200
+ continue;
201
+ }
202
+ else if (key !== 'body') {
203
+ // @ts-expect-error
204
+ querystring[key] = params[key];
205
+ }
206
+ }
207
+ const method = 'POST';
208
+ const path = `/${encodeURIComponent(params.index.toString())}/_close`;
209
+ const meta = {
210
+ name: 'indices.close',
211
+ pathParts: {
212
+ index: params.index
213
+ }
214
+ };
215
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
216
+ }
217
+ async create(params, options) {
218
+ const acceptedPath = ['index'];
219
+ const acceptedBody = ['aliases', 'mappings', 'settings'];
220
+ const querystring = {};
221
+ // @ts-expect-error
222
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
223
+ let body;
224
+ if (typeof userBody === 'string') {
225
+ body = userBody;
226
+ }
227
+ else {
228
+ body = userBody != null ? { ...userBody } : undefined;
229
+ }
230
+ for (const key in params) {
231
+ if (acceptedBody.includes(key)) {
232
+ body = body !== null && body !== void 0 ? body : {};
233
+ // @ts-expect-error
234
+ body[key] = params[key];
235
+ }
236
+ else if (acceptedPath.includes(key)) {
237
+ continue;
238
+ }
239
+ else if (key !== 'body') {
240
+ // @ts-expect-error
241
+ querystring[key] = params[key];
242
+ }
243
+ }
244
+ const method = 'PUT';
245
+ const path = `/${encodeURIComponent(params.index.toString())}`;
246
+ const meta = {
247
+ name: 'indices.create',
248
+ pathParts: {
249
+ index: params.index
250
+ }
251
+ };
252
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
253
+ }
254
+ async createDataStream(params, options) {
255
+ const acceptedPath = ['name'];
256
+ const querystring = {};
257
+ const body = undefined;
258
+ for (const key in params) {
259
+ if (acceptedPath.includes(key)) {
260
+ continue;
261
+ }
262
+ else if (key !== 'body') {
263
+ // @ts-expect-error
264
+ querystring[key] = params[key];
265
+ }
266
+ }
267
+ const method = 'PUT';
268
+ const path = `/_data_stream/${encodeURIComponent(params.name.toString())}`;
269
+ const meta = {
270
+ name: 'indices.create_data_stream',
271
+ pathParts: {
272
+ name: params.name
273
+ }
274
+ };
275
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
276
+ }
277
+ async createFrom(params, options) {
278
+ var _a;
279
+ const acceptedPath = ['source', 'dest'];
280
+ const acceptedBody = ['create_from'];
281
+ const querystring = {};
282
+ // @ts-expect-error
283
+ let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
284
+ for (const key in params) {
285
+ if (acceptedBody.includes(key)) {
286
+ // @ts-expect-error
287
+ body = params[key];
288
+ }
289
+ else if (acceptedPath.includes(key)) {
290
+ continue;
291
+ }
292
+ else if (key !== 'body') {
293
+ // @ts-expect-error
294
+ querystring[key] = params[key];
295
+ }
296
+ }
297
+ const method = 'PUT';
298
+ const path = `/_create_from/${encodeURIComponent(params.source.toString())}/${encodeURIComponent(params.dest.toString())}`;
299
+ const meta = {
300
+ name: 'indices.create_from',
301
+ pathParts: {
302
+ source: params.source,
303
+ dest: params.dest
304
+ }
305
+ };
306
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
307
+ }
308
+ async dataStreamsStats(params, options) {
309
+ const acceptedPath = ['name'];
310
+ const querystring = {};
311
+ const body = undefined;
312
+ params = params !== null && params !== void 0 ? params : {};
313
+ for (const key in params) {
314
+ if (acceptedPath.includes(key)) {
315
+ continue;
316
+ }
317
+ else if (key !== 'body') {
318
+ // @ts-expect-error
319
+ querystring[key] = params[key];
320
+ }
321
+ }
322
+ let method = '';
323
+ let path = '';
324
+ if (params.name != null) {
325
+ method = 'GET';
326
+ path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_stats`;
327
+ }
328
+ else {
329
+ method = 'GET';
330
+ path = '/_data_stream/_stats';
331
+ }
332
+ const meta = {
333
+ name: 'indices.data_streams_stats',
334
+ pathParts: {
335
+ name: params.name
336
+ }
337
+ };
338
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
339
+ }
340
+ async delete(params, options) {
341
+ const acceptedPath = ['index'];
342
+ const querystring = {};
343
+ const body = undefined;
344
+ for (const key in params) {
345
+ if (acceptedPath.includes(key)) {
346
+ continue;
347
+ }
348
+ else if (key !== 'body') {
349
+ // @ts-expect-error
350
+ querystring[key] = params[key];
351
+ }
352
+ }
353
+ const method = 'DELETE';
354
+ const path = `/${encodeURIComponent(params.index.toString())}`;
355
+ const meta = {
356
+ name: 'indices.delete',
357
+ pathParts: {
358
+ index: params.index
359
+ }
360
+ };
361
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
362
+ }
363
+ async deleteAlias(params, options) {
364
+ const acceptedPath = ['index', 'name'];
365
+ const querystring = {};
366
+ const body = undefined;
367
+ for (const key in params) {
368
+ if (acceptedPath.includes(key)) {
369
+ continue;
370
+ }
371
+ else if (key !== 'body') {
372
+ // @ts-expect-error
373
+ querystring[key] = params[key];
374
+ }
375
+ }
376
+ let method = '';
377
+ let path = '';
378
+ if (params.index != null && params.name != null) {
379
+ method = 'DELETE';
380
+ path = `/${encodeURIComponent(params.index.toString())}/_alias/${encodeURIComponent(params.name.toString())}`;
381
+ }
382
+ else {
383
+ method = 'DELETE';
384
+ path = `/${encodeURIComponent(params.index.toString())}/_aliases/${encodeURIComponent(params.name.toString())}`;
385
+ }
386
+ const meta = {
387
+ name: 'indices.delete_alias',
388
+ pathParts: {
389
+ index: params.index,
390
+ name: params.name
391
+ }
392
+ };
393
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
394
+ }
395
+ async deleteDataLifecycle(params, options) {
396
+ const acceptedPath = ['name'];
397
+ const querystring = {};
398
+ const body = undefined;
399
+ for (const key in params) {
400
+ if (acceptedPath.includes(key)) {
401
+ continue;
402
+ }
403
+ else if (key !== 'body') {
404
+ // @ts-expect-error
405
+ querystring[key] = params[key];
406
+ }
407
+ }
408
+ const method = 'DELETE';
409
+ const path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_lifecycle`;
410
+ const meta = {
411
+ name: 'indices.delete_data_lifecycle',
412
+ pathParts: {
413
+ name: params.name
414
+ }
415
+ };
416
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
417
+ }
418
+ async deleteDataStream(params, options) {
419
+ const acceptedPath = ['name'];
420
+ const querystring = {};
421
+ const body = undefined;
422
+ for (const key in params) {
423
+ if (acceptedPath.includes(key)) {
424
+ continue;
425
+ }
426
+ else if (key !== 'body') {
427
+ // @ts-expect-error
428
+ querystring[key] = params[key];
429
+ }
430
+ }
431
+ const method = 'DELETE';
432
+ const path = `/_data_stream/${encodeURIComponent(params.name.toString())}`;
433
+ const meta = {
434
+ name: 'indices.delete_data_stream',
435
+ pathParts: {
436
+ name: params.name
437
+ }
438
+ };
439
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
440
+ }
441
+ async deleteDataStreamOptions(params, options) {
442
+ const acceptedPath = ['name'];
443
+ const querystring = {};
444
+ const body = undefined;
445
+ for (const key in params) {
446
+ if (acceptedPath.includes(key)) {
447
+ continue;
448
+ }
449
+ else if (key !== 'body') {
450
+ // @ts-expect-error
451
+ querystring[key] = params[key];
452
+ }
453
+ }
454
+ const method = 'DELETE';
455
+ const path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_options`;
456
+ const meta = {
457
+ name: 'indices.delete_data_stream_options',
458
+ pathParts: {
459
+ name: params.name
460
+ }
461
+ };
462
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
463
+ }
464
+ async deleteIndexTemplate(params, options) {
465
+ const acceptedPath = ['name'];
466
+ const querystring = {};
467
+ const body = undefined;
468
+ for (const key in params) {
469
+ if (acceptedPath.includes(key)) {
470
+ continue;
471
+ }
472
+ else if (key !== 'body') {
473
+ // @ts-expect-error
474
+ querystring[key] = params[key];
475
+ }
476
+ }
477
+ const method = 'DELETE';
478
+ const path = `/_index_template/${encodeURIComponent(params.name.toString())}`;
479
+ const meta = {
480
+ name: 'indices.delete_index_template',
481
+ pathParts: {
482
+ name: params.name
483
+ }
484
+ };
485
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
486
+ }
487
+ async deleteTemplate(params, options) {
488
+ const acceptedPath = ['name'];
489
+ const querystring = {};
490
+ const body = undefined;
491
+ for (const key in params) {
492
+ if (acceptedPath.includes(key)) {
493
+ continue;
494
+ }
495
+ else if (key !== 'body') {
496
+ // @ts-expect-error
497
+ querystring[key] = params[key];
498
+ }
499
+ }
500
+ const method = 'DELETE';
501
+ const path = `/_template/${encodeURIComponent(params.name.toString())}`;
502
+ const meta = {
503
+ name: 'indices.delete_template',
504
+ pathParts: {
505
+ name: params.name
506
+ }
507
+ };
508
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
509
+ }
510
+ async diskUsage(params, options) {
511
+ const acceptedPath = ['index'];
512
+ const querystring = {};
513
+ const body = undefined;
514
+ for (const key in params) {
515
+ if (acceptedPath.includes(key)) {
516
+ continue;
517
+ }
518
+ else if (key !== 'body') {
519
+ // @ts-expect-error
520
+ querystring[key] = params[key];
521
+ }
522
+ }
523
+ const method = 'POST';
524
+ const path = `/${encodeURIComponent(params.index.toString())}/_disk_usage`;
525
+ const meta = {
526
+ name: 'indices.disk_usage',
527
+ pathParts: {
528
+ index: params.index
529
+ }
530
+ };
531
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
532
+ }
533
+ async downsample(params, options) {
534
+ var _a;
535
+ const acceptedPath = ['index', 'target_index'];
536
+ const acceptedBody = ['config'];
537
+ const querystring = {};
538
+ // @ts-expect-error
539
+ let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
540
+ for (const key in params) {
541
+ if (acceptedBody.includes(key)) {
542
+ // @ts-expect-error
543
+ body = params[key];
544
+ }
545
+ else if (acceptedPath.includes(key)) {
546
+ continue;
547
+ }
548
+ else if (key !== 'body') {
549
+ // @ts-expect-error
550
+ querystring[key] = params[key];
551
+ }
552
+ }
553
+ const method = 'POST';
554
+ const path = `/${encodeURIComponent(params.index.toString())}/_downsample/${encodeURIComponent(params.target_index.toString())}`;
555
+ const meta = {
556
+ name: 'indices.downsample',
557
+ pathParts: {
558
+ index: params.index,
559
+ target_index: params.target_index
560
+ }
561
+ };
562
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
563
+ }
564
+ async exists(params, options) {
565
+ const acceptedPath = ['index'];
566
+ const querystring = {};
567
+ const body = undefined;
568
+ for (const key in params) {
569
+ if (acceptedPath.includes(key)) {
570
+ continue;
571
+ }
572
+ else if (key !== 'body') {
573
+ // @ts-expect-error
574
+ querystring[key] = params[key];
575
+ }
576
+ }
577
+ const method = 'HEAD';
578
+ const path = `/${encodeURIComponent(params.index.toString())}`;
579
+ const meta = {
580
+ name: 'indices.exists',
581
+ pathParts: {
582
+ index: params.index
583
+ }
584
+ };
585
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
586
+ }
587
+ async existsAlias(params, options) {
588
+ const acceptedPath = ['name', 'index'];
589
+ const querystring = {};
590
+ const body = undefined;
591
+ for (const key in params) {
592
+ if (acceptedPath.includes(key)) {
593
+ continue;
594
+ }
595
+ else if (key !== 'body') {
596
+ // @ts-expect-error
597
+ querystring[key] = params[key];
598
+ }
599
+ }
600
+ let method = '';
601
+ let path = '';
602
+ if (params.index != null && params.name != null) {
603
+ method = 'HEAD';
604
+ path = `/${encodeURIComponent(params.index.toString())}/_alias/${encodeURIComponent(params.name.toString())}`;
605
+ }
606
+ else {
607
+ method = 'HEAD';
608
+ path = `/_alias/${encodeURIComponent(params.name.toString())}`;
609
+ }
610
+ const meta = {
611
+ name: 'indices.exists_alias',
612
+ pathParts: {
613
+ name: params.name,
614
+ index: params.index
615
+ }
616
+ };
617
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
618
+ }
619
+ async existsIndexTemplate(params, options) {
620
+ const acceptedPath = ['name'];
621
+ const querystring = {};
622
+ const body = undefined;
623
+ for (const key in params) {
624
+ if (acceptedPath.includes(key)) {
625
+ continue;
626
+ }
627
+ else if (key !== 'body') {
628
+ // @ts-expect-error
629
+ querystring[key] = params[key];
630
+ }
631
+ }
632
+ const method = 'HEAD';
633
+ const path = `/_index_template/${encodeURIComponent(params.name.toString())}`;
634
+ const meta = {
635
+ name: 'indices.exists_index_template',
636
+ pathParts: {
637
+ name: params.name
638
+ }
639
+ };
640
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
641
+ }
642
+ async existsTemplate(params, options) {
643
+ const acceptedPath = ['name'];
644
+ const querystring = {};
645
+ const body = undefined;
646
+ for (const key in params) {
647
+ if (acceptedPath.includes(key)) {
648
+ continue;
649
+ }
650
+ else if (key !== 'body') {
651
+ // @ts-expect-error
652
+ querystring[key] = params[key];
653
+ }
654
+ }
655
+ const method = 'HEAD';
656
+ const path = `/_template/${encodeURIComponent(params.name.toString())}`;
657
+ const meta = {
658
+ name: 'indices.exists_template',
659
+ pathParts: {
660
+ name: params.name
661
+ }
662
+ };
663
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
664
+ }
665
+ async explainDataLifecycle(params, options) {
666
+ const acceptedPath = ['index'];
667
+ const querystring = {};
668
+ const body = undefined;
669
+ for (const key in params) {
670
+ if (acceptedPath.includes(key)) {
671
+ continue;
672
+ }
673
+ else if (key !== 'body') {
674
+ // @ts-expect-error
675
+ querystring[key] = params[key];
676
+ }
677
+ }
678
+ const method = 'GET';
679
+ const path = `/${encodeURIComponent(params.index.toString())}/_lifecycle/explain`;
680
+ const meta = {
681
+ name: 'indices.explain_data_lifecycle',
682
+ pathParts: {
683
+ index: params.index
684
+ }
685
+ };
686
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
687
+ }
688
+ async fieldUsageStats(params, options) {
689
+ const acceptedPath = ['index'];
690
+ const querystring = {};
691
+ const body = undefined;
692
+ for (const key in params) {
693
+ if (acceptedPath.includes(key)) {
694
+ continue;
695
+ }
696
+ else if (key !== 'body') {
697
+ // @ts-expect-error
698
+ querystring[key] = params[key];
699
+ }
700
+ }
701
+ const method = 'GET';
702
+ const path = `/${encodeURIComponent(params.index.toString())}/_field_usage_stats`;
703
+ const meta = {
704
+ name: 'indices.field_usage_stats',
705
+ pathParts: {
706
+ index: params.index
707
+ }
708
+ };
709
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
710
+ }
711
+ async flush(params, options) {
712
+ const acceptedPath = ['index'];
713
+ const querystring = {};
714
+ const body = undefined;
715
+ params = params !== null && params !== void 0 ? params : {};
716
+ for (const key in params) {
717
+ if (acceptedPath.includes(key)) {
718
+ continue;
719
+ }
720
+ else if (key !== 'body') {
721
+ // @ts-expect-error
722
+ querystring[key] = params[key];
723
+ }
724
+ }
725
+ let method = '';
726
+ let path = '';
727
+ if (params.index != null) {
728
+ method = body != null ? 'POST' : 'GET';
729
+ path = `/${encodeURIComponent(params.index.toString())}/_flush`;
730
+ }
731
+ else {
732
+ method = body != null ? 'POST' : 'GET';
733
+ path = '/_flush';
734
+ }
735
+ const meta = {
736
+ name: 'indices.flush',
737
+ pathParts: {
738
+ index: params.index
739
+ }
740
+ };
741
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
742
+ }
743
+ async forcemerge(params, options) {
744
+ const acceptedPath = ['index'];
745
+ const querystring = {};
746
+ const body = undefined;
747
+ params = params !== null && params !== void 0 ? params : {};
748
+ for (const key in params) {
749
+ if (acceptedPath.includes(key)) {
750
+ continue;
751
+ }
752
+ else if (key !== 'body') {
753
+ // @ts-expect-error
754
+ querystring[key] = params[key];
755
+ }
756
+ }
757
+ let method = '';
758
+ let path = '';
759
+ if (params.index != null) {
760
+ method = 'POST';
761
+ path = `/${encodeURIComponent(params.index.toString())}/_forcemerge`;
762
+ }
763
+ else {
764
+ method = 'POST';
765
+ path = '/_forcemerge';
766
+ }
767
+ const meta = {
768
+ name: 'indices.forcemerge',
769
+ pathParts: {
770
+ index: params.index
771
+ }
772
+ };
773
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
774
+ }
775
+ async get(params, options) {
776
+ const acceptedPath = ['index'];
777
+ const querystring = {};
778
+ const body = undefined;
779
+ for (const key in params) {
780
+ if (acceptedPath.includes(key)) {
781
+ continue;
782
+ }
783
+ else if (key !== 'body') {
784
+ // @ts-expect-error
785
+ querystring[key] = params[key];
786
+ }
787
+ }
788
+ const method = 'GET';
789
+ const path = `/${encodeURIComponent(params.index.toString())}`;
790
+ const meta = {
791
+ name: 'indices.get',
792
+ pathParts: {
793
+ index: params.index
794
+ }
795
+ };
796
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
797
+ }
798
+ async getAlias(params, options) {
799
+ const acceptedPath = ['name', 'index'];
800
+ const querystring = {};
801
+ const body = undefined;
802
+ params = params !== null && params !== void 0 ? params : {};
803
+ for (const key in params) {
804
+ if (acceptedPath.includes(key)) {
805
+ continue;
806
+ }
807
+ else if (key !== 'body') {
808
+ // @ts-expect-error
809
+ querystring[key] = params[key];
810
+ }
811
+ }
812
+ let method = '';
813
+ let path = '';
814
+ if (params.index != null && params.name != null) {
815
+ method = 'GET';
816
+ path = `/${encodeURIComponent(params.index.toString())}/_alias/${encodeURIComponent(params.name.toString())}`;
817
+ }
818
+ else if (params.name != null) {
819
+ method = 'GET';
820
+ path = `/_alias/${encodeURIComponent(params.name.toString())}`;
821
+ }
822
+ else if (params.index != null) {
823
+ method = 'GET';
824
+ path = `/${encodeURIComponent(params.index.toString())}/_alias`;
825
+ }
826
+ else {
827
+ method = 'GET';
828
+ path = '/_alias';
829
+ }
830
+ const meta = {
831
+ name: 'indices.get_alias',
832
+ pathParts: {
833
+ name: params.name,
834
+ index: params.index
835
+ }
836
+ };
837
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
838
+ }
839
+ async getDataLifecycle(params, options) {
840
+ const acceptedPath = ['name'];
841
+ const querystring = {};
842
+ const body = undefined;
843
+ for (const key in params) {
844
+ if (acceptedPath.includes(key)) {
845
+ continue;
846
+ }
847
+ else if (key !== 'body') {
848
+ // @ts-expect-error
849
+ querystring[key] = params[key];
850
+ }
851
+ }
852
+ const method = 'GET';
853
+ const path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_lifecycle`;
854
+ const meta = {
855
+ name: 'indices.get_data_lifecycle',
856
+ pathParts: {
857
+ name: params.name
858
+ }
859
+ };
860
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
861
+ }
862
+ async getDataLifecycleStats(params, options) {
863
+ const acceptedPath = [];
864
+ const querystring = {};
865
+ const body = undefined;
866
+ params = params !== null && params !== void 0 ? params : {};
867
+ for (const key in params) {
868
+ if (acceptedPath.includes(key)) {
869
+ continue;
870
+ }
871
+ else if (key !== 'body') {
872
+ // @ts-expect-error
873
+ querystring[key] = params[key];
874
+ }
875
+ }
876
+ const method = 'GET';
877
+ const path = '/_lifecycle/stats';
878
+ const meta = {
879
+ name: 'indices.get_data_lifecycle_stats'
880
+ };
881
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
882
+ }
883
+ async getDataStream(params, options) {
884
+ const acceptedPath = ['name'];
885
+ const querystring = {};
886
+ const body = undefined;
887
+ params = params !== null && params !== void 0 ? params : {};
888
+ for (const key in params) {
889
+ if (acceptedPath.includes(key)) {
890
+ continue;
891
+ }
892
+ else if (key !== 'body') {
893
+ // @ts-expect-error
894
+ querystring[key] = params[key];
895
+ }
896
+ }
897
+ let method = '';
898
+ let path = '';
899
+ if (params.name != null) {
900
+ method = 'GET';
901
+ path = `/_data_stream/${encodeURIComponent(params.name.toString())}`;
902
+ }
903
+ else {
904
+ method = 'GET';
905
+ path = '/_data_stream';
906
+ }
907
+ const meta = {
908
+ name: 'indices.get_data_stream',
909
+ pathParts: {
910
+ name: params.name
911
+ }
912
+ };
913
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
914
+ }
915
+ async getDataStreamOptions(params, options) {
916
+ const acceptedPath = ['name'];
917
+ const querystring = {};
918
+ const body = undefined;
919
+ for (const key in params) {
920
+ if (acceptedPath.includes(key)) {
921
+ continue;
922
+ }
923
+ else if (key !== 'body') {
924
+ // @ts-expect-error
925
+ querystring[key] = params[key];
926
+ }
927
+ }
928
+ const method = 'GET';
929
+ const path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_options`;
930
+ const meta = {
931
+ name: 'indices.get_data_stream_options',
932
+ pathParts: {
933
+ name: params.name
934
+ }
935
+ };
936
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
937
+ }
938
+ async getDataStreamSettings(params, options) {
939
+ const acceptedPath = ['name'];
940
+ const querystring = {};
941
+ const body = undefined;
942
+ for (const key in params) {
943
+ if (acceptedPath.includes(key)) {
944
+ continue;
945
+ }
946
+ else if (key !== 'body') {
947
+ // @ts-expect-error
948
+ querystring[key] = params[key];
949
+ }
950
+ }
951
+ const method = 'GET';
952
+ const path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_settings`;
953
+ const meta = {
954
+ name: 'indices.get_data_stream_settings',
955
+ pathParts: {
956
+ name: params.name
957
+ }
958
+ };
959
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
960
+ }
961
+ async getFieldMapping(params, options) {
962
+ const acceptedPath = ['fields', 'index'];
963
+ const querystring = {};
964
+ const body = undefined;
965
+ for (const key in params) {
966
+ if (acceptedPath.includes(key)) {
967
+ continue;
968
+ }
969
+ else if (key !== 'body') {
970
+ // @ts-expect-error
971
+ querystring[key] = params[key];
972
+ }
973
+ }
974
+ let method = '';
975
+ let path = '';
976
+ if (params.index != null && params.fields != null) {
977
+ method = 'GET';
978
+ path = `/${encodeURIComponent(params.index.toString())}/_mapping/field/${encodeURIComponent(params.fields.toString())}`;
979
+ }
980
+ else {
981
+ method = 'GET';
982
+ path = `/_mapping/field/${encodeURIComponent(params.fields.toString())}`;
983
+ }
984
+ const meta = {
985
+ name: 'indices.get_field_mapping',
986
+ pathParts: {
987
+ fields: params.fields,
988
+ index: params.index
989
+ }
990
+ };
991
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
992
+ }
993
+ async getIndexTemplate(params, options) {
994
+ const acceptedPath = ['name'];
995
+ const querystring = {};
996
+ const body = undefined;
997
+ params = params !== null && params !== void 0 ? params : {};
998
+ for (const key in params) {
999
+ if (acceptedPath.includes(key)) {
1000
+ continue;
1001
+ }
1002
+ else if (key !== 'body') {
1003
+ // @ts-expect-error
1004
+ querystring[key] = params[key];
1005
+ }
1006
+ }
1007
+ let method = '';
1008
+ let path = '';
1009
+ if (params.name != null) {
1010
+ method = 'GET';
1011
+ path = `/_index_template/${encodeURIComponent(params.name.toString())}`;
1012
+ }
1013
+ else {
1014
+ method = 'GET';
1015
+ path = '/_index_template';
1016
+ }
1017
+ const meta = {
1018
+ name: 'indices.get_index_template',
1019
+ pathParts: {
1020
+ name: params.name
1021
+ }
1022
+ };
1023
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1024
+ }
1025
+ async getMapping(params, options) {
1026
+ const acceptedPath = ['index'];
1027
+ const querystring = {};
1028
+ const body = undefined;
1029
+ params = params !== null && params !== void 0 ? params : {};
1030
+ for (const key in params) {
1031
+ if (acceptedPath.includes(key)) {
1032
+ continue;
1033
+ }
1034
+ else if (key !== 'body') {
1035
+ // @ts-expect-error
1036
+ querystring[key] = params[key];
1037
+ }
1038
+ }
1039
+ let method = '';
1040
+ let path = '';
1041
+ if (params.index != null) {
1042
+ method = 'GET';
1043
+ path = `/${encodeURIComponent(params.index.toString())}/_mapping`;
1044
+ }
1045
+ else {
1046
+ method = 'GET';
1047
+ path = '/_mapping';
1048
+ }
1049
+ const meta = {
1050
+ name: 'indices.get_mapping',
1051
+ pathParts: {
1052
+ index: params.index
1053
+ }
1054
+ };
1055
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1056
+ }
1057
+ async getMigrateReindexStatus(params, options) {
1058
+ const acceptedPath = ['index'];
1059
+ const querystring = {};
1060
+ const body = undefined;
1061
+ for (const key in params) {
1062
+ if (acceptedPath.includes(key)) {
1063
+ continue;
1064
+ }
1065
+ else if (key !== 'body') {
1066
+ // @ts-expect-error
1067
+ querystring[key] = params[key];
1068
+ }
1069
+ }
1070
+ const method = 'GET';
1071
+ const path = `/_migration/reindex/${encodeURIComponent(params.index.toString())}/_status`;
1072
+ const meta = {
1073
+ name: 'indices.get_migrate_reindex_status',
1074
+ pathParts: {
1075
+ index: params.index
1076
+ }
1077
+ };
1078
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1079
+ }
1080
+ async getSettings(params, options) {
1081
+ const acceptedPath = ['index', 'name'];
1082
+ const querystring = {};
1083
+ const body = undefined;
1084
+ params = params !== null && params !== void 0 ? params : {};
1085
+ for (const key in params) {
1086
+ if (acceptedPath.includes(key)) {
1087
+ continue;
1088
+ }
1089
+ else if (key !== 'body') {
1090
+ // @ts-expect-error
1091
+ querystring[key] = params[key];
1092
+ }
1093
+ }
1094
+ let method = '';
1095
+ let path = '';
1096
+ if (params.index != null && params.name != null) {
1097
+ method = 'GET';
1098
+ path = `/${encodeURIComponent(params.index.toString())}/_settings/${encodeURIComponent(params.name.toString())}`;
1099
+ }
1100
+ else if (params.index != null) {
1101
+ method = 'GET';
1102
+ path = `/${encodeURIComponent(params.index.toString())}/_settings`;
1103
+ }
1104
+ else if (params.name != null) {
1105
+ method = 'GET';
1106
+ path = `/_settings/${encodeURIComponent(params.name.toString())}`;
1107
+ }
1108
+ else {
1109
+ method = 'GET';
1110
+ path = '/_settings';
1111
+ }
1112
+ const meta = {
1113
+ name: 'indices.get_settings',
1114
+ pathParts: {
1115
+ index: params.index,
1116
+ name: params.name
1117
+ }
1118
+ };
1119
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1120
+ }
1121
+ async getTemplate(params, options) {
1122
+ const acceptedPath = ['name'];
1123
+ const querystring = {};
1124
+ const body = undefined;
1125
+ params = params !== null && params !== void 0 ? params : {};
1126
+ for (const key in params) {
1127
+ if (acceptedPath.includes(key)) {
1128
+ continue;
1129
+ }
1130
+ else if (key !== 'body') {
1131
+ // @ts-expect-error
1132
+ querystring[key] = params[key];
1133
+ }
1134
+ }
1135
+ let method = '';
1136
+ let path = '';
1137
+ if (params.name != null) {
1138
+ method = 'GET';
1139
+ path = `/_template/${encodeURIComponent(params.name.toString())}`;
1140
+ }
1141
+ else {
1142
+ method = 'GET';
1143
+ path = '/_template';
1144
+ }
1145
+ const meta = {
1146
+ name: 'indices.get_template',
1147
+ pathParts: {
1148
+ name: params.name
1149
+ }
1150
+ };
1151
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1152
+ }
1153
+ async migrateReindex(params, options) {
1154
+ var _a;
1155
+ const acceptedPath = [];
1156
+ const acceptedBody = ['reindex'];
1157
+ const querystring = {};
1158
+ // @ts-expect-error
1159
+ let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
1160
+ for (const key in params) {
1161
+ if (acceptedBody.includes(key)) {
1162
+ // @ts-expect-error
1163
+ body = params[key];
1164
+ }
1165
+ else if (acceptedPath.includes(key)) {
1166
+ continue;
1167
+ }
1168
+ else if (key !== 'body') {
1169
+ // @ts-expect-error
1170
+ querystring[key] = params[key];
1171
+ }
1172
+ }
1173
+ const method = 'POST';
1174
+ const path = '/_migration/reindex';
1175
+ const meta = {
1176
+ name: 'indices.migrate_reindex'
1177
+ };
1178
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1179
+ }
1180
+ async migrateToDataStream(params, options) {
1181
+ const acceptedPath = ['name'];
1182
+ const querystring = {};
1183
+ const body = undefined;
1184
+ for (const key in params) {
1185
+ if (acceptedPath.includes(key)) {
1186
+ continue;
1187
+ }
1188
+ else if (key !== 'body') {
1189
+ // @ts-expect-error
1190
+ querystring[key] = params[key];
1191
+ }
1192
+ }
1193
+ const method = 'POST';
1194
+ const path = `/_data_stream/_migrate/${encodeURIComponent(params.name.toString())}`;
1195
+ const meta = {
1196
+ name: 'indices.migrate_to_data_stream',
1197
+ pathParts: {
1198
+ name: params.name
1199
+ }
1200
+ };
1201
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1202
+ }
1203
+ async modifyDataStream(params, options) {
1204
+ const acceptedPath = [];
1205
+ const acceptedBody = ['actions'];
1206
+ const querystring = {};
1207
+ // @ts-expect-error
1208
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1209
+ let body;
1210
+ if (typeof userBody === 'string') {
1211
+ body = userBody;
1212
+ }
1213
+ else {
1214
+ body = userBody != null ? { ...userBody } : undefined;
1215
+ }
1216
+ for (const key in params) {
1217
+ if (acceptedBody.includes(key)) {
1218
+ body = body !== null && body !== void 0 ? body : {};
1219
+ // @ts-expect-error
1220
+ body[key] = params[key];
1221
+ }
1222
+ else if (acceptedPath.includes(key)) {
1223
+ continue;
1224
+ }
1225
+ else if (key !== 'body') {
1226
+ // @ts-expect-error
1227
+ querystring[key] = params[key];
1228
+ }
1229
+ }
1230
+ const method = 'POST';
1231
+ const path = '/_data_stream/_modify';
1232
+ const meta = {
1233
+ name: 'indices.modify_data_stream'
1234
+ };
1235
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1236
+ }
1237
+ async open(params, options) {
1238
+ const acceptedPath = ['index'];
1239
+ const querystring = {};
1240
+ const body = undefined;
1241
+ for (const key in params) {
1242
+ if (acceptedPath.includes(key)) {
1243
+ continue;
1244
+ }
1245
+ else if (key !== 'body') {
1246
+ // @ts-expect-error
1247
+ querystring[key] = params[key];
1248
+ }
1249
+ }
1250
+ const method = 'POST';
1251
+ const path = `/${encodeURIComponent(params.index.toString())}/_open`;
1252
+ const meta = {
1253
+ name: 'indices.open',
1254
+ pathParts: {
1255
+ index: params.index
1256
+ }
1257
+ };
1258
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1259
+ }
1260
+ async promoteDataStream(params, options) {
1261
+ const acceptedPath = ['name'];
1262
+ const querystring = {};
1263
+ const body = undefined;
1264
+ for (const key in params) {
1265
+ if (acceptedPath.includes(key)) {
1266
+ continue;
1267
+ }
1268
+ else if (key !== 'body') {
1269
+ // @ts-expect-error
1270
+ querystring[key] = params[key];
1271
+ }
1272
+ }
1273
+ const method = 'POST';
1274
+ const path = `/_data_stream/_promote/${encodeURIComponent(params.name.toString())}`;
1275
+ const meta = {
1276
+ name: 'indices.promote_data_stream',
1277
+ pathParts: {
1278
+ name: params.name
1279
+ }
1280
+ };
1281
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1282
+ }
1283
+ async putAlias(params, options) {
1284
+ const acceptedPath = ['index', 'name'];
1285
+ const acceptedBody = ['filter', 'index_routing', 'is_write_index', 'routing', 'search_routing'];
1286
+ const querystring = {};
1287
+ // @ts-expect-error
1288
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1289
+ let body;
1290
+ if (typeof userBody === 'string') {
1291
+ body = userBody;
1292
+ }
1293
+ else {
1294
+ body = userBody != null ? { ...userBody } : undefined;
1295
+ }
1296
+ for (const key in params) {
1297
+ if (acceptedBody.includes(key)) {
1298
+ body = body !== null && body !== void 0 ? body : {};
1299
+ // @ts-expect-error
1300
+ body[key] = params[key];
1301
+ }
1302
+ else if (acceptedPath.includes(key)) {
1303
+ continue;
1304
+ }
1305
+ else if (key !== 'body') {
1306
+ // @ts-expect-error
1307
+ querystring[key] = params[key];
1308
+ }
1309
+ }
1310
+ let method = '';
1311
+ let path = '';
1312
+ if (params.index != null && params.name != null) {
1313
+ method = 'PUT';
1314
+ path = `/${encodeURIComponent(params.index.toString())}/_alias/${encodeURIComponent(params.name.toString())}`;
1315
+ }
1316
+ else {
1317
+ method = 'PUT';
1318
+ path = `/${encodeURIComponent(params.index.toString())}/_aliases/${encodeURIComponent(params.name.toString())}`;
1319
+ }
1320
+ const meta = {
1321
+ name: 'indices.put_alias',
1322
+ pathParts: {
1323
+ index: params.index,
1324
+ name: params.name
1325
+ }
1326
+ };
1327
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1328
+ }
1329
+ async putDataLifecycle(params, options) {
1330
+ const acceptedPath = ['name'];
1331
+ const acceptedBody = ['data_retention', 'downsampling', 'enabled'];
1332
+ const querystring = {};
1333
+ // @ts-expect-error
1334
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1335
+ let body;
1336
+ if (typeof userBody === 'string') {
1337
+ body = userBody;
1338
+ }
1339
+ else {
1340
+ body = userBody != null ? { ...userBody } : undefined;
1341
+ }
1342
+ for (const key in params) {
1343
+ if (acceptedBody.includes(key)) {
1344
+ body = body !== null && body !== void 0 ? body : {};
1345
+ // @ts-expect-error
1346
+ body[key] = params[key];
1347
+ }
1348
+ else if (acceptedPath.includes(key)) {
1349
+ continue;
1350
+ }
1351
+ else if (key !== 'body') {
1352
+ // @ts-expect-error
1353
+ querystring[key] = params[key];
1354
+ }
1355
+ }
1356
+ const method = 'PUT';
1357
+ const path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_lifecycle`;
1358
+ const meta = {
1359
+ name: 'indices.put_data_lifecycle',
1360
+ pathParts: {
1361
+ name: params.name
1362
+ }
1363
+ };
1364
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1365
+ }
1366
+ async putDataStreamOptions(params, options) {
1367
+ const acceptedPath = ['name'];
1368
+ const acceptedBody = ['failure_store'];
1369
+ const querystring = {};
1370
+ // @ts-expect-error
1371
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1372
+ let body;
1373
+ if (typeof userBody === 'string') {
1374
+ body = userBody;
1375
+ }
1376
+ else {
1377
+ body = userBody != null ? { ...userBody } : undefined;
1378
+ }
1379
+ for (const key in params) {
1380
+ if (acceptedBody.includes(key)) {
1381
+ body = body !== null && body !== void 0 ? body : {};
1382
+ // @ts-expect-error
1383
+ body[key] = params[key];
1384
+ }
1385
+ else if (acceptedPath.includes(key)) {
1386
+ continue;
1387
+ }
1388
+ else if (key !== 'body') {
1389
+ // @ts-expect-error
1390
+ querystring[key] = params[key];
1391
+ }
1392
+ }
1393
+ const method = 'PUT';
1394
+ const path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_options`;
1395
+ const meta = {
1396
+ name: 'indices.put_data_stream_options',
1397
+ pathParts: {
1398
+ name: params.name
1399
+ }
1400
+ };
1401
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1402
+ }
1403
+ async putDataStreamSettings(params, options) {
1404
+ var _a;
1405
+ const acceptedPath = ['name'];
1406
+ const acceptedBody = ['settings'];
1407
+ const querystring = {};
1408
+ // @ts-expect-error
1409
+ let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
1410
+ for (const key in params) {
1411
+ if (acceptedBody.includes(key)) {
1412
+ // @ts-expect-error
1413
+ body = params[key];
1414
+ }
1415
+ else if (acceptedPath.includes(key)) {
1416
+ continue;
1417
+ }
1418
+ else if (key !== 'body') {
1419
+ // @ts-expect-error
1420
+ querystring[key] = params[key];
1421
+ }
1422
+ }
1423
+ const method = 'PUT';
1424
+ const path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_settings`;
1425
+ const meta = {
1426
+ name: 'indices.put_data_stream_settings',
1427
+ pathParts: {
1428
+ name: params.name
1429
+ }
1430
+ };
1431
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1432
+ }
1433
+ async putIndexTemplate(params, options) {
1434
+ const acceptedPath = ['name'];
1435
+ const acceptedBody = ['index_patterns', 'composed_of', 'template', 'data_stream', 'priority', 'version', '_meta', 'allow_auto_create', 'ignore_missing_component_templates', 'deprecated'];
1436
+ const querystring = {};
1437
+ // @ts-expect-error
1438
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1439
+ let body;
1440
+ if (typeof userBody === 'string') {
1441
+ body = userBody;
1442
+ }
1443
+ else {
1444
+ body = userBody != null ? { ...userBody } : undefined;
1445
+ }
1446
+ for (const key in params) {
1447
+ if (acceptedBody.includes(key)) {
1448
+ body = body !== null && body !== void 0 ? body : {};
1449
+ // @ts-expect-error
1450
+ body[key] = params[key];
1451
+ }
1452
+ else if (acceptedPath.includes(key)) {
1453
+ continue;
1454
+ }
1455
+ else if (key !== 'body') {
1456
+ // @ts-expect-error
1457
+ querystring[key] = params[key];
1458
+ }
1459
+ }
1460
+ const method = 'PUT';
1461
+ const path = `/_index_template/${encodeURIComponent(params.name.toString())}`;
1462
+ const meta = {
1463
+ name: 'indices.put_index_template',
1464
+ pathParts: {
1465
+ name: params.name
1466
+ }
1467
+ };
1468
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1469
+ }
1470
+ async putMapping(params, options) {
1471
+ const acceptedPath = ['index'];
1472
+ const acceptedBody = ['date_detection', 'dynamic', 'dynamic_date_formats', 'dynamic_templates', '_field_names', '_meta', 'numeric_detection', 'properties', '_routing', '_source', 'runtime'];
1473
+ const querystring = {};
1474
+ // @ts-expect-error
1475
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1476
+ let body;
1477
+ if (typeof userBody === 'string') {
1478
+ body = userBody;
1479
+ }
1480
+ else {
1481
+ body = userBody != null ? { ...userBody } : undefined;
1482
+ }
1483
+ for (const key in params) {
1484
+ if (acceptedBody.includes(key)) {
1485
+ body = body !== null && body !== void 0 ? body : {};
1486
+ // @ts-expect-error
1487
+ body[key] = params[key];
1488
+ }
1489
+ else if (acceptedPath.includes(key)) {
1490
+ continue;
1491
+ }
1492
+ else if (key !== 'body') {
1493
+ // @ts-expect-error
1494
+ querystring[key] = params[key];
1495
+ }
1496
+ }
1497
+ const method = 'PUT';
1498
+ const path = `/${encodeURIComponent(params.index.toString())}/_mapping`;
1499
+ const meta = {
1500
+ name: 'indices.put_mapping',
1501
+ pathParts: {
1502
+ index: params.index
1503
+ }
1504
+ };
1505
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1506
+ }
1507
+ async putSettings(params, options) {
1508
+ var _a;
1509
+ const acceptedPath = ['index'];
1510
+ const acceptedBody = ['settings'];
1511
+ const querystring = {};
1512
+ // @ts-expect-error
1513
+ let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
1514
+ for (const key in params) {
1515
+ if (acceptedBody.includes(key)) {
1516
+ // @ts-expect-error
1517
+ body = params[key];
1518
+ }
1519
+ else if (acceptedPath.includes(key)) {
1520
+ continue;
1521
+ }
1522
+ else if (key !== 'body') {
1523
+ // @ts-expect-error
1524
+ querystring[key] = params[key];
1525
+ }
1526
+ }
1527
+ let method = '';
1528
+ let path = '';
1529
+ if (params.index != null) {
1530
+ method = 'PUT';
1531
+ path = `/${encodeURIComponent(params.index.toString())}/_settings`;
1532
+ }
1533
+ else {
1534
+ method = 'PUT';
1535
+ path = '/_settings';
1536
+ }
1537
+ const meta = {
1538
+ name: 'indices.put_settings',
1539
+ pathParts: {
1540
+ index: params.index
1541
+ }
1542
+ };
1543
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1544
+ }
1545
+ async putTemplate(params, options) {
1546
+ const acceptedPath = ['name'];
1547
+ const acceptedBody = ['aliases', 'index_patterns', 'mappings', 'order', 'settings', 'version'];
1548
+ const querystring = {};
1549
+ // @ts-expect-error
1550
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1551
+ let body;
1552
+ if (typeof userBody === 'string') {
1553
+ body = userBody;
1554
+ }
1555
+ else {
1556
+ body = userBody != null ? { ...userBody } : undefined;
1557
+ }
1558
+ for (const key in params) {
1559
+ if (acceptedBody.includes(key)) {
1560
+ body = body !== null && body !== void 0 ? body : {};
1561
+ // @ts-expect-error
1562
+ body[key] = params[key];
1563
+ }
1564
+ else if (acceptedPath.includes(key)) {
1565
+ continue;
1566
+ }
1567
+ else if (key !== 'body') {
1568
+ // @ts-expect-error
1569
+ querystring[key] = params[key];
1570
+ }
1571
+ }
1572
+ const method = 'PUT';
1573
+ const path = `/_template/${encodeURIComponent(params.name.toString())}`;
1574
+ const meta = {
1575
+ name: 'indices.put_template',
1576
+ pathParts: {
1577
+ name: params.name
1578
+ }
1579
+ };
1580
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1581
+ }
1582
+ async recovery(params, options) {
1583
+ const acceptedPath = ['index'];
1584
+ const querystring = {};
1585
+ const body = undefined;
1586
+ params = params !== null && params !== void 0 ? params : {};
1587
+ for (const key in params) {
1588
+ if (acceptedPath.includes(key)) {
1589
+ continue;
1590
+ }
1591
+ else if (key !== 'body') {
1592
+ // @ts-expect-error
1593
+ querystring[key] = params[key];
1594
+ }
1595
+ }
1596
+ let method = '';
1597
+ let path = '';
1598
+ if (params.index != null) {
1599
+ method = 'GET';
1600
+ path = `/${encodeURIComponent(params.index.toString())}/_recovery`;
1601
+ }
1602
+ else {
1603
+ method = 'GET';
1604
+ path = '/_recovery';
1605
+ }
1606
+ const meta = {
1607
+ name: 'indices.recovery',
1608
+ pathParts: {
1609
+ index: params.index
1610
+ }
1611
+ };
1612
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1613
+ }
1614
+ async refresh(params, options) {
1615
+ const acceptedPath = ['index'];
1616
+ const querystring = {};
1617
+ const body = undefined;
1618
+ params = params !== null && params !== void 0 ? params : {};
1619
+ for (const key in params) {
1620
+ if (acceptedPath.includes(key)) {
1621
+ continue;
1622
+ }
1623
+ else if (key !== 'body') {
1624
+ // @ts-expect-error
1625
+ querystring[key] = params[key];
1626
+ }
1627
+ }
1628
+ let method = '';
1629
+ let path = '';
1630
+ if (params.index != null) {
1631
+ method = body != null ? 'POST' : 'GET';
1632
+ path = `/${encodeURIComponent(params.index.toString())}/_refresh`;
1633
+ }
1634
+ else {
1635
+ method = body != null ? 'POST' : 'GET';
1636
+ path = '/_refresh';
1637
+ }
1638
+ const meta = {
1639
+ name: 'indices.refresh',
1640
+ pathParts: {
1641
+ index: params.index
1642
+ }
1643
+ };
1644
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1645
+ }
1646
+ async reloadSearchAnalyzers(params, options) {
1647
+ const acceptedPath = ['index'];
1648
+ const querystring = {};
1649
+ const body = undefined;
1650
+ for (const key in params) {
1651
+ if (acceptedPath.includes(key)) {
1652
+ continue;
1653
+ }
1654
+ else if (key !== 'body') {
1655
+ // @ts-expect-error
1656
+ querystring[key] = params[key];
1657
+ }
1658
+ }
1659
+ const method = body != null ? 'POST' : 'GET';
1660
+ const path = `/${encodeURIComponent(params.index.toString())}/_reload_search_analyzers`;
1661
+ const meta = {
1662
+ name: 'indices.reload_search_analyzers',
1663
+ pathParts: {
1664
+ index: params.index
1665
+ }
1666
+ };
1667
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1668
+ }
1669
+ async resolveCluster(params, options) {
1670
+ const acceptedPath = ['name'];
1671
+ const querystring = {};
1672
+ const body = undefined;
1673
+ params = params !== null && params !== void 0 ? params : {};
1674
+ for (const key in params) {
1675
+ if (acceptedPath.includes(key)) {
1676
+ continue;
1677
+ }
1678
+ else if (key !== 'body') {
1679
+ // @ts-expect-error
1680
+ querystring[key] = params[key];
1681
+ }
1682
+ }
1683
+ let method = '';
1684
+ let path = '';
1685
+ if (params.name != null) {
1686
+ method = 'GET';
1687
+ path = `/_resolve/cluster/${encodeURIComponent(params.name.toString())}`;
1688
+ }
1689
+ else {
1690
+ method = 'GET';
1691
+ path = '/_resolve/cluster';
1692
+ }
1693
+ const meta = {
1694
+ name: 'indices.resolve_cluster',
1695
+ pathParts: {
1696
+ name: params.name
1697
+ }
1698
+ };
1699
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1700
+ }
1701
+ async resolveIndex(params, options) {
1702
+ const acceptedPath = ['name'];
1703
+ const querystring = {};
1704
+ const body = undefined;
1705
+ for (const key in params) {
1706
+ if (acceptedPath.includes(key)) {
1707
+ continue;
1708
+ }
1709
+ else if (key !== 'body') {
1710
+ // @ts-expect-error
1711
+ querystring[key] = params[key];
1712
+ }
1713
+ }
1714
+ const method = 'GET';
1715
+ const path = `/_resolve/index/${encodeURIComponent(params.name.toString())}`;
1716
+ const meta = {
1717
+ name: 'indices.resolve_index',
1718
+ pathParts: {
1719
+ name: params.name
1720
+ }
1721
+ };
1722
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1723
+ }
1724
+ async rollover(params, options) {
1725
+ const acceptedPath = ['alias', 'new_index'];
1726
+ const acceptedBody = ['aliases', 'conditions', 'mappings', 'settings'];
1727
+ const querystring = {};
1728
+ // @ts-expect-error
1729
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1730
+ let body;
1731
+ if (typeof userBody === 'string') {
1732
+ body = userBody;
1733
+ }
1734
+ else {
1735
+ body = userBody != null ? { ...userBody } : undefined;
1736
+ }
1737
+ for (const key in params) {
1738
+ if (acceptedBody.includes(key)) {
1739
+ body = body !== null && body !== void 0 ? body : {};
1740
+ // @ts-expect-error
1741
+ body[key] = params[key];
1742
+ }
1743
+ else if (acceptedPath.includes(key)) {
1744
+ continue;
1745
+ }
1746
+ else if (key !== 'body') {
1747
+ // @ts-expect-error
1748
+ querystring[key] = params[key];
1749
+ }
1750
+ }
1751
+ let method = '';
1752
+ let path = '';
1753
+ if (params.alias != null && params.new_index != null) {
1754
+ method = 'POST';
1755
+ path = `/${encodeURIComponent(params.alias.toString())}/_rollover/${encodeURIComponent(params.new_index.toString())}`;
1756
+ }
1757
+ else {
1758
+ method = 'POST';
1759
+ path = `/${encodeURIComponent(params.alias.toString())}/_rollover`;
1760
+ }
1761
+ const meta = {
1762
+ name: 'indices.rollover',
1763
+ pathParts: {
1764
+ alias: params.alias,
1765
+ new_index: params.new_index
1766
+ }
1767
+ };
1768
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1769
+ }
1770
+ async segments(params, options) {
1771
+ const acceptedPath = ['index'];
1772
+ const querystring = {};
1773
+ const body = undefined;
1774
+ params = params !== null && params !== void 0 ? params : {};
1775
+ for (const key in params) {
1776
+ if (acceptedPath.includes(key)) {
1777
+ continue;
1778
+ }
1779
+ else if (key !== 'body') {
1780
+ // @ts-expect-error
1781
+ querystring[key] = params[key];
1782
+ }
1783
+ }
1784
+ let method = '';
1785
+ let path = '';
1786
+ if (params.index != null) {
1787
+ method = 'GET';
1788
+ path = `/${encodeURIComponent(params.index.toString())}/_segments`;
1789
+ }
1790
+ else {
1791
+ method = 'GET';
1792
+ path = '/_segments';
1793
+ }
1794
+ const meta = {
1795
+ name: 'indices.segments',
1796
+ pathParts: {
1797
+ index: params.index
1798
+ }
1799
+ };
1800
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1801
+ }
1802
+ async shardStores(params, options) {
1803
+ const acceptedPath = ['index'];
1804
+ const querystring = {};
1805
+ const body = undefined;
1806
+ params = params !== null && params !== void 0 ? params : {};
1807
+ for (const key in params) {
1808
+ if (acceptedPath.includes(key)) {
1809
+ continue;
1810
+ }
1811
+ else if (key !== 'body') {
1812
+ // @ts-expect-error
1813
+ querystring[key] = params[key];
1814
+ }
1815
+ }
1816
+ let method = '';
1817
+ let path = '';
1818
+ if (params.index != null) {
1819
+ method = 'GET';
1820
+ path = `/${encodeURIComponent(params.index.toString())}/_shard_stores`;
1821
+ }
1822
+ else {
1823
+ method = 'GET';
1824
+ path = '/_shard_stores';
1825
+ }
1826
+ const meta = {
1827
+ name: 'indices.shard_stores',
1828
+ pathParts: {
1829
+ index: params.index
1830
+ }
1831
+ };
1832
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1833
+ }
1834
+ async shrink(params, options) {
1835
+ const acceptedPath = ['index', 'target'];
1836
+ const acceptedBody = ['aliases', 'settings'];
1837
+ const querystring = {};
1838
+ // @ts-expect-error
1839
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1840
+ let body;
1841
+ if (typeof userBody === 'string') {
1842
+ body = userBody;
1843
+ }
1844
+ else {
1845
+ body = userBody != null ? { ...userBody } : undefined;
1846
+ }
1847
+ for (const key in params) {
1848
+ if (acceptedBody.includes(key)) {
1849
+ body = body !== null && body !== void 0 ? body : {};
1850
+ // @ts-expect-error
1851
+ body[key] = params[key];
1852
+ }
1853
+ else if (acceptedPath.includes(key)) {
1854
+ continue;
1855
+ }
1856
+ else if (key !== 'body') {
1857
+ // @ts-expect-error
1858
+ querystring[key] = params[key];
1859
+ }
1860
+ }
1861
+ const method = 'PUT';
1862
+ const path = `/${encodeURIComponent(params.index.toString())}/_shrink/${encodeURIComponent(params.target.toString())}`;
1863
+ const meta = {
1864
+ name: 'indices.shrink',
1865
+ pathParts: {
1866
+ index: params.index,
1867
+ target: params.target
1868
+ }
1869
+ };
1870
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1871
+ }
1872
+ async simulateIndexTemplate(params, options) {
1873
+ var _a;
1874
+ const acceptedPath = ['name'];
1875
+ const acceptedBody = ['index_template'];
1876
+ const querystring = {};
1877
+ // @ts-expect-error
1878
+ let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
1879
+ for (const key in params) {
1880
+ if (acceptedBody.includes(key)) {
1881
+ // @ts-expect-error
1882
+ body = params[key];
1883
+ }
1884
+ else if (acceptedPath.includes(key)) {
1885
+ continue;
1886
+ }
1887
+ else if (key !== 'body') {
1888
+ // @ts-expect-error
1889
+ querystring[key] = params[key];
1890
+ }
1891
+ }
1892
+ const method = 'POST';
1893
+ const path = `/_index_template/_simulate_index/${encodeURIComponent(params.name.toString())}`;
1894
+ const meta = {
1895
+ name: 'indices.simulate_index_template',
1896
+ pathParts: {
1897
+ name: params.name
1898
+ }
1899
+ };
1900
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1901
+ }
1902
+ async simulateTemplate(params, options) {
1903
+ const acceptedPath = ['name'];
1904
+ const acceptedBody = ['allow_auto_create', 'index_patterns', 'composed_of', 'template', 'data_stream', 'priority', 'version', '_meta', 'ignore_missing_component_templates', 'deprecated'];
1905
+ const querystring = {};
1906
+ // @ts-expect-error
1907
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1908
+ let body;
1909
+ if (typeof userBody === 'string') {
1910
+ body = userBody;
1911
+ }
1912
+ else {
1913
+ body = userBody != null ? { ...userBody } : undefined;
1914
+ }
1915
+ params = params !== null && params !== void 0 ? params : {};
1916
+ for (const key in params) {
1917
+ if (acceptedBody.includes(key)) {
1918
+ body = body !== null && body !== void 0 ? body : {};
1919
+ // @ts-expect-error
1920
+ body[key] = params[key];
1921
+ }
1922
+ else if (acceptedPath.includes(key)) {
1923
+ continue;
1924
+ }
1925
+ else if (key !== 'body') {
1926
+ // @ts-expect-error
1927
+ querystring[key] = params[key];
1928
+ }
1929
+ }
1930
+ let method = '';
1931
+ let path = '';
1932
+ if (params.name != null) {
1933
+ method = 'POST';
1934
+ path = `/_index_template/_simulate/${encodeURIComponent(params.name.toString())}`;
1935
+ }
1936
+ else {
1937
+ method = 'POST';
1938
+ path = '/_index_template/_simulate';
1939
+ }
1940
+ const meta = {
1941
+ name: 'indices.simulate_template',
1942
+ pathParts: {
1943
+ name: params.name
1944
+ }
1945
+ };
1946
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1947
+ }
1948
+ async split(params, options) {
1949
+ const acceptedPath = ['index', 'target'];
1950
+ const acceptedBody = ['aliases', 'settings'];
1951
+ const querystring = {};
1952
+ // @ts-expect-error
1953
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1954
+ let body;
1955
+ if (typeof userBody === 'string') {
1956
+ body = userBody;
1957
+ }
1958
+ else {
1959
+ body = userBody != null ? { ...userBody } : undefined;
1960
+ }
1961
+ for (const key in params) {
1962
+ if (acceptedBody.includes(key)) {
1963
+ body = body !== null && body !== void 0 ? body : {};
1964
+ // @ts-expect-error
1965
+ body[key] = params[key];
1966
+ }
1967
+ else if (acceptedPath.includes(key)) {
1968
+ continue;
1969
+ }
1970
+ else if (key !== 'body') {
1971
+ // @ts-expect-error
1972
+ querystring[key] = params[key];
1973
+ }
1974
+ }
1975
+ const method = 'PUT';
1976
+ const path = `/${encodeURIComponent(params.index.toString())}/_split/${encodeURIComponent(params.target.toString())}`;
1977
+ const meta = {
1978
+ name: 'indices.split',
1979
+ pathParts: {
1980
+ index: params.index,
1981
+ target: params.target
1982
+ }
1983
+ };
1984
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1985
+ }
1986
+ async stats(params, options) {
1987
+ const acceptedPath = ['metric', 'index'];
1988
+ const querystring = {};
1989
+ const body = undefined;
1990
+ params = params !== null && params !== void 0 ? params : {};
1991
+ for (const key in params) {
1992
+ if (acceptedPath.includes(key)) {
1993
+ continue;
1994
+ }
1995
+ else if (key !== 'body') {
1996
+ // @ts-expect-error
1997
+ querystring[key] = params[key];
1998
+ }
1999
+ }
2000
+ let method = '';
2001
+ let path = '';
2002
+ if (params.index != null && params.metric != null) {
2003
+ method = 'GET';
2004
+ path = `/${encodeURIComponent(params.index.toString())}/_stats/${encodeURIComponent(params.metric.toString())}`;
2005
+ }
2006
+ else if (params.metric != null) {
2007
+ method = 'GET';
2008
+ path = `/_stats/${encodeURIComponent(params.metric.toString())}`;
2009
+ }
2010
+ else if (params.index != null) {
2011
+ method = 'GET';
2012
+ path = `/${encodeURIComponent(params.index.toString())}/_stats`;
2013
+ }
2014
+ else {
2015
+ method = 'GET';
2016
+ path = '/_stats';
2017
+ }
2018
+ const meta = {
2019
+ name: 'indices.stats',
2020
+ pathParts: {
2021
+ metric: params.metric,
2022
+ index: params.index
2023
+ }
2024
+ };
2025
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
2026
+ }
2027
+ async unfreeze(params, options) {
2028
+ const acceptedPath = ['index'];
2029
+ const querystring = {};
2030
+ const body = undefined;
2031
+ for (const key in params) {
2032
+ if (acceptedPath.includes(key)) {
2033
+ continue;
2034
+ }
2035
+ else if (key !== 'body') {
2036
+ // @ts-expect-error
2037
+ querystring[key] = params[key];
2038
+ }
2039
+ }
2040
+ const method = 'POST';
2041
+ const path = `/${encodeURIComponent(params.index.toString())}/_unfreeze`;
2042
+ const meta = {
2043
+ name: 'indices.unfreeze',
2044
+ pathParts: {
2045
+ index: params.index
2046
+ }
2047
+ };
2048
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
2049
+ }
2050
+ async updateAliases(params, options) {
2051
+ const acceptedPath = [];
2052
+ const acceptedBody = ['actions'];
2053
+ const querystring = {};
2054
+ // @ts-expect-error
2055
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
2056
+ let body;
2057
+ if (typeof userBody === 'string') {
2058
+ body = userBody;
2059
+ }
2060
+ else {
2061
+ body = userBody != null ? { ...userBody } : undefined;
2062
+ }
2063
+ params = params !== null && params !== void 0 ? params : {};
2064
+ for (const key in params) {
2065
+ if (acceptedBody.includes(key)) {
2066
+ body = body !== null && body !== void 0 ? body : {};
2067
+ // @ts-expect-error
2068
+ body[key] = params[key];
2069
+ }
2070
+ else if (acceptedPath.includes(key)) {
2071
+ continue;
2072
+ }
2073
+ else if (key !== 'body') {
2074
+ // @ts-expect-error
2075
+ querystring[key] = params[key];
2076
+ }
2077
+ }
2078
+ const method = 'POST';
2079
+ const path = '/_aliases';
2080
+ const meta = {
2081
+ name: 'indices.update_aliases'
2082
+ };
2083
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
2084
+ }
2085
+ async validateQuery(params, options) {
2086
+ const acceptedPath = ['index'];
2087
+ const acceptedBody = ['query'];
2088
+ const querystring = {};
2089
+ // @ts-expect-error
2090
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
2091
+ let body;
2092
+ if (typeof userBody === 'string') {
2093
+ body = userBody;
2094
+ }
2095
+ else {
2096
+ body = userBody != null ? { ...userBody } : undefined;
2097
+ }
2098
+ params = params !== null && params !== void 0 ? params : {};
2099
+ for (const key in params) {
2100
+ if (acceptedBody.includes(key)) {
2101
+ body = body !== null && body !== void 0 ? body : {};
2102
+ // @ts-expect-error
2103
+ body[key] = params[key];
2104
+ }
2105
+ else if (acceptedPath.includes(key)) {
2106
+ continue;
2107
+ }
2108
+ else if (key !== 'body') {
2109
+ // @ts-expect-error
2110
+ querystring[key] = params[key];
2111
+ }
2112
+ }
2113
+ let method = '';
2114
+ let path = '';
2115
+ if (params.index != null) {
2116
+ method = body != null ? 'POST' : 'GET';
2117
+ path = `/${encodeURIComponent(params.index.toString())}/_validate/query`;
2118
+ }
2119
+ else {
2120
+ method = body != null ? 'POST' : 'GET';
2121
+ path = '/_validate/query';
2122
+ }
2123
+ const meta = {
2124
+ name: 'indices.validate_query',
2125
+ pathParts: {
2126
+ index: params.index
2127
+ }
2128
+ };
2129
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
2130
+ }
2131
+ }
2132
+ exports.default = Indices;
2133
+ //# sourceMappingURL=indices.js.map