@opensearch-project/opensearch 1.1.0 → 2.1.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 (94) hide show
  1. package/.eslintignore +2 -0
  2. package/.eslintrc.json +31 -0
  3. package/.prettierrc.json +5 -0
  4. package/.whitesource +15 -0
  5. package/ADMINS.md +13 -31
  6. package/CHANGELOG.md +24 -0
  7. package/COMPATIBILITY.md +27 -0
  8. package/DEVELOPER_GUIDE.md +22 -5
  9. package/MAINTAINERS.md +15 -70
  10. package/Makefile +2 -12
  11. package/README.md +19 -123
  12. package/RELEASING.md +3 -3
  13. package/SECURITY.md +1 -1
  14. package/USER_GUIDE.md +197 -0
  15. package/api/api/bulk.js +54 -28
  16. package/api/api/cat.js +355 -266
  17. package/api/api/clear_scroll.js +18 -19
  18. package/api/api/cluster.js +367 -221
  19. package/api/api/count.js +56 -26
  20. package/api/api/create.js +51 -26
  21. package/api/api/dangling_indices.js +96 -53
  22. package/api/api/delete.js +50 -24
  23. package/api/api/delete_by_query.js +89 -27
  24. package/api/api/delete_by_query_rethrottle.js +34 -21
  25. package/api/api/delete_script.js +32 -19
  26. package/api/api/exists.js +56 -24
  27. package/api/api/exists_source.js +61 -29
  28. package/api/api/explain.js +61 -24
  29. package/api/api/features.js +57 -37
  30. package/api/api/field_caps.js +37 -20
  31. package/api/api/get.js +56 -24
  32. package/api/api/get_script.js +31 -19
  33. package/api/api/get_script_context.js +16 -17
  34. package/api/api/get_script_languages.js +16 -17
  35. package/api/api/get_source.js +56 -24
  36. package/api/api/index.js +61 -30
  37. package/api/api/indices.js +1069 -859
  38. package/api/api/info.js +16 -17
  39. package/api/api/ingest.js +133 -98
  40. package/api/api/mget.js +51 -28
  41. package/api/api/msearch.js +50 -28
  42. package/api/api/msearch_template.js +54 -28
  43. package/api/api/mtermvectors.js +49 -26
  44. package/api/api/nodes.js +282 -156
  45. package/api/api/ping.js +16 -17
  46. package/api/api/put_script.js +41 -27
  47. package/api/api/rank_eval.js +38 -22
  48. package/api/api/reindex.js +39 -19
  49. package/api/api/reindex_rethrottle.js +33 -21
  50. package/api/api/render_search_template.js +19 -20
  51. package/api/api/scripts_painless_execute.js +16 -17
  52. package/api/api/scroll.js +32 -19
  53. package/api/api/search.js +109 -26
  54. package/api/api/search_shards.js +37 -20
  55. package/api/api/search_template.js +65 -28
  56. package/api/api/shutdown.js +67 -56
  57. package/api/api/snapshot.js +348 -226
  58. package/api/api/tasks.js +66 -48
  59. package/api/api/terms_enum.js +18 -19
  60. package/api/api/termvectors.js +58 -28
  61. package/api/api/update.js +65 -26
  62. package/api/api/update_by_query.js +90 -25
  63. package/api/api/update_by_query_rethrottle.js +34 -21
  64. package/api/index.js +268 -181
  65. package/api/new.d.ts +2043 -531
  66. package/api/opensearch_dashboards.d.ts +240 -238
  67. package/api/requestParams.d.ts +302 -71
  68. package/api/types.d.ts +6205 -5721
  69. package/api/utils.js +23 -24
  70. package/codecov.yml +2 -2
  71. package/index.d.ts +5203 -1037
  72. package/index.js +154 -143
  73. package/index.mjs +10 -11
  74. package/jenkins/release.JenkinsFile +11 -0
  75. package/lib/Connection.d.ts +38 -28
  76. package/lib/Connection.js +166 -170
  77. package/lib/Helpers.d.ts +108 -68
  78. package/lib/Helpers.js +401 -378
  79. package/lib/Serializer.d.ts +3 -4
  80. package/lib/Serializer.js +40 -41
  81. package/lib/Transport.d.ts +39 -15
  82. package/lib/Transport.js +381 -337
  83. package/lib/aws/AwsSigv4Signer.js +167 -0
  84. package/lib/aws/errors.js +24 -0
  85. package/lib/aws/index.d.ts +39 -0
  86. package/lib/aws/index.js +19 -0
  87. package/lib/errors.d.ts +26 -9
  88. package/lib/errors.js +76 -73
  89. package/lib/pool/BaseConnectionPool.js +101 -99
  90. package/lib/pool/CloudConnectionPool.js +17 -18
  91. package/lib/pool/ConnectionPool.js +106 -107
  92. package/lib/pool/index.d.ts +9 -8
  93. package/lib/pool/index.js +7 -8
  94. package/package.json +37 -15
