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,148 @@
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 TextStructure {
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 findFieldStructure(params, options) {
32
+ const acceptedPath = [];
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 = 'GET';
45
+ const path = '/_text_structure/find_field_structure';
46
+ const meta = {
47
+ name: 'text_structure.find_field_structure'
48
+ };
49
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
50
+ }
51
+ async findMessageStructure(params, options) {
52
+ const acceptedPath = [];
53
+ const acceptedBody = ['messages'];
54
+ const querystring = {};
55
+ // @ts-expect-error
56
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
57
+ let body;
58
+ if (typeof userBody === 'string') {
59
+ body = userBody;
60
+ }
61
+ else {
62
+ body = userBody != null ? { ...userBody } : undefined;
63
+ }
64
+ for (const key in params) {
65
+ if (acceptedBody.includes(key)) {
66
+ body = body !== null && body !== void 0 ? body : {};
67
+ // @ts-expect-error
68
+ body[key] = params[key];
69
+ }
70
+ else if (acceptedPath.includes(key)) {
71
+ continue;
72
+ }
73
+ else if (key !== 'body') {
74
+ // @ts-expect-error
75
+ querystring[key] = params[key];
76
+ }
77
+ }
78
+ const method = body != null ? 'POST' : 'GET';
79
+ const path = '/_text_structure/find_message_structure';
80
+ const meta = {
81
+ name: 'text_structure.find_message_structure'
82
+ };
83
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
84
+ }
85
+ async findStructure(params, options) {
86
+ var _a;
87
+ const acceptedPath = [];
88
+ const acceptedBody = ['text_files'];
89
+ const querystring = {};
90
+ // @ts-expect-error
91
+ let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
92
+ for (const key in params) {
93
+ if (acceptedBody.includes(key)) {
94
+ // @ts-expect-error
95
+ body = params[key];
96
+ }
97
+ else if (acceptedPath.includes(key)) {
98
+ continue;
99
+ }
100
+ else if (key !== 'body') {
101
+ // @ts-expect-error
102
+ querystring[key] = params[key];
103
+ }
104
+ }
105
+ const method = 'POST';
106
+ const path = '/_text_structure/find_structure';
107
+ const meta = {
108
+ name: 'text_structure.find_structure'
109
+ };
110
+ return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options);
111
+ }
112
+ async testGrokPattern(params, options) {
113
+ const acceptedPath = [];
114
+ const acceptedBody = ['grok_pattern', 'text'];
115
+ const querystring = {};
116
+ // @ts-expect-error
117
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
118
+ let body;
119
+ if (typeof userBody === 'string') {
120
+ body = userBody;
121
+ }
122
+ else {
123
+ body = userBody != null ? { ...userBody } : undefined;
124
+ }
125
+ for (const key in params) {
126
+ if (acceptedBody.includes(key)) {
127
+ body = body !== null && body !== void 0 ? body : {};
128
+ // @ts-expect-error
129
+ body[key] = params[key];
130
+ }
131
+ else if (acceptedPath.includes(key)) {
132
+ continue;
133
+ }
134
+ else if (key !== 'body') {
135
+ // @ts-expect-error
136
+ querystring[key] = params[key];
137
+ }
138
+ }
139
+ const method = body != null ? 'POST' : 'GET';
140
+ const path = '/_text_structure/test_grok_pattern';
141
+ const meta = {
142
+ name: 'text_structure.test_grok_pattern'
143
+ };
144
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
145
+ }
146
+ }
147
+ exports.default = TextStructure;
148
+ //# sourceMappingURL=text_structure.js.map
@@ -0,0 +1,101 @@
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 Transform {
8
+ transport: Transport;
9
+ constructor(transport: Transport);
10
+ /**
11
+ * Delete a transform.
12
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/delete-transform.html | Elasticsearch API documentation}
13
+ */
14
+ deleteTransform(this: That, params: T.TransformDeleteTransformRequest | TB.TransformDeleteTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformDeleteTransformResponse>;
15
+ deleteTransform(this: That, params: T.TransformDeleteTransformRequest | TB.TransformDeleteTransformRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformDeleteTransformResponse, unknown>>;
16
+ deleteTransform(this: That, params: T.TransformDeleteTransformRequest | TB.TransformDeleteTransformRequest, options?: TransportRequestOptions): Promise<T.TransformDeleteTransformResponse>;
17
+ /**
18
+ * Get node stats. Get per-node information about transform usage.
19
+ */
20
+ getNodeStats(this: That, params?: T.TransformGetNodeStatsRequest | TB.TransformGetNodeStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformGetNodeStatsResponse>;
21
+ getNodeStats(this: That, params?: T.TransformGetNodeStatsRequest | TB.TransformGetNodeStatsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformGetNodeStatsResponse, unknown>>;
22
+ getNodeStats(this: That, params?: T.TransformGetNodeStatsRequest | TB.TransformGetNodeStatsRequest, options?: TransportRequestOptions): Promise<T.TransformGetNodeStatsResponse>;
23
+ /**
24
+ * Get transforms. Get configuration information for transforms.
25
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/get-transform.html | Elasticsearch API documentation}
26
+ */
27
+ getTransform(this: That, params?: T.TransformGetTransformRequest | TB.TransformGetTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformGetTransformResponse>;
28
+ getTransform(this: That, params?: T.TransformGetTransformRequest | TB.TransformGetTransformRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformGetTransformResponse, unknown>>;
29
+ getTransform(this: That, params?: T.TransformGetTransformRequest | TB.TransformGetTransformRequest, options?: TransportRequestOptions): Promise<T.TransformGetTransformResponse>;
30
+ /**
31
+ * Get transform stats. Get usage information for transforms.
32
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/get-transform-stats.html | Elasticsearch API documentation}
33
+ */
34
+ getTransformStats(this: That, params: T.TransformGetTransformStatsRequest | TB.TransformGetTransformStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformGetTransformStatsResponse>;
35
+ getTransformStats(this: That, params: T.TransformGetTransformStatsRequest | TB.TransformGetTransformStatsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformGetTransformStatsResponse, unknown>>;
36
+ getTransformStats(this: That, params: T.TransformGetTransformStatsRequest | TB.TransformGetTransformStatsRequest, options?: TransportRequestOptions): Promise<T.TransformGetTransformStatsResponse>;
37
+ /**
38
+ * Preview a transform. Generates a preview of the results that you will get when you create a transform with the same configuration. It returns a maximum of 100 results. The calculations are based on all the current data in the source index. It also generates a list of mappings and settings for the destination index. These values are determined based on the field types of the source index and the transform aggregations.
39
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/preview-transform.html | Elasticsearch API documentation}
40
+ */
41
+ previewTransform<TTransform = unknown>(this: That, params?: T.TransformPreviewTransformRequest | TB.TransformPreviewTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformPreviewTransformResponse<TTransform>>;
42
+ previewTransform<TTransform = unknown>(this: That, params?: T.TransformPreviewTransformRequest | TB.TransformPreviewTransformRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformPreviewTransformResponse<TTransform>, unknown>>;
43
+ previewTransform<TTransform = unknown>(this: That, params?: T.TransformPreviewTransformRequest | TB.TransformPreviewTransformRequest, options?: TransportRequestOptions): Promise<T.TransformPreviewTransformResponse<TTransform>>;
44
+ /**
45
+ * Create a transform. Creates a transform. A transform copies data from source indices, transforms it, and persists it into an entity-centric destination index. You can also think of the destination index as a two-dimensional tabular data structure (known as a data frame). The ID for each document in the data frame is generated from a hash of the entity, so there is a unique row per entity. You must choose either the latest or pivot method for your transform; you cannot use both in a single transform. If you choose to use the pivot method for your transform, the entities are defined by the set of `group_by` fields in the pivot object. If you choose to use the latest method, the entities are defined by the `unique_key` field values in the latest object. You must have `create_index`, `index`, and `read` privileges on the destination index and `read` and `view_index_metadata` privileges on the source indices. When Elasticsearch security features are enabled, the transform remembers which roles the user that created it had at the time of creation and uses those same roles. If those roles do not have the required privileges on the source and destination indices, the transform fails when it attempts unauthorized operations. NOTE: You must use Kibana or this API to create a transform. Do not add a transform directly into any `.transform-internal*` indices using the Elasticsearch index API. If Elasticsearch security features are enabled, do not give users any privileges on `.transform-internal*` indices. If you used transforms prior to 7.5, also do not give users any privileges on `.data-frame-internal*` indices.
46
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/put-transform.html | Elasticsearch API documentation}
47
+ */
48
+ putTransform(this: That, params: T.TransformPutTransformRequest | TB.TransformPutTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformPutTransformResponse>;
49
+ putTransform(this: That, params: T.TransformPutTransformRequest | TB.TransformPutTransformRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformPutTransformResponse, unknown>>;
50
+ putTransform(this: That, params: T.TransformPutTransformRequest | TB.TransformPutTransformRequest, options?: TransportRequestOptions): Promise<T.TransformPutTransformResponse>;
51
+ /**
52
+ * Reset a transform. Before you can reset it, you must stop it; alternatively, use the `force` query parameter. If the destination index was created by the transform, it is deleted.
53
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/reset-transform.html | Elasticsearch API documentation}
54
+ */
55
+ resetTransform(this: That, params: T.TransformResetTransformRequest | TB.TransformResetTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformResetTransformResponse>;
56
+ resetTransform(this: That, params: T.TransformResetTransformRequest | TB.TransformResetTransformRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformResetTransformResponse, unknown>>;
57
+ resetTransform(this: That, params: T.TransformResetTransformRequest | TB.TransformResetTransformRequest, options?: TransportRequestOptions): Promise<T.TransformResetTransformResponse>;
58
+ /**
59
+ * Schedule a transform to start now. Instantly run a transform to process data. If you run this API, the transform will process the new data instantly, without waiting for the configured frequency interval. After the API is called, the transform will be processed again at `now + frequency` unless the API is called again in the meantime.
60
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/schedule-now-transform.html | Elasticsearch API documentation}
61
+ */
62
+ scheduleNowTransform(this: That, params: T.TransformScheduleNowTransformRequest | TB.TransformScheduleNowTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformScheduleNowTransformResponse>;
63
+ scheduleNowTransform(this: That, params: T.TransformScheduleNowTransformRequest | TB.TransformScheduleNowTransformRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformScheduleNowTransformResponse, unknown>>;
64
+ scheduleNowTransform(this: That, params: T.TransformScheduleNowTransformRequest | TB.TransformScheduleNowTransformRequest, options?: TransportRequestOptions): Promise<T.TransformScheduleNowTransformResponse>;
65
+ /**
66
+ * Set upgrade_mode for transform indices. Sets a cluster wide upgrade_mode setting that prepares transform indices for an upgrade. When upgrading your cluster, in some circumstances you must restart your nodes and reindex your transform indices. In those circumstances, there must be no transforms running. You can close the transforms, do the upgrade, then open all the transforms again. Alternatively, you can use this API to temporarily halt tasks associated with the transforms and prevent new transforms from opening. You can also use this API during upgrades that do not require you to reindex your transform indices, though stopping transforms is not a requirement in that case. You can see the current value for the upgrade_mode setting by using the get transform info API.
67
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-set-upgrade-mode | Elasticsearch API documentation}
68
+ */
69
+ setUpgradeMode(this: That, params?: T.TransformSetUpgradeModeRequest | TB.TransformSetUpgradeModeRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformSetUpgradeModeResponse>;
70
+ setUpgradeMode(this: That, params?: T.TransformSetUpgradeModeRequest | TB.TransformSetUpgradeModeRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformSetUpgradeModeResponse, unknown>>;
71
+ setUpgradeMode(this: That, params?: T.TransformSetUpgradeModeRequest | TB.TransformSetUpgradeModeRequest, options?: TransportRequestOptions): Promise<T.TransformSetUpgradeModeResponse>;
72
+ /**
73
+ * Start a transform. When you start a transform, it creates the destination index if it does not already exist. The `number_of_shards` is set to `1` and the `auto_expand_replicas` is set to `0-1`. If it is a pivot transform, it deduces the mapping definitions for the destination index from the source indices and the transform aggregations. If fields in the destination index are derived from scripts (as in the case of `scripted_metric` or `bucket_script` aggregations), the transform uses dynamic mappings unless an index template exists. If it is a latest transform, it does not deduce mapping definitions; it uses dynamic mappings. To use explicit mappings, create the destination index before you start the transform. Alternatively, you can create an index template, though it does not affect the deduced mappings in a pivot transform. When the transform starts, a series of validations occur to ensure its success. If you deferred validation when you created the transform, they occur when you start the transform—with the exception of privilege checks. When Elasticsearch security features are enabled, the transform remembers which roles the user that created it had at the time of creation and uses those same roles. If those roles do not have the required privileges on the source and destination indices, the transform fails when it attempts unauthorized operations.
74
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/start-transform.html | Elasticsearch API documentation}
75
+ */
76
+ startTransform(this: That, params: T.TransformStartTransformRequest | TB.TransformStartTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformStartTransformResponse>;
77
+ startTransform(this: That, params: T.TransformStartTransformRequest | TB.TransformStartTransformRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformStartTransformResponse, unknown>>;
78
+ startTransform(this: That, params: T.TransformStartTransformRequest | TB.TransformStartTransformRequest, options?: TransportRequestOptions): Promise<T.TransformStartTransformResponse>;
79
+ /**
80
+ * Stop transforms. Stops one or more transforms.
81
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/stop-transform.html | Elasticsearch API documentation}
82
+ */
83
+ stopTransform(this: That, params: T.TransformStopTransformRequest | TB.TransformStopTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformStopTransformResponse>;
84
+ stopTransform(this: That, params: T.TransformStopTransformRequest | TB.TransformStopTransformRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformStopTransformResponse, unknown>>;
85
+ stopTransform(this: That, params: T.TransformStopTransformRequest | TB.TransformStopTransformRequest, options?: TransportRequestOptions): Promise<T.TransformStopTransformResponse>;
86
+ /**
87
+ * Update a transform. Updates certain properties of a transform. All updated properties except `description` do not take effect until after the transform starts the next checkpoint, thus there is data consistency in each checkpoint. To use this API, you must have `read` and `view_index_metadata` privileges for the source indices. You must also have `index` and `read` privileges for the destination index. When Elasticsearch security features are enabled, the transform remembers which roles the user who updated it had at the time of update and runs with those privileges.
88
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v8/operation/operation-transform-update-transform | Elasticsearch API documentation}
89
+ */
90
+ updateTransform(this: That, params: T.TransformUpdateTransformRequest | TB.TransformUpdateTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformUpdateTransformResponse>;
91
+ updateTransform(this: That, params: T.TransformUpdateTransformRequest | TB.TransformUpdateTransformRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformUpdateTransformResponse, unknown>>;
92
+ updateTransform(this: That, params: T.TransformUpdateTransformRequest | TB.TransformUpdateTransformRequest, options?: TransportRequestOptions): Promise<T.TransformUpdateTransformResponse>;
93
+ /**
94
+ * Upgrade all transforms. Transforms are compatible across minor versions and between supported major versions. However, over time, the format of transform configuration information may change. This API identifies transforms that have a legacy configuration format and upgrades them to the latest version. It also cleans up the internal data structures that store the transform state and checkpoints. The upgrade does not affect the source and destination indices. The upgrade also does not affect the roles that transforms use when Elasticsearch security features are enabled; the role used to read source data and write to the destination index remains unchanged. If a transform upgrade step fails, the upgrade stops and an error is returned about the underlying issue. Resolve the issue then re-run the process again. A summary is returned when the upgrade is finished. To ensure continuous transforms remain running during a major version upgrade of the cluster – for example, from 7.16 to 8.0 – it is recommended to upgrade transforms before upgrading the cluster. You may want to perform a recent cluster backup prior to the upgrade.
95
+ * @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/v8/operation/operation-transform-upgrade-transforms | Elasticsearch API documentation}
96
+ */
97
+ upgradeTransforms(this: That, params?: T.TransformUpgradeTransformsRequest | TB.TransformUpgradeTransformsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformUpgradeTransformsResponse>;
98
+ upgradeTransforms(this: That, params?: T.TransformUpgradeTransformsRequest | TB.TransformUpgradeTransformsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformUpgradeTransformsResponse, unknown>>;
99
+ upgradeTransforms(this: That, params?: T.TransformUpgradeTransformsRequest | TB.TransformUpgradeTransformsRequest, options?: TransportRequestOptions): Promise<T.TransformUpgradeTransformsResponse>;
100
+ }
101
+ export {};
@@ -0,0 +1,386 @@
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 Transform {
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 deleteTransform(params, options) {
32
+ const acceptedPath = ['transform_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 = `/_transform/${encodeURIComponent(params.transform_id.toString())}`;
46
+ const meta = {
47
+ name: 'transform.delete_transform',
48
+ pathParts: {
49
+ transform_id: params.transform_id
50
+ }
51
+ };
52
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
53
+ }
54
+ async getNodeStats(params, options) {
55
+ const acceptedPath = [];
56
+ const querystring = {};
57
+ const body = undefined;
58
+ params = params !== null && params !== void 0 ? params : {};
59
+ for (const key in params) {
60
+ if (acceptedPath.includes(key)) {
61
+ continue;
62
+ }
63
+ else if (key !== 'body') {
64
+ // @ts-expect-error
65
+ querystring[key] = params[key];
66
+ }
67
+ }
68
+ const method = 'GET';
69
+ const path = '/_transform/_node_stats';
70
+ const meta = {
71
+ name: 'transform.get_node_stats'
72
+ };
73
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
74
+ }
75
+ async getTransform(params, options) {
76
+ const acceptedPath = ['transform_id'];
77
+ const querystring = {};
78
+ const body = undefined;
79
+ params = params !== null && params !== void 0 ? params : {};
80
+ for (const key in params) {
81
+ if (acceptedPath.includes(key)) {
82
+ continue;
83
+ }
84
+ else if (key !== 'body') {
85
+ // @ts-expect-error
86
+ querystring[key] = params[key];
87
+ }
88
+ }
89
+ let method = '';
90
+ let path = '';
91
+ if (params.transform_id != null) {
92
+ method = 'GET';
93
+ path = `/_transform/${encodeURIComponent(params.transform_id.toString())}`;
94
+ }
95
+ else {
96
+ method = 'GET';
97
+ path = '/_transform';
98
+ }
99
+ const meta = {
100
+ name: 'transform.get_transform',
101
+ pathParts: {
102
+ transform_id: params.transform_id
103
+ }
104
+ };
105
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
106
+ }
107
+ async getTransformStats(params, options) {
108
+ const acceptedPath = ['transform_id'];
109
+ const querystring = {};
110
+ const body = undefined;
111
+ for (const key in params) {
112
+ if (acceptedPath.includes(key)) {
113
+ continue;
114
+ }
115
+ else if (key !== 'body') {
116
+ // @ts-expect-error
117
+ querystring[key] = params[key];
118
+ }
119
+ }
120
+ const method = 'GET';
121
+ const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}/_stats`;
122
+ const meta = {
123
+ name: 'transform.get_transform_stats',
124
+ pathParts: {
125
+ transform_id: params.transform_id
126
+ }
127
+ };
128
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
129
+ }
130
+ async previewTransform(params, options) {
131
+ const acceptedPath = ['transform_id'];
132
+ const acceptedBody = ['dest', 'description', 'frequency', 'pivot', 'source', 'settings', 'sync', 'retention_policy', 'latest'];
133
+ const querystring = {};
134
+ // @ts-expect-error
135
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
136
+ let body;
137
+ if (typeof userBody === 'string') {
138
+ body = userBody;
139
+ }
140
+ else {
141
+ body = userBody != null ? { ...userBody } : undefined;
142
+ }
143
+ params = params !== null && params !== void 0 ? params : {};
144
+ for (const key in params) {
145
+ if (acceptedBody.includes(key)) {
146
+ body = body !== null && body !== void 0 ? body : {};
147
+ // @ts-expect-error
148
+ body[key] = params[key];
149
+ }
150
+ else if (acceptedPath.includes(key)) {
151
+ continue;
152
+ }
153
+ else if (key !== 'body') {
154
+ // @ts-expect-error
155
+ querystring[key] = params[key];
156
+ }
157
+ }
158
+ let method = '';
159
+ let path = '';
160
+ if (params.transform_id != null) {
161
+ method = body != null ? 'POST' : 'GET';
162
+ path = `/_transform/${encodeURIComponent(params.transform_id.toString())}/_preview`;
163
+ }
164
+ else {
165
+ method = body != null ? 'POST' : 'GET';
166
+ path = '/_transform/_preview';
167
+ }
168
+ const meta = {
169
+ name: 'transform.preview_transform',
170
+ pathParts: {
171
+ transform_id: params.transform_id
172
+ }
173
+ };
174
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
175
+ }
176
+ async putTransform(params, options) {
177
+ const acceptedPath = ['transform_id'];
178
+ const acceptedBody = ['dest', 'description', 'frequency', 'latest', '_meta', 'pivot', 'retention_policy', 'settings', 'source', 'sync'];
179
+ const querystring = {};
180
+ // @ts-expect-error
181
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
182
+ let body;
183
+ if (typeof userBody === 'string') {
184
+ body = userBody;
185
+ }
186
+ else {
187
+ body = userBody != null ? { ...userBody } : undefined;
188
+ }
189
+ for (const key in params) {
190
+ if (acceptedBody.includes(key)) {
191
+ body = body !== null && body !== void 0 ? body : {};
192
+ // @ts-expect-error
193
+ body[key] = params[key];
194
+ }
195
+ else if (acceptedPath.includes(key)) {
196
+ continue;
197
+ }
198
+ else if (key !== 'body') {
199
+ // @ts-expect-error
200
+ querystring[key] = params[key];
201
+ }
202
+ }
203
+ const method = 'PUT';
204
+ const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}`;
205
+ const meta = {
206
+ name: 'transform.put_transform',
207
+ pathParts: {
208
+ transform_id: params.transform_id
209
+ }
210
+ };
211
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
212
+ }
213
+ async resetTransform(params, options) {
214
+ const acceptedPath = ['transform_id'];
215
+ const querystring = {};
216
+ const body = undefined;
217
+ for (const key in params) {
218
+ if (acceptedPath.includes(key)) {
219
+ continue;
220
+ }
221
+ else if (key !== 'body') {
222
+ // @ts-expect-error
223
+ querystring[key] = params[key];
224
+ }
225
+ }
226
+ const method = 'POST';
227
+ const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}/_reset`;
228
+ const meta = {
229
+ name: 'transform.reset_transform',
230
+ pathParts: {
231
+ transform_id: params.transform_id
232
+ }
233
+ };
234
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
235
+ }
236
+ async scheduleNowTransform(params, options) {
237
+ const acceptedPath = ['transform_id'];
238
+ const querystring = {};
239
+ const body = undefined;
240
+ for (const key in params) {
241
+ if (acceptedPath.includes(key)) {
242
+ continue;
243
+ }
244
+ else if (key !== 'body') {
245
+ // @ts-expect-error
246
+ querystring[key] = params[key];
247
+ }
248
+ }
249
+ const method = 'POST';
250
+ const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}/_schedule_now`;
251
+ const meta = {
252
+ name: 'transform.schedule_now_transform',
253
+ pathParts: {
254
+ transform_id: params.transform_id
255
+ }
256
+ };
257
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
258
+ }
259
+ async setUpgradeMode(params, options) {
260
+ const acceptedPath = [];
261
+ const querystring = {};
262
+ const body = undefined;
263
+ params = params !== null && params !== void 0 ? params : {};
264
+ for (const key in params) {
265
+ if (acceptedPath.includes(key)) {
266
+ continue;
267
+ }
268
+ else if (key !== 'body') {
269
+ // @ts-expect-error
270
+ querystring[key] = params[key];
271
+ }
272
+ }
273
+ const method = 'POST';
274
+ const path = '/_transform/set_upgrade_mode';
275
+ const meta = {
276
+ name: 'transform.set_upgrade_mode'
277
+ };
278
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
279
+ }
280
+ async startTransform(params, options) {
281
+ const acceptedPath = ['transform_id'];
282
+ const querystring = {};
283
+ const body = undefined;
284
+ for (const key in params) {
285
+ if (acceptedPath.includes(key)) {
286
+ continue;
287
+ }
288
+ else if (key !== 'body') {
289
+ // @ts-expect-error
290
+ querystring[key] = params[key];
291
+ }
292
+ }
293
+ const method = 'POST';
294
+ const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}/_start`;
295
+ const meta = {
296
+ name: 'transform.start_transform',
297
+ pathParts: {
298
+ transform_id: params.transform_id
299
+ }
300
+ };
301
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
302
+ }
303
+ async stopTransform(params, options) {
304
+ const acceptedPath = ['transform_id'];
305
+ const querystring = {};
306
+ const body = undefined;
307
+ for (const key in params) {
308
+ if (acceptedPath.includes(key)) {
309
+ continue;
310
+ }
311
+ else if (key !== 'body') {
312
+ // @ts-expect-error
313
+ querystring[key] = params[key];
314
+ }
315
+ }
316
+ const method = 'POST';
317
+ const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}/_stop`;
318
+ const meta = {
319
+ name: 'transform.stop_transform',
320
+ pathParts: {
321
+ transform_id: params.transform_id
322
+ }
323
+ };
324
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
325
+ }
326
+ async updateTransform(params, options) {
327
+ const acceptedPath = ['transform_id'];
328
+ const acceptedBody = ['dest', 'description', 'frequency', '_meta', 'source', 'settings', 'sync', 'retention_policy'];
329
+ const querystring = {};
330
+ // @ts-expect-error
331
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
332
+ let body;
333
+ if (typeof userBody === 'string') {
334
+ body = userBody;
335
+ }
336
+ else {
337
+ body = userBody != null ? { ...userBody } : undefined;
338
+ }
339
+ for (const key in params) {
340
+ if (acceptedBody.includes(key)) {
341
+ body = body !== null && body !== void 0 ? body : {};
342
+ // @ts-expect-error
343
+ body[key] = params[key];
344
+ }
345
+ else 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 = 'POST';
354
+ const path = `/_transform/${encodeURIComponent(params.transform_id.toString())}/_update`;
355
+ const meta = {
356
+ name: 'transform.update_transform',
357
+ pathParts: {
358
+ transform_id: params.transform_id
359
+ }
360
+ };
361
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
362
+ }
363
+ async upgradeTransforms(params, options) {
364
+ const acceptedPath = [];
365
+ const querystring = {};
366
+ const body = undefined;
367
+ params = params !== null && params !== void 0 ? params : {};
368
+ for (const key in params) {
369
+ if (acceptedPath.includes(key)) {
370
+ continue;
371
+ }
372
+ else if (key !== 'body') {
373
+ // @ts-expect-error
374
+ querystring[key] = params[key];
375
+ }
376
+ }
377
+ const method = 'POST';
378
+ const path = '/_transform/_upgrade';
379
+ const meta = {
380
+ name: 'transform.upgrade_transforms'
381
+ };
382
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
383
+ }
384
+ }
385
+ exports.default = Transform;
386
+ //# sourceMappingURL=transform.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
+ * Update a document. Update a document by running a script or passing a partial document. If the Elasticsearch security features are enabled, you must have the `index` or `write` index privilege for the target index or index alias. The script can update, delete, or skip modifying the document. The API also supports passing a partial document, which is merged into the existing document. To fully replace an existing document, use the index API. This operation: * Gets the document (collocated with the shard) from the index. * Runs the specified script. * Indexes the result. The document must still be reindexed, but using this API removes some network roundtrips and reduces chances of version conflicts between the GET and the index operation. The `_source` field must be enabled to use this API. In addition to `_source`, you can access the following variables through the `ctx` map: `_index`, `_type`, `_id`, `_version`, `_routing`, and `_now` (the current timestamp).
9
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/docs-update.html | Elasticsearch API documentation}
10
+ */
11
+ export default function UpdateApi<TDocument = unknown, TPartialDocument = unknown, TDocumentR = unknown>(this: That, params: T.UpdateRequest<TDocument, TPartialDocument> | TB.UpdateRequest<TDocument, TPartialDocument>, options?: TransportRequestOptionsWithOutMeta): Promise<T.UpdateResponse<TDocumentR>>;
12
+ export default function UpdateApi<TDocument = unknown, TPartialDocument = unknown, TDocumentR = unknown>(this: That, params: T.UpdateRequest<TDocument, TPartialDocument> | TB.UpdateRequest<TDocument, TPartialDocument>, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.UpdateResponse<TDocumentR>, unknown>>;
13
+ export default function UpdateApi<TDocument = unknown, TPartialDocument = unknown, TDocumentR = unknown>(this: That, params: T.UpdateRequest<TDocument, TPartialDocument> | TB.UpdateRequest<TDocument, TPartialDocument>, options?: TransportRequestOptions): Promise<T.UpdateResponse<TDocumentR>>;
14
+ export {};