Compare commits

...

9 Commits
7.x ... v7.12.0

Author SHA1 Message Date
c8aae67cd6 Integration test: Fix yaml parser and crash on failure (#1423)
* Fix yaml parser and crash on failure

* Log response in case of ResponseError

* Updated cleanup

* Updated skip list

* Updated skip list

* Updated skip list
2021-03-24 07:54:49 +01:00
886289e3f5 API generation 2021-03-23 18:36:34 +01:00
111da7e529 API generation 2021-03-22 11:54:16 +01:00
d615692b9f fix(TransportRequestPromise): add finally method to TransportRequestP… (#1415)
* fix(TransportRequestPromise): add finally method to TransportRequestPromise interface

* fix(TransportRequestPromise): add finally method to transportReturn object

* fix(TransportRequestPromise): add finally method tests
2021-03-22 11:53:17 +01:00
ace70aea08 Fix test bundler (#1417) (#1418)
* Updated .gitignore

* Fix parcel build

* Updated .gitignore

Co-authored-by: Tomas Della Vedova <delvedor@users.noreply.github.com>
2021-03-22 11:53:07 +01:00
7b21f92ceb API generation 2021-02-19 08:32:33 +01:00
d506222d02 Remove linter ignore configuration 2021-02-19 08:30:35 +01:00
6c2d4acac6 Remove Node.js v8 support (#1402) 2021-02-19 08:30:33 +01:00
496b2bb6d1 Updated ci configuration 2021-02-18 16:42:14 +01:00
124 changed files with 1495 additions and 1432 deletions

View File

@ -1,12 +1,11 @@
---
STACK_VERSION:
- 7.x-SNAPSHOT
- 7.12.0-SNAPSHOT
NODE_JS_VERSION:
- 14
- 12
- 10
- 8
TEST_SUITE:
- free

View File

@ -40,31 +40,6 @@ jobs:
run: |
npm run test:types
test-node-v8:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [8.x]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: |
npm install
- name: Test
run: |
npm run test:node8
helpers-integration-test:
name: Helpers integration test
runs-on: ubuntu-latest
@ -86,7 +61,7 @@ jobs:
- name: Runs Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: 7.x-SNAPSHOT
stack-version: 7.12.0-SNAPSHOT
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1

1
.gitignore vendored
View File

@ -60,3 +60,4 @@ test/benchmarks/macro/fixtures/*
.cache
test/bundlers/**/bundle.js
test/bundlers/parcel-test/.parcel-cache

View File

@ -28,7 +28,7 @@ npm install @elastic/elasticsearch
### Node.js support
NOTE: The minimum supported version of Node.js is `v8`.
NOTE: The minimum supported version of Node.js is `v10`.
The client versioning follows the Elastc Stack versioning, this means that
major, minor, and patch releases are done following a precise schedule that

View File

@ -23,8 +23,8 @@
/* eslint no-unused-vars: 0 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path', 'wait_for_completion_timeout', 'keep_alive', 'typed_keys', 'keep_on_completion', 'batched_reduce_size', 'request_cache', 'analyzer', 'analyze_wildcard', 'default_operator', 'df', 'explain', 'stored_fields', 'docvalue_fields', 'from', 'ignore_unavailable', 'ignore_throttled', 'allow_no_indices', 'expand_wildcards', 'lenient', 'preference', 'q', 'routing', 'search_type', 'size', 'sort', '_source', '_source_excludes', '_source_includes', 'terminate_after', 'stats', 'suggest_field', 'suggest_mode', 'suggest_size', 'suggest_text', 'timeout', 'track_scores', 'track_total_hits', 'allow_partial_search_results', 'version', 'seq_no_primary_term', 'max_concurrent_shard_requests']
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', waitForCompletionTimeout: 'wait_for_completion_timeout', keepAlive: 'keep_alive', typedKeys: 'typed_keys', keepOnCompletion: 'keep_on_completion', batchedReduceSize: 'batched_reduce_size', requestCache: 'request_cache', analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', storedFields: 'stored_fields', docvalueFields: 'docvalue_fields', ignoreUnavailable: 'ignore_unavailable', ignoreThrottled: 'ignore_throttled', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', searchType: 'search_type', _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', terminateAfter: 'terminate_after', suggestField: 'suggest_field', suggestMode: 'suggest_mode', suggestSize: 'suggest_size', suggestText: 'suggest_text', trackScores: 'track_scores', trackTotalHits: 'track_total_hits', allowPartialSearchResults: 'allow_partial_search_results', seqNoPrimaryTerm: 'seq_no_primary_term', maxConcurrentShardRequests: 'max_concurrent_shard_requests' }
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path', 'wait_for_completion_timeout', 'keep_alive', 'typed_keys', 'keep_on_completion', 'batched_reduce_size', 'request_cache', 'analyzer', 'analyze_wildcard', 'default_operator', 'df', 'explain', 'stored_fields', 'docvalue_fields', 'from', 'ignore_unavailable', 'ignore_throttled', 'allow_no_indices', 'expand_wildcards', 'lenient', 'preference', 'q', 'routing', 'search_type', 'size', 'sort', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'terminate_after', 'stats', 'suggest_field', 'suggest_mode', 'suggest_size', 'suggest_text', 'timeout', 'track_scores', 'track_total_hits', 'allow_partial_search_results', 'version', 'seq_no_primary_term', 'max_concurrent_shard_requests']
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', waitForCompletionTimeout: 'wait_for_completion_timeout', keepAlive: 'keep_alive', typedKeys: 'typed_keys', keepOnCompletion: 'keep_on_completion', batchedReduceSize: 'batched_reduce_size', requestCache: 'request_cache', analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', storedFields: 'stored_fields', docvalueFields: 'docvalue_fields', ignoreUnavailable: 'ignore_unavailable', ignoreThrottled: 'ignore_throttled', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', searchType: 'search_type', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', terminateAfter: 'terminate_after', suggestField: 'suggest_field', suggestMode: 'suggest_mode', suggestSize: 'suggest_size', suggestText: 'suggest_text', trackScores: 'track_scores', trackTotalHits: 'track_total_hits', allowPartialSearchResults: 'allow_partial_search_results', seqNoPrimaryTerm: 'seq_no_primary_term', maxConcurrentShardRequests: 'max_concurrent_shard_requests' }
function AsyncSearchApi (transport, ConfigurationError) {
this.transport = transport
@ -35,15 +35,15 @@ AsyncSearchApi.prototype.delete = function asyncSearchDeleteApi (params, options
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_async_search' + '/' + encodeURIComponent(id)
@ -62,15 +62,15 @@ AsyncSearchApi.prototype.get = function asyncSearchGetApi (params, options, call
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_async_search' + '/' + encodeURIComponent(id)
@ -89,15 +89,15 @@ AsyncSearchApi.prototype.status = function asyncSearchStatusApi (params, options
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_async_search' + '/' + 'status' + '/' + encodeURIComponent(id)
@ -115,10 +115,10 @@ AsyncSearchApi.prototype.status = function asyncSearchStatusApi (params, options
AsyncSearchApi.prototype.submit = function asyncSearchSubmitApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_async_search'

View File

@ -35,15 +35,15 @@ AutoscalingApi.prototype.deleteAutoscalingPolicy = function autoscalingDeleteAut
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_autoscaling' + '/' + 'policy' + '/' + encodeURIComponent(name)
@ -61,10 +61,10 @@ AutoscalingApi.prototype.deleteAutoscalingPolicy = function autoscalingDeleteAut
AutoscalingApi.prototype.getAutoscalingCapacity = function autoscalingGetAutoscalingCapacityApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_autoscaling' + '/' + 'capacity'
@ -83,15 +83,15 @@ AutoscalingApi.prototype.getAutoscalingPolicy = function autoscalingGetAutoscali
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_autoscaling' + '/' + 'policy' + '/' + encodeURIComponent(name)
@ -110,19 +110,19 @@ AutoscalingApi.prototype.putAutoscalingPolicy = function autoscalingPutAutoscali
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_autoscaling' + '/' + 'policy' + '/' + encodeURIComponent(name)

View File

@ -23,28 +23,28 @@
/* eslint no-unused-vars: 0 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['wait_for_active_shards', 'refresh', 'routing', 'timeout', 'type', '_source', '_source_excludes', '_source_includes', 'pipeline', 'require_alias', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { waitForActiveShards: 'wait_for_active_shards', _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', requireAlias: 'require_alias', errorTrace: 'error_trace', filterPath: 'filter_path' }
const acceptedQuerystring = ['wait_for_active_shards', 'refresh', 'routing', 'timeout', 'type', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'pipeline', 'require_alias', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { waitForActiveShards: 'wait_for_active_shards', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', requireAlias: 'require_alias', errorTrace: 'error_trace', filterPath: 'filter_path' }
function bulkApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if (params['type'] != null && (params['index'] == null)) {
if (params.type != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_bulk'

View File

@ -34,10 +34,10 @@ function CatApi (transport, ConfigurationError) {
CatApi.prototype.aliases = function catAliasesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'aliases' + '/' + encodeURIComponent(name)
@ -60,10 +60,10 @@ CatApi.prototype.aliases = function catAliasesApi (params, options, callback) {
CatApi.prototype.allocation = function catAllocationApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, nodeId, node_id, ...querystring } = params
let { method, body, nodeId, node_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((node_id || nodeId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'allocation' + '/' + encodeURIComponent(node_id || nodeId)
@ -86,10 +86,10 @@ CatApi.prototype.allocation = function catAllocationApi (params, options, callba
CatApi.prototype.count = function catCountApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'count' + '/' + encodeURIComponent(index)
@ -112,10 +112,10 @@ CatApi.prototype.count = function catCountApi (params, options, callback) {
CatApi.prototype.fielddata = function catFielddataApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, fields, ...querystring } = params
let { method, body, fields, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((fields) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'fielddata' + '/' + encodeURIComponent(fields)
@ -138,10 +138,10 @@ CatApi.prototype.fielddata = function catFielddataApi (params, options, callback
CatApi.prototype.health = function catHealthApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'health'
@ -159,10 +159,10 @@ CatApi.prototype.health = function catHealthApi (params, options, callback) {
CatApi.prototype.help = function catHelpApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_cat'
@ -180,10 +180,10 @@ CatApi.prototype.help = function catHelpApi (params, options, callback) {
CatApi.prototype.indices = function catIndicesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'indices' + '/' + encodeURIComponent(index)
@ -206,10 +206,10 @@ CatApi.prototype.indices = function catIndicesApi (params, options, callback) {
CatApi.prototype.master = function catMasterApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'master'
@ -227,10 +227,10 @@ CatApi.prototype.master = function catMasterApi (params, options, callback) {
CatApi.prototype.nodeattrs = function catNodeattrsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'nodeattrs'
@ -248,10 +248,10 @@ CatApi.prototype.nodeattrs = function catNodeattrsApi (params, options, callback
CatApi.prototype.nodes = function catNodesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'nodes'
@ -269,10 +269,10 @@ CatApi.prototype.nodes = function catNodesApi (params, options, callback) {
CatApi.prototype.pendingTasks = function catPendingTasksApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'pending_tasks'
@ -290,10 +290,10 @@ CatApi.prototype.pendingTasks = function catPendingTasksApi (params, options, ca
CatApi.prototype.plugins = function catPluginsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'plugins'
@ -311,10 +311,10 @@ CatApi.prototype.plugins = function catPluginsApi (params, options, callback) {
CatApi.prototype.recovery = function catRecoveryApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'recovery' + '/' + encodeURIComponent(index)
@ -337,10 +337,10 @@ CatApi.prototype.recovery = function catRecoveryApi (params, options, callback)
CatApi.prototype.repositories = function catRepositoriesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'repositories'
@ -358,10 +358,10 @@ CatApi.prototype.repositories = function catRepositoriesApi (params, options, ca
CatApi.prototype.segments = function catSegmentsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'segments' + '/' + encodeURIComponent(index)
@ -384,10 +384,10 @@ CatApi.prototype.segments = function catSegmentsApi (params, options, callback)
CatApi.prototype.shards = function catShardsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'shards' + '/' + encodeURIComponent(index)
@ -410,10 +410,10 @@ CatApi.prototype.shards = function catShardsApi (params, options, callback) {
CatApi.prototype.snapshots = function catSnapshotsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, repository, ...querystring } = params
let { method, body, repository, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((repository) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'snapshots' + '/' + encodeURIComponent(repository)
@ -436,10 +436,10 @@ CatApi.prototype.snapshots = function catSnapshotsApi (params, options, callback
CatApi.prototype.tasks = function catTasksApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'tasks'
@ -457,10 +457,10 @@ CatApi.prototype.tasks = function catTasksApi (params, options, callback) {
CatApi.prototype.templates = function catTemplatesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'templates' + '/' + encodeURIComponent(name)
@ -483,10 +483,10 @@ CatApi.prototype.templates = function catTemplatesApi (params, options, callback
CatApi.prototype.threadPool = function catThreadPoolApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, threadPoolPatterns, thread_pool_patterns, ...querystring } = params
let { method, body, threadPoolPatterns, thread_pool_patterns, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((thread_pool_patterns || threadPoolPatterns) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'thread_pool' + '/' + encodeURIComponent(thread_pool_patterns || threadPoolPatterns)
@ -509,10 +509,10 @@ CatApi.prototype.threadPool = function catThreadPoolApi (params, options, callba
CatApi.prototype.mlDataFrameAnalytics = function catMlDataFrameAnalyticsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((id) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + encodeURIComponent(id)
@ -535,10 +535,10 @@ CatApi.prototype.mlDataFrameAnalytics = function catMlDataFrameAnalyticsApi (par
CatApi.prototype.mlDatafeeds = function catMlDatafeedsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, datafeedId, datafeed_id, ...querystring } = params
let { method, body, datafeedId, datafeed_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((datafeed_id || datafeedId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId)
@ -561,10 +561,10 @@ CatApi.prototype.mlDatafeeds = function catMlDatafeedsApi (params, options, call
CatApi.prototype.mlJobs = function catMlJobsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, jobId, job_id, ...querystring } = params
let { method, body, jobId, job_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((job_id || jobId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId)
@ -587,10 +587,10 @@ CatApi.prototype.mlJobs = function catMlJobsApi (params, options, callback) {
CatApi.prototype.mlTrainedModels = function catMlTrainedModelsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, modelId, model_id, ...querystring } = params
let { method, body, modelId, model_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((model_id || modelId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'trained_models' + '/' + encodeURIComponent(model_id || modelId)
@ -613,10 +613,10 @@ CatApi.prototype.mlTrainedModels = function catMlTrainedModelsApi (params, optio
CatApi.prototype.transforms = function catTransformsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, transformId, transform_id, ...querystring } = params
let { method, body, transformId, transform_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((transform_id || transformId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId)

View File

@ -35,15 +35,15 @@ CcrApi.prototype.deleteAutoFollowPattern = function ccrDeleteAutoFollowPatternAp
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name)
@ -62,19 +62,19 @@ CcrApi.prototype.follow = function ccrFollowApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'follow'
@ -93,15 +93,15 @@ CcrApi.prototype.followInfo = function ccrFollowInfoApi (params, options, callba
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'info'
@ -120,15 +120,15 @@ CcrApi.prototype.followStats = function ccrFollowStatsApi (params, options, call
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'stats'
@ -147,19 +147,19 @@ CcrApi.prototype.forgetFollower = function ccrForgetFollowerApi (params, options
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'forget_follower'
@ -177,10 +177,10 @@ CcrApi.prototype.forgetFollower = function ccrForgetFollowerApi (params, options
CcrApi.prototype.getAutoFollowPattern = function ccrGetAutoFollowPatternApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name)
@ -204,15 +204,15 @@ CcrApi.prototype.pauseAutoFollowPattern = function ccrPauseAutoFollowPatternApi
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name) + '/' + 'pause'
@ -231,15 +231,15 @@ CcrApi.prototype.pauseFollow = function ccrPauseFollowApi (params, options, call
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'pause_follow'
@ -258,19 +258,19 @@ CcrApi.prototype.putAutoFollowPattern = function ccrPutAutoFollowPatternApi (par
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name)
@ -289,15 +289,15 @@ CcrApi.prototype.resumeAutoFollowPattern = function ccrResumeAutoFollowPatternAp
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name) + '/' + 'resume'
@ -316,15 +316,15 @@ CcrApi.prototype.resumeFollow = function ccrResumeFollowApi (params, options, ca
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'resume_follow'
@ -342,10 +342,10 @@ CcrApi.prototype.resumeFollow = function ccrResumeFollowApi (params, options, ca
CcrApi.prototype.stats = function ccrStatsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_ccr' + '/' + 'stats'
@ -364,15 +364,15 @@ CcrApi.prototype.unfollow = function ccrUnfollowApi (params, options, callback)
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'unfollow'

View File

@ -29,10 +29,10 @@ const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
function clearScrollApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, scrollId, scroll_id, ...querystring } = params
let { method, body, scrollId, scroll_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((scroll_id || scrollId) != null) {
if (method == null) method = 'DELETE'
path = '/' + '_search' + '/' + 'scroll' + '/' + encodeURIComponent(scroll_id || scrollId)

View File

@ -29,10 +29,10 @@ const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
function closePointInTimeApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_pit'

View File

@ -34,10 +34,10 @@ function ClusterApi (transport, ConfigurationError) {
ClusterApi.prototype.allocationExplain = function clusterAllocationExplainApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_cluster' + '/' + 'allocation' + '/' + 'explain'
@ -56,15 +56,15 @@ ClusterApi.prototype.deleteComponentTemplate = function clusterDeleteComponentTe
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_component_template' + '/' + encodeURIComponent(name)
@ -82,10 +82,10 @@ ClusterApi.prototype.deleteComponentTemplate = function clusterDeleteComponentTe
ClusterApi.prototype.deleteVotingConfigExclusions = function clusterDeleteVotingConfigExclusionsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_cluster' + '/' + 'voting_config_exclusions'
@ -104,15 +104,15 @@ ClusterApi.prototype.existsComponentTemplate = function clusterExistsComponentTe
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'HEAD'
path = '/' + '_component_template' + '/' + encodeURIComponent(name)
@ -130,10 +130,10 @@ ClusterApi.prototype.existsComponentTemplate = function clusterExistsComponentTe
ClusterApi.prototype.getComponentTemplate = function clusterGetComponentTemplateApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_component_template' + '/' + encodeURIComponent(name)
@ -156,10 +156,10 @@ ClusterApi.prototype.getComponentTemplate = function clusterGetComponentTemplate
ClusterApi.prototype.getSettings = function clusterGetSettingsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'settings'
@ -177,10 +177,10 @@ ClusterApi.prototype.getSettings = function clusterGetSettingsApi (params, optio
ClusterApi.prototype.health = function clusterHealthApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'health' + '/' + encodeURIComponent(index)
@ -203,10 +203,10 @@ ClusterApi.prototype.health = function clusterHealthApi (params, options, callba
ClusterApi.prototype.pendingTasks = function clusterPendingTasksApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'pending_tasks'
@ -224,10 +224,10 @@ ClusterApi.prototype.pendingTasks = function clusterPendingTasksApi (params, opt
ClusterApi.prototype.postVotingConfigExclusions = function clusterPostVotingConfigExclusionsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_cluster' + '/' + 'voting_config_exclusions'
@ -246,19 +246,19 @@ ClusterApi.prototype.putComponentTemplate = function clusterPutComponentTemplate
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_component_template' + '/' + encodeURIComponent(name)
@ -277,15 +277,15 @@ ClusterApi.prototype.putSettings = function clusterPutSettingsApi (params, optio
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_cluster' + '/' + 'settings'
@ -303,10 +303,10 @@ ClusterApi.prototype.putSettings = function clusterPutSettingsApi (params, optio
ClusterApi.prototype.remoteInfo = function clusterRemoteInfoApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_remote' + '/' + 'info'
@ -324,10 +324,10 @@ ClusterApi.prototype.remoteInfo = function clusterRemoteInfoApi (params, options
ClusterApi.prototype.reroute = function clusterRerouteApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_cluster' + '/' + 'reroute'
@ -346,15 +346,15 @@ ClusterApi.prototype.state = function clusterStateApi (params, options, callback
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required url components
if (params['index'] != null && (params['metric'] == null)) {
if (params.index != null && (params.metric == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: metric')
return handleError(err, callback)
}
var { method, body, metric, index, ...querystring } = params
let { method, body, metric, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((metric) != null && (index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'state' + '/' + encodeURIComponent(metric) + '/' + encodeURIComponent(index)
@ -380,10 +380,10 @@ ClusterApi.prototype.state = function clusterStateApi (params, options, callback
ClusterApi.prototype.stats = function clusterStatsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, nodeId, node_id, ...querystring } = params
let { method, body, nodeId, node_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((node_id || nodeId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'stats' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId)

View File

@ -30,15 +30,15 @@ function countApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required url components
if (params['type'] != null && (params['index'] == null)) {
if (params.type != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_count'

View File

@ -30,23 +30,23 @@ function createApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, id, index, type, ...querystring } = params
let { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_create'

View File

@ -35,15 +35,15 @@ DanglingIndicesApi.prototype.deleteDanglingIndex = function danglingIndicesDelet
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index_uuid'] == null && params['indexUuid'] == null) {
if (params.index_uuid == null && params.indexUuid == null) {
const err = new this[kConfigurationError]('Missing required parameter: index_uuid or indexUuid')
return handleError(err, callback)
}
var { method, body, indexUuid, index_uuid, ...querystring } = params
let { method, body, indexUuid, index_uuid, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_dangling' + '/' + encodeURIComponent(index_uuid || indexUuid)
@ -62,15 +62,15 @@ DanglingIndicesApi.prototype.importDanglingIndex = function danglingIndicesImpor
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index_uuid'] == null && params['indexUuid'] == null) {
if (params.index_uuid == null && params.indexUuid == null) {
const err = new this[kConfigurationError]('Missing required parameter: index_uuid or indexUuid')
return handleError(err, callback)
}
var { method, body, indexUuid, index_uuid, ...querystring } = params
let { method, body, indexUuid, index_uuid, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_dangling' + '/' + encodeURIComponent(index_uuid || indexUuid)
@ -88,10 +88,10 @@ DanglingIndicesApi.prototype.importDanglingIndex = function danglingIndicesImpor
DanglingIndicesApi.prototype.listDanglingIndices = function danglingIndicesListDanglingIndicesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_dangling'

View File

@ -30,19 +30,19 @@ function deleteApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, id, index, type, ...querystring } = params
let { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'DELETE'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)

View File

@ -23,32 +23,32 @@
/* eslint no-unused-vars: 0 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['analyzer', 'analyze_wildcard', 'default_operator', 'df', 'from', 'ignore_unavailable', 'allow_no_indices', 'conflicts', 'expand_wildcards', 'lenient', 'preference', 'q', 'routing', 'scroll', 'search_type', 'search_timeout', 'size', 'max_docs', 'sort', '_source', '_source_excludes', '_source_includes', 'terminate_after', 'stats', 'version', 'request_cache', 'refresh', 'timeout', 'wait_for_active_shards', 'scroll_size', 'wait_for_completion', 'requests_per_second', 'slices', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', searchType: 'search_type', searchTimeout: 'search_timeout', maxDocs: 'max_docs', _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', terminateAfter: 'terminate_after', requestCache: 'request_cache', waitForActiveShards: 'wait_for_active_shards', scrollSize: 'scroll_size', waitForCompletion: 'wait_for_completion', requestsPerSecond: 'requests_per_second', errorTrace: 'error_trace', filterPath: 'filter_path' }
const acceptedQuerystring = ['analyzer', 'analyze_wildcard', 'default_operator', 'df', 'from', 'ignore_unavailable', 'allow_no_indices', 'conflicts', 'expand_wildcards', 'lenient', 'preference', 'q', 'routing', 'scroll', 'search_type', 'search_timeout', 'size', 'max_docs', 'sort', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'terminate_after', 'stats', 'version', 'request_cache', 'refresh', 'timeout', 'wait_for_active_shards', 'scroll_size', 'wait_for_completion', 'requests_per_second', 'slices', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', searchType: 'search_type', searchTimeout: 'search_timeout', maxDocs: 'max_docs', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', terminateAfter: 'terminate_after', requestCache: 'request_cache', waitForActiveShards: 'wait_for_active_shards', scrollSize: 'scroll_size', waitForCompletion: 'wait_for_completion', requestsPerSecond: 'requests_per_second', errorTrace: 'error_trace', filterPath: 'filter_path' }
function deleteByQueryApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if (params['type'] != null && (params['index'] == null)) {
if (params.type != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_delete_by_query'

View File

@ -30,19 +30,19 @@ function deleteByQueryRethrottleApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['task_id'] == null && params['taskId'] == null) {
if (params.task_id == null && params.taskId == null) {
const err = new this[kConfigurationError]('Missing required parameter: task_id or taskId')
return handleError(err, callback)
}
if (params['requests_per_second'] == null && params['requestsPerSecond'] == null) {
if (params.requests_per_second == null && params.requestsPerSecond == null) {
const err = new this[kConfigurationError]('Missing required parameter: requests_per_second or requestsPerSecond')
return handleError(err, callback)
}
var { method, body, taskId, task_id, ...querystring } = params
let { method, body, taskId, task_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_delete_by_query' + '/' + encodeURIComponent(task_id || taskId) + '/' + '_rethrottle'

View File

@ -30,15 +30,15 @@ function deleteScriptApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_scripts' + '/' + encodeURIComponent(id)

View File

@ -35,15 +35,15 @@ EnrichApi.prototype.deletePolicy = function enrichDeletePolicyApi (params, optio
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name)
@ -62,15 +62,15 @@ EnrichApi.prototype.executePolicy = function enrichExecutePolicyApi (params, opt
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name) + '/' + '_execute'
@ -88,10 +88,10 @@ EnrichApi.prototype.executePolicy = function enrichExecutePolicyApi (params, opt
EnrichApi.prototype.getPolicy = function enrichGetPolicyApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name)
@ -115,19 +115,19 @@ EnrichApi.prototype.putPolicy = function enrichPutPolicyApi (params, options, ca
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name)
@ -145,10 +145,10 @@ EnrichApi.prototype.putPolicy = function enrichPutPolicyApi (params, options, ca
EnrichApi.prototype.stats = function enrichStatsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_enrich' + '/' + '_stats'

View File

@ -35,15 +35,15 @@ EqlApi.prototype.delete = function eqlDeleteApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_eql' + '/' + 'search' + '/' + encodeURIComponent(id)
@ -62,15 +62,15 @@ EqlApi.prototype.get = function eqlGetApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_eql' + '/' + 'search' + '/' + encodeURIComponent(id)
@ -89,15 +89,15 @@ EqlApi.prototype.getStatus = function eqlGetStatusApi (params, options, callback
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_eql' + '/' + 'search' + '/' + 'status' + '/' + encodeURIComponent(id)
@ -116,19 +116,19 @@ EqlApi.prototype.search = function eqlSearchApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_eql' + '/' + 'search'

View File

@ -23,26 +23,26 @@
/* eslint no-unused-vars: 0 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['stored_fields', 'preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_includes', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' }
const acceptedQuerystring = ['stored_fields', 'preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' }
function existsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, id, index, type, ...querystring } = params
let { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'HEAD'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)

View File

@ -23,35 +23,35 @@
/* eslint no-unused-vars: 0 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_includes', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' }
const acceptedQuerystring = ['preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' }
function existsSourceApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
// check required url components
if (params['id'] != null && (params['type'] == null || params['index'] == null)) {
if (params.id != null && (params.type == null || params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: type, index')
return handleError(err, callback)
} else if (params['type'] != null && (params['index'] == null)) {
} else if (params.type != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
var { method, body, id, index, type, ...querystring } = params
let { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'HEAD'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'

View File

@ -23,26 +23,26 @@
/* eslint no-unused-vars: 0 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['analyze_wildcard', 'analyzer', 'default_operator', 'df', 'stored_fields', 'lenient', 'preference', 'q', 'routing', '_source', '_source_excludes', '_source_includes', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', errorTrace: 'error_trace', filterPath: 'filter_path' }
const acceptedQuerystring = ['analyze_wildcard', 'analyzer', 'default_operator', 'df', 'stored_fields', 'lenient', 'preference', 'q', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', errorTrace: 'error_trace', filterPath: 'filter_path' }
function explainApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, id, index, type, ...querystring } = params
let { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_explain'

59
api/api/features.js Normal file
View File

@ -0,0 +1,59 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' }
function FeaturesApi (transport, ConfigurationError) {
this.transport = transport
this[kConfigurationError] = ConfigurationError
}
FeaturesApi.prototype.getFeatures = function featuresGetFeaturesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_features'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
Object.defineProperties(FeaturesApi.prototype, {
get_features: { get () { return this.getFeatures } }
})
module.exports = FeaturesApi

View File

@ -29,10 +29,10 @@ const snakeCase = { ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'al
function fieldCapsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_field_caps'

View File

@ -23,26 +23,26 @@
/* eslint no-unused-vars: 0 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['stored_fields', 'preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_includes', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' }
const acceptedQuerystring = ['stored_fields', 'preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' }
function getApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, id, index, type, ...querystring } = params
let { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)

View File

@ -30,15 +30,15 @@ function getScriptApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_scripts' + '/' + encodeURIComponent(id)

View File

@ -29,10 +29,10 @@ const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
function getScriptContextApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_script_context'

View File

@ -29,10 +29,10 @@ const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
function getScriptLanguagesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_script_language'

View File

@ -23,26 +23,26 @@
/* eslint no-unused-vars: 0 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_includes', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' }
const acceptedQuerystring = ['preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' }
function getSourceApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, id, index, type, ...querystring } = params
let { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'

View File

@ -35,21 +35,21 @@ GraphApi.prototype.explore = function graphExploreApi (params, options, callback
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
// check required url components
if (params['type'] != null && (params['index'] == null)) {
if (params.type != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_graph' + '/' + 'explore'

View File

@ -35,15 +35,15 @@ IlmApi.prototype.deleteLifecycle = function ilmDeleteLifecycleApi (params, optio
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['policy'] == null) {
if (params.policy == null) {
const err = new this[kConfigurationError]('Missing required parameter: policy')
return handleError(err, callback)
}
var { method, body, policy, ...querystring } = params
let { method, body, policy, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_ilm' + '/' + 'policy' + '/' + encodeURIComponent(policy)
@ -62,15 +62,15 @@ IlmApi.prototype.explainLifecycle = function ilmExplainLifecycleApi (params, opt
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_ilm' + '/' + 'explain'
@ -88,10 +88,10 @@ IlmApi.prototype.explainLifecycle = function ilmExplainLifecycleApi (params, opt
IlmApi.prototype.getLifecycle = function ilmGetLifecycleApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, policy, ...querystring } = params
let { method, body, policy, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((policy) != null) {
if (method == null) method = 'GET'
path = '/' + '_ilm' + '/' + 'policy' + '/' + encodeURIComponent(policy)
@ -114,10 +114,10 @@ IlmApi.prototype.getLifecycle = function ilmGetLifecycleApi (params, options, ca
IlmApi.prototype.getStatus = function ilmGetStatusApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_ilm' + '/' + 'status'
@ -136,15 +136,15 @@ IlmApi.prototype.moveToStep = function ilmMoveToStepApi (params, options, callba
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_ilm' + '/' + 'move' + '/' + encodeURIComponent(index)
@ -163,15 +163,15 @@ IlmApi.prototype.putLifecycle = function ilmPutLifecycleApi (params, options, ca
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['policy'] == null) {
if (params.policy == null) {
const err = new this[kConfigurationError]('Missing required parameter: policy')
return handleError(err, callback)
}
var { method, body, policy, ...querystring } = params
let { method, body, policy, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_ilm' + '/' + 'policy' + '/' + encodeURIComponent(policy)
@ -190,15 +190,15 @@ IlmApi.prototype.removePolicy = function ilmRemovePolicyApi (params, options, ca
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_ilm' + '/' + 'remove'
@ -217,15 +217,15 @@ IlmApi.prototype.retry = function ilmRetryApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_ilm' + '/' + 'retry'
@ -243,10 +243,10 @@ IlmApi.prototype.retry = function ilmRetryApi (params, options, callback) {
IlmApi.prototype.start = function ilmStartApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_ilm' + '/' + 'start'
@ -264,10 +264,10 @@ IlmApi.prototype.start = function ilmStartApi (params, options, callback) {
IlmApi.prototype.stop = function ilmStopApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_ilm' + '/' + 'stop'

View File

@ -30,19 +30,19 @@ function indexApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, id, index, type, ...querystring } = params
let { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)

View File

@ -35,25 +35,25 @@ IndicesApi.prototype.addBlock = function indicesAddBlockApi (params, options, ca
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params['block'] == null) {
if (params.block == null) {
const err = new this[kConfigurationError]('Missing required parameter: block')
return handleError(err, callback)
}
// check required url components
if (params['block'] != null && (params['index'] == null)) {
if (params.block != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
var { method, body, index, block, ...querystring } = params
let { method, body, index, block, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + '_block' + '/' + encodeURIComponent(block)
@ -71,10 +71,10 @@ IndicesApi.prototype.addBlock = function indicesAddBlockApi (params, options, ca
IndicesApi.prototype.analyze = function indicesAnalyzeApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_analyze'
@ -97,10 +97,10 @@ IndicesApi.prototype.analyze = function indicesAnalyzeApi (params, options, call
IndicesApi.prototype.clearCache = function indicesClearCacheApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_cache' + '/' + 'clear'
@ -124,25 +124,25 @@ IndicesApi.prototype.clone = function indicesCloneApi (params, options, callback
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params['target'] == null) {
if (params.target == null) {
const err = new this[kConfigurationError]('Missing required parameter: target')
return handleError(err, callback)
}
// check required url components
if (params['target'] != null && (params['index'] == null)) {
if (params.target != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
var { method, body, index, target, ...querystring } = params
let { method, body, index, target, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + '_clone' + '/' + encodeURIComponent(target)
@ -161,15 +161,15 @@ IndicesApi.prototype.close = function indicesCloseApi (params, options, callback
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_close'
@ -188,15 +188,15 @@ IndicesApi.prototype.create = function indicesCreateApi (params, options, callba
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index)
@ -215,15 +215,15 @@ IndicesApi.prototype.delete = function indicesDeleteApi (params, options, callba
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + encodeURIComponent(index)
@ -242,25 +242,25 @@ IndicesApi.prototype.deleteAlias = function indicesDeleteAliasApi (params, optio
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
// check required url components
if (params['name'] != null && (params['index'] == null)) {
if (params.name != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
var { method, body, index, name, ...querystring } = params
let { method, body, index, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (name) != null) {
if (method == null) method = 'DELETE'
path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
@ -284,15 +284,15 @@ IndicesApi.prototype.deleteIndexTemplate = function indicesDeleteIndexTemplateAp
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_index_template' + '/' + encodeURIComponent(name)
@ -311,15 +311,15 @@ IndicesApi.prototype.deleteTemplate = function indicesDeleteTemplateApi (params,
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_template' + '/' + encodeURIComponent(name)
@ -338,15 +338,15 @@ IndicesApi.prototype.exists = function indicesExistsApi (params, options, callba
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'HEAD'
path = '/' + encodeURIComponent(index)
@ -365,15 +365,15 @@ IndicesApi.prototype.existsAlias = function indicesExistsAliasApi (params, optio
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, index, ...querystring } = params
let { method, body, name, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (name) != null) {
if (method == null) method = 'HEAD'
path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
@ -397,15 +397,15 @@ IndicesApi.prototype.existsIndexTemplate = function indicesExistsIndexTemplateAp
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'HEAD'
path = '/' + '_index_template' + '/' + encodeURIComponent(name)
@ -424,15 +424,15 @@ IndicesApi.prototype.existsTemplate = function indicesExistsTemplateApi (params,
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'HEAD'
path = '/' + '_template' + '/' + encodeURIComponent(name)
@ -451,25 +451,25 @@ IndicesApi.prototype.existsType = function indicesExistsTypeApi (params, options
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params['type'] == null) {
if (params.type == null) {
const err = new this[kConfigurationError]('Missing required parameter: type')
return handleError(err, callback)
}
// check required url components
if (params['type'] != null && (params['index'] == null)) {
if (params.type != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'HEAD'
path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type)
@ -487,10 +487,10 @@ IndicesApi.prototype.existsType = function indicesExistsTypeApi (params, options
IndicesApi.prototype.flush = function indicesFlushApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_flush'
@ -513,10 +513,10 @@ IndicesApi.prototype.flush = function indicesFlushApi (params, options, callback
IndicesApi.prototype.flushSynced = function indicesFlushSyncedApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_flush' + '/' + 'synced'
@ -534,10 +534,10 @@ IndicesApi.prototype.flushSynced = function indicesFlushSyncedApi (params, optio
IndicesApi.prototype.forcemerge = function indicesForcemergeApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_forcemerge'
@ -561,15 +561,15 @@ IndicesApi.prototype.get = function indicesGetApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index)
@ -587,10 +587,10 @@ IndicesApi.prototype.get = function indicesGetApi (params, options, callback) {
IndicesApi.prototype.getAlias = function indicesGetAliasApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, name, index, ...querystring } = params
let { method, body, name, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (name) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
@ -620,15 +620,15 @@ IndicesApi.prototype.getFieldMapping = function indicesGetFieldMappingApi (param
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['fields'] == null) {
if (params.fields == null) {
const err = new this[kConfigurationError]('Missing required parameter: fields')
return handleError(err, callback)
}
var { method, body, fields, index, type, ...querystring } = params
let { method, body, fields, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null && (fields) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type) + '/' + 'field' + '/' + encodeURIComponent(fields)
@ -657,10 +657,10 @@ IndicesApi.prototype.getFieldMapping = function indicesGetFieldMappingApi (param
IndicesApi.prototype.getIndexTemplate = function indicesGetIndexTemplateApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_index_template' + '/' + encodeURIComponent(name)
@ -683,10 +683,10 @@ IndicesApi.prototype.getIndexTemplate = function indicesGetIndexTemplateApi (par
IndicesApi.prototype.getMapping = function indicesGetMappingApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type)
@ -715,10 +715,10 @@ IndicesApi.prototype.getMapping = function indicesGetMappingApi (params, options
IndicesApi.prototype.getSettings = function indicesGetSettingsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, name, ...querystring } = params
let { method, body, index, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (name) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_settings' + '/' + encodeURIComponent(name)
@ -747,10 +747,10 @@ IndicesApi.prototype.getSettings = function indicesGetSettingsApi (params, optio
IndicesApi.prototype.getTemplate = function indicesGetTemplateApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_template' + '/' + encodeURIComponent(name)
@ -773,10 +773,10 @@ IndicesApi.prototype.getTemplate = function indicesGetTemplateApi (params, optio
IndicesApi.prototype.getUpgrade = function indicesGetUpgradeApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_upgrade'
@ -795,15 +795,15 @@ IndicesApi.prototype.open = function indicesOpenApi (params, options, callback)
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_open'
@ -822,25 +822,25 @@ IndicesApi.prototype.putAlias = function indicesPutAliasApi (params, options, ca
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
// check required url components
if (params['name'] != null && (params['index'] == null)) {
if (params.name != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
var { method, body, index, name, ...querystring } = params
let { method, body, index, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (name) != null) {
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
@ -864,19 +864,19 @@ IndicesApi.prototype.putIndexTemplate = function indicesPutIndexTemplateApi (par
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_index_template' + '/' + encodeURIComponent(name)
@ -895,15 +895,15 @@ IndicesApi.prototype.putMapping = function indicesPutMappingApi (params, options
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null) {
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mapping'
@ -945,15 +945,15 @@ IndicesApi.prototype.putSettings = function indicesPutSettingsApi (params, optio
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + '_settings'
@ -977,19 +977,19 @@ IndicesApi.prototype.putTemplate = function indicesPutTemplateApi (params, optio
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_template' + '/' + encodeURIComponent(name)
@ -1007,10 +1007,10 @@ IndicesApi.prototype.putTemplate = function indicesPutTemplateApi (params, optio
IndicesApi.prototype.recovery = function indicesRecoveryApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_recovery'
@ -1033,10 +1033,10 @@ IndicesApi.prototype.recovery = function indicesRecoveryApi (params, options, ca
IndicesApi.prototype.refresh = function indicesRefreshApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_refresh'
@ -1060,15 +1060,15 @@ IndicesApi.prototype.resolveIndex = function indicesResolveIndexApi (params, opt
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_resolve' + '/' + 'index' + '/' + encodeURIComponent(name)
@ -1087,21 +1087,21 @@ IndicesApi.prototype.rollover = function indicesRolloverApi (params, options, ca
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['alias'] == null) {
if (params.alias == null) {
const err = new this[kConfigurationError]('Missing required parameter: alias')
return handleError(err, callback)
}
// check required url components
if ((params['new_index'] != null || params['newIndex'] != null) && (params['alias'] == null)) {
if ((params.new_index != null || params.newIndex != null) && (params.alias == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: alias')
return handleError(err, callback)
}
var { method, body, alias, newIndex, new_index, ...querystring } = params
let { method, body, alias, newIndex, new_index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((alias) != null && (new_index || newIndex) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(alias) + '/' + '_rollover' + '/' + encodeURIComponent(new_index || newIndex)
@ -1124,10 +1124,10 @@ IndicesApi.prototype.rollover = function indicesRolloverApi (params, options, ca
IndicesApi.prototype.segments = function indicesSegmentsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_segments'
@ -1150,10 +1150,10 @@ IndicesApi.prototype.segments = function indicesSegmentsApi (params, options, ca
IndicesApi.prototype.shardStores = function indicesShardStoresApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_shard_stores'
@ -1177,25 +1177,25 @@ IndicesApi.prototype.shrink = function indicesShrinkApi (params, options, callba
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params['target'] == null) {
if (params.target == null) {
const err = new this[kConfigurationError]('Missing required parameter: target')
return handleError(err, callback)
}
// check required url components
if (params['target'] != null && (params['index'] == null)) {
if (params.target != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
var { method, body, index, target, ...querystring } = params
let { method, body, index, target, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + '_shrink' + '/' + encodeURIComponent(target)
@ -1214,15 +1214,15 @@ IndicesApi.prototype.simulateIndexTemplate = function indicesSimulateIndexTempla
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_index_template' + '/' + '_simulate_index' + '/' + encodeURIComponent(name)
@ -1240,10 +1240,10 @@ IndicesApi.prototype.simulateIndexTemplate = function indicesSimulateIndexTempla
IndicesApi.prototype.simulateTemplate = function indicesSimulateTemplateApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((name) != null) {
if (method == null) method = 'POST'
path = '/' + '_index_template' + '/' + '_simulate' + '/' + encodeURIComponent(name)
@ -1267,25 +1267,25 @@ IndicesApi.prototype.split = function indicesSplitApi (params, options, callback
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params['target'] == null) {
if (params.target == null) {
const err = new this[kConfigurationError]('Missing required parameter: target')
return handleError(err, callback)
}
// check required url components
if (params['target'] != null && (params['index'] == null)) {
if (params.target != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
var { method, body, index, target, ...querystring } = params
let { method, body, index, target, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + '_split' + '/' + encodeURIComponent(target)
@ -1303,10 +1303,10 @@ IndicesApi.prototype.split = function indicesSplitApi (params, options, callback
IndicesApi.prototype.stats = function indicesStatsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, metric, index, ...querystring } = params
let { method, body, metric, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (metric) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_stats' + '/' + encodeURIComponent(metric)
@ -1336,15 +1336,15 @@ IndicesApi.prototype.updateAliases = function indicesUpdateAliasesApi (params, o
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_aliases'
@ -1362,10 +1362,10 @@ IndicesApi.prototype.updateAliases = function indicesUpdateAliasesApi (params, o
IndicesApi.prototype.upgrade = function indicesUpgradeApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_upgrade'
@ -1384,15 +1384,15 @@ IndicesApi.prototype.validateQuery = function indicesValidateQueryApi (params, o
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required url components
if (params['type'] != null && (params['index'] == null)) {
if (params.type != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_validate' + '/' + 'query'
@ -1419,15 +1419,15 @@ IndicesApi.prototype.createDataStream = function indicesCreateDataStreamApi (par
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_data_stream' + '/' + encodeURIComponent(name)
@ -1445,10 +1445,10 @@ IndicesApi.prototype.createDataStream = function indicesCreateDataStreamApi (par
IndicesApi.prototype.dataStreamsStats = function indicesDataStreamsStatsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_data_stream' + '/' + encodeURIComponent(name) + '/' + '_stats'
@ -1472,15 +1472,15 @@ IndicesApi.prototype.deleteDataStream = function indicesDeleteDataStreamApi (par
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_data_stream' + '/' + encodeURIComponent(name)
@ -1499,15 +1499,15 @@ IndicesApi.prototype.freeze = function indicesFreezeApi (params, options, callba
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_freeze'
@ -1525,10 +1525,10 @@ IndicesApi.prototype.freeze = function indicesFreezeApi (params, options, callba
IndicesApi.prototype.getDataStream = function indicesGetDataStreamApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_data_stream' + '/' + encodeURIComponent(name)
@ -1552,15 +1552,15 @@ IndicesApi.prototype.migrateToDataStream = function indicesMigrateToDataStreamAp
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_data_stream' + '/' + '_migrate' + '/' + encodeURIComponent(name)
@ -1579,15 +1579,15 @@ IndicesApi.prototype.promoteDataStream = function indicesPromoteDataStreamApi (p
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_data_stream' + '/' + '_promote' + '/' + encodeURIComponent(name)
@ -1606,15 +1606,15 @@ IndicesApi.prototype.reloadSearchAnalyzers = function indicesReloadSearchAnalyze
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_reload_search_analyzers'
@ -1633,15 +1633,15 @@ IndicesApi.prototype.unfreeze = function indicesUnfreezeApi (params, options, ca
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_unfreeze'

View File

@ -29,10 +29,10 @@ const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
function infoApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/'

View File

@ -35,15 +35,15 @@ IngestApi.prototype.deletePipeline = function ingestDeletePipelineApi (params, o
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
@ -61,10 +61,10 @@ IngestApi.prototype.deletePipeline = function ingestDeletePipelineApi (params, o
IngestApi.prototype.getPipeline = function ingestGetPipelineApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((id) != null) {
if (method == null) method = 'GET'
path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
@ -87,10 +87,10 @@ IngestApi.prototype.getPipeline = function ingestGetPipelineApi (params, options
IngestApi.prototype.processorGrok = function ingestProcessorGrokApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_ingest' + '/' + 'processor' + '/' + 'grok'
@ -109,19 +109,19 @@ IngestApi.prototype.putPipeline = function ingestPutPipelineApi (params, options
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
@ -140,15 +140,15 @@ IngestApi.prototype.simulate = function ingestSimulateApi (params, options, call
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((id) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id) + '/' + '_simulate'

View File

@ -34,10 +34,10 @@ function LicenseApi (transport, ConfigurationError) {
LicenseApi.prototype.delete = function licenseDeleteApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_license'
@ -55,10 +55,10 @@ LicenseApi.prototype.delete = function licenseDeleteApi (params, options, callba
LicenseApi.prototype.get = function licenseGetApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_license'
@ -76,10 +76,10 @@ LicenseApi.prototype.get = function licenseGetApi (params, options, callback) {
LicenseApi.prototype.getBasicStatus = function licenseGetBasicStatusApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_license' + '/' + 'basic_status'
@ -97,10 +97,10 @@ LicenseApi.prototype.getBasicStatus = function licenseGetBasicStatusApi (params,
LicenseApi.prototype.getTrialStatus = function licenseGetTrialStatusApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_license' + '/' + 'trial_status'
@ -118,10 +118,10 @@ LicenseApi.prototype.getTrialStatus = function licenseGetTrialStatusApi (params,
LicenseApi.prototype.post = function licensePostApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_license'
@ -139,10 +139,10 @@ LicenseApi.prototype.post = function licensePostApi (params, options, callback)
LicenseApi.prototype.postStartBasic = function licensePostStartBasicApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_license' + '/' + 'start_basic'
@ -160,10 +160,10 @@ LicenseApi.prototype.postStartBasic = function licensePostStartBasicApi (params,
LicenseApi.prototype.postStartTrial = function licensePostStartTrialApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_license' + '/' + 'start_trial'

View File

@ -35,15 +35,15 @@ LogstashApi.prototype.deletePipeline = function logstashDeletePipelineApi (param
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_logstash' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
@ -62,15 +62,15 @@ LogstashApi.prototype.getPipeline = function logstashGetPipelineApi (params, opt
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_logstash' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
@ -89,19 +89,19 @@ LogstashApi.prototype.putPipeline = function logstashPutPipelineApi (params, opt
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_logstash' + '/' + 'pipeline' + '/' + encodeURIComponent(id)

View File

@ -23,28 +23,28 @@
/* eslint no-unused-vars: 0 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['stored_fields', 'preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_includes', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', errorTrace: 'error_trace', filterPath: 'filter_path' }
const acceptedQuerystring = ['stored_fields', 'preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', errorTrace: 'error_trace', filterPath: 'filter_path' }
function mgetApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if (params['type'] != null && (params['index'] == null)) {
if (params.type != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mget'

View File

@ -34,10 +34,10 @@ function MigrationApi (transport, ConfigurationError) {
MigrationApi.prototype.deprecations = function migrationDeprecationsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_migration' + '/' + 'deprecations'

File diff suppressed because it is too large Load Diff

View File

@ -35,15 +35,15 @@ MonitoringApi.prototype.bulk = function monitoringBulkApi (params, options, call
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, type, ...querystring } = params
let { method, body, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((type) != null) {
if (method == null) method = 'POST'
path = '/' + '_monitoring' + '/' + encodeURIComponent(type) + '/' + 'bulk'

View File

@ -30,21 +30,21 @@ function msearchApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if (params['type'] != null && (params['index'] == null)) {
if (params.type != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_msearch'

View File

@ -30,21 +30,21 @@ function msearchTemplateApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if (params['type'] != null && (params['index'] == null)) {
if (params.type != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_msearch' + '/' + 'template'

View File

@ -30,15 +30,15 @@ function mtermvectorsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required url components
if (params['type'] != null && (params['index'] == null)) {
if (params.type != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mtermvectors'

View File

@ -34,10 +34,10 @@ function NodesApi (transport, ConfigurationError) {
NodesApi.prototype.hotThreads = function nodesHotThreadsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, nodeId, node_id, ...querystring } = params
let { method, body, nodeId, node_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((node_id || nodeId) != null) {
if (method == null) method = 'GET'
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'hot_threads'
@ -69,10 +69,10 @@ NodesApi.prototype.hotThreads = function nodesHotThreadsApi (params, options, ca
NodesApi.prototype.info = function nodesInfoApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, nodeId, node_id, metric, ...querystring } = params
let { method, body, nodeId, node_id, metric, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((node_id || nodeId) != null && (metric) != null) {
if (method == null) method = 'GET'
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + encodeURIComponent(metric)
@ -101,10 +101,10 @@ NodesApi.prototype.info = function nodesInfoApi (params, options, callback) {
NodesApi.prototype.reloadSecureSettings = function nodesReloadSecureSettingsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, nodeId, node_id, ...querystring } = params
let { method, body, nodeId, node_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((node_id || nodeId) != null) {
if (method == null) method = 'POST'
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'reload_secure_settings'
@ -127,10 +127,10 @@ NodesApi.prototype.reloadSecureSettings = function nodesReloadSecureSettingsApi
NodesApi.prototype.stats = function nodesStatsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, nodeId, node_id, metric, indexMetric, index_metric, ...querystring } = params
let { method, body, nodeId, node_id, metric, indexMetric, index_metric, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((node_id || nodeId) != null && (metric) != null && (index_metric || indexMetric) != null) {
if (method == null) method = 'GET'
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'stats' + '/' + encodeURIComponent(metric) + '/' + encodeURIComponent(index_metric || indexMetric)
@ -165,10 +165,10 @@ NodesApi.prototype.stats = function nodesStatsApi (params, options, callback) {
NodesApi.prototype.usage = function nodesUsageApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, nodeId, node_id, metric, ...querystring } = params
let { method, body, nodeId, node_id, metric, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((node_id || nodeId) != null && (metric) != null) {
if (method == null) method = 'GET'
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'usage' + '/' + encodeURIComponent(metric)

View File

@ -29,10 +29,10 @@ const snakeCase = { ignoreUnavailable: 'ignore_unavailable', expandWildcards: 'e
function openPointInTimeApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_pit'

View File

@ -29,10 +29,10 @@ const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
function pingApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'HEAD'
path = '/'

View File

@ -30,25 +30,25 @@ function putScriptApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if (params['context'] != null && (params['id'] == null)) {
if (params.context != null && (params.id == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: id')
return handleError(err, callback)
}
var { method, body, id, context, ...querystring } = params
let { method, body, id, context, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((id) != null && (context) != null) {
if (method == null) method = 'PUT'
path = '/' + '_scripts' + '/' + encodeURIComponent(id) + '/' + encodeURIComponent(context)

View File

@ -30,15 +30,15 @@ function rankEvalApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_rank_eval'

View File

@ -30,15 +30,15 @@ function reindexApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_reindex'

View File

@ -30,19 +30,19 @@ function reindexRethrottleApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['task_id'] == null && params['taskId'] == null) {
if (params.task_id == null && params.taskId == null) {
const err = new this[kConfigurationError]('Missing required parameter: task_id or taskId')
return handleError(err, callback)
}
if (params['requests_per_second'] == null && params['requestsPerSecond'] == null) {
if (params.requests_per_second == null && params.requestsPerSecond == null) {
const err = new this[kConfigurationError]('Missing required parameter: requests_per_second or requestsPerSecond')
return handleError(err, callback)
}
var { method, body, taskId, task_id, ...querystring } = params
let { method, body, taskId, task_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_reindex' + '/' + encodeURIComponent(task_id || taskId) + '/' + '_rethrottle'

View File

@ -29,10 +29,10 @@ const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
function renderSearchTemplateApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((id) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_render' + '/' + 'template' + '/' + encodeURIComponent(id)

View File

@ -35,15 +35,15 @@ RollupApi.prototype.deleteJob = function rollupDeleteJobApi (params, options, ca
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id)
@ -61,10 +61,10 @@ RollupApi.prototype.deleteJob = function rollupDeleteJobApi (params, options, ca
RollupApi.prototype.getJobs = function rollupGetJobsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((id) != null) {
if (method == null) method = 'GET'
path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id)
@ -87,10 +87,10 @@ RollupApi.prototype.getJobs = function rollupGetJobsApi (params, options, callba
RollupApi.prototype.getRollupCaps = function rollupGetRollupCapsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((id) != null) {
if (method == null) method = 'GET'
path = '/' + '_rollup' + '/' + 'data' + '/' + encodeURIComponent(id)
@ -114,15 +114,15 @@ RollupApi.prototype.getRollupIndexCaps = function rollupGetRollupIndexCapsApi (p
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_rollup' + '/' + 'data'
@ -141,19 +141,19 @@ RollupApi.prototype.putJob = function rollupPutJobApi (params, options, callback
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id)
@ -172,29 +172,29 @@ RollupApi.prototype.rollup = function rollupRollupApi (params, options, callback
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params['rollup_index'] == null && params['rollupIndex'] == null) {
if (params.rollup_index == null && params.rollupIndex == null) {
const err = new this[kConfigurationError]('Missing required parameter: rollup_index or rollupIndex')
return handleError(err, callback)
}
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if ((params['rollup_index'] != null || params['rollupIndex'] != null) && (params['index'] == null)) {
if ((params.rollup_index != null || params.rollupIndex != null) && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
var { method, body, index, rollupIndex, rollup_index, ...querystring } = params
let { method, body, index, rollupIndex, rollup_index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_rollup' + '/' + encodeURIComponent(rollup_index || rollupIndex)
@ -213,25 +213,25 @@ RollupApi.prototype.rollupSearch = function rollupRollupSearchApi (params, optio
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if (params['type'] != null && (params['index'] == null)) {
if (params.type != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_rollup_search'
@ -255,15 +255,15 @@ RollupApi.prototype.startJob = function rollupStartJobApi (params, options, call
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id) + '/' + '_start'
@ -282,15 +282,15 @@ RollupApi.prototype.stopJob = function rollupStopJobApi (params, options, callba
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_rollup' + '/' + 'job' + '/' + encodeURIComponent(id) + '/' + '_stop'

View File

@ -29,10 +29,10 @@ const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
function scriptsPainlessExecuteApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_scripts' + '/' + 'painless' + '/' + '_execute'

View File

@ -29,10 +29,10 @@ const snakeCase = { scrollId: 'scroll_id', restTotalHitsAsInt: 'rest_total_hits_
function scrollApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, scrollId, scroll_id, ...querystring } = params
let { method, body, scrollId, scroll_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((scroll_id || scrollId) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_search' + '/' + 'scroll' + '/' + encodeURIComponent(scroll_id || scrollId)

View File

@ -23,22 +23,22 @@
/* eslint no-unused-vars: 0 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['analyzer', 'analyze_wildcard', 'ccs_minimize_roundtrips', 'default_operator', 'df', 'explain', 'stored_fields', 'docvalue_fields', 'from', 'ignore_unavailable', 'ignore_throttled', 'allow_no_indices', 'expand_wildcards', 'lenient', 'preference', 'q', 'routing', 'scroll', 'search_type', 'size', 'sort', '_source', '_source_excludes', '_source_includes', 'terminate_after', 'stats', 'suggest_field', 'suggest_mode', 'suggest_size', 'suggest_text', 'timeout', 'track_scores', 'track_total_hits', 'allow_partial_search_results', 'typed_keys', 'version', 'seq_no_primary_term', 'request_cache', 'batched_reduce_size', 'max_concurrent_shard_requests', 'pre_filter_shard_size', 'rest_total_hits_as_int', 'min_compatible_shard_node', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { analyzeWildcard: 'analyze_wildcard', ccsMinimizeRoundtrips: 'ccs_minimize_roundtrips', defaultOperator: 'default_operator', storedFields: 'stored_fields', docvalueFields: 'docvalue_fields', ignoreUnavailable: 'ignore_unavailable', ignoreThrottled: 'ignore_throttled', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', searchType: 'search_type', _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', terminateAfter: 'terminate_after', suggestField: 'suggest_field', suggestMode: 'suggest_mode', suggestSize: 'suggest_size', suggestText: 'suggest_text', trackScores: 'track_scores', trackTotalHits: 'track_total_hits', allowPartialSearchResults: 'allow_partial_search_results', typedKeys: 'typed_keys', seqNoPrimaryTerm: 'seq_no_primary_term', requestCache: 'request_cache', batchedReduceSize: 'batched_reduce_size', maxConcurrentShardRequests: 'max_concurrent_shard_requests', preFilterShardSize: 'pre_filter_shard_size', restTotalHitsAsInt: 'rest_total_hits_as_int', minCompatibleShardNode: 'min_compatible_shard_node', errorTrace: 'error_trace', filterPath: 'filter_path' }
const acceptedQuerystring = ['analyzer', 'analyze_wildcard', 'ccs_minimize_roundtrips', 'default_operator', 'df', 'explain', 'stored_fields', 'docvalue_fields', 'from', 'ignore_unavailable', 'ignore_throttled', 'allow_no_indices', 'expand_wildcards', 'lenient', 'preference', 'q', 'routing', 'scroll', 'search_type', 'size', 'sort', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'terminate_after', 'stats', 'suggest_field', 'suggest_mode', 'suggest_size', 'suggest_text', 'timeout', 'track_scores', 'track_total_hits', 'allow_partial_search_results', 'typed_keys', 'version', 'seq_no_primary_term', 'request_cache', 'batched_reduce_size', 'max_concurrent_shard_requests', 'pre_filter_shard_size', 'rest_total_hits_as_int', 'min_compatible_shard_node', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { analyzeWildcard: 'analyze_wildcard', ccsMinimizeRoundtrips: 'ccs_minimize_roundtrips', defaultOperator: 'default_operator', storedFields: 'stored_fields', docvalueFields: 'docvalue_fields', ignoreUnavailable: 'ignore_unavailable', ignoreThrottled: 'ignore_throttled', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', searchType: 'search_type', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', terminateAfter: 'terminate_after', suggestField: 'suggest_field', suggestMode: 'suggest_mode', suggestSize: 'suggest_size', suggestText: 'suggest_text', trackScores: 'track_scores', trackTotalHits: 'track_total_hits', allowPartialSearchResults: 'allow_partial_search_results', typedKeys: 'typed_keys', seqNoPrimaryTerm: 'seq_no_primary_term', requestCache: 'request_cache', batchedReduceSize: 'batched_reduce_size', maxConcurrentShardRequests: 'max_concurrent_shard_requests', preFilterShardSize: 'pre_filter_shard_size', restTotalHitsAsInt: 'rest_total_hits_as_int', minCompatibleShardNode: 'min_compatible_shard_node', errorTrace: 'error_trace', filterPath: 'filter_path' }
function searchApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required url components
if (params['type'] != null && (params['index'] == null)) {
if (params.type != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_search'

View File

@ -29,10 +29,10 @@ const snakeCase = { ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'al
function searchShardsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_search_shards'

View File

@ -30,21 +30,21 @@ function searchTemplateApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if (params['type'] != null && (params['index'] == null)) {
if (params.type != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_search' + '/' + 'template'

View File

@ -34,10 +34,10 @@ function SearchableSnapshotsApi (transport, ConfigurationError) {
SearchableSnapshotsApi.prototype.clearCache = function searchableSnapshotsClearCacheApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_searchable_snapshots' + '/' + 'cache' + '/' + 'clear'
@ -61,29 +61,29 @@ SearchableSnapshotsApi.prototype.mount = function searchableSnapshotsMountApi (p
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['repository'] == null) {
if (params.repository == null) {
const err = new this[kConfigurationError]('Missing required parameter: repository')
return handleError(err, callback)
}
if (params['snapshot'] == null) {
if (params.snapshot == null) {
const err = new this[kConfigurationError]('Missing required parameter: snapshot')
return handleError(err, callback)
}
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if (params['snapshot'] != null && (params['repository'] == null)) {
if (params.snapshot != null && (params.repository == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: repository')
return handleError(err, callback)
}
var { method, body, repository, snapshot, ...querystring } = params
let { method, body, repository, snapshot, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot) + '/' + '_mount'
@ -102,15 +102,15 @@ SearchableSnapshotsApi.prototype.repositoryStats = function searchableSnapshotsR
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['repository'] == null) {
if (params.repository == null) {
const err = new this[kConfigurationError]('Missing required parameter: repository')
return handleError(err, callback)
}
var { method, body, repository, ...querystring } = params
let { method, body, repository, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_stats'
@ -128,10 +128,10 @@ SearchableSnapshotsApi.prototype.repositoryStats = function searchableSnapshotsR
SearchableSnapshotsApi.prototype.stats = function searchableSnapshotsStatsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, index, ...querystring } = params
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_searchable_snapshots' + '/' + 'stats'

View File

@ -34,10 +34,10 @@ function SecurityApi (transport, ConfigurationError) {
SecurityApi.prototype.authenticate = function securityAuthenticateApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_security' + '/' + '_authenticate'
@ -56,15 +56,15 @@ SecurityApi.prototype.changePassword = function securityChangePasswordApi (param
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, username, ...querystring } = params
let { method, body, username, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((username) != null) {
if (method == null) method = 'PUT'
path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(username) + '/' + '_password'
@ -88,15 +88,15 @@ SecurityApi.prototype.clearApiKeyCache = function securityClearApiKeyCacheApi (p
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['ids'] == null) {
if (params.ids == null) {
const err = new this[kConfigurationError]('Missing required parameter: ids')
return handleError(err, callback)
}
var { method, body, ids, ...querystring } = params
let { method, body, ids, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_security' + '/' + 'api_key' + '/' + encodeURIComponent(ids) + '/' + '_clear_cache'
@ -115,15 +115,15 @@ SecurityApi.prototype.clearCachedPrivileges = function securityClearCachedPrivil
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['application'] == null) {
if (params.application == null) {
const err = new this[kConfigurationError]('Missing required parameter: application')
return handleError(err, callback)
}
var { method, body, application, ...querystring } = params
let { method, body, application, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_security' + '/' + 'privilege' + '/' + encodeURIComponent(application) + '/' + '_clear_cache'
@ -142,15 +142,15 @@ SecurityApi.prototype.clearCachedRealms = function securityClearCachedRealmsApi
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['realms'] == null) {
if (params.realms == null) {
const err = new this[kConfigurationError]('Missing required parameter: realms')
return handleError(err, callback)
}
var { method, body, realms, ...querystring } = params
let { method, body, realms, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_security' + '/' + 'realm' + '/' + encodeURIComponent(realms) + '/' + '_clear_cache'
@ -169,15 +169,15 @@ SecurityApi.prototype.clearCachedRoles = function securityClearCachedRolesApi (p
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_security' + '/' + 'role' + '/' + encodeURIComponent(name) + '/' + '_clear_cache'
@ -196,15 +196,15 @@ SecurityApi.prototype.createApiKey = function securityCreateApiKeyApi (params, o
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_security' + '/' + 'api_key'
@ -223,25 +223,25 @@ SecurityApi.prototype.deletePrivileges = function securityDeletePrivilegesApi (p
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['application'] == null) {
if (params.application == null) {
const err = new this[kConfigurationError]('Missing required parameter: application')
return handleError(err, callback)
}
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
// check required url components
if (params['name'] != null && (params['application'] == null)) {
if (params.name != null && (params.application == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: application')
return handleError(err, callback)
}
var { method, body, application, name, ...querystring } = params
let { method, body, application, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_security' + '/' + 'privilege' + '/' + encodeURIComponent(application) + '/' + encodeURIComponent(name)
@ -260,15 +260,15 @@ SecurityApi.prototype.deleteRole = function securityDeleteRoleApi (params, optio
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_security' + '/' + 'role' + '/' + encodeURIComponent(name)
@ -287,15 +287,15 @@ SecurityApi.prototype.deleteRoleMapping = function securityDeleteRoleMappingApi
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_security' + '/' + 'role_mapping' + '/' + encodeURIComponent(name)
@ -314,15 +314,15 @@ SecurityApi.prototype.deleteUser = function securityDeleteUserApi (params, optio
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['username'] == null) {
if (params.username == null) {
const err = new this[kConfigurationError]('Missing required parameter: username')
return handleError(err, callback)
}
var { method, body, username, ...querystring } = params
let { method, body, username, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(username)
@ -341,15 +341,15 @@ SecurityApi.prototype.disableUser = function securityDisableUserApi (params, opt
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['username'] == null) {
if (params.username == null) {
const err = new this[kConfigurationError]('Missing required parameter: username')
return handleError(err, callback)
}
var { method, body, username, ...querystring } = params
let { method, body, username, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(username) + '/' + '_disable'
@ -368,15 +368,15 @@ SecurityApi.prototype.enableUser = function securityEnableUserApi (params, optio
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['username'] == null) {
if (params.username == null) {
const err = new this[kConfigurationError]('Missing required parameter: username')
return handleError(err, callback)
}
var { method, body, username, ...querystring } = params
let { method, body, username, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(username) + '/' + '_enable'
@ -394,10 +394,10 @@ SecurityApi.prototype.enableUser = function securityEnableUserApi (params, optio
SecurityApi.prototype.getApiKey = function securityGetApiKeyApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_security' + '/' + 'api_key'
@ -415,10 +415,10 @@ SecurityApi.prototype.getApiKey = function securityGetApiKeyApi (params, options
SecurityApi.prototype.getBuiltinPrivileges = function securityGetBuiltinPrivilegesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_security' + '/' + 'privilege' + '/' + '_builtin'
@ -437,15 +437,15 @@ SecurityApi.prototype.getPrivileges = function securityGetPrivilegesApi (params,
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required url components
if (params['name'] != null && (params['application'] == null)) {
if (params.name != null && (params.application == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: application')
return handleError(err, callback)
}
var { method, body, application, name, ...querystring } = params
let { method, body, application, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((application) != null && (name) != null) {
if (method == null) method = 'GET'
path = '/' + '_security' + '/' + 'privilege' + '/' + encodeURIComponent(application) + '/' + encodeURIComponent(name)
@ -471,10 +471,10 @@ SecurityApi.prototype.getPrivileges = function securityGetPrivilegesApi (params,
SecurityApi.prototype.getRole = function securityGetRoleApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_security' + '/' + 'role' + '/' + encodeURIComponent(name)
@ -497,10 +497,10 @@ SecurityApi.prototype.getRole = function securityGetRoleApi (params, options, ca
SecurityApi.prototype.getRoleMapping = function securityGetRoleMappingApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_security' + '/' + 'role_mapping' + '/' + encodeURIComponent(name)
@ -524,15 +524,15 @@ SecurityApi.prototype.getToken = function securityGetTokenApi (params, options,
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_security' + '/' + 'oauth2' + '/' + 'token'
@ -550,10 +550,10 @@ SecurityApi.prototype.getToken = function securityGetTokenApi (params, options,
SecurityApi.prototype.getUser = function securityGetUserApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, username, ...querystring } = params
let { method, body, username, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((username) != null) {
if (method == null) method = 'GET'
path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(username)
@ -576,10 +576,10 @@ SecurityApi.prototype.getUser = function securityGetUserApi (params, options, ca
SecurityApi.prototype.getUserPrivileges = function securityGetUserPrivilegesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_security' + '/' + 'user' + '/' + '_privileges'
@ -598,15 +598,15 @@ SecurityApi.prototype.grantApiKey = function securityGrantApiKeyApi (params, opt
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_security' + '/' + 'api_key' + '/' + 'grant'
@ -625,15 +625,15 @@ SecurityApi.prototype.hasPrivileges = function securityHasPrivilegesApi (params,
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, user, ...querystring } = params
let { method, body, user, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((user) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(user) + '/' + '_has_privileges'
@ -657,15 +657,15 @@ SecurityApi.prototype.invalidateApiKey = function securityInvalidateApiKeyApi (p
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_security' + '/' + 'api_key'
@ -684,15 +684,15 @@ SecurityApi.prototype.invalidateToken = function securityInvalidateTokenApi (par
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_security' + '/' + 'oauth2' + '/' + 'token'
@ -711,15 +711,15 @@ SecurityApi.prototype.putPrivileges = function securityPutPrivilegesApi (params,
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_security' + '/' + 'privilege'
@ -738,19 +738,19 @@ SecurityApi.prototype.putRole = function securityPutRoleApi (params, options, ca
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_security' + '/' + 'role' + '/' + encodeURIComponent(name)
@ -769,19 +769,19 @@ SecurityApi.prototype.putRoleMapping = function securityPutRoleMappingApi (param
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['name'] == null) {
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, name, ...querystring } = params
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_security' + '/' + 'role_mapping' + '/' + encodeURIComponent(name)
@ -800,19 +800,19 @@ SecurityApi.prototype.putUser = function securityPutUserApi (params, options, ca
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['username'] == null) {
if (params.username == null) {
const err = new this[kConfigurationError]('Missing required parameter: username')
return handleError(err, callback)
}
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, username, ...querystring } = params
let { method, body, username, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_security' + '/' + 'user' + '/' + encodeURIComponent(username)

View File

@ -35,15 +35,15 @@ SlmApi.prototype.deleteLifecycle = function slmDeleteLifecycleApi (params, optio
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['policy_id'] == null && params['policyId'] == null) {
if (params.policy_id == null && params.policyId == null) {
const err = new this[kConfigurationError]('Missing required parameter: policy_id or policyId')
return handleError(err, callback)
}
var { method, body, policyId, policy_id, ...querystring } = params
let { method, body, policyId, policy_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_slm' + '/' + 'policy' + '/' + encodeURIComponent(policy_id || policyId)
@ -62,15 +62,15 @@ SlmApi.prototype.executeLifecycle = function slmExecuteLifecycleApi (params, opt
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['policy_id'] == null && params['policyId'] == null) {
if (params.policy_id == null && params.policyId == null) {
const err = new this[kConfigurationError]('Missing required parameter: policy_id or policyId')
return handleError(err, callback)
}
var { method, body, policyId, policy_id, ...querystring } = params
let { method, body, policyId, policy_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_slm' + '/' + 'policy' + '/' + encodeURIComponent(policy_id || policyId) + '/' + '_execute'
@ -88,10 +88,10 @@ SlmApi.prototype.executeLifecycle = function slmExecuteLifecycleApi (params, opt
SlmApi.prototype.executeRetention = function slmExecuteRetentionApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_slm' + '/' + '_execute_retention'
@ -109,10 +109,10 @@ SlmApi.prototype.executeRetention = function slmExecuteRetentionApi (params, opt
SlmApi.prototype.getLifecycle = function slmGetLifecycleApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, policyId, policy_id, ...querystring } = params
let { method, body, policyId, policy_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((policy_id || policyId) != null) {
if (method == null) method = 'GET'
path = '/' + '_slm' + '/' + 'policy' + '/' + encodeURIComponent(policy_id || policyId)
@ -135,10 +135,10 @@ SlmApi.prototype.getLifecycle = function slmGetLifecycleApi (params, options, ca
SlmApi.prototype.getStats = function slmGetStatsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_slm' + '/' + 'stats'
@ -156,10 +156,10 @@ SlmApi.prototype.getStats = function slmGetStatsApi (params, options, callback)
SlmApi.prototype.getStatus = function slmGetStatusApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_slm' + '/' + 'status'
@ -178,15 +178,15 @@ SlmApi.prototype.putLifecycle = function slmPutLifecycleApi (params, options, ca
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['policy_id'] == null && params['policyId'] == null) {
if (params.policy_id == null && params.policyId == null) {
const err = new this[kConfigurationError]('Missing required parameter: policy_id or policyId')
return handleError(err, callback)
}
var { method, body, policyId, policy_id, ...querystring } = params
let { method, body, policyId, policy_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_slm' + '/' + 'policy' + '/' + encodeURIComponent(policy_id || policyId)
@ -204,10 +204,10 @@ SlmApi.prototype.putLifecycle = function slmPutLifecycleApi (params, options, ca
SlmApi.prototype.start = function slmStartApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_slm' + '/' + 'start'
@ -225,10 +225,10 @@ SlmApi.prototype.start = function slmStartApi (params, options, callback) {
SlmApi.prototype.stop = function slmStopApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_slm' + '/' + 'stop'

View File

@ -35,15 +35,15 @@ SnapshotApi.prototype.cleanupRepository = function snapshotCleanupRepositoryApi
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['repository'] == null) {
if (params.repository == null) {
const err = new this[kConfigurationError]('Missing required parameter: repository')
return handleError(err, callback)
}
var { method, body, repository, ...querystring } = params
let { method, body, repository, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_cleanup'
@ -62,36 +62,36 @@ SnapshotApi.prototype.clone = function snapshotCloneApi (params, options, callba
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['repository'] == null) {
if (params.repository == null) {
const err = new this[kConfigurationError]('Missing required parameter: repository')
return handleError(err, callback)
}
if (params['snapshot'] == null) {
if (params.snapshot == null) {
const err = new this[kConfigurationError]('Missing required parameter: snapshot')
return handleError(err, callback)
}
if (params['target_snapshot'] == null && params['targetSnapshot'] == null) {
if (params.target_snapshot == null && params.targetSnapshot == null) {
const err = new this[kConfigurationError]('Missing required parameter: target_snapshot or targetSnapshot')
return handleError(err, callback)
}
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if ((params['target_snapshot'] != null || params['targetSnapshot'] != null) && (params['snapshot'] == null || params['repository'] == null)) {
if ((params.target_snapshot != null || params.targetSnapshot != null) && (params.snapshot == null || params.repository == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: snapshot, repository')
return handleError(err, callback)
} else if (params['snapshot'] != null && (params['repository'] == null)) {
} else if (params.snapshot != null && (params.repository == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: repository')
return handleError(err, callback)
}
var { method, body, repository, snapshot, targetSnapshot, target_snapshot, ...querystring } = params
let { method, body, repository, snapshot, targetSnapshot, target_snapshot, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot) + '/' + '_clone' + '/' + encodeURIComponent(target_snapshot || targetSnapshot)
@ -110,25 +110,25 @@ SnapshotApi.prototype.create = function snapshotCreateApi (params, options, call
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['repository'] == null) {
if (params.repository == null) {
const err = new this[kConfigurationError]('Missing required parameter: repository')
return handleError(err, callback)
}
if (params['snapshot'] == null) {
if (params.snapshot == null) {
const err = new this[kConfigurationError]('Missing required parameter: snapshot')
return handleError(err, callback)
}
// check required url components
if (params['snapshot'] != null && (params['repository'] == null)) {
if (params.snapshot != null && (params.repository == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: repository')
return handleError(err, callback)
}
var { method, body, repository, snapshot, ...querystring } = params
let { method, body, repository, snapshot, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot)
@ -147,19 +147,19 @@ SnapshotApi.prototype.createRepository = function snapshotCreateRepositoryApi (p
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['repository'] == null) {
if (params.repository == null) {
const err = new this[kConfigurationError]('Missing required parameter: repository')
return handleError(err, callback)
}
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, repository, ...querystring } = params
let { method, body, repository, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository)
@ -178,25 +178,25 @@ SnapshotApi.prototype.delete = function snapshotDeleteApi (params, options, call
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['repository'] == null) {
if (params.repository == null) {
const err = new this[kConfigurationError]('Missing required parameter: repository')
return handleError(err, callback)
}
if (params['snapshot'] == null) {
if (params.snapshot == null) {
const err = new this[kConfigurationError]('Missing required parameter: snapshot')
return handleError(err, callback)
}
// check required url components
if (params['snapshot'] != null && (params['repository'] == null)) {
if (params.snapshot != null && (params.repository == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: repository')
return handleError(err, callback)
}
var { method, body, repository, snapshot, ...querystring } = params
let { method, body, repository, snapshot, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot)
@ -215,15 +215,15 @@ SnapshotApi.prototype.deleteRepository = function snapshotDeleteRepositoryApi (p
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['repository'] == null) {
if (params.repository == null) {
const err = new this[kConfigurationError]('Missing required parameter: repository')
return handleError(err, callback)
}
var { method, body, repository, ...querystring } = params
let { method, body, repository, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository)
@ -242,25 +242,25 @@ SnapshotApi.prototype.get = function snapshotGetApi (params, options, callback)
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['repository'] == null) {
if (params.repository == null) {
const err = new this[kConfigurationError]('Missing required parameter: repository')
return handleError(err, callback)
}
if (params['snapshot'] == null) {
if (params.snapshot == null) {
const err = new this[kConfigurationError]('Missing required parameter: snapshot')
return handleError(err, callback)
}
// check required url components
if (params['snapshot'] != null && (params['repository'] == null)) {
if (params.snapshot != null && (params.repository == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: repository')
return handleError(err, callback)
}
var { method, body, repository, snapshot, ...querystring } = params
let { method, body, repository, snapshot, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot)
@ -275,34 +275,13 @@ SnapshotApi.prototype.get = function snapshotGetApi (params, options, callback)
return this.transport.request(request, options, callback)
}
SnapshotApi.prototype.getFeatures = function snapshotGetFeaturesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'GET'
path = '/' + '_snapshottable_features'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
SnapshotApi.prototype.getRepository = function snapshotGetRepositoryApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, repository, ...querystring } = params
let { method, body, repository, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((repository) != null) {
if (method == null) method = 'GET'
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository)
@ -326,25 +305,25 @@ SnapshotApi.prototype.restore = function snapshotRestoreApi (params, options, ca
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['repository'] == null) {
if (params.repository == null) {
const err = new this[kConfigurationError]('Missing required parameter: repository')
return handleError(err, callback)
}
if (params['snapshot'] == null) {
if (params.snapshot == null) {
const err = new this[kConfigurationError]('Missing required parameter: snapshot')
return handleError(err, callback)
}
// check required url components
if (params['snapshot'] != null && (params['repository'] == null)) {
if (params.snapshot != null && (params.repository == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: repository')
return handleError(err, callback)
}
var { method, body, repository, snapshot, ...querystring } = params
let { method, body, repository, snapshot, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot) + '/' + '_restore'
@ -363,15 +342,15 @@ SnapshotApi.prototype.status = function snapshotStatusApi (params, options, call
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required url components
if (params['snapshot'] != null && (params['repository'] == null)) {
if (params.snapshot != null && (params.repository == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: repository')
return handleError(err, callback)
}
var { method, body, repository, snapshot, ...querystring } = params
let { method, body, repository, snapshot, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((repository) != null && (snapshot) != null) {
if (method == null) method = 'GET'
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + encodeURIComponent(snapshot) + '/' + '_status'
@ -398,15 +377,15 @@ SnapshotApi.prototype.verifyRepository = function snapshotVerifyRepositoryApi (p
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['repository'] == null) {
if (params.repository == null) {
const err = new this[kConfigurationError]('Missing required parameter: repository')
return handleError(err, callback)
}
var { method, body, repository, ...querystring } = params
let { method, body, repository, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_verify'
@ -425,7 +404,6 @@ Object.defineProperties(SnapshotApi.prototype, {
cleanup_repository: { get () { return this.cleanupRepository } },
create_repository: { get () { return this.createRepository } },
delete_repository: { get () { return this.deleteRepository } },
get_features: { get () { return this.getFeatures } },
get_repository: { get () { return this.getRepository } },
verify_repository: { get () { return this.verifyRepository } }
})

View File

@ -35,15 +35,15 @@ SqlApi.prototype.clearCursor = function sqlClearCursorApi (params, options, call
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_sql' + '/' + 'close'
@ -62,15 +62,15 @@ SqlApi.prototype.query = function sqlQueryApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_sql'
@ -89,15 +89,15 @@ SqlApi.prototype.translate = function sqlTranslateApi (params, options, callback
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_sql' + '/' + 'translate'

View File

@ -34,10 +34,10 @@ function SslApi (transport, ConfigurationError) {
SslApi.prototype.certificates = function sslCertificatesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_ssl' + '/' + 'certificates'

View File

@ -34,10 +34,10 @@ function TasksApi (transport, ConfigurationError) {
TasksApi.prototype.cancel = function tasksCancelApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, taskId, task_id, ...querystring } = params
let { method, body, taskId, task_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((task_id || taskId) != null) {
if (method == null) method = 'POST'
path = '/' + '_tasks' + '/' + encodeURIComponent(task_id || taskId) + '/' + '_cancel'
@ -61,15 +61,15 @@ TasksApi.prototype.get = function tasksGetApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['task_id'] == null && params['taskId'] == null) {
if (params.task_id == null && params.taskId == null) {
const err = new this[kConfigurationError]('Missing required parameter: task_id or taskId')
return handleError(err, callback)
}
var { method, body, taskId, task_id, ...querystring } = params
let { method, body, taskId, task_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_tasks' + '/' + encodeURIComponent(task_id || taskId)
@ -87,10 +87,10 @@ TasksApi.prototype.get = function tasksGetApi (params, options, callback) {
TasksApi.prototype.list = function tasksListApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_tasks'

View File

@ -30,15 +30,15 @@ function termvectorsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
var { method, body, index, id, type, ...querystring } = params
let { method, body, index, id, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_termvectors'

View File

@ -35,15 +35,15 @@ TextStructureApi.prototype.findStructure = function textStructureFindStructureAp
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_text_structure' + '/' + 'find_structure'

View File

@ -35,15 +35,15 @@ TransformApi.prototype.deleteTransform = function transformDeleteTransformApi (p
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['transform_id'] == null && params['transformId'] == null) {
if (params.transform_id == null && params.transformId == null) {
const err = new this[kConfigurationError]('Missing required parameter: transform_id or transformId')
return handleError(err, callback)
}
var { method, body, transformId, transform_id, ...querystring } = params
let { method, body, transformId, transform_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId)
@ -61,10 +61,10 @@ TransformApi.prototype.deleteTransform = function transformDeleteTransformApi (p
TransformApi.prototype.getTransform = function transformGetTransformApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, transformId, transform_id, ...querystring } = params
let { method, body, transformId, transform_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((transform_id || transformId) != null) {
if (method == null) method = 'GET'
path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId)
@ -88,15 +88,15 @@ TransformApi.prototype.getTransformStats = function transformGetTransformStatsAp
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['transform_id'] == null && params['transformId'] == null) {
if (params.transform_id == null && params.transformId == null) {
const err = new this[kConfigurationError]('Missing required parameter: transform_id or transformId')
return handleError(err, callback)
}
var { method, body, transformId, transform_id, ...querystring } = params
let { method, body, transformId, transform_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_stats'
@ -115,15 +115,15 @@ TransformApi.prototype.previewTransform = function transformPreviewTransformApi
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_transform' + '/' + '_preview'
@ -142,19 +142,19 @@ TransformApi.prototype.putTransform = function transformPutTransformApi (params,
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['transform_id'] == null && params['transformId'] == null) {
if (params.transform_id == null && params.transformId == null) {
const err = new this[kConfigurationError]('Missing required parameter: transform_id or transformId')
return handleError(err, callback)
}
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, transformId, transform_id, ...querystring } = params
let { method, body, transformId, transform_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId)
@ -173,15 +173,15 @@ TransformApi.prototype.startTransform = function transformStartTransformApi (par
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['transform_id'] == null && params['transformId'] == null) {
if (params.transform_id == null && params.transformId == null) {
const err = new this[kConfigurationError]('Missing required parameter: transform_id or transformId')
return handleError(err, callback)
}
var { method, body, transformId, transform_id, ...querystring } = params
let { method, body, transformId, transform_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_start'
@ -200,15 +200,15 @@ TransformApi.prototype.stopTransform = function transformStopTransformApi (param
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['transform_id'] == null && params['transformId'] == null) {
if (params.transform_id == null && params.transformId == null) {
const err = new this[kConfigurationError]('Missing required parameter: transform_id or transformId')
return handleError(err, callback)
}
var { method, body, transformId, transform_id, ...querystring } = params
let { method, body, transformId, transform_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_stop'
@ -227,19 +227,19 @@ TransformApi.prototype.updateTransform = function transformUpdateTransformApi (p
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['transform_id'] == null && params['transformId'] == null) {
if (params.transform_id == null && params.transformId == null) {
const err = new this[kConfigurationError]('Missing required parameter: transform_id or transformId')
return handleError(err, callback)
}
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, transformId, transform_id, ...querystring } = params
let { method, body, transformId, transform_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_update'

View File

@ -23,30 +23,30 @@
/* eslint no-unused-vars: 0 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['wait_for_active_shards', '_source', '_source_excludes', '_source_includes', 'lang', 'refresh', 'retry_on_conflict', 'routing', 'timeout', 'if_seq_no', 'if_primary_term', 'require_alias', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { waitForActiveShards: 'wait_for_active_shards', _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', retryOnConflict: 'retry_on_conflict', ifSeqNo: 'if_seq_no', ifPrimaryTerm: 'if_primary_term', requireAlias: 'require_alias', errorTrace: 'error_trace', filterPath: 'filter_path' }
const acceptedQuerystring = ['wait_for_active_shards', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'lang', 'refresh', 'retry_on_conflict', 'routing', 'timeout', 'if_seq_no', 'if_primary_term', 'require_alias', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { waitForActiveShards: 'wait_for_active_shards', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', retryOnConflict: 'retry_on_conflict', ifSeqNo: 'if_seq_no', ifPrimaryTerm: 'if_primary_term', requireAlias: 'require_alias', errorTrace: 'error_trace', filterPath: 'filter_path' }
function updateApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params['body'] == null) {
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
var { method, body, id, index, type, ...querystring } = params
let { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_update'

View File

@ -23,28 +23,28 @@
/* eslint no-unused-vars: 0 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['analyzer', 'analyze_wildcard', 'default_operator', 'df', 'from', 'ignore_unavailable', 'allow_no_indices', 'conflicts', 'expand_wildcards', 'lenient', 'pipeline', 'preference', 'q', 'routing', 'scroll', 'search_type', 'search_timeout', 'size', 'max_docs', 'sort', '_source', '_source_excludes', '_source_includes', 'terminate_after', 'stats', 'version', 'version_type', 'request_cache', 'refresh', 'timeout', 'wait_for_active_shards', 'scroll_size', 'wait_for_completion', 'requests_per_second', 'slices', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', searchType: 'search_type', searchTimeout: 'search_timeout', maxDocs: 'max_docs', _sourceExcludes: '_source_excludes', _sourceIncludes: '_source_includes', terminateAfter: 'terminate_after', versionType: 'version_type', requestCache: 'request_cache', waitForActiveShards: 'wait_for_active_shards', scrollSize: 'scroll_size', waitForCompletion: 'wait_for_completion', requestsPerSecond: 'requests_per_second', errorTrace: 'error_trace', filterPath: 'filter_path' }
const acceptedQuerystring = ['analyzer', 'analyze_wildcard', 'default_operator', 'df', 'from', 'ignore_unavailable', 'allow_no_indices', 'conflicts', 'expand_wildcards', 'lenient', 'pipeline', 'preference', 'q', 'routing', 'scroll', 'search_type', 'search_timeout', 'size', 'max_docs', 'sort', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'terminate_after', 'stats', 'version', 'version_type', 'request_cache', 'refresh', 'timeout', 'wait_for_active_shards', 'scroll_size', 'wait_for_completion', 'requests_per_second', 'slices', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', searchType: 'search_type', searchTimeout: 'search_timeout', maxDocs: 'max_docs', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', terminateAfter: 'terminate_after', versionType: 'version_type', requestCache: 'request_cache', waitForActiveShards: 'wait_for_active_shards', scrollSize: 'scroll_size', waitForCompletion: 'wait_for_completion', requestsPerSecond: 'requests_per_second', errorTrace: 'error_trace', filterPath: 'filter_path' }
function updateByQueryApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['index'] == null) {
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
// check required url components
if (params['type'] != null && (params['index'] == null)) {
if (params.type != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
var { method, body, index, type, ...querystring } = params
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((index) != null && (type) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_update_by_query'

View File

@ -30,19 +30,19 @@ function updateByQueryRethrottleApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['task_id'] == null && params['taskId'] == null) {
if (params.task_id == null && params.taskId == null) {
const err = new this[kConfigurationError]('Missing required parameter: task_id or taskId')
return handleError(err, callback)
}
if (params['requests_per_second'] == null && params['requestsPerSecond'] == null) {
if (params.requests_per_second == null && params.requestsPerSecond == null) {
const err = new this[kConfigurationError]('Missing required parameter: requests_per_second or requestsPerSecond')
return handleError(err, callback)
}
var { method, body, taskId, task_id, ...querystring } = params
let { method, body, taskId, task_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_update_by_query' + '/' + encodeURIComponent(task_id || taskId) + '/' + '_rethrottle'

View File

@ -35,21 +35,21 @@ WatcherApi.prototype.ackWatch = function watcherAckWatchApi (params, options, ca
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['watch_id'] == null && params['watchId'] == null) {
if (params.watch_id == null && params.watchId == null) {
const err = new this[kConfigurationError]('Missing required parameter: watch_id or watchId')
return handleError(err, callback)
}
// check required url components
if ((params['action_id'] != null || params['actionId'] != null) && ((params['watch_id'] == null && params['watchId'] == null))) {
if ((params.action_id != null || params.actionId != null) && ((params.watch_id == null && params.watchId == null))) {
const err = new this[kConfigurationError]('Missing required parameter of the url: watch_id')
return handleError(err, callback)
}
var { method, body, watchId, watch_id, actionId, action_id, ...querystring } = params
let { method, body, watchId, watch_id, actionId, action_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((watch_id || watchId) != null && (action_id || actionId) != null) {
if (method == null) method = 'PUT'
path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(watch_id || watchId) + '/' + '_ack' + '/' + encodeURIComponent(action_id || actionId)
@ -73,15 +73,15 @@ WatcherApi.prototype.activateWatch = function watcherActivateWatchApi (params, o
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['watch_id'] == null && params['watchId'] == null) {
if (params.watch_id == null && params.watchId == null) {
const err = new this[kConfigurationError]('Missing required parameter: watch_id or watchId')
return handleError(err, callback)
}
var { method, body, watchId, watch_id, ...querystring } = params
let { method, body, watchId, watch_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(watch_id || watchId) + '/' + '_activate'
@ -100,15 +100,15 @@ WatcherApi.prototype.deactivateWatch = function watcherDeactivateWatchApi (param
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['watch_id'] == null && params['watchId'] == null) {
if (params.watch_id == null && params.watchId == null) {
const err = new this[kConfigurationError]('Missing required parameter: watch_id or watchId')
return handleError(err, callback)
}
var { method, body, watchId, watch_id, ...querystring } = params
let { method, body, watchId, watch_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(watch_id || watchId) + '/' + '_deactivate'
@ -127,15 +127,15 @@ WatcherApi.prototype.deleteWatch = function watcherDeleteWatchApi (params, optio
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(id)
@ -153,10 +153,10 @@ WatcherApi.prototype.deleteWatch = function watcherDeleteWatchApi (params, optio
WatcherApi.prototype.executeWatch = function watcherExecuteWatchApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((id) != null) {
if (method == null) method = 'PUT'
path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(id) + '/' + '_execute'
@ -180,15 +180,15 @@ WatcherApi.prototype.getWatch = function watcherGetWatchApi (params, options, ca
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(id)
@ -207,15 +207,15 @@ WatcherApi.prototype.putWatch = function watcherPutWatchApi (params, options, ca
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
var { method, body, id, ...querystring } = params
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_watcher' + '/' + 'watch' + '/' + encodeURIComponent(id)
@ -233,10 +233,10 @@ WatcherApi.prototype.putWatch = function watcherPutWatchApi (params, options, ca
WatcherApi.prototype.queryWatches = function watcherQueryWatchesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_watcher' + '/' + '_query' + '/' + 'watches'
@ -254,10 +254,10 @@ WatcherApi.prototype.queryWatches = function watcherQueryWatchesApi (params, opt
WatcherApi.prototype.start = function watcherStartApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_watcher' + '/' + '_start'
@ -275,10 +275,10 @@ WatcherApi.prototype.start = function watcherStartApi (params, options, callback
WatcherApi.prototype.stats = function watcherStatsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, metric, ...querystring } = params
let { method, body, metric, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if ((metric) != null) {
if (method == null) method = 'GET'
path = '/' + '_watcher' + '/' + 'stats' + '/' + encodeURIComponent(metric)
@ -301,10 +301,10 @@ WatcherApi.prototype.stats = function watcherStatsApi (params, options, callback
WatcherApi.prototype.stop = function watcherStopApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'POST'
path = '/' + '_watcher' + '/' + '_stop'

View File

@ -34,10 +34,10 @@ function XpackApi (transport, ConfigurationError) {
XpackApi.prototype.info = function xpackInfoApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_xpack'
@ -55,10 +55,10 @@ XpackApi.prototype.info = function xpackInfoApi (params, options, callback) {
XpackApi.prototype.usage = function xpackUsageApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
var { method, body, ...querystring } = params
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
if (method == null) method = 'GET'
path = '/' + '_xpack' + '/' + 'usage'

View File

@ -33,6 +33,7 @@ const deleteScriptApi = require('./api/delete_script')
const existsApi = require('./api/exists')
const existsSourceApi = require('./api/exists_source')
const explainApi = require('./api/explain')
const FeaturesApi = require('./api/features')
const fieldCapsApi = require('./api/field_caps')
const getApi = require('./api/get')
const getScriptApi = require('./api/get_script')
@ -94,6 +95,7 @@ const { kConfigurationError } = require('./utils')
const kCat = Symbol('Cat')
const kCluster = Symbol('Cluster')
const kDanglingIndices = Symbol('DanglingIndices')
const kFeatures = Symbol('Features')
const kIndices = Symbol('Indices')
const kIngest = Symbol('Ingest')
const kNodes = Symbol('Nodes')
@ -127,6 +129,7 @@ function ESAPI (opts) {
this[kCat] = null
this[kCluster] = null
this[kDanglingIndices] = null
this[kFeatures] = null
this[kIndices] = null
this[kIngest] = null
this[kNodes] = null
@ -228,6 +231,14 @@ Object.defineProperties(ESAPI.prototype, {
delete_by_query_rethrottle: { get () { return this.deleteByQueryRethrottle } },
delete_script: { get () { return this.deleteScript } },
exists_source: { get () { return this.existsSource } },
features: {
get () {
if (this[kFeatures] === null) {
this[kFeatures] = new FeaturesApi(this.transport, this[kConfigurationError])
}
return this[kFeatures]
}
},
field_caps: { get () { return this.fieldCaps } },
get_script: { get () { return this.getScript } },
get_script_context: { get () { return this.getScriptContext } },

4
api/kibana.d.ts vendored
View File

@ -176,6 +176,9 @@ interface KibanaClient {
exists<TResponse = boolean, TContext = Context>(params?: RequestParams.Exists, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
existsSource<TResponse = boolean, TContext = Context>(params?: RequestParams.ExistsSource, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
explain<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.Explain<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
features: {
getFeatures<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.FeaturesGetFeatures, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
}
fieldCaps<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.FieldCaps<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
get<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.Get, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
getScript<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.GetScript, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
@ -435,7 +438,6 @@ interface KibanaClient {
delete<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotDelete, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
deleteRepository<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotDeleteRepository, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
get<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotGet, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
getFeatures<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotGetFeatures, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
getRepository<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotGetRepository, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
restore<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotRestore<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
status<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotStatus, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>

View File

@ -45,6 +45,8 @@ export interface AsyncSearchStatus extends Generic {
export interface AsyncSearchSubmit<T = RequestBody> extends Generic {
index?: string | string[];
_source_exclude?: string | string[];
_source_include?: string | string[];
wait_for_completion_timeout?: string;
keep_on_completion?: boolean;
keep_alive?: string;
@ -108,6 +110,8 @@ export interface AutoscalingPutAutoscalingPolicy<T = RequestBody> extends Generi
export interface Bulk<T = RequestNDBody> extends Generic {
index?: string;
type?: string;
_source_exclude?: string | string[];
_source_include?: string | string[];
wait_for_active_shards?: string;
refresh?: 'wait_for' | boolean;
routing?: string;
@ -648,6 +652,8 @@ export interface Delete extends Generic {
export interface DeleteByQuery<T = RequestBody> extends Generic {
index: string | string[];
type?: string | string[];
_source_exclude?: string | string[];
_source_include?: string | string[];
analyzer?: string;
analyze_wildcard?: boolean;
default_operator?: 'AND' | 'OR';
@ -742,6 +748,8 @@ export interface Exists extends Generic {
id: string;
index: string;
type?: string;
_source_exclude?: string | string[];
_source_include?: string | string[];
stored_fields?: string | string[];
preference?: string;
realtime?: boolean;
@ -758,6 +766,8 @@ export interface ExistsSource extends Generic {
id: string;
index: string;
type?: string;
_source_exclude?: string | string[];
_source_include?: string | string[];
preference?: string;
realtime?: boolean;
refresh?: boolean;
@ -773,6 +783,8 @@ export interface Explain<T = RequestBody> extends Generic {
id: string;
index: string;
type?: string;
_source_exclude?: string | string[];
_source_include?: string | string[];
analyze_wildcard?: boolean;
analyzer?: string;
default_operator?: 'AND' | 'OR';
@ -788,6 +800,10 @@ export interface Explain<T = RequestBody> extends Generic {
body?: T;
}
export interface FeaturesGetFeatures extends Generic {
master_timeout?: string;
}
export interface FieldCaps<T = RequestBody> extends Generic {
index?: string | string[];
fields?: string | string[];
@ -802,6 +818,8 @@ export interface Get extends Generic {
id: string;
index: string;
type?: string;
_source_exclude?: string | string[];
_source_include?: string | string[];
stored_fields?: string | string[];
preference?: string;
realtime?: boolean;
@ -829,6 +847,8 @@ export interface GetSource extends Generic {
id: string;
index: string;
type?: string;
_source_exclude?: string | string[];
_source_include?: string | string[];
preference?: string;
realtime?: boolean;
refresh?: boolean;
@ -1451,6 +1471,8 @@ export interface LogstashPutPipeline<T = RequestBody> extends Generic {
export interface Mget<T = RequestBody> extends Generic {
index?: string;
type?: string;
_source_exclude?: string | string[];
_source_include?: string | string[];
stored_fields?: string | string[];
preference?: string;
realtime?: boolean;
@ -2074,6 +2096,8 @@ export interface Scroll<T = RequestBody> extends Generic {
export interface Search<T = RequestBody> extends Generic {
index?: string | string[];
type?: string | string[];
_source_exclude?: string | string[];
_source_include?: string | string[];
analyzer?: string;
analyze_wildcard?: boolean;
ccs_minimize_roundtrips?: boolean;
@ -2394,10 +2418,6 @@ export interface SnapshotGet extends Generic {
verbose?: boolean;
}
export interface SnapshotGetFeatures extends Generic {
master_timeout?: string;
}
export interface SnapshotGetRepository extends Generic {
repository?: string | string[];
master_timeout?: string;
@ -2555,6 +2575,8 @@ export interface Update<T = RequestBody> extends Generic {
id: string;
index: string;
type?: string;
_source_exclude?: string | string[];
_source_include?: string | string[];
wait_for_active_shards?: string;
_source?: string | string[];
_source_excludes?: string | string[];
@ -2573,6 +2595,8 @@ export interface Update<T = RequestBody> extends Generic {
export interface UpdateByQuery<T = RequestBody> extends Generic {
index: string | string[];
type?: string | string[];
_source_exclude?: string | string[];
_source_include?: string | string[];
analyzer?: string;
analyze_wildcard?: boolean;
default_operator?: 'AND' | 'OR';

View File

@ -31,10 +31,10 @@ function handleError (err, callback) {
}
function snakeCaseKeys (acceptedQuerystring, snakeCase, querystring) {
var target = {}
var keys = Object.keys(querystring)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
const target = {}
const keys = Object.keys(querystring)
for (let i = 0, len = keys.length; i < len; i++) {
const key = keys[i]
target[snakeCase[key] || key] = querystring[key]
}
return target

View File

@ -57,7 +57,7 @@ async function run () {
})
// stream async iteration, available in Node.js ≥ 10
var payload = ''
let payload = ''
body.setEncoding('utf8')
for await (const chunk of body) {
payload += chunk
@ -65,7 +65,7 @@ async function run () {
console.log(JSON.parse(payload))
// classic stream callback style
var payload = ''
let payload = ''
body.setEncoding('utf8')
body.on('data', chunk => { payload += chunk })
body.on('error', console.log)
@ -101,4 +101,4 @@ fastify.post('/search/:index', async (req, reply) => {
})
fastify.listen(3000)
----
----

View File

@ -124,7 +124,7 @@ const client = new Client({ node: 'http://localhost:9200' })
// Scroll utility
async function * scrollSearch (params) {
var response = await client.search(params)
let response = await client.search(params)
while (true) {
const sourceHits = response.body.hits.hits
@ -190,4 +190,4 @@ async function run () {
}
run().catch(console.log)
----
----

View File

@ -51,7 +51,7 @@ async function run () {
const data = body.rows.map(row => {
const obj = {}
for (var i = 0; i < row.length; i++) {
for (let i = 0; i < row.length; i++) {
obj[body.columns[i].name] = row[i]
}
return obj

View File

@ -24,7 +24,7 @@ To learn more about the supported major versions, please refer to the
[[nodejs-support]]
=== Node.js support
NOTE: The minimum supported version of Node.js is `v8`.
NOTE: The minimum supported version of Node.js is `v10`.
The client versioning follows the {stack} versioning, this means that
major, minor, and patch releases are done following a precise schedule that

View File

@ -3264,6 +3264,23 @@ _Default:_ `OR`
|===
[discrete]
=== features.getFeatures
[source,ts]
----
client.features.getFeatures({
master_timeout: string
})
----
link:{ref}/modules-snapshots.html[Documentation] +
[cols=2*]
|===
|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node
|===
[discrete]
=== fieldCaps
@ -9976,23 +9993,6 @@ link:{ref}/modules-snapshots.html[Documentation] +
|===
[discrete]
=== snapshot.getFeatures
[source,ts]
----
client.snapshot.getFeatures({
master_timeout: string
})
----
link:{ref}/modules-snapshots.html[Documentation] +
[cols=2*]
|===
|`master_timeout` or `masterTimeout`
|`string` - Explicit operation timeout for connection to master node
|===
[discrete]
=== snapshot.getRepository

18
index.d.ts vendored
View File

@ -720,6 +720,16 @@ declare class Client {
explain<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
explain<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.Explain<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
explain<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.Explain<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
features: {
get_features<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.FeaturesGetFeatures, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
get_features<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get_features<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.FeaturesGetFeatures, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get_features<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.FeaturesGetFeatures, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
getFeatures<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.FeaturesGetFeatures, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
getFeatures<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
getFeatures<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.FeaturesGetFeatures, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
getFeatures<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.FeaturesGetFeatures, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
}
field_caps<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.FieldCaps<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
field_caps<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
field_caps<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.FieldCaps<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
@ -2391,14 +2401,6 @@ declare class Client {
get<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SnapshotGet, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SnapshotGet, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get_features<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotGetFeatures, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
get_features<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get_features<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SnapshotGetFeatures, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get_features<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SnapshotGetFeatures, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
getFeatures<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotGetFeatures, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
getFeatures<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
getFeatures<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SnapshotGetFeatures, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
getFeatures<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SnapshotGetFeatures, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get_repository<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotGetRepository, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
get_repository<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get_repository<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SnapshotGetRepository, callback: callbackFn<TResponse, TContext>): TransportRequestCallback

View File

@ -27,8 +27,7 @@ const debug = require('debug')('elasticsearch')
const Transport = require('./lib/Transport')
const Connection = require('./lib/Connection')
const { ConnectionPool, CloudConnectionPool } = require('./lib/pool')
// Helpers works only in Node.js >= 10
const Helpers = nodeMajor < 10 ? /* istanbul ignore next */ null : require('./lib/Helpers')
const Helpers = require('./lib/Helpers')
const Serializer = require('./lib/Serializer')
const errors = require('./lib/errors')
const { ConfigurationError } = errors
@ -48,15 +47,6 @@ const kEventEmitter = Symbol('elasticsearchjs-event-emitter')
const ESAPI = require('./api')
/* istanbul ignore next */
if (nodeMajor < 10) {
process.emitWarning('You are using a version of Node.js that is currently in EOL. ' +
'The support for this version will be dropped in 7.12. ' +
'Please refer to https://ela.st/nodejs-support for additional information.',
'DeprecationWarning'
)
}
/* istanbul ignore next */
if (nodeMajor >= 10 && nodeMajor < 12) {
process.emitWarning('You are using a version of Node.js that will reach EOL in April 2021. ' +
@ -189,16 +179,13 @@ class Client extends ESAPI {
context: options.context
})
/* istanbul ignore else */
if (Helpers !== null) {
this.helpers = new Helpers({
client: this,
maxRetries: options.maxRetries,
metaHeader: options.enableMetaHeader
? `es=${clientVersion},js=${nodeVersion},t=${clientVersion},hc=${nodeVersion}`
: null
})
}
this.helpers = new Helpers({
client: this,
maxRetries: options.maxRetries,
metaHeader: options.enableMetaHeader
? `es=${clientVersion},js=${nodeVersion},t=${clientVersion},hc=${nodeVersion}`
: null
})
}
get emit () {
@ -223,7 +210,7 @@ class Client extends ESAPI {
opts = {}
}
var [namespace, method] = name.split('.')
let [namespace, method] = name.split('.')
if (method == null) {
method = namespace
namespace = null

View File

@ -213,8 +213,8 @@ class Connection {
}
const paramsKeys = Object.keys(params)
for (var i = 0, len = paramsKeys.length; i < len; i++) {
var key = paramsKeys[i]
for (let i = 0, len = paramsKeys.length; i < len; i++) {
const key = paramsKeys[i]
if (key === 'path') {
request.pathname = resolve(request.pathname, params[key])
} else if (key === 'querystring' && !!params[key] === true) {

View File

@ -27,8 +27,9 @@ const { SerializationError, DeserializationError } = require('./errors')
class Serializer {
serialize (object) {
debug('Serializing', object)
let json
try {
var json = JSON.stringify(object)
json = JSON.stringify(object)
} catch (err) {
throw new SerializationError(err.message, object)
}
@ -37,8 +38,9 @@ class Serializer {
deserialize (json) {
debug('Deserializing', json)
let object
try {
var object = sjson.parse(json)
object = sjson.parse(json)
} catch (err) {
throw new DeserializationError(err.message, json)
}
@ -50,8 +52,8 @@ class Serializer {
if (Array.isArray(array) === false) {
throw new SerializationError('The argument provided is not an array')
}
var ndjson = ''
for (var i = 0, len = array.length; i < len; i++) {
let ndjson = ''
for (let i = 0, len = array.length; i < len; i++) {
if (typeof array[i] === 'string') {
ndjson += array[i] + '\n'
} else {
@ -67,8 +69,8 @@ class Serializer {
if (typeof object === 'string') return object
// arrays should be serialized as comma separated list
const keys = Object.keys(object)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
for (let i = 0, len = keys.length; i < len; i++) {
const key = keys[i]
// elasticsearch will complain for keys without a value
if (object[key] === undefined) {
delete object[key]

1
lib/Transport.d.ts vendored
View File

@ -120,6 +120,7 @@ export interface TransportRequestCallback {
export interface TransportRequestPromise<T> extends Promise<T> {
abort: () => void;
finally(onFinally?: (() => void) | undefined | null): Promise<T>;
}
export interface TransportGetConnectionOptions {

View File

@ -91,7 +91,7 @@ class Transport {
callback = options
options = {}
}
var p = null
let p = null
// promises support
if (callback === undefined) {
@ -147,9 +147,10 @@ class Transport {
// the size of the stream, we risk to take too much memory.
// Furthermore, copying everytime the stream is very a expensive operation.
const maxRetries = isStream(params.body) || isStream(params.bulkBody)
? 0 : (typeof options.maxRetries === 'number' ? options.maxRetries : this.maxRetries)
? 0
: (typeof options.maxRetries === 'number' ? options.maxRetries : this.maxRetries)
const compression = options.compression !== undefined ? options.compression : this.compression
var request = { abort: noop }
let request = { abort: noop }
const transportReturn = {
then (onFulfilled, onRejected) {
return p.then(onFulfilled, onRejected)
@ -162,6 +163,9 @@ class Transport {
request.abort()
debug('Aborting request', params)
return this
},
finally (onFinally) {
return p.finally(onFinally)
}
}
@ -525,7 +529,7 @@ function defaultNodeFilter (node) {
}
function roundRobinSelector () {
var current = -1
let current = -1
return function _roundRobinSelector (connections) {
if (++current >= connections.length) {
current = 0
@ -540,8 +544,8 @@ function randomSelector (connections) {
}
function generateRequestId () {
var maxInt = 2147483647
var nextReqId = 0
const maxInt = 2147483647
let nextReqId = 0
return function genReqId (params, options) {
return (nextReqId = (nextReqId + 1) & maxInt)
}

View File

@ -128,7 +128,7 @@ class BaseConnectionPool {
*/
empty (callback) {
debug('Emptying the connection pool')
var openConnections = this.size
let openConnections = this.size
this.connections.forEach(connection => {
connection.close(() => {
if (--openConnections === 0) {
@ -201,7 +201,7 @@ class BaseConnectionPool {
const ids = Object.keys(nodes)
const hosts = []
for (var i = 0, len = ids.length; i < len; i++) {
for (let i = 0, len = ids.length; i < len; i++) {
const node = nodes[ids[i]]
// If there is no protocol in
// the `publish_address` new URL will throw
@ -210,7 +210,7 @@ class BaseConnectionPool {
// - hostname/ip:port
// if we encounter the second case, we should
// use the hostname instead of the ip
var address = node.http.publish_address
let address = node.http.publish_address
const parts = address.split('/')
// the url is in the form of hostname/ip:port
if (parts.length > 1) {

View File

@ -80,7 +80,7 @@ class ConnectionPool extends BaseConnectionPool {
// list a node that no longer exist. The following check verify
// that the connection is still part of the pool before
// marking it as dead.
for (var i = 0; i < this.size; i++) {
for (let i = 0; i < this.size; i++) {
if (this.connections[i].id === id) {
this.dead.push(id)
break
@ -138,7 +138,7 @@ class ConnectionPool extends BaseConnectionPool {
path: '/',
timeout: this.pingTimeout
}, (err, response) => {
var isAlive = true
let isAlive = true
const statusCode = response !== null ? response.statusCode : 0
if (err != null ||
(statusCode === 502 || statusCode === 503 || statusCode === 504)) {
@ -170,8 +170,7 @@ class ConnectionPool extends BaseConnectionPool {
isAlive: true,
connection
})
// eslint-disable-next-line standard/no-callback-literal
callback(true, connection)
callback(true, connection) // eslint-disable-line
}
}
@ -199,7 +198,7 @@ class ConnectionPool extends BaseConnectionPool {
// TODO: can we cache this?
const connections = []
for (var i = 0; i < this.size; i++) {
for (let i = 0; i < this.size; i++) {
const connection = this.connections[i]
if (noAliveConnections || connection.status === Connection.statuses.ALIVE) {
if (filter(connection) === true) {

View File

@ -25,7 +25,6 @@
],
"scripts": {
"test": "npm run lint && tap test/{unit,acceptance}/{*,**/*}.test.js && npm run test:types",
"test:node8": "npm run lint && tap test/{unit,acceptance}/*.test.js",
"test:unit": "tap test/unit/{*,**/*}.test.js",
"test:acceptance": "tap test/acceptance/*.test.js",
"test:integration": "node test/integration/index.js",
@ -49,37 +48,37 @@
},
"devDependencies": {
"@sinonjs/fake-timers": "github:sinonjs/fake-timers#0bfffc1",
"@types/node": "^12.6.2",
"@types/node": "^14.14.28",
"convert-hrtime": "^3.0.0",
"dedent": "^0.7.0",
"deepmerge": "^4.0.0",
"deepmerge": "^4.2.2",
"dezalgo": "^1.0.3",
"fast-deep-equal": "^3.1.1",
"into-stream": "^5.1.1",
"js-yaml": "^3.13.1",
"fast-deep-equal": "^3.1.3",
"into-stream": "^6.0.0",
"js-yaml": "^4.0.0",
"license-checker": "^25.0.1",
"minimist": "^1.2.0",
"ora": "^3.4.0",
"minimist": "^1.2.5",
"ora": "^5.3.0",
"pretty-hrtime": "^1.0.3",
"proxy": "^1.0.2",
"rimraf": "^2.6.3",
"semver": "^6.0.0",
"simple-git": "^1.110.0",
"simple-statistics": "^7.0.2",
"split2": "^3.1.1",
"standard": "^13.0.2",
"rimraf": "^3.0.2",
"semver": "^7.3.4",
"simple-git": "^2.35.0",
"simple-statistics": "^7.4.1",
"split2": "^3.2.2",
"standard": "^16.0.3",
"stoppable": "^1.1.0",
"tap": "^14.4.1",
"tsd": "^0.13.1",
"workq": "^2.1.0",
"xmlbuilder2": "^2.1.2"
"tap": "^14.11.0",
"tsd": "^0.14.0",
"workq": "^3.0.0",
"xmlbuilder2": "^2.4.0"
},
"dependencies": {
"debug": "^4.1.1",
"debug": "^4.3.1",
"hpagent": "^0.1.1",
"ms": "^2.1.1",
"ms": "^2.1.3",
"pump": "^3.0.0",
"secure-json-parse": "^2.1.0"
"secure-json-parse": "^2.3.1"
},
"license": "Apache-2.0",
"repository": {
@ -90,7 +89,7 @@
"url": "https://github.com/elastic/elasticsearch-js/issues"
},
"engines": {
"node": ">=8"
"node": ">=10"
},
"tsd": {
"directory": "test/types"
@ -103,4 +102,4 @@
"coverage": false,
"jobs-auto": true
}
}
}

View File

@ -42,8 +42,8 @@ function cloneAndCheckout (opts, callback) {
* @param {function} callback
*/
function withTag (tag, callback) {
var fresh = false
var retry = 0
let fresh = false
let retry = 0
if (!pathExist(esFolder)) {
if (!createFolder(esFolder)) {

View File

@ -208,7 +208,7 @@ function generateSingleApi (version, spec, common) {
// get the required parts from the url
// if the url has at least one static path,
// then there are not required parts of the url
var allParts = []
let allParts = []
for (const path of paths) {
if (path.parts) {
allParts.push(Object.keys(path.parts))
@ -252,10 +252,10 @@ function generateSingleApi (version, spec, common) {
${genUrlValidation(paths, api)}
var { ${genQueryBlacklist(false)}, ...querystring } = params
let { ${genQueryBlacklist(false)}, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
let path = ''
${buildPath(api)}
// build request object
@ -291,7 +291,7 @@ function generateSingleApi (version, spec, common) {
return code.join('\n ')
function _genRequiredCheck (param) {
var camelCased = param[0] === '_'
const camelCased = param[0] === '_'
? '_' + param.slice(1).replace(/_([a-z])/g, k => k[1].toUpperCase())
: param.replace(/_([a-z])/g, k => k[1].toUpperCase())
@ -388,7 +388,7 @@ function generateSingleApi (version, spec, common) {
return path.length > 0 ? ('\'/\' + ' + path) : '\'/\''
}
var hasStaticPath = false
let hasStaticPath = false
const sortedPaths = paths
// some legacy API have mutliple statis paths
// this filter removes them
@ -403,8 +403,8 @@ function generateSingleApi (version, spec, common) {
// sort by number of parameters (desc)
.sort((a, b) => Object.keys(b.parts || {}).length - Object.keys(a.parts || {}).length)
var code = ''
for (var i = 0; i < sortedPaths.length; i++) {
let code = ''
for (let i = 0; i < sortedPaths.length; i++) {
const { path, methods } = sortedPaths[i]
if (sortedPaths.length === 1) {
code += `if (method == null) method = ${generatePickMethod(methods)}
@ -492,13 +492,13 @@ function genUrlValidation (paths, api) {
.map(s => s.slice(1, -1))
.reverse()
var code = ''
let code = ''
const len = chunks.length
chunks.forEach((chunk, index) => {
if (index === len - 1) return
var params = []
var camelCased = chunk[0] === '_'
const params = []
let camelCased = chunk[0] === '_'
? '_' + chunk.slice(1).replace(/_([a-z])/g, k => k[1].toUpperCase())
: chunk.replace(/_([a-z])/g, k => k[1].toUpperCase())
@ -507,7 +507,7 @@ function genUrlValidation (paths, api) {
} else {
code += `${index ? '} else ' : ''}if ((params['${chunk}'] != null || params['${camelCased}'] != null) && (`
}
for (var i = index + 1; i < len; i++) {
for (let i = index + 1; i < len; i++) {
params.push(chunks[i])
// url parts can be declared in camelCase fashion
camelCased = chunks[i][0] === '_'
@ -543,7 +543,7 @@ function generateDocumentation ({ documentation }, op) {
if (documentation == null) return ''
var doc = '/**\n'
let doc = '/**\n'
doc += ` * Perform a ${op} request\n`
if (documentation.description) {
doc += ` * ${documentation.description.replace(/\u00A0/g, ' ')}\n`

View File

@ -28,7 +28,7 @@ const codeExamples = readdirSync(join(__dirname, '..', '..', 'docs', 'examples')
.filter(api => api !== 'index')
function generateDocs (common, spec) {
var doc = dedent`
let doc = dedent`
[[api-reference]]
////////
@ -110,7 +110,7 @@ function generateDocs (common, spec) {
}
function commonParameters (spec) {
var doc = dedent`
let doc = dedent`
[discrete]
=== Common parameters
Parameters that are accepted by all API endpoints.
@ -196,7 +196,7 @@ function generateApiDoc (spec) {
const codeParameters = params
.reduce((acc, val) => {
var code = `${val.name}: ${val.type},`
const code = `${val.name}: ${val.type},`
acc += acc === ''
? code
: '\n ' + code
@ -210,7 +210,7 @@ function generateApiDoc (spec) {
? ''
: `*Stability:* ${spec[name].stability}`
var doc = dedent`
let doc = dedent`
[discrete]
=== ${camelify(name)}
${stability}

View File

@ -235,44 +235,44 @@ function buildMethodDefinition (opts, api, name, hasBody, isHead) {
if (opts.kibana) {
if (hasBody) {
return [
{ key: `${camelify(api)}<TResponse = ${responseType}, TRequestBody extends ${bodyType} = ${defaultBodyType}, TContext = Context>(params?: RequestParams.${Name}<TRequestBody>, options?: TransportRequestOptions)`, val: `TransportRequestPromise<ApiResponse<TResponse, TContext>>` }
{ key: `${camelify(api)}<TResponse = ${responseType}, TRequestBody extends ${bodyType} = ${defaultBodyType}, TContext = Context>(params?: RequestParams.${Name}<TRequestBody>, options?: TransportRequestOptions)`, val: 'TransportRequestPromise<ApiResponse<TResponse, TContext>>' }
]
} else {
return [
{ key: `${camelify(api)}<TResponse = ${responseType}, TContext = Context>(params?: RequestParams.${Name}, options?: TransportRequestOptions)`, val: `TransportRequestPromise<ApiResponse<TResponse, TContext>>` }
{ key: `${camelify(api)}<TResponse = ${responseType}, TContext = Context>(params?: RequestParams.${Name}, options?: TransportRequestOptions)`, val: 'TransportRequestPromise<ApiResponse<TResponse, TContext>>' }
]
}
}
if (hasBody) {
let methods = [
{ key: `${api}<TResponse = ${responseType}, TRequestBody extends ${bodyType} = ${defaultBodyType}, TContext = Context>(params?: RequestParams.${Name}<TRequestBody>, options?: TransportRequestOptions)`, val: `TransportRequestPromise<ApiResponse<TResponse, TContext>>` },
{ key: `${api}<TResponse = ${responseType}, TRequestBody extends ${bodyType} = ${defaultBodyType}, TContext = Context>(callback: callbackFn<TResponse, TContext>)`, val: `TransportRequestCallback` },
{ key: `${api}<TResponse = ${responseType}, TRequestBody extends ${bodyType} = ${defaultBodyType}, TContext = Context>(params: RequestParams.${Name}<TRequestBody>, callback: callbackFn<TResponse, TContext>)`, val: `TransportRequestCallback` },
{ key: `${api}<TResponse = ${responseType}, TRequestBody extends ${bodyType} = ${defaultBodyType}, TContext = Context>(params: RequestParams.${Name}<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>)`, val: `TransportRequestCallback` }
{ key: `${api}<TResponse = ${responseType}, TRequestBody extends ${bodyType} = ${defaultBodyType}, TContext = Context>(params?: RequestParams.${Name}<TRequestBody>, options?: TransportRequestOptions)`, val: 'TransportRequestPromise<ApiResponse<TResponse, TContext>>' },
{ key: `${api}<TResponse = ${responseType}, TRequestBody extends ${bodyType} = ${defaultBodyType}, TContext = Context>(callback: callbackFn<TResponse, TContext>)`, val: 'TransportRequestCallback' },
{ key: `${api}<TResponse = ${responseType}, TRequestBody extends ${bodyType} = ${defaultBodyType}, TContext = Context>(params: RequestParams.${Name}<TRequestBody>, callback: callbackFn<TResponse, TContext>)`, val: 'TransportRequestCallback' },
{ key: `${api}<TResponse = ${responseType}, TRequestBody extends ${bodyType} = ${defaultBodyType}, TContext = Context>(params: RequestParams.${Name}<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>)`, val: 'TransportRequestCallback' }
]
if (isSnakeCased(api)) {
methods = methods.concat([
{ key: `${camelify(api)}<TResponse = ${responseType}, TRequestBody extends ${bodyType} = ${defaultBodyType}, TContext = Context>(params?: RequestParams.${Name}<TRequestBody>, options?: TransportRequestOptions)`, val: `TransportRequestPromise<ApiResponse<TResponse, TContext>>` },
{ key: `${camelify(api)}<TResponse = ${responseType}, TRequestBody extends ${bodyType} = ${defaultBodyType}, TContext = Context>(callback: callbackFn<TResponse, TContext>)`, val: `TransportRequestCallback` },
{ key: `${camelify(api)}<TResponse = ${responseType}, TRequestBody extends ${bodyType} = ${defaultBodyType}, TContext = Context>(params: RequestParams.${Name}<TRequestBody>, callback: callbackFn<TResponse, TContext>)`, val: `TransportRequestCallback` },
{ key: `${camelify(api)}<TResponse = ${responseType}, TRequestBody extends ${bodyType} = ${defaultBodyType}, TContext = Context>(params: RequestParams.${Name}<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>)`, val: `TransportRequestCallback` }
{ key: `${camelify(api)}<TResponse = ${responseType}, TRequestBody extends ${bodyType} = ${defaultBodyType}, TContext = Context>(params?: RequestParams.${Name}<TRequestBody>, options?: TransportRequestOptions)`, val: 'TransportRequestPromise<ApiResponse<TResponse, TContext>>' },
{ key: `${camelify(api)}<TResponse = ${responseType}, TRequestBody extends ${bodyType} = ${defaultBodyType}, TContext = Context>(callback: callbackFn<TResponse, TContext>)`, val: 'TransportRequestCallback' },
{ key: `${camelify(api)}<TResponse = ${responseType}, TRequestBody extends ${bodyType} = ${defaultBodyType}, TContext = Context>(params: RequestParams.${Name}<TRequestBody>, callback: callbackFn<TResponse, TContext>)`, val: 'TransportRequestCallback' },
{ key: `${camelify(api)}<TResponse = ${responseType}, TRequestBody extends ${bodyType} = ${defaultBodyType}, TContext = Context>(params: RequestParams.${Name}<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>)`, val: 'TransportRequestCallback' }
])
}
return methods
} else {
let methods = [
{ key: `${api}<TResponse = ${responseType}, TContext = Context>(params?: RequestParams.${Name}, options?: TransportRequestOptions)`, val: `TransportRequestPromise<ApiResponse<TResponse, TContext>>` },
{ key: `${api}<TResponse = ${responseType}, TContext = Context>(callback: callbackFn<TResponse, TContext>)`, val: `TransportRequestCallback` },
{ key: `${api}<TResponse = ${responseType}, TContext = Context>(params: RequestParams.${Name}, callback: callbackFn<TResponse, TContext>)`, val: `TransportRequestCallback` },
{ key: `${api}<TResponse = ${responseType}, TContext = Context>(params: RequestParams.${Name}, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>)`, val: `TransportRequestCallback` }
{ key: `${api}<TResponse = ${responseType}, TContext = Context>(params?: RequestParams.${Name}, options?: TransportRequestOptions)`, val: 'TransportRequestPromise<ApiResponse<TResponse, TContext>>' },
{ key: `${api}<TResponse = ${responseType}, TContext = Context>(callback: callbackFn<TResponse, TContext>)`, val: 'TransportRequestCallback' },
{ key: `${api}<TResponse = ${responseType}, TContext = Context>(params: RequestParams.${Name}, callback: callbackFn<TResponse, TContext>)`, val: 'TransportRequestCallback' },
{ key: `${api}<TResponse = ${responseType}, TContext = Context>(params: RequestParams.${Name}, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>)`, val: 'TransportRequestCallback' }
]
if (isSnakeCased(api)) {
methods = methods.concat([
{ key: `${camelify(api)}<TResponse = ${responseType}, TContext = Context>(params?: RequestParams.${Name}, options?: TransportRequestOptions)`, val: `TransportRequestPromise<ApiResponse<TResponse, TContext>>` },
{ key: `${camelify(api)}<TResponse = ${responseType}, TContext = Context>(callback: callbackFn<TResponse, TContext>)`, val: `TransportRequestCallback` },
{ key: `${camelify(api)}<TResponse = ${responseType}, TContext = Context>(params: RequestParams.${Name}, callback: callbackFn<TResponse, TContext>)`, val: `TransportRequestCallback` },
{ key: `${camelify(api)}<TResponse = ${responseType}, TContext = Context>(params: RequestParams.${Name}, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>)`, val: `TransportRequestCallback` }
{ key: `${camelify(api)}<TResponse = ${responseType}, TContext = Context>(params?: RequestParams.${Name}, options?: TransportRequestOptions)`, val: 'TransportRequestPromise<ApiResponse<TResponse, TContext>>' },
{ key: `${camelify(api)}<TResponse = ${responseType}, TContext = Context>(callback: callbackFn<TResponse, TContext>)`, val: 'TransportRequestCallback' },
{ key: `${camelify(api)}<TResponse = ${responseType}, TContext = Context>(params: RequestParams.${Name}, callback: callbackFn<TResponse, TContext>)`, val: 'TransportRequestCallback' },
{ key: `${camelify(api)}<TResponse = ${responseType}, TContext = Context>(params: RequestParams.${Name}, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>)`, val: 'TransportRequestCallback' }
])
}
return methods

View File

@ -33,7 +33,7 @@ const ndjsonApiKey = ndjsonApi
function generate (version, api) {
const release = semver.valid(version) ? semver.major(version) : version
var types = `/*
let types = `/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
@ -79,8 +79,8 @@ export interface Generic {
// get the required parts from the url
// if the url has at least one static path,
// then there are not required parts of the url
var allParts = []
var requiredParts = []
let allParts = []
let requiredParts = []
for (const path of paths) {
if (path.parts) {
allParts.push(Object.keys(path.parts))
@ -146,7 +146,7 @@ export interface ${toPascalCase(name)}${body ? `<T = ${bodyGeneric}>` : ''} exte
case 'time':
case 'timeout':
return 'string'
case 'enum':
case 'enum': {
// the following code changes 'true' | 'false' to boolean
let foundTrue = false
let foundFalse = false
@ -172,6 +172,7 @@ export interface ${toPascalCase(name)}${body ? `<T = ${bodyGeneric}>` : ''} exte
options.push('boolean')
}
return options.join(' | ')
}
case 'int':
case 'double':
case 'long':

View File

@ -16,7 +16,7 @@ test('Request id', t => {
const genReqId = generateRequestId()
t.type(genReqId, 'function')
for (var i = 1; i <= 10; i++) {
for (let i = 1; i <= 10; i++) {
t.strictEqual(genReqId(), i)
}

View File

@ -95,7 +95,7 @@ test('Resurrect a node and handle 502/3/4 status code', t => {
const clock = FakeTimers.install({ toFake: ['Date'] })
const q = workq()
var count = 0
let count = 0
function handler (req, res) {
res.statusCode = count++ < 2 ? 502 : 200
res.setHeader('content-type', 'application/json')
@ -114,7 +114,7 @@ test('Resurrect a node and handle 502/3/4 status code', t => {
maxRetries: 0
})
var idCount = 2
let idCount = 2
client.on(events.RESURRECT, (err, meta) => {
t.error(err)
t.strictEqual(meta.strategy, 'ping')

Some files were not shown because too many files have changed in this diff Show More