@elastic/elasticsearch 7.10.0 → 7.13.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/README.md +2 -2
  2. package/api/api/async_search.js +35 -8
  3. package/api/api/autoscaling.js +15 -15
  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 +26 -26
  32. package/api/api/index.js +4 -4
  33. package/api/api/indices.js +385 -339
  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 +344 -204
  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 +66 -25
  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 +295 -85
  61. package/api/api/shutdown.js +124 -0
  62. package/api/api/slm.js +21 -21
  63. package/api/api/snapshot.js +48 -48
  64. package/api/api/sql.js +9 -9
  65. package/api/api/ssl.js +2 -2
  66. package/api/api/tasks.js +7 -7
  67. package/api/api/termvectors.js +3 -3
  68. package/api/api/text_structure.js +65 -0
  69. package/api/api/transform.js +27 -27
  70. package/api/api/update.js +5 -5
  71. package/api/api/update_by_query.js +4 -4
  72. package/api/api/update_by_query_rethrottle.js +4 -4
  73. package/api/api/watcher.js +50 -28
  74. package/api/api/xpack.js +4 -4
  75. package/api/index.js +176 -120
  76. package/api/new.d.ts +1498 -0
  77. package/api/requestParams.d.ts +168 -8
  78. package/api/types.d.ts +13881 -0
  79. package/api/utils.js +4 -4
  80. package/free-report-junit.xml +3410 -0
  81. package/index.d.ts +275 -30
  82. package/index.js +29 -30
  83. package/lib/Connection.js +7 -5
  84. package/lib/Helpers.d.ts +2 -2
  85. package/lib/Helpers.js +30 -18
  86. package/lib/Serializer.d.ts +5 -0
  87. package/lib/Serializer.js +17 -6
  88. package/lib/Transport.d.ts +2 -1
  89. package/lib/Transport.js +38 -8
  90. package/lib/errors.js +14 -1
  91. package/lib/pool/BaseConnectionPool.js +3 -3
  92. package/lib/pool/ConnectionPool.js +4 -5
  93. package/package.json +26 -26
  94. package/api/kibana.d.ts +0 -479
