plugin-elastic-report 0.0.0-stage → 0.7.0

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 (272) hide show
  1. package/ai/skills/elastic-report/SKILLS.md +34 -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/357.0dd385384cab5dbf.js +10 -0
  7. package/dist/client/index.js +10 -0
  8. package/dist/client-v2/851.142c93fc6d666b28.js +10 -0
  9. package/dist/client-v2/857.a5bf9637d5fd4ef5.js +10 -0
  10. package/dist/client-v2/877.f4095a3dbcadf98f.js +10 -0
  11. package/dist/client-v2/index.js +10 -0
  12. package/dist/externalVersion.js +21 -0
  13. package/dist/index.js +48 -0
  14. package/dist/locale/en-US.json +198 -0
  15. package/dist/locale/vi-VN.json +198 -0
  16. package/dist/locale/zh-CN.json +198 -0
  17. package/dist/node_modules/@elastic/elasticsearch/.dockerignore +11 -0
  18. package/dist/node_modules/@elastic/elasticsearch/LICENSE +202 -0
  19. package/dist/node_modules/@elastic/elasticsearch/NOTICE.txt +2 -0
  20. package/dist/node_modules/@elastic/elasticsearch/catalog-info.yaml +50 -0
  21. package/dist/node_modules/@elastic/elasticsearch/codecov.yml +14 -0
  22. package/dist/node_modules/@elastic/elasticsearch/index.d.ts +28 -0
  23. package/dist/node_modules/@elastic/elasticsearch/index.js +85525 -0
  24. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/async_search.d.ts +39 -0
  25. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/async_search.js +155 -0
  26. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/autoscaling.d.ts +39 -0
  27. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/autoscaling.js +130 -0
  28. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/bulk.d.ts +14 -0
  29. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/bulk.js +60 -0
  30. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/capabilities.d.ts +14 -0
  31. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/capabilities.js +43 -0
  32. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/cat.d.ts +193 -0
  33. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/cat.js +766 -0
  34. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ccr.d.ts +102 -0
  35. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ccr.js +395 -0
  36. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/clear_scroll.d.ts +14 -0
  37. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/clear_scroll.js +60 -0
  38. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/close_point_in_time.d.ts +14 -0
  39. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/close_point_in_time.js +56 -0
  40. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/cluster.d.ts +123 -0
  41. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/cluster.js +482 -0
  42. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/connector.d.ts +245 -0
  43. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/connector.js +1121 -0
  44. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/count.d.ts +14 -0
  45. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/count.js +68 -0
  46. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/create.d.ts +14 -0
  47. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/create.js +53 -0
  48. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/dangling_indices.d.ts +32 -0
  49. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/dangling_indices.js +100 -0
  50. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete.d.ts +14 -0
  51. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete.js +46 -0
  52. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete_by_query.d.ts +14 -0
  53. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete_by_query.js +59 -0
  54. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete_by_query_rethrottle.d.ts +14 -0
  55. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete_by_query_rethrottle.js +45 -0
  56. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete_script.d.ts +14 -0
  57. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete_script.js +45 -0
  58. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/enrich.d.ts +46 -0
  59. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/enrich.js +169 -0
  60. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/eql.d.ts +39 -0
  61. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/eql.js +139 -0
  62. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/esql.d.ts +46 -0
  63. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/esql.js +170 -0
  64. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/exists.d.ts +14 -0
  65. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/exists.js +46 -0
  66. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/exists_source.d.ts +14 -0
  67. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/exists_source.js +46 -0
  68. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/explain.d.ts +14 -0
  69. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/explain.js +60 -0
  70. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/features.d.ts +25 -0
  71. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/features.js +75 -0
  72. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/field_caps.d.ts +14 -0
  73. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/field_caps.js +68 -0
  74. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/fleet.d.ts +50 -0
  75. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/fleet.js +211 -0
  76. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get.d.ts +14 -0
  77. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get.js +46 -0
  78. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_script.d.ts +14 -0
  79. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_script.js +45 -0
  80. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_script_context.d.ts +14 -0
  81. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_script_context.js +43 -0
  82. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_script_languages.d.ts +14 -0
  83. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_script_languages.js +43 -0
  84. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_source.d.ts +14 -0
  85. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_source.js +46 -0
  86. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/graph.d.ts +18 -0
  87. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/graph.js +70 -0
  88. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/health_report.d.ts +14 -0
  89. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/health_report.js +54 -0
  90. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ilm.d.ts +88 -0
  91. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ilm.js +329 -0
  92. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/index.d.ts +14 -0
  93. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/index.js +61 -0
  94. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/indices.d.ts +494 -0
  95. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/indices.js +2133 -0
  96. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/inference.d.ts +221 -0
  97. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/inference.js +1167 -0
  98. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/info.d.ts +14 -0
  99. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/info.js +43 -0
  100. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ingest.d.ts +95 -0
  101. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ingest.js +389 -0
  102. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/knn_search.d.ts +14 -0
  103. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/knn_search.js +59 -0
  104. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/license.d.ts +60 -0
  105. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/license.js +194 -0
  106. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/logstash.d.ts +32 -0
  107. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/logstash.js +118 -0
  108. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/mget.d.ts +14 -0
  109. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/mget.js +68 -0
  110. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/migration.d.ts +32 -0
  111. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/migration.js +107 -0
  112. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ml.d.ts +522 -0
  113. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ml.js +2468 -0
  114. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/monitoring.d.ts +18 -0
  115. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/monitoring.js +60 -0
  116. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/msearch.d.ts +14 -0
  117. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/msearch.js +60 -0
  118. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/msearch_template.d.ts +14 -0
  119. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/msearch_template.js +60 -0
  120. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/mtermvectors.d.ts +14 -0
  121. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/mtermvectors.js +68 -0
  122. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/nodes.d.ts +60 -0
  123. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/nodes.js +290 -0
  124. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/open_point_in_time.d.ts +14 -0
  125. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/open_point_in_time.js +59 -0
  126. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ping.d.ts +14 -0
  127. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ping.js +43 -0
  128. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/profiling.d.ts +39 -0
  129. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/profiling.js +135 -0
  130. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/put_script.d.ts +14 -0
  131. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/put_script.js +68 -0
  132. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/query_rules.d.ts +67 -0
  133. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/query_rules.js +260 -0
  134. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/rank_eval.d.ts +14 -0
  135. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/rank_eval.js +67 -0
  136. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/reindex.d.ts +14 -0
  137. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/reindex.js +56 -0
  138. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/reindex_rethrottle.d.ts +14 -0
  139. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/reindex_rethrottle.js +45 -0
  140. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/render_search_template.d.ts +14 -0
  141. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/render_search_template.js +68 -0
  142. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/rollup.d.ts +67 -0
  143. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/rollup.js +263 -0
  144. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/scripts_painless_execute.d.ts +14 -0
  145. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/scripts_painless_execute.js +57 -0
  146. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/scroll.d.ts +14 -0
  147. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/scroll.js +59 -0
  148. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search.d.ts +14 -0
  149. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search.js +75 -0
  150. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_application.d.ts +81 -0
  151. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_application.js +313 -0
  152. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_mvt.d.ts +14 -0
  153. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_mvt.js +63 -0
  154. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_shards.d.ts +14 -0
  155. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_shards.js +54 -0
  156. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_template.d.ts +14 -0
  157. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_template.js +68 -0
  158. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/searchable_snapshots.d.ts +39 -0
  159. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/searchable_snapshots.js +167 -0
  160. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/security.d.ts +459 -0
  161. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/security.js +1982 -0
  162. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/shutdown.d.ts +32 -0
  163. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/shutdown.js +125 -0
  164. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/simulate.d.ts +18 -0
  165. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/simulate.js +78 -0
  166. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/slm.d.ts +74 -0
  167. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/slm.js +253 -0
  168. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/snapshot.d.ts +102 -0
  169. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/snapshot.js +410 -0
  170. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/sql.d.ts +53 -0
  171. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/sql.js +205 -0
  172. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ssl.d.ts +18 -0
  173. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ssl.js +54 -0
  174. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/streams.d.ts +32 -0
  175. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/streams.js +96 -0
  176. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/synonyms.d.ts +60 -0
  177. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/synonyms.js +223 -0
  178. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/tasks.d.ts +32 -0
  179. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/tasks.js +109 -0
  180. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/terms_enum.d.ts +14 -0
  181. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/terms_enum.js +59 -0
  182. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/termvectors.d.ts +14 -0
  183. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/termvectors.js +68 -0
  184. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/text_structure.d.ts +39 -0
  185. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/text_structure.js +148 -0
  186. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/transform.d.ts +101 -0
  187. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/transform.js +386 -0
  188. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/update.d.ts +14 -0
  189. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/update.js +60 -0
  190. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/update_by_query.d.ts +14 -0
  191. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/update_by_query.js +59 -0
  192. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/update_by_query_rethrottle.d.ts +14 -0
  193. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/update_by_query_rethrottle.js +45 -0
  194. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/watcher.d.ts +102 -0
  195. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/watcher.js +405 -0
  196. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/xpack.d.ts +25 -0
  197. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/xpack.js +75 -0
  198. package/dist/node_modules/@elastic/elasticsearch/lib/api/index.d.ts +265 -0
  199. package/dist/node_modules/@elastic/elasticsearch/lib/api/index.js +632 -0
  200. package/dist/node_modules/@elastic/elasticsearch/lib/api/types.d.ts +19933 -0
  201. package/dist/node_modules/@elastic/elasticsearch/lib/api/types.js +21 -0
  202. package/dist/node_modules/@elastic/elasticsearch/lib/api/typesWithBodyKey.d.ts +20606 -0
  203. package/dist/node_modules/@elastic/elasticsearch/lib/api/typesWithBodyKey.js +21 -0
  204. package/dist/node_modules/@elastic/elasticsearch/lib/client.d.ts +152 -0
  205. package/dist/node_modules/@elastic/elasticsearch/lib/client.js +369 -0
  206. package/dist/node_modules/@elastic/elasticsearch/lib/helpers.d.ts +184 -0
  207. package/dist/node_modules/@elastic/elasticsearch/lib/helpers.js +889 -0
  208. package/dist/node_modules/@elastic/elasticsearch/lib/sniffingTransport.d.ts +4 -0
  209. package/dist/node_modules/@elastic/elasticsearch/lib/sniffingTransport.js +56 -0
  210. package/dist/node_modules/@elastic/elasticsearch/node_modules/.bin/arrow2csv +15 -0
  211. package/dist/node_modules/@elastic/elasticsearch/node_modules/.bin/arrow2csv.cmd +7 -0
  212. package/dist/node_modules/@elastic/elasticsearch/package.json +1 -0
  213. package/dist/node_modules/@elastic/elasticsearch/tsconfig.json +38 -0
  214. package/dist/server/acl-guard.js +179 -0
  215. package/dist/server/collections/es-report-data-views.js +85 -0
  216. package/dist/server/collections/es-reports.js +101 -0
  217. package/dist/server/index.js +58 -0
  218. package/dist/server/mcp/ElasticReportMcpServer.js +344 -0
  219. package/dist/server/mcp/ElasticReportToolCatalog.js +639 -0
  220. package/dist/server/plugin.js +529 -0
  221. package/dist/server/services/ElasticReportService.js +377 -0
  222. package/dist/server/services/ElasticsearchConnectionService.js +572 -0
  223. package/dist/server/services/ReportExportService.js +243 -0
  224. package/dist/server/services/ReportQueryCompiler.js +1299 -0
  225. package/dist/server/workflow/ElasticReportQueryInstruction.js +123 -0
  226. package/dist/shared/constants.js +96 -0
  227. package/dist/shared/types.js +24 -0
  228. package/package.json +62 -4
  229. package/server.d.ts +2 -0
  230. package/server.js +1 -0
  231. package/src/client/index.tsx +34 -0
  232. package/src/client/workflow-instructions.tsx +44 -0
  233. package/src/client-v2/__tests__/elastic-report.test.tsx +791 -0
  234. package/src/client-v2/__tests__/kql-autocomplete.test.ts +178 -0
  235. package/src/client-v2/api.ts +320 -0
  236. package/src/client-v2/bus/DashboardFilterBus.ts +212 -0
  237. package/src/client-v2/components/ElasticBasicCharts.tsx +652 -0
  238. package/src/client-v2/components/ElasticFilterBar.tsx +372 -0
  239. package/src/client-v2/components/ElasticKqlInput.tsx +421 -0
  240. package/src/client-v2/components/ElasticReportBlock.tsx +306 -0
  241. package/src/client-v2/components/ElasticReportRenderer.tsx +1257 -0
  242. package/src/client-v2/components/HighlightText.tsx +50 -0
  243. package/src/client-v2/components/ReportSelect.tsx +85 -0
  244. package/src/client-v2/index.tsx +14 -0
  245. package/src/client-v2/locale.ts +23 -0
  246. package/src/client-v2/models/ElasticFilterBarBlockModel.tsx +115 -0
  247. package/src/client-v2/models/ElasticReportBlockModel.tsx +118 -0
  248. package/src/client-v2/pages/ElasticReportManager.tsx +1453 -0
  249. package/src/client-v2/plugin.tsx +72 -0
  250. package/src/client-v2/utils/kqlAutocomplete.ts +861 -0
  251. package/src/client-v2/workflow/instructions.tsx +149 -0
  252. package/src/index.ts +11 -0
  253. package/src/locale/en-US.json +198 -0
  254. package/src/locale/vi-VN.json +198 -0
  255. package/src/locale/zh-CN.json +198 -0
  256. package/src/server/__tests__/query-compiler.test.ts +620 -0
  257. package/src/server/__tests__/report-mcp-acl.integration.test.ts +645 -0
  258. package/src/server/acl-guard.ts +194 -0
  259. package/src/server/collections/es-report-data-views.ts +64 -0
  260. package/src/server/collections/es-reports.ts +80 -0
  261. package/src/server/index.ts +15 -0
  262. package/src/server/mcp/ElasticReportMcpServer.ts +391 -0
  263. package/src/server/mcp/ElasticReportToolCatalog.ts +663 -0
  264. package/src/server/plugin.ts +599 -0
  265. package/src/server/services/ElasticReportService.ts +486 -0
  266. package/src/server/services/ElasticsearchConnectionService.ts +728 -0
  267. package/src/server/services/ReportExportService.ts +282 -0
  268. package/src/server/services/ReportQueryCompiler.ts +1552 -0
  269. package/src/server/workflow/ElasticReportQueryInstruction.ts +124 -0
  270. package/src/shared/constants.ts +36 -0
  271. package/src/shared/types.ts +272 -0
  272. package/README.md +0 -3
