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,1121 @@
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 Connector {
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 checkIn(params, options) {
32
+ const acceptedPath = ['connector_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 = 'PUT';
45
+ const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_check_in`;
46
+ const meta = {
47
+ name: 'connector.check_in',
48
+ pathParts: {
49
+ connector_id: params.connector_id
50
+ }
51
+ };
52
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
53
+ }
54
+ async delete(params, options) {
55
+ const acceptedPath = ['connector_id'];
56
+ const querystring = {};
57
+ const body = undefined;
58
+ for (const key in params) {
59
+ if (acceptedPath.includes(key)) {
60
+ continue;
61
+ }
62
+ else if (key !== 'body') {
63
+ // @ts-expect-error
64
+ querystring[key] = params[key];
65
+ }
66
+ }
67
+ const method = 'DELETE';
68
+ const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}`;
69
+ const meta = {
70
+ name: 'connector.delete',
71
+ pathParts: {
72
+ connector_id: params.connector_id
73
+ }
74
+ };
75
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
76
+ }
77
+ async get(params, options) {
78
+ const acceptedPath = ['connector_id'];
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 = `/_connector/${encodeURIComponent(params.connector_id.toString())}`;
92
+ const meta = {
93
+ name: 'connector.get',
94
+ pathParts: {
95
+ connector_id: params.connector_id
96
+ }
97
+ };
98
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
99
+ }
100
+ async lastSync(params, options) {
101
+ const acceptedPath = ['connector_id'];
102
+ const acceptedBody = ['last_access_control_sync_error', 'last_access_control_sync_scheduled_at', 'last_access_control_sync_status', 'last_deleted_document_count', 'last_incremental_sync_scheduled_at', 'last_indexed_document_count', 'last_seen', 'last_sync_error', 'last_sync_scheduled_at', 'last_sync_status', 'last_synced', 'sync_cursor'];
103
+ const querystring = {};
104
+ // @ts-expect-error
105
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
106
+ let body;
107
+ if (typeof userBody === 'string') {
108
+ body = userBody;
109
+ }
110
+ else {
111
+ body = userBody != null ? { ...userBody } : undefined;
112
+ }
113
+ for (const key in params) {
114
+ if (acceptedBody.includes(key)) {
115
+ body = body !== null && body !== void 0 ? body : {};
116
+ // @ts-expect-error
117
+ body[key] = params[key];
118
+ }
119
+ else if (acceptedPath.includes(key)) {
120
+ continue;
121
+ }
122
+ else if (key !== 'body') {
123
+ // @ts-expect-error
124
+ querystring[key] = params[key];
125
+ }
126
+ }
127
+ const method = 'PUT';
128
+ const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_last_sync`;
129
+ const meta = {
130
+ name: 'connector.last_sync',
131
+ pathParts: {
132
+ connector_id: params.connector_id
133
+ }
134
+ };
135
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
136
+ }
137
+ async list(params, options) {
138
+ const acceptedPath = [];
139
+ const querystring = {};
140
+ const body = undefined;
141
+ params = params !== null && params !== void 0 ? params : {};
142
+ for (const key in params) {
143
+ if (acceptedPath.includes(key)) {
144
+ continue;
145
+ }
146
+ else if (key !== 'body') {
147
+ // @ts-expect-error
148
+ querystring[key] = params[key];
149
+ }
150
+ }
151
+ const method = 'GET';
152
+ const path = '/_connector';
153
+ const meta = {
154
+ name: 'connector.list'
155
+ };
156
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
157
+ }
158
+ async post(params, options) {
159
+ const acceptedPath = [];
160
+ const acceptedBody = ['description', 'index_name', 'is_native', 'language', 'name', 'service_type'];
161
+ const querystring = {};
162
+ // @ts-expect-error
163
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
164
+ let body;
165
+ if (typeof userBody === 'string') {
166
+ body = userBody;
167
+ }
168
+ else {
169
+ body = userBody != null ? { ...userBody } : undefined;
170
+ }
171
+ params = params !== null && params !== void 0 ? params : {};
172
+ for (const key in params) {
173
+ if (acceptedBody.includes(key)) {
174
+ body = body !== null && body !== void 0 ? body : {};
175
+ // @ts-expect-error
176
+ body[key] = params[key];
177
+ }
178
+ else if (acceptedPath.includes(key)) {
179
+ continue;
180
+ }
181
+ else if (key !== 'body') {
182
+ // @ts-expect-error
183
+ querystring[key] = params[key];
184
+ }
185
+ }
186
+ const method = 'POST';
187
+ const path = '/_connector';
188
+ const meta = {
189
+ name: 'connector.post'
190
+ };
191
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
192
+ }
193
+ async put(params, options) {
194
+ const acceptedPath = ['connector_id'];
195
+ const acceptedBody = ['description', 'index_name', 'is_native', 'language', 'name', 'service_type'];
196
+ const querystring = {};
197
+ // @ts-expect-error
198
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
199
+ let body;
200
+ if (typeof userBody === 'string') {
201
+ body = userBody;
202
+ }
203
+ else {
204
+ body = userBody != null ? { ...userBody } : undefined;
205
+ }
206
+ params = params !== null && params !== void 0 ? params : {};
207
+ for (const key in params) {
208
+ if (acceptedBody.includes(key)) {
209
+ body = body !== null && body !== void 0 ? body : {};
210
+ // @ts-expect-error
211
+ body[key] = params[key];
212
+ }
213
+ else if (acceptedPath.includes(key)) {
214
+ continue;
215
+ }
216
+ else if (key !== 'body') {
217
+ // @ts-expect-error
218
+ querystring[key] = params[key];
219
+ }
220
+ }
221
+ let method = '';
222
+ let path = '';
223
+ if (params.connector_id != null) {
224
+ method = 'PUT';
225
+ path = `/_connector/${encodeURIComponent(params.connector_id.toString())}`;
226
+ }
227
+ else {
228
+ method = 'PUT';
229
+ path = '/_connector';
230
+ }
231
+ const meta = {
232
+ name: 'connector.put',
233
+ pathParts: {
234
+ connector_id: params.connector_id
235
+ }
236
+ };
237
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
238
+ }
239
+ async secretDelete(params, options) {
240
+ const acceptedPath = ['id'];
241
+ const querystring = {};
242
+ const body = undefined;
243
+ for (const key in params) {
244
+ if (acceptedPath.includes(key)) {
245
+ continue;
246
+ }
247
+ else if (key !== 'body') {
248
+ // @ts-expect-error
249
+ querystring[key] = params[key];
250
+ }
251
+ }
252
+ const method = 'DELETE';
253
+ const path = `/_connector/_secret/${encodeURIComponent(params.id.toString())}`;
254
+ const meta = {
255
+ name: 'connector.secret_delete',
256
+ pathParts: {
257
+ id: params.id
258
+ }
259
+ };
260
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
261
+ }
262
+ async secretGet(params, options) {
263
+ const acceptedPath = ['id'];
264
+ const querystring = {};
265
+ const body = undefined;
266
+ for (const key in params) {
267
+ if (acceptedPath.includes(key)) {
268
+ continue;
269
+ }
270
+ else if (key !== 'body') {
271
+ // @ts-expect-error
272
+ querystring[key] = params[key];
273
+ }
274
+ }
275
+ const method = 'GET';
276
+ const path = `/_connector/_secret/${encodeURIComponent(params.id.toString())}`;
277
+ const meta = {
278
+ name: 'connector.secret_get',
279
+ pathParts: {
280
+ id: params.id
281
+ }
282
+ };
283
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
284
+ }
285
+ async secretPost(params, options) {
286
+ const acceptedPath = [];
287
+ const acceptedBody = ['value'];
288
+ const querystring = {};
289
+ // @ts-expect-error
290
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
291
+ let body;
292
+ if (typeof userBody === 'string') {
293
+ body = userBody;
294
+ }
295
+ else {
296
+ body = userBody != null ? { ...userBody } : undefined;
297
+ }
298
+ params = params !== null && params !== void 0 ? params : {};
299
+ for (const key in params) {
300
+ if (acceptedBody.includes(key)) {
301
+ body = body !== null && body !== void 0 ? body : {};
302
+ // @ts-expect-error
303
+ body[key] = params[key];
304
+ }
305
+ else if (acceptedPath.includes(key)) {
306
+ continue;
307
+ }
308
+ else if (key !== 'body') {
309
+ // @ts-expect-error
310
+ querystring[key] = params[key];
311
+ }
312
+ }
313
+ const method = 'POST';
314
+ const path = '/_connector/_secret';
315
+ const meta = {
316
+ name: 'connector.secret_post'
317
+ };
318
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
319
+ }
320
+ async secretPut(params, options) {
321
+ const acceptedPath = ['id'];
322
+ const acceptedBody = ['value'];
323
+ const querystring = {};
324
+ // @ts-expect-error
325
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
326
+ let body;
327
+ if (typeof userBody === 'string') {
328
+ body = userBody;
329
+ }
330
+ else {
331
+ body = userBody != null ? { ...userBody } : undefined;
332
+ }
333
+ for (const key in params) {
334
+ if (acceptedBody.includes(key)) {
335
+ body = body !== null && body !== void 0 ? body : {};
336
+ // @ts-expect-error
337
+ body[key] = params[key];
338
+ }
339
+ else if (acceptedPath.includes(key)) {
340
+ continue;
341
+ }
342
+ else if (key !== 'body') {
343
+ // @ts-expect-error
344
+ querystring[key] = params[key];
345
+ }
346
+ }
347
+ const method = 'PUT';
348
+ const path = `/_connector/_secret/${encodeURIComponent(params.id.toString())}`;
349
+ const meta = {
350
+ name: 'connector.secret_put',
351
+ pathParts: {
352
+ id: params.id
353
+ }
354
+ };
355
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
356
+ }
357
+ async syncJobCancel(params, options) {
358
+ const acceptedPath = ['connector_sync_job_id'];
359
+ const querystring = {};
360
+ const body = undefined;
361
+ for (const key in params) {
362
+ if (acceptedPath.includes(key)) {
363
+ continue;
364
+ }
365
+ else if (key !== 'body') {
366
+ // @ts-expect-error
367
+ querystring[key] = params[key];
368
+ }
369
+ }
370
+ const method = 'PUT';
371
+ const path = `/_connector/_sync_job/${encodeURIComponent(params.connector_sync_job_id.toString())}/_cancel`;
372
+ const meta = {
373
+ name: 'connector.sync_job_cancel',
374
+ pathParts: {
375
+ connector_sync_job_id: params.connector_sync_job_id
376
+ }
377
+ };
378
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
379
+ }
380
+ async syncJobCheckIn(params, options) {
381
+ const acceptedPath = ['connector_sync_job_id'];
382
+ const querystring = {};
383
+ const body = undefined;
384
+ for (const key in params) {
385
+ if (acceptedPath.includes(key)) {
386
+ continue;
387
+ }
388
+ else if (key !== 'body') {
389
+ // @ts-expect-error
390
+ querystring[key] = params[key];
391
+ }
392
+ }
393
+ const method = 'PUT';
394
+ const path = `/_connector/_sync_job/${encodeURIComponent(params.connector_sync_job_id.toString())}/_check_in`;
395
+ const meta = {
396
+ name: 'connector.sync_job_check_in',
397
+ pathParts: {
398
+ connector_sync_job_id: params.connector_sync_job_id
399
+ }
400
+ };
401
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
402
+ }
403
+ async syncJobClaim(params, options) {
404
+ const acceptedPath = ['connector_sync_job_id'];
405
+ const acceptedBody = ['sync_cursor', 'worker_hostname'];
406
+ const querystring = {};
407
+ // @ts-expect-error
408
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
409
+ let body;
410
+ if (typeof userBody === 'string') {
411
+ body = userBody;
412
+ }
413
+ else {
414
+ body = userBody != null ? { ...userBody } : undefined;
415
+ }
416
+ for (const key in params) {
417
+ if (acceptedBody.includes(key)) {
418
+ body = body !== null && body !== void 0 ? body : {};
419
+ // @ts-expect-error
420
+ body[key] = params[key];
421
+ }
422
+ else if (acceptedPath.includes(key)) {
423
+ continue;
424
+ }
425
+ else if (key !== 'body') {
426
+ // @ts-expect-error
427
+ querystring[key] = params[key];
428
+ }
429
+ }
430
+ const method = 'PUT';
431
+ const path = `/_connector/_sync_job/${encodeURIComponent(params.connector_sync_job_id.toString())}/_claim`;
432
+ const meta = {
433
+ name: 'connector.sync_job_claim',
434
+ pathParts: {
435
+ connector_sync_job_id: params.connector_sync_job_id
436
+ }
437
+ };
438
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
439
+ }
440
+ async syncJobDelete(params, options) {
441
+ const acceptedPath = ['connector_sync_job_id'];
442
+ const querystring = {};
443
+ const body = undefined;
444
+ for (const key in params) {
445
+ if (acceptedPath.includes(key)) {
446
+ continue;
447
+ }
448
+ else if (key !== 'body') {
449
+ // @ts-expect-error
450
+ querystring[key] = params[key];
451
+ }
452
+ }
453
+ const method = 'DELETE';
454
+ const path = `/_connector/_sync_job/${encodeURIComponent(params.connector_sync_job_id.toString())}`;
455
+ const meta = {
456
+ name: 'connector.sync_job_delete',
457
+ pathParts: {
458
+ connector_sync_job_id: params.connector_sync_job_id
459
+ }
460
+ };
461
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
462
+ }
463
+ async syncJobError(params, options) {
464
+ const acceptedPath = ['connector_sync_job_id'];
465
+ const acceptedBody = ['error'];
466
+ const querystring = {};
467
+ // @ts-expect-error
468
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
469
+ let body;
470
+ if (typeof userBody === 'string') {
471
+ body = userBody;
472
+ }
473
+ else {
474
+ body = userBody != null ? { ...userBody } : undefined;
475
+ }
476
+ for (const key in params) {
477
+ if (acceptedBody.includes(key)) {
478
+ body = body !== null && body !== void 0 ? body : {};
479
+ // @ts-expect-error
480
+ body[key] = params[key];
481
+ }
482
+ else if (acceptedPath.includes(key)) {
483
+ continue;
484
+ }
485
+ else if (key !== 'body') {
486
+ // @ts-expect-error
487
+ querystring[key] = params[key];
488
+ }
489
+ }
490
+ const method = 'PUT';
491
+ const path = `/_connector/_sync_job/${encodeURIComponent(params.connector_sync_job_id.toString())}/_error`;
492
+ const meta = {
493
+ name: 'connector.sync_job_error',
494
+ pathParts: {
495
+ connector_sync_job_id: params.connector_sync_job_id
496
+ }
497
+ };
498
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
499
+ }
500
+ async syncJobGet(params, options) {
501
+ const acceptedPath = ['connector_sync_job_id'];
502
+ const querystring = {};
503
+ const body = undefined;
504
+ for (const key in params) {
505
+ if (acceptedPath.includes(key)) {
506
+ continue;
507
+ }
508
+ else if (key !== 'body') {
509
+ // @ts-expect-error
510
+ querystring[key] = params[key];
511
+ }
512
+ }
513
+ const method = 'GET';
514
+ const path = `/_connector/_sync_job/${encodeURIComponent(params.connector_sync_job_id.toString())}`;
515
+ const meta = {
516
+ name: 'connector.sync_job_get',
517
+ pathParts: {
518
+ connector_sync_job_id: params.connector_sync_job_id
519
+ }
520
+ };
521
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
522
+ }
523
+ async syncJobList(params, options) {
524
+ const acceptedPath = [];
525
+ const querystring = {};
526
+ const body = undefined;
527
+ params = params !== null && params !== void 0 ? params : {};
528
+ for (const key in params) {
529
+ if (acceptedPath.includes(key)) {
530
+ continue;
531
+ }
532
+ else if (key !== 'body') {
533
+ // @ts-expect-error
534
+ querystring[key] = params[key];
535
+ }
536
+ }
537
+ const method = 'GET';
538
+ const path = '/_connector/_sync_job';
539
+ const meta = {
540
+ name: 'connector.sync_job_list'
541
+ };
542
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
543
+ }
544
+ async syncJobPost(params, options) {
545
+ const acceptedPath = [];
546
+ const acceptedBody = ['id', 'job_type', 'trigger_method'];
547
+ const querystring = {};
548
+ // @ts-expect-error
549
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
550
+ let body;
551
+ if (typeof userBody === 'string') {
552
+ body = userBody;
553
+ }
554
+ else {
555
+ body = userBody != null ? { ...userBody } : undefined;
556
+ }
557
+ for (const key in params) {
558
+ if (acceptedBody.includes(key)) {
559
+ body = body !== null && body !== void 0 ? body : {};
560
+ // @ts-expect-error
561
+ body[key] = params[key];
562
+ }
563
+ else if (acceptedPath.includes(key)) {
564
+ continue;
565
+ }
566
+ else if (key !== 'body') {
567
+ // @ts-expect-error
568
+ querystring[key] = params[key];
569
+ }
570
+ }
571
+ const method = 'POST';
572
+ const path = '/_connector/_sync_job';
573
+ const meta = {
574
+ name: 'connector.sync_job_post'
575
+ };
576
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
577
+ }
578
+ async syncJobUpdateStats(params, options) {
579
+ const acceptedPath = ['connector_sync_job_id'];
580
+ const acceptedBody = ['deleted_document_count', 'indexed_document_count', 'indexed_document_volume', 'last_seen', 'metadata', 'total_document_count'];
581
+ const querystring = {};
582
+ // @ts-expect-error
583
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
584
+ let body;
585
+ if (typeof userBody === 'string') {
586
+ body = userBody;
587
+ }
588
+ else {
589
+ body = userBody != null ? { ...userBody } : undefined;
590
+ }
591
+ for (const key in params) {
592
+ if (acceptedBody.includes(key)) {
593
+ body = body !== null && body !== void 0 ? body : {};
594
+ // @ts-expect-error
595
+ body[key] = params[key];
596
+ }
597
+ else if (acceptedPath.includes(key)) {
598
+ continue;
599
+ }
600
+ else if (key !== 'body') {
601
+ // @ts-expect-error
602
+ querystring[key] = params[key];
603
+ }
604
+ }
605
+ const method = 'PUT';
606
+ const path = `/_connector/_sync_job/${encodeURIComponent(params.connector_sync_job_id.toString())}/_stats`;
607
+ const meta = {
608
+ name: 'connector.sync_job_update_stats',
609
+ pathParts: {
610
+ connector_sync_job_id: params.connector_sync_job_id
611
+ }
612
+ };
613
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
614
+ }
615
+ async updateActiveFiltering(params, options) {
616
+ const acceptedPath = ['connector_id'];
617
+ const querystring = {};
618
+ const body = undefined;
619
+ for (const key in params) {
620
+ if (acceptedPath.includes(key)) {
621
+ continue;
622
+ }
623
+ else if (key !== 'body') {
624
+ // @ts-expect-error
625
+ querystring[key] = params[key];
626
+ }
627
+ }
628
+ const method = 'PUT';
629
+ const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_filtering/_activate`;
630
+ const meta = {
631
+ name: 'connector.update_active_filtering',
632
+ pathParts: {
633
+ connector_id: params.connector_id
634
+ }
635
+ };
636
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
637
+ }
638
+ async updateApiKeyId(params, options) {
639
+ const acceptedPath = ['connector_id'];
640
+ const acceptedBody = ['api_key_id', 'api_key_secret_id'];
641
+ const querystring = {};
642
+ // @ts-expect-error
643
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
644
+ let body;
645
+ if (typeof userBody === 'string') {
646
+ body = userBody;
647
+ }
648
+ else {
649
+ body = userBody != null ? { ...userBody } : undefined;
650
+ }
651
+ for (const key in params) {
652
+ if (acceptedBody.includes(key)) {
653
+ body = body !== null && body !== void 0 ? body : {};
654
+ // @ts-expect-error
655
+ body[key] = params[key];
656
+ }
657
+ else if (acceptedPath.includes(key)) {
658
+ continue;
659
+ }
660
+ else if (key !== 'body') {
661
+ // @ts-expect-error
662
+ querystring[key] = params[key];
663
+ }
664
+ }
665
+ const method = 'PUT';
666
+ const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_api_key_id`;
667
+ const meta = {
668
+ name: 'connector.update_api_key_id',
669
+ pathParts: {
670
+ connector_id: params.connector_id
671
+ }
672
+ };
673
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
674
+ }
675
+ async updateConfiguration(params, options) {
676
+ const acceptedPath = ['connector_id'];
677
+ const acceptedBody = ['configuration', 'values'];
678
+ const querystring = {};
679
+ // @ts-expect-error
680
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
681
+ let body;
682
+ if (typeof userBody === 'string') {
683
+ body = userBody;
684
+ }
685
+ else {
686
+ body = userBody != null ? { ...userBody } : undefined;
687
+ }
688
+ for (const key in params) {
689
+ if (acceptedBody.includes(key)) {
690
+ body = body !== null && body !== void 0 ? body : {};
691
+ // @ts-expect-error
692
+ body[key] = params[key];
693
+ }
694
+ else if (acceptedPath.includes(key)) {
695
+ continue;
696
+ }
697
+ else if (key !== 'body') {
698
+ // @ts-expect-error
699
+ querystring[key] = params[key];
700
+ }
701
+ }
702
+ const method = 'PUT';
703
+ const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_configuration`;
704
+ const meta = {
705
+ name: 'connector.update_configuration',
706
+ pathParts: {
707
+ connector_id: params.connector_id
708
+ }
709
+ };
710
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
711
+ }
712
+ async updateError(params, options) {
713
+ const acceptedPath = ['connector_id'];
714
+ const acceptedBody = ['error'];
715
+ const querystring = {};
716
+ // @ts-expect-error
717
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
718
+ let body;
719
+ if (typeof userBody === 'string') {
720
+ body = userBody;
721
+ }
722
+ else {
723
+ body = userBody != null ? { ...userBody } : undefined;
724
+ }
725
+ for (const key in params) {
726
+ if (acceptedBody.includes(key)) {
727
+ body = body !== null && body !== void 0 ? body : {};
728
+ // @ts-expect-error
729
+ body[key] = params[key];
730
+ }
731
+ else if (acceptedPath.includes(key)) {
732
+ continue;
733
+ }
734
+ else if (key !== 'body') {
735
+ // @ts-expect-error
736
+ querystring[key] = params[key];
737
+ }
738
+ }
739
+ const method = 'PUT';
740
+ const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_error`;
741
+ const meta = {
742
+ name: 'connector.update_error',
743
+ pathParts: {
744
+ connector_id: params.connector_id
745
+ }
746
+ };
747
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
748
+ }
749
+ async updateFeatures(params, options) {
750
+ const acceptedPath = ['connector_id'];
751
+ const acceptedBody = ['features'];
752
+ const querystring = {};
753
+ // @ts-expect-error
754
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
755
+ let body;
756
+ if (typeof userBody === 'string') {
757
+ body = userBody;
758
+ }
759
+ else {
760
+ body = userBody != null ? { ...userBody } : undefined;
761
+ }
762
+ for (const key in params) {
763
+ if (acceptedBody.includes(key)) {
764
+ body = body !== null && body !== void 0 ? body : {};
765
+ // @ts-expect-error
766
+ body[key] = params[key];
767
+ }
768
+ else if (acceptedPath.includes(key)) {
769
+ continue;
770
+ }
771
+ else if (key !== 'body') {
772
+ // @ts-expect-error
773
+ querystring[key] = params[key];
774
+ }
775
+ }
776
+ const method = 'PUT';
777
+ const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_features`;
778
+ const meta = {
779
+ name: 'connector.update_features',
780
+ pathParts: {
781
+ connector_id: params.connector_id
782
+ }
783
+ };
784
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
785
+ }
786
+ async updateFiltering(params, options) {
787
+ const acceptedPath = ['connector_id'];
788
+ const acceptedBody = ['filtering', 'rules', 'advanced_snippet'];
789
+ const querystring = {};
790
+ // @ts-expect-error
791
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
792
+ let body;
793
+ if (typeof userBody === 'string') {
794
+ body = userBody;
795
+ }
796
+ else {
797
+ body = userBody != null ? { ...userBody } : undefined;
798
+ }
799
+ for (const key in params) {
800
+ if (acceptedBody.includes(key)) {
801
+ body = body !== null && body !== void 0 ? body : {};
802
+ // @ts-expect-error
803
+ body[key] = params[key];
804
+ }
805
+ else if (acceptedPath.includes(key)) {
806
+ continue;
807
+ }
808
+ else if (key !== 'body') {
809
+ // @ts-expect-error
810
+ querystring[key] = params[key];
811
+ }
812
+ }
813
+ const method = 'PUT';
814
+ const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_filtering`;
815
+ const meta = {
816
+ name: 'connector.update_filtering',
817
+ pathParts: {
818
+ connector_id: params.connector_id
819
+ }
820
+ };
821
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
822
+ }
823
+ async updateFilteringValidation(params, options) {
824
+ const acceptedPath = ['connector_id'];
825
+ const acceptedBody = ['validation'];
826
+ const querystring = {};
827
+ // @ts-expect-error
828
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
829
+ let body;
830
+ if (typeof userBody === 'string') {
831
+ body = userBody;
832
+ }
833
+ else {
834
+ body = userBody != null ? { ...userBody } : undefined;
835
+ }
836
+ for (const key in params) {
837
+ if (acceptedBody.includes(key)) {
838
+ body = body !== null && body !== void 0 ? body : {};
839
+ // @ts-expect-error
840
+ body[key] = params[key];
841
+ }
842
+ else if (acceptedPath.includes(key)) {
843
+ continue;
844
+ }
845
+ else if (key !== 'body') {
846
+ // @ts-expect-error
847
+ querystring[key] = params[key];
848
+ }
849
+ }
850
+ const method = 'PUT';
851
+ const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_filtering/_validation`;
852
+ const meta = {
853
+ name: 'connector.update_filtering_validation',
854
+ pathParts: {
855
+ connector_id: params.connector_id
856
+ }
857
+ };
858
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
859
+ }
860
+ async updateIndexName(params, options) {
861
+ const acceptedPath = ['connector_id'];
862
+ const acceptedBody = ['index_name'];
863
+ const querystring = {};
864
+ // @ts-expect-error
865
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
866
+ let body;
867
+ if (typeof userBody === 'string') {
868
+ body = userBody;
869
+ }
870
+ else {
871
+ body = userBody != null ? { ...userBody } : undefined;
872
+ }
873
+ for (const key in params) {
874
+ if (acceptedBody.includes(key)) {
875
+ body = body !== null && body !== void 0 ? body : {};
876
+ // @ts-expect-error
877
+ body[key] = params[key];
878
+ }
879
+ else if (acceptedPath.includes(key)) {
880
+ continue;
881
+ }
882
+ else if (key !== 'body') {
883
+ // @ts-expect-error
884
+ querystring[key] = params[key];
885
+ }
886
+ }
887
+ const method = 'PUT';
888
+ const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_index_name`;
889
+ const meta = {
890
+ name: 'connector.update_index_name',
891
+ pathParts: {
892
+ connector_id: params.connector_id
893
+ }
894
+ };
895
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
896
+ }
897
+ async updateName(params, options) {
898
+ const acceptedPath = ['connector_id'];
899
+ const acceptedBody = ['name', 'description'];
900
+ const querystring = {};
901
+ // @ts-expect-error
902
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
903
+ let body;
904
+ if (typeof userBody === 'string') {
905
+ body = userBody;
906
+ }
907
+ else {
908
+ body = userBody != null ? { ...userBody } : undefined;
909
+ }
910
+ for (const key in params) {
911
+ if (acceptedBody.includes(key)) {
912
+ body = body !== null && body !== void 0 ? body : {};
913
+ // @ts-expect-error
914
+ body[key] = params[key];
915
+ }
916
+ else if (acceptedPath.includes(key)) {
917
+ continue;
918
+ }
919
+ else if (key !== 'body') {
920
+ // @ts-expect-error
921
+ querystring[key] = params[key];
922
+ }
923
+ }
924
+ const method = 'PUT';
925
+ const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_name`;
926
+ const meta = {
927
+ name: 'connector.update_name',
928
+ pathParts: {
929
+ connector_id: params.connector_id
930
+ }
931
+ };
932
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
933
+ }
934
+ async updateNative(params, options) {
935
+ const acceptedPath = ['connector_id'];
936
+ const acceptedBody = ['is_native'];
937
+ const querystring = {};
938
+ // @ts-expect-error
939
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
940
+ let body;
941
+ if (typeof userBody === 'string') {
942
+ body = userBody;
943
+ }
944
+ else {
945
+ body = userBody != null ? { ...userBody } : undefined;
946
+ }
947
+ for (const key in params) {
948
+ if (acceptedBody.includes(key)) {
949
+ body = body !== null && body !== void 0 ? body : {};
950
+ // @ts-expect-error
951
+ body[key] = params[key];
952
+ }
953
+ else if (acceptedPath.includes(key)) {
954
+ continue;
955
+ }
956
+ else if (key !== 'body') {
957
+ // @ts-expect-error
958
+ querystring[key] = params[key];
959
+ }
960
+ }
961
+ const method = 'PUT';
962
+ const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_native`;
963
+ const meta = {
964
+ name: 'connector.update_native',
965
+ pathParts: {
966
+ connector_id: params.connector_id
967
+ }
968
+ };
969
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
970
+ }
971
+ async updatePipeline(params, options) {
972
+ const acceptedPath = ['connector_id'];
973
+ const acceptedBody = ['pipeline'];
974
+ const querystring = {};
975
+ // @ts-expect-error
976
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
977
+ let body;
978
+ if (typeof userBody === 'string') {
979
+ body = userBody;
980
+ }
981
+ else {
982
+ body = userBody != null ? { ...userBody } : undefined;
983
+ }
984
+ for (const key in params) {
985
+ if (acceptedBody.includes(key)) {
986
+ body = body !== null && body !== void 0 ? body : {};
987
+ // @ts-expect-error
988
+ body[key] = params[key];
989
+ }
990
+ else if (acceptedPath.includes(key)) {
991
+ continue;
992
+ }
993
+ else if (key !== 'body') {
994
+ // @ts-expect-error
995
+ querystring[key] = params[key];
996
+ }
997
+ }
998
+ const method = 'PUT';
999
+ const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_pipeline`;
1000
+ const meta = {
1001
+ name: 'connector.update_pipeline',
1002
+ pathParts: {
1003
+ connector_id: params.connector_id
1004
+ }
1005
+ };
1006
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1007
+ }
1008
+ async updateScheduling(params, options) {
1009
+ const acceptedPath = ['connector_id'];
1010
+ const acceptedBody = ['scheduling'];
1011
+ const querystring = {};
1012
+ // @ts-expect-error
1013
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1014
+ let body;
1015
+ if (typeof userBody === 'string') {
1016
+ body = userBody;
1017
+ }
1018
+ else {
1019
+ body = userBody != null ? { ...userBody } : undefined;
1020
+ }
1021
+ for (const key in params) {
1022
+ if (acceptedBody.includes(key)) {
1023
+ body = body !== null && body !== void 0 ? body : {};
1024
+ // @ts-expect-error
1025
+ body[key] = params[key];
1026
+ }
1027
+ else if (acceptedPath.includes(key)) {
1028
+ continue;
1029
+ }
1030
+ else if (key !== 'body') {
1031
+ // @ts-expect-error
1032
+ querystring[key] = params[key];
1033
+ }
1034
+ }
1035
+ const method = 'PUT';
1036
+ const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_scheduling`;
1037
+ const meta = {
1038
+ name: 'connector.update_scheduling',
1039
+ pathParts: {
1040
+ connector_id: params.connector_id
1041
+ }
1042
+ };
1043
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1044
+ }
1045
+ async updateServiceType(params, options) {
1046
+ const acceptedPath = ['connector_id'];
1047
+ const acceptedBody = ['service_type'];
1048
+ const querystring = {};
1049
+ // @ts-expect-error
1050
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1051
+ let body;
1052
+ if (typeof userBody === 'string') {
1053
+ body = userBody;
1054
+ }
1055
+ else {
1056
+ body = userBody != null ? { ...userBody } : undefined;
1057
+ }
1058
+ for (const key in params) {
1059
+ if (acceptedBody.includes(key)) {
1060
+ body = body !== null && body !== void 0 ? body : {};
1061
+ // @ts-expect-error
1062
+ body[key] = params[key];
1063
+ }
1064
+ else if (acceptedPath.includes(key)) {
1065
+ continue;
1066
+ }
1067
+ else if (key !== 'body') {
1068
+ // @ts-expect-error
1069
+ querystring[key] = params[key];
1070
+ }
1071
+ }
1072
+ const method = 'PUT';
1073
+ const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_service_type`;
1074
+ const meta = {
1075
+ name: 'connector.update_service_type',
1076
+ pathParts: {
1077
+ connector_id: params.connector_id
1078
+ }
1079
+ };
1080
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1081
+ }
1082
+ async updateStatus(params, options) {
1083
+ const acceptedPath = ['connector_id'];
1084
+ const acceptedBody = ['status'];
1085
+ const querystring = {};
1086
+ // @ts-expect-error
1087
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1088
+ let body;
1089
+ if (typeof userBody === 'string') {
1090
+ body = userBody;
1091
+ }
1092
+ else {
1093
+ body = userBody != null ? { ...userBody } : undefined;
1094
+ }
1095
+ for (const key in params) {
1096
+ if (acceptedBody.includes(key)) {
1097
+ body = body !== null && body !== void 0 ? body : {};
1098
+ // @ts-expect-error
1099
+ body[key] = params[key];
1100
+ }
1101
+ else if (acceptedPath.includes(key)) {
1102
+ continue;
1103
+ }
1104
+ else if (key !== 'body') {
1105
+ // @ts-expect-error
1106
+ querystring[key] = params[key];
1107
+ }
1108
+ }
1109
+ const method = 'PUT';
1110
+ const path = `/_connector/${encodeURIComponent(params.connector_id.toString())}/_status`;
1111
+ const meta = {
1112
+ name: 'connector.update_status',
1113
+ pathParts: {
1114
+ connector_id: params.connector_id
1115
+ }
1116
+ };
1117
+ return await this.transport.request({ path, method, querystring, body, meta }, options);
1118
+ }
1119
+ }
1120
+ exports.default = Connector;
1121
+ //# sourceMappingURL=connector.js.map