@@ -30,19 +30,19 @@ function deleteByQueryRethrottleApi (params, options, callback) {
30
30
  ;[params, options, callback] = normalizeArguments(params, options, callback)
31
31
 
32
32
  // check required parameters
33
- if (params['task_id'] == null && params['taskId'] == null) {
33
+ if (params.task_id == null && params.taskId == null) {
34
34
  const err = new this[kConfigurationError]('Missing required parameter: task_id or taskId')
35
35
  return handleError(err, callback)
36
36
  }
37
- if (params['requests_per_second'] == null && params['requestsPerSecond'] == null) {
37
+ if (params.requests_per_second == null && params.requestsPerSecond == null) {
38
38
  const err = new this[kConfigurationError]('Missing required parameter: requests_per_second or requestsPerSecond')
39
39
  return handleError(err, callback)
40
40
  }
41
41
 
42
- var { method, body, taskId, task_id, ...querystring } = params
42
+ let { method, body, taskId, task_id, ...querystring } = params
43
43
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
44
44
 
45
- var path = ''
45
+ let path = ''
46
46
  if (method == null) method = 'POST'
47
47
  path = '/' + '_delete_by_query' + '/' + encodeURIComponent(task_id || taskId) + '/' + '_rethrottle'
48
48
 
@@ -30,15 +30,15 @@ function deleteScriptApi (params, options, callback) {
30
30
  ;[params, options, callback] = normalizeArguments(params, options, callback)
31
31
 
32
32
  // check required parameters
33
- if (params['id'] == null) {
33
+ if (params.id == null) {
34
34
  const err = new this[kConfigurationError]('Missing required parameter: id')
35
35
  return handleError(err, callback)
36
36
  }
37
37
 
38
- var { method, body, id, ...querystring } = params
38
+ let { method, body, id, ...querystring } = params
39
39
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
40
40
 
41
- var path = ''
41
+ let path = ''
42
42
  if (method == null) method = 'DELETE'
43
43
  path = '/' + '_scripts' + '/' + encodeURIComponent(id)
44
44
 
package/api/api/enrich.js CHANGED
@@ -35,15 +35,15 @@ EnrichApi.prototype.deletePolicy = function enrichDeletePolicyApi (params, optio
35
35
  ;[params, options, callback] = normalizeArguments(params, options, callback)
36
36
 
37
37
  // check required parameters
38
- if (params['name'] == null) {
38
+ if (params.name == null) {
39
39
  const err = new this[kConfigurationError]('Missing required parameter: name')
40
40
  return handleError(err, callback)
41
41
  }
42
42
 
43
- var { method, body, name, ...querystring } = params
43
+ let { method, body, name, ...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 = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name)
49
49
 
@@ -62,15 +62,15 @@ EnrichApi.prototype.executePolicy = function enrichExecutePolicyApi (params, opt
62
62
  ;[params, options, callback] = normalizeArguments(params, options, callback)
63
63
 
64
64
  // check required parameters
65
- if (params['name'] == null) {
65
+ if (params.name == null) {
66
66
  const err = new this[kConfigurationError]('Missing required parameter: name')
67
67
  return handleError(err, callback)
68
68
  }
69
69
 
70
- var { method, body, name, ...querystring } = params
70
+ let { method, body, name, ...querystring } = params
71
71
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
72
72
 
73
- var path = ''
73
+ let path = ''
74
74
  if (method == null) method = 'PUT'
75
75
  path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name) + '/' + '_execute'
76
76
 
@@ -88,10 +88,10 @@ EnrichApi.prototype.executePolicy = function enrichExecutePolicyApi (params, opt
88
88
  EnrichApi.prototype.getPolicy = function enrichGetPolicyApi (params, options, callback) {
89
89
  ;[params, options, callback] = normalizeArguments(params, options, callback)
90
90
 
91
- var { method, body, name, ...querystring } = params
91
+ let { method, body, name, ...querystring } = params
92
92
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
93
93
 
94
- var path = ''
94
+ let path = ''
95
95
  if ((name) != null) {
96
96
  if (method == null) method = 'GET'
97
97
  path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name)
@@ -115,19 +115,19 @@ EnrichApi.prototype.putPolicy = function enrichPutPolicyApi (params, options, ca
115
115
  ;[params, options, callback] = normalizeArguments(params, options, callback)
116
116
 
117
117
  // check required parameters
118
- if (params['name'] == null) {
118
+ if (params.name == null) {
119
119
  const err = new this[kConfigurationError]('Missing required parameter: name')
120
120
  return handleError(err, callback)
121
121
  }
122
- if (params['body'] == null) {
122
+ if (params.body == null) {
123
123
  const err = new this[kConfigurationError]('Missing required parameter: body')
124
124
  return handleError(err, callback)
125
125
  }
126
126
 
127
- var { method, body, name, ...querystring } = params
127
+ let { method, body, name, ...querystring } = params
128
128
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
129
129
 
130
- var path = ''
130
+ let path = ''
131
131
  if (method == null) method = 'PUT'
132
132
  path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name)
133
133
 
@@ -145,10 +145,10 @@ EnrichApi.prototype.putPolicy = function enrichPutPolicyApi (params, options, ca
145
145
  EnrichApi.prototype.stats = function enrichStatsApi (params, options, callback) {
146
146
  ;[params, options, callback] = normalizeArguments(params, options, callback)
147
147
 
148
- var { method, body, ...querystring } = params
148
+ let { method, body, ...querystring } = params
149
149
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
150
150
 
151
- var path = ''
151
+ let path = ''
152
152
  if (method == null) method = 'GET'
153
153
  path = '/' + '_enrich' + '/' + '_stats'
154
154
 
package/api/api/eql.js CHANGED
@@ -35,15 +35,15 @@ EqlApi.prototype.delete = function eqlDeleteApi (params, options, callback) {
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 = '/' + '_eql' + '/' + 'search' + '/' + encodeURIComponent(id)
49
49
 
@@ -62,15 +62,15 @@ EqlApi.prototype.get = function eqlGetApi (params, options, callback) {
62
62
  ;[params, options, callback] = normalizeArguments(params, options, callback)
63
63
 
64
64
  // check required parameters
65
- if (params['id'] == null) {
65
+ if (params.id == null) {
66
66
  const err = new this[kConfigurationError]('Missing required parameter: id')
67
67
  return handleError(err, callback)
68
68
  }
69
69
 
70
- var { method, body, id, ...querystring } = params
70
+ let { method, body, id, ...querystring } = params
71
71
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
72
72
 
73
- var path = ''
73
+ let path = ''
74
74
  if (method == null) method = 'GET'
75
75
  path = '/' + '_eql' + '/' + 'search' + '/' + encodeURIComponent(id)
76
76
 
@@ -85,23 +85,50 @@ EqlApi.prototype.get = function eqlGetApi (params, options, callback) {
85
85
  return this.transport.request(request, options, callback)
86
86
  }
87
87
 
88
+ EqlApi.prototype.getStatus = function eqlGetStatusApi (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
+
97
+ let { method, body, id, ...querystring } = params
98
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
99
+
100
+ let path = ''
101
+ if (method == null) method = 'GET'
102
+ path = '/' + '_eql' + '/' + 'search' + '/' + 'status' + '/' + encodeURIComponent(id)
103
+
104
+ // build request object
105
+ const request = {
106
+ method,
107
+ path,
108
+ body: null,
109
+ querystring
110
+ }
111
+
112
+ return this.transport.request(request, options, callback)
113
+ }
114
+
88
115
  EqlApi.prototype.search = function eqlSearchApi (params, options, callback) {
89
116
  ;[params, options, callback] = normalizeArguments(params, options, callback)
90
117
 
91
118
  // check required parameters
92
- if (params['index'] == null) {
119
+ if (params.index == null) {
93
120
  const err = new this[kConfigurationError]('Missing required parameter: index')
94
121
  return handleError(err, callback)
95
122
  }
96
- if (params['body'] == null) {
123
+ if (params.body == null) {
97
124
  const err = new this[kConfigurationError]('Missing required parameter: body')
98
125
  return handleError(err, callback)
99
126
  }
100
127
 
101
- var { method, body, index, ...querystring } = params
128
+ let { method, body, index, ...querystring } = params
102
129
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
103
130
 
104
- var path = ''
131
+ let path = ''
105
132
  if (method == null) method = body == null ? 'GET' : 'POST'
106
133
  path = '/' + encodeURIComponent(index) + '/' + '_eql' + '/' + 'search'
107
134
 
@@ -116,4 +143,8 @@ EqlApi.prototype.search = function eqlSearchApi (params, options, callback) {
116
143
  return this.transport.request(request, options, callback)
117
144
  }
118
145
 
146
+ Object.defineProperties(EqlApi.prototype, {
147
+ get_status: { get () { return this.getStatus } }
148
+ })
149
+
119
150
  module.exports = EqlApi
package/api/api/exists.js CHANGED
@@ -30,19 +30,19 @@ function existsApi (params, options, callback) {
30
30
  ;[params, options, callback] = normalizeArguments(params, options, callback)
31
31
 
32
32
  // check required parameters
33
- if (params['id'] == null) {
33
+ if (params.id == null) {
34
34
  const err = new this[kConfigurationError]('Missing required parameter: id')
35
35
  return handleError(err, callback)
36
36
  }
37
- if (params['index'] == null) {
37
+ if (params.index == null) {
38
38
  const err = new this[kConfigurationError]('Missing required parameter: index')
39
39
  return handleError(err, callback)
40
40
  }
41
41
 
42
- var { method, body, id, index, type, ...querystring } = params
42
+ let { method, body, id, index, type, ...querystring } = params
43
43
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
44
44
 
45
- var path = ''
45
+ let path = ''
46
46
  if ((index) != null && (type) != null && (id) != null) {
47
47
  if (method == null) method = 'HEAD'
48
48
  path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
@@ -30,28 +30,28 @@ function existsSourceApi (params, options, callback) {
30
30
  ;[params, options, callback] = normalizeArguments(params, options, callback)
31
31
 
32
32
  // check required parameters
33
- if (params['id'] == null) {
33
+ if (params.id == null) {
34
34
  const err = new this[kConfigurationError]('Missing required parameter: id')
35
35
  return handleError(err, callback)
36
36
  }
37
- if (params['index'] == null) {
37
+ if (params.index == null) {
38
38
  const err = new this[kConfigurationError]('Missing required parameter: index')
39
39
  return handleError(err, callback)
40
40
  }
41
41
 
42
42
  // check required url components
43
- if (params['id'] != null && (params['type'] == null || params['index'] == null)) {
43
+ if (params.id != null && (params.type == null || params.index == null)) {
44
44
  const err = new this[kConfigurationError]('Missing required parameter of the url: type, index')
45
45
  return handleError(err, callback)
46
- } else if (params['type'] != null && (params['index'] == null)) {
46
+ } else if (params.type != null && (params.index == null)) {
47
47
  const err = new this[kConfigurationError]('Missing required parameter of the url: index')
48
48
  return handleError(err, callback)
49
49
  }
50
50
 
51
- var { method, body, id, index, type, ...querystring } = params
51
+ let { method, body, id, index, type, ...querystring } = params
52
52
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
53
53
 
54
- var path = ''
54
+ let path = ''
55
55
  if ((index) != null && (type) != null && (id) != null) {
56
56
  if (method == null) method = 'HEAD'
57
57
  path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'
@@ -30,19 +30,19 @@ function explainApi (params, options, callback) {
30
30
  ;[params, options, callback] = normalizeArguments(params, options, callback)
31
31
 
32
32
  // check required parameters
33
- if (params['id'] == null) {
33
+ if (params.id == null) {
34
34
  const err = new this[kConfigurationError]('Missing required parameter: id')
35
35
  return handleError(err, callback)
36
36
  }
37
- if (params['index'] == null) {
37
+ if (params.index == null) {
38
38
  const err = new this[kConfigurationError]('Missing required parameter: index')
39
39
  return handleError(err, callback)
40
40
  }
41
41
 
42
- var { method, body, id, index, type, ...querystring } = params
42
+ let { method, body, id, index, type, ...querystring } = params
43
43
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
44
44
 
45
- var path = ''
45
+ let path = ''
46
46
  if ((index) != null && (type) != null && (id) != null) {
47
47
  if (method == null) method = body == null ? 'GET' : 'POST'
48
48
  path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_explain'
@@ -0,0 +1,81 @@
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 = ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
27
+ const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' }
28
+
29
+ function FeaturesApi (transport, ConfigurationError) {
30
+ this.transport = transport
31
+ this[kConfigurationError] = ConfigurationError
32
+ }
33
+
34
+ FeaturesApi.prototype.getFeatures = function featuresGetFeaturesApi (params, options, callback) {
35
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
36
+
37
+ let { method, body, ...querystring } = params
38
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
39
+
40
+ let path = ''
41
+ if (method == null) method = 'GET'
42
+ path = '/' + '_features'
43
+
44
+ // build request object
45
+ const request = {
46
+ method,
47
+ path,
48
+ body: null,
49
+ querystring
50
+ }
51
+
52
+ return this.transport.request(request, options, callback)
53
+ }
54
+
55
+ FeaturesApi.prototype.resetFeatures = function featuresResetFeaturesApi (params, options, callback) {
56
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
57
+
58
+ let { method, body, ...querystring } = params
59
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
60
+
61
+ let path = ''
62
+ if (method == null) method = 'POST'
63
+ path = '/' + '_features' + '/' + '_reset'
64
+
65
+ // build request object
66
+ const request = {
67
+ method,
68
+ path,
69
+ body: body || '',
70
+ querystring
71
+ }
72
+
73
+ return this.transport.request(request, options, callback)
74
+ }
75
+
76
+ Object.defineProperties(FeaturesApi.prototype, {
77
+ get_features: { get () { return this.getFeatures } },
78
+ reset_features: { get () { return this.resetFeatures } }
79
+ })
80
+
81
+ module.exports = FeaturesApi
@@ -29,10 +29,10 @@ const snakeCase = { ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'al
29
29
  function fieldCapsApi (params, options, callback) {
30
30
  ;[params, options, callback] = normalizeArguments(params, options, callback)
31
31
 
32
- var { method, body, index, ...querystring } = params
32
+ let { method, body, index, ...querystring } = params
33
33
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
34
34
 
35
- var path = ''
35
+ let path = ''
36
36
  if ((index) != null) {
37
37
  if (method == null) method = body == null ? 'GET' : 'POST'
38
38
  path = '/' + encodeURIComponent(index) + '/' + '_field_caps'
@@ -0,0 +1,65 @@
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 = ['wait_for_advance', 'wait_for_index', 'checkpoints', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
27
+ const snakeCase = { waitForAdvance: 'wait_for_advance', waitForIndex: 'wait_for_index', errorTrace: 'error_trace', filterPath: 'filter_path' }
28
+
29
+ function FleetApi (transport, ConfigurationError) {
30
+ this.transport = transport
31
+ this[kConfigurationError] = ConfigurationError
32
+ }
33
+
34
+ FleetApi.prototype.globalCheckpoints = function fleetGlobalCheckpointsApi (params, options, callback) {
35
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
36
+
37
+ // check required parameters
38
+ if (params.index == null) {
39
+ const err = new this[kConfigurationError]('Missing required parameter: index')
40
+ return handleError(err, callback)
41
+ }
42
+
43
+ let { method, body, index, ...querystring } = params
44
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
45
+
46
+ let path = ''
47
+ if (method == null) method = 'GET'
48
+ path = '/' + encodeURIComponent(index) + '/' + '_fleet' + '/' + 'global_checkpoints'
49
+
50
+ // build request object
51
+ const request = {
52
+ method,
53
+ path,
54
+ body: null,
55
+ querystring
56
+ }
57
+
58
+ return this.transport.request(request, options, callback)
59
+ }
60
+
61
+ Object.defineProperties(FleetApi.prototype, {
62
+ global_checkpoints: { get () { return this.globalCheckpoints } }
63
+ })
64
+
65
+ module.exports = FleetApi
package/api/api/get.js CHANGED
@@ -30,19 +30,19 @@ function getApi (params, options, callback) {
30
30
  ;[params, options, callback] = normalizeArguments(params, options, callback)
31
31
 
32
32
  // check required parameters
33
- if (params['id'] == null) {
33
+ if (params.id == null) {
34
34
  const err = new this[kConfigurationError]('Missing required parameter: id')
35
35
  return handleError(err, callback)
36
36
  }
37
- if (params['index'] == null) {
37
+ if (params.index == null) {
38
38
  const err = new this[kConfigurationError]('Missing required parameter: index')
39
39
  return handleError(err, callback)
40
40
  }
41
41
 
42
- var { method, body, id, index, type, ...querystring } = params
42
+ let { method, body, id, index, type, ...querystring } = params
43
43
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
44
44
 
45
- var path = ''
45
+ let path = ''
46
46
  if ((index) != null && (type) != null && (id) != null) {
47
47
  if (method == null) method = 'GET'
48
48
  path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
@@ -30,15 +30,15 @@ function getScriptApi (params, options, callback) {
30
30
  ;[params, options, callback] = normalizeArguments(params, options, callback)
31
31
 
32
32
  // check required parameters
33
- if (params['id'] == null) {
33
+ if (params.id == null) {
34
34
  const err = new this[kConfigurationError]('Missing required parameter: id')
35
35
  return handleError(err, callback)
36
36
  }
37
37
 
38
- var { method, body, id, ...querystring } = params
38
+ let { method, body, id, ...querystring } = params
39
39
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
40
40
 
41
- var path = ''
41
+ let path = ''
42
42
  if (method == null) method = 'GET'
43
43
  path = '/' + '_scripts' + '/' + encodeURIComponent(id)
44
44
 
@@ -29,10 +29,10 @@ const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
29
29
  function getScriptContextApi (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 = '/' + '_script_context'
38
38
 
@@ -29,10 +29,10 @@ const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
29
29
  function getScriptLanguagesApi (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 = '/' + '_script_language'
38
38
 
@@ -30,19 +30,19 @@ function getSourceApi (params, options, callback) {
30
30
  ;[params, options, callback] = normalizeArguments(params, options, callback)
31
31
 
32
32
  // check required parameters
33
- if (params['id'] == null) {
33
+ if (params.id == null) {
34
34
  const err = new this[kConfigurationError]('Missing required parameter: id')
35
35
  return handleError(err, callback)
36
36
  }
37
- if (params['index'] == null) {
37
+ if (params.index == null) {
38
38
  const err = new this[kConfigurationError]('Missing required parameter: index')
39
39
  return handleError(err, callback)
40
40
  }
41
41
 
42
- var { method, body, id, index, type, ...querystring } = params
42
+ let { method, body, id, index, type, ...querystring } = params
43
43
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
44
44
 
45
- var path = ''
45
+ let path = ''
46
46
  if ((index) != null && (type) != null && (id) != null) {
47
47
  if (method == null) method = 'GET'
48
48
  path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'
package/api/api/graph.js CHANGED
@@ -35,21 +35,21 @@ GraphApi.prototype.explore = function graphExploreApi (params, options, callback
35
35
  ;[params, options, callback] = normalizeArguments(params, options, callback)
36
36
 
37
37
  // check required parameters
38
- if (params['index'] == null) {
38
+ if (params.index == null) {
39
39
  const err = new this[kConfigurationError]('Missing required parameter: index')
40
40
  return handleError(err, callback)
41
41
  }
42
42
 
43
43
  // check required url components
44
- if (params['type'] != null && (params['index'] == null)) {
44
+ if (params.type != null && (params.index == null)) {
45
45
  const err = new this[kConfigurationError]('Missing required parameter of the url: index')
46
46
  return handleError(err, callback)
47
47
  }
48
48
 
49
- var { method, body, index, type, ...querystring } = params
49
+ let { method, body, index, type, ...querystring } = params
50
50
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
51
51
 
52
- var path = ''
52
+ let path = ''
53
53
  if ((index) != null && (type) != null) {
54
54
  if (method == null) method = body == null ? 'GET' : 'POST'
55
55
  path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_graph' + '/' + 'explore'