plugin-elastic-report 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. package/ai/skills/elastic-report/SKILLS.md +32 -0
  2. package/client-v2.d.ts +2 -0
  3. package/client-v2.js +1 -0
  4. package/client.d.ts +2 -0
  5. package/client.js +1 -0
  6. package/dist/client/index.js +10 -0
  7. package/dist/client-v2/851.488fdbf5bc5b6a36.js +10 -0
  8. package/dist/client-v2/index.js +10 -0
  9. package/dist/externalVersion.js +20 -0
  10. package/dist/index.js +48 -0
  11. package/dist/locale/en-US.json +99 -0
  12. package/dist/locale/vi-VN.json +99 -0
  13. package/dist/locale/zh-CN.json +99 -0
  14. package/dist/node_modules/@elastic/elasticsearch/.dockerignore +11 -0
  15. package/dist/node_modules/@elastic/elasticsearch/LICENSE +202 -0
  16. package/dist/node_modules/@elastic/elasticsearch/NOTICE.txt +2 -0
  17. package/dist/node_modules/@elastic/elasticsearch/catalog-info.yaml +50 -0
  18. package/dist/node_modules/@elastic/elasticsearch/codecov.yml +14 -0
  19. package/dist/node_modules/@elastic/elasticsearch/index.d.ts +28 -0
  20. package/dist/node_modules/@elastic/elasticsearch/index.js +85525 -0
  21. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/async_search.d.ts +39 -0
  22. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/async_search.js +155 -0
  23. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/autoscaling.d.ts +39 -0
  24. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/autoscaling.js +130 -0
  25. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/bulk.d.ts +14 -0
  26. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/bulk.js +60 -0
  27. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/capabilities.d.ts +14 -0
  28. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/capabilities.js +43 -0
  29. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/cat.d.ts +193 -0
  30. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/cat.js +766 -0
  31. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ccr.d.ts +102 -0
  32. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ccr.js +395 -0
  33. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/clear_scroll.d.ts +14 -0
  34. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/clear_scroll.js +60 -0
  35. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/close_point_in_time.d.ts +14 -0
  36. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/close_point_in_time.js +56 -0
  37. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/cluster.d.ts +123 -0
  38. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/cluster.js +482 -0
  39. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/connector.d.ts +245 -0
  40. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/connector.js +1121 -0
  41. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/count.d.ts +14 -0
  42. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/count.js +68 -0
  43. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/create.d.ts +14 -0
  44. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/create.js +53 -0
  45. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/dangling_indices.d.ts +32 -0
  46. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/dangling_indices.js +100 -0
  47. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete.d.ts +14 -0
  48. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete.js +46 -0
  49. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete_by_query.d.ts +14 -0
  50. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete_by_query.js +59 -0
  51. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete_by_query_rethrottle.d.ts +14 -0
  52. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete_by_query_rethrottle.js +45 -0
  53. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete_script.d.ts +14 -0
  54. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/delete_script.js +45 -0
  55. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/enrich.d.ts +46 -0
  56. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/enrich.js +169 -0
  57. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/eql.d.ts +39 -0
  58. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/eql.js +139 -0
  59. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/esql.d.ts +46 -0
  60. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/esql.js +170 -0
  61. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/exists.d.ts +14 -0
  62. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/exists.js +46 -0
  63. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/exists_source.d.ts +14 -0
  64. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/exists_source.js +46 -0
  65. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/explain.d.ts +14 -0
  66. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/explain.js +60 -0
  67. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/features.d.ts +25 -0
  68. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/features.js +75 -0
  69. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/field_caps.d.ts +14 -0
  70. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/field_caps.js +68 -0
  71. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/fleet.d.ts +50 -0
  72. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/fleet.js +211 -0
  73. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get.d.ts +14 -0
  74. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get.js +46 -0
  75. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_script.d.ts +14 -0
  76. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_script.js +45 -0
  77. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_script_context.d.ts +14 -0
  78. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_script_context.js +43 -0
  79. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_script_languages.d.ts +14 -0
  80. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_script_languages.js +43 -0
  81. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_source.d.ts +14 -0
  82. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/get_source.js +46 -0
  83. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/graph.d.ts +18 -0
  84. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/graph.js +70 -0
  85. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/health_report.d.ts +14 -0
  86. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/health_report.js +54 -0
  87. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ilm.d.ts +88 -0
  88. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ilm.js +329 -0
  89. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/index.d.ts +14 -0
  90. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/index.js +61 -0
  91. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/indices.d.ts +494 -0
  92. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/indices.js +2133 -0
  93. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/inference.d.ts +221 -0
  94. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/inference.js +1167 -0
  95. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/info.d.ts +14 -0
  96. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/info.js +43 -0
  97. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ingest.d.ts +95 -0
  98. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ingest.js +389 -0
  99. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/knn_search.d.ts +14 -0
  100. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/knn_search.js +59 -0
  101. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/license.d.ts +60 -0
  102. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/license.js +194 -0
  103. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/logstash.d.ts +32 -0
  104. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/logstash.js +118 -0
  105. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/mget.d.ts +14 -0
  106. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/mget.js +68 -0
  107. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/migration.d.ts +32 -0
  108. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/migration.js +107 -0
  109. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ml.d.ts +522 -0
  110. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ml.js +2468 -0
  111. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/monitoring.d.ts +18 -0
  112. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/monitoring.js +60 -0
  113. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/msearch.d.ts +14 -0
  114. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/msearch.js +60 -0
  115. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/msearch_template.d.ts +14 -0
  116. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/msearch_template.js +60 -0
  117. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/mtermvectors.d.ts +14 -0
  118. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/mtermvectors.js +68 -0
  119. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/nodes.d.ts +60 -0
  120. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/nodes.js +290 -0
  121. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/open_point_in_time.d.ts +14 -0
  122. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/open_point_in_time.js +59 -0
  123. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ping.d.ts +14 -0
  124. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ping.js +43 -0
  125. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/profiling.d.ts +39 -0
  126. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/profiling.js +135 -0
  127. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/put_script.d.ts +14 -0
  128. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/put_script.js +68 -0
  129. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/query_rules.d.ts +67 -0
  130. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/query_rules.js +260 -0
  131. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/rank_eval.d.ts +14 -0
  132. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/rank_eval.js +67 -0
  133. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/reindex.d.ts +14 -0
  134. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/reindex.js +56 -0
  135. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/reindex_rethrottle.d.ts +14 -0
  136. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/reindex_rethrottle.js +45 -0
  137. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/render_search_template.d.ts +14 -0
  138. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/render_search_template.js +68 -0
  139. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/rollup.d.ts +67 -0
  140. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/rollup.js +263 -0
  141. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/scripts_painless_execute.d.ts +14 -0
  142. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/scripts_painless_execute.js +57 -0
  143. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/scroll.d.ts +14 -0
  144. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/scroll.js +59 -0
  145. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search.d.ts +14 -0
  146. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search.js +75 -0
  147. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_application.d.ts +81 -0
  148. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_application.js +313 -0
  149. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_mvt.d.ts +14 -0
  150. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_mvt.js +63 -0
  151. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_shards.d.ts +14 -0
  152. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_shards.js +54 -0
  153. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_template.d.ts +14 -0
  154. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/search_template.js +68 -0
  155. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/searchable_snapshots.d.ts +39 -0
  156. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/searchable_snapshots.js +167 -0
  157. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/security.d.ts +459 -0
  158. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/security.js +1982 -0
  159. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/shutdown.d.ts +32 -0
  160. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/shutdown.js +125 -0
  161. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/simulate.d.ts +18 -0
  162. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/simulate.js +78 -0
  163. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/slm.d.ts +74 -0
  164. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/slm.js +253 -0
  165. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/snapshot.d.ts +102 -0
  166. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/snapshot.js +410 -0
  167. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/sql.d.ts +53 -0
  168. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/sql.js +205 -0
  169. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ssl.d.ts +18 -0
  170. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/ssl.js +54 -0
  171. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/streams.d.ts +32 -0
  172. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/streams.js +96 -0
  173. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/synonyms.d.ts +60 -0
  174. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/synonyms.js +223 -0
  175. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/tasks.d.ts +32 -0
  176. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/tasks.js +109 -0
  177. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/terms_enum.d.ts +14 -0
  178. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/terms_enum.js +59 -0
  179. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/termvectors.d.ts +14 -0
  180. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/termvectors.js +68 -0
  181. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/text_structure.d.ts +39 -0
  182. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/text_structure.js +148 -0
  183. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/transform.d.ts +101 -0
  184. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/transform.js +386 -0
  185. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/update.d.ts +14 -0
  186. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/update.js +60 -0
  187. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/update_by_query.d.ts +14 -0
  188. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/update_by_query.js +59 -0
  189. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/update_by_query_rethrottle.d.ts +14 -0
  190. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/update_by_query_rethrottle.js +45 -0
  191. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/watcher.d.ts +102 -0
  192. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/watcher.js +405 -0
  193. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/xpack.d.ts +25 -0
  194. package/dist/node_modules/@elastic/elasticsearch/lib/api/api/xpack.js +75 -0
  195. package/dist/node_modules/@elastic/elasticsearch/lib/api/index.d.ts +265 -0
  196. package/dist/node_modules/@elastic/elasticsearch/lib/api/index.js +632 -0
  197. package/dist/node_modules/@elastic/elasticsearch/lib/api/types.d.ts +19933 -0
  198. package/dist/node_modules/@elastic/elasticsearch/lib/api/types.js +21 -0
  199. package/dist/node_modules/@elastic/elasticsearch/lib/api/typesWithBodyKey.d.ts +20606 -0
  200. package/dist/node_modules/@elastic/elasticsearch/lib/api/typesWithBodyKey.js +21 -0
  201. package/dist/node_modules/@elastic/elasticsearch/lib/client.d.ts +152 -0
  202. package/dist/node_modules/@elastic/elasticsearch/lib/client.js +369 -0
  203. package/dist/node_modules/@elastic/elasticsearch/lib/helpers.d.ts +184 -0
  204. package/dist/node_modules/@elastic/elasticsearch/lib/helpers.js +889 -0
  205. package/dist/node_modules/@elastic/elasticsearch/lib/sniffingTransport.d.ts +4 -0
  206. package/dist/node_modules/@elastic/elasticsearch/lib/sniffingTransport.js +56 -0
  207. package/dist/node_modules/@elastic/elasticsearch/node_modules/.bin/arrow2csv +15 -0
  208. package/dist/node_modules/@elastic/elasticsearch/node_modules/.bin/arrow2csv.cmd +7 -0
  209. package/dist/node_modules/@elastic/elasticsearch/package.json +1 -0
  210. package/dist/node_modules/@elastic/elasticsearch/tsconfig.json +38 -0
  211. package/dist/server/acl-guard.js +107 -0
  212. package/dist/server/collections/es-report-data-views.js +79 -0
  213. package/dist/server/collections/es-reports.js +95 -0
  214. package/dist/server/index.js +58 -0
  215. package/dist/server/mcp/ElasticReportMcpServer.js +344 -0
  216. package/dist/server/mcp/ElasticReportToolCatalog.js +417 -0
  217. package/dist/server/plugin.js +395 -0
  218. package/dist/server/services/ElasticReportService.js +263 -0
  219. package/dist/server/services/ElasticsearchConnectionService.js +332 -0
  220. package/dist/server/services/ReportQueryCompiler.js +858 -0
  221. package/dist/shared/constants.js +81 -0
  222. package/dist/shared/types.js +24 -0
  223. package/package.json +61 -4
  224. package/server.d.ts +2 -0
  225. package/server.js +1 -0
  226. package/src/client/index.tsx +19 -0
  227. package/src/client-v2/__tests__/elastic-report.test.tsx +311 -0
  228. package/src/client-v2/api.ts +224 -0
  229. package/src/client-v2/components/ElasticBasicCharts.tsx +399 -0
  230. package/src/client-v2/components/ElasticReportBlock.tsx +160 -0
  231. package/src/client-v2/components/ElasticReportRenderer.tsx +707 -0
  232. package/src/client-v2/components/HighlightText.tsx +50 -0
  233. package/src/client-v2/components/ReportSelect.tsx +72 -0
  234. package/src/client-v2/index.tsx +14 -0
  235. package/src/client-v2/locale.ts +23 -0
  236. package/src/client-v2/models/ElasticReportBlockModel.tsx +85 -0
  237. package/src/client-v2/pages/ElasticReportManager.tsx +1047 -0
  238. package/src/client-v2/plugin.tsx +52 -0
  239. package/src/index.ts +11 -0
  240. package/src/locale/en-US.json +99 -0
  241. package/src/locale/vi-VN.json +99 -0
  242. package/src/locale/zh-CN.json +99 -0
  243. package/src/server/__tests__/query-compiler.test.ts +231 -0
  244. package/src/server/__tests__/report-mcp-acl.integration.test.ts +377 -0
  245. package/src/server/acl-guard.ts +103 -0
  246. package/src/server/collections/es-report-data-views.ts +58 -0
  247. package/src/server/collections/es-reports.ts +74 -0
  248. package/src/server/index.ts +15 -0
  249. package/src/server/mcp/ElasticReportMcpServer.ts +391 -0
  250. package/src/server/mcp/ElasticReportToolCatalog.ts +417 -0
  251. package/src/server/plugin.ts +431 -0
  252. package/src/server/services/ElasticReportService.ts +326 -0
  253. package/src/server/services/ElasticsearchConnectionService.ts +401 -0
  254. package/src/server/services/ReportQueryCompiler.ts +1017 -0
  255. package/src/shared/constants.ts +29 -0
  256. package/src/shared/types.ts +175 -0
  257. package/README.md +0 -3
