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,81 @@
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 SearchApplication {
8
+ transport: Transport;
9
+ constructor(transport: Transport);
10
+ /**
11
+ * Delete a search application. Remove a search application and its associated alias. Indices attached to the search application are not removed.
12
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/delete-search-application.html | Elasticsearch API documentation}
13
+ */
14
+ delete(this: That, params: T.SearchApplicationDeleteRequest | TB.SearchApplicationDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchApplicationDeleteResponse>;
15
+ delete(this: That, params: T.SearchApplicationDeleteRequest | TB.SearchApplicationDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchApplicationDeleteResponse, unknown>>;
16
+ delete(this: That, params: T.SearchApplicationDeleteRequest | TB.SearchApplicationDeleteRequest, options?: TransportRequestOptions): Promise<T.SearchApplicationDeleteResponse>;
17
+ /**
18
+ * Delete a behavioral analytics collection. The associated data stream is also deleted.
19
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/delete-analytics-collection.html | Elasticsearch API documentation}
20
+ */
21
+ deleteBehavioralAnalytics(this: That, params: T.SearchApplicationDeleteBehavioralAnalyticsRequest | TB.SearchApplicationDeleteBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchApplicationDeleteBehavioralAnalyticsResponse>;
22
+ deleteBehavioralAnalytics(this: That, params: T.SearchApplicationDeleteBehavioralAnalyticsRequest | TB.SearchApplicationDeleteBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchApplicationDeleteBehavioralAnalyticsResponse, unknown>>;
23
+ deleteBehavioralAnalytics(this: That, params: T.SearchApplicationDeleteBehavioralAnalyticsRequest | TB.SearchApplicationDeleteBehavioralAnalyticsRequest, options?: TransportRequestOptions): Promise<T.SearchApplicationDeleteBehavioralAnalyticsResponse>;
24
+ /**
25
+ * Get search application details.
26
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/get-search-application.html | Elasticsearch API documentation}
27
+ */
28
+ get(this: That, params: T.SearchApplicationGetRequest | TB.SearchApplicationGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchApplicationGetResponse>;
29
+ get(this: That, params: T.SearchApplicationGetRequest | TB.SearchApplicationGetRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchApplicationGetResponse, unknown>>;
30
+ get(this: That, params: T.SearchApplicationGetRequest | TB.SearchApplicationGetRequest, options?: TransportRequestOptions): Promise<T.SearchApplicationGetResponse>;
31
+ /**
32
+ * Get behavioral analytics collections.
33
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/list-analytics-collection.html | Elasticsearch API documentation}
34
+ */
35
+ getBehavioralAnalytics(this: That, params?: T.SearchApplicationGetBehavioralAnalyticsRequest | TB.SearchApplicationGetBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchApplicationGetBehavioralAnalyticsResponse>;
36
+ getBehavioralAnalytics(this: That, params?: T.SearchApplicationGetBehavioralAnalyticsRequest | TB.SearchApplicationGetBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchApplicationGetBehavioralAnalyticsResponse, unknown>>;
37
+ getBehavioralAnalytics(this: That, params?: T.SearchApplicationGetBehavioralAnalyticsRequest | TB.SearchApplicationGetBehavioralAnalyticsRequest, options?: TransportRequestOptions): Promise<T.SearchApplicationGetBehavioralAnalyticsResponse>;
38
+ /**
39
+ * Get search applications. Get information about search applications.
40
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/list-analytics-collection.html | Elasticsearch API documentation}
41
+ */
42
+ list(this: That, params?: T.SearchApplicationListRequest | TB.SearchApplicationListRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchApplicationListResponse>;
43
+ list(this: That, params?: T.SearchApplicationListRequest | TB.SearchApplicationListRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchApplicationListResponse, unknown>>;
44
+ list(this: That, params?: T.SearchApplicationListRequest | TB.SearchApplicationListRequest, options?: TransportRequestOptions): Promise<T.SearchApplicationListResponse>;
45
+ /**
46
+ * Create a behavioral analytics collection event.
47
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/post-analytics-collection-event.html | Elasticsearch API documentation}
48
+ */
49
+ postBehavioralAnalyticsEvent(this: That, params: T.SearchApplicationPostBehavioralAnalyticsEventRequest | TB.SearchApplicationPostBehavioralAnalyticsEventRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchApplicationPostBehavioralAnalyticsEventResponse>;
50
+ postBehavioralAnalyticsEvent(this: That, params: T.SearchApplicationPostBehavioralAnalyticsEventRequest | TB.SearchApplicationPostBehavioralAnalyticsEventRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchApplicationPostBehavioralAnalyticsEventResponse, unknown>>;
51
+ postBehavioralAnalyticsEvent(this: That, params: T.SearchApplicationPostBehavioralAnalyticsEventRequest | TB.SearchApplicationPostBehavioralAnalyticsEventRequest, options?: TransportRequestOptions): Promise<T.SearchApplicationPostBehavioralAnalyticsEventResponse>;
52
+ /**
53
+ * Create or update a search application.
54
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/put-search-application.html | Elasticsearch API documentation}
55
+ */
56
+ put(this: That, params: T.SearchApplicationPutRequest | TB.SearchApplicationPutRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchApplicationPutResponse>;
57
+ put(this: That, params: T.SearchApplicationPutRequest | TB.SearchApplicationPutRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchApplicationPutResponse, unknown>>;
58
+ put(this: That, params: T.SearchApplicationPutRequest | TB.SearchApplicationPutRequest, options?: TransportRequestOptions): Promise<T.SearchApplicationPutResponse>;
59
+ /**
60
+ * Create a behavioral analytics collection.
61
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/put-analytics-collection.html | Elasticsearch API documentation}
62
+ */
63
+ putBehavioralAnalytics(this: That, params: T.SearchApplicationPutBehavioralAnalyticsRequest | TB.SearchApplicationPutBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchApplicationPutBehavioralAnalyticsResponse>;
64
+ putBehavioralAnalytics(this: That, params: T.SearchApplicationPutBehavioralAnalyticsRequest | TB.SearchApplicationPutBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchApplicationPutBehavioralAnalyticsResponse, unknown>>;
65
+ putBehavioralAnalytics(this: That, params: T.SearchApplicationPutBehavioralAnalyticsRequest | TB.SearchApplicationPutBehavioralAnalyticsRequest, options?: TransportRequestOptions): Promise<T.SearchApplicationPutBehavioralAnalyticsResponse>;
66
+ /**
67
+ * Render a search application query. Generate an Elasticsearch query using the specified query parameters and the search template associated with the search application or a default template if none is specified. If a parameter used in the search template is not specified in `params`, the parameter's default value will be used. The API returns the specific Elasticsearch query that would be generated and run by calling the search application search API. You must have `read` privileges on the backing alias of the search application.
68
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/search-application-render-query.html | Elasticsearch API documentation}
69
+ */
70
+ renderQuery(this: That, params: T.SearchApplicationRenderQueryRequest | TB.SearchApplicationRenderQueryRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchApplicationRenderQueryResponse>;
71
+ renderQuery(this: That, params: T.SearchApplicationRenderQueryRequest | TB.SearchApplicationRenderQueryRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchApplicationRenderQueryResponse, unknown>>;
72
+ renderQuery(this: That, params: T.SearchApplicationRenderQueryRequest | TB.SearchApplicationRenderQueryRequest, options?: TransportRequestOptions): Promise<T.SearchApplicationRenderQueryResponse>;
73
+ /**
74
+ * Run a search application search. Generate and run an Elasticsearch query that uses the specified query parameteter and the search template associated with the search application or default template. Unspecified template parameters are assigned their default values if applicable.
75
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/search-application-search.html | Elasticsearch API documentation}
76
+ */
77
+ search<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>>(this: That, params: T.SearchApplicationSearchRequest | TB.SearchApplicationSearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchApplicationSearchResponse<TDocument, TAggregations>>;
78
+ search<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>>(this: That, params: T.SearchApplicationSearchRequest | TB.SearchApplicationSearchRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchApplicationSearchResponse<TDocument, TAggregations>, unknown>>;
79
+ search<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>>(this: That, params: T.SearchApplicationSearchRequest | TB.SearchApplicationSearchRequest, options?: TransportRequestOptions): Promise<T.SearchApplicationSearchResponse<TDocument, TAggregations>>;
80
+ }
81
+ export {};
@@ -0,0 +1,313 @@
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 SearchApplication {
22
+ constructor(transport) {
23
+ Object.defineProperty(this, "transport", {
24
+ enumerable: true,
25
+ configurable: true,
26
+ writable: true,
27
+ value: void 0
28
+ });
29
+ this.transport = transport;
30
+ }
31
+ async delete(params, options) {
32
+ const acceptedPath = ['name'];
33
+ const querystring = {};
34
+ const body = undefined;
35
+ for (const key in params) {
36
+ if (acceptedPath.includes(key)) {
37
+ continue;
38
+ }
39
+ else if (key !== 'body') {
40
+ // @ts-expect-error
41
+ querystring[key] = params[key];
42
+ }
43
+ }
44
+ const method = 'DELETE';
45
+ const path = `/_application/search_application/${encodeURIComponent(params.name.toString())}`;
46
+ const meta = {
47
+ name: 'search_application.delete',
48
+ pathParts: {
49
+ name: params.name
50
+ }
51
+ };
52
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
53
+ }
54
+ async deleteBehavioralAnalytics(params, options) {
55
+ const acceptedPath = ['name'];
56
+ const querystring = {};
57
+ const body = undefined;
58
+ for (const key in params) {
59
+ if (acceptedPath.includes(key)) {
60
+ continue;
61
+ }
62
+ else if (key !== 'body') {
63
+ // @ts-expect-error
64
+ querystring[key] = params[key];
65
+ }
66
+ }
67
+ const method = 'DELETE';
68
+ const path = `/_application/analytics/${encodeURIComponent(params.name.toString())}`;
69
+ const meta = {
70
+ name: 'search_application.delete_behavioral_analytics',
71
+ pathParts: {
72
+ name: params.name
73
+ }
74
+ };
75
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
76
+ }
77
+ async get(params, options) {
78
+ const acceptedPath = ['name'];
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 = `/_application/search_application/${encodeURIComponent(params.name.toString())}`;
92
+ const meta = {
93
+ name: 'search_application.get',
94
+ pathParts: {
95
+ name: params.name
96
+ }
97
+ };
98
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
99
+ }
100
+ async getBehavioralAnalytics(params, options) {
101
+ const acceptedPath = ['name'];
102
+ const querystring = {};
103
+ const body = undefined;
104
+ params = params !== null && params !== void 0 ? params : {};
105
+ for (const key in params) {
106
+ if (acceptedPath.includes(key)) {
107
+ continue;
108
+ }
109
+ else if (key !== 'body') {
110
+ // @ts-expect-error
111
+ querystring[key] = params[key];
112
+ }
113
+ }
114
+ let method = '';
115
+ let path = '';
116
+ if (params.name != null) {
117
+ method = 'GET';
118
+ path = `/_application/analytics/${encodeURIComponent(params.name.toString())}`;
119
+ }
120
+ else {
121
+ method = 'GET';
122
+ path = '/_application/analytics';
123
+ }
124
+ const meta = {
125
+ name: 'search_application.get_behavioral_analytics',
126
+ pathParts: {
127
+ name: params.name
128
+ }
129
+ };
130
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
131
+ }
132
+ async list(params, options) {
133
+ const acceptedPath = [];
134
+ const querystring = {};
135
+ const body = undefined;
136
+ params = params !== null && params !== void 0 ? params : {};
137
+ for (const key in params) {
138
+ if (acceptedPath.includes(key)) {
139
+ continue;
140
+ }
141
+ else if (key !== 'body') {
142
+ // @ts-expect-error
143
+ querystring[key] = params[key];
144
+ }
145
+ }
146
+ const method = 'GET';
147
+ const path = '/_application/search_application';
148
+ const meta = {
149
+ name: 'search_application.list'
150
+ };
151
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
152
+ }
153
+ async postBehavioralAnalyticsEvent(params, options) {
154
+ var _a;
155
+ const acceptedPath = ['collection_name', 'event_type'];
156
+ const acceptedBody = ['payload'];
157
+ const querystring = {};
158
+ // @ts-expect-error
159
+ let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
160
+ for (const key in params) {
161
+ if (acceptedBody.includes(key)) {
162
+ // @ts-expect-error
163
+ body = params[key];
164
+ }
165
+ else if (acceptedPath.includes(key)) {
166
+ continue;
167
+ }
168
+ else if (key !== 'body') {
169
+ // @ts-expect-error
170
+ querystring[key] = params[key];
171
+ }
172
+ }
173
+ const method = 'POST';
174
+ const path = `/_application/analytics/${encodeURIComponent(params.collection_name.toString())}/event/${encodeURIComponent(params.event_type.toString())}`;
175
+ const meta = {
176
+ name: 'search_application.post_behavioral_analytics_event',
177
+ pathParts: {
178
+ collection_name: params.collection_name,
179
+ event_type: params.event_type
180
+ }
181
+ };
182
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
183
+ }
184
+ async put(params, options) {
185
+ var _a;
186
+ const acceptedPath = ['name'];
187
+ const acceptedBody = ['search_application'];
188
+ const querystring = {};
189
+ // @ts-expect-error
190
+ let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
191
+ for (const key in params) {
192
+ if (acceptedBody.includes(key)) {
193
+ // @ts-expect-error
194
+ body = params[key];
195
+ }
196
+ else if (acceptedPath.includes(key)) {
197
+ continue;
198
+ }
199
+ else if (key !== 'body') {
200
+ // @ts-expect-error
201
+ querystring[key] = params[key];
202
+ }
203
+ }
204
+ const method = 'PUT';
205
+ const path = `/_application/search_application/${encodeURIComponent(params.name.toString())}`;
206
+ const meta = {
207
+ name: 'search_application.put',
208
+ pathParts: {
209
+ name: params.name
210
+ }
211
+ };
212
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
213
+ }
214
+ async putBehavioralAnalytics(params, options) {
215
+ const acceptedPath = ['name'];
216
+ const querystring = {};
217
+ const body = undefined;
218
+ for (const key in params) {
219
+ if (acceptedPath.includes(key)) {
220
+ continue;
221
+ }
222
+ else if (key !== 'body') {
223
+ // @ts-expect-error
224
+ querystring[key] = params[key];
225
+ }
226
+ }
227
+ const method = 'PUT';
228
+ const path = `/_application/analytics/${encodeURIComponent(params.name.toString())}`;
229
+ const meta = {
230
+ name: 'search_application.put_behavioral_analytics',
231
+ pathParts: {
232
+ name: params.name
233
+ }
234
+ };
235
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
236
+ }
237
+ async renderQuery(params, options) {
238
+ const acceptedPath = ['name'];
239
+ const acceptedBody = ['params'];
240
+ const querystring = {};
241
+ // @ts-expect-error
242
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
243
+ let body;
244
+ if (typeof userBody === 'string') {
245
+ body = userBody;
246
+ }
247
+ else {
248
+ body = userBody != null ? { ...userBody } : undefined;
249
+ }
250
+ for (const key in params) {
251
+ if (acceptedBody.includes(key)) {
252
+ body = body !== null && body !== void 0 ? body : {};
253
+ // @ts-expect-error
254
+ body[key] = params[key];
255
+ }
256
+ else if (acceptedPath.includes(key)) {
257
+ continue;
258
+ }
259
+ else if (key !== 'body') {
260
+ // @ts-expect-error
261
+ querystring[key] = params[key];
262
+ }
263
+ }
264
+ const method = 'POST';
265
+ const path = `/_application/search_application/${encodeURIComponent(params.name.toString())}/_render_query`;
266
+ const meta = {
267
+ name: 'search_application.render_query',
268
+ pathParts: {
269
+ name: params.name
270
+ }
271
+ };
272
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
273
+ }
274
+ async search(params, options) {
275
+ const acceptedPath = ['name'];
276
+ const acceptedBody = ['params'];
277
+ const querystring = {};
278
+ // @ts-expect-error
279
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
280
+ let body;
281
+ if (typeof userBody === 'string') {
282
+ body = userBody;
283
+ }
284
+ else {
285
+ body = userBody != null ? { ...userBody } : undefined;
286
+ }
287
+ for (const key in params) {
288
+ if (acceptedBody.includes(key)) {
289
+ body = body !== null && body !== void 0 ? body : {};
290
+ // @ts-expect-error
291
+ body[key] = params[key];
292
+ }
293
+ else if (acceptedPath.includes(key)) {
294
+ continue;
295
+ }
296
+ else if (key !== 'body') {
297
+ // @ts-expect-error
298
+ querystring[key] = params[key];
299
+ }
300
+ }
301
+ const method = body != null ? 'POST' : 'GET';
302
+ const path = `/_application/search_application/${encodeURIComponent(params.name.toString())}/_search`;
303
+ const meta = {
304
+ name: 'search_application.search',
305
+ pathParts: {
306
+ name: params.name
307
+ }
308
+ };
309
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
310
+ }
311
+ }
312
+ exports.default = SearchApplication;
313
+ //# sourceMappingURL=search_application.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
+ * Search a vector tile. Search a vector tile for geospatial values. Before using this API, you should be familiar with the Mapbox vector tile specification. The API returns results as a binary mapbox vector tile. Internally, Elasticsearch translates a vector tile search API request into a search containing: * A `geo_bounding_box` query on the `<field>`. The query uses the `<zoom>/<x>/<y>` tile as a bounding box. * A `geotile_grid` or `geohex_grid` aggregation on the `<field>`. The `grid_agg` parameter determines the aggregation type. The aggregation uses the `<zoom>/<x>/<y>` tile as a bounding box. * Optionally, a `geo_bounds` aggregation on the `<field>`. The search only includes this aggregation if the `exact_bounds` parameter is `true`. * If the optional parameter `with_labels` is `true`, the internal search will include a dynamic runtime field that calls the `getLabelPosition` function of the geometry doc value. This enables the generation of new point features containing suggested geometry labels, so that, for example, multi-polygons will have only one label. For example, Elasticsearch may translate a vector tile search API request with a `grid_agg` argument of `geotile` and an `exact_bounds` argument of `true` into the following search ``` GET my-index/_search { "size": 10000, "query": { "geo_bounding_box": { "my-geo-field": { "top_left": { "lat": -40.979898069620134, "lon": -45 }, "bottom_right": { "lat": -66.51326044311186, "lon": 0 } } } }, "aggregations": { "grid": { "geotile_grid": { "field": "my-geo-field", "precision": 11, "size": 65536, "bounds": { "top_left": { "lat": -40.979898069620134, "lon": -45 }, "bottom_right": { "lat": -66.51326044311186, "lon": 0 } } } }, "bounds": { "geo_bounds": { "field": "my-geo-field", "wrap_longitude": false } } } } ``` The API returns results as a binary Mapbox vector tile. Mapbox vector tiles are encoded as Google Protobufs (PBF). By default, the tile contains three layers: * A `hits` layer containing a feature for each `<field>` value matching the `geo_bounding_box` query. * An `aggs` layer containing a feature for each cell of the `geotile_grid` or `geohex_grid`. The layer only contains features for cells with matching data. * A meta layer containing: * A feature containing a bounding box. By default, this is the bounding box of the tile. * Value ranges for any sub-aggregations on the `geotile_grid` or `geohex_grid`. * Metadata for the search. The API only returns features that can display at its zoom level. For example, if a polygon feature has no area at its zoom level, the API omits it. The API returns errors as UTF-8 encoded JSON. IMPORTANT: You can specify several options for this API as either a query parameter or request body parameter. If you specify both parameters, the query parameter takes precedence. **Grid precision for geotile** For a `grid_agg` of `geotile`, you can use cells in the `aggs` layer as tiles for lower zoom levels. `grid_precision` represents the additional zoom levels available through these cells. The final precision is computed by as follows: `<zoom> + grid_precision`. For example, if `<zoom>` is 7 and `grid_precision` is 8, then the `geotile_grid` aggregation will use a precision of 15. The maximum final precision is 29. The `grid_precision` also determines the number of cells for the grid as follows: `(2^grid_precision) x (2^grid_precision)`. For example, a value of 8 divides the tile into a grid of 256 x 256 cells. The `aggs` layer only contains features for cells with matching data. **Grid precision for geohex** For a `grid_agg` of `geohex`, Elasticsearch uses `<zoom>` and `grid_precision` to calculate a final precision as follows: `<zoom> + grid_precision`. This precision determines the H3 resolution of the hexagonal cells produced by the `geohex` aggregation. The following table maps the H3 resolution for each precision. For example, if `<zoom>` is 3 and `grid_precision` is 3, the precision is 6. At a precision of 6, hexagonal cells have an H3 resolution of 2. If `<zoom>` is 3 and `grid_precision` is 4, the precision is 7. At a precision of 7, hexagonal cells have an H3 resolution of 3. | Precision | Unique tile bins | H3 resolution | Unique hex bins | Ratio | | --------- | ---------------- | ------------- | ----------------| ----- | | 1 | 4 | 0 | 122 | 30.5 | | 2 | 16 | 0 | 122 | 7.625 | | 3 | 64 | 1 | 842 | 13.15625 | | 4 | 256 | 1 | 842 | 3.2890625 | | 5 | 1024 | 2 | 5882 | 5.744140625 | | 6 | 4096 | 2 | 5882 | 1.436035156 | | 7 | 16384 | 3 | 41162 | 2.512329102 | | 8 | 65536 | 3 | 41162 | 0.6280822754 | | 9 | 262144 | 4 | 288122 | 1.099098206 | | 10 | 1048576 | 4 | 288122 | 0.2747745514 | | 11 | 4194304 | 5 | 2016842 | 0.4808526039 | | 12 | 16777216 | 6 | 14117882 | 0.8414913416 | | 13 | 67108864 | 6 | 14117882 | 0.2103728354 | | 14 | 268435456 | 7 | 98825162 | 0.3681524172 | | 15 | 1073741824 | 8 | 691776122 | 0.644266719 | | 16 | 4294967296 | 8 | 691776122 | 0.1610666797 | | 17 | 17179869184 | 9 | 4842432842 | 0.2818666889 | | 18 | 68719476736 | 10 | 33897029882 | 0.4932667053 | | 19 | 274877906944 | 11 | 237279209162 | 0.8632167343 | | 20 | 1099511627776 | 11 | 237279209162 | 0.2158041836 | | 21 | 4398046511104 | 12 | 1660954464122 | 0.3776573213 | | 22 | 17592186044416 | 13 | 11626681248842 | 0.6609003122 | | 23 | 70368744177664 | 13 | 11626681248842 | 0.165225078 | | 24 | 281474976710656 | 14 | 81386768741882 | 0.2891438866 | | 25 | 1125899906842620 | 15 | 569707381193162 | 0.5060018015 | | 26 | 4503599627370500 | 15 | 569707381193162 | 0.1265004504 | | 27 | 18014398509482000 | 15 | 569707381193162 | 0.03162511259 | | 28 | 72057594037927900 | 15 | 569707381193162 | 0.007906278149 | | 29 | 288230376151712000 | 15 | 569707381193162 | 0.001976569537 | Hexagonal cells don't align perfectly on a vector tile. Some cells may intersect more than one vector tile. To compute the H3 resolution for each precision, Elasticsearch compares the average density of hexagonal bins at each resolution with the average density of tile bins at each zoom level. Elasticsearch uses the H3 resolution that is closest to the corresponding geotile density.
9
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/search-vector-tile-api.html | Elasticsearch API documentation}
10
+ */
11
+ export default function SearchMvtApi(this: That, params: T.SearchMvtRequest | TB.SearchMvtRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchMvtResponse>;
12
+ export default function SearchMvtApi(this: That, params: T.SearchMvtRequest | TB.SearchMvtRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchMvtResponse, unknown>>;
13
+ export default function SearchMvtApi(this: That, params: T.SearchMvtRequest | TB.SearchMvtRequest, options?: TransportRequestOptions): Promise<T.SearchMvtResponse>;
14
+ export {};
@@ -0,0 +1,63 @@
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 = SearchMvtApi;
22
+ async function SearchMvtApi(params, options) {
23
+ const acceptedPath = ['index', 'field', 'zoom', 'x', 'y'];
24
+ const acceptedBody = ['aggs', 'buffer', 'exact_bounds', 'extent', 'fields', 'grid_agg', 'grid_precision', 'grid_type', 'query', 'runtime_mappings', 'size', 'sort', 'track_total_hits', 'with_labels'];
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())}/_mvt/${encodeURIComponent(params.field.toString())}/${encodeURIComponent(params.zoom.toString())}/${encodeURIComponent(params.x.toString())}/${encodeURIComponent(params.y.toString())}`;
51
+ const meta = {
52
+ name: 'search_mvt',
53
+ pathParts: {
54
+ index: params.index,
55
+ field: params.field,
56
+ zoom: params.zoom,
57
+ x: params.x,
58
+ y: params.y
59
+ }
60
+ };
61
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
62
+ }
63
+ //# sourceMappingURL=search_mvt.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 search shards. Get the indices and shards that a search request would be run against. This information can be useful for working out issues or planning optimizations with routing and shard preferences. When filtered aliases are used, the filter is returned as part of the `indices` section. If the Elasticsearch security features are enabled, you must have the `view_index_metadata` or `manage` index privilege for the target data stream, index, or alias.
9
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/search-shards.html | Elasticsearch API documentation}
10
+ */
11
+ export default function SearchShardsApi(this: That, params?: T.SearchShardsRequest | TB.SearchShardsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchShardsResponse>;
12
+ export default function SearchShardsApi(this: That, params?: T.SearchShardsRequest | TB.SearchShardsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchShardsResponse, unknown>>;
13
+ export default function SearchShardsApi(this: That, params?: T.SearchShardsRequest | TB.SearchShardsRequest, options?: TransportRequestOptions): Promise<T.SearchShardsResponse>;
14
+ export {};
@@ -0,0 +1,54 @@
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 = SearchShardsApi;
22
+ async function SearchShardsApi(params, options) {
23
+ const acceptedPath = ['index'];
24
+ const querystring = {};
25
+ const body = undefined;
26
+ params = params !== null && params !== void 0 ? params : {};
27
+ for (const key in params) {
28
+ if (acceptedPath.includes(key)) {
29
+ continue;
30
+ }
31
+ else if (key !== 'body') {
32
+ // @ts-expect-error
33
+ querystring[key] = params[key];
34
+ }
35
+ }
36
+ let method = '';
37
+ let path = '';
38
+ if (params.index != null) {
39
+ method = body != null ? 'POST' : 'GET';
40
+ path = `/${encodeURIComponent(params.index.toString())}/_search_shards`;
41
+ }
42
+ else {
43
+ method = body != null ? 'POST' : 'GET';
44
+ path = '/_search_shards';
45
+ }
46
+ const meta = {
47
+ name: 'search_shards',
48
+ pathParts: {
49
+ index: params.index
50
+ }
51
+ };
52
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
53
+ }
54
+ //# sourceMappingURL=search_shards.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
+ * Run a search with a search template.
9
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/search-template-api.html | Elasticsearch API documentation}
10
+ */
11
+ export default function SearchTemplateApi<TDocument = unknown>(this: That, params?: T.SearchTemplateRequest | TB.SearchTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchTemplateResponse<TDocument>>;
12
+ export default function SearchTemplateApi<TDocument = unknown>(this: That, params?: T.SearchTemplateRequest | TB.SearchTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchTemplateResponse<TDocument>, unknown>>;
13
+ export default function SearchTemplateApi<TDocument = unknown>(this: That, params?: T.SearchTemplateRequest | TB.SearchTemplateRequest, options?: TransportRequestOptions): Promise<T.SearchTemplateResponse<TDocument>>;
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 = SearchTemplateApi;
22
+ async function SearchTemplateApi(params, options) {
23
+ const acceptedPath = ['index'];
24
+ const acceptedBody = ['explain', 'id', 'params', 'profile', 'source'];
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())}/_search/template`;
55
+ }
56
+ else {
57
+ method = body != null ? 'POST' : 'GET';
58
+ path = '/_search/template';
59
+ }
60
+ const meta = {
61
+ name: 'search_template',
62
+ pathParts: {
63
+ index: params.index
64
+ }
65
+ };
66
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
67
+ }
68
+ //# sourceMappingURL=search_template.js.map