@elastic/elasticsearch 8.16.2 → 9.0.0-alpha.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 (273) hide show
  1. package/catalog-info.yaml +4 -1
  2. package/lib/api/api/async_search.d.ts +16 -17
  3. package/lib/api/api/async_search.js +5 -16
  4. package/lib/api/api/async_search.js.map +1 -1
  5. package/lib/api/api/autoscaling.d.ts +16 -17
  6. package/lib/api/api/autoscaling.js +5 -7
  7. package/lib/api/api/autoscaling.js.map +1 -1
  8. package/lib/api/api/bulk.d.ts +4 -5
  9. package/lib/api/api/bulk.js +3 -5
  10. package/lib/api/api/bulk.js.map +1 -1
  11. package/lib/api/api/capabilities.d.ts +3 -4
  12. package/lib/api/api/capabilities.js +2 -2
  13. package/lib/api/api/capabilities.js.map +1 -1
  14. package/lib/api/api/cat.d.ts +121 -122
  15. package/lib/api/api/cat.js +26 -26
  16. package/lib/api/api/cat.js.map +1 -1
  17. package/lib/api/api/ccr.d.ts +52 -53
  18. package/lib/api/api/ccr.js +18 -54
  19. package/lib/api/api/ccr.js.map +1 -1
  20. package/lib/api/api/clear_scroll.d.ts +4 -5
  21. package/lib/api/api/clear_scroll.js +3 -12
  22. package/lib/api/api/clear_scroll.js.map +1 -1
  23. package/lib/api/api/close_point_in_time.d.ts +4 -5
  24. package/lib/api/api/close_point_in_time.js +3 -12
  25. package/lib/api/api/close_point_in_time.js.map +1 -1
  26. package/lib/api/api/cluster.d.ts +64 -65
  27. package/lib/api/api/cluster.js +20 -56
  28. package/lib/api/api/cluster.js.map +1 -1
  29. package/lib/api/api/connector.d.ts +132 -133
  30. package/lib/api/api/connector.js +50 -194
  31. package/lib/api/api/connector.js.map +1 -1
  32. package/lib/api/api/count.d.ts +5 -6
  33. package/lib/api/api/count.js +3 -12
  34. package/lib/api/api/count.js.map +1 -1
  35. package/lib/api/api/create.d.ts +4 -5
  36. package/lib/api/api/create.js +3 -5
  37. package/lib/api/api/create.js.map +1 -1
  38. package/lib/api/api/dangling_indices.d.ts +12 -13
  39. package/lib/api/api/dangling_indices.js +3 -3
  40. package/lib/api/api/dangling_indices.js.map +1 -1
  41. package/lib/api/api/delete.d.ts +4 -5
  42. package/lib/api/api/delete.js +2 -2
  43. package/lib/api/api/delete.js.map +1 -1
  44. package/lib/api/api/delete_by_query.d.ts +4 -5
  45. package/lib/api/api/delete_by_query.js +3 -12
  46. package/lib/api/api/delete_by_query.js.map +1 -1
  47. package/lib/api/api/delete_by_query_rethrottle.d.ts +4 -5
  48. package/lib/api/api/delete_by_query_rethrottle.js +2 -2
  49. package/lib/api/api/delete_by_query_rethrottle.js.map +1 -1
  50. package/lib/api/api/delete_script.d.ts +4 -5
  51. package/lib/api/api/delete_script.js +2 -2
  52. package/lib/api/api/delete_script.js.map +1 -1
  53. package/lib/api/api/enrich.d.ts +21 -22
  54. package/lib/api/api/enrich.js +6 -15
  55. package/lib/api/api/enrich.js.map +1 -1
  56. package/lib/api/api/eql.d.ts +20 -21
  57. package/lib/api/api/eql.js +6 -15
  58. package/lib/api/api/eql.js.map +1 -1
  59. package/lib/api/api/esql.d.ts +13 -14
  60. package/lib/api/api/esql.js +4 -13
  61. package/lib/api/api/esql.js.map +1 -1
  62. package/lib/api/api/exists.d.ts +4 -5
  63. package/lib/api/api/exists.js +2 -2
  64. package/lib/api/api/exists.js.map +1 -1
  65. package/lib/api/api/exists_source.d.ts +4 -5
  66. package/lib/api/api/exists_source.js +2 -2
  67. package/lib/api/api/exists_source.js.map +1 -1
  68. package/lib/api/api/explain.d.ts +4 -5
  69. package/lib/api/api/explain.js +3 -12
  70. package/lib/api/api/explain.js.map +1 -1
  71. package/lib/api/api/features.d.ts +8 -9
  72. package/lib/api/api/features.js +2 -2
  73. package/lib/api/api/features.js.map +1 -1
  74. package/lib/api/api/field_caps.d.ts +4 -5
  75. package/lib/api/api/field_caps.js +3 -12
  76. package/lib/api/api/field_caps.js.map +1 -1
  77. package/lib/api/api/fleet.d.ts +22 -23
  78. package/lib/api/api/fleet.js +8 -19
  79. package/lib/api/api/fleet.js.map +1 -1
  80. package/lib/api/api/get.d.ts +4 -5
  81. package/lib/api/api/get.js +2 -2
  82. package/lib/api/api/get.js.map +1 -1
  83. package/lib/api/api/get_script.d.ts +4 -5
  84. package/lib/api/api/get_script.js +2 -2
  85. package/lib/api/api/get_script.js.map +1 -1
  86. package/lib/api/api/get_script_context.d.ts +4 -5
  87. package/lib/api/api/get_script_context.js +2 -2
  88. package/lib/api/api/get_script_context.js.map +1 -1
  89. package/lib/api/api/get_script_languages.d.ts +4 -5
  90. package/lib/api/api/get_script_languages.js +2 -2
  91. package/lib/api/api/get_script_languages.js.map +1 -1
  92. package/lib/api/api/get_source.d.ts +4 -5
  93. package/lib/api/api/get_source.js +2 -2
  94. package/lib/api/api/get_source.js.map +1 -1
  95. package/lib/api/api/graph.d.ts +5 -6
  96. package/lib/api/api/graph.js +2 -11
  97. package/lib/api/api/graph.js.map +1 -1
  98. package/lib/api/api/health_report.d.ts +4 -5
  99. package/lib/api/api/health_report.js +2 -2
  100. package/lib/api/api/health_report.js.map +1 -1
  101. package/lib/api/api/ilm.d.ts +44 -45
  102. package/lib/api/api/ilm.js +14 -41
  103. package/lib/api/api/ilm.js.map +1 -1
  104. package/lib/api/api/index.d.ts +4 -5
  105. package/lib/api/api/index.js +3 -5
  106. package/lib/api/api/index.js.map +1 -1
  107. package/lib/api/api/indices.d.ts +238 -239
  108. package/lib/api/api/indices.js +77 -216
  109. package/lib/api/api/indices.js.map +1 -1
  110. package/lib/api/api/inference.d.ts +20 -21
  111. package/lib/api/api/inference.js +7 -18
  112. package/lib/api/api/inference.js.map +1 -1
  113. package/lib/api/api/info.d.ts +4 -5
  114. package/lib/api/api/info.js +2 -2
  115. package/lib/api/api/info.js.map +1 -1
  116. package/lib/api/api/ingest.d.ts +57 -58
  117. package/lib/api/api/ingest.js +15 -42
  118. package/lib/api/api/ingest.js.map +1 -1
  119. package/lib/api/api/knn_search.d.ts +4 -5
  120. package/lib/api/api/knn_search.js +3 -12
  121. package/lib/api/api/knn_search.js.map +1 -1
  122. package/lib/api/api/license.d.ts +28 -29
  123. package/lib/api/api/license.js +8 -17
  124. package/lib/api/api/license.js.map +1 -1
  125. package/lib/api/api/logstash.d.ts +12 -13
  126. package/lib/api/api/logstash.js +4 -6
  127. package/lib/api/api/logstash.js.map +1 -1
  128. package/lib/api/api/mget.d.ts +4 -5
  129. package/lib/api/api/mget.js +3 -12
  130. package/lib/api/api/mget.js.map +1 -1
  131. package/lib/api/api/migration.d.ts +12 -13
  132. package/lib/api/api/migration.js +3 -3
  133. package/lib/api/api/migration.js.map +1 -1
  134. package/lib/api/api/ml.d.ts +293 -294
  135. package/lib/api/api/ml.js +112 -449
  136. package/lib/api/api/ml.js.map +1 -1
  137. package/lib/api/api/monitoring.d.ts +4 -5
  138. package/lib/api/api/monitoring.js +2 -4
  139. package/lib/api/api/monitoring.js.map +1 -1
  140. package/lib/api/api/msearch.d.ts +4 -5
  141. package/lib/api/api/msearch.js +3 -5
  142. package/lib/api/api/msearch.js.map +1 -1
  143. package/lib/api/api/msearch_template.d.ts +4 -5
  144. package/lib/api/api/msearch_template.js +3 -5
  145. package/lib/api/api/msearch_template.js.map +1 -1
  146. package/lib/api/api/mtermvectors.d.ts +4 -5
  147. package/lib/api/api/mtermvectors.js +3 -12
  148. package/lib/api/api/mtermvectors.js.map +1 -1
  149. package/lib/api/api/nodes.d.ts +28 -29
  150. package/lib/api/api/nodes.js +8 -17
  151. package/lib/api/api/nodes.js.map +1 -1
  152. package/lib/api/api/open_point_in_time.d.ts +4 -5
  153. package/lib/api/api/open_point_in_time.js +3 -12
  154. package/lib/api/api/open_point_in_time.js.map +1 -1
  155. package/lib/api/api/ping.d.ts +4 -5
  156. package/lib/api/api/ping.js +2 -2
  157. package/lib/api/api/ping.js.map +1 -1
  158. package/lib/api/api/profiling.d.ts +16 -17
  159. package/lib/api/api/profiling.js +4 -4
  160. package/lib/api/api/profiling.js.map +1 -1
  161. package/lib/api/api/put_script.d.ts +4 -5
  162. package/lib/api/api/put_script.js +3 -12
  163. package/lib/api/api/put_script.js.map +1 -1
  164. package/lib/api/api/query_rules.d.ts +40 -41
  165. package/lib/api/api/query_rules.js +11 -38
  166. package/lib/api/api/query_rules.js.map +1 -1
  167. package/lib/api/api/rank_eval.d.ts +4 -5
  168. package/lib/api/api/rank_eval.js +3 -12
  169. package/lib/api/api/rank_eval.js.map +1 -1
  170. package/lib/api/api/reindex.d.ts +4 -5
  171. package/lib/api/api/reindex.js +3 -12
  172. package/lib/api/api/reindex.js.map +1 -1
  173. package/lib/api/api/reindex_rethrottle.d.ts +4 -5
  174. package/lib/api/api/reindex_rethrottle.js +2 -2
  175. package/lib/api/api/reindex_rethrottle.js.map +1 -1
  176. package/lib/api/api/render_search_template.d.ts +4 -5
  177. package/lib/api/api/render_search_template.js +3 -12
  178. package/lib/api/api/render_search_template.js.map +1 -1
  179. package/lib/api/api/rollup.d.ts +32 -33
  180. package/lib/api/api/rollup.js +10 -28
  181. package/lib/api/api/rollup.js.map +1 -1
  182. package/lib/api/api/scripts_painless_execute.d.ts +4 -5
  183. package/lib/api/api/scripts_painless_execute.js +3 -12
  184. package/lib/api/api/scripts_painless_execute.js.map +1 -1
  185. package/lib/api/api/scroll.d.ts +4 -5
  186. package/lib/api/api/scroll.js +3 -12
  187. package/lib/api/api/scroll.js.map +1 -1
  188. package/lib/api/api/search.d.ts +4 -5
  189. package/lib/api/api/search.js +3 -14
  190. package/lib/api/api/search.js.map +1 -1
  191. package/lib/api/api/search_application.d.ts +39 -40
  192. package/lib/api/api/search_application.js +12 -23
  193. package/lib/api/api/search_application.js.map +1 -1
  194. package/lib/api/api/search_mvt.d.ts +4 -5
  195. package/lib/api/api/search_mvt.js +3 -12
  196. package/lib/api/api/search_mvt.js.map +1 -1
  197. package/lib/api/api/search_shards.d.ts +4 -5
  198. package/lib/api/api/search_shards.js +2 -2
  199. package/lib/api/api/search_shards.js.map +1 -1
  200. package/lib/api/api/search_template.d.ts +4 -5
  201. package/lib/api/api/search_template.js +3 -12
  202. package/lib/api/api/search_template.js.map +1 -1
  203. package/lib/api/api/searchable_snapshots.d.ts +16 -17
  204. package/lib/api/api/searchable_snapshots.js +5 -14
  205. package/lib/api/api/searchable_snapshots.js.map +1 -1
  206. package/lib/api/api/security.d.ts +253 -254
  207. package/lib/api/api/security.js +92 -337
  208. package/lib/api/api/security.js.map +1 -1
  209. package/lib/api/api/shutdown.d.ts +9 -10
  210. package/lib/api/api/shutdown.js +4 -13
  211. package/lib/api/api/shutdown.js.map +1 -1
  212. package/lib/api/api/simulate.d.ts +4 -5
  213. package/lib/api/api/simulate.js +1 -1
  214. package/lib/api/api/simulate.js.map +1 -1
  215. package/lib/api/api/slm.d.ts +36 -37
  216. package/lib/api/api/slm.js +10 -19
  217. package/lib/api/api/slm.js.map +1 -1
  218. package/lib/api/api/snapshot.d.ts +52 -53
  219. package/lib/api/api/snapshot.js +17 -46
  220. package/lib/api/api/snapshot.js.map +1 -1
  221. package/lib/api/api/sql.d.ts +30 -31
  222. package/lib/api/api/sql.js +9 -36
  223. package/lib/api/api/sql.js.map +1 -1
  224. package/lib/api/api/ssl.d.ts +4 -5
  225. package/lib/api/api/ssl.js +1 -1
  226. package/lib/api/api/ssl.js.map +1 -1
  227. package/lib/api/api/synonyms.d.ts +35 -36
  228. package/lib/api/api/synonyms.js +9 -27
  229. package/lib/api/api/synonyms.js.map +1 -1
  230. package/lib/api/api/tasks.d.ts +12 -13
  231. package/lib/api/api/tasks.js +3 -3
  232. package/lib/api/api/tasks.js.map +1 -1
  233. package/lib/api/api/terms_enum.d.ts +4 -5
  234. package/lib/api/api/terms_enum.js +3 -12
  235. package/lib/api/api/terms_enum.js.map +1 -1
  236. package/lib/api/api/termvectors.d.ts +4 -5
  237. package/lib/api/api/termvectors.js +3 -12
  238. package/lib/api/api/termvectors.js.map +1 -1
  239. package/lib/api/api/text_structure.d.ts +16 -17
  240. package/lib/api/api/text_structure.js +6 -17
  241. package/lib/api/api/text_structure.js.map +1 -1
  242. package/lib/api/api/transform.d.ts +48 -49
  243. package/lib/api/api/transform.js +15 -42
  244. package/lib/api/api/transform.js.map +1 -1
  245. package/lib/api/api/update.d.ts +4 -5
  246. package/lib/api/api/update.js +3 -12
  247. package/lib/api/api/update.js.map +1 -1
  248. package/lib/api/api/update_by_query.d.ts +4 -5
  249. package/lib/api/api/update_by_query.js +3 -12
  250. package/lib/api/api/update_by_query.js.map +1 -1
  251. package/lib/api/api/update_by_query_rethrottle.d.ts +4 -5
  252. package/lib/api/api/update_by_query_rethrottle.js +2 -2
  253. package/lib/api/api/update_by_query_rethrottle.js.map +1 -1
  254. package/lib/api/api/watcher.d.ts +52 -53
  255. package/lib/api/api/watcher.js +16 -43
  256. package/lib/api/api/watcher.js.map +1 -1
  257. package/lib/api/api/xpack.d.ts +8 -9
  258. package/lib/api/api/xpack.js +2 -2
  259. package/lib/api/api/xpack.js.map +1 -1
  260. package/lib/api/index.js +1 -1
  261. package/lib/api/index.js.map +1 -1
  262. package/lib/api/types.d.ts +131 -72
  263. package/lib/client.d.ts +82 -2
  264. package/lib/client.js +11 -4
  265. package/lib/client.js.map +1 -1
  266. package/lib/helpers.d.ts +0 -3
  267. package/lib/helpers.js +8 -7
  268. package/lib/helpers.js.map +1 -1
  269. package/package.json +33 -33
  270. package/renovate.json +29 -0
  271. package/lib/api/typesWithBodyKey.d.ts +0 -18163
  272. package/lib/api/typesWithBodyKey.js +0 -21
  273. package/lib/api/typesWithBodyKey.js.map +0 -1