package/api/api/cat.js CHANGED
@@ -1,12 +1,11 @@
1
1
  /*
2
+ * Copyright OpenSearch Contributors
2
3
  * SPDX-License-Identifier: Apache-2.0
3
4
  *
4
5
  * The OpenSearch Contributors require contributions made to
5
6
  * this file be licensed under the Apache-2.0 license or a
6
7
  * compatible open source license.
7
8
  *
8
- * Modifications Copyright OpenSearch Contributors. See
9
- * GitHub history for details.
10
9
  */
11
10
 
12
11
  /*
@@ -28,33 +27,84 @@
28
27
  * under the License.
29
28
  */
30
29
 
31
- 'use strict'
30
+ 'use strict';
32
31
 
33
32
  /* eslint camelcase: 0 */
34
33
  /* eslint no-unused-vars: 0 */
35
34
 
36
- const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
37
- const acceptedQuerystring = ['format', 'local', 'h', 'help', 's', 'v', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'bytes', 'master_timeout', 'fields', 'time', 'ts', 'health', 'pri', 'include_unloaded_segments', 'allow_no_match', 'allow_no_datafeeds', 'allow_no_jobs', 'from', 'size', 'full_id', 'include_bootstrap', 'active_only', 'detailed', 'index', 'ignore_unavailable', 'nodes', 'actions', 'parent_task_id']
38
- const snakeCase = { expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', masterTimeout: 'master_timeout', includeUnloadedSegments: 'include_unloaded_segments', allowNoMatch: 'allow_no_match', allowNoDatafeeds: 'allow_no_datafeeds', allowNoJobs: 'allow_no_jobs', fullId: 'full_id', includeBootstrap: 'include_bootstrap', activeOnly: 'active_only', ignoreUnavailable: 'ignore_unavailable', parentTaskId: 'parent_task_id' }
39
-
40
- function CatApi (transport, ConfigurationError) {
41
- this.transport = transport
42
- this[kConfigurationError] = ConfigurationError
35
+ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
36
+ const acceptedQuerystring = [
37
+ 'format',
38
+ 'local',
39
+ 'h',
40
+ 'help',
41
+ 's',
42
+ 'v',
43
+ 'expand_wildcards',
44
+ 'pretty',
45
+ 'human',
46
+ 'error_trace',
47
+ 'source',
48
+ 'filter_path',
49
+ 'bytes',
50
+ 'cluster_manager_timeout',
51
+ 'master_timeout',
52
+ 'fields',
53
+ 'time',
54
+ 'ts',
55
+ 'health',
56
+ 'pri',
57
+ 'include_unloaded_segments',
58
+ 'allow_no_match',
59
+ 'allow_no_datafeeds',
60
+ 'allow_no_jobs',
61
+ 'from',
62
+ 'size',
63
+ 'full_id',
64
+ 'include_bootstrap',
65
+ 'active_only',
66
+ 'detailed',
67
+ 'index',
68
+ 'ignore_unavailable',
69
+ 'nodes',
70
+ 'actions',
71
+ 'parent_task_id',
72
+ ];
73
+ const snakeCase = {
74
+ expandWildcards: 'expand_wildcards',
75
+ errorTrace: 'error_trace',
76
+ filterPath: 'filter_path',
77
+ clusterManagerTimeout: 'cluster_manager_timeout',
78
+ masterTimeout: 'master_timeout',
79
+ includeUnloadedSegments: 'include_unloaded_segments',
80
+ allowNoMatch: 'allow_no_match',
81
+ allowNoDatafeeds: 'allow_no_datafeeds',
82
+ allowNoJobs: 'allow_no_jobs',
83
+ fullId: 'full_id',
84
+ includeBootstrap: 'include_bootstrap',
85
+ activeOnly: 'active_only',
86
+ ignoreUnavailable: 'ignore_unavailable',
87
+ parentTaskId: 'parent_task_id',
88
+ };
89
+
90
+ function CatApi(transport, ConfigurationError) {
91
+ this.transport = transport;
92
+ this[kConfigurationError] = ConfigurationError;
43
93
  }
44
94
 
45
- CatApi.prototype.aliases = function catAliasesApi (params, options, callback) {
46
- ;[params, options, callback] = normalizeArguments(params, options, callback)
95
+ CatApi.prototype.aliases = function catAliasesApi(params, options, callback) {
96
+ [params, options, callback] = normalizeArguments(params, options, callback);
47
97
 
48
- let { method, body, name, ...querystring } = params
49
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
98
+ let { method, body, name, ...querystring } = params;
99
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
50
100
 
51
- let path = ''
52
- if ((name) != null) {
53
- if (method == null) method = 'GET'
54
- path = '/' + '_cat' + '/' + 'aliases' + '/' + encodeURIComponent(name)
101
+ let path = '';
102
+ if (name != null) {
103
+ if (method == null) method = 'GET';
104
+ path = '/' + '_cat' + '/' + 'aliases' + '/' + encodeURIComponent(name);
55
105
  } else {
56
- if (method == null) method = 'GET'
57
- path = '/' + '_cat' + '/' + 'aliases'
106
+ if (method == null) method = 'GET';
107
+ path = '/' + '_cat' + '/' + 'aliases';
58
108
  }
59
109
 
60
110
  // build request object
@@ -62,25 +112,25 @@ CatApi.prototype.aliases = function catAliasesApi (params, options, callback) {
62
112
  method,
63
113
  path,
64
114
  body: null,
65
- querystring
66
- }
115
+ querystring,
116
+ };
67
117
 
68
- return this.transport.request(request, options, callback)
69
- }
118
+ return this.transport.request(request, options, callback);
119
+ };
70
120
 
71
- CatApi.prototype.allocation = function catAllocationApi (params, options, callback) {
72
- ;[params, options, callback] = normalizeArguments(params, options, callback)
121
+ CatApi.prototype.allocation = function catAllocationApi(params, options, callback) {
122
+ [params, options, callback] = normalizeArguments(params, options, callback);
73
123
 
74
- let { method, body, nodeId, node_id, ...querystring } = params
75
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
124
+ let { method, body, nodeId, node_id, ...querystring } = params;
125
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
76
126
 
77
- let path = ''
127
+ let path = '';
78
128
  if ((node_id || nodeId) != null) {
79
- if (method == null) method = 'GET'
80
- path = '/' + '_cat' + '/' + 'allocation' + '/' + encodeURIComponent(node_id || nodeId)
129
+ if (method == null) method = 'GET';
130
+ path = '/' + '_cat' + '/' + 'allocation' + '/' + encodeURIComponent(node_id || nodeId);
81
131
  } else {
82
- if (method == null) method = 'GET'
83
- path = '/' + '_cat' + '/' + 'allocation'
132
+ if (method == null) method = 'GET';
133
+ path = '/' + '_cat' + '/' + 'allocation';
84
134
  }
85
135
 
86
136
  // build request object
@@ -88,25 +138,25 @@ CatApi.prototype.allocation = function catAllocationApi (params, options, callba
88
138
  method,
89
139
  path,
90
140
  body: null,
91
- querystring
92
- }
141
+ querystring,
142
+ };
93
143
 
94
- return this.transport.request(request, options, callback)
95
- }
144
+ return this.transport.request(request, options, callback);
145
+ };
96
146
 
97
- CatApi.prototype.count = function catCountApi (params, options, callback) {
98
- ;[params, options, callback] = normalizeArguments(params, options, callback)
147
+ CatApi.prototype.count = function catCountApi(params, options, callback) {
148
+ [params, options, callback] = normalizeArguments(params, options, callback);
99
149
 
100
- let { method, body, index, ...querystring } = params
101
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
150
+ let { method, body, index, ...querystring } = params;
151
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
102
152
 
103
- let path = ''
104
- if ((index) != null) {
105
- if (method == null) method = 'GET'
106
- path = '/' + '_cat' + '/' + 'count' + '/' + encodeURIComponent(index)
153
+ let path = '';
154
+ if (index != null) {
155
+ if (method == null) method = 'GET';
156
+ path = '/' + '_cat' + '/' + 'count' + '/' + encodeURIComponent(index);
107
157
  } else {
108
- if (method == null) method = 'GET'
109
- path = '/' + '_cat' + '/' + 'count'
158
+ if (method == null) method = 'GET';
159
+ path = '/' + '_cat' + '/' + 'count';
110
160
  }
111
161
 
112
162
  // build request object
@@ -114,25 +164,25 @@ CatApi.prototype.count = function catCountApi (params, options, callback) {
114
164
  method,
115
165
  path,
116
166
  body: null,
117
- querystring
118
- }
167
+ querystring,
168
+ };
119
169
 
120
- return this.transport.request(request, options, callback)
121
- }
170
+ return this.transport.request(request, options, callback);
171
+ };
122
172
 
123
- CatApi.prototype.fielddata = function catFielddataApi (params, options, callback) {
124
- ;[params, options, callback] = normalizeArguments(params, options, callback)
173
+ CatApi.prototype.fielddata = function catFielddataApi(params, options, callback) {
174
+ [params, options, callback] = normalizeArguments(params, options, callback);
125
175
 
126
- let { method, body, fields, ...querystring } = params
127
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
176
+ let { method, body, fields, ...querystring } = params;
177
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
128
178
 
129
- let path = ''
130
- if ((fields) != null) {
131
- if (method == null) method = 'GET'
132
- path = '/' + '_cat' + '/' + 'fielddata' + '/' + encodeURIComponent(fields)
179
+ let path = '';
180
+ if (fields != null) {
181
+ if (method == null) method = 'GET';
182
+ path = '/' + '_cat' + '/' + 'fielddata' + '/' + encodeURIComponent(fields);
133
183
  } else {
134
- if (method == null) method = 'GET'
135
- path = '/' + '_cat' + '/' + 'fielddata'
184
+ if (method == null) method = 'GET';
185
+ path = '/' + '_cat' + '/' + 'fielddata';
136
186
  }
137
187
 
138
188
  // build request object
@@ -140,67 +190,67 @@ CatApi.prototype.fielddata = function catFielddataApi (params, options, callback
140
190
  method,
141
191
  path,
142
192
  body: null,
143
- querystring
144
- }
193
+ querystring,
194
+ };
145
195
 
146
- return this.transport.request(request, options, callback)
147
- }
196
+ return this.transport.request(request, options, callback);
197
+ };
148
198
 
149
- CatApi.prototype.health = function catHealthApi (params, options, callback) {
150
- ;[params, options, callback] = normalizeArguments(params, options, callback)
199
+ CatApi.prototype.health = function catHealthApi(params, options, callback) {
200
+ [params, options, callback] = normalizeArguments(params, options, callback);
151
201
 
152
- let { method, body, ...querystring } = params
153
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
202
+ let { method, body, ...querystring } = params;
203
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
154
204
 
155
- let path = ''
156
- if (method == null) method = 'GET'
157
- path = '/' + '_cat' + '/' + 'health'
205
+ let path = '';
206
+ if (method == null) method = 'GET';
207
+ path = '/' + '_cat' + '/' + 'health';
158
208
 
159
209
  // build request object
160
210
  const request = {
161
211
  method,
162
212
  path,
163
213
  body: null,
164
- querystring
165
- }
214
+ querystring,
215
+ };
166
216
 
167
- return this.transport.request(request, options, callback)
168
- }
217
+ return this.transport.request(request, options, callback);
218
+ };
169
219
 
