@elastic/elasticsearch 7.11.0 → 7.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/README.md +4 -2
  2. package/api/api/async_search.js +11 -11
  3. package/api/api/autoscaling.js +12 -12
  4. package/api/api/bulk.js +4 -4
  5. package/api/api/cat.js +127 -127
  6. package/api/api/ccr.js +40 -40
  7. package/api/api/clear_scroll.js +2 -2
  8. package/api/api/close_point_in_time.js +2 -2
  9. package/api/api/cluster.js +36 -36
  10. package/api/api/count.js +3 -3
  11. package/api/api/create.js +5 -5
  12. package/api/api/dangling_indices.js +8 -8
  13. package/api/api/delete.js +4 -4
  14. package/api/api/delete_by_query.js +5 -5
  15. package/api/api/delete_by_query_rethrottle.js +4 -4
  16. package/api/api/delete_script.js +3 -3
  17. package/api/api/enrich.js +14 -14
  18. package/api/api/eql.js +41 -10
  19. package/api/api/exists.js +4 -4
  20. package/api/api/exists_source.js +6 -6
  21. package/api/api/explain.js +4 -4
  22. package/api/api/features.js +81 -0
  23. package/api/api/field_caps.js +2 -2
  24. package/api/api/fleet.js +65 -0
  25. package/api/api/get.js +4 -4
  26. package/api/api/get_script.js +3 -3
  27. package/api/api/get_script_context.js +2 -2
  28. package/api/api/get_script_languages.js +2 -2
  29. package/api/api/get_source.js +4 -4
  30. package/api/api/graph.js +4 -4
  31. package/api/api/ilm.js +50 -28
  32. package/api/api/index.js +4 -4
  33. package/api/api/indices.js +381 -381
  34. package/api/api/info.js +2 -2
  35. package/api/api/ingest.js +37 -15
  36. package/api/api/license.js +14 -14
  37. package/api/api/logstash.js +125 -0
  38. package/api/api/mget.js +4 -4
  39. package/api/api/migration.js +2 -2
  40. package/api/api/ml.js +338 -208
  41. package/api/api/monitoring.js +3 -3
  42. package/api/api/msearch.js +4 -4
  43. package/api/api/msearch_template.js +4 -4
  44. package/api/api/mtermvectors.js +3 -3
  45. package/api/api/nodes.js +12 -12
  46. package/api/api/open_point_in_time.js +2 -2
  47. package/api/api/ping.js +2 -2
  48. package/api/api/put_script.js +5 -5
  49. package/api/api/rank_eval.js +3 -3
  50. package/api/api/reindex.js +3 -3
  51. package/api/api/reindex_rethrottle.js +4 -4
  52. package/api/api/render_search_template.js +2 -2
  53. package/api/api/rollup.js +31 -31
  54. package/api/api/scripts_painless_execute.js +2 -2
  55. package/api/api/scroll.js +2 -2
  56. package/api/api/search.js +5 -5
  57. package/api/api/search_shards.js +2 -2
  58. package/api/api/search_template.js +4 -4
  59. package/api/api/searchable_snapshots.js +42 -15
  60. package/api/api/security.js +464 -86
  61. package/api/api/shutdown.js +124 -0
  62. package/api/api/slm.js +21 -21
  63. package/api/api/snapshot.js +76 -48
  64. package/api/api/sql.js +96 -12
  65. package/api/api/ssl.js +2 -2
  66. package/api/api/tasks.js +7 -7
  67. package/api/api/terms_enum.js +56 -0
  68. package/api/api/termvectors.js +3 -3
  69. package/api/api/text_structure.js +65 -0
  70. package/api/api/transform.js +25 -25
  71. package/api/api/update.js +5 -5
  72. package/api/api/update_by_query.js +4 -4
  73. package/api/api/update_by_query_rethrottle.js +4 -4
  74. package/api/api/watcher.js +29 -29
  75. package/api/api/xpack.js +4 -4
  76. package/api/index.js +179 -120
  77. package/api/new.d.ts +1584 -0
  78. package/api/requestParams.d.ts +203 -7
  79. package/api/types.d.ts +15455 -0
  80. package/api/utils.js +4 -4
  81. package/free-report-junit.xml +3410 -0
  82. package/index.d.ts +326 -23
  83. package/index.js +28 -36
  84. package/lib/Connection.js +6 -4
  85. package/lib/Helpers.d.ts +4 -2
  86. package/lib/Helpers.js +31 -17
  87. package/lib/Serializer.d.ts +5 -0
  88. package/lib/Serializer.js +17 -6
  89. package/lib/Transport.d.ts +4 -2
  90. package/lib/Transport.js +194 -79
  91. package/lib/errors.d.ts +7 -0
  92. package/lib/errors.js +26 -2
  93. package/lib/pool/BaseConnectionPool.js +3 -3
  94. package/lib/pool/ConnectionPool.js +4 -5
  95. package/lib/pool/index.d.ts +5 -0
  96. package/package.json +26 -26
  97. package/api/kibana.d.ts +0 -485