@@ -0,0 +1,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 = RenderSearchTemplateApi;
22
+ async function RenderSearchTemplateApi(params, options) {
23
+ const acceptedPath = [];
24
+ const acceptedBody = ['id', 'file', 'params', '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.id != null) {
53
+ method = body != null ? 'POST' : 'GET';
54
+ path = `/_render/template/${encodeURIComponent(params.id.toString())}`;
55
+ }
56
+ else {
57
+ method = body != null ? 'POST' : 'GET';
58
+ path = '/_render/template';
59
+ }
60
+ const meta = {
61
+ name: 'render_search_template',
62
+ pathParts: {
63
+ id: params.id
64
+ }
65
+ };
66
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
67
+ }
68
+ //# sourceMappingURL=render_search_template.js.map
@@ -0,0 +1,67 @@
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 Rollup {
8
+ transport: Transport;
9
+ constructor(transport: Transport);
10
+ /**
11
+ * Delete a rollup job. A job must be stopped before it can be deleted. If you attempt to delete a started job, an error occurs. Similarly, if you attempt to delete a nonexistent job, an exception occurs. IMPORTANT: When you delete a job, you remove only the process that is actively monitoring and rolling up data. The API does not delete any previously rolled up data. This is by design; a user may wish to roll up a static data set. Because the data set is static, after it has been fully rolled up there is no need to keep the indexing rollup job around (as there will be no new data). Thus the job can be deleted, leaving behind the rolled up data for analysis. If you wish to also remove the rollup data and the rollup index contains the data for only a single job, you can delete the whole rollup index. If the rollup index stores data from several jobs, you must issue a delete-by-query that targets the rollup job's identifier in the rollup index. For example: ``` POST my_rollup_index/_delete_by_query { "query": { "term": { "_rollup.id": "the_rollup_job_id" } } } ```
12
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/rollup-delete-job.html | Elasticsearch API documentation}
13
+ */
14
+ deleteJob(this: That, params: T.RollupDeleteJobRequest | TB.RollupDeleteJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.RollupDeleteJobResponse>;
15
+ deleteJob(this: That, params: T.RollupDeleteJobRequest | TB.RollupDeleteJobRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.RollupDeleteJobResponse, unknown>>;
16
+ deleteJob(this: That, params: T.RollupDeleteJobRequest | TB.RollupDeleteJobRequest, options?: TransportRequestOptions): Promise<T.RollupDeleteJobResponse>;
17
+ /**
18
+ * Get rollup job information. Get the configuration, stats, and status of rollup jobs. NOTE: This API returns only active (both `STARTED` and `STOPPED`) jobs. If a job was created, ran for a while, then was deleted, the API does not return any details about it. For details about a historical rollup job, the rollup capabilities API may be more useful.
19
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/rollup-get-job.html | Elasticsearch API documentation}
20
+ */
21
+ getJobs(this: That, params?: T.RollupGetJobsRequest | TB.RollupGetJobsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.RollupGetJobsResponse>;
22
+ getJobs(this: That, params?: T.RollupGetJobsRequest | TB.RollupGetJobsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.RollupGetJobsResponse, unknown>>;
23
+ getJobs(this: That, params?: T.RollupGetJobsRequest | TB.RollupGetJobsRequest, options?: TransportRequestOptions): Promise<T.RollupGetJobsResponse>;
24
+ /**
25
+ * Get the rollup job capabilities. Get the capabilities of any rollup jobs that have been configured for a specific index or index pattern. This API is useful because a rollup job is often configured to rollup only a subset of fields from the source index. Furthermore, only certain aggregations can be configured for various fields, leading to a limited subset of functionality depending on that configuration. This API enables you to inspect an index and determine: 1. Does this index have associated rollup data somewhere in the cluster? 2. If yes to the first question, what fields were rolled up, what aggregations can be performed, and where does the data live?
26
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/rollup-get-rollup-caps.html | Elasticsearch API documentation}
27
+ */
28
+ getRollupCaps(this: That, params?: T.RollupGetRollupCapsRequest | TB.RollupGetRollupCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.RollupGetRollupCapsResponse>;
29
+ getRollupCaps(this: That, params?: T.RollupGetRollupCapsRequest | TB.RollupGetRollupCapsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.RollupGetRollupCapsResponse, unknown>>;
30
+ getRollupCaps(this: That, params?: T.RollupGetRollupCapsRequest | TB.RollupGetRollupCapsRequest, options?: TransportRequestOptions): Promise<T.RollupGetRollupCapsResponse>;
31
+ /**
32
+ * Get the rollup index capabilities. Get the rollup capabilities of all jobs inside of a rollup index. A single rollup index may store the data for multiple rollup jobs and may have a variety of capabilities depending on those jobs. This API enables you to determine: * What jobs are stored in an index (or indices specified via a pattern)? * What target indices were rolled up, what fields were used in those rollups, and what aggregations can be performed on each job?
33
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/rollup-get-rollup-index-caps.html | Elasticsearch API documentation}
34
+ */
35
+ getRollupIndexCaps(this: That, params: T.RollupGetRollupIndexCapsRequest | TB.RollupGetRollupIndexCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.RollupGetRollupIndexCapsResponse>;
36
+ getRollupIndexCaps(this: That, params: T.RollupGetRollupIndexCapsRequest | TB.RollupGetRollupIndexCapsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.RollupGetRollupIndexCapsResponse, unknown>>;
37
+ getRollupIndexCaps(this: That, params: T.RollupGetRollupIndexCapsRequest | TB.RollupGetRollupIndexCapsRequest, options?: TransportRequestOptions): Promise<T.RollupGetRollupIndexCapsResponse>;
38
+ /**
39
+ * Create a rollup job. WARNING: From 8.15.0, calling this API in a cluster with no rollup usage will fail with a message about the deprecation and planned removal of rollup features. A cluster needs to contain either a rollup job or a rollup index in order for this API to be allowed to run. The rollup job configuration contains all the details about how the job should run, when it indexes documents, and what future queries will be able to run against the rollup index. There are three main sections to the job configuration: the logistical details about the job (for example, the cron schedule), the fields that are used for grouping, and what metrics to collect for each group. Jobs are created in a `STOPPED` state. You can start them with the start rollup jobs API.
40
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/rollup-put-job.html | Elasticsearch API documentation}
41
+ */
42
+ putJob(this: That, params: T.RollupPutJobRequest | TB.RollupPutJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.RollupPutJobResponse>;
43
+ putJob(this: That, params: T.RollupPutJobRequest | TB.RollupPutJobRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.RollupPutJobResponse, unknown>>;
44
+ putJob(this: That, params: T.RollupPutJobRequest | TB.RollupPutJobRequest, options?: TransportRequestOptions): Promise<T.RollupPutJobResponse>;
45
+ /**
46
+ * Search rolled-up data. The rollup search endpoint is needed because, internally, rolled-up documents utilize a different document structure than the original data. It rewrites standard Query DSL into a format that matches the rollup documents then takes the response and rewrites it back to what a client would expect given the original query. The request body supports a subset of features from the regular search API. The following functionality is not available: `size`: Because rollups work on pre-aggregated data, no search hits can be returned and so size must be set to zero or omitted entirely. `highlighter`, `suggestors`, `post_filter`, `profile`, `explain`: These are similarly disallowed. **Searching both historical rollup and non-rollup data** The rollup search API has the capability to search across both "live" non-rollup data and the aggregated rollup data. This is done by simply adding the live indices to the URI. For example: ``` GET sensor-1,sensor_rollup/_rollup_search { "size": 0, "aggregations": { "max_temperature": { "max": { "field": "temperature" } } } } ``` The rollup search endpoint does two things when the search runs: * The original request is sent to the non-rollup index unaltered. * A rewritten version of the original request is sent to the rollup index. When the two responses are received, the endpoint rewrites the rollup response and merges the two together. During the merging process, if there is any overlap in buckets between the two responses, the buckets from the non-rollup index are used.
47
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/rollup-search.html | Elasticsearch API documentation}
48
+ */
49
+ rollupSearch<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>>(this: That, params: T.RollupRollupSearchRequest | TB.RollupRollupSearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.RollupRollupSearchResponse<TDocument, TAggregations>>;
50
+ rollupSearch<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>>(this: That, params: T.RollupRollupSearchRequest | TB.RollupRollupSearchRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.RollupRollupSearchResponse<TDocument, TAggregations>, unknown>>;
51
+ rollupSearch<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>>(this: That, params: T.RollupRollupSearchRequest | TB.RollupRollupSearchRequest, options?: TransportRequestOptions): Promise<T.RollupRollupSearchResponse<TDocument, TAggregations>>;
52
+ /**
53
+ * Start rollup jobs. If you try to start a job that does not exist, an exception occurs. If you try to start a job that is already started, nothing happens.
54
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/rollup-start-job.html | Elasticsearch API documentation}
55
+ */
56
+ startJob(this: That, params: T.RollupStartJobRequest | TB.RollupStartJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.RollupStartJobResponse>;
57
+ startJob(this: That, params: T.RollupStartJobRequest | TB.RollupStartJobRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.RollupStartJobResponse, unknown>>;
58
+ startJob(this: That, params: T.RollupStartJobRequest | TB.RollupStartJobRequest, options?: TransportRequestOptions): Promise<T.RollupStartJobResponse>;
59
+ /**
60
+ * Stop rollup jobs. If you try to stop a job that does not exist, an exception occurs. If you try to stop a job that is already stopped, nothing happens. Since only a stopped job can be deleted, it can be useful to block the API until the indexer has fully stopped. This is accomplished with the `wait_for_completion` query parameter, and optionally a timeout. For example: ``` POST _rollup/job/sensor/_stop?wait_for_completion=true&timeout=10s ``` The parameter blocks the API call from returning until either the job has moved to STOPPED or the specified time has elapsed. If the specified time elapses without the job moving to STOPPED, a timeout exception occurs.
61
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/rollup-stop-job.html | Elasticsearch API documentation}
62
+ */
63
+ stopJob(this: That, params: T.RollupStopJobRequest | TB.RollupStopJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.RollupStopJobResponse>;
64
+ stopJob(this: That, params: T.RollupStopJobRequest | TB.RollupStopJobRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.RollupStopJobResponse, unknown>>;
65
+ stopJob(this: That, params: T.RollupStopJobRequest | TB.RollupStopJobRequest, options?: TransportRequestOptions): Promise<T.RollupStopJobResponse>;
66
+ }
67
+ export {};
@@ -0,0 +1,263 @@
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 Rollup {
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 deleteJob(params, options) {
32
+ const acceptedPath = ['id'];
33
+ const querystring = {};
34
+ const body = undefined;
35
+ for (const key in params) {
36
+ if (acceptedPath.includes(key)) {
37
+ continue;
38
+ }
39
+ else if (key !== 'body') {
40
+ // @ts-expect-error
41
+ querystring[key] = params[key];
42
+ }
43
+ }
44
+ const method = 'DELETE';
45
+ const path = `/_rollup/job/${encodeURIComponent(params.id.toString())}`;
46
+ const meta = {
47
+ name: 'rollup.delete_job',
48
+ pathParts: {
49
+ id: params.id
50
+ }
51
+ };
52
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
53
+ }
54
+ async getJobs(params, options) {
55
+ const acceptedPath = ['id'];
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
+ let method = '';
69
+ let path = '';
70
+ if (params.id != null) {
71
+ method = 'GET';
72
+ path = `/_rollup/job/${encodeURIComponent(params.id.toString())}`;
73
+ }
74
+ else {
75
+ method = 'GET';
76
+ path = '/_rollup/job';
77
+ }
78
+ const meta = {
79
+ name: 'rollup.get_jobs',
80
+ pathParts: {
81
+ id: params.id
82
+ }
83
+ };
84
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
85
+ }
86
+ async getRollupCaps(params, options) {
87
+ const acceptedPath = ['id'];
88
+ const querystring = {};
89
+ const body = undefined;
90
+ params = params !== null && params !== void 0 ? params : {};
91
+ for (const key in params) {
92
+ if (acceptedPath.includes(key)) {
93
+ continue;
94
+ }
95
+ else if (key !== 'body') {
96
+ // @ts-expect-error
97
+ querystring[key] = params[key];
98
+ }
99
+ }
100
+ let method = '';
101
+ let path = '';
102
+ if (params.id != null) {
103
+ method = 'GET';
104
+ path = `/_rollup/data/${encodeURIComponent(params.id.toString())}`;
105
+ }
106
+ else {
107
+ method = 'GET';
108
+ path = '/_rollup/data';
109
+ }
110
+ const meta = {
111
+ name: 'rollup.get_rollup_caps',
112
+ pathParts: {
113
+ id: params.id
114
+ }
115
+ };
116
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
117
+ }
118
+ async getRollupIndexCaps(params, options) {
119
+ const acceptedPath = ['index'];
120
+ const querystring = {};
121
+ const body = undefined;
122
+ for (const key in params) {
123
+ if (acceptedPath.includes(key)) {
124
+ continue;
125
+ }
126
+ else if (key !== 'body') {
127
+ // @ts-expect-error
128
+ querystring[key] = params[key];
129
+ }
130
+ }
131
+ const method = 'GET';
132
+ const path = `/${encodeURIComponent(params.index.toString())}/_rollup/data`;
133
+ const meta = {
134
+ name: 'rollup.get_rollup_index_caps',
135
+ pathParts: {
136
+ index: params.index
137
+ }
138
+ };
139
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
140
+ }
141
+ async putJob(params, options) {
142
+ const acceptedPath = ['id'];
143
+ const acceptedBody = ['cron', 'groups', 'index_pattern', 'metrics', 'page_size', 'rollup_index', 'timeout', 'headers'];
144
+ const querystring = {};
145
+ // @ts-expect-error
146
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
147
+ let body;
148
+ if (typeof userBody === 'string') {
149
+ body = userBody;
150
+ }
151
+ else {
152
+ body = userBody != null ? { ...userBody } : undefined;
153
+ }
154
+ for (const key in params) {
155
+ if (acceptedBody.includes(key)) {
156
+ body = body !== null && body !== void 0 ? body : {};
157
+ // @ts-expect-error
158
+ body[key] = params[key];
159
+ }
160
+ else if (acceptedPath.includes(key)) {
161
+ continue;
162
+ }
163
+ else if (key !== 'body') {
164
+ // @ts-expect-error
165
+ querystring[key] = params[key];
166
+ }
167
+ }
168
+ const method = 'PUT';
169
+ const path = `/_rollup/job/${encodeURIComponent(params.id.toString())}`;
170
+ const meta = {
171
+ name: 'rollup.put_job',
172
+ pathParts: {
173
+ id: params.id
174
+ }
175
+ };
176
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
177
+ }
178
+ async rollupSearch(params, options) {
179
+ const acceptedPath = ['index'];
180
+ const acceptedBody = ['aggregations', 'aggs', 'query', 'size'];
181
+ const querystring = {};
182
+ // @ts-expect-error
183
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
184
+ let body;
185
+ if (typeof userBody === 'string') {
186
+ body = userBody;
187
+ }
188
+ else {
189
+ body = userBody != null ? { ...userBody } : undefined;
190
+ }
191
+ for (const key in params) {
192
+ if (acceptedBody.includes(key)) {
193
+ body = body !== null && body !== void 0 ? body : {};
194
+ // @ts-expect-error
195
+ body[key] = params[key];
196
+ }
197
+ else if (acceptedPath.includes(key)) {
198
+ continue;
199
+ }
200
+ else if (key !== 'body') {
201
+ // @ts-expect-error
202
+ querystring[key] = params[key];
203
+ }
204
+ }
205
+ const method = body != null ? 'POST' : 'GET';
206
+ const path = `/${encodeURIComponent(params.index.toString())}/_rollup_search`;
207
+ const meta = {
208
+ name: 'rollup.rollup_search',
209
+ pathParts: {
210
+ index: params.index
211
+ }
212
+ };
213
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
214
+ }
215
+ async startJob(params, options) {
216
+ const acceptedPath = ['id'];
217
+ const querystring = {};
218
+ const body = undefined;
219
+ for (const key in params) {
220
+ if (acceptedPath.includes(key)) {
221
+ continue;
222
+ }
223
+ else if (key !== 'body') {
224
+ // @ts-expect-error
225
+ querystring[key] = params[key];
226
+ }
227
+ }
228
+ const method = 'POST';
229
+ const path = `/_rollup/job/${encodeURIComponent(params.id.toString())}/_start`;
230
+ const meta = {
231
+ name: 'rollup.start_job',
232
+ pathParts: {
233
+ id: params.id
234
+ }
235
+ };
236
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
237
+ }
238
+ async stopJob(params, options) {
239
+ const acceptedPath = ['id'];
240
+ const querystring = {};
241
+ const body = undefined;
242
+ for (const key in params) {
243
+ if (acceptedPath.includes(key)) {
244
+ continue;
245
+ }
246
+ else if (key !== 'body') {
247
+ // @ts-expect-error
248
+ querystring[key] = params[key];
249
+ }
250
+ }
251
+ const method = 'POST';
252
+ const path = `/_rollup/job/${encodeURIComponent(params.id.toString())}/_stop`;
253
+ const meta = {
254
+ name: 'rollup.stop_job',
255
+ pathParts: {
256
+ id: params.id
257
+ }
258
+ };
259
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
260
+ }
261
+ }
262
+ exports.default = Rollup;
263
+ //# sourceMappingURL=rollup.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 script. Runs a script and returns a result. Use this API to build and test scripts, such as when defining a script for a runtime field. This API requires very few dependencies and is especially useful if you don't have permissions to write documents on a cluster. The API uses several _contexts_, which control how scripts are run, what variables are available at runtime, and what the return type is. Each context requires a script, but additional parameters depend on the context you're using for that script.
9
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/painless/8.19/painless-execute-api.html | Elasticsearch API documentation}
10
+ */
11
+ export default function ScriptsPainlessExecuteApi<TResult = unknown>(this: That, params?: T.ScriptsPainlessExecuteRequest | TB.ScriptsPainlessExecuteRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ScriptsPainlessExecuteResponse<TResult>>;
12
+ export default function ScriptsPainlessExecuteApi<TResult = unknown>(this: That, params?: T.ScriptsPainlessExecuteRequest | TB.ScriptsPainlessExecuteRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ScriptsPainlessExecuteResponse<TResult>, unknown>>;
13
+ export default function ScriptsPainlessExecuteApi<TResult = unknown>(this: That, params?: T.ScriptsPainlessExecuteRequest | TB.ScriptsPainlessExecuteRequest, options?: TransportRequestOptions): Promise<T.ScriptsPainlessExecuteResponse<TResult>>;
14
+ export {};
@@ -0,0 +1,57 @@
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 = ScriptsPainlessExecuteApi;
22
+ async function ScriptsPainlessExecuteApi(params, options) {
23
+ const acceptedPath = [];
24
+ const acceptedBody = ['context', 'context_setup', 'script'];
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
+ const method = body != null ? 'POST' : 'GET';
51
+ const path = '/_scripts/painless/_execute';
52
+ const meta = {
53
+ name: 'scripts_painless_execute'
54
+ };
55
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
56
+ }
57
+ //# sourceMappingURL=scripts_painless_execute.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 scrolling search. IMPORTANT: The scroll API is no longer recommend for deep pagination. If you need to preserve the index state while paging through more than 10,000 hits, use the `search_after` parameter with a point in time (PIT). The scroll API gets large sets of results from a single scrolling search request. To get the necessary scroll ID, submit a search API request that includes an argument for the `scroll` query parameter. The `scroll` parameter indicates how long Elasticsearch should retain the search context for the request. The search response returns a scroll ID in the `_scroll_id` response body parameter. You can then use the scroll ID with the scroll API to retrieve the next batch of results for the request. If the Elasticsearch security features are enabled, the access to the results of a specific scroll ID is restricted to the user or API key that submitted the search. You can also use the scroll API to specify a new scroll parameter that extends or shortens the retention period for the search context. IMPORTANT: Results from a scrolling search reflect the state of the index at the time of the initial search request. Subsequent indexing or document changes only affect later search and scroll requests.
9
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/scroll-api.html | Elasticsearch API documentation}
10
+ */
11
+ export default function ScrollApi<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>>(this: That, params: T.ScrollRequest | TB.ScrollRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ScrollResponse<TDocument, TAggregations>>;
12
+ export default function ScrollApi<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>>(this: That, params: T.ScrollRequest | TB.ScrollRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ScrollResponse<TDocument, TAggregations>, unknown>>;
13
+ export default function ScrollApi<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>>(this: That, params: T.ScrollRequest | TB.ScrollRequest, options?: TransportRequestOptions): Promise<T.ScrollResponse<TDocument, TAggregations>>;
14
+ export {};
@@ -0,0 +1,59 @@
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 = ScrollApi;
22
+ async function ScrollApi(params, options) {
23
+ const acceptedPath = [];
24
+ const acceptedBody = ['scroll', 'scroll_id'];
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 = '/_search/scroll';
51
+ const meta = {
52
+ name: 'scroll',
53
+ pathParts: {
54
+ scroll_id: params.scroll_id
55
+ }
56
+ };
57
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
58
+ }
59
+ //# sourceMappingURL=scroll.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. Get search hits that match the query defined in the request. You can provide search queries using the `q` query string parameter or the request body. If both are specified, only the query parameter is used. If the Elasticsearch security features are enabled, you must have the read index privilege for the target data stream, index, or alias. For cross-cluster search, refer to the documentation about configuring CCS privileges. To search a point in time (PIT) for an alias, you must have the `read` index privilege for the alias's data streams or indices. **Search slicing** When paging through a large number of documents, it can be helpful to split the search into multiple slices to consume them independently with the `slice` and `pit` properties. By default the splitting is done first on the shards, then locally on each shard. The local splitting partitions the shard into contiguous ranges based on Lucene document IDs. For instance if the number of shards is equal to 2 and you request 4 slices, the slices 0 and 2 are assigned to the first shard and the slices 1 and 3 are assigned to the second shard. IMPORTANT: The same point-in-time ID should be used for all slices. If different PIT IDs are used, slices can overlap and miss documents. This situation can occur because the splitting criterion is based on Lucene document IDs, which are not stable across changes to the index.
9
+ * @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/search-search.html | Elasticsearch API documentation}
10
+ */
11
+ export default function SearchApi<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>>(this: That, params?: T.SearchRequest | TB.SearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchResponse<TDocument, TAggregations>>;
12
+ export default function SearchApi<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>>(this: That, params?: T.SearchRequest | TB.SearchRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchResponse<TDocument, TAggregations>, unknown>>;
13
+ export default function SearchApi<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>>(this: That, params?: T.SearchRequest | TB.SearchRequest, options?: TransportRequestOptions): Promise<T.SearchResponse<TDocument, TAggregations>>;
14
+ export {};
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ /*
3
+ * Licensed to Elasticsearch B.V. under one or more contributor
4
+ * license agreements. See the NOTICE file distributed with
5
+ * this work for additional information regarding copyright
6
+ * ownership. Elasticsearch B.V. licenses this file to you under
7
+ * the Apache License, Version 2.0 (the "License"); you may
8
+ * not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing,
14
+ * software distributed under the License is distributed on an
15
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ * KIND, either express or implied. See the License for the
17
+ * specific language governing permissions and limitations
18
+ * under the License.
19
+ */
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.default = SearchApi;
22
+ async function SearchApi(params, options) {
23
+ const acceptedPath = ['index'];
24
+ const acceptedBody = ['aggregations', 'aggs', 'collapse', 'explain', 'ext', 'from', 'highlight', 'track_total_hits', 'indices_boost', 'docvalue_fields', 'knn', 'rank', 'min_score', 'post_filter', 'profile', 'query', 'rescore', 'retriever', 'script_fields', 'search_after', 'size', 'slice', 'sort', '_source', 'fields', 'suggest', 'terminate_after', 'timeout', 'track_scores', 'version', 'seq_no_primary_term', 'stored_fields', 'pit', 'runtime_mappings', 'stats'];
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
+ if (key === 'sort' && typeof params[key] === 'string' && params[key].includes(':')) { // eslint-disable-line
41
+ // @ts-expect-error
42
+ querystring[key] = params[key];
43
+ }
44
+ else {
45
+ // @ts-expect-error
46
+ body[key] = params[key];
47
+ }
48
+ }
49
+ else if (acceptedPath.includes(key)) {
50
+ continue;
51
+ }
52
+ else if (key !== 'body') {
53
+ // @ts-expect-error
54
+ querystring[key] = params[key];
55
+ }
56
+ }
57
+ let method = '';
58
+ let path = '';
59
+ if (params.index != null) {
60
+ method = body != null ? 'POST' : 'GET';
61
+ path = `/${encodeURIComponent(params.index.toString())}/_search`;
62
+ }
63
+ else {
64
+ method = body != null ? 'POST' : 'GET';
65
+ path = '/_search';
66
+ }
67
+ const meta = {
68
+ name: 'search',
69
+ pathParts: {
70
+ index: params.index
71
+ }
72
+ };
73
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
74
+ }
75
+ //# sourceMappingURL=search.js.map