170
- CatApi.prototype.help = function catHelpApi (params, options, callback) {
171
- ;[params, options, callback] = normalizeArguments(params, options, callback)
220
+ CatApi.prototype.help = function catHelpApi(params, options, callback) {
221
+ [params, options, callback] = normalizeArguments(params, options, callback);
172
222
 
173
- let { method, body, ...querystring } = params
174
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
223
+ let { method, body, ...querystring } = params;
224
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
175
225
 
176
- let path = ''
177
- if (method == null) method = 'GET'
178
- path = '/' + '_cat'
226
+ let path = '';
227
+ if (method == null) method = 'GET';
228
+ path = '/' + '_cat';
179
229
 
180
230
  // build request object
181
231
  const request = {
182
232
  method,
183
233
  path,
184
234
  body: null,
185
- querystring
186
- }
235
+ querystring,
236
+ };
187
237
 
188
- return this.transport.request(request, options, callback)
189
- }
238
+ return this.transport.request(request, options, callback);
239
+ };
190
240
 
191
- CatApi.prototype.indices = function catIndicesApi (params, options, callback) {
192
- ;[params, options, callback] = normalizeArguments(params, options, callback)
241
+ CatApi.prototype.indices = function catIndicesApi(params, options, callback) {
242
+ [params, options, callback] = normalizeArguments(params, options, callback);
193
243
 
194
- let { method, body, index, ...querystring } = params
195
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
244
+ let { method, body, index, ...querystring } = params;
245
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
196
246
 
197
- let path = ''
198
- if ((index) != null) {
199
- if (method == null) method = 'GET'
200
- path = '/' + '_cat' + '/' + 'indices' + '/' + encodeURIComponent(index)
247
+ let path = '';
248
+ if (index != null) {
249
+ if (method == null) method = 'GET';
250
+ path = '/' + '_cat' + '/' + 'indices' + '/' + encodeURIComponent(index);
201
251
  } else {
202
- if (method == null) method = 'GET'
203
- path = '/' + '_cat' + '/' + 'indices'
252
+ if (method == null) method = 'GET';
253
+ path = '/' + '_cat' + '/' + 'indices';
204
254
  }
205
255
 
206
256
  // build request object
@@ -208,130 +258,155 @@ CatApi.prototype.indices = function catIndicesApi (params, options, callback) {
208
258
  method,
209
259
  path,
210
260
  body: null,
211
- querystring
212
- }
261
+ querystring,
262
+ };
213
263
 
214
- return this.transport.request(request, options, callback)
215
- }
264
+ return this.transport.request(request, options, callback);
265
+ };
216
266
 