package/api/api/info.js CHANGED
@@ -29,10 +29,10 @@ const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
29
29
  function infoApi (params, options, callback) {
30
30
  ;[params, options, callback] = normalizeArguments(params, options, callback)
31
31
 
32
- var { method, body, ...querystring } = params
32
+ let { method, body, ...querystring } = params
33
33
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
34
34
 
35
- var path = ''
35
+ let path = ''
36
36
  if (method == null) method = 'GET'
37
37
  path = '/'
38
38
 
package/api/api/ingest.js CHANGED
@@ -23,7 +23,7 @@
23
23
  /* eslint no-unused-vars: 0 */
24
24
 
25
25
  const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
26
- const acceptedQuerystring = ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'verbose']
26
+ const acceptedQuerystring = ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'summary', 'verbose']
27
27
  const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' }
28
28
 
29
29
  function IngestApi (transport, ConfigurationError) {
@@ -35,15 +35,15 @@ IngestApi.prototype.deletePipeline = function ingestDeletePipelineApi (params, o
35
35
  ;[params, options, callback] = normalizeArguments(params, options, callback)
36
36
 
37
37
  // check required parameters
38
- if (params['id'] == null) {
38
+ if (params.id == null) {
39
39
  const err = new this[kConfigurationError]('Missing required parameter: id')
40
40
  return handleError(err, callback)
41
41
  }
42
42
 
43
- var { method, body, id, ...querystring } = params
43
+ let { method, body, id, ...querystring } = params
44
44
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
45
45
 
46
- var path = ''
46
+ let path = ''
47
47
  if (method == null) method = 'DELETE'
48
48
  path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
49
49
 
@@ -58,13 +58,34 @@ IngestApi.prototype.deletePipeline = function ingestDeletePipelineApi (params, o
58
58
  return this.transport.request(request, options, callback)
59
59
  }
60
60
 
61
+ IngestApi.prototype.geoIpStats = function ingestGeoIpStatsApi (params, options, callback) {
62
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
63
+
64
+ let { method, body, ...querystring } = params
65
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
66
+
67
+ let path = ''
68
+ if (method == null) method = 'GET'
69
+ path = '/' + '_ingest' + '/' + 'geoip' + '/' + 'stats'
70
+
71
+ // build request object
72
+ const request = {
73
+ method,
74
+ path,
75
+ body: null,
76
+ querystring
77
+ }
78
+
79
+ return this.transport.request(request, options, callback)
80
+ }
81
+
61
82
  IngestApi.prototype.getPipeline = function ingestGetPipelineApi (params, options, callback) {
62
83
  ;[params, options, callback] = normalizeArguments(params, options, callback)
63
84
 
64
- var { method, body, id, ...querystring } = params
85
+ let { method, body, id, ...querystring } = params
65
86
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
66
87
 
67
- var path = ''
88
+ let path = ''
68
89
  if ((id) != null) {
69
90
  if (method == null) method = 'GET'
70
91
  path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
@@ -87,10 +108,10 @@ IngestApi.prototype.getPipeline = function ingestGetPipelineApi (params, options
87
108
  IngestApi.prototype.processorGrok = function ingestProcessorGrokApi (params, options, callback) {
88
109
  ;[params, options, callback] = normalizeArguments(params, options, callback)
89
110
 
90
- var { method, body, ...querystring } = params
111
+ let { method, body, ...querystring } = params
91
112
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
92
113
 
93
- var path = ''
114
+ let path = ''
94
115
  if (method == null) method = 'GET'
95
116
  path = '/' + '_ingest' + '/' + 'processor' + '/' + 'grok'
96
117
 
@@ -109,19 +130,19 @@ IngestApi.prototype.putPipeline = function ingestPutPipelineApi (params, options
109
130
  ;[params, options, callback] = normalizeArguments(params, options, callback)
110
131
 
111
132
  // check required parameters
112
- if (params['id'] == null) {
133
+ if (params.id == null) {
113
134
  const err = new this[kConfigurationError]('Missing required parameter: id')
114
135
  return handleError(err, callback)
115
136
  }
116
- if (params['body'] == null) {
137
+ if (params.body == null) {
117
138
  const err = new this[kConfigurationError]('Missing required parameter: body')
118
139
  return handleError(err, callback)
119
140
  }
120
141
 
121
- var { method, body, id, ...querystring } = params
142
+ let { method, body, id, ...querystring } = params
122
143
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
123
144
 
124
- var path = ''
145
+ let path = ''
125
146
  if (method == null) method = 'PUT'
126
147
  path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
127
148
 
@@ -140,15 +161,15 @@ IngestApi.prototype.simulate = function ingestSimulateApi (params, options, call
140
161
  ;[params, options, callback] = normalizeArguments(params, options, callback)
141
162
 
142
163
  // check required parameters
143
- if (params['body'] == null) {
164
+ if (params.body == null) {
144
165
  const err = new this[kConfigurationError]('Missing required parameter: body')
145
166
  return handleError(err, callback)
146
167
  }
147
168
 
148
- var { method, body, id, ...querystring } = params
169
+ let { method, body, id, ...querystring } = params
149
170
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
150
171
 
151
- var path = ''
172
+ let path = ''
152
173
  if ((id) != null) {
153
174
  if (method == null) method = body == null ? 'GET' : 'POST'
154
175
  path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id) + '/' + '_simulate'
@@ -170,6 +191,7 @@ IngestApi.prototype.simulate = function ingestSimulateApi (params, options, call
170
191
 
171
192
  Object.defineProperties(IngestApi.prototype, {
172
193
  delete_pipeline: { get () { return this.deletePipeline } },
194
+ geo_ip_stats: { get () { return this.geoIpStats } },
173
195
  get_pipeline: { get () { return this.getPipeline } },
174
196
  processor_grok: { get () { return this.processorGrok } },
175
197
  put_pipeline: { get () { return this.putPipeline } }
@@ -34,10 +34,10 @@ function LicenseApi (transport, ConfigurationError) {
34
34
  LicenseApi.prototype.delete = function licenseDeleteApi (params, options, callback) {
35
35
  ;[params, options, callback] = normalizeArguments(params, options, callback)
36
36
 
37
- var { method, body, ...querystring } = params
37
+ let { method, body, ...querystring } = params
38
38
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
39
39
 
40
- var path = ''
40
+ let path = ''
41
41
  if (method == null) method = 'DELETE'
42
42
  path = '/' + '_license'
43
43
 
@@ -55,10 +55,10 @@ LicenseApi.prototype.delete = function licenseDeleteApi (params, options, callba
55
55
  LicenseApi.prototype.get = function licenseGetApi (params, options, callback) {
56
56
  ;[params, options, callback] = normalizeArguments(params, options, callback)
57
57
 
58
- var { method, body, ...querystring } = params
58
+ let { method, body, ...querystring } = params
59
59
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
60
60
 
61
- var path = ''
61
+ let path = ''
62
62
  if (method == null) method = 'GET'
63
63
  path = '/' + '_license'
64
64
 
@@ -76,10 +76,10 @@ LicenseApi.prototype.get = function licenseGetApi (params, options, callback) {
76
76
  LicenseApi.prototype.getBasicStatus = function licenseGetBasicStatusApi (params, options, callback) {
77
77
  ;[params, options, callback] = normalizeArguments(params, options, callback)
78
78
 
79
- var { method, body, ...querystring } = params
79
+ let { method, body, ...querystring } = params
80
80
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
81
81
 
82
- var path = ''
82
+ let path = ''
83
83
  if (method == null) method = 'GET'
84
84
  path = '/' + '_license' + '/' + 'basic_status'
85
85
 
@@ -97,10 +97,10 @@ LicenseApi.prototype.getBasicStatus = function licenseGetBasicStatusApi (params,
97
97
  LicenseApi.prototype.getTrialStatus = function licenseGetTrialStatusApi (params, options, callback) {
98
98
  ;[params, options, callback] = normalizeArguments(params, options, callback)
99
99
 
100
- var { method, body, ...querystring } = params
100
+ let { method, body, ...querystring } = params
101
101
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
102
102
 
103
- var path = ''
103
+ let path = ''
104
104
  if (method == null) method = 'GET'
105
105
  path = '/' + '_license' + '/' + 'trial_status'
106
106
 
@@ -118,10 +118,10 @@ LicenseApi.prototype.getTrialStatus = function licenseGetTrialStatusApi (params,
118
118
  LicenseApi.prototype.post = function licensePostApi (params, options, callback) {
119
119
  ;[params, options, callback] = normalizeArguments(params, options, callback)
120
120
 
121
- var { method, body, ...querystring } = params
121
+ let { method, body, ...querystring } = params
122
122
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
123
123
 
124
- var path = ''
124
+ let path = ''
125
125
  if (method == null) method = 'PUT'
126
126
  path = '/' + '_license'
127
127
 
@@ -139,10 +139,10 @@ LicenseApi.prototype.post = function licensePostApi (params, options, callback)
139
139
  LicenseApi.prototype.postStartBasic = function licensePostStartBasicApi (params, options, callback) {
140
140
  ;[params, options, callback] = normalizeArguments(params, options, callback)
141
141
 
142
- var { method, body, ...querystring } = params
142
+ let { method, body, ...querystring } = params
143
143
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
144
144
 
145
- var path = ''
145
+ let path = ''
146
146
  if (method == null) method = 'POST'
147
147
  path = '/' + '_license' + '/' + 'start_basic'
148
148
 
@@ -160,10 +160,10 @@ LicenseApi.prototype.postStartBasic = function licensePostStartBasicApi (params,
160
160
  LicenseApi.prototype.postStartTrial = function licensePostStartTrialApi (params, options, callback) {
161
161
  ;[params, options, callback] = normalizeArguments(params, options, callback)
162
162
 
163
- var { method, body, ...querystring } = params
163
+ let { method, body, ...querystring } = params
164
164
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
165
165
 
166
- var path = ''
166
+ let path = ''
167
167
  if (method == null) method = 'POST'
168
168
  path = '/' + '_license' + '/' + 'start_trial'
169
169
 
@@ -0,0 +1,125 @@
1
+ /*
2
+ * Licensed to Elasticsearch B.V. under one or more contributor
3
+ * license agreements. See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright
5
+ * ownership. Elasticsearch B.V. licenses this file to you under
6
+ * the Apache License, Version 2.0 (the "License"); you may
7
+ * not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing,
13
+ * software distributed under the License is distributed on an
14
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ * KIND, either express or implied. See the License for the
16
+ * specific language governing permissions and limitations
17
+ * under the License.
18
+ */
19
+
20
+ 'use strict'
21
+
22
+ /* eslint camelcase: 0 */
23
+ /* eslint no-unused-vars: 0 */
24
+
25
+ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
26
+ const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']
27
+ const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
28
+
29
+ function LogstashApi (transport, ConfigurationError) {
30
+ this.transport = transport
31
+ this[kConfigurationError] = ConfigurationError
32
+ }
33
+
34
+ LogstashApi.prototype.deletePipeline = function logstashDeletePipelineApi (params, options, callback) {
35
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
36
+
37
+ // check required parameters
38
+ if (params.id == null) {
39
+ const err = new this[kConfigurationError]('Missing required parameter: id')
40
+ return handleError(err, callback)
41
+ }
42
+
43
+ let { method, body, id, ...querystring } = params
44
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
45
+
46
+ let path = ''
47
+ if (method == null) method = 'DELETE'
48
+ path = '/' + '_logstash' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
49
+
50
+ // build request object
51
+ const request = {
52
+ method,
53
+ path,
54
+ body: body || '',
55
+ querystring
56
+ }
57
+
58
+ return this.transport.request(request, options, callback)
59
+ }
60
+
61
+ LogstashApi.prototype.getPipeline = function logstashGetPipelineApi (params, options, callback) {
62
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
63
+
64
+ // check required parameters
65
+ if (params.id == null) {
66
+ const err = new this[kConfigurationError]('Missing required parameter: id')
67
+ return handleError(err, callback)
68
+ }
69
+
70
+ let { method, body, id, ...querystring } = params
71
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
72
+
73
+ let path = ''
74
+ if (method == null) method = 'GET'
75
+ path = '/' + '_logstash' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
76
+
77
+ // build request object
78
+ const request = {
79
+ method,
80
+ path,
81
+ body: null,
82
+ querystring
83
+ }
84
+
85
+ return this.transport.request(request, options, callback)
86
+ }
87
+
88
+ LogstashApi.prototype.putPipeline = function logstashPutPipelineApi (params, options, callback) {
89
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
90
+
91
+ // check required parameters
92
+ if (params.id == null) {
93
+ const err = new this[kConfigurationError]('Missing required parameter: id')
94
+ return handleError(err, callback)
95
+ }
96
+ if (params.body == null) {
97
+ const err = new this[kConfigurationError]('Missing required parameter: body')
98
+ return handleError(err, callback)
99
+ }
100
+
101
+ let { method, body, id, ...querystring } = params
102
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
103
+
104
+ let path = ''
105
+ if (method == null) method = 'PUT'
106
+ path = '/' + '_logstash' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
107
+
108
+ // build request object
109
+ const request = {
110
+ method,
111
+ path,
112
+ body: body || '',
113
+ querystring
114
+ }
115
+
116
+ return this.transport.request(request, options, callback)
117
+ }
118
+
119
+ Object.defineProperties(LogstashApi.prototype, {
120
+ delete_pipeline: { get () { return this.deletePipeline } },
121
+ get_pipeline: { get () { return this.getPipeline } },
122
+ put_pipeline: { get () { return this.putPipeline } }
123
+ })
124
+
125
+ module.exports = LogstashApi
package/api/api/mget.js CHANGED
@@ -30,21 +30,21 @@ function mgetApi (params, options, callback) {
30
30
  ;[params, options, callback] = normalizeArguments(params, options, callback)
31
31
 
32
32
  // check required parameters
33
- if (params['body'] == null) {
33
+ if (params.body == null) {
34
34
  const err = new this[kConfigurationError]('Missing required parameter: body')
35
35
  return handleError(err, callback)
36
36
  }
37
37
 
38
38
  // check required url components
39
- if (params['type'] != null && (params['index'] == null)) {
39
+ if (params.type != null && (params.index == null)) {
40
40
  const err = new this[kConfigurationError]('Missing required parameter of the url: index')
41
41
  return handleError(err, callback)
42
42
  }
43
43
 
44
- var { method, body, index, type, ...querystring } = params
44
+ let { method, body, index, type, ...querystring } = params
45
45
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
46
46
 
47
- var path = ''
47
+ let path = ''
48
48
  if ((index) != null && (type) != null) {
49
49
  if (method == null) method = body == null ? 'GET' : 'POST'
50
50
  path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mget'
@@ -34,10 +34,10 @@ function MigrationApi (transport, ConfigurationError) {
34
34
  MigrationApi.prototype.deprecations = function migrationDeprecationsApi (params, options, callback) {
35
35
  ;[params, options, callback] = normalizeArguments(params, options, callback)
36
36
 
37
- var { method, body, index, ...querystring } = params
37
+ let { method, body, index, ...querystring } = params
38
38
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
39
39
 
40
- var path = ''
40
+ let path = ''
41
41
  if ((index) != null) {
42
42
  if (method == null) method = 'GET'
43
43
  path = '/' + encodeURIComponent(index) + '/' + '_migration' + '/' + 'deprecations'