Patch deprecated parameters (#851)
* Updated code generation * API generation * API generation * Updated code generation
This commit is contained in:
committed by
delvedor
parent
b2fbcfd8e2
commit
0efa0df934
@ -52,7 +52,9 @@ function buildBulk (opts) {
|
|||||||
'fields',
|
'fields',
|
||||||
'_source',
|
'_source',
|
||||||
'_source_excludes',
|
'_source_excludes',
|
||||||
|
'_source_exclude',
|
||||||
'_source_includes',
|
'_source_includes',
|
||||||
|
'_source_include',
|
||||||
'pipeline',
|
'pipeline',
|
||||||
'pretty',
|
'pretty',
|
||||||
'human',
|
'human',
|
||||||
@ -64,7 +66,9 @@ function buildBulk (opts) {
|
|||||||
const snakeCase = {
|
const snakeCase = {
|
||||||
waitForActiveShards: 'wait_for_active_shards',
|
waitForActiveShards: 'wait_for_active_shards',
|
||||||
_sourceExcludes: '_source_excludes',
|
_sourceExcludes: '_source_excludes',
|
||||||
|
_sourceExclude: '_source_exclude',
|
||||||
_sourceIncludes: '_source_includes',
|
_sourceIncludes: '_source_includes',
|
||||||
|
_sourceInclude: '_source_include',
|
||||||
errorTrace: 'error_trace',
|
errorTrace: 'error_trace',
|
||||||
filterPath: 'filter_path'
|
filterPath: 'filter_path'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,7 +29,6 @@ function buildDeleteByQuery (opts) {
|
|||||||
* Perform a [delete_by_query](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html) request
|
* Perform a [delete_by_query](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
* @param {list} index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
||||||
* @param {list} type - A comma-separated list of document types to search; leave empty to perform the operation on all types
|
|
||||||
* @param {string} analyzer - The analyzer to use for the query string
|
* @param {string} analyzer - The analyzer to use for the query string
|
||||||
* @param {boolean} analyze_wildcard - Specify whether wildcard and prefix queries should be analyzed (default: false)
|
* @param {boolean} analyze_wildcard - Specify whether wildcard and prefix queries should be analyzed (default: false)
|
||||||
* @param {enum} default_operator - The default operator for query string query (AND or OR)
|
* @param {enum} default_operator - The default operator for query string query (AND or OR)
|
||||||
@ -86,7 +85,9 @@ function buildDeleteByQuery (opts) {
|
|||||||
'sort',
|
'sort',
|
||||||
'_source',
|
'_source',
|
||||||
'_source_excludes',
|
'_source_excludes',
|
||||||
|
'_source_exclude',
|
||||||
'_source_includes',
|
'_source_includes',
|
||||||
|
'_source_include',
|
||||||
'terminate_after',
|
'terminate_after',
|
||||||
'stats',
|
'stats',
|
||||||
'version',
|
'version',
|
||||||
@ -114,7 +115,9 @@ function buildDeleteByQuery (opts) {
|
|||||||
searchType: 'search_type',
|
searchType: 'search_type',
|
||||||
searchTimeout: 'search_timeout',
|
searchTimeout: 'search_timeout',
|
||||||
_sourceExcludes: '_source_excludes',
|
_sourceExcludes: '_source_excludes',
|
||||||
|
_sourceExclude: '_source_exclude',
|
||||||
_sourceIncludes: '_source_includes',
|
_sourceIncludes: '_source_includes',
|
||||||
|
_sourceInclude: '_source_include',
|
||||||
terminateAfter: 'terminate_after',
|
terminateAfter: 'terminate_after',
|
||||||
requestCache: 'request_cache',
|
requestCache: 'request_cache',
|
||||||
waitForActiveShards: 'wait_for_active_shards',
|
waitForActiveShards: 'wait_for_active_shards',
|
||||||
@ -147,12 +150,6 @@ function buildDeleteByQuery (opts) {
|
|||||||
return handleError(err, callback)
|
return handleError(err, callback)
|
||||||
}
|
}
|
||||||
|
|
||||||
// check required url components
|
|
||||||
if (params['type'] != null && (params['index'] == null)) {
|
|
||||||
const err = new ConfigurationError('Missing required parameter of the url: index')
|
|
||||||
return handleError(err, callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
// validate headers object
|
// validate headers object
|
||||||
if (options.headers != null && typeof options.headers !== 'object') {
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
@ -160,7 +157,7 @@ function buildDeleteByQuery (opts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var warnings = []
|
var warnings = []
|
||||||
var { method, body, index, type, ...querystring } = params
|
var { method, body, index, ...querystring } = params
|
||||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
if (method == null) {
|
if (method == null) {
|
||||||
@ -174,11 +171,7 @@ function buildDeleteByQuery (opts) {
|
|||||||
|
|
||||||
var path = ''
|
var path = ''
|
||||||
|
|
||||||
if ((index) != null && (type) != null) {
|
|
||||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_delete_by_query'
|
|
||||||
} else {
|
|
||||||
path = '/' + encodeURIComponent(index) + '/' + '_delete_by_query'
|
path = '/' + encodeURIComponent(index) + '/' + '_delete_by_query'
|
||||||
}
|
|
||||||
|
|
||||||
// build request object
|
// build request object
|
||||||
const request = {
|
const request = {
|
||||||
|
|||||||
@ -53,7 +53,9 @@ function buildExists (opts) {
|
|||||||
'routing',
|
'routing',
|
||||||
'_source',
|
'_source',
|
||||||
'_source_excludes',
|
'_source_excludes',
|
||||||
|
'_source_exclude',
|
||||||
'_source_includes',
|
'_source_includes',
|
||||||
|
'_source_include',
|
||||||
'version',
|
'version',
|
||||||
'version_type',
|
'version_type',
|
||||||
'pretty',
|
'pretty',
|
||||||
@ -66,7 +68,9 @@ function buildExists (opts) {
|
|||||||
const snakeCase = {
|
const snakeCase = {
|
||||||
storedFields: 'stored_fields',
|
storedFields: 'stored_fields',
|
||||||
_sourceExcludes: '_source_excludes',
|
_sourceExcludes: '_source_excludes',
|
||||||
|
_sourceExclude: '_source_exclude',
|
||||||
_sourceIncludes: '_source_includes',
|
_sourceIncludes: '_source_includes',
|
||||||
|
_sourceInclude: '_source_include',
|
||||||
versionType: 'version_type',
|
versionType: 'version_type',
|
||||||
errorTrace: 'error_trace',
|
errorTrace: 'error_trace',
|
||||||
filterPath: 'filter_path'
|
filterPath: 'filter_path'
|
||||||
|
|||||||
@ -51,7 +51,9 @@ function buildExistsSource (opts) {
|
|||||||
'routing',
|
'routing',
|
||||||
'_source',
|
'_source',
|
||||||
'_source_excludes',
|
'_source_excludes',
|
||||||
|
'_source_exclude',
|
||||||
'_source_includes',
|
'_source_includes',
|
||||||
|
'_source_include',
|
||||||
'version',
|
'version',
|
||||||
'version_type',
|
'version_type',
|
||||||
'pretty',
|
'pretty',
|
||||||
@ -63,7 +65,9 @@ function buildExistsSource (opts) {
|
|||||||
|
|
||||||
const snakeCase = {
|
const snakeCase = {
|
||||||
_sourceExcludes: '_source_excludes',
|
_sourceExcludes: '_source_excludes',
|
||||||
|
_sourceExclude: '_source_exclude',
|
||||||
_sourceIncludes: '_source_includes',
|
_sourceIncludes: '_source_includes',
|
||||||
|
_sourceInclude: '_source_include',
|
||||||
versionType: 'version_type',
|
versionType: 'version_type',
|
||||||
errorTrace: 'error_trace',
|
errorTrace: 'error_trace',
|
||||||
filterPath: 'filter_path'
|
filterPath: 'filter_path'
|
||||||
|
|||||||
@ -60,7 +60,9 @@ function buildExplain (opts) {
|
|||||||
'routing',
|
'routing',
|
||||||
'_source',
|
'_source',
|
||||||
'_source_excludes',
|
'_source_excludes',
|
||||||
|
'_source_exclude',
|
||||||
'_source_includes',
|
'_source_includes',
|
||||||
|
'_source_include',
|
||||||
'pretty',
|
'pretty',
|
||||||
'human',
|
'human',
|
||||||
'error_trace',
|
'error_trace',
|
||||||
@ -73,7 +75,9 @@ function buildExplain (opts) {
|
|||||||
defaultOperator: 'default_operator',
|
defaultOperator: 'default_operator',
|
||||||
storedFields: 'stored_fields',
|
storedFields: 'stored_fields',
|
||||||
_sourceExcludes: '_source_excludes',
|
_sourceExcludes: '_source_excludes',
|
||||||
|
_sourceExclude: '_source_exclude',
|
||||||
_sourceIncludes: '_source_includes',
|
_sourceIncludes: '_source_includes',
|
||||||
|
_sourceInclude: '_source_include',
|
||||||
errorTrace: 'error_trace',
|
errorTrace: 'error_trace',
|
||||||
filterPath: 'filter_path'
|
filterPath: 'filter_path'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,8 +55,12 @@ function buildGet (opts) {
|
|||||||
'routing',
|
'routing',
|
||||||
'_source',
|
'_source',
|
||||||
'_source_excludes',
|
'_source_excludes',
|
||||||
'_source_includes',
|
|
||||||
'_source_exclude',
|
'_source_exclude',
|
||||||
|
'_source_includes',
|
||||||
|
<<<<<<< HEAD
|
||||||
|
'_source_exclude',
|
||||||
|
=======
|
||||||
|
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||||
'_source_include',
|
'_source_include',
|
||||||
'version',
|
'version',
|
||||||
'version_type',
|
'version_type',
|
||||||
@ -70,8 +74,12 @@ function buildGet (opts) {
|
|||||||
const snakeCase = {
|
const snakeCase = {
|
||||||
storedFields: 'stored_fields',
|
storedFields: 'stored_fields',
|
||||||
_sourceExcludes: '_source_excludes',
|
_sourceExcludes: '_source_excludes',
|
||||||
_sourceIncludes: '_source_includes',
|
|
||||||
_sourceExclude: '_source_exclude',
|
_sourceExclude: '_source_exclude',
|
||||||
|
_sourceIncludes: '_source_includes',
|
||||||
|
<<<<<<< HEAD
|
||||||
|
_sourceExclude: '_source_exclude',
|
||||||
|
=======
|
||||||
|
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||||
_sourceInclude: '_source_include',
|
_sourceInclude: '_source_include',
|
||||||
versionType: 'version_type',
|
versionType: 'version_type',
|
||||||
errorTrace: 'error_trace',
|
errorTrace: 'error_trace',
|
||||||
|
|||||||
@ -51,7 +51,9 @@ function buildGetSource (opts) {
|
|||||||
'routing',
|
'routing',
|
||||||
'_source',
|
'_source',
|
||||||
'_source_excludes',
|
'_source_excludes',
|
||||||
|
'_source_exclude',
|
||||||
'_source_includes',
|
'_source_includes',
|
||||||
|
'_source_include',
|
||||||
'version',
|
'version',
|
||||||
'version_type',
|
'version_type',
|
||||||
'pretty',
|
'pretty',
|
||||||
@ -63,7 +65,9 @@ function buildGetSource (opts) {
|
|||||||
|
|
||||||
const snakeCase = {
|
const snakeCase = {
|
||||||
_sourceExcludes: '_source_excludes',
|
_sourceExcludes: '_source_excludes',
|
||||||
|
_sourceExclude: '_source_exclude',
|
||||||
_sourceIncludes: '_source_includes',
|
_sourceIncludes: '_source_includes',
|
||||||
|
_sourceInclude: '_source_include',
|
||||||
versionType: 'version_type',
|
versionType: 'version_type',
|
||||||
errorTrace: 'error_trace',
|
errorTrace: 'error_trace',
|
||||||
filterPath: 'filter_path'
|
filterPath: 'filter_path'
|
||||||
|
|||||||
@ -49,7 +49,9 @@ function buildMget (opts) {
|
|||||||
'routing',
|
'routing',
|
||||||
'_source',
|
'_source',
|
||||||
'_source_excludes',
|
'_source_excludes',
|
||||||
|
'_source_exclude',
|
||||||
'_source_includes',
|
'_source_includes',
|
||||||
|
'_source_include',
|
||||||
'pretty',
|
'pretty',
|
||||||
'human',
|
'human',
|
||||||
'error_trace',
|
'error_trace',
|
||||||
@ -60,7 +62,9 @@ function buildMget (opts) {
|
|||||||
const snakeCase = {
|
const snakeCase = {
|
||||||
storedFields: 'stored_fields',
|
storedFields: 'stored_fields',
|
||||||
_sourceExcludes: '_source_excludes',
|
_sourceExcludes: '_source_excludes',
|
||||||
|
_sourceExclude: '_source_exclude',
|
||||||
_sourceIncludes: '_source_includes',
|
_sourceIncludes: '_source_includes',
|
||||||
|
_sourceInclude: '_source_include',
|
||||||
errorTrace: 'error_trace',
|
errorTrace: 'error_trace',
|
||||||
filterPath: 'filter_path'
|
filterPath: 'filter_path'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,7 +29,6 @@ function buildMsearch (opts) {
|
|||||||
* Perform a [msearch](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html) request
|
* Perform a [msearch](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of index names to use as default
|
* @param {list} index - A comma-separated list of index names to use as default
|
||||||
* @param {list} type - A comma-separated list of document types to use as default
|
|
||||||
* @param {enum} search_type - Search operation type
|
* @param {enum} search_type - Search operation type
|
||||||
* @param {number} max_concurrent_searches - Controls the maximum number of concurrent searches the multi search api will execute
|
* @param {number} max_concurrent_searches - Controls the maximum number of concurrent searches the multi search api will execute
|
||||||
* @param {boolean} typed_keys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
|
* @param {boolean} typed_keys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
|
||||||
@ -82,12 +81,6 @@ function buildMsearch (opts) {
|
|||||||
return handleError(err, callback)
|
return handleError(err, callback)
|
||||||
}
|
}
|
||||||
|
|
||||||
// check required url components
|
|
||||||
if (params['type'] != null && (params['index'] == null)) {
|
|
||||||
const err = new ConfigurationError('Missing required parameter of the url: index')
|
|
||||||
return handleError(err, callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
// validate headers object
|
// validate headers object
|
||||||
if (options.headers != null && typeof options.headers !== 'object') {
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
@ -95,7 +88,7 @@ function buildMsearch (opts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var warnings = []
|
var warnings = []
|
||||||
var { method, body, index, type, ...querystring } = params
|
var { method, body, index, ...querystring } = params
|
||||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
if (method == null) {
|
if (method == null) {
|
||||||
@ -109,9 +102,7 @@ function buildMsearch (opts) {
|
|||||||
|
|
||||||
var path = ''
|
var path = ''
|
||||||
|
|
||||||
if ((index) != null && (type) != null) {
|
if ((index) != null) {
|
||||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_msearch'
|
|
||||||
} else if ((index) != null) {
|
|
||||||
path = '/' + encodeURIComponent(index) + '/' + '_msearch'
|
path = '/' + encodeURIComponent(index) + '/' + '_msearch'
|
||||||
} else {
|
} else {
|
||||||
path = '/' + '_msearch'
|
path = '/' + '_msearch'
|
||||||
|
|||||||
@ -29,7 +29,6 @@ function buildMsearchTemplate (opts) {
|
|||||||
* Perform a [msearch_template](http://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html) request
|
* Perform a [msearch_template](http://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of index names to use as default
|
* @param {list} index - A comma-separated list of index names to use as default
|
||||||
* @param {list} type - A comma-separated list of document types to use as default
|
|
||||||
* @param {enum} search_type - Search operation type
|
* @param {enum} search_type - Search operation type
|
||||||
* @param {boolean} typed_keys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
|
* @param {boolean} typed_keys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
|
||||||
* @param {number} max_concurrent_searches - Controls the maximum number of concurrent searches the multi search api will execute
|
* @param {number} max_concurrent_searches - Controls the maximum number of concurrent searches the multi search api will execute
|
||||||
@ -76,12 +75,6 @@ function buildMsearchTemplate (opts) {
|
|||||||
return handleError(err, callback)
|
return handleError(err, callback)
|
||||||
}
|
}
|
||||||
|
|
||||||
// check required url components
|
|
||||||
if (params['type'] != null && (params['index'] == null)) {
|
|
||||||
const err = new ConfigurationError('Missing required parameter of the url: index')
|
|
||||||
return handleError(err, callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
// validate headers object
|
// validate headers object
|
||||||
if (options.headers != null && typeof options.headers !== 'object') {
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
@ -89,7 +82,7 @@ function buildMsearchTemplate (opts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var warnings = []
|
var warnings = []
|
||||||
var { method, body, index, type, ...querystring } = params
|
var { method, body, index, ...querystring } = params
|
||||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
if (method == null) {
|
if (method == null) {
|
||||||
@ -103,9 +96,7 @@ function buildMsearchTemplate (opts) {
|
|||||||
|
|
||||||
var path = ''
|
var path = ''
|
||||||
|
|
||||||
if ((index) != null && (type) != null) {
|
if ((index) != null) {
|
||||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_msearch' + '/' + 'template'
|
|
||||||
} else if ((index) != null) {
|
|
||||||
path = '/' + encodeURIComponent(index) + '/' + '_msearch' + '/' + 'template'
|
path = '/' + encodeURIComponent(index) + '/' + '_msearch' + '/' + 'template'
|
||||||
} else {
|
} else {
|
||||||
path = '/' + '_msearch' + '/' + 'template'
|
path = '/' + '_msearch' + '/' + 'template'
|
||||||
|
|||||||
@ -29,7 +29,6 @@ function buildMtermvectors (opts) {
|
|||||||
* Perform a [mtermvectors](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html) request
|
* Perform a [mtermvectors](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html) request
|
||||||
*
|
*
|
||||||
* @param {string} index - The index in which the document resides.
|
* @param {string} index - The index in which the document resides.
|
||||||
* @param {string} type - The type of the document.
|
|
||||||
* @param {list} ids - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body
|
* @param {list} ids - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body
|
||||||
* @param {boolean} term_statistics - Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs".
|
* @param {boolean} term_statistics - Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs".
|
||||||
* @param {boolean} field_statistics - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs".
|
* @param {boolean} field_statistics - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs".
|
||||||
@ -87,12 +86,6 @@ function buildMtermvectors (opts) {
|
|||||||
options = {}
|
options = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
// check required url components
|
|
||||||
if (params['type'] != null && (params['index'] == null)) {
|
|
||||||
const err = new ConfigurationError('Missing required parameter of the url: index')
|
|
||||||
return handleError(err, callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
// validate headers object
|
// validate headers object
|
||||||
if (options.headers != null && typeof options.headers !== 'object') {
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
@ -100,7 +93,7 @@ function buildMtermvectors (opts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var warnings = []
|
var warnings = []
|
||||||
var { method, body, index, type, ...querystring } = params
|
var { method, body, index, ...querystring } = params
|
||||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
if (method == null) {
|
if (method == null) {
|
||||||
@ -114,9 +107,7 @@ function buildMtermvectors (opts) {
|
|||||||
|
|
||||||
var path = ''
|
var path = ''
|
||||||
|
|
||||||
if ((index) != null && (type) != null) {
|
if ((index) != null) {
|
||||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mtermvectors'
|
|
||||||
} else if ((index) != null) {
|
|
||||||
path = '/' + encodeURIComponent(index) + '/' + '_mtermvectors'
|
path = '/' + encodeURIComponent(index) + '/' + '_mtermvectors'
|
||||||
} else {
|
} else {
|
||||||
path = '/' + '_mtermvectors'
|
path = '/' + '_mtermvectors'
|
||||||
|
|||||||
@ -29,7 +29,6 @@ function buildSearch (opts) {
|
|||||||
* Perform a [search](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html) request
|
* Perform a [search](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
* @param {list} index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
||||||
* @param {list} type - A comma-separated list of document types to search; leave empty to perform the operation on all types
|
|
||||||
* @param {string} analyzer - The analyzer to use for the query string
|
* @param {string} analyzer - The analyzer to use for the query string
|
||||||
* @param {boolean} analyze_wildcard - Specify whether wildcard and prefix queries should be analyzed (default: false)
|
* @param {boolean} analyze_wildcard - Specify whether wildcard and prefix queries should be analyzed (default: false)
|
||||||
* @param {enum} default_operator - The default operator for query string query (AND or OR)
|
* @param {enum} default_operator - The default operator for query string query (AND or OR)
|
||||||
@ -97,7 +96,9 @@ function buildSearch (opts) {
|
|||||||
'sort',
|
'sort',
|
||||||
'_source',
|
'_source',
|
||||||
'_source_excludes',
|
'_source_excludes',
|
||||||
|
'_source_exclude',
|
||||||
'_source_includes',
|
'_source_includes',
|
||||||
|
'_source_include',
|
||||||
'terminate_after',
|
'terminate_after',
|
||||||
'stats',
|
'stats',
|
||||||
'suggest_field',
|
'suggest_field',
|
||||||
@ -134,7 +135,9 @@ function buildSearch (opts) {
|
|||||||
expandWildcards: 'expand_wildcards',
|
expandWildcards: 'expand_wildcards',
|
||||||
searchType: 'search_type',
|
searchType: 'search_type',
|
||||||
_sourceExcludes: '_source_excludes',
|
_sourceExcludes: '_source_excludes',
|
||||||
|
_sourceExclude: '_source_exclude',
|
||||||
_sourceIncludes: '_source_includes',
|
_sourceIncludes: '_source_includes',
|
||||||
|
_sourceInclude: '_source_include',
|
||||||
terminateAfter: 'terminate_after',
|
terminateAfter: 'terminate_after',
|
||||||
suggestField: 'suggest_field',
|
suggestField: 'suggest_field',
|
||||||
suggestMode: 'suggest_mode',
|
suggestMode: 'suggest_mode',
|
||||||
@ -166,12 +169,6 @@ function buildSearch (opts) {
|
|||||||
options = {}
|
options = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
// check required url components
|
|
||||||
if (params['type'] != null && (params['index'] == null)) {
|
|
||||||
const err = new ConfigurationError('Missing required parameter of the url: index')
|
|
||||||
return handleError(err, callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
// validate headers object
|
// validate headers object
|
||||||
if (options.headers != null && typeof options.headers !== 'object') {
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
@ -179,7 +176,7 @@ function buildSearch (opts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var warnings = []
|
var warnings = []
|
||||||
var { method, body, index, type, ...querystring } = params
|
var { method, body, index, ...querystring } = params
|
||||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
if (method == null) {
|
if (method == null) {
|
||||||
@ -193,9 +190,7 @@ function buildSearch (opts) {
|
|||||||
|
|
||||||
var path = ''
|
var path = ''
|
||||||
|
|
||||||
if ((index) != null && (type) != null) {
|
if ((index) != null) {
|
||||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_search'
|
|
||||||
} else if ((index) != null) {
|
|
||||||
path = '/' + encodeURIComponent(index) + '/' + '_search'
|
path = '/' + encodeURIComponent(index) + '/' + '_search'
|
||||||
} else {
|
} else {
|
||||||
path = '/' + '_search'
|
path = '/' + '_search'
|
||||||
|
|||||||
@ -29,7 +29,6 @@ function buildSearchTemplate (opts) {
|
|||||||
* Perform a [search_template](http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html) request
|
* Perform a [search_template](http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
* @param {list} index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
||||||
* @param {list} type - A comma-separated list of document types to search; leave empty to perform the operation on all types
|
|
||||||
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
||||||
* @param {boolean} ignore_throttled - Whether specified concrete, expanded or aliased indices should be ignored when throttled
|
* @param {boolean} ignore_throttled - Whether specified concrete, expanded or aliased indices should be ignored when throttled
|
||||||
* @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
* @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
||||||
@ -95,12 +94,6 @@ function buildSearchTemplate (opts) {
|
|||||||
return handleError(err, callback)
|
return handleError(err, callback)
|
||||||
}
|
}
|
||||||
|
|
||||||
// check required url components
|
|
||||||
if (params['type'] != null && (params['index'] == null)) {
|
|
||||||
const err = new ConfigurationError('Missing required parameter of the url: index')
|
|
||||||
return handleError(err, callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
// validate headers object
|
// validate headers object
|
||||||
if (options.headers != null && typeof options.headers !== 'object') {
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
@ -108,7 +101,7 @@ function buildSearchTemplate (opts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var warnings = []
|
var warnings = []
|
||||||
var { method, body, index, type, ...querystring } = params
|
var { method, body, index, ...querystring } = params
|
||||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
if (method == null) {
|
if (method == null) {
|
||||||
@ -122,9 +115,7 @@ function buildSearchTemplate (opts) {
|
|||||||
|
|
||||||
var path = ''
|
var path = ''
|
||||||
|
|
||||||
if ((index) != null && (type) != null) {
|
if ((index) != null) {
|
||||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_search' + '/' + 'template'
|
|
||||||
} else if ((index) != null) {
|
|
||||||
path = '/' + encodeURIComponent(index) + '/' + '_search' + '/' + 'template'
|
path = '/' + encodeURIComponent(index) + '/' + '_search' + '/' + 'template'
|
||||||
} else {
|
} else {
|
||||||
path = '/' + '_search' + '/' + 'template'
|
path = '/' + '_search' + '/' + 'template'
|
||||||
|
|||||||
@ -29,7 +29,6 @@ function buildTermvectors (opts) {
|
|||||||
* Perform a [termvectors](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html) request
|
* Perform a [termvectors](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html) request
|
||||||
*
|
*
|
||||||
* @param {string} index - The index in which the document resides.
|
* @param {string} index - The index in which the document resides.
|
||||||
* @param {string} type - The type of the document.
|
|
||||||
* @param {string} id - The id of the document, when not specified a doc param should be supplied.
|
* @param {string} id - The id of the document, when not specified a doc param should be supplied.
|
||||||
* @param {boolean} term_statistics - Specifies if total term frequency and document frequency should be returned.
|
* @param {boolean} term_statistics - Specifies if total term frequency and document frequency should be returned.
|
||||||
* @param {boolean} field_statistics - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned.
|
* @param {boolean} field_statistics - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned.
|
||||||
@ -103,7 +102,7 @@ function buildTermvectors (opts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var warnings = []
|
var warnings = []
|
||||||
var { method, body, index, type, id, ...querystring } = params
|
var { method, body, index, id, ...querystring } = params
|
||||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
if (method == null) {
|
if (method == null) {
|
||||||
@ -117,8 +116,13 @@ function buildTermvectors (opts) {
|
|||||||
|
|
||||||
var path = ''
|
var path = ''
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
if ((index) != null && (type) != null && (id) != null) {
|
if ((index) != null && (type) != null && (id) != null) {
|
||||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_termvectors'
|
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_termvectors'
|
||||||
|
=======
|
||||||
|
if ((index) != null && (id) != null) {
|
||||||
|
path = '/' + encodeURIComponent(index) + '/' + '_termvectors' + '/' + encodeURIComponent(id)
|
||||||
|
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||||
} else {
|
} else {
|
||||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_termvectors'
|
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_termvectors'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -54,7 +54,9 @@ function buildUpdate (opts) {
|
|||||||
'fields',
|
'fields',
|
||||||
'_source',
|
'_source',
|
||||||
'_source_excludes',
|
'_source_excludes',
|
||||||
|
'_source_exclude',
|
||||||
'_source_includes',
|
'_source_includes',
|
||||||
|
'_source_include',
|
||||||
'lang',
|
'lang',
|
||||||
'parent',
|
'parent',
|
||||||
'refresh',
|
'refresh',
|
||||||
@ -75,7 +77,9 @@ function buildUpdate (opts) {
|
|||||||
const snakeCase = {
|
const snakeCase = {
|
||||||
waitForActiveShards: 'wait_for_active_shards',
|
waitForActiveShards: 'wait_for_active_shards',
|
||||||
_sourceExcludes: '_source_excludes',
|
_sourceExcludes: '_source_excludes',
|
||||||
|
_sourceExclude: '_source_exclude',
|
||||||
_sourceIncludes: '_source_includes',
|
_sourceIncludes: '_source_includes',
|
||||||
|
_sourceInclude: '_source_include',
|
||||||
retryOnConflict: 'retry_on_conflict',
|
retryOnConflict: 'retry_on_conflict',
|
||||||
ifSeqNo: 'if_seq_no',
|
ifSeqNo: 'if_seq_no',
|
||||||
ifPrimaryTerm: 'if_primary_term',
|
ifPrimaryTerm: 'if_primary_term',
|
||||||
|
|||||||
@ -29,7 +29,6 @@ function buildUpdateByQuery (opts) {
|
|||||||
* Perform a [update_by_query](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html) request
|
* Perform a [update_by_query](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html) request
|
||||||
*
|
*
|
||||||
* @param {list} index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
* @param {list} index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
||||||
* @param {list} type - A comma-separated list of document types to search; leave empty to perform the operation on all types
|
|
||||||
* @param {string} analyzer - The analyzer to use for the query string
|
* @param {string} analyzer - The analyzer to use for the query string
|
||||||
* @param {boolean} analyze_wildcard - Specify whether wildcard and prefix queries should be analyzed (default: false)
|
* @param {boolean} analyze_wildcard - Specify whether wildcard and prefix queries should be analyzed (default: false)
|
||||||
* @param {enum} default_operator - The default operator for query string query (AND or OR)
|
* @param {enum} default_operator - The default operator for query string query (AND or OR)
|
||||||
@ -89,7 +88,9 @@ function buildUpdateByQuery (opts) {
|
|||||||
'sort',
|
'sort',
|
||||||
'_source',
|
'_source',
|
||||||
'_source_excludes',
|
'_source_excludes',
|
||||||
|
'_source_exclude',
|
||||||
'_source_includes',
|
'_source_includes',
|
||||||
|
'_source_include',
|
||||||
'terminate_after',
|
'terminate_after',
|
||||||
'stats',
|
'stats',
|
||||||
'version',
|
'version',
|
||||||
@ -118,7 +119,9 @@ function buildUpdateByQuery (opts) {
|
|||||||
searchType: 'search_type',
|
searchType: 'search_type',
|
||||||
searchTimeout: 'search_timeout',
|
searchTimeout: 'search_timeout',
|
||||||
_sourceExcludes: '_source_excludes',
|
_sourceExcludes: '_source_excludes',
|
||||||
|
_sourceExclude: '_source_exclude',
|
||||||
_sourceIncludes: '_source_includes',
|
_sourceIncludes: '_source_includes',
|
||||||
|
_sourceInclude: '_source_include',
|
||||||
terminateAfter: 'terminate_after',
|
terminateAfter: 'terminate_after',
|
||||||
versionType: 'version_type',
|
versionType: 'version_type',
|
||||||
requestCache: 'request_cache',
|
requestCache: 'request_cache',
|
||||||
@ -148,12 +151,6 @@ function buildUpdateByQuery (opts) {
|
|||||||
return handleError(err, callback)
|
return handleError(err, callback)
|
||||||
}
|
}
|
||||||
|
|
||||||
// check required url components
|
|
||||||
if (params['type'] != null && (params['index'] == null)) {
|
|
||||||
const err = new ConfigurationError('Missing required parameter of the url: index')
|
|
||||||
return handleError(err, callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
// validate headers object
|
// validate headers object
|
||||||
if (options.headers != null && typeof options.headers !== 'object') {
|
if (options.headers != null && typeof options.headers !== 'object') {
|
||||||
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
|
||||||
@ -161,7 +158,7 @@ function buildUpdateByQuery (opts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var warnings = []
|
var warnings = []
|
||||||
var { method, body, index, type, ...querystring } = params
|
var { method, body, index, ...querystring } = params
|
||||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)
|
||||||
|
|
||||||
if (method == null) {
|
if (method == null) {
|
||||||
@ -175,11 +172,7 @@ function buildUpdateByQuery (opts) {
|
|||||||
|
|
||||||
var path = ''
|
var path = ''
|
||||||
|
|
||||||
if ((index) != null && (type) != null) {
|
|
||||||
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_update_by_query'
|
|
||||||
} else {
|
|
||||||
path = '/' + encodeURIComponent(index) + '/' + '_update_by_query'
|
path = '/' + encodeURIComponent(index) + '/' + '_update_by_query'
|
||||||
}
|
|
||||||
|
|
||||||
// build request object
|
// build request object
|
||||||
const request = {
|
const request = {
|
||||||
|
|||||||
56
api/requestParams.d.ts
vendored
56
api/requestParams.d.ts
vendored
@ -30,6 +30,8 @@ export interface Generic {
|
|||||||
export interface Bulk<T = any> extends Generic {
|
export interface Bulk<T = any> extends Generic {
|
||||||
index?: string;
|
index?: string;
|
||||||
type?: string;
|
type?: string;
|
||||||
|
_source_exclude?: string | string[];
|
||||||
|
_source_include?: string | string[];
|
||||||
wait_for_active_shards?: string;
|
wait_for_active_shards?: string;
|
||||||
refresh?: 'true' | 'false' | 'wait_for';
|
refresh?: 'true' | 'false' | 'wait_for';
|
||||||
routing?: string;
|
routing?: string;
|
||||||
@ -386,7 +388,8 @@ export interface Delete extends Generic {
|
|||||||
|
|
||||||
export interface DeleteByQuery<T = any> extends Generic {
|
export interface DeleteByQuery<T = any> extends Generic {
|
||||||
index: string | string[];
|
index: string | string[];
|
||||||
type?: string | string[];
|
_source_exclude?: string | string[];
|
||||||
|
_source_include?: string | string[];
|
||||||
analyzer?: string;
|
analyzer?: string;
|
||||||
analyze_wildcard?: boolean;
|
analyze_wildcard?: boolean;
|
||||||
default_operator?: 'AND' | 'OR';
|
default_operator?: 'AND' | 'OR';
|
||||||
@ -436,7 +439,13 @@ export interface DeleteScript extends Generic {
|
|||||||
export interface Exists extends Generic {
|
export interface Exists extends Generic {
|
||||||
id: string;
|
id: string;
|
||||||
index: string;
|
index: string;
|
||||||
|
<<<<<<< HEAD
|
||||||
type: string;
|
type: string;
|
||||||
|
=======
|
||||||
|
type?: string;
|
||||||
|
_source_exclude?: string | string[];
|
||||||
|
_source_include?: string | string[];
|
||||||
|
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||||
stored_fields?: string | string[];
|
stored_fields?: string | string[];
|
||||||
parent?: string;
|
parent?: string;
|
||||||
preference?: string;
|
preference?: string;
|
||||||
@ -453,7 +462,13 @@ export interface Exists extends Generic {
|
|||||||
export interface ExistsSource extends Generic {
|
export interface ExistsSource extends Generic {
|
||||||
id: string;
|
id: string;
|
||||||
index: string;
|
index: string;
|
||||||
|
<<<<<<< HEAD
|
||||||
type: string;
|
type: string;
|
||||||
|
=======
|
||||||
|
type?: string;
|
||||||
|
_source_exclude?: string | string[];
|
||||||
|
_source_include?: string | string[];
|
||||||
|
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||||
parent?: string;
|
parent?: string;
|
||||||
preference?: string;
|
preference?: string;
|
||||||
realtime?: boolean;
|
realtime?: boolean;
|
||||||
@ -469,7 +484,13 @@ export interface ExistsSource extends Generic {
|
|||||||
export interface Explain<T = any> extends Generic {
|
export interface Explain<T = any> extends Generic {
|
||||||
id: string;
|
id: string;
|
||||||
index: string;
|
index: string;
|
||||||
|
<<<<<<< HEAD
|
||||||
type: string;
|
type: string;
|
||||||
|
=======
|
||||||
|
type?: string;
|
||||||
|
_source_exclude?: string | string[];
|
||||||
|
_source_include?: string | string[];
|
||||||
|
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||||
analyze_wildcard?: boolean;
|
analyze_wildcard?: boolean;
|
||||||
analyzer?: string;
|
analyzer?: string;
|
||||||
default_operator?: 'AND' | 'OR';
|
default_operator?: 'AND' | 'OR';
|
||||||
@ -498,7 +519,13 @@ export interface FieldCaps<T = any> extends Generic {
|
|||||||
export interface Get extends Generic {
|
export interface Get extends Generic {
|
||||||
id: string;
|
id: string;
|
||||||
index: string;
|
index: string;
|
||||||
|
<<<<<<< HEAD
|
||||||
type: string;
|
type: string;
|
||||||
|
=======
|
||||||
|
type?: string;
|
||||||
|
_source_exclude?: string | string[];
|
||||||
|
_source_include?: string | string[];
|
||||||
|
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||||
stored_fields?: string | string[];
|
stored_fields?: string | string[];
|
||||||
parent?: string;
|
parent?: string;
|
||||||
preference?: string;
|
preference?: string;
|
||||||
@ -522,7 +549,13 @@ export interface GetScript extends Generic {
|
|||||||
export interface GetSource extends Generic {
|
export interface GetSource extends Generic {
|
||||||
id: string;
|
id: string;
|
||||||
index: string;
|
index: string;
|
||||||
|
<<<<<<< HEAD
|
||||||
type: string;
|
type: string;
|
||||||
|
=======
|
||||||
|
type?: string;
|
||||||
|
_source_exclude?: string | string[];
|
||||||
|
_source_include?: string | string[];
|
||||||
|
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||||
parent?: string;
|
parent?: string;
|
||||||
preference?: string;
|
preference?: string;
|
||||||
realtime?: boolean;
|
realtime?: boolean;
|
||||||
@ -936,6 +969,8 @@ export interface IngestSimulate<T = any> extends Generic {
|
|||||||
export interface Mget<T = any> extends Generic {
|
export interface Mget<T = any> extends Generic {
|
||||||
index?: string;
|
index?: string;
|
||||||
type?: string;
|
type?: string;
|
||||||
|
_source_exclude?: string | string[];
|
||||||
|
_source_include?: string | string[];
|
||||||
stored_fields?: string | string[];
|
stored_fields?: string | string[];
|
||||||
preference?: string;
|
preference?: string;
|
||||||
realtime?: boolean;
|
realtime?: boolean;
|
||||||
@ -949,7 +984,6 @@ export interface Mget<T = any> extends Generic {
|
|||||||
|
|
||||||
export interface Msearch<T = any> extends Generic {
|
export interface Msearch<T = any> extends Generic {
|
||||||
index?: string | string[];
|
index?: string | string[];
|
||||||
type?: string | string[];
|
|
||||||
search_type?: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch';
|
search_type?: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch';
|
||||||
max_concurrent_searches?: number;
|
max_concurrent_searches?: number;
|
||||||
typed_keys?: boolean;
|
typed_keys?: boolean;
|
||||||
@ -961,7 +995,6 @@ export interface Msearch<T = any> extends Generic {
|
|||||||
|
|
||||||
export interface MsearchTemplate<T = any> extends Generic {
|
export interface MsearchTemplate<T = any> extends Generic {
|
||||||
index?: string | string[];
|
index?: string | string[];
|
||||||
type?: string | string[];
|
|
||||||
search_type?: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch';
|
search_type?: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch';
|
||||||
typed_keys?: boolean;
|
typed_keys?: boolean;
|
||||||
max_concurrent_searches?: number;
|
max_concurrent_searches?: number;
|
||||||
@ -971,7 +1004,6 @@ export interface MsearchTemplate<T = any> extends Generic {
|
|||||||
|
|
||||||
export interface Mtermvectors<T = any> extends Generic {
|
export interface Mtermvectors<T = any> extends Generic {
|
||||||
index?: string;
|
index?: string;
|
||||||
type?: string;
|
|
||||||
ids?: string | string[];
|
ids?: string | string[];
|
||||||
term_statistics?: boolean;
|
term_statistics?: boolean;
|
||||||
field_statistics?: boolean;
|
field_statistics?: boolean;
|
||||||
@ -1082,7 +1114,8 @@ export interface Scroll<T = any> extends Generic {
|
|||||||
|
|
||||||
export interface Search<T = any> extends Generic {
|
export interface Search<T = any> extends Generic {
|
||||||
index?: string | string[];
|
index?: string | string[];
|
||||||
type?: string | string[];
|
_source_exclude?: string | string[];
|
||||||
|
_source_include?: string | string[];
|
||||||
analyzer?: string;
|
analyzer?: string;
|
||||||
analyze_wildcard?: boolean;
|
analyze_wildcard?: boolean;
|
||||||
default_operator?: 'AND' | 'OR';
|
default_operator?: 'AND' | 'OR';
|
||||||
@ -1139,7 +1172,6 @@ export interface SearchShards extends Generic {
|
|||||||
|
|
||||||
export interface SearchTemplate<T = any> extends Generic {
|
export interface SearchTemplate<T = any> extends Generic {
|
||||||
index?: string | string[];
|
index?: string | string[];
|
||||||
type?: string | string[];
|
|
||||||
ignore_unavailable?: boolean;
|
ignore_unavailable?: boolean;
|
||||||
ignore_throttled?: boolean;
|
ignore_throttled?: boolean;
|
||||||
allow_no_indices?: boolean;
|
allow_no_indices?: boolean;
|
||||||
@ -1243,7 +1275,10 @@ export interface TasksList extends Generic {
|
|||||||
|
|
||||||
export interface Termvectors<T = any> extends Generic {
|
export interface Termvectors<T = any> extends Generic {
|
||||||
index: string;
|
index: string;
|
||||||
|
<<<<<<< HEAD
|
||||||
type: string;
|
type: string;
|
||||||
|
=======
|
||||||
|
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||||
id?: string;
|
id?: string;
|
||||||
term_statistics?: boolean;
|
term_statistics?: boolean;
|
||||||
field_statistics?: boolean;
|
field_statistics?: boolean;
|
||||||
@ -1263,7 +1298,13 @@ export interface Termvectors<T = any> extends Generic {
|
|||||||
export interface Update<T = any> extends Generic {
|
export interface Update<T = any> extends Generic {
|
||||||
id: string;
|
id: string;
|
||||||
index: string;
|
index: string;
|
||||||
|
<<<<<<< HEAD
|
||||||
type: string;
|
type: string;
|
||||||
|
=======
|
||||||
|
type?: string;
|
||||||
|
_source_exclude?: string | string[];
|
||||||
|
_source_include?: string | string[];
|
||||||
|
>>>>>>> 844206e... Patch deprecated parameters (#851)
|
||||||
wait_for_active_shards?: string;
|
wait_for_active_shards?: string;
|
||||||
fields?: string | string[];
|
fields?: string | string[];
|
||||||
_source?: string | string[];
|
_source?: string | string[];
|
||||||
@ -1284,7 +1325,8 @@ export interface Update<T = any> extends Generic {
|
|||||||
|
|
||||||
export interface UpdateByQuery<T = any> extends Generic {
|
export interface UpdateByQuery<T = any> extends Generic {
|
||||||
index: string | string[];
|
index: string | string[];
|
||||||
type?: string | string[];
|
_source_exclude?: string | string[];
|
||||||
|
_source_include?: string | string[];
|
||||||
analyzer?: string;
|
analyzer?: string;
|
||||||
analyze_wildcard?: boolean;
|
analyze_wildcard?: boolean;
|
||||||
default_operator?: 'AND' | 'OR';
|
default_operator?: 'AND' | 'OR';
|
||||||
|
|||||||
@ -1156,9 +1156,6 @@ link:{ref}/docs-delete-by-query.html[Reference]
|
|||||||
|`index`
|
|`index`
|
||||||
|`string, string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
|`string, string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
||||||
|
|
||||||
|`type`
|
|
||||||
|`string, string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types
|
|
||||||
|
|
||||||
|`analyzer`
|
|`analyzer`
|
||||||
|`string` - The analyzer to use for the query string
|
|`string` - The analyzer to use for the query string
|
||||||
|
|
||||||
@ -2936,9 +2933,6 @@ link:{ref}/search-multi-search.html[Reference]
|
|||||||
|`index`
|
|`index`
|
||||||
|`string, string[]` - A comma-separated list of index names to use as default
|
|`string, string[]` - A comma-separated list of index names to use as default
|
||||||
|
|
||||||
|`type`
|
|
||||||
|`string, string[]` - A comma-separated list of document types to use as default
|
|
||||||
|
|
||||||
|`search_type` or `searchType`
|
|`search_type` or `searchType`
|
||||||
|`'query_then_fetch', 'query_and_fetch', 'dfs_query_then_fetch', 'dfs_query_and_fetch'` - Search operation type
|
|`'query_then_fetch', 'query_and_fetch', 'dfs_query_then_fetch', 'dfs_query_and_fetch'` - Search operation type
|
||||||
|
|
||||||
@ -2975,9 +2969,6 @@ link:{ref}/search-multi-search.html[Reference]
|
|||||||
|`index`
|
|`index`
|
||||||
|`string, string[]` - A comma-separated list of index names to use as default
|
|`string, string[]` - A comma-separated list of index names to use as default
|
||||||
|
|
||||||
|`type`
|
|
||||||
|`string, string[]` - A comma-separated list of document types to use as default
|
|
||||||
|
|
||||||
|`search_type` or `searchType`
|
|`search_type` or `searchType`
|
||||||
|`'query_then_fetch', 'query_and_fetch', 'dfs_query_then_fetch', 'dfs_query_and_fetch'` - Search operation type
|
|`'query_then_fetch', 'query_and_fetch', 'dfs_query_then_fetch', 'dfs_query_and_fetch'` - Search operation type
|
||||||
|
|
||||||
@ -3006,9 +2997,6 @@ link:{ref}/docs-multi-termvectors.html[Reference]
|
|||||||
|`index`
|
|`index`
|
||||||
|`string` - The index in which the document resides.
|
|`string` - The index in which the document resides.
|
||||||
|
|
||||||
|`type`
|
|
||||||
|`string` - The type of the document.
|
|
||||||
|
|
||||||
|`ids`
|
|`ids`
|
||||||
|`string, string[]` - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body
|
|`string, string[]` - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body
|
||||||
|
|
||||||
@ -3366,9 +3354,6 @@ link:{ref}/search-search.html[Reference]
|
|||||||
|`index`
|
|`index`
|
||||||
|`string, string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
|`string, string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
||||||
|
|
||||||
|`type`
|
|
||||||
|`string, string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types
|
|
||||||
|
|
||||||
|`analyzer`
|
|`analyzer`
|
||||||
|`string` - The analyzer to use for the query string
|
|`string` - The analyzer to use for the query string
|
||||||
|
|
||||||
@ -3547,9 +3532,6 @@ link:{ref}/search-template.html[Reference]
|
|||||||
|`index`
|
|`index`
|
||||||
|`string, string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
|`string, string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
||||||
|
|
||||||
|`type`
|
|
||||||
|`string, string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types
|
|
||||||
|
|
||||||
|`ignore_unavailable` or `ignoreUnavailable`
|
|`ignore_unavailable` or `ignoreUnavailable`
|
||||||
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
|`boolean` - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
||||||
|
|
||||||
@ -3874,9 +3856,6 @@ link:{ref}/docs-termvectors.html[Reference]
|
|||||||
|`index`
|
|`index`
|
||||||
|`string` - The index in which the document resides.
|
|`string` - The index in which the document resides.
|
||||||
|
|
||||||
|`type`
|
|
||||||
|`string` - The type of the document.
|
|
||||||
|
|
||||||
|`id`
|
|`id`
|
||||||
|`string` - The id of the document, when not specified a doc param should be supplied.
|
|`string` - The id of the document, when not specified a doc param should be supplied.
|
||||||
|
|
||||||
@ -4003,9 +3982,6 @@ link:{ref}/docs-update-by-query.html[Reference]
|
|||||||
|`index`
|
|`index`
|
||||||
|`string, string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
|`string, string[]` - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
||||||
|
|
||||||
|`type`
|
|
||||||
|`string, string[]` - A comma-separated list of document types to search; leave empty to perform the operation on all types
|
|
||||||
|
|
||||||
|`analyzer`
|
|`analyzer`
|
||||||
|`string` - The analyzer to use for the query string
|
|`string` - The analyzer to use for the query string
|
||||||
|
|
||||||
|
|||||||
@ -69,7 +69,7 @@ function start (opts) {
|
|||||||
|
|
||||||
writeFileSync(
|
writeFileSync(
|
||||||
requestParamsOutputFile,
|
requestParamsOutputFile,
|
||||||
generateRequestTypes(allSpec),
|
generateRequestTypes(opts.branch || opts.tag, allSpec),
|
||||||
{ encoding: 'utf8' }
|
{ encoding: 'utf8' }
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ function start (opts) {
|
|||||||
|
|
||||||
const spec = require(join(apiFolder, file))
|
const spec = require(join(apiFolder, file))
|
||||||
allSpec.push(spec)
|
allSpec.push(spec)
|
||||||
const code = generate(spec, common)
|
const code = generate(opts.branch || opts.tag, spec, common)
|
||||||
const filePath = join(apiOutputFolder, `${file.slice(0, file.lastIndexOf('.'))}.js`)
|
const filePath = join(apiOutputFolder, `${file.slice(0, file.lastIndexOf('.'))}.js`)
|
||||||
|
|
||||||
writeFileSync(filePath, code, { encoding: 'utf8' })
|
writeFileSync(filePath, code, { encoding: 'utf8' })
|
||||||
|
|||||||
@ -20,11 +20,16 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
const dedent = require('dedent')
|
const dedent = require('dedent')
|
||||||
|
const semver = require('semver')
|
||||||
const allowedMethods = {
|
const allowedMethods = {
|
||||||
noBody: ['GET', 'HEAD', 'DELETE'],
|
noBody: ['GET', 'HEAD', 'DELETE'],
|
||||||
body: ['POST', 'PUT', 'DELETE']
|
body: ['POST', 'PUT', 'DELETE']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if a parameter is depracted in a minor release
|
||||||
|
// we should be able to support it until the next major
|
||||||
|
const deprecatedParameters = require('./patch.json')
|
||||||
|
|
||||||
// list of apis that does not need any kind of validation
|
// list of apis that does not need any kind of validation
|
||||||
// because of how the url is built or the `type` handling in ES7
|
// because of how the url is built or the `type` handling in ES7
|
||||||
const noPathValidation = [
|
const noPathValidation = [
|
||||||
@ -59,7 +64,8 @@ const ndjsonApi = [
|
|||||||
'xpack.monitoring.bulk'
|
'xpack.monitoring.bulk'
|
||||||
]
|
]
|
||||||
|
|
||||||
function generate (spec, common) {
|
function generate (version, spec, common) {
|
||||||
|
const release = semver.valid(version) ? semver.major(version) : version
|
||||||
const api = Object.keys(spec)[0]
|
const api = Object.keys(spec)[0]
|
||||||
const name = api
|
const name = api
|
||||||
.replace(/\.([a-z])/g, k => k[1].toUpperCase())
|
.replace(/\.([a-z])/g, k => k[1].toUpperCase())
|
||||||
@ -80,7 +86,11 @@ function generate (spec, common) {
|
|||||||
if (params[key].required) {
|
if (params[key].required) {
|
||||||
required.push(key)
|
required.push(key)
|
||||||
}
|
}
|
||||||
|
|
||||||
acceptedQuerystring.push(key)
|
acceptedQuerystring.push(key)
|
||||||
|
if (deprecatedParameters[release] && deprecatedParameters[release][key]) {
|
||||||
|
acceptedQuerystring.push(deprecatedParameters[release][key])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const key in spec[api]) {
|
for (const key in spec[api]) {
|
||||||
|
|||||||
@ -19,7 +19,11 @@
|
|||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
function generate (api) {
|
const semver = require('semver')
|
||||||
|
const deprecatedParameters = require('./patch.json')
|
||||||
|
|
||||||
|
function generate (version, api) {
|
||||||
|
const release = semver.valid(version) ? semver.major(version) : version
|
||||||
var types = `/*
|
var types = `/*
|
||||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||||
* license agreements. See the NOTICE file distributed with
|
* license agreements. See the NOTICE file distributed with
|
||||||
@ -64,9 +68,20 @@ export interface Generic {
|
|||||||
|
|
||||||
const partsArr = Object.keys(parts)
|
const partsArr = Object.keys(parts)
|
||||||
.map(k => ({ key: k, value: parts[k] }))
|
.map(k => ({ key: k, value: parts[k] }))
|
||||||
|
const deprecatedParametersToAdd = []
|
||||||
const paramsArr = Object.keys(params)
|
const paramsArr = Object.keys(params)
|
||||||
.filter(k => !Object.keys(parts).includes(k))
|
.filter(k => !Object.keys(parts).includes(k))
|
||||||
.map(k => ({ key: k, value: params[k] }))
|
.map(k => {
|
||||||
|
if (deprecatedParameters[release] && deprecatedParameters[release][k]) {
|
||||||
|
deprecatedParametersToAdd.push({
|
||||||
|
key: deprecatedParameters[release][k],
|
||||||
|
value: params[k]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return { key: k, value: params[k] }
|
||||||
|
})
|
||||||
|
|
||||||
|
deprecatedParametersToAdd.forEach(k => partsArr.push(k))
|
||||||
|
|
||||||
const genLine = e => {
|
const genLine = e => {
|
||||||
const optional = e.value.required ? '' : '?'
|
const optional = e.value.required ? '' : '?'
|
||||||
|
|||||||
14
scripts/utils/patch.json
Normal file
14
scripts/utils/patch.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"6": {
|
||||||
|
"_source_includes": "_source_include",
|
||||||
|
"_source_excludes": "_source_exclude"
|
||||||
|
},
|
||||||
|
"7": {
|
||||||
|
"_source_includes": "_source_include",
|
||||||
|
"_source_excludes": "_source_exclude"
|
||||||
|
},
|
||||||
|
"master": {
|
||||||
|
"_source_includes": "_source_include",
|
||||||
|
"_source_excludes": "_source_exclude"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user