217
- CatApi.prototype.master = function catMasterApi (params, options, callback) {
218
- ;[params, options, callback] = normalizeArguments(params, options, callback)
267
+ CatApi.prototype.cluster_manager = function catClusterManagerApi(params, options, callback) {
268
+ [params, options, callback] = normalizeArguments(params, options, callback);
219
269
 
220
- let { method, body, ...querystring } = params
221
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
270
+ let { method, body, ...querystring } = params;
271
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
222
272
 
223
- let path = ''
224
- if (method == null) method = 'GET'
225
- path = '/' + '_cat' + '/' + 'master'
273
+ let path = '';
274
+ if (method == null) method = 'GET';
275
+ path = '/' + '_cat' + '/' + 'cluster_manager';
226
276
 
227
277
  // build request object
228
278
  const request = {
229
279
  method,
230
280
  path,
231
281
  body: null,
232
- querystring
233
- }
282
+ querystring,
283
+ };
234
284
 
235
- return this.transport.request(request, options, callback)
236
- }
285
+ return this.transport.request(request, options, callback);
286
+ };
237
287
 
238
- CatApi.prototype.nodeattrs = function catNodeattrsApi (params, options, callback) {
239
- ;[params, options, callback] = normalizeArguments(params, options, callback)
288
+ /**
289
+ * // TODO: delete CatApi.prototype.master when it is removed from OpenSearch
290
+ * @deprecated use CatApi.prototype.cluster_manager instead
291
+ */
292
+ CatApi.prototype.master = function catMasterApi(params, options, callback) {
293
+ [params, options, callback] = normalizeArguments(params, options, callback);
240
294
 
241
- let { method, body, ...querystring } = params
242
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
295
+ let { method, body, ...querystring } = params;
296
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
243
297
 
244
- let path = ''
245
- if (method == null) method = 'GET'
246
- path = '/' + '_cat' + '/' + 'nodeattrs'
298
+ let path = '';
299
+ if (method == null) method = 'GET';
300
+ path = '/' + '_cat' + '/' + 'master';
247
301
 
248
302
  // build request object
249
303
  const request = {
250
304
  method,
251
305
  path,
252
306
  body: null,
253
- querystring
254
- }
307
+ querystring,
308
+ };
255
309
 
256
- return this.transport.request(request, options, callback)
257
- }
310
+ return this.transport.request(request, options, callback);
311
+ };
258
312
 
