@elastic/elasticsearch
Advanced tools
Comparing version 7.10.0 to 7.11.0-rc.1
@@ -26,4 +26,4 @@ /* | ||
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_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' } | ||
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' } | ||
@@ -89,2 +89,29 @@ function AsyncSearchApi (transport, ConfigurationError) { | ||
AsyncSearchApi.prototype.status = function asyncSearchStatusApi (params, options, callback) { | ||
;[params, options, callback] = normalizeArguments(params, options, callback) | ||
// check required parameters | ||
if (params['id'] == null) { | ||
const err = new this[kConfigurationError]('Missing required parameter: id') | ||
return handleError(err, callback) | ||
} | ||
var { method, body, id, ...querystring } = params | ||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) | ||
var path = '' | ||
if (method == null) method = 'GET' | ||
path = '/' + '_async_search' + '/' + 'status' + '/' + encodeURIComponent(id) | ||
// build request object | ||
const request = { | ||
method, | ||
path, | ||
body: null, | ||
querystring | ||
} | ||
return this.transport.request(request, options, callback) | ||
} | ||
AsyncSearchApi.prototype.submit = function asyncSearchSubmitApi (params, options, callback) { | ||
@@ -91,0 +118,0 @@ ;[params, options, callback] = normalizeArguments(params, options, callback) |
@@ -61,3 +61,3 @@ /* | ||
AutoscalingApi.prototype.getAutoscalingDecision = function autoscalingGetAutoscalingDecisionApi (params, options, callback) { | ||
AutoscalingApi.prototype.getAutoscalingCapacity = function autoscalingGetAutoscalingCapacityApi (params, options, callback) { | ||
;[params, options, callback] = normalizeArguments(params, options, callback) | ||
@@ -70,3 +70,3 @@ | ||
if (method == null) method = 'GET' | ||
path = '/' + '_autoscaling' + '/' + 'decision' | ||
path = '/' + '_autoscaling' + '/' + 'capacity' | ||
@@ -144,3 +144,3 @@ // build request object | ||
delete_autoscaling_policy: { get () { return this.deleteAutoscalingPolicy } }, | ||
get_autoscaling_decision: { get () { return this.getAutoscalingDecision } }, | ||
get_autoscaling_capacity: { get () { return this.getAutoscalingCapacity } }, | ||
get_autoscaling_policy: { get () { return this.getAutoscalingPolicy } }, | ||
@@ -147,0 +147,0 @@ put_autoscaling_policy: { get () { return this.putAutoscalingPolicy } } |
@@ -26,4 +26,4 @@ /* | ||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') | ||
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' } | ||
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' } | ||
@@ -30,0 +30,0 @@ function bulkApi (params, options, callback) { |
@@ -26,4 +26,4 @@ /* | ||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') | ||
const acceptedQuerystring = ['format', 'local', 'h', 'help', 's', 'v', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'bytes', 'master_timeout', 'fields', 'time', 'ts', 'health', 'pri', 'include_unloaded_segments', 'full_id', 'active_only', 'detailed', 'index', 'ignore_unavailable', 'node_id', 'actions', 'parent_task', 'size', 'allow_no_match', 'allow_no_datafeeds', 'allow_no_jobs', 'from'] | ||
const snakeCase = { expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', masterTimeout: 'master_timeout', includeUnloadedSegments: 'include_unloaded_segments', fullId: 'full_id', activeOnly: 'active_only', ignoreUnavailable: 'ignore_unavailable', nodeId: 'node_id', parentTask: 'parent_task', allowNoMatch: 'allow_no_match', allowNoDatafeeds: 'allow_no_datafeeds', allowNoJobs: 'allow_no_jobs' } | ||
const acceptedQuerystring = ['format', 'local', 'h', 'help', 's', 'v', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'bytes', 'master_timeout', 'fields', 'time', 'ts', 'health', 'pri', 'include_unloaded_segments', 'full_id', 'active_only', 'detailed', 'index', 'ignore_unavailable', 'nodes', 'actions', 'parent_task_id', 'size', 'allow_no_match', 'allow_no_datafeeds', 'allow_no_jobs', 'from'] | ||
const snakeCase = { expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', masterTimeout: 'master_timeout', includeUnloadedSegments: 'include_unloaded_segments', fullId: 'full_id', activeOnly: 'active_only', ignoreUnavailable: 'ignore_unavailable', parentTaskId: 'parent_task_id', allowNoMatch: 'allow_no_match', allowNoDatafeeds: 'allow_no_datafeeds', allowNoJobs: 'allow_no_jobs' } | ||
@@ -30,0 +30,0 @@ function CatApi (transport, ConfigurationError) { |
@@ -26,4 +26,4 @@ /* | ||
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_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' } | ||
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' } | ||
@@ -30,0 +30,0 @@ function deleteByQueryApi (params, options, callback) { |
@@ -26,4 +26,4 @@ /* | ||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') | ||
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' } | ||
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' } | ||
@@ -30,0 +30,0 @@ function existsSourceApi (params, options, callback) { |
@@ -26,4 +26,4 @@ /* | ||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') | ||
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' } | ||
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' } | ||
@@ -30,0 +30,0 @@ function existsApi (params, options, callback) { |
@@ -26,4 +26,4 @@ /* | ||
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_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' } | ||
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' } | ||
@@ -30,0 +30,0 @@ function explainApi (params, options, callback) { |
@@ -26,4 +26,4 @@ /* | ||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') | ||
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' } | ||
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' } | ||
@@ -30,0 +30,0 @@ function getSourceApi (params, options, callback) { |
@@ -26,4 +26,4 @@ /* | ||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') | ||
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' } | ||
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' } | ||
@@ -30,0 +30,0 @@ function getApi (params, options, callback) { |
@@ -780,9 +780,4 @@ /* | ||
var path = '' | ||
if ((index) != null) { | ||
if (method == null) method = 'GET' | ||
path = '/' + encodeURIComponent(index) + '/' + '_upgrade' | ||
} else { | ||
if (method == null) method = 'GET' | ||
path = '/' + '_upgrade' | ||
} | ||
if (method == null) method = 'GET' | ||
path = '/' + encodeURIComponent(index) + '/' + '_upgrade' | ||
@@ -1375,9 +1370,4 @@ // build request object | ||
var path = '' | ||
if ((index) != null) { | ||
if (method == null) method = 'POST' | ||
path = '/' + encodeURIComponent(index) + '/' + '_upgrade' | ||
} else { | ||
if (method == null) method = 'POST' | ||
path = '/' + '_upgrade' | ||
} | ||
if (method == null) method = 'POST' | ||
path = '/' + encodeURIComponent(index) + '/' + '_upgrade' | ||
@@ -1563,2 +1553,56 @@ // build request object | ||
IndicesApi.prototype.migrateToDataStream = function indicesMigrateToDataStreamApi (params, options, callback) { | ||
;[params, options, callback] = normalizeArguments(params, options, callback) | ||
// check required parameters | ||
if (params['name'] == null) { | ||
const err = new this[kConfigurationError]('Missing required parameter: name') | ||
return handleError(err, callback) | ||
} | ||
var { method, body, name, ...querystring } = params | ||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) | ||
var path = '' | ||
if (method == null) method = 'POST' | ||
path = '/' + '_data_stream' + '/' + '_migrate' + '/' + encodeURIComponent(name) | ||
// build request object | ||
const request = { | ||
method, | ||
path, | ||
body: body || '', | ||
querystring | ||
} | ||
return this.transport.request(request, options, callback) | ||
} | ||
IndicesApi.prototype.promoteDataStream = function indicesPromoteDataStreamApi (params, options, callback) { | ||
;[params, options, callback] = normalizeArguments(params, options, callback) | ||
// check required parameters | ||
if (params['name'] == null) { | ||
const err = new this[kConfigurationError]('Missing required parameter: name') | ||
return handleError(err, callback) | ||
} | ||
var { method, body, name, ...querystring } = params | ||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) | ||
var path = '' | ||
if (method == null) method = 'POST' | ||
path = '/' + '_data_stream' + '/' + '_promote' + '/' + encodeURIComponent(name) | ||
// build request object | ||
const request = { | ||
method, | ||
path, | ||
body: body || '', | ||
querystring | ||
} | ||
return this.transport.request(request, options, callback) | ||
} | ||
IndicesApi.prototype.reloadSearchAnalyzers = function indicesReloadSearchAnalyzersApi (params, options, callback) { | ||
@@ -1651,2 +1695,4 @@ ;[params, options, callback] = normalizeArguments(params, options, callback) | ||
get_data_stream: { get () { return this.getDataStream } }, | ||
migrate_to_data_stream: { get () { return this.migrateToDataStream } }, | ||
promote_data_stream: { get () { return this.promoteDataStream } }, | ||
reload_search_analyzers: { get () { return this.reloadSearchAnalyzers } } | ||
@@ -1653,0 +1699,0 @@ }) |
@@ -26,4 +26,4 @@ /* | ||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') | ||
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' } | ||
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' } | ||
@@ -30,0 +30,0 @@ function mgetApi (params, options, callback) { |
@@ -171,2 +171,43 @@ /* | ||
RollupApi.prototype.rollup = function rollupRollupApi (params, options, callback) { | ||
;[params, options, callback] = normalizeArguments(params, options, callback) | ||
// check required parameters | ||
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) { | ||
const err = new this[kConfigurationError]('Missing required parameter: rollup_index or rollupIndex') | ||
return handleError(err, callback) | ||
} | ||
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)) { | ||
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 | ||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring) | ||
var path = '' | ||
if (method == null) method = 'POST' | ||
path = '/' + encodeURIComponent(index) + '/' + '_rollup' + '/' + encodeURIComponent(rollup_index || rollupIndex) | ||
// build request object | ||
const request = { | ||
method, | ||
path, | ||
body: body || '', | ||
querystring | ||
} | ||
return this.transport.request(request, options, callback) | ||
} | ||
RollupApi.prototype.rollupSearch = function rollupRollupSearchApi (params, options, callback) { | ||
@@ -173,0 +214,0 @@ ;[params, options, callback] = normalizeArguments(params, options, callback) |
@@ -26,4 +26,4 @@ /* | ||
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_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', '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', 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_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', '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', errorTrace: 'error_trace', filterPath: 'filter_path' } | ||
@@ -30,0 +30,0 @@ function searchApi (params, options, callback) { |
@@ -26,4 +26,4 @@ /* | ||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') | ||
const acceptedQuerystring = ['force', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'from', 'size', 'allow_no_match', 'defer_validation', 'timeout', 'wait_for_completion', 'wait_for_checkpoint'] | ||
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', allowNoMatch: 'allow_no_match', deferValidation: 'defer_validation', waitForCompletion: 'wait_for_completion', waitForCheckpoint: 'wait_for_checkpoint' } | ||
const acceptedQuerystring = ['force', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'from', 'size', 'allow_no_match', 'exclude_generated', 'defer_validation', 'timeout', 'wait_for_completion', 'wait_for_checkpoint'] | ||
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', allowNoMatch: 'allow_no_match', excludeGenerated: 'exclude_generated', deferValidation: 'defer_validation', waitForCompletion: 'wait_for_completion', waitForCheckpoint: 'wait_for_checkpoint' } | ||
@@ -30,0 +30,0 @@ function TransformApi (transport, ConfigurationError) { |
@@ -26,4 +26,4 @@ /* | ||
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_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' } | ||
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' } | ||
@@ -30,0 +30,0 @@ function updateByQueryApi (params, options, callback) { |
@@ -26,4 +26,4 @@ /* | ||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils') | ||
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' } | ||
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' } | ||
@@ -30,0 +30,0 @@ function updateApi (params, options, callback) { |
@@ -233,2 +233,23 @@ /* | ||
WatcherApi.prototype.queryWatches = function watcherQueryWatchesApi (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 = body == null ? 'GET' : 'POST' | ||
path = '/' + '_watcher' + '/' + '_query' + '/' + 'watches' | ||
// build request object | ||
const request = { | ||
method, | ||
path, | ||
body: body || '', | ||
querystring | ||
} | ||
return this.transport.request(request, options, callback) | ||
} | ||
WatcherApi.prototype.start = function watcherStartApi (params, options, callback) { | ||
@@ -309,5 +330,6 @@ ;[params, options, callback] = normalizeArguments(params, options, callback) | ||
get_watch: { get () { return this.getWatch } }, | ||
put_watch: { get () { return this.putWatch } } | ||
put_watch: { get () { return this.putWatch } }, | ||
query_watches: { get () { return this.queryWatches } } | ||
}) | ||
module.exports = WatcherApi |
@@ -42,6 +42,8 @@ /* | ||
export interface AsyncSearchStatus extends Generic { | ||
id: string; | ||
} | ||
export interface AsyncSearchSubmit<T = RequestBody> extends Generic { | ||
index?: string | string[]; | ||
_source_exclude?: string | string[]; | ||
_source_include?: string | string[]; | ||
wait_for_completion_timeout?: string; | ||
@@ -95,3 +97,3 @@ keep_on_completion?: boolean; | ||
export interface AutoscalingGetAutoscalingDecision extends Generic { | ||
export interface AutoscalingGetAutoscalingCapacity extends Generic { | ||
} | ||
@@ -111,4 +113,2 @@ | ||
type?: string; | ||
_source_exclude?: string | string[]; | ||
_source_include?: string | string[]; | ||
wait_for_active_shards?: string; | ||
@@ -365,6 +365,6 @@ refresh?: 'wait_for' | boolean; | ||
format?: string; | ||
node_id?: string | string[]; | ||
nodes?: string | string[]; | ||
actions?: string | string[]; | ||
detailed?: boolean; | ||
parent_task?: number; | ||
parent_task_id?: string; | ||
h?: string | string[]; | ||
@@ -654,4 +654,2 @@ help?: boolean; | ||
type?: string | string[]; | ||
_source_exclude?: string | string[]; | ||
_source_include?: string | string[]; | ||
analyzer?: string; | ||
@@ -747,4 +745,2 @@ analyze_wildcard?: boolean; | ||
type?: string; | ||
_source_exclude?: string | string[]; | ||
_source_include?: string | string[]; | ||
stored_fields?: string | string[]; | ||
@@ -766,4 +762,2 @@ preference?: string; | ||
type?: string; | ||
_source_exclude?: string | string[]; | ||
_source_include?: string | string[]; | ||
preference?: string; | ||
@@ -784,4 +778,2 @@ realtime?: boolean; | ||
type?: string; | ||
_source_exclude?: string | string[]; | ||
_source_include?: string | string[]; | ||
analyze_wildcard?: boolean; | ||
@@ -816,4 +808,2 @@ analyzer?: string; | ||
type?: string; | ||
_source_exclude?: string | string[]; | ||
_source_include?: string | string[]; | ||
stored_fields?: string | string[]; | ||
@@ -846,4 +836,2 @@ preference?: string; | ||
type?: string; | ||
_source_exclude?: string | string[]; | ||
_source_include?: string | string[]; | ||
preference?: string; | ||
@@ -1007,2 +995,3 @@ realtime?: boolean; | ||
name: string | string[]; | ||
expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; | ||
} | ||
@@ -1123,2 +1112,3 @@ | ||
name?: string | string[]; | ||
expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all'; | ||
} | ||
@@ -1183,2 +1173,6 @@ | ||
export interface IndicesMigrateToDataStream extends Generic { | ||
name: string; | ||
} | ||
export interface IndicesOpen extends Generic { | ||
@@ -1194,2 +1188,6 @@ index: string | string[]; | ||
export interface IndicesPromoteDataStream extends Generic { | ||
name: string; | ||
} | ||
export interface IndicesPutAlias<T = RequestBody> extends Generic { | ||
@@ -1452,4 +1450,2 @@ index: string | string[]; | ||
type?: string; | ||
_source_exclude?: string | string[]; | ||
_source_include?: string | string[]; | ||
stored_fields?: string | string[]; | ||
@@ -1630,2 +1626,3 @@ preference?: string; | ||
size?: number; | ||
exclude_generated?: boolean; | ||
} | ||
@@ -1651,2 +1648,3 @@ | ||
allow_no_datafeeds?: boolean; | ||
exclude_generated?: boolean; | ||
} | ||
@@ -1683,2 +1681,3 @@ | ||
allow_no_jobs?: boolean; | ||
exclude_generated?: boolean; | ||
} | ||
@@ -1733,3 +1732,3 @@ | ||
tags?: string | string[]; | ||
for_export?: boolean; | ||
exclude_generated?: boolean; | ||
} | ||
@@ -1879,2 +1878,9 @@ | ||
export interface MlUpgradeJobSnapshot extends Generic { | ||
job_id: string; | ||
snapshot_id: string; | ||
timeout?: string; | ||
wait_for_completion?: boolean; | ||
} | ||
export interface MlValidate<T = RequestBody> extends Generic { | ||
@@ -2053,2 +2059,8 @@ body: T; | ||
export interface RollupRollup<T = RequestBody> extends Generic { | ||
index: string; | ||
rollup_index: string; | ||
body: T; | ||
} | ||
export interface RollupRollupSearch<T = RequestBody> extends Generic { | ||
@@ -2086,4 +2098,2 @@ index: string | string[]; | ||
type?: string | string[]; | ||
_source_exclude?: string | string[]; | ||
_source_include?: string | string[]; | ||
analyzer?: string; | ||
@@ -2501,2 +2511,3 @@ analyze_wildcard?: boolean; | ||
allow_no_match?: boolean; | ||
exclude_generated?: boolean; | ||
} | ||
@@ -2545,4 +2556,2 @@ | ||
type?: string; | ||
_source_exclude?: string | string[]; | ||
_source_include?: string | string[]; | ||
wait_for_active_shards?: string; | ||
@@ -2566,4 +2575,2 @@ _source?: string | string[]; | ||
type?: string | string[]; | ||
_source_exclude?: string | string[]; | ||
_source_include?: string | string[]; | ||
analyzer?: string; | ||
@@ -2648,2 +2655,6 @@ analyze_wildcard?: boolean; | ||
export interface WatcherQueryWatches<T = RequestBody> extends Generic { | ||
body?: T; | ||
} | ||
export interface WatcherStart extends Generic { | ||
@@ -2650,0 +2661,0 @@ } |
21
index.js
@@ -36,2 +36,4 @@ /* | ||
const { prepareHeaders } = Connection.internals | ||
const clientVersion = require('./package.json').version | ||
const nodeVersion = process.versions.node | ||
@@ -129,3 +131,4 @@ const kInitialOptions = Symbol('elasticsearchjs-initial-options') | ||
context: null, | ||
proxy: null | ||
proxy: null, | ||
enableMetaHeader: true | ||
}, opts) | ||
@@ -137,2 +140,6 @@ | ||
if (options.enableMetaHeader) { | ||
options.headers['x-elastic-client-meta'] = `es=${clientVersion},js=${nodeVersion},t=${clientVersion},hc=${nodeVersion}` | ||
} | ||
if (opts[kChild] !== undefined) { | ||
@@ -185,3 +192,9 @@ this.serializer = options[kChild].serializer | ||
if (Helpers !== null) { | ||
this.helpers = new Helpers({ client: this, maxRetries: options.maxRetries }) | ||
this.helpers = new Helpers({ | ||
client: this, | ||
maxRetries: options.maxRetries, | ||
metaHeader: options.enableMetaHeader | ||
? `es=${clientVersion},js=${nodeVersion},t=${clientVersion},hc=${nodeVersion}` | ||
: null | ||
}) | ||
} | ||
@@ -321,3 +334,5 @@ } | ||
SNIFF: 'sniff', | ||
RESURRECT: 'resurrect' | ||
RESURRECT: 'resurrect', | ||
SERIALIZATION: 'serialization', | ||
DESERIALIZATION: 'deserialization' | ||
} | ||
@@ -324,0 +339,0 @@ |
@@ -85,2 +85,3 @@ /* | ||
this._openRequests++ | ||
let cleanedListeners = false | ||
@@ -138,3 +139,3 @@ const requestParams = this.buildRequestObject(params) | ||
/* istanbul ignore if */ | ||
if (err != null) { | ||
if (err != null && cleanedListeners === false) { | ||
cleanListeners() | ||
@@ -156,2 +157,3 @@ this._openRequests-- | ||
request.removeListener('abort', onAbort) | ||
cleanedListeners = true | ||
} | ||
@@ -158,0 +160,0 @@ } |
@@ -31,2 +31,3 @@ /* | ||
const kClient = Symbol('elasticsearch-client') | ||
const kMetaHeader = Symbol('meta header') | ||
/* istanbul ignore next */ | ||
@@ -38,2 +39,3 @@ const noop = () => {} | ||
this[kClient] = opts.client | ||
this[kMetaHeader] = opts.metaHeader | ||
this.maxRetries = opts.maxRetries | ||
@@ -76,2 +78,6 @@ } | ||
async * scrollSearch (params, options = {}) { | ||
if (this[kMetaHeader] !== null) { | ||
options.headers = options.headers || {} | ||
options.headers['x-elastic-client-meta'] = this[kMetaHeader] + ',h=s' | ||
} | ||
// TODO: study scroll search slices | ||
@@ -105,3 +111,3 @@ const wait = options.wait || 5000 | ||
{ body: { scroll_id } }, | ||
{ ignore: [400] } | ||
{ ignore: [400], ...options } | ||
) | ||
@@ -421,2 +427,3 @@ } | ||
const { serialize, deserialize } = client.serializer | ||
const reqOptions = this[kMetaHeader] !== null ? { headers: { 'x-elastic-client-meta': this[kMetaHeader] + ',h=bp' } } : {} | ||
const { | ||
@@ -684,3 +691,3 @@ datasource, | ||
if (shouldAbort === true) return callback(null, []) | ||
client.bulk(Object.assign({}, bulkOptions, { body: bulkBody }), (err, { body }) => { | ||
client.bulk(Object.assign({}, bulkOptions, { body: bulkBody }), reqOptions, (err, { body }) => { | ||
if (err) return callback(err, null) | ||
@@ -687,0 +694,0 @@ if (body.errors === false) { |
@@ -25,2 +25,3 @@ /* | ||
const { gzip, unzip, createGzip } = require('zlib') | ||
const buffer = require('buffer') | ||
const ms = require('ms') | ||
@@ -39,2 +40,4 @@ const { | ||
const userAgent = `elasticsearch-js/${clientVersion} (${os.platform()} ${os.release()}-${os.arch()}; Node.js ${process.version})` | ||
const MAX_BUFFER_LENGTH = buffer.constants.MAX_LENGTH | ||
const MAX_STRING_LENGTH = buffer.constants.MAX_STRING_LENGTH | ||
@@ -46,2 +49,3 @@ class Transport { | ||
} | ||
this.emit = opts.emit | ||
@@ -224,2 +228,18 @@ this.connectionPool = opts.connectionPool | ||
const isCompressed = contentEncoding.indexOf('gzip') > -1 || contentEncoding.indexOf('deflate') > -1 | ||
/* istanbul ignore else */ | ||
if (result.headers['content-length'] !== undefined) { | ||
const contentLength = Number(result.headers['content-length']) | ||
if (isCompressed && contentLength > MAX_BUFFER_LENGTH) { | ||
response.destroy() | ||
return onConnectionError( | ||
new RequestAbortedError(`The content length (${contentLength}) is bigger than the maximum allowed buffer (${MAX_BUFFER_LENGTH})`, result) | ||
) | ||
} else if (contentLength > MAX_STRING_LENGTH) { | ||
response.destroy() | ||
return onConnectionError( | ||
new RequestAbortedError(`The content length (${contentLength}) is bigger than the maximum allowed string (${MAX_STRING_LENGTH})`, result) | ||
) | ||
} | ||
} | ||
// if the response is compressed, we must handle it | ||
@@ -256,2 +276,4 @@ // as buffer for allowing decompression later | ||
} | ||
this.emit('deserialization', null, result) | ||
response.on('data', onData) | ||
@@ -329,2 +351,3 @@ response.on('error', onEnd) | ||
this.emit('serialization', null, result) | ||
const headers = Object.assign({}, this.headers, lowerCaseHeaders(options.headers)) | ||
@@ -344,2 +367,3 @@ | ||
} catch (err) { | ||
this.emit('request', err, result) | ||
process.nextTick(callback, err, result) | ||
@@ -360,2 +384,3 @@ return transportReturn | ||
} catch (err) { | ||
this.emit('request', err, result) | ||
process.nextTick(callback, err, result) | ||
@@ -400,2 +425,3 @@ return transportReturn | ||
if (err) { | ||
this.emit('request', err, result) | ||
return callback(err, result) | ||
@@ -402,0 +428,0 @@ } |
@@ -14,3 +14,3 @@ { | ||
"homepage": "http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html", | ||
"version": "7.10.0", | ||
"version": "7.11.0-rc.1", | ||
"keywords": [ | ||
@@ -17,0 +17,0 @@ "elasticsearch", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1232541
19318
1