@elastic/elasticsearch 8.0.0-alpha.0 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/README.md +13 -62
  2. package/free-report-junit.xml +13 -0
  3. package/index.d.ts +4 -3
  4. package/index.js +31 -3
  5. package/lib/api/api/async_search.js +28 -40
  6. package/lib/api/api/async_search.js.map +1 -1
  7. package/lib/api/api/autoscaling.js +13 -37
  8. package/lib/api/api/autoscaling.js.map +1 -1
  9. package/lib/api/api/bulk.d.ts +3 -3
  10. package/lib/api/api/bulk.js +6 -10
  11. package/lib/api/api/bulk.js.map +1 -1
  12. package/lib/api/api/cat.js +75 -275
  13. package/lib/api/api/cat.js.map +1 -1
  14. package/lib/api/api/ccr.js +79 -127
  15. package/lib/api/api/ccr.js.map +1 -1
  16. package/lib/api/api/clear_scroll.js +13 -7
  17. package/lib/api/api/clear_scroll.js.map +1 -1
  18. package/lib/api/api/close_point_in_time.js +13 -7
  19. package/lib/api/api/close_point_in_time.js.map +1 -1
  20. package/lib/api/api/cluster.js +85 -149
  21. package/lib/api/api/cluster.js.map +1 -1
  22. package/lib/api/api/count.js +13 -7
  23. package/lib/api/api/count.js.map +1 -1
  24. package/lib/api/api/create.js +5 -5
  25. package/lib/api/api/create.js.map +1 -1
  26. package/lib/api/api/dangling_indices.js +9 -33
  27. package/lib/api/api/dangling_indices.js.map +1 -1
  28. package/lib/api/api/delete.js +4 -12
  29. package/lib/api/api/delete.js.map +1 -1
  30. package/lib/api/api/delete_by_query.js +13 -7
  31. package/lib/api/api/delete_by_query.js.map +1 -1
  32. package/lib/api/api/delete_by_query_rethrottle.js +3 -11
  33. package/lib/api/api/delete_by_query_rethrottle.js.map +1 -1
  34. package/lib/api/api/delete_script.js +3 -11
  35. package/lib/api/api/delete_script.js.map +1 -1
  36. package/lib/api/api/enrich.js +25 -51
  37. package/lib/api/api/enrich.js.map +1 -1
  38. package/lib/api/api/eql.js +22 -40
  39. package/lib/api/api/eql.js.map +1 -1
  40. package/lib/api/api/exists.js +3 -11
  41. package/lib/api/api/exists.js.map +1 -1
  42. package/lib/api/api/exists_source.js +4 -12
  43. package/lib/api/api/exists_source.js.map +1 -1
  44. package/lib/api/api/explain.js +13 -7
  45. package/lib/api/api/explain.js.map +1 -1
  46. package/lib/api/api/features.js +6 -22
  47. package/lib/api/api/features.js.map +1 -1
  48. package/lib/api/api/field_caps.js +13 -7
  49. package/lib/api/api/field_caps.js.map +1 -1
  50. package/lib/api/api/fleet.d.ts +9 -3
  51. package/lib/api/api/fleet.js +64 -7
  52. package/lib/api/api/fleet.js.map +1 -1
  53. package/lib/api/api/get.js +3 -11
  54. package/lib/api/api/get.js.map +1 -1
  55. package/lib/api/api/get_script.js +3 -11
  56. package/lib/api/api/get_script.js.map +1 -1
  57. package/lib/api/api/get_script_context.js +3 -11
  58. package/lib/api/api/get_script_context.js.map +1 -1
  59. package/lib/api/api/get_script_languages.js +3 -11
  60. package/lib/api/api/get_script_languages.js.map +1 -1
  61. package/lib/api/api/get_source.js +3 -11
  62. package/lib/api/api/get_source.js.map +1 -1
  63. package/lib/api/api/graph.js +13 -7
  64. package/lib/api/api/graph.js.map +1 -1
  65. package/lib/api/api/ilm.d.ts +3 -3
  66. package/lib/api/api/ilm.js +73 -116
  67. package/lib/api/api/ilm.js.map +1 -1
  68. package/lib/api/api/index.js +4 -4
  69. package/lib/api/api/index.js.map +1 -1
  70. package/lib/api/api/indices.d.ts +9 -6
  71. package/lib/api/api/indices.js +320 -519
  72. package/lib/api/api/indices.js.map +1 -1
  73. package/lib/api/api/info.js +3 -11
  74. package/lib/api/api/info.js.map +1 -1
  75. package/lib/api/api/ingest.js +38 -58
  76. package/lib/api/api/ingest.js.map +1 -1
  77. package/lib/api/api/knn_search.d.ts +10 -0
  78. package/lib/api/api/knn_search.js +53 -0
  79. package/lib/api/api/knn_search.js.map +1 -0
  80. package/lib/api/api/license.d.ts +3 -3
  81. package/lib/api/api/license.js +31 -74
  82. package/lib/api/api/license.js.map +1 -1
  83. package/lib/api/api/logstash.js +10 -26
  84. package/lib/api/api/logstash.js.map +1 -1
  85. package/lib/api/api/mget.js +13 -7
  86. package/lib/api/api/mget.js.map +1 -1
  87. package/lib/api/api/migration.d.ts +6 -0
  88. package/lib/api/api/migration.js +39 -11
  89. package/lib/api/api/migration.js.map +1 -1
  90. package/lib/api/api/ml.d.ts +24 -24
  91. package/lib/api/api/ml.js +601 -626
  92. package/lib/api/api/ml.js.map +1 -1
  93. package/lib/api/api/monitoring.d.ts +3 -3
  94. package/lib/api/api/monitoring.js +4 -4
  95. package/lib/api/api/monitoring.js.map +1 -1
  96. package/lib/api/api/msearch.d.ts +3 -3
  97. package/lib/api/api/msearch.js +4 -4
  98. package/lib/api/api/msearch.js.map +1 -1
  99. package/lib/api/api/msearch_template.d.ts +3 -3
  100. package/lib/api/api/msearch_template.js +4 -4
  101. package/lib/api/api/msearch_template.js.map +1 -1
  102. package/lib/api/api/mtermvectors.js +13 -7
  103. package/lib/api/api/mtermvectors.js.map +1 -1
  104. package/lib/api/api/nodes.d.ts +6 -6
  105. package/lib/api/api/nodes.js +33 -71
  106. package/lib/api/api/nodes.js.map +1 -1
  107. package/lib/api/api/open_point_in_time.js +3 -11
  108. package/lib/api/api/open_point_in_time.js.map +1 -1
  109. package/lib/api/api/ping.js +3 -11
  110. package/lib/api/api/ping.js.map +1 -1
  111. package/lib/api/api/put_script.js +13 -7
  112. package/lib/api/api/put_script.js.map +1 -1
  113. package/lib/api/api/rank_eval.js +13 -7
  114. package/lib/api/api/rank_eval.js.map +1 -1
  115. package/lib/api/api/reindex.js +13 -7
  116. package/lib/api/api/reindex.js.map +1 -1
  117. package/lib/api/api/reindex_rethrottle.js +3 -11
  118. package/lib/api/api/reindex_rethrottle.js.map +1 -1
  119. package/lib/api/api/render_search_template.js +13 -7
  120. package/lib/api/api/render_search_template.js.map +1 -1
  121. package/lib/api/api/rollup.d.ts +3 -3
  122. package/lib/api/api/rollup.js +49 -85
  123. package/lib/api/api/rollup.js.map +1 -1
  124. package/lib/api/api/scripts_painless_execute.js +13 -7
  125. package/lib/api/api/scripts_painless_execute.js.map +1 -1
  126. package/lib/api/api/scroll.d.ts +3 -3
  127. package/lib/api/api/scroll.js +13 -7
  128. package/lib/api/api/scroll.js.map +1 -1
  129. package/lib/api/api/search.d.ts +3 -3
  130. package/lib/api/api/search.js +19 -7
  131. package/lib/api/api/search.js.map +1 -1
  132. package/lib/api/api/search_mvt.js +13 -7
  133. package/lib/api/api/search_mvt.js.map +1 -1
  134. package/lib/api/api/search_shards.js +3 -11
  135. package/lib/api/api/search_shards.js.map +1 -1
  136. package/lib/api/api/search_template.js +13 -7
  137. package/lib/api/api/search_template.js.map +1 -1
  138. package/lib/api/api/searchable_snapshots.d.ts +3 -3
  139. package/lib/api/api/searchable_snapshots.js +23 -38
  140. package/lib/api/api/searchable_snapshots.js.map +1 -1
  141. package/lib/api/api/security.d.ts +27 -27
  142. package/lib/api/api/security.js +311 -401
  143. package/lib/api/api/security.js.map +1 -1
  144. package/lib/api/api/shutdown.js +9 -33
  145. package/lib/api/api/shutdown.js.map +1 -1
  146. package/lib/api/api/slm.js +37 -95
  147. package/lib/api/api/slm.js.map +1 -1
  148. package/lib/api/api/snapshot.js +87 -125
  149. package/lib/api/api/snapshot.js.map +1 -1
  150. package/lib/api/api/sql.d.ts +9 -9
  151. package/lib/api/api/sql.js +51 -51
  152. package/lib/api/api/sql.js.map +1 -1
  153. package/lib/api/api/ssl.js +3 -11
  154. package/lib/api/api/ssl.js.map +1 -1
  155. package/lib/api/api/tasks.js +9 -33
  156. package/lib/api/api/tasks.js.map +1 -1
  157. package/lib/api/api/terms_enum.js +13 -7
  158. package/lib/api/api/terms_enum.js.map +1 -1
  159. package/lib/api/api/termvectors.js +13 -7
  160. package/lib/api/api/termvectors.js.map +1 -1
  161. package/lib/api/api/text_structure.js +4 -4
  162. package/lib/api/api/text_structure.js.map +1 -1
  163. package/lib/api/api/transform.d.ts +3 -0
  164. package/lib/api/api/transform.js +74 -78
  165. package/lib/api/api/transform.js.map +1 -1
  166. package/lib/api/api/update.js +14 -8
  167. package/lib/api/api/update.js.map +1 -1
  168. package/lib/api/api/update_by_query.js +13 -7
  169. package/lib/api/api/update_by_query.js.map +1 -1
  170. package/lib/api/api/update_by_query_rethrottle.js +3 -11
  171. package/lib/api/api/update_by_query_rethrottle.js.map +1 -1
  172. package/lib/api/api/watcher.js +63 -109
  173. package/lib/api/api/watcher.js.map +1 -1
  174. package/lib/api/api/xpack.js +6 -22
  175. package/lib/api/api/xpack.js.map +1 -1
  176. package/lib/api/index.d.ts +2 -0
  177. package/lib/api/index.js +2 -0
  178. package/lib/api/index.js.map +1 -1
  179. package/lib/api/types.d.ts +2945 -1413
  180. package/lib/api/typesWithBodyKey.d.ts +3076 -1437
  181. package/lib/{Client.d.ts → client.d.ts} +3 -4
  182. package/lib/{Client.js → client.js} +11 -6
  183. package/lib/{Client.js.map → client.js.map} +1 -1
  184. package/lib/{Helpers.d.ts → helpers.d.ts} +2 -2
  185. package/lib/{Helpers.js → helpers.js} +2 -4
  186. package/lib/helpers.js.map +1 -0
  187. package/lib/{SniffingTransport.d.ts → sniffingTransport.d.ts} +0 -0
  188. package/lib/{SniffingTransport.js → sniffingTransport.js} +1 -1
  189. package/lib/{SniffingTransport.js.map → sniffingTransport.js.map} +1 -1
  190. package/package.json +3 -3
  191. package/platinum-report-junit.xml +13 -0
  192. package/tsconfig.json +1 -1
  193. package/lib/Helpers.js.map +0 -1