259
- CatApi.prototype.nodes = function catNodesApi (params, options, callback) {
260
- ;[params, options, callback] = normalizeArguments(params, options, callback)
313
+ CatApi.prototype.nodeattrs = function catNodeattrsApi(params, options, callback) {
314
+ [params, options, callback] = normalizeArguments(params, options, callback);
261
315
 
262
- let { method, body, ...querystring } = params
263
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
316
+ let { method, body, ...querystring } = params;
317
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
264
318
 
265
- let path = ''
266
- if (method == null) method = 'GET'
267
- path = '/' + '_cat' + '/' + 'nodes'
319
+ let path = '';
320
+ if (method == null) method = 'GET';
321
+ path = '/' + '_cat' + '/' + 'nodeattrs';
268
322
 
269
323
  // build request object
270
324
  const request = {
271
325
  method,
272
326
  path,
273
327
  body: null,
274
- querystring
275
- }
328
+ querystring,
329
+ };
276
330
 
277
- return this.transport.request(request, options, callback)
278
- }
331
+ return this.transport.request(request, options, callback);
332
+ };
279
333
 
280
- CatApi.prototype.pendingTasks = function catPendingTasksApi (params, options, callback) {
281
- ;[params, options, callback] = normalizeArguments(params, options, callback)
334
+ CatApi.prototype.nodes = function catNodesApi(params, options, callback) {
335
+ [params, options, callback] = normalizeArguments(params, options, callback);
282
336
 
283
- let { method, body, ...querystring } = params
284
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
337
+ let { method, body, ...querystring } = params;
338
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
285
339
 
286
- let path = ''
287
- if (method == null) method = 'GET'
288
- path = '/' + '_cat' + '/' + 'pending_tasks'
340
+ let path = '';
341
+ if (method == null) method = 'GET';
342
+ path = '/' + '_cat' + '/' + 'nodes';
289
343
 
290
344
  // build request object
291
345
  const request = {
292
346
  method,
293
347
  path,
294
348
  body: null,
295
- querystring
296
- }
349
+ querystring,
350
+ };
297
351
 
298
- return this.transport.request(request, options, callback)
299
- }
352
+ return this.transport.request(request, options, callback);
353
+ };
300
354
 