@@ -36,7 +36,7 @@ class Indices {
36
36
  if (acceptedPath.includes(key)) {
37
37
  continue;
38
38
  }
39
- else if (key !== 'body') {
39
+ else {
40
40
  // @ts-expect-error
41
41
  querystring[key] = params[key];
42
42
  }
@@ -56,26 +56,17 @@ class Indices {
56
56
  const acceptedPath = ['index'];
57
57
  const acceptedBody = ['analyzer', 'attributes', 'char_filter', 'explain', 'field', 'filter', 'normalizer', 'text', 'tokenizer'];
58
58
  const querystring = {};
59
- // @ts-expect-error
60
- const userBody = params === null || params === void 0 ? void 0 : params.body;
61
- let body;
62
- if (typeof userBody === 'string') {
63
- body = userBody;
64
- }
65
- else {
66
- body = userBody != null ? { ...userBody } : undefined;
67
- }
59
+ const body = {};
68
60
  params = params !== null && params !== void 0 ? params : {};
69
61
  for (const key in params) {
70
62
  if (acceptedBody.includes(key)) {
71
- body = body !== null && body !== void 0 ? body : {};
72
63
  // @ts-expect-error
73
64
  body[key] = params[key];
74
65
  }
75
66
  else if (acceptedPath.includes(key)) {
76
67
  continue;
77
68
  }
78
- else if (key !== 'body') {
69
+ else {
79
70
  // @ts-expect-error
80
71
  querystring[key] = params[key];
81
72
  }
@@ -107,7 +98,7 @@ class Indices {
107
98
  if (acceptedPath.includes(key)) {
108
99
  continue;
109
100
  }
110
- else if (key !== 'body') {
101
+ else {
111
102
  // @ts-expect-error
112
103
  querystring[key] = params[key];
113
104
  }
@@ -134,25 +125,16 @@ class Indices {
134
125
  const acceptedPath = ['index', 'target'];
135
126
  const acceptedBody = ['aliases', 'settings'];
136
127
  const querystring = {};
137
- // @ts-expect-error
138
- const userBody = params === null || params === void 0 ? void 0 : params.body;
139
- let body;
140
- if (typeof userBody === 'string') {
141
- body = userBody;
142
- }
143
- else {
144
- body = userBody != null ? { ...userBody } : undefined;
145
- }
128
+ const body = {};
146
129
  for (const key in params) {
147
130
  if (acceptedBody.includes(key)) {
148
- body = body !== null && body !== void 0 ? body : {};
149
131
  // @ts-expect-error
150
132
  body[key] = params[key];
151
133
  }
152
134
  else if (acceptedPath.includes(key)) {
153
135
  continue;
154
136
  }
155
- else if (key !== 'body') {
137
+ else {
156
138
  // @ts-expect-error
157
139
  querystring[key] = params[key];
158
140
  }
@@ -176,7 +158,7 @@ class Indices {
176
158
  if (acceptedPath.includes(key)) {
177
159
  continue;
178
160
  }
179
- else if (key !== 'body') {
161
+ else {
180
162
  // @ts-expect-error
181
163
  querystring[key] = params[key];
182
164
  }
@@ -195,25 +177,16 @@ class Indices {
195
177
  const acceptedPath = ['index'];
196
178
  const acceptedBody = ['aliases', 'mappings', 'settings'];
197
179
  const querystring = {};
198
- // @ts-expect-error
199
- const userBody = params === null || params === void 0 ? void 0 : params.body;
200
- let body;
201
- if (typeof userBody === 'string') {
202
- body = userBody;
203
- }
204
- else {
205
- body = userBody != null ? { ...userBody } : undefined;
206
- }
180
+ const body = {};
207
181
  for (const key in params) {
208
182
  if (acceptedBody.includes(key)) {
209
- body = body !== null && body !== void 0 ? body : {};
210
183
  // @ts-expect-error
211
184
  body[key] = params[key];
212
185
  }
213
186
  else if (acceptedPath.includes(key)) {
214
187
  continue;
215
188
  }
216
- else if (key !== 'body') {
189
+ else {
217
190
  // @ts-expect-error
218
191
  querystring[key] = params[key];
219
192
  }
@@ -236,7 +209,7 @@ class Indices {
236
209
  if (acceptedPath.includes(key)) {
237
210
  continue;
238
211
  }
239
- else if (key !== 'body') {
212
+ else {
240
213
  // @ts-expect-error
241
214
  querystring[key] = params[key];
242
215
  }
@@ -260,7 +233,7 @@ class Indices {
260
233
  if (acceptedPath.includes(key)) {
261
234
  continue;
262
235
  }
263
- else if (key !== 'body') {
236
+ else {
264
237
  // @ts-expect-error
265
238
  querystring[key] = params[key];
266
239
  }
@@ -291,7 +264,7 @@ class Indices {
291
264
  if (acceptedPath.includes(key)) {
292
265
  continue;
293
266
  }
294
- else if (key !== 'body') {
267
+ else {
295
268
  // @ts-expect-error
296
269
  querystring[key] = params[key];
297
270
  }
@@ -314,7 +287,7 @@ class Indices {
314
287
  if (acceptedPath.includes(key)) {
315
288
  continue;
316
289
  }
317
- else if (key !== 'body') {
290
+ else {
318
291
  // @ts-expect-error
319
292
  querystring[key] = params[key];
320
293
  }
@@ -346,7 +319,7 @@ class Indices {
346
319
  if (acceptedPath.includes(key)) {
347
320
  continue;
348
321
  }
349
- else if (key !== 'body') {
322
+ else {
350
323
  // @ts-expect-error
351
324
  querystring[key] = params[key];
352
325
  }
@@ -369,7 +342,7 @@ class Indices {
369
342
  if (acceptedPath.includes(key)) {
370
343
  continue;
371
344
  }
372
- else if (key !== 'body') {
345
+ else {
373
346
  // @ts-expect-error
374
347
  querystring[key] = params[key];
375
348
  }
@@ -392,7 +365,7 @@ class Indices {
392
365
  if (acceptedPath.includes(key)) {
393
366
  continue;
394
367
  }
395
- else if (key !== 'body') {
368
+ else {
396
369
  // @ts-expect-error
397
370
  querystring[key] = params[key];
398
371
  }
@@ -415,7 +388,7 @@ class Indices {
415
388
  if (acceptedPath.includes(key)) {
416
389
  continue;
417
390
  }
418
- else if (key !== 'body') {
391
+ else {
419
392
  // @ts-expect-error
420
393
  querystring[key] = params[key];
421
394
  }
@@ -438,7 +411,7 @@ class Indices {
438
411
  if (acceptedPath.includes(key)) {
439
412
  continue;
440
413
  }
441
- else if (key !== 'body') {
414
+ else {
442
415
  // @ts-expect-error
443
416
  querystring[key] = params[key];
444
417
  }
@@ -454,12 +427,10 @@ class Indices {
454
427
  return await this.transport.request({ path, method, querystring, body, meta }, options);
455
428
  }
456
429
  async downsample(params, options) {
457
- var _a;
458
430
  const acceptedPath = ['index', 'target_index'];
459
431
  const acceptedBody = ['config'];
460
432
  const querystring = {};
461
- // @ts-expect-error
462
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
433
+ let body;
463
434
  for (const key in params) {
464
435
  if (acceptedBody.includes(key)) {
465
436
  // @ts-expect-error
@@ -468,7 +439,7 @@ class Indices {
468
439
  else if (acceptedPath.includes(key)) {
469
440
  continue;
470
441
  }
471
- else if (key !== 'body') {
442
+ else {
472
443
  // @ts-expect-error
473
444
  querystring[key] = params[key];
474
445
  }
@@ -492,7 +463,7 @@ class Indices {
492
463
  if (acceptedPath.includes(key)) {
493
464
  continue;
494
465
  }
495
- else if (key !== 'body') {
466
+ else {
496
467
  // @ts-expect-error
497
468
  querystring[key] = params[key];
498
469
  }
@@ -515,7 +486,7 @@ class Indices {
515
486
  if (acceptedPath.includes(key)) {
516
487
  continue;
517
488
  }
518
- else if (key !== 'body') {
489
+ else {
519
490
  // @ts-expect-error
520
491
  querystring[key] = params[key];
521
492
  }
@@ -547,7 +518,7 @@ class Indices {
547
518
  if (acceptedPath.includes(key)) {
548
519
  continue;
549
520
  }
550
- else if (key !== 'body') {
521
+ else {
551
522
  // @ts-expect-error
552
523
  querystring[key] = params[key];
553
524
  }
@@ -570,7 +541,7 @@ class Indices {
570
541
  if (acceptedPath.includes(key)) {
571
542
  continue;
572
543
  }
573
- else if (key !== 'body') {
544
+ else {
574
545
  // @ts-expect-error
575
546
  querystring[key] = params[key];
576
547
  }
@@ -593,7 +564,7 @@ class Indices {
593
564
  if (acceptedPath.includes(key)) {
594
565
  continue;
595
566
  }
596
- else if (key !== 'body') {
567
+ else {
597
568
  // @ts-expect-error
598
569
  querystring[key] = params[key];
599
570
  }
@@ -616,7 +587,7 @@ class Indices {
616
587
  if (acceptedPath.includes(key)) {
617
588
  continue;
618
589
  }
619
- else if (key !== 'body') {
590
+ else {
620
591
  // @ts-expect-error
621
592
  querystring[key] = params[key];
622
593
  }
@@ -640,7 +611,7 @@ class Indices {
640
611
  if (acceptedPath.includes(key)) {
641
612
  continue;
642
613
  }
643
- else if (key !== 'body') {
614
+ else {
644
615
  // @ts-expect-error
645
616
  querystring[key] = params[key];
646
617
  }
@@ -672,7 +643,7 @@ class Indices {
672
643
  if (acceptedPath.includes(key)) {
673
644
  continue;
674
645
  }
675
- else if (key !== 'body') {
646
+ else {
676
647
  // @ts-expect-error
677
648
  querystring[key] = params[key];
678
649
  }
@@ -703,7 +674,7 @@ class Indices {
703
674
  if (acceptedPath.includes(key)) {
704
675
  continue;
705
676
  }
706
- else if (key !== 'body') {
677
+ else {
707
678
  // @ts-expect-error
708
679
  querystring[key] = params[key];
709
680
  }
@@ -727,7 +698,7 @@ class Indices {
727
698
  if (acceptedPath.includes(key)) {
728
699
  continue;
729
700
  }
730
- else if (key !== 'body') {
701
+ else {
731
702
  // @ts-expect-error
732
703
  querystring[key] = params[key];
733
704
  }
@@ -767,7 +738,7 @@ class Indices {
767
738
  if (acceptedPath.includes(key)) {
768
739
  continue;
769
740
  }
770
- else if (key !== 'body') {
741
+ else {
771
742
  // @ts-expect-error
772
743
  querystring[key] = params[key];
773
744
  }
@@ -791,7 +762,7 @@ class Indices {
791
762
  if (acceptedPath.includes(key)) {
792
763
  continue;
793
764
  }
794
- else if (key !== 'body') {
765
+ else {
795
766
  // @ts-expect-error
796
767
  querystring[key] = params[key];
797
768
  }
@@ -822,7 +793,7 @@ class Indices {
822
793
  if (acceptedPath.includes(key)) {
823
794
  continue;
824
795
  }
825
- else if (key !== 'body') {
796
+ else {
826
797
  // @ts-expect-error
827
798
  querystring[key] = params[key];
828
799
  }
@@ -855,7 +826,7 @@ class Indices {
855
826
  if (acceptedPath.includes(key)) {
856
827
  continue;
857
828
  }
858
- else if (key !== 'body') {
829
+ else {
859
830
  // @ts-expect-error
860
831
  querystring[key] = params[key];
861
832
  }
@@ -887,7 +858,7 @@ class Indices {
887
858
  if (acceptedPath.includes(key)) {
888
859
  continue;
889
860
  }
890
- else if (key !== 'body') {
861
+ else {
891
862
  // @ts-expect-error
892
863
  querystring[key] = params[key];
893
864
  }
@@ -919,7 +890,7 @@ class Indices {
919
890
  if (acceptedPath.includes(key)) {
920
891
  continue;
921
892
  }
922
- else if (key !== 'body') {
893
+ else {
923
894
  // @ts-expect-error
924
895
  querystring[key] = params[key];
925
896
  }
@@ -960,7 +931,7 @@ class Indices {
960
931
  if (acceptedPath.includes(key)) {
961
932
  continue;
962
933
  }
963
- else if (key !== 'body') {
934
+ else {
964
935
  // @ts-expect-error
965
936
  querystring[key] = params[key];
966
937
  }
@@ -991,7 +962,7 @@ class Indices {
991
962
  if (acceptedPath.includes(key)) {
992
963
  continue;
993
964
  }
994
- else if (key !== 'body') {
965
+ else {
995
966
  // @ts-expect-error
996
967
  querystring[key] = params[key];
997
968
  }
@@ -1010,25 +981,16 @@ class Indices {
1010
981
  const acceptedPath = [];
1011
982
  const acceptedBody = ['actions'];
1012
983
  const querystring = {};
1013
- // @ts-expect-error
1014
- const userBody = params === null || params === void 0 ? void 0 : params.body;
1015
- let body;
1016
- if (typeof userBody === 'string') {
1017
- body = userBody;
1018
- }
1019
- else {
1020
- body = userBody != null ? { ...userBody } : undefined;
1021
- }
984
+ const body = {};
1022
985
  for (const key in params) {
1023
986
  if (acceptedBody.includes(key)) {
1024
- body = body !== null && body !== void 0 ? body : {};
1025
987
  // @ts-expect-error
1026
988
  body[key] = params[key];
1027
989
  }
1028
990
  else if (acceptedPath.includes(key)) {
1029
991
  continue;
1030
992
  }
1031
- else if (key !== 'body') {
993
+ else {
1032
994
  // @ts-expect-error
1033
995
  querystring[key] = params[key];
1034
996
  }
@@ -1048,7 +1010,7 @@ class Indices {
1048
1010
  if (acceptedPath.includes(key)) {
1049
1011
  continue;
1050
1012
  }
1051
- else if (key !== 'body') {
1013
+ else {
1052
1014
  // @ts-expect-error
1053
1015
  querystring[key] = params[key];
1054
1016
  }
@@ -1071,7 +1033,7 @@ class Indices {
1071
1033
  if (acceptedPath.includes(key)) {
1072
1034
  continue;
1073
1035
  }
1074
- else if (key !== 'body') {
1036
+ else {
1075
1037
  // @ts-expect-error
1076
1038
  querystring[key] = params[key];
1077
1039
  }
@@ -1090,25 +1052,16 @@ class Indices {
1090
1052
  const acceptedPath = ['index', 'name'];
1091
1053
  const acceptedBody = ['filter', 'index_routing', 'is_write_index', 'routing', 'search_routing'];
1092
1054
  const querystring = {};
1093
- // @ts-expect-error
1094
- const userBody = params === null || params === void 0 ? void 0 : params.body;
1095
- let body;
1096
- if (typeof userBody === 'string') {
1097
- body = userBody;
1098
- }
1099
- else {
1100
- body = userBody != null ? { ...userBody } : undefined;
1101
- }
1055
+ const body = {};
1102
1056
  for (const key in params) {
1103
1057
  if (acceptedBody.includes(key)) {
1104
- body = body !== null && body !== void 0 ? body : {};
1105
1058
  // @ts-expect-error
1106
1059
  body[key] = params[key];
1107
1060
  }
1108
1061
  else if (acceptedPath.includes(key)) {
1109
1062
  continue;
1110
1063
  }
1111
- else if (key !== 'body') {
1064
+ else {
1112
1065
  // @ts-expect-error
1113
1066
  querystring[key] = params[key];
1114
1067
  }
@@ -1134,27 +1087,18 @@ class Indices {
1134
1087
  }
1135
1088
  async putDataLifecycle(params, options) {
1136
1089
  const acceptedPath = ['name'];
1137
- const acceptedBody = ['data_retention', 'downsampling'];
1090
+ const acceptedBody = ['lifecycle'];
1138
1091
  const querystring = {};
1139
- // @ts-expect-error
1140
- const userBody = params === null || params === void 0 ? void 0 : params.body;
1141
1092
  let body;
1142
- if (typeof userBody === 'string') {
1143
- body = userBody;
1144
- }
1145
- else {
1146
- body = userBody != null ? { ...userBody } : undefined;
1147
- }
1148
1093
  for (const key in params) {
1149
1094
  if (acceptedBody.includes(key)) {
1150
- body = body !== null && body !== void 0 ? body : {};
1151
1095
  // @ts-expect-error
1152
- body[key] = params[key];
1096
+ body = params[key];
1153
1097
  }
1154
1098
  else if (acceptedPath.includes(key)) {
1155
1099
  continue;
1156
1100
  }
1157
- else if (key !== 'body') {
1101
+ else {
1158
1102
  // @ts-expect-error
1159
1103
  querystring[key] = params[key];
1160
1104
  }
@@ -1173,25 +1117,16 @@ class Indices {
1173
1117
  const acceptedPath = ['name'];
1174
1118
  const acceptedBody = ['index_patterns', 'composed_of', 'template', 'data_stream', 'priority', 'version', '_meta', 'allow_auto_create', 'ignore_missing_component_templates', 'deprecated'];
1175
1119
  const querystring = {};
1176
- // @ts-expect-error
1177
- const userBody = params === null || params === void 0 ? void 0 : params.body;
1178
- let body;
1179
- if (typeof userBody === 'string') {
1180
- body = userBody;
1181
- }
1182
- else {
1183
- body = userBody != null ? { ...userBody } : undefined;
1184
- }
1120
+ const body = {};
1185
1121
  for (const key in params) {
1186
1122
  if (acceptedBody.includes(key)) {
1187
- body = body !== null && body !== void 0 ? body : {};
1188
1123
  // @ts-expect-error
1189
1124
  body[key] = params[key];
1190
1125
  }
1191
1126
  else if (acceptedPath.includes(key)) {
1192
1127
  continue;
1193
1128
  }
1194
- else if (key !== 'body') {
1129
+ else {
1195
1130
  // @ts-expect-error
1196
1131
  querystring[key] = params[key];
1197
1132
  }
@@ -1210,25 +1145,16 @@ class Indices {
1210
1145
  const acceptedPath = ['index'];
1211
1146
  const acceptedBody = ['date_detection', 'dynamic', 'dynamic_date_formats', 'dynamic_templates', '_field_names', '_meta', 'numeric_detection', 'properties', '_routing', '_source', 'runtime'];
1212
1147
  const querystring = {};
1213
- // @ts-expect-error
1214
- const userBody = params === null || params === void 0 ? void 0 : params.body;
1215
- let body;
1216
- if (typeof userBody === 'string') {
1217
- body = userBody;
1218
- }
1219
- else {
1220
- body = userBody != null ? { ...userBody } : undefined;
1221
- }
1148
+ const body = {};
1222
1149
  for (const key in params) {
1223
1150
  if (acceptedBody.includes(key)) {
1224
- body = body !== null && body !== void 0 ? body : {};
1225
1151
  // @ts-expect-error
1226
1152
  body[key] = params[key];
1227
1153
  }
1228
1154
  else if (acceptedPath.includes(key)) {
1229
1155
  continue;
1230
1156
  }
1231
- else if (key !== 'body') {
1157
+ else {
1232
1158
  // @ts-expect-error
1233
1159
  querystring[key] = params[key];
1234
1160
  }
@@ -1244,12 +1170,10 @@ class Indices {
1244
1170
  return await this.transport.request({ path, method, querystring, body, meta }, options);
1245
1171
  }
1246
1172
  async putSettings(params, options) {
1247
- var _a;
1248
1173
  const acceptedPath = ['index'];
1249
1174
  const acceptedBody = ['settings'];
1250
1175
  const querystring = {};
1251
- // @ts-expect-error
1252
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
1176
+ let body;
1253
1177
  for (const key in params) {
1254
1178
  if (acceptedBody.includes(key)) {
1255
1179
  // @ts-expect-error
@@ -1258,7 +1182,7 @@ class Indices {
1258
1182
  else if (acceptedPath.includes(key)) {
1259
1183
  continue;
1260
1184
  }
1261
- else if (key !== 'body') {
1185
+ else {
1262
1186
  // @ts-expect-error
1263
1187
  querystring[key] = params[key];
1264
1188
  }
@@ -1285,25 +1209,16 @@ class Indices {
1285
1209
  const acceptedPath = ['name'];
1286
1210
  const acceptedBody = ['aliases', 'index_patterns', 'mappings', 'order', 'settings', 'version'];
1287
1211
  const querystring = {};
1288
- // @ts-expect-error
1289
- const userBody = params === null || params === void 0 ? void 0 : params.body;
1290
- let body;
1291
- if (typeof userBody === 'string') {
1292
- body = userBody;
1293
- }
1294
- else {
1295
- body = userBody != null ? { ...userBody } : undefined;
1296
- }
1212
+ const body = {};
1297
1213
  for (const key in params) {
1298
1214
  if (acceptedBody.includes(key)) {
1299
- body = body !== null && body !== void 0 ? body : {};
1300
1215
  // @ts-expect-error
1301
1216
  body[key] = params[key];
1302
1217
  }
1303
1218
  else if (acceptedPath.includes(key)) {
1304
1219
  continue;
1305
1220
  }
1306
- else if (key !== 'body') {
1221
+ else {
1307
1222
  // @ts-expect-error
1308
1223
  querystring[key] = params[key];
1309
1224
  }
@@ -1327,7 +1242,7 @@ class Indices {
1327
1242
  if (acceptedPath.includes(key)) {
1328
1243
  continue;
1329
1244
  }
1330
- else if (key !== 'body') {
1245
+ else {
1331
1246
  // @ts-expect-error
1332
1247
  querystring[key] = params[key];
1333
1248
  }
@@ -1359,7 +1274,7 @@ class Indices {
1359
1274
  if (acceptedPath.includes(key)) {
1360
1275
  continue;
1361
1276
  }
1362
- else if (key !== 'body') {
1277
+ else {
1363
1278
  // @ts-expect-error
1364
1279
  querystring[key] = params[key];
1365
1280
  }
@@ -1390,7 +1305,7 @@ class Indices {
1390
1305
  if (acceptedPath.includes(key)) {
1391
1306
  continue;
1392
1307
  }
1393
- else if (key !== 'body') {
1308
+ else {
1394
1309
  // @ts-expect-error
1395
1310
  querystring[key] = params[key];
1396
1311
  }
@@ -1413,7 +1328,7 @@ class Indices {
1413
1328
  if (acceptedPath.includes(key)) {
1414
1329
  continue;
1415
1330
  }
1416
- else if (key !== 'body') {
1331
+ else {
1417
1332
  // @ts-expect-error
1418
1333
  querystring[key] = params[key];
1419
1334
  }
@@ -1436,7 +1351,7 @@ class Indices {
1436
1351
  if (acceptedPath.includes(key)) {
1437
1352
  continue;
1438
1353
  }
1439
- else if (key !== 'body') {
1354
+ else {
1440
1355
  // @ts-expect-error
1441
1356
  querystring[key] = params[key];
1442
1357
  }
@@ -1455,25 +1370,16 @@ class Indices {
1455
1370
  const acceptedPath = ['alias', 'new_index'];
1456
1371
  const acceptedBody = ['aliases', 'conditions', 'mappings', 'settings'];
1457
1372
  const querystring = {};
1458
- // @ts-expect-error
1459
- const userBody = params === null || params === void 0 ? void 0 : params.body;
1460
- let body;
1461
- if (typeof userBody === 'string') {
1462
- body = userBody;
1463
- }
1464
- else {
1465
- body = userBody != null ? { ...userBody } : undefined;
1466
- }
1373
+ const body = {};
1467
1374
  for (const key in params) {
1468
1375
  if (acceptedBody.includes(key)) {
1469
- body = body !== null && body !== void 0 ? body : {};
1470
1376
  // @ts-expect-error
1471
1377
  body[key] = params[key];
1472
1378
  }
1473
1379
  else if (acceptedPath.includes(key)) {
1474
1380
  continue;
1475
1381
  }
1476
- else if (key !== 'body') {
1382
+ else {
1477
1383
  // @ts-expect-error
1478
1384
  querystring[key] = params[key];
1479
1385
  }
@@ -1506,7 +1412,7 @@ class Indices {
1506
1412
  if (acceptedPath.includes(key)) {
1507
1413
  continue;
1508
1414
  }
1509
- else if (key !== 'body') {
1415
+ else {
1510
1416
  // @ts-expect-error
1511
1417
  querystring[key] = params[key];
1512
1418
  }
@@ -1538,7 +1444,7 @@ class Indices {
1538
1444
  if (acceptedPath.includes(key)) {
1539
1445
  continue;
1540
1446
  }
1541
- else if (key !== 'body') {
1447
+ else {
1542
1448
  // @ts-expect-error
1543
1449
  querystring[key] = params[key];
1544
1450
  }
@@ -1565,25 +1471,16 @@ class Indices {
1565
1471
  const acceptedPath = ['index', 'target'];
1566
1472
  const acceptedBody = ['aliases', 'settings'];
1567
1473
  const querystring = {};
1568
- // @ts-expect-error
1569
- const userBody = params === null || params === void 0 ? void 0 : params.body;
1570
- let body;
1571
- if (typeof userBody === 'string') {
1572
- body = userBody;
1573
- }
1574
- else {
1575
- body = userBody != null ? { ...userBody } : undefined;
1576
- }
1474
+ const body = {};
1577
1475
  for (const key in params) {
1578
1476
  if (acceptedBody.includes(key)) {
1579
- body = body !== null && body !== void 0 ? body : {};
1580
1477
  // @ts-expect-error
1581
1478
  body[key] = params[key];
1582
1479
  }
1583
1480
  else if (acceptedPath.includes(key)) {
1584
1481
  continue;
1585
1482
  }
1586
- else if (key !== 'body') {
1483
+ else {
1587
1484
  // @ts-expect-error
1588
1485
  querystring[key] = params[key];
1589
1486
  }
@@ -1607,7 +1504,7 @@ class Indices {
1607
1504
  if (acceptedPath.includes(key)) {
1608
1505
  continue;
1609
1506
  }
1610
- else if (key !== 'body') {
1507
+ else {
1611
1508
  // @ts-expect-error
1612
1509
  querystring[key] = params[key];
1613
1510
  }
@@ -1626,26 +1523,17 @@ class Indices {
1626
1523
  const acceptedPath = ['name'];
1627
1524
  const acceptedBody = ['allow_auto_create', 'index_patterns', 'composed_of', 'template', 'data_stream', 'priority', 'version', '_meta', 'ignore_missing_component_templates', 'deprecated'];
1628
1525
  const querystring = {};
1629
- // @ts-expect-error
1630
- const userBody = params === null || params === void 0 ? void 0 : params.body;
1631
- let body;
1632
- if (typeof userBody === 'string') {
1633
- body = userBody;
1634
- }
1635
- else {
1636
- body = userBody != null ? { ...userBody } : undefined;
1637
- }
1526
+ const body = {};
1638
1527
  params = params !== null && params !== void 0 ? params : {};
1639
1528
  for (const key in params) {
1640
1529
  if (acceptedBody.includes(key)) {
1641
- body = body !== null && body !== void 0 ? body : {};
1642
1530
  // @ts-expect-error
1643
1531
  body[key] = params[key];
1644
1532
  }
1645
1533
  else if (acceptedPath.includes(key)) {
1646
1534
  continue;
1647
1535
  }
1648
- else if (key !== 'body') {
1536
+ else {
1649
1537
  // @ts-expect-error
1650
1538
  querystring[key] = params[key];
1651
1539
  }
@@ -1672,25 +1560,16 @@ class Indices {
1672
1560
  const acceptedPath = ['index', 'target'];
1673
1561
  const acceptedBody = ['aliases', 'settings'];
1674
1562
  const querystring = {};
1675
- // @ts-expect-error
1676
- const userBody = params === null || params === void 0 ? void 0 : params.body;
1677
- let body;
1678
- if (typeof userBody === 'string') {
1679
- body = userBody;
1680
- }
1681
- else {
1682
- body = userBody != null ? { ...userBody } : undefined;
1683
- }
1563
+ const body = {};
1684
1564
  for (const key in params) {
1685
1565
  if (acceptedBody.includes(key)) {
1686
- body = body !== null && body !== void 0 ? body : {};
1687
1566
  // @ts-expect-error
1688
1567
  body[key] = params[key];
1689
1568
  }
1690
1569
  else if (acceptedPath.includes(key)) {
1691
1570
  continue;
1692
1571
  }
1693
- else if (key !== 'body') {
1572
+ else {
1694
1573
  // @ts-expect-error
1695
1574
  querystring[key] = params[key];
1696
1575
  }
@@ -1715,7 +1594,7 @@ class Indices {
1715
1594
  if (acceptedPath.includes(key)) {
1716
1595
  continue;
1717
1596
  }
1718
- else if (key !== 'body') {
1597
+ else {
1719
1598
  // @ts-expect-error
1720
1599
  querystring[key] = params[key];
1721
1600
  }
@@ -1755,7 +1634,7 @@ class Indices {
1755
1634
  if (acceptedPath.includes(key)) {
1756
1635
  continue;
1757
1636
  }
1758
- else if (key !== 'body') {
1637
+ else {
1759
1638
  // @ts-expect-error
1760
1639
  querystring[key] = params[key];
1761
1640
  }
@@ -1774,26 +1653,17 @@ class Indices {
1774
1653
  const acceptedPath = [];
1775
1654
  const acceptedBody = ['actions'];
1776
1655
  const querystring = {};
1777
- // @ts-expect-error
1778
- const userBody = params === null || params === void 0 ? void 0 : params.body;
1779
- let body;
1780
- if (typeof userBody === 'string') {
1781
- body = userBody;
1782
- }
1783
- else {
1784
- body = userBody != null ? { ...userBody } : undefined;
1785
- }
1656
+ const body = {};
1786
1657
  params = params !== null && params !== void 0 ? params : {};
1787
1658
  for (const key in params) {
1788
1659
  if (acceptedBody.includes(key)) {
1789
- body = body !== null && body !== void 0 ? body : {};
1790
1660
  // @ts-expect-error
1791
1661
  body[key] = params[key];
1792
1662
  }
1793
1663
  else if (acceptedPath.includes(key)) {
1794
1664
  continue;
1795
1665
  }
1796
- else if (key !== 'body') {
1666
+ else {
1797
1667
  // @ts-expect-error
1798
1668
  querystring[key] = params[key];
1799
1669
  }
@@ -1809,26 +1679,17 @@ class Indices {
1809
1679
  const acceptedPath = ['index'];
1810
1680
  const acceptedBody = ['query'];
1811
1681
  const querystring = {};
1812
- // @ts-expect-error
1813
- const userBody = params === null || params === void 0 ? void 0 : params.body;
1814
- let body;
1815
- if (typeof userBody === 'string') {
1816
- body = userBody;
1817
- }
1818
- else {
1819
- body = userBody != null ? { ...userBody } : undefined;
1820
- }
1682
+ const body = {};
1821
1683
  params = params !== null && params !== void 0 ? params : {};
1822
1684
  for (const key in params) {
1823
1685
  if (acceptedBody.includes(key)) {
1824
- body = body !== null && body !== void 0 ? body : {};
1825
1686
  // @ts-expect-error
1826
1687
  body[key] = params[key];
1827
1688
  }
1828
1689
  else if (acceptedPath.includes(key)) {
1829
1690
  continue;
1830
1691
  }
1831
- else if (key !== 'body') {
1692
+ else {
1832
1693
  // @ts-expect-error
1833
1694
  querystring[key] = params[key];
1834
1695
  }