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