301
- CatApi.prototype.plugins = function catPluginsApi (params, options, callback) {
302
- ;[params, options, callback] = normalizeArguments(params, options, callback)
355
+ CatApi.prototype.pendingTasks = function catPendingTasksApi(params, options, callback) {
356
+ [params, options, callback] = normalizeArguments(params, options, callback);
303
357
 
304
- let { method, body, ...querystring } = params
305
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
358
+ let { method, body, ...querystring } = params;
359
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
306
360
 
307
- let path = ''
308
- if (method == null) method = 'GET'
309
- path = '/' + '_cat' + '/' + 'plugins'
361
+ let path = '';
362
+ if (method == null) method = 'GET';
363
+ path = '/' + '_cat' + '/' + 'pending_tasks';
310
364
 
311
365
  // build request object
312
366
  const request = {
313
367
  method,
314
368
  path,
315
369
  body: null,
316
- querystring
317
- }
370
+ querystring,
371
+ };
318
372
 
319
- return this.transport.request(request, options, callback)
320
- }
373
+ return this.transport.request(request, options, callback);
374
+ };
375
+
376
+ CatApi.prototype.plugins = function catPluginsApi(params, options, callback) {
377
+ [params, options, callback] = normalizeArguments(params, options, callback);
321
378
 
322
- CatApi.prototype.recovery = function catRecoveryApi (params, options, callback) {
323
- ;[params, options, callback] = normalizeArguments(params, options, callback)
379
+ let { method, body, ...querystring } = params;
380
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
324
381
 
325
- let { method, body, index, ...querystring } = params
326
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
382
+ let path = '';
383
+ if (method == null) method = 'GET';
384
+ path = '/' + '_cat' + '/' + 'plugins';
327
385
 
328
- let path = ''
329
- if ((index) != null) {
330
- if (method == null) method = 'GET'
331
- path = '/' + '_cat' + '/' + 'recovery' + '/' + encodeURIComponent(index)
386
+ // build request object
387
+ const request = {
388
+ method,
389
+ path,
390
+ body: null,
391
+ querystring,
392
+ };
393
+
394
+ return this.transport.request(request, options, callback);
395
+ };
396
+
397
+ CatApi.prototype.recovery = function catRecoveryApi(params, options, callback) {
398
+ [params, options, callback] = normalizeArguments(params, options, callback);
399
+
400
+ let { method, body, index, ...querystring } = params;
401
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
402
+
403
+ let path = '';
404
+ if (index != null) {
405
+ if (method == null) method = 'GET';
406
+ path = '/' + '_cat' + '/' + 'recovery' + '/' + encodeURIComponent(index);
332
407
  } else {
333
- if (method == null) method = 'GET'
334
- path = '/' + '_cat' + '/' + 'recovery'
408
+ if (method == null) method = 'GET';
409
+ path = '/' + '_cat' + '/' + 'recovery';
335
410
  }
336
411
 
337
412
  // build request object
@@ -339,46 +414,46 @@ CatApi.prototype.recovery = function catRecoveryApi (params, options, callback)
339
414
  method,
340
415
  path,
341
416
  body: null,
342
- querystring
343
- }
417
+ querystring,
418
+ };
344
419
 
345
- return this.transport.request(request, options, callback)
346
- }
420
+ return this.transport.request(request, options, callback);
421
+ };
347
422
 
348
- CatApi.prototype.repositories = function catRepositoriesApi (params, options, callback) {
349
- ;[params, options, callback] = normalizeArguments(params, options, callback)
423
+ CatApi.prototype.repositories = function catRepositoriesApi(params, options, callback) {
424
+ [params, options, callback] = normalizeArguments(params, options, callback);
350
425
 
351
- let { method, body, ...querystring } = params
352
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
426
+ let { method, body, ...querystring } = params;
427
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
353
428
 
354
- let path = ''
355
- if (method == null) method = 'GET'
356
- path = '/' + '_cat' + '/' + 'repositories'
429
+ let path = '';
430
+ if (method == null) method = 'GET';
431
+ path = '/' + '_cat' + '/' + 'repositories';
357
432
 
358
433
  // build request object
359
434
  const request = {
360
435
  method,
361
436
  path,
362
437
  body: null,
363
- querystring
364
- }
438
+ querystring,
439
+ };
365
440
 
366
- return this.transport.request(request, options, callback)
367
- }
441
+ return this.transport.request(request, options, callback);
442
+ };
368
443
 