@@ -29,25 +29,17 @@ class Security {
29
29
  this.transport = transport;
30
30
  }
31
31
  async authenticate(params, options) {
32
- var _a;
33
32
  const acceptedPath = [];
34
- const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
35
33
  const querystring = {};
36
- // @ts-expect-error
37
- let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
34
+ const body = undefined;
38
35
  params = params !== null && params !== void 0 ? params : {};
39
36
  for (const key in params) {
40
- if (acceptedQuery.includes(key)) {
41
- // @ts-expect-error
42
- querystring[key] = params[key];
43
- }
44
- else if (acceptedPath.includes(key)) {
37
+ if (acceptedPath.includes(key)) {
45
38
  continue;
46
39
  }
47
40
  else if (key !== 'body') {
48
- body = body !== null && body !== void 0 ? body : {};
49
41
  // @ts-expect-error
50
- body[key] = params[key];
42
+ querystring[key] = params[key];
51
43
  }
52
44
  }
53
45
  const method = 'GET';
@@ -55,25 +47,31 @@ class Security {
55
47
  return await this.transport.request({ path, method, querystring, body }, options);
56
48
  }
57
49
  async changePassword(params, options) {
58
- var _a;
59
50
  const acceptedPath = ['username'];
60
- const acceptedQuery = ['refresh', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
51
+ const acceptedBody = ['password', 'password_hash'];
61
52
  const querystring = {};
62
53
  // @ts-expect-error
63
- let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
54
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
55
+ let body;
56
+ if (typeof userBody === 'string') {
57
+ body = userBody;
58
+ }
59
+ else {
60
+ body = userBody != null ? { ...userBody } : undefined;
61
+ }
64
62
  params = params !== null && params !== void 0 ? params : {};
65
63
  for (const key in params) {
66
- if (acceptedQuery.includes(key)) {
64
+ if (acceptedBody.includes(key)) {
65
+ body = body !== null && body !== void 0 ? body : {};
67
66
  // @ts-expect-error
68
- querystring[key] = params[key];
67
+ body[key] = params[key];
69
68
  }
70
69
  else if (acceptedPath.includes(key)) {
71
70
  continue;
72
71
  }
73
72
  else if (key !== 'body') {
74
- body = body !== null && body !== void 0 ? body : {};
75
73
  // @ts-expect-error
76
- body[key] = params[key];
74
+ querystring[key] = params[key];
77
75
  }
78
76
  }
79
77
  let method = '';
@@ -89,24 +87,16 @@ class Security {
89
87
  return await this.transport.request({ path, method, querystring, body }, options);
90
88
  }
91
89
  async clearApiKeyCache(params, options) {
92
- var _a;
93
90
  const acceptedPath = ['ids'];
94
- const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
95
91
  const querystring = {};
96
- // @ts-expect-error
97
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
92
+ const body = undefined;
98
93
  for (const key in params) {
99
- if (acceptedQuery.includes(key)) {
100
- // @ts-expect-error
101
- querystring[key] = params[key];
102
- }
103
- else if (acceptedPath.includes(key)) {
94
+ if (acceptedPath.includes(key)) {
104
95
  continue;
105
96
  }
106
97
  else if (key !== 'body') {
107
- body = body !== null && body !== void 0 ? body : {};
108
98
  // @ts-expect-error
109
- body[key] = params[key];
99
+ querystring[key] = params[key];
110
100
  }
111
101
  }
112
102
  const method = 'POST';
@@ -114,24 +104,16 @@ class Security {
114
104
  return await this.transport.request({ path, method, querystring, body }, options);
115
105
  }
116
106
  async clearCachedPrivileges(params, options) {
117
- var _a;
118
107
  const acceptedPath = ['application'];
119
- const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
120
108
  const querystring = {};
121
- // @ts-expect-error
122
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
109
+ const body = undefined;
123
110
  for (const key in params) {
124
- if (acceptedQuery.includes(key)) {
125
- // @ts-expect-error
126
- querystring[key] = params[key];
127
- }
128
- else if (acceptedPath.includes(key)) {
111
+ if (acceptedPath.includes(key)) {
129
112
  continue;
130
113
  }
131
114
  else if (key !== 'body') {
132
- body = body !== null && body !== void 0 ? body : {};
133
115
  // @ts-expect-error
134
- body[key] = params[key];
116
+ querystring[key] = params[key];
135
117
  }
136
118
  }
137
119
  const method = 'POST';
@@ -139,24 +121,16 @@ class Security {
139
121
  return await this.transport.request({ path, method, querystring, body }, options);
140
122
  }
141
123
  async clearCachedRealms(params, options) {
142
- var _a;
143
124
  const acceptedPath = ['realms'];
144
- const acceptedQuery = ['usernames', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
145
125
  const querystring = {};
146
- // @ts-expect-error
147
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
126
+ const body = undefined;
148
127
  for (const key in params) {
149
- if (acceptedQuery.includes(key)) {
150
- // @ts-expect-error
151
- querystring[key] = params[key];
152
- }
153
- else if (acceptedPath.includes(key)) {
128
+ if (acceptedPath.includes(key)) {
154
129
  continue;
155
130
  }
156
131
  else if (key !== 'body') {
157
- body = body !== null && body !== void 0 ? body : {};
158
132
  // @ts-expect-error
159
- body[key] = params[key];
133
+ querystring[key] = params[key];
160
134
  }
161
135
  }
162
136
  const method = 'POST';
@@ -164,24 +138,16 @@ class Security {
164
138
  return await this.transport.request({ path, method, querystring, body }, options);
165
139
  }
166
140
  async clearCachedRoles(params, options) {
167
- var _a;
168
141
  const acceptedPath = ['name'];
169
- const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
170
142
  const querystring = {};
171
- // @ts-expect-error
172
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
143
+ const body = undefined;
173
144
  for (const key in params) {
174
- if (acceptedQuery.includes(key)) {
175
- // @ts-expect-error
176
- querystring[key] = params[key];
177
- }
178
- else if (acceptedPath.includes(key)) {
145
+ if (acceptedPath.includes(key)) {
179
146
  continue;
180
147
  }
181
148
  else if (key !== 'body') {
182
- body = body !== null && body !== void 0 ? body : {};
183
149
  // @ts-expect-error
184
- body[key] = params[key];
150
+ querystring[key] = params[key];
185
151
  }
186
152
  }
187
153
  const method = 'POST';
@@ -189,24 +155,16 @@ class Security {
189
155
  return await this.transport.request({ path, method, querystring, body }, options);
190
156
  }
191
157
  async clearCachedServiceTokens(params, options) {
192
- var _a;
193
158
  const acceptedPath = ['namespace', 'service', 'name'];
194
- const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
195
159
  const querystring = {};
196
- // @ts-expect-error
197
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
160
+ const body = undefined;
198
161
  for (const key in params) {
199
- if (acceptedQuery.includes(key)) {
200
- // @ts-expect-error
201
- querystring[key] = params[key];
202
- }
203
- else if (acceptedPath.includes(key)) {
162
+ if (acceptedPath.includes(key)) {
204
163
  continue;
205
164
  }
206
165
  else if (key !== 'body') {
207
- body = body !== null && body !== void 0 ? body : {};
208
166
  // @ts-expect-error
209
- body[key] = params[key];
167
+ querystring[key] = params[key];
210
168
  }
211
169
  }
212
170
  const method = 'POST';
@@ -214,25 +172,31 @@ class Security {
214
172
  return await this.transport.request({ path, method, querystring, body }, options);
215
173
  }
216
174
  async createApiKey(params, options) {
217
- var _a;
218
175
  const acceptedPath = [];
219
- const acceptedQuery = ['refresh', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
176
+ const acceptedBody = ['expiration', 'name', 'role_descriptors', 'metadata'];
220
177
  const querystring = {};
221
178
  // @ts-expect-error
222
- let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
179
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
180
+ let body;
181
+ if (typeof userBody === 'string') {
182
+ body = userBody;
183
+ }
184
+ else {
185
+ body = userBody != null ? { ...userBody } : undefined;
186
+ }
223
187
  params = params !== null && params !== void 0 ? params : {};
224
188
  for (const key in params) {
225
- if (acceptedQuery.includes(key)) {
189
+ if (acceptedBody.includes(key)) {
190
+ body = body !== null && body !== void 0 ? body : {};
226
191
  // @ts-expect-error
227
- querystring[key] = params[key];
192
+ body[key] = params[key];
228
193
  }
229
194
  else if (acceptedPath.includes(key)) {
230
195
  continue;
231
196
  }
232
197
  else if (key !== 'body') {
233
- body = body !== null && body !== void 0 ? body : {};
234
198
  // @ts-expect-error
235
- body[key] = params[key];
199
+ querystring[key] = params[key];
236
200
  }
237
201
  }
238
202
  const method = 'PUT';
@@ -240,24 +204,16 @@ class Security {
240
204
  return await this.transport.request({ path, method, querystring, body }, options);
241
205
  }
242
206
  async createServiceToken(params, options) {
243
- var _a;
244
207
  const acceptedPath = ['namespace', 'service', 'name'];
245
- const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
246
208
  const querystring = {};
247
- // @ts-expect-error
248
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
209
+ const body = undefined;
249
210
  for (const key in params) {
250
- if (acceptedQuery.includes(key)) {
251
- // @ts-expect-error
252
- querystring[key] = params[key];
253
- }
254
- else if (acceptedPath.includes(key)) {
211
+ if (acceptedPath.includes(key)) {
255
212
  continue;
256
213
  }
257
214
  else if (key !== 'body') {
258
- body = body !== null && body !== void 0 ? body : {};
259
215
  // @ts-expect-error
260
- body[key] = params[key];
216
+ querystring[key] = params[key];
261
217
  }
262
218
  }
263
219
  let method = '';
@@ -273,24 +229,16 @@ class Security {
273
229
  return await this.transport.request({ path, method, querystring, body }, options);
274
230
  }
275
231
  async deletePrivileges(params, options) {
276
- var _a;
277
232
  const acceptedPath = ['application', 'name'];
278
- const acceptedQuery = ['refresh', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
279
233
  const querystring = {};
280
- // @ts-expect-error
281
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
234
+ const body = undefined;
282
235
  for (const key in params) {
283
- if (acceptedQuery.includes(key)) {
284
- // @ts-expect-error
285
- querystring[key] = params[key];
286
- }
287
- else if (acceptedPath.includes(key)) {
236
+ if (acceptedPath.includes(key)) {
288
237
  continue;
289
238
  }
290
239
  else if (key !== 'body') {
291
- body = body !== null && body !== void 0 ? body : {};
292
240
  // @ts-expect-error
293
- body[key] = params[key];
241
+ querystring[key] = params[key];
294
242
  }
295
243
  }
296
244
  const method = 'DELETE';
@@ -298,24 +246,16 @@ class Security {
298
246
  return await this.transport.request({ path, method, querystring, body }, options);
299
247
  }
300
248
  async deleteRole(params, options) {
301
- var _a;
302
249
  const acceptedPath = ['name'];
303
- const acceptedQuery = ['refresh', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
304
250
  const querystring = {};
305
- // @ts-expect-error
306
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
251
+ const body = undefined;
307
252
  for (const key in params) {
308
- if (acceptedQuery.includes(key)) {
309
- // @ts-expect-error
310
- querystring[key] = params[key];
311
- }
312
- else if (acceptedPath.includes(key)) {
253
+ if (acceptedPath.includes(key)) {
313
254
  continue;
314
255
  }
315
256
  else if (key !== 'body') {
316
- body = body !== null && body !== void 0 ? body : {};
317
257
  // @ts-expect-error
318
- body[key] = params[key];
258
+ querystring[key] = params[key];
319
259
  }
320
260
  }
321
261
  const method = 'DELETE';
@@ -323,24 +263,16 @@ class Security {
323
263
  return await this.transport.request({ path, method, querystring, body }, options);
324
264
  }
325
265
  async deleteRoleMapping(params, options) {
326
- var _a;
327
266
  const acceptedPath = ['name'];
328
- const acceptedQuery = ['refresh', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
329
267
  const querystring = {};
330
- // @ts-expect-error
331
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
268
+ const body = undefined;
332
269
  for (const key in params) {
333
- if (acceptedQuery.includes(key)) {
334
- // @ts-expect-error
335
- querystring[key] = params[key];
336
- }
337
- else if (acceptedPath.includes(key)) {
270
+ if (acceptedPath.includes(key)) {
338
271
  continue;
339
272
  }
340
273
  else if (key !== 'body') {
341
- body = body !== null && body !== void 0 ? body : {};
342
274
  // @ts-expect-error
343
- body[key] = params[key];
275
+ querystring[key] = params[key];
344
276
  }
345
277
  }
346
278
  const method = 'DELETE';
@@ -348,24 +280,16 @@ class Security {
348
280
  return await this.transport.request({ path, method, querystring, body }, options);
349
281
  }
350
282
  async deleteServiceToken(params, options) {
351
- var _a;
352
283
  const acceptedPath = ['namespace', 'service', 'name'];
353
- const acceptedQuery = ['refresh', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
354
284
  const querystring = {};
355
- // @ts-expect-error
356
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
285
+ const body = undefined;
357
286
  for (const key in params) {
358
- if (acceptedQuery.includes(key)) {
359
- // @ts-expect-error
360
- querystring[key] = params[key];
361
- }
362
- else if (acceptedPath.includes(key)) {
287
+ if (acceptedPath.includes(key)) {
363
288
  continue;
364
289
  }
365
290
  else if (key !== 'body') {
366
- body = body !== null && body !== void 0 ? body : {};
367
291
  // @ts-expect-error
368
- body[key] = params[key];
292
+ querystring[key] = params[key];
369
293
  }
370
294
  }
371
295
  const method = 'DELETE';
@@ -373,24 +297,16 @@ class Security {
373
297
  return await this.transport.request({ path, method, querystring, body }, options);
374
298
  }
375
299
  async deleteUser(params, options) {
376
- var _a;
377
300
  const acceptedPath = ['username'];
378
- const acceptedQuery = ['refresh', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
379
301
  const querystring = {};
380
- // @ts-expect-error
381
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
302
+ const body = undefined;
382
303
  for (const key in params) {
383
- if (acceptedQuery.includes(key)) {
384
- // @ts-expect-error
385
- querystring[key] = params[key];
386
- }
387
- else if (acceptedPath.includes(key)) {
304
+ if (acceptedPath.includes(key)) {
388
305
  continue;
389
306
  }
390
307
  else if (key !== 'body') {
391
- body = body !== null && body !== void 0 ? body : {};
392
308
  // @ts-expect-error
393
- body[key] = params[key];
309
+ querystring[key] = params[key];
394
310
  }
395
311
  }
396
312
  const method = 'DELETE';
@@ -398,24 +314,16 @@ class Security {
398
314
  return await this.transport.request({ path, method, querystring, body }, options);
399
315
  }
400
316
  async disableUser(params, options) {
401
- var _a;
402
317
  const acceptedPath = ['username'];
403
- const acceptedQuery = ['refresh', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
404
318
  const querystring = {};
405
- // @ts-expect-error
406
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
319
+ const body = undefined;
407
320
  for (const key in params) {
408
- if (acceptedQuery.includes(key)) {
409
- // @ts-expect-error
410
- querystring[key] = params[key];
411
- }
412
- else if (acceptedPath.includes(key)) {
321
+ if (acceptedPath.includes(key)) {
413
322
  continue;
414
323
  }
415
324
  else if (key !== 'body') {
416
- body = body !== null && body !== void 0 ? body : {};
417
325
  // @ts-expect-error
418
- body[key] = params[key];
326
+ querystring[key] = params[key];
419
327
  }
420
328
  }
421
329
  const method = 'PUT';
@@ -423,24 +331,16 @@ class Security {
423
331
  return await this.transport.request({ path, method, querystring, body }, options);
424
332
  }
425
333
  async enableUser(params, options) {
426
- var _a;
427
334
  const acceptedPath = ['username'];
428
- const acceptedQuery = ['refresh', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
429
335
  const querystring = {};
430
- // @ts-expect-error
431
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
336
+ const body = undefined;
432
337
  for (const key in params) {
433
- if (acceptedQuery.includes(key)) {
434
- // @ts-expect-error
435
- querystring[key] = params[key];
436
- }
437
- else if (acceptedPath.includes(key)) {
338
+ if (acceptedPath.includes(key)) {
438
339
  continue;
439
340
  }
440
341
  else if (key !== 'body') {
441
- body = body !== null && body !== void 0 ? body : {};
442
342
  // @ts-expect-error
443
- body[key] = params[key];
343
+ querystring[key] = params[key];
444
344
  }
445
345
  }
446
346
  const method = 'PUT';
@@ -448,22 +348,17 @@ class Security {
448
348
  return await this.transport.request({ path, method, querystring, body }, options);
449
349
  }
450
350
  async enrollKibana(params, options) {
451
- var _a;
452
351
  const acceptedPath = [];
453
- const acceptedQuery = [];
454
352
  const querystring = {};
455
- let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
353
+ const body = undefined;
456
354
  params = params !== null && params !== void 0 ? params : {};
457
355
  for (const key in params) {
458
- if (acceptedQuery.includes(key)) {
459
- querystring[key] = params[key];
460
- }
461
- else if (acceptedPath.includes(key)) {
356
+ if (acceptedPath.includes(key)) {
462
357
  continue;
463
358
  }
464
359
  else if (key !== 'body') {
465
- body = body !== null && body !== void 0 ? body : {};
466
- body[key] = params[key];
360
+ // @ts-expect-error
361
+ querystring[key] = params[key];
467
362
  }
468
363
  }
469
364
  const method = 'GET';
@@ -471,22 +366,17 @@ class Security {
471
366
  return await this.transport.request({ path, method, querystring, body }, options);
472
367
  }
473
368
  async enrollNode(params, options) {
474
- var _a;
475
369
  const acceptedPath = [];
476
- const acceptedQuery = [];
477
370
  const querystring = {};
478
- let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
371
+ const body = undefined;
479
372
  params = params !== null && params !== void 0 ? params : {};
480
373
  for (const key in params) {
481
- if (acceptedQuery.includes(key)) {
482
- querystring[key] = params[key];
483
- }
484
- else if (acceptedPath.includes(key)) {
374
+ if (acceptedPath.includes(key)) {
485
375
  continue;
486
376
  }
487
377
  else if (key !== 'body') {
488
- body = body !== null && body !== void 0 ? body : {};
489
- body[key] = params[key];
378
+ // @ts-expect-error
379
+ querystring[key] = params[key];
490
380
  }
491
381
  }
492
382
  const method = 'GET';
@@ -494,25 +384,17 @@ class Security {
494
384
  return await this.transport.request({ path, method, querystring, body }, options);
495
385
  }
496
386
  async getApiKey(params, options) {
497
- var _a;
498
387
  const acceptedPath = [];
499
- const acceptedQuery = ['id', 'name', 'owner', 'realm_name', 'username', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
500
388
  const querystring = {};
501
- // @ts-expect-error
502
- let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
389
+ const body = undefined;
503
390
  params = params !== null && params !== void 0 ? params : {};
504
391
  for (const key in params) {
505
- if (acceptedQuery.includes(key)) {
506
- // @ts-expect-error
507
- querystring[key] = params[key];
508
- }
509
- else if (acceptedPath.includes(key)) {
392
+ if (acceptedPath.includes(key)) {
510
393
  continue;
511
394
  }
512
395
  else if (key !== 'body') {
513
- body = body !== null && body !== void 0 ? body : {};
514
396
  // @ts-expect-error
515
- body[key] = params[key];
397
+ querystring[key] = params[key];
516
398
  }
517
399
  }
518
400
  const method = 'GET';
@@ -520,25 +402,17 @@ class Security {
520
402
  return await this.transport.request({ path, method, querystring, body }, options);
521
403
  }
522
404
  async getBuiltinPrivileges(params, options) {
523
- var _a;
524
405
  const acceptedPath = [];
525
- const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
526
406
  const querystring = {};
527
- // @ts-expect-error
528
- let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
407
+ const body = undefined;
529
408
  params = params !== null && params !== void 0 ? params : {};
530
409
  for (const key in params) {
531
- if (acceptedQuery.includes(key)) {
532
- // @ts-expect-error
533
- querystring[key] = params[key];
534
- }
535
- else if (acceptedPath.includes(key)) {
410
+ if (acceptedPath.includes(key)) {
536
411
  continue;
537
412
  }
538
413
  else if (key !== 'body') {
539
- body = body !== null && body !== void 0 ? body : {};
540
414
  // @ts-expect-error
541
- body[key] = params[key];
415
+ querystring[key] = params[key];
542
416
  }
543
417
  }
544
418
  const method = 'GET';
@@ -546,25 +420,17 @@ class Security {
546
420
  return await this.transport.request({ path, method, querystring, body }, options);
547
421
  }
548
422
  async getPrivileges(params, options) {
549
- var _a;
550
423
  const acceptedPath = ['application', 'name'];
551
- const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
552
424
  const querystring = {};
553
- // @ts-expect-error
554
- let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
425
+ const body = undefined;
555
426
  params = params !== null && params !== void 0 ? params : {};
556
427
  for (const key in params) {
557
- if (acceptedQuery.includes(key)) {
558
- // @ts-expect-error
559
- querystring[key] = params[key];
560
- }
561
- else if (acceptedPath.includes(key)) {
428
+ if (acceptedPath.includes(key)) {
562
429
  continue;
563
430
  }
564
431
  else if (key !== 'body') {
565
- body = body !== null && body !== void 0 ? body : {};
566
432
  // @ts-expect-error
567
- body[key] = params[key];
433
+ querystring[key] = params[key];
568
434
  }
569
435
  }
570
436
  let method = '';
@@ -584,25 +450,17 @@ class Security {
584
450
  return await this.transport.request({ path, method, querystring, body }, options);
585
451
  }
586
452
  async getRole(params, options) {
587
- var _a;
588
453
  const acceptedPath = ['name'];
589
- const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
590
454
  const querystring = {};
591
- // @ts-expect-error
592
- let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
455
+ const body = undefined;
593
456
  params = params !== null && params !== void 0 ? params : {};
594
457
  for (const key in params) {
595
- if (acceptedQuery.includes(key)) {
596
- // @ts-expect-error
597
- querystring[key] = params[key];
598
- }
599
- else if (acceptedPath.includes(key)) {
458
+ if (acceptedPath.includes(key)) {
600
459
  continue;
601
460
  }
602
461
  else if (key !== 'body') {
603
- body = body !== null && body !== void 0 ? body : {};
604
462
  // @ts-expect-error
605
- body[key] = params[key];
463
+ querystring[key] = params[key];
606
464
  }
607
465
  }
608
466
  let method = '';
@@ -618,25 +476,17 @@ class Security {
618
476
  return await this.transport.request({ path, method, querystring, body }, options);
619
477
  }
620
478
  async getRoleMapping(params, options) {
621
- var _a;
622
479
  const acceptedPath = ['name'];
623
- const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
624
480
  const querystring = {};
625
- // @ts-expect-error
626
- let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
481
+ const body = undefined;
627
482
  params = params !== null && params !== void 0 ? params : {};
628
483
  for (const key in params) {
629
- if (acceptedQuery.includes(key)) {
630
- // @ts-expect-error
631
- querystring[key] = params[key];
632
- }
633
- else if (acceptedPath.includes(key)) {
484
+ if (acceptedPath.includes(key)) {
634
485
  continue;
635
486
  }
636
487
  else if (key !== 'body') {
637
- body = body !== null && body !== void 0 ? body : {};
638
488
  // @ts-expect-error
639
- body[key] = params[key];
489
+ querystring[key] = params[key];
640
490
  }
641
491
  }
642
492
  let method = '';
@@ -652,25 +502,17 @@ class Security {
652
502
  return await this.transport.request({ path, method, querystring, body }, options);
653
503
  }
654
504
  async getServiceAccounts(params, options) {
655
- var _a;
656
505
  const acceptedPath = ['namespace', 'service'];
657
- const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
658
506
  const querystring = {};
659
- // @ts-expect-error
660
- let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
507
+ const body = undefined;
661
508
  params = params !== null && params !== void 0 ? params : {};
662
509
  for (const key in params) {
663
- if (acceptedQuery.includes(key)) {
664
- // @ts-expect-error
665
- querystring[key] = params[key];
666
- }
667
- else if (acceptedPath.includes(key)) {
510
+ if (acceptedPath.includes(key)) {
668
511
  continue;
669
512
  }
670
513
  else if (key !== 'body') {
671
- body = body !== null && body !== void 0 ? body : {};
672
514
  // @ts-expect-error
673
- body[key] = params[key];
515
+ querystring[key] = params[key];
674
516
  }
675
517
  }
676
518
  let method = '';
@@ -690,24 +532,16 @@ class Security {
690
532
  return await this.transport.request({ path, method, querystring, body }, options);
691
533
  }
692
534
  async getServiceCredentials(params, options) {
693
- var _a;
694
535
  const acceptedPath = ['namespace', 'service'];
695
- const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
696
536
  const querystring = {};
697
- // @ts-expect-error
698
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
537
+ const body = undefined;
699
538
  for (const key in params) {
700
- if (acceptedQuery.includes(key)) {
701
- // @ts-expect-error
702
- querystring[key] = params[key];
703
- }
704
- else if (acceptedPath.includes(key)) {
539
+ if (acceptedPath.includes(key)) {
705
540
  continue;
706
541
  }
707
542
  else if (key !== 'body') {
708
- body = body !== null && body !== void 0 ? body : {};
709
543
  // @ts-expect-error
710
- body[key] = params[key];
544
+ querystring[key] = params[key];
711
545
  }
712
546
  }
713
547
  const method = 'GET';
@@ -715,25 +549,31 @@ class Security {
715
549
  return await this.transport.request({ path, method, querystring, body }, options);
716
550
  }
717
551
  async getToken(params, options) {
718
- var _a;
719
552
  const acceptedPath = [];
720
- const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
553
+ const acceptedBody = ['grant_type', 'scope', 'password', 'kerberos_ticket', 'refresh_token', 'username'];
721
554
  const querystring = {};
722
555
  // @ts-expect-error
723
- let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
556
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
557
+ let body;
558
+ if (typeof userBody === 'string') {
559
+ body = userBody;
560
+ }
561
+ else {
562
+ body = userBody != null ? { ...userBody } : undefined;
563
+ }
724
564
  params = params !== null && params !== void 0 ? params : {};
725
565
  for (const key in params) {
726
- if (acceptedQuery.includes(key)) {
566
+ if (acceptedBody.includes(key)) {
567
+ body = body !== null && body !== void 0 ? body : {};
727
568
  // @ts-expect-error
728
- querystring[key] = params[key];
569
+ body[key] = params[key];
729
570
  }
730
571
  else if (acceptedPath.includes(key)) {
731
572
  continue;
732
573
  }
733
574
  else if (key !== 'body') {
734
- body = body !== null && body !== void 0 ? body : {};
735
575
  // @ts-expect-error
736
- body[key] = params[key];
576
+ querystring[key] = params[key];
737
577
  }
738
578
  }
739
579
  const method = 'POST';
@@ -741,25 +581,17 @@ class Security {
741
581
  return await this.transport.request({ path, method, querystring, body }, options);
742
582
  }
743
583
  async getUser(params, options) {
744
- var _a;
745
584
  const acceptedPath = ['username'];
746
- const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
747
585
  const querystring = {};
748
- // @ts-expect-error
749
- let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
586
+ const body = undefined;
750
587
  params = params !== null && params !== void 0 ? params : {};
751
588
  for (const key in params) {
752
- if (acceptedQuery.includes(key)) {
753
- // @ts-expect-error
754
- querystring[key] = params[key];
755
- }
756
- else if (acceptedPath.includes(key)) {
589
+ if (acceptedPath.includes(key)) {
757
590
  continue;
758
591
  }
759
592
  else if (key !== 'body') {
760
- body = body !== null && body !== void 0 ? body : {};
761
593
  // @ts-expect-error
762
- body[key] = params[key];
594
+ querystring[key] = params[key];
763
595
  }
764
596
  }
765
597
  let method = '';
@@ -775,25 +607,17 @@ class Security {
775
607
  return await this.transport.request({ path, method, querystring, body }, options);
776
608
  }
777
609
  async getUserPrivileges(params, options) {
778
- var _a;
779
610
  const acceptedPath = [];
780
- const acceptedQuery = ['application', 'priviledge', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
781
611
  const querystring = {};
782
- // @ts-expect-error
783
- let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
612
+ const body = undefined;
784
613
  params = params !== null && params !== void 0 ? params : {};
785
614
  for (const key in params) {
786
- if (acceptedQuery.includes(key)) {
787
- // @ts-expect-error
788
- querystring[key] = params[key];
789
- }
790
- else if (acceptedPath.includes(key)) {
615
+ if (acceptedPath.includes(key)) {
791
616
  continue;
792
617
  }
793
618
  else if (key !== 'body') {
794
- body = body !== null && body !== void 0 ? body : {};
795
619
  // @ts-expect-error
796
- body[key] = params[key];
620
+ querystring[key] = params[key];
797
621
  }
798
622
  }
799
623
  const method = 'GET';
@@ -801,24 +625,30 @@ class Security {
801
625
  return await this.transport.request({ path, method, querystring, body }, options);
802
626
  }
803
627
  async grantApiKey(params, options) {
804
- var _a;
805
628
  const acceptedPath = [];
806
- const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
629
+ const acceptedBody = ['api_key', 'grant_type', 'access_token', 'username', 'password'];
807
630
  const querystring = {};
808
631
  // @ts-expect-error
809
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
632
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
633
+ let body;
634
+ if (typeof userBody === 'string') {
635
+ body = userBody;
636
+ }
637
+ else {
638
+ body = userBody != null ? { ...userBody } : undefined;
639
+ }
810
640
  for (const key in params) {
811
- if (acceptedQuery.includes(key)) {
641
+ if (acceptedBody.includes(key)) {
642
+ body = body !== null && body !== void 0 ? body : {};
812
643
  // @ts-expect-error
813
- querystring[key] = params[key];
644
+ body[key] = params[key];
814
645
  }
815
646
  else if (acceptedPath.includes(key)) {
816
647
  continue;
817
648
  }
818
649
  else if (key !== 'body') {
819
- body = body !== null && body !== void 0 ? body : {};
820
650
  // @ts-expect-error
821
- body[key] = params[key];
651
+ querystring[key] = params[key];
822
652
  }
823
653
  }
824
654
  const method = 'POST';
@@ -826,25 +656,31 @@ class Security {
826
656
  return await this.transport.request({ path, method, querystring, body }, options);
827
657
  }
828
658
  async hasPrivileges(params, options) {
829
- var _a;
830
659
  const acceptedPath = ['user'];
831
- const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
660
+ const acceptedBody = ['application', 'cluster', 'index'];
832
661
  const querystring = {};
833
662
  // @ts-expect-error
834
- let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
663
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
664
+ let body;
665
+ if (typeof userBody === 'string') {
666
+ body = userBody;
667
+ }
668
+ else {
669
+ body = userBody != null ? { ...userBody } : undefined;
670
+ }
835
671
  params = params !== null && params !== void 0 ? params : {};
836
672
  for (const key in params) {
837
- if (acceptedQuery.includes(key)) {
673
+ if (acceptedBody.includes(key)) {
674
+ body = body !== null && body !== void 0 ? body : {};
838
675
  // @ts-expect-error
839
- querystring[key] = params[key];
676
+ body[key] = params[key];
840
677
  }
841
678
  else if (acceptedPath.includes(key)) {
842
679
  continue;
843
680
  }
844
681
  else if (key !== 'body') {
845
- body = body !== null && body !== void 0 ? body : {};
846
682
  // @ts-expect-error
847
- body[key] = params[key];
683
+ querystring[key] = params[key];
848
684
  }
849
685
  }
850
686
  let method = '';
@@ -860,25 +696,31 @@ class Security {
860
696
  return await this.transport.request({ path, method, querystring, body }, options);
861
697
  }
862
698
  async invalidateApiKey(params, options) {
863
- var _a;
864
699
  const acceptedPath = [];
865
- const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
700
+ const acceptedBody = ['id', 'ids', 'name', 'owner', 'realm_name', 'username'];
866
701
  const querystring = {};
867
702
  // @ts-expect-error
868
- let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
703
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
704
+ let body;
705
+ if (typeof userBody === 'string') {
706
+ body = userBody;
707
+ }
708
+ else {
709
+ body = userBody != null ? { ...userBody } : undefined;
710
+ }
869
711
  params = params !== null && params !== void 0 ? params : {};
870
712
  for (const key in params) {
871
- if (acceptedQuery.includes(key)) {
713
+ if (acceptedBody.includes(key)) {
714
+ body = body !== null && body !== void 0 ? body : {};
872
715
  // @ts-expect-error
873
- querystring[key] = params[key];
716
+ body[key] = params[key];
874
717
  }
875
718
  else if (acceptedPath.includes(key)) {
876
719
  continue;
877
720
  }
878
721
  else if (key !== 'body') {
879
- body = body !== null && body !== void 0 ? body : {};
880
722
  // @ts-expect-error
881
- body[key] = params[key];
723
+ querystring[key] = params[key];
882
724
  }
883
725
  }
884
726
  const method = 'DELETE';
@@ -886,25 +728,31 @@ class Security {
886
728
  return await this.transport.request({ path, method, querystring, body }, options);
887
729
  }
888
730
  async invalidateToken(params, options) {
889
- var _a;
890
731
  const acceptedPath = [];
891
- const acceptedQuery = ['error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
732
+ const acceptedBody = ['token', 'refresh_token', 'realm_name', 'username'];
892
733
  const querystring = {};
893
734
  // @ts-expect-error
894
- let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
735
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
736
+ let body;
737
+ if (typeof userBody === 'string') {
738
+ body = userBody;
739
+ }
740
+ else {
741
+ body = userBody != null ? { ...userBody } : undefined;
742
+ }
895
743
  params = params !== null && params !== void 0 ? params : {};
896
744
  for (const key in params) {
897
- if (acceptedQuery.includes(key)) {
745
+ if (acceptedBody.includes(key)) {
746
+ body = body !== null && body !== void 0 ? body : {};
898
747
  // @ts-expect-error
899
- querystring[key] = params[key];
748
+ body[key] = params[key];
900
749
  }
901
750
  else if (acceptedPath.includes(key)) {
902
751
  continue;
903
752
  }
904
753
  else if (key !== 'body') {
905
- body = body !== null && body !== void 0 ? body : {};
906
754
  // @ts-expect-error
907
- body[key] = params[key];
755
+ querystring[key] = params[key];
908
756
  }
909
757
  }
910
758
  const method = 'DELETE';
@@ -914,21 +762,21 @@ class Security {
914
762
  async putPrivileges(params, options) {
915
763
  var _a;
916
764
  const acceptedPath = [];
917
- const acceptedQuery = ['refresh', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
765
+ const acceptedBody = ['privileges'];
918
766
  const querystring = {};
919
767
  // @ts-expect-error
920
768
  let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
921
769
  for (const key in params) {
922
- if (acceptedQuery.includes(key)) {
770
+ if (acceptedBody.includes(key)) {
923
771
  // @ts-expect-error
924
- querystring[key] = params[key];
772
+ body = params[key];
925
773
  }
926
774
  else if (acceptedPath.includes(key)) {
927
775
  continue;
928
776
  }
929
777
  else if (key !== 'body') {
930
778
  // @ts-expect-error
931
- body = params[key];
779
+ querystring[key] = params[key];
932
780
  }
933
781
  }
934
782
  const method = 'PUT';
@@ -936,24 +784,30 @@ class Security {
936
784
  return await this.transport.request({ path, method, querystring, body }, options);
937
785
  }
938
786
  async putRole(params, options) {
939
- var _a;
940
787
  const acceptedPath = ['name'];
941
- const acceptedQuery = ['refresh', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
788
+ const acceptedBody = ['applications', 'cluster', 'global', 'indices', 'metadata', 'run_as', 'transient_metadata'];
942
789
  const querystring = {};
943
790
  // @ts-expect-error
944
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
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
+ }
945
799
  for (const key in params) {
946
- if (acceptedQuery.includes(key)) {
800
+ if (acceptedBody.includes(key)) {
801
+ body = body !== null && body !== void 0 ? body : {};
947
802
  // @ts-expect-error
948
- querystring[key] = params[key];
803
+ body[key] = params[key];
949
804
  }
950
805
  else if (acceptedPath.includes(key)) {
951
806
  continue;
952
807
  }
953
808
  else if (key !== 'body') {
954
- body = body !== null && body !== void 0 ? body : {};
955
809
  // @ts-expect-error
956
- body[key] = params[key];
810
+ querystring[key] = params[key];
957
811
  }
958
812
  }
959
813
  const method = 'PUT';
@@ -961,24 +815,30 @@ class Security {
961
815
  return await this.transport.request({ path, method, querystring, body }, options);
962
816
  }
963
817
  async putRoleMapping(params, options) {
964
- var _a;
965
818
  const acceptedPath = ['name'];
966
- const acceptedQuery = ['refresh', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
819
+ const acceptedBody = ['enabled', 'metadata', 'roles', 'rules', 'run_as'];
967
820
  const querystring = {};
968
821
  // @ts-expect-error
969
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
822
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
823
+ let body;
824
+ if (typeof userBody === 'string') {
825
+ body = userBody;
826
+ }
827
+ else {
828
+ body = userBody != null ? { ...userBody } : undefined;
829
+ }
970
830
  for (const key in params) {
971
- if (acceptedQuery.includes(key)) {
831
+ if (acceptedBody.includes(key)) {
832
+ body = body !== null && body !== void 0 ? body : {};
972
833
  // @ts-expect-error
973
- querystring[key] = params[key];
834
+ body[key] = params[key];
974
835
  }
975
836
  else if (acceptedPath.includes(key)) {
976
837
  continue;
977
838
  }
978
839
  else if (key !== 'body') {
979
- body = body !== null && body !== void 0 ? body : {};
980
840
  // @ts-expect-error
981
- body[key] = params[key];
841
+ querystring[key] = params[key];
982
842
  }
983
843
  }
984
844
  const method = 'PUT';
@@ -986,24 +846,30 @@ class Security {
986
846
  return await this.transport.request({ path, method, querystring, body }, options);
987
847
  }
988
848
  async putUser(params, options) {
989
- var _a;
990
849
  const acceptedPath = [];
991
- const acceptedQuery = ['refresh', 'error_trace', 'filter_path', 'human', 'pretty', 'source_query_string'];
850
+ const acceptedBody = ['username', 'email', 'full_name', 'metadata', 'password', 'password_hash', 'roles', 'enabled'];
992
851
  const querystring = {};
993
852
  // @ts-expect-error
994
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
853
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
854
+ let body;
855
+ if (typeof userBody === 'string') {
856
+ body = userBody;
857
+ }
858
+ else {
859
+ body = userBody != null ? { ...userBody } : undefined;
860
+ }
995
861
  for (const key in params) {
996
- if (acceptedQuery.includes(key)) {
862
+ if (acceptedBody.includes(key)) {
863
+ body = body !== null && body !== void 0 ? body : {};
997
864
  // @ts-expect-error
998
- querystring[key] = params[key];
865
+ body[key] = params[key];
999
866
  }
1000
867
  else if (acceptedPath.includes(key)) {
1001
868
  continue;
1002
869
  }
1003
870
  else if (key !== 'body') {
1004
- body = body !== null && body !== void 0 ? body : {};
1005
871
  // @ts-expect-error
1006
- body[key] = params[key];
872
+ querystring[key] = params[key];
1007
873
  }
1008
874
  }
1009
875
  const method = 'PUT';
@@ -1011,22 +877,31 @@ class Security {
1011
877
  return await this.transport.request({ path, method, querystring, body }, options);
1012
878
  }
1013
879
  async queryApiKeys(params, options) {
1014
- var _a;
1015
880
  const acceptedPath = [];
1016
- const acceptedQuery = [];
881
+ const acceptedBody = ['query', 'from', 'sort', 'size', 'search_after'];
1017
882
  const querystring = {};
1018
- let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
883
+ // @ts-expect-error
884
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
885
+ let body;
886
+ if (typeof userBody === 'string') {
887
+ body = userBody;
888
+ }
889
+ else {
890
+ body = userBody != null ? { ...userBody } : undefined;
891
+ }
1019
892
  params = params !== null && params !== void 0 ? params : {};
1020
893
  for (const key in params) {
1021
- if (acceptedQuery.includes(key)) {
1022
- querystring[key] = params[key];
894
+ if (acceptedBody.includes(key)) {
895
+ body = body !== null && body !== void 0 ? body : {};
896
+ // @ts-expect-error
897
+ body[key] = params[key];
1023
898
  }
1024
899
  else if (acceptedPath.includes(key)) {
1025
900
  continue;
1026
901
  }
1027
902
  else if (key !== 'body') {
1028
- body = body !== null && body !== void 0 ? body : {};
1029
- body[key] = params[key];
903
+ // @ts-expect-error
904
+ querystring[key] = params[key];
1030
905
  }
1031
906
  }
1032
907
  const method = body != null ? 'POST' : 'GET';
@@ -1034,22 +909,30 @@ class Security {
1034
909
  return await this.transport.request({ path, method, querystring, body }, options);
1035
910
  }
1036
911
  async samlAuthenticate(params, options) {
1037
- var _a;
1038
912
  const acceptedPath = [];
1039
- const acceptedQuery = [];
913
+ const acceptedBody = ['content', 'ids', 'realm'];
1040
914
  const querystring = {};
1041
- let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
1042
- params = params !== null && params !== void 0 ? params : {};
915
+ // @ts-expect-error
916
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
917
+ let body;
918
+ if (typeof userBody === 'string') {
919
+ body = userBody;
920
+ }
921
+ else {
922
+ body = userBody != null ? { ...userBody } : undefined;
923
+ }
1043
924
  for (const key in params) {
1044
- if (acceptedQuery.includes(key)) {
1045
- querystring[key] = params[key];
925
+ if (acceptedBody.includes(key)) {
926
+ body = body !== null && body !== void 0 ? body : {};
927
+ // @ts-expect-error
928
+ body[key] = params[key];
1046
929
  }
1047
930
  else if (acceptedPath.includes(key)) {
1048
931
  continue;
1049
932
  }
1050
933
  else if (key !== 'body') {
1051
- body = body !== null && body !== void 0 ? body : {};
1052
- body[key] = params[key];
934
+ // @ts-expect-error
935
+ querystring[key] = params[key];
1053
936
  }
1054
937
  }
1055
938
  const method = 'POST';
@@ -1057,22 +940,30 @@ class Security {
1057
940
  return await this.transport.request({ path, method, querystring, body }, options);
1058
941
  }
1059
942
  async samlCompleteLogout(params, options) {
1060
- var _a;
1061
943
  const acceptedPath = [];
1062
- const acceptedQuery = [];
944
+ const acceptedBody = ['realm', 'ids', 'query_string', 'content'];
1063
945
  const querystring = {};
1064
- let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
1065
- params = params !== null && params !== void 0 ? params : {};
946
+ // @ts-expect-error
947
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
948
+ let body;
949
+ if (typeof userBody === 'string') {
950
+ body = userBody;
951
+ }
952
+ else {
953
+ body = userBody != null ? { ...userBody } : undefined;
954
+ }
1066
955
  for (const key in params) {
1067
- if (acceptedQuery.includes(key)) {
1068
- querystring[key] = params[key];
956
+ if (acceptedBody.includes(key)) {
957
+ body = body !== null && body !== void 0 ? body : {};
958
+ // @ts-expect-error
959
+ body[key] = params[key];
1069
960
  }
1070
961
  else if (acceptedPath.includes(key)) {
1071
962
  continue;
1072
963
  }
1073
964
  else if (key !== 'body') {
1074
- body = body !== null && body !== void 0 ? body : {};
1075
- body[key] = params[key];
965
+ // @ts-expect-error
966
+ querystring[key] = params[key];
1076
967
  }
1077
968
  }
1078
969
  const method = 'POST';
@@ -1080,22 +971,30 @@ class Security {
1080
971
  return await this.transport.request({ path, method, querystring, body }, options);
1081
972
  }
1082
973
  async samlInvalidate(params, options) {
1083
- var _a;
1084
974
  const acceptedPath = [];
1085
- const acceptedQuery = [];
975
+ const acceptedBody = ['acs', 'query_string', 'realm'];
1086
976
  const querystring = {};
1087
- let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
1088
- params = params !== null && params !== void 0 ? params : {};
977
+ // @ts-expect-error
978
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
979
+ let body;
980
+ if (typeof userBody === 'string') {
981
+ body = userBody;
982
+ }
983
+ else {
984
+ body = userBody != null ? { ...userBody } : undefined;
985
+ }
1089
986
  for (const key in params) {
1090
- if (acceptedQuery.includes(key)) {
1091
- querystring[key] = params[key];
987
+ if (acceptedBody.includes(key)) {
988
+ body = body !== null && body !== void 0 ? body : {};
989
+ // @ts-expect-error
990
+ body[key] = params[key];
1092
991
  }
1093
992
  else if (acceptedPath.includes(key)) {
1094
993
  continue;
1095
994
  }
1096
995
  else if (key !== 'body') {
1097
- body = body !== null && body !== void 0 ? body : {};
1098
- body[key] = params[key];
996
+ // @ts-expect-error
997
+ querystring[key] = params[key];
1099
998
  }
1100
999
  }
1101
1000
  const method = 'POST';
@@ -1103,22 +1002,30 @@ class Security {
1103
1002
  return await this.transport.request({ path, method, querystring, body }, options);
1104
1003
  }
1105
1004
  async samlLogout(params, options) {
1106
- var _a;
1107
1005
  const acceptedPath = [];
1108
- const acceptedQuery = [];
1006
+ const acceptedBody = ['token', 'refresh_token'];
1109
1007
  const querystring = {};
1110
- let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
1111
- params = params !== null && params !== void 0 ? params : {};
1008
+ // @ts-expect-error
1009
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1010
+ let body;
1011
+ if (typeof userBody === 'string') {
1012
+ body = userBody;
1013
+ }
1014
+ else {
1015
+ body = userBody != null ? { ...userBody } : undefined;
1016
+ }
1112
1017
  for (const key in params) {
1113
- if (acceptedQuery.includes(key)) {
1114
- querystring[key] = params[key];
1018
+ if (acceptedBody.includes(key)) {
1019
+ body = body !== null && body !== void 0 ? body : {};
1020
+ // @ts-expect-error
1021
+ body[key] = params[key];
1115
1022
  }
1116
1023
  else if (acceptedPath.includes(key)) {
1117
1024
  continue;
1118
1025
  }
1119
1026
  else if (key !== 'body') {
1120
- body = body !== null && body !== void 0 ? body : {};
1121
- body[key] = params[key];
1027
+ // @ts-expect-error
1028
+ querystring[key] = params[key];
1122
1029
  }
1123
1030
  }
1124
1031
  const method = 'POST';
@@ -1126,22 +1033,31 @@ class Security {
1126
1033
  return await this.transport.request({ path, method, querystring, body }, options);
1127
1034
  }
1128
1035
  async samlPrepareAuthentication(params, options) {
1129
- var _a;
1130
1036
  const acceptedPath = [];
1131
- const acceptedQuery = [];
1037
+ const acceptedBody = ['acs', 'realm', 'relay_state'];
1132
1038
  const querystring = {};
1133
- let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
1039
+ // @ts-expect-error
1040
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1041
+ let body;
1042
+ if (typeof userBody === 'string') {
1043
+ body = userBody;
1044
+ }
1045
+ else {
1046
+ body = userBody != null ? { ...userBody } : undefined;
1047
+ }
1134
1048
  params = params !== null && params !== void 0 ? params : {};
1135
1049
  for (const key in params) {
1136
- if (acceptedQuery.includes(key)) {
1137
- querystring[key] = params[key];
1050
+ if (acceptedBody.includes(key)) {
1051
+ body = body !== null && body !== void 0 ? body : {};
1052
+ // @ts-expect-error
1053
+ body[key] = params[key];
1138
1054
  }
1139
1055
  else if (acceptedPath.includes(key)) {
1140
1056
  continue;
1141
1057
  }
1142
1058
  else if (key !== 'body') {
1143
- body = body !== null && body !== void 0 ? body : {};
1144
- body[key] = params[key];
1059
+ // @ts-expect-error
1060
+ querystring[key] = params[key];
1145
1061
  }
1146
1062
  }
1147
1063
  const method = 'POST';
@@ -1149,22 +1065,16 @@ class Security {
1149
1065
  return await this.transport.request({ path, method, querystring, body }, options);
1150
1066
  }
1151
1067
  async samlServiceProviderMetadata(params, options) {
1152
- var _a;
1153
1068
  const acceptedPath = ['realm_name'];
1154
- const acceptedQuery = [];
1155
1069
  const querystring = {};
1156
- let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
1157
- params = params !== null && params !== void 0 ? params : {};
1070
+ const body = undefined;
1158
1071
  for (const key in params) {
1159
- if (acceptedQuery.includes(key)) {
1160
- querystring[key] = params[key];
1161
- }
1162
- else if (acceptedPath.includes(key)) {
1072
+ if (acceptedPath.includes(key)) {
1163
1073
  continue;
1164
1074
  }
1165
1075
  else if (key !== 'body') {
1166
- body = body !== null && body !== void 0 ? body : {};
1167
- body[key] = params[key];
1076
+ // @ts-expect-error
1077
+ querystring[key] = params[key];
1168
1078
  }
1169
1079
  }
1170
1080
  const method = 'GET';