@@ -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 = ExistsSourceApi;
22
+ async function ExistsSourceApi(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())}/_source/${encodeURIComponent(params.id.toString())}`;
37
+ const meta = {
38
+ name: 'exists_source',
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_source.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
+ * Explain a document match result. Get information about why a specific document matches, or doesn't match, a query. It computes a score explanation for a query and a specific document.
9
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/search-explain.html | Elasticsearch API documentation}
10
+ */
11
+ export default function ExplainApi<TDocument = unknown>(this: That, params: T.ExplainRequest | TB.ExplainRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ExplainResponse<TDocument>>;
12
+ export default function ExplainApi<TDocument = unknown>(this: That, params: T.ExplainRequest | TB.ExplainRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ExplainResponse<TDocument>, unknown>>;
13
+ export default function ExplainApi<TDocument = unknown>(this: That, params: T.ExplainRequest | TB.ExplainRequest, options?: TransportRequestOptions): Promise<T.ExplainResponse<TDocument>>;
14
+ export {};
@@ -0,0 +1,60 @@
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 = ExplainApi;
22
+ async function ExplainApi(params, options) {
23
+ const acceptedPath = ['id', 'index'];
24
+ const acceptedBody = ['query'];
25
+ const querystring = {};
26
+ // @ts-expect-error
27
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
28
+ let body;
29
+ if (typeof userBody === 'string') {
30
+ body = userBody;
31
+ }
32
+ else {
33
+ body = userBody != null ? { ...userBody } : undefined;
34
+ }
35
+ for (const key in params) {
36
+ if (acceptedBody.includes(key)) {
37
+ body = body !== null && body !== void 0 ? body : {};
38
+ // @ts-expect-error
39
+ body[key] = params[key];
40
+ }
41
+ else if (acceptedPath.includes(key)) {
42
+ continue;
43
+ }
44
+ else if (key !== 'body') {
45
+ // @ts-expect-error
46
+ querystring[key] = params[key];
47
+ }
48
+ }
49
+ const method = body != null ? 'POST' : 'GET';
50
+ const path = `/${encodeURIComponent(params.index.toString())}/_explain/${encodeURIComponent(params.id.toString())}`;
51
+ const meta = {
52
+ name: 'explain',
53
+ pathParts: {
54
+ id: params.id,
55
+ index: params.index
56
+ }
57
+ };
58
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
59
+ }
60
+ //# sourceMappingURL=explain.js.map
@@ -0,0 +1,25 @@
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 Features {
8
+ transport: Transport;
9
+ constructor(transport: Transport);
10
+ /**
11
+ * Get the features. Get a list of features that can be included in snapshots using the `feature_states` field when creating a snapshot. You can use this API to determine which feature states to include when taking a snapshot. By default, all feature states are included in a snapshot if that snapshot includes the global state, or none if it does not. A feature state includes one or more system indices necessary for a given feature to function. In order to ensure data integrity, all system indices that comprise a feature state are snapshotted and restored together. The features listed by this API are a combination of built-in features and features defined by plugins. In order for a feature state to be listed in this API and recognized as a valid feature state by the create snapshot API, the plugin that defines that feature must be installed on the master node.
12
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/get-features-api.html | Elasticsearch API documentation}
13
+ */
14
+ getFeatures(this: That, params?: T.FeaturesGetFeaturesRequest | TB.FeaturesGetFeaturesRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FeaturesGetFeaturesResponse>;
15
+ getFeatures(this: That, params?: T.FeaturesGetFeaturesRequest | TB.FeaturesGetFeaturesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FeaturesGetFeaturesResponse, unknown>>;
16
+ getFeatures(this: That, params?: T.FeaturesGetFeaturesRequest | TB.FeaturesGetFeaturesRequest, options?: TransportRequestOptions): Promise<T.FeaturesGetFeaturesResponse>;
17
+ /**
18
+ * Reset the features. Clear all of the state information stored in system indices by Elasticsearch features, including the security and machine learning indices. WARNING: Intended for development and testing use only. Do not reset features on a production cluster. Return a cluster to the same state as a new installation by resetting the feature state for all Elasticsearch features. This deletes all state information stored in system indices. The response code is HTTP 200 if the state is successfully reset for all features. It is HTTP 500 if the reset operation failed for any feature. Note that select features might provide a way to reset particular system indices. Using this API resets all features, both those that are built-in and implemented as plugins. To list the features that will be affected, use the get features API. IMPORTANT: The features installed on the node you submit this request to are the features that will be reset. Run on the master node if you have any doubts about which plugins are installed on individual nodes.
19
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/reset-features-api.html | Elasticsearch API documentation}
20
+ */
21
+ resetFeatures(this: That, params?: T.FeaturesResetFeaturesRequest | TB.FeaturesResetFeaturesRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FeaturesResetFeaturesResponse>;
22
+ resetFeatures(this: That, params?: T.FeaturesResetFeaturesRequest | TB.FeaturesResetFeaturesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FeaturesResetFeaturesResponse, unknown>>;
23
+ resetFeatures(this: That, params?: T.FeaturesResetFeaturesRequest | TB.FeaturesResetFeaturesRequest, options?: TransportRequestOptions): Promise<T.FeaturesResetFeaturesResponse>;
24
+ }
25
+ export {};
@@ -0,0 +1,75 @@
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 Features {
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 getFeatures(params, options) {
32
+ const acceptedPath = [];
33
+ const querystring = {};
34
+ const body = undefined;
35
+ params = params !== null && params !== void 0 ? params : {};
36
+ for (const key in params) {
37
+ if (acceptedPath.includes(key)) {
38
+ continue;
39
+ }
40
+ else if (key !== 'body') {
41
+ // @ts-expect-error
42
+ querystring[key] = params[key];
43
+ }
44
+ }
45
+ const method = 'GET';
46
+ const path = '/_features';
47
+ const meta = {
48
+ name: 'features.get_features'
49
+ };
50
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
51
+ }
52
+ async resetFeatures(params, options) {
53
+ const acceptedPath = [];
54
+ const querystring = {};
55
+ const body = undefined;
56
+ params = params !== null && params !== void 0 ? params : {};
57
+ for (const key in params) {
58
+ if (acceptedPath.includes(key)) {
59
+ continue;
60
+ }
61
+ else if (key !== 'body') {
62
+ // @ts-expect-error
63
+ querystring[key] = params[key];
64
+ }
65
+ }
66
+ const method = 'POST';
67
+ const path = '/_features/_reset';
68
+ const meta = {
69
+ name: 'features.reset_features'
70
+ };
71
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
72
+ }
73
+ }
74
+ exports.default = Features;
75
+ //# sourceMappingURL=features.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
+ * Get the field capabilities. Get information about the capabilities of fields among multiple indices. For data streams, the API returns field capabilities among the stream’s backing indices. It returns runtime fields like any other field. For example, a runtime field with a type of keyword is returned the same as any other field that belongs to the `keyword` family.
9
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/search-field-caps.html | Elasticsearch API documentation}
10
+ */
11
+ export default function FieldCapsApi(this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FieldCapsResponse>;
12
+ export default function FieldCapsApi(this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FieldCapsResponse, unknown>>;
13
+ export default function FieldCapsApi(this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptions): Promise<T.FieldCapsResponse>;
14
+ export {};
@@ -0,0 +1,68 @@
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 = FieldCapsApi;
22
+ async function FieldCapsApi(params, options) {
23
+ const acceptedPath = ['index'];
24
+ const acceptedBody = ['fields', 'index_filter', 'runtime_mappings'];
25
+ const querystring = {};
26
+ // @ts-expect-error
27
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
28
+ let body;
29
+ if (typeof userBody === 'string') {
30
+ body = userBody;
31
+ }
32
+ else {
33
+ body = userBody != null ? { ...userBody } : undefined;
34
+ }
35
+ params = params !== null && params !== void 0 ? params : {};
36
+ for (const key in params) {
37
+ if (acceptedBody.includes(key)) {
38
+ body = body !== null && body !== void 0 ? body : {};
39
+ // @ts-expect-error
40
+ body[key] = params[key];
41
+ }
42
+ else if (acceptedPath.includes(key)) {
43
+ continue;
44
+ }
45
+ else if (key !== 'body') {
46
+ // @ts-expect-error
47
+ querystring[key] = params[key];
48
+ }
49
+ }
50
+ let method = '';
51
+ let path = '';
52
+ if (params.index != null) {
53
+ method = body != null ? 'POST' : 'GET';
54
+ path = `/${encodeURIComponent(params.index.toString())}/_field_caps`;
55
+ }
56
+ else {
57
+ method = body != null ? 'POST' : 'GET';
58
+ path = '/_field_caps';
59
+ }
60
+ const meta = {
61
+ name: 'field_caps',
62
+ pathParts: {
63
+ index: params.index
64
+ }
65
+ };
66
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
67
+ }
68
+ //# sourceMappingURL=field_caps.js.map
@@ -0,0 +1,50 @@
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 Fleet {
8
+ transport: Transport;
9
+ constructor(transport: Transport);
10
+ /**
11
+ * Deletes a secret stored by Fleet.
12
+ */
13
+ deleteSecret(this: That, params: T.FleetDeleteSecretRequest | TB.FleetDeleteSecretRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FleetDeleteSecretResponse>;
14
+ deleteSecret(this: That, params: T.FleetDeleteSecretRequest | TB.FleetDeleteSecretRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FleetDeleteSecretResponse, unknown>>;
15
+ deleteSecret(this: That, params: T.FleetDeleteSecretRequest | TB.FleetDeleteSecretRequest, options?: TransportRequestOptions): Promise<T.FleetDeleteSecretResponse>;
16
+ /**
17
+ * Retrieves a secret stored by Fleet.
18
+ */
19
+ getSecret(this: That, params: T.FleetGetSecretRequest | TB.FleetGetSecretRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FleetGetSecretResponse>;
20
+ getSecret(this: That, params: T.FleetGetSecretRequest | TB.FleetGetSecretRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FleetGetSecretResponse, unknown>>;
21
+ getSecret(this: That, params: T.FleetGetSecretRequest | TB.FleetGetSecretRequest, options?: TransportRequestOptions): Promise<T.FleetGetSecretResponse>;
22
+ /**
23
+ * Get global checkpoints. Get the current global checkpoints for an index. This API is designed for internal use by the Fleet server project.
24
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/get-global-checkpoints.html | Elasticsearch API documentation}
25
+ */
26
+ globalCheckpoints(this: That, params: T.FleetGlobalCheckpointsRequest | TB.FleetGlobalCheckpointsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FleetGlobalCheckpointsResponse>;
27
+ globalCheckpoints(this: That, params: T.FleetGlobalCheckpointsRequest | TB.FleetGlobalCheckpointsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FleetGlobalCheckpointsResponse, unknown>>;
28
+ globalCheckpoints(this: That, params: T.FleetGlobalCheckpointsRequest | TB.FleetGlobalCheckpointsRequest, options?: TransportRequestOptions): Promise<T.FleetGlobalCheckpointsResponse>;
29
+ /**
30
+ * Executes several fleet searches with a single API request. The API follows the same structure as the multi search (`_msearch`) API. However, similar to the fleet search API, it supports the `wait_for_checkpoints` parameter.
31
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/fleet-multi-search.html | Elasticsearch API documentation}
32
+ */
33
+ msearch<TDocument = unknown>(this: That, params: T.FleetMsearchRequest | TB.FleetMsearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FleetMsearchResponse<TDocument>>;
34
+ msearch<TDocument = unknown>(this: That, params: T.FleetMsearchRequest | TB.FleetMsearchRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FleetMsearchResponse<TDocument>, unknown>>;
35
+ msearch<TDocument = unknown>(this: That, params: T.FleetMsearchRequest | TB.FleetMsearchRequest, options?: TransportRequestOptions): Promise<T.FleetMsearchResponse<TDocument>>;
36
+ /**
37
+ * Creates a secret stored by Fleet.
38
+ */
39
+ postSecret(this: That, params: T.FleetPostSecretRequest | TB.FleetPostSecretRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FleetPostSecretResponse>;
40
+ postSecret(this: That, params: T.FleetPostSecretRequest | TB.FleetPostSecretRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FleetPostSecretResponse, unknown>>;
41
+ postSecret(this: That, params: T.FleetPostSecretRequest | TB.FleetPostSecretRequest, options?: TransportRequestOptions): Promise<T.FleetPostSecretResponse>;
42
+ /**
43
+ * The purpose of the fleet search api is to provide a search api where the search will only be executed after provided checkpoint has been processed and is visible for searches inside of Elasticsearch.
44
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/fleet-search.html | Elasticsearch API documentation}
45
+ */
46
+ search<TDocument = unknown>(this: That, params: T.FleetSearchRequest | TB.FleetSearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FleetSearchResponse<TDocument>>;
47
+ search<TDocument = unknown>(this: That, params: T.FleetSearchRequest | TB.FleetSearchRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FleetSearchResponse<TDocument>, unknown>>;
48
+ search<TDocument = unknown>(this: That, params: T.FleetSearchRequest | TB.FleetSearchRequest, options?: TransportRequestOptions): Promise<T.FleetSearchResponse<TDocument>>;
49
+ }
50
+ export {};
@@ -0,0 +1,211 @@
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 Fleet {
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 deleteSecret(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 = `/_fleet/secret/${encodeURIComponent(params.id.toString())}`;
46
+ const meta = {
47
+ name: 'fleet.delete_secret',
48
+ pathParts: {
49
+ id: params.id
50
+ }
51
+ };
52
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
53
+ }
54
+ async getSecret(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 = `/_fleet/secret/${encodeURIComponent(params.id.toString())}`;
69
+ const meta = {
70
+ name: 'fleet.get_secret',
71
+ pathParts: {
72
+ id: params.id
73
+ }
74
+ };
75
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
76
+ }
77
+ async globalCheckpoints(params, options) {
78
+ const acceptedPath = ['index'];
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 = `/${encodeURIComponent(params.index.toString())}/_fleet/global_checkpoints`;
92
+ const meta = {
93
+ name: 'fleet.global_checkpoints',
94
+ pathParts: {
95
+ index: params.index
96
+ }
97
+ };
98
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
99
+ }
100
+ async msearch(params, options) {
101
+ var _a;
102
+ const acceptedPath = ['index'];
103
+ const acceptedBody = ['searches'];
104
+ const querystring = {};
105
+ // @ts-expect-error
106
+ let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
107
+ for (const key in params) {
108
+ if (acceptedBody.includes(key)) {
109
+ // @ts-expect-error
110
+ body = params[key];
111
+ }
112
+ else if (acceptedPath.includes(key)) {
113
+ continue;
114
+ }
115
+ else if (key !== 'body') {
116
+ // @ts-expect-error
117
+ querystring[key] = params[key];
118
+ }
119
+ }
120
+ let method = '';
121
+ let path = '';
122
+ if (params.index != null) {
123
+ method = body != null ? 'POST' : 'GET';
124
+ path = `/${encodeURIComponent(params.index.toString())}/_fleet/_fleet_msearch`;
125
+ }
126
+ else {
127
+ method = body != null ? 'POST' : 'GET';
128
+ path = '/_fleet/_fleet_msearch';
129
+ }
130
+ const meta = {
131
+ name: 'fleet.msearch',
132
+ pathParts: {
133
+ index: params.index
134
+ }
135
+ };
136
+ return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options);
137
+ }
138
+ async postSecret(params, options) {
139
+ const acceptedPath = [];
140
+ const acceptedBody = ['value'];
141
+ const querystring = {};
142
+ // @ts-expect-error
143
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
144
+ let body;
145
+ if (typeof userBody === 'string') {
146
+ body = userBody;
147
+ }
148
+ else {
149
+ body = userBody != null ? { ...userBody } : undefined;
150
+ }
151
+ for (const key in params) {
152
+ if (acceptedBody.includes(key)) {
153
+ body = body !== null && body !== void 0 ? body : {};
154
+ // @ts-expect-error
155
+ body[key] = params[key];
156
+ }
157
+ else if (acceptedPath.includes(key)) {
158
+ continue;
159
+ }
160
+ else if (key !== 'body') {
161
+ // @ts-expect-error
162
+ querystring[key] = params[key];
163
+ }
164
+ }
165
+ const method = 'POST';
166
+ const path = '/_fleet/secret';
167
+ const meta = {
168
+ name: 'fleet.post_secret'
169
+ };
170
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
171
+ }
172
+ async search(params, options) {
173
+ const acceptedPath = ['index'];
174
+ const acceptedBody = ['aggregations', 'aggs', 'collapse', 'explain', 'ext', 'from', 'highlight', 'track_total_hits', 'indices_boost', 'docvalue_fields', 'min_score', 'post_filter', 'profile', 'query', 'rescore', 'script_fields', 'search_after', 'size', 'slice', 'sort', '_source', 'fields', 'suggest', 'terminate_after', 'timeout', 'track_scores', 'version', 'seq_no_primary_term', 'stored_fields', 'pit', 'runtime_mappings', 'stats'];
175
+ const querystring = {};
176
+ // @ts-expect-error
177
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
178
+ let body;
179
+ if (typeof userBody === 'string') {
180
+ body = userBody;
181
+ }
182
+ else {
183
+ body = userBody != null ? { ...userBody } : undefined;
184
+ }
185
+ for (const key in params) {
186
+ if (acceptedBody.includes(key)) {
187
+ body = body !== null && body !== void 0 ? body : {};
188
+ // @ts-expect-error
189
+ body[key] = params[key];
190
+ }
191
+ else if (acceptedPath.includes(key)) {
192
+ continue;
193
+ }
194
+ else if (key !== 'body') {
195
+ // @ts-expect-error
196
+ querystring[key] = params[key];
197
+ }
198
+ }
199
+ const method = body != null ? 'POST' : 'GET';
200
+ const path = `/${encodeURIComponent(params.index.toString())}/_fleet/_fleet_search`;
201
+ const meta = {
202
+ name: 'fleet.search',
203
+ pathParts: {
204
+ index: params.index
205
+ }
206
+ };
207
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
208
+ }
209
+ }
210
+ exports.default = Fleet;
211
+ //# sourceMappingURL=fleet.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
+ * Get a document by its ID. Get a document and its source or stored fields from an index. By default, this API is realtime and is not affected by the refresh rate of the index (when data will become visible for search). In the case where stored fields are requested with the `stored_fields` parameter and the document has been updated but is not yet refreshed, the API will have to parse and analyze the source to extract the stored fields. To turn off realtime behavior, set the `realtime` parameter to false. **Source filtering** By default, the API returns the contents of the `_source` field unless you have used the `stored_fields` parameter or the `_source` field is turned off. You can turn off `_source` retrieval by using the `_source` parameter: ``` GET my-index-000001/_doc/0?_source=false ``` If you only need one or two fields from the `_source`, use the `_source_includes` or `_source_excludes` parameters to include or filter out particular fields. This can be helpful with large documents where partial retrieval can save on network overhead Both parameters take a comma separated list of fields or wildcard expressions. For example: ``` GET my-index-000001/_doc/0?_source_includes=*.id&_source_excludes=entities ``` If you only want to specify includes, you can use a shorter notation: ``` GET my-index-000001/_doc/0?_source=*.id ``` **Routing** If routing is used during indexing, the routing value also needs to be specified to retrieve a document. For example: ``` GET my-index-000001/_doc/2?routing=user1 ``` This request gets the document with ID 2, but it is routed based on the user. The document is not fetched if the correct routing is not specified. **Distributed** The GET operation is hashed into a specific shard ID. It is then redirected to one of the replicas within that shard ID and returns the result. The replicas are the primary shard and its replicas within that shard ID group. This means that the more replicas you have, the better your GET scaling will be. **Versioning support** You can use the `version` parameter to retrieve 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 GetApi<TDocument = unknown>(this: That, params: T.GetRequest | TB.GetRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.GetResponse<TDocument>>;
12
+ export default function GetApi<TDocument = unknown>(this: That, params: T.GetRequest | TB.GetRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.GetResponse<TDocument>, unknown>>;
13
+ export default function GetApi<TDocument = unknown>(this: That, params: T.GetRequest | TB.GetRequest, options?: TransportRequestOptions): Promise<T.GetResponse<TDocument>>;
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 = GetApi;
22
+ async function GetApi(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 = 'GET';
36
+ const path = `/${encodeURIComponent(params.index.toString())}/_doc/${encodeURIComponent(params.id.toString())}`;
37
+ const meta = {
38
+ name: 'get',
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=get.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
+ * Get a script or search template. Retrieves a stored script or search template.
9
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/get-stored-script-api.html | Elasticsearch API documentation}
10
+ */
11
+ export default function GetScriptApi(this: That, params: T.GetScriptRequest | TB.GetScriptRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.GetScriptResponse>;
12
+ export default function GetScriptApi(this: That, params: T.GetScriptRequest | TB.GetScriptRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.GetScriptResponse, unknown>>;
13
+ export default function GetScriptApi(this: That, params: T.GetScriptRequest | TB.GetScriptRequest, options?: TransportRequestOptions): Promise<T.GetScriptResponse>;
14
+ export {};