369
- CatApi.prototype.segments = function catSegmentsApi (params, options, callback) {
370
- ;[params, options, callback] = normalizeArguments(params, options, callback)
444
+ CatApi.prototype.segments = function catSegmentsApi(params, options, callback) {
445
+ [params, options, callback] = normalizeArguments(params, options, callback);
371
446
 
372
- let { method, body, index, ...querystring } = params
373
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
447
+ let { method, body, index, ...querystring } = params;
448
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
374
449
 
375
- let path = ''
376
- if ((index) != null) {
377
- if (method == null) method = 'GET'
378
- path = '/' + '_cat' + '/' + 'segments' + '/' + encodeURIComponent(index)
450
+ let path = '';
451
+ if (index != null) {
452
+ if (method == null) method = 'GET';
453
+ path = '/' + '_cat' + '/' + 'segments' + '/' + encodeURIComponent(index);
379
454
  } else {
380
- if (method == null) method = 'GET'
381
- path = '/' + '_cat' + '/' + 'segments'
455
+ if (method == null) method = 'GET';
456
+ path = '/' + '_cat' + '/' + 'segments';
382
457
  }
383
458
 
384
459
  // build request object
@@ -386,25 +461,25 @@ CatApi.prototype.segments = function catSegmentsApi (params, options, callback)
386
461
  method,
387
462
  path,
388
463
  body: null,
389
- querystring
390
- }
464
+ querystring,
465
+ };
391
466
 
392
- return this.transport.request(request, options, callback)
393
- }
467
+ return this.transport.request(request, options, callback);
468
+ };
394
469
 
395
- CatApi.prototype.shards = function catShardsApi (params, options, callback) {
396
- ;[params, options, callback] = normalizeArguments(params, options, callback)
470
+ CatApi.prototype.shards = function catShardsApi(params, options, callback) {
471
+ [params, options, callback] = normalizeArguments(params, options, callback);
397
472
 
398
- let { method, body, index, ...querystring } = params
399
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
473
+ let { method, body, index, ...querystring } = params;
474
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
400
475
 
401
- let path = ''
402
- if ((index) != null) {
403
- if (method == null) method = 'GET'
404
- path = '/' + '_cat' + '/' + 'shards' + '/' + encodeURIComponent(index)
476
+ let path = '';
477
+ if (index != null) {
478
+ if (method == null) method = 'GET';
479
+ path = '/' + '_cat' + '/' + 'shards' + '/' + encodeURIComponent(index);
405
480
  } else {
406
- if (method == null) method = 'GET'
407
- path = '/' + '_cat' + '/' + 'shards'
481
+ if (method == null) method = 'GET';
482
+ path = '/' + '_cat' + '/' + 'shards';
408
483
  }
409
484
 
410
485
  // build request object
@@ -412,25 +487,25 @@ CatApi.prototype.shards = function catShardsApi (params, options, callback) {
412
487
  method,
413
488
  path,
414
489
  body: null,
415
- querystring
416
- }
490
+ querystring,
491
+ };
417
492
 
418
- return this.transport.request(request, options, callback)
419
- }
493
+ return this.transport.request(request, options, callback);
494
+ };
420
495
 
421
- CatApi.prototype.snapshots = function catSnapshotsApi (params, options, callback) {
422
- ;[params, options, callback] = normalizeArguments(params, options, callback)
496
+ CatApi.prototype.snapshots = function catSnapshotsApi(params, options, callback) {
497
+ [params, options, callback] = normalizeArguments(params, options, callback);
423
498
 
424
- let { method, body, repository, ...querystring } = params
425
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
499
+ let { method, body, repository, ...querystring } = params;
500
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
426
501
 
427
- let path = ''
428
- if ((repository) != null) {
429
- if (method == null) method = 'GET'
430
- path = '/' + '_cat' + '/' + 'snapshots' + '/' + encodeURIComponent(repository)
502
+ let path = '';
503
+ if (repository != null) {
504
+ if (method == null) method = 'GET';
505
+ path = '/' + '_cat' + '/' + 'snapshots' + '/' + encodeURIComponent(repository);
431
506
  } else {
432
- if (method == null) method = 'GET'
433
- path = '/' + '_cat' + '/' + 'snapshots'
507
+ if (method == null) method = 'GET';
508
+ path = '/' + '_cat' + '/' + 'snapshots';
434
509
  }
435
510
 
436
511
  // build request object
@@ -438,46 +513,46 @@ CatApi.prototype.snapshots = function catSnapshotsApi (params, options, callback
438
513
  method,
439
514
  path,
440
515
  body: null,
441
- querystring
442
- }
516
+ querystring,
517
+ };
443
518
 
444
- return this.transport.request(request, options, callback)
445
- }
519
+ return this.transport.request(request, options, callback);
520
+ };
446
521
 
447
- CatApi.prototype.tasks = function catTasksApi (params, options, callback) {
448
- ;[params, options, callback] = normalizeArguments(params, options, callback)
522
+ CatApi.prototype.tasks = function catTasksApi(params, options, callback) {
523
+ [params, options, callback] = normalizeArguments(params, options, callback);
449
524
 
450
- let { method, body, ...querystring } = params
451
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
525
+ let { method, body, ...querystring } = params;
526
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
452
527
 
453
- let path = ''
454
- if (method == null) method = 'GET'
455
- path = '/' + '_cat' + '/' + 'tasks'
528
+ let path = '';
529
+ if (method == null) method = 'GET';
530
+ path = '/' + '_cat' + '/' + 'tasks';
456
531
 
457
532
  // build request object
458
533
  const request = {
459
534
  method,
460
535
  path,
461
536
  body: null,
462
- querystring
463
- }
537
+ querystring,
538
+ };
464
539
 
465
- return this.transport.request(request, options, callback)
466
- }
540
+ return this.transport.request(request, options, callback);
541
+ };
467
542
 
468
- CatApi.prototype.templates = function catTemplatesApi (params, options, callback) {
469
- ;[params, options, callback] = normalizeArguments(params, options, callback)
543
+ CatApi.prototype.templates = function catTemplatesApi(params, options, callback) {
544
+ [params, options, callback] = normalizeArguments(params, options, callback);
470
545
 
471
- let { method, body, name, ...querystring } = params
472
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
546
+ let { method, body, name, ...querystring } = params;
547
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
473
548
 
474
- let path = ''
475
- if ((name) != null) {
476
- if (method == null) method = 'GET'
477
- path = '/' + '_cat' + '/' + 'templates' + '/' + encodeURIComponent(name)
549
+ let path = '';
550
+ if (name != null) {
551
+ if (method == null) method = 'GET';
552
+ path = '/' + '_cat' + '/' + 'templates' + '/' + encodeURIComponent(name);
478
553
  } else {
479
- if (method == null) method = 'GET'
480
- path = '/' + '_cat' + '/' + 'templates'
554
+ if (method == null) method = 'GET';
555
+ path = '/' + '_cat' + '/' + 'templates';
481
556
  }
482
557
 
483
558
  // build request object
@@ -485,25 +560,31 @@ CatApi.prototype.templates = function catTemplatesApi (params, options, callback
485
560
  method,
486
561
  path,
487
562
  body: null,
488
- querystring
489
- }
563
+ querystring,
564
+ };
490
565
 
491
- return this.transport.request(request, options, callback)
492
- }
566
+ return this.transport.request(request, options, callback);
567
+ };
493
568
 
494
- CatApi.prototype.threadPool = function catThreadPoolApi (params, options, callback) {
495
- ;[params, options, callback] = normalizeArguments(params, options, callback)
569
+ CatApi.prototype.threadPool = function catThreadPoolApi(params, options, callback) {
570
+ [params, options, callback] = normalizeArguments(params, options, callback);
496
571
 
497
- let { method, body, threadPoolPatterns, thread_pool_patterns, ...querystring } = params
498
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
572
+ let { method, body, threadPoolPatterns, thread_pool_patterns, ...querystring } = params;
573
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
499
574
 
500
- let path = ''
575
+ let path = '';
501
576
  if ((thread_pool_patterns || threadPoolPatterns) != null) {
502
- if (method == null) method = 'GET'
503
- path = '/' + '_cat' + '/' + 'thread_pool' + '/' + encodeURIComponent(thread_pool_patterns || threadPoolPatterns)
577
+ if (method == null) method = 'GET';
578
+ path =
579
+ '/' +
580
+ '_cat' +
581
+ '/' +
582
+ 'thread_pool' +
583
+ '/' +
584
+ encodeURIComponent(thread_pool_patterns || threadPoolPatterns);
504
585
  } else {
505
- if (method == null) method = 'GET'
506
- path = '/' + '_cat' + '/' + 'thread_pool'
586
+ if (method == null) method = 'GET';
587
+ path = '/' + '_cat' + '/' + 'thread_pool';
507
588
  }
508
589
 
509
590
  // build request object
@@ -511,15 +592,23 @@ CatApi.prototype.threadPool = function catThreadPoolApi (params, options, callba
511
592
  method,
512
593
  path,
513
594
  body: null,
514
- querystring
515
- }
595
+ querystring,
596
+ };
516
597
 
517
- return this.transport.request(request, options, callback)
518
- }
598
+ return this.transport.request(request, options, callback);
599
+ };
519
600
 
520
601
  Object.defineProperties(CatApi.prototype, {
521
- pending_tasks: { get () { return this.pendingTasks } },
522
- thread_pool: { get () { return this.threadPool } }
523
- })
524
-
525
- module.exports = CatApi
602
+ pending_tasks: {
603
+ get() {
604
+ return this.pendingTasks;
605
+ },
606
+ },
607
+ thread_pool: {
608
+ get() {
609
+ return this.threadPool;
610
+ },
611
+ },
612
+ });
613
+
614
+ module.exports = CatApi;