@elastic/elasticsearch 7.15.0 → 7.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -28,7 +28,7 @@ npm install @elastic/elasticsearch
28
28
 
29
29
  ### Node.js support
30
30
 
31
- NOTE: The minimum supported version of Node.js is `v10`.
31
+ NOTE: The minimum supported version of Node.js is `v12`.
32
32
 
33
33
  The client versioning follows the Elastc Stack versioning, this means that
34
34
  major, minor, and patch releases are done following a precise schedule that
@@ -49,13 +49,13 @@ of `^7.10.0`).
49
49
 
50
50
  | Node.js Version | Node.js EOL date | End of support |
51
51
  | --------------- |------------------| ---------------------- |
52
- | `8.x` | `December 2019` | `7.11` (early 2021) |
53
- | `10.x` | `Apri 2021` | `7.12` (mid 2021) |
52
+ | `8.x` | `December 2019` | `7.11` (early 2021) |
53
+ | `10.x` | `April 2021` | `7.12` (mid 2021) |
54
54
 
55
55
  ### Compatibility
56
56
 
57
- Language clients are forward compatible; meaning that clients support communicating with greater minor versions of Elasticsearch.
58
- Elastic language clients are also backwards compatible with lesser supported minor Elasticsearch versions.
57
+ Language clients are forward compatible; meaning that clients support communicating with greater or equal minor versions of Elasticsearch.
58
+ Elasticsearch language clients are only backwards compatible with default distributions and without guarantees made.
59
59
 
60
60
  | Elasticsearch Version | Client Version |
61
61
  | --------------------- |----------------|
@@ -23,8 +23,8 @@
23
23
  /* eslint no-unused-vars: 0 */
24
24
 
25
25
  const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
26
- 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']
27
- 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' }
26
+ 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', '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']
27
+ 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', 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' }
28
28
 
29
29
  function deleteByQueryApi (params, options, callback) {
30
30
  ;[params, options, callback] = normalizeArguments(params, options, callback)
package/api/api/fleet.js CHANGED
@@ -23,8 +23,8 @@
23
23
  /* eslint no-unused-vars: 0 */
24
24
 
25
25
  const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
26
- const acceptedQuerystring = ['wait_for_advance', 'wait_for_index', 'checkpoints', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
27
- const snakeCase = { waitForAdvance: 'wait_for_advance', waitForIndex: 'wait_for_index', errorTrace: 'error_trace', filterPath: 'filter_path' }
26
+ const acceptedQuerystring = ['wait_for_advance', 'wait_for_index', 'checkpoints', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'wait_for_checkpoints', 'wait_for_checkpoints_timeout', 'allow_partial_search_results']
27
+ const snakeCase = { waitForAdvance: 'wait_for_advance', waitForIndex: 'wait_for_index', errorTrace: 'error_trace', filterPath: 'filter_path', waitForCheckpoints: 'wait_for_checkpoints', waitForCheckpointsTimeout: 'wait_for_checkpoints_timeout', allowPartialSearchResults: 'allow_partial_search_results' }
28
28
 
29
29
  function FleetApi (transport, ConfigurationError) {
30
30
  this.transport = transport
@@ -58,6 +58,65 @@ FleetApi.prototype.globalCheckpoints = function fleetGlobalCheckpointsApi (param
58
58
  return this.transport.request(request, options, callback)
59
59
  }
60
60
 
61
+ FleetApi.prototype.msearch = function fleetMsearchApi (params, options, callback) {
62
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
63
+
64
+ // check required parameters
65
+ if (params.body == null) {
66
+ const err = new this[kConfigurationError]('Missing required parameter: body')
67
+ return handleError(err, callback)
68
+ }
69
+
70
+ let { method, body, index, ...querystring } = params
71
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
72
+
73
+ let path = ''
74
+ if ((index) != null) {
75
+ if (method == null) method = body == null ? 'GET' : 'POST'
76
+ path = '/' + encodeURIComponent(index) + '/' + '_fleet' + '/' + '_fleet_msearch'
77
+ } else {
78
+ if (method == null) method = body == null ? 'GET' : 'POST'
79
+ path = '/' + '_fleet' + '/' + '_fleet_msearch'
80
+ }
81
+
82
+ // build request object
83
+ const request = {
84
+ method,
85
+ path,
86
+ bulkBody: body,
87
+ querystring
88
+ }
89
+
90
+ return this.transport.request(request, options, callback)
91
+ }
92
+
93
+ FleetApi.prototype.search = function fleetSearchApi (params, options, callback) {
94
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
95
+
96
+ // check required parameters
97
+ if (params.index == null) {
98
+ const err = new this[kConfigurationError]('Missing required parameter: index')
99
+ return handleError(err, callback)
100
+ }
101
+
102
+ let { method, body, index, ...querystring } = params
103
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
104
+
105
+ let path = ''
106
+ if (method == null) method = body == null ? 'GET' : 'POST'
107
+ path = '/' + encodeURIComponent(index) + '/' + '_fleet' + '/' + '_fleet_search'
108
+
109
+ // build request object
110
+ const request = {
111
+ method,
112
+ path,
113
+ body: body || '',
114
+ querystring
115
+ }
116
+
117
+ return this.transport.request(request, options, callback)
118
+ }
119
+
61
120
  Object.defineProperties(FleetApi.prototype, {
62
121
  global_checkpoints: { get () { return this.globalCheckpoints } }
63
122
  })
@@ -1005,6 +1005,33 @@ IndicesApi.prototype.migrateToDataStream = function indicesMigrateToDataStreamAp
1005
1005
  return this.transport.request(request, options, callback)
1006
1006
  }
1007
1007
 
1008
+ IndicesApi.prototype.modifyDataStream = function indicesModifyDataStreamApi (params, options, callback) {
1009
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
1010
+
1011
+ // check required parameters
1012
+ if (params.body == null) {
1013
+ const err = new this[kConfigurationError]('Missing required parameter: body')
1014
+ return handleError(err, callback)
1015
+ }
1016
+
1017
+ let { method, body, ...querystring } = params
1018
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
1019
+
1020
+ let path = ''
1021
+ if (method == null) method = 'POST'
1022
+ path = '/' + '_data_stream' + '/' + '_modify'
1023
+
1024
+ // build request object
1025
+ const request = {
1026
+ method,
1027
+ path,
1028
+ body: body || '',
1029
+ querystring
1030
+ }
1031
+
1032
+ return this.transport.request(request, options, callback)
1033
+ }
1034
+
1008
1035
  IndicesApi.prototype.open = function indicesOpenApi (params, options, callback) {
1009
1036
  ;[params, options, callback] = normalizeArguments(params, options, callback)
1010
1037
 
@@ -1735,6 +1762,7 @@ Object.defineProperties(IndicesApi.prototype, {
1735
1762
  get_template: { get () { return this.getTemplate } },
1736
1763
  get_upgrade: { get () { return this.getUpgrade } },
1737
1764
  migrate_to_data_stream: { get () { return this.migrateToDataStream } },
1765
+ modify_data_stream: { get () { return this.modifyDataStream } },
1738
1766
  promote_data_stream: { get () { return this.promoteDataStream } },
1739
1767
  put_alias: { get () { return this.putAlias } },
1740
1768
  put_index_template: { get () { return this.putIndexTemplate } },
package/api/api/ingest.js CHANGED
@@ -23,8 +23,8 @@
23
23
  /* eslint no-unused-vars: 0 */
24
24
 
25
25
  const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
26
- const acceptedQuerystring = ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'summary', 'verbose']
27
- const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' }
26
+ const acceptedQuerystring = ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'summary', 'if_version', 'verbose']
27
+ const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path', ifVersion: 'if_version' }
28
28
 
29
29
  function IngestApi (transport, ConfigurationError) {
30
30
  this.transport = transport
@@ -57,4 +57,51 @@ MigrationApi.prototype.deprecations = function migrationDeprecationsApi (params,
57
57
  return this.transport.request(request, options, callback)
58
58
  }
59
59
 
60
+ MigrationApi.prototype.getFeatureUpgradeStatus = function migrationGetFeatureUpgradeStatusApi (params, options, callback) {
61
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
62
+
63
+ let { method, body, ...querystring } = params
64
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
65
+
66
+ let path = ''
67
+ if (method == null) method = 'GET'
68
+ path = '/' + '_migration' + '/' + 'system_features'
69
+
70
+ // build request object
71
+ const request = {
72
+ method,
73
+ path,
74
+ body: null,
75
+ querystring
76
+ }
77
+
78
+ return this.transport.request(request, options, callback)
79
+ }
80
+
81
+ MigrationApi.prototype.postFeatureUpgrade = function migrationPostFeatureUpgradeApi (params, options, callback) {
82
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
83
+
84
+ let { method, body, ...querystring } = params
85
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
86
+
87
+ let path = ''
88
+ if (method == null) method = 'POST'
89
+ path = '/' + '_migration' + '/' + 'system_features'
90
+
91
+ // build request object
92
+ const request = {
93
+ method,
94
+ path,
95
+ body: body || '',
96
+ querystring
97
+ }
98
+
99
+ return this.transport.request(request, options, callback)
100
+ }
101
+
102
+ Object.defineProperties(MigrationApi.prototype, {
103
+ get_feature_upgrade_status: { get () { return this.getFeatureUpgradeStatus } },
104
+ post_feature_upgrade: { get () { return this.postFeatureUpgrade } }
105
+ })
106
+
60
107
  module.exports = MigrationApi
package/api/api/ml.js CHANGED
@@ -23,8 +23,8 @@
23
23
  /* eslint no-unused-vars: 0 */
24
24
 
25
25
  const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
26
- const acceptedQuerystring = ['allow_no_match', 'allow_no_jobs', 'force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'requests_per_second', 'allow_no_forecasts', 'wait_for_completion', 'lines_to_sample', 'line_merge_size_limit', 'charset', 'format', 'has_header_row', 'column_names', 'delimiter', 'quote', 'should_trim_fields', 'grok_pattern', 'timestamp_field', 'timestamp_format', 'explain', 'calc_interim', 'start', 'end', 'advance_time', 'skip_time', 'duration', 'expires_in', 'max_model_memory', 'expand', 'exclude_interim', 'from', 'size', 'anomaly_score', 'sort', 'desc', 'job_id', 'partition_field_value', 'exclude_generated', 'verbose', 'allow_no_datafeeds', 'influencer_score', 'top_n', 'bucket_span', 'overall_score', 'record_score', 'include', 'include_model_definition', 'decompress_definition', 'tags', 'reset_start', 'reset_end', 'ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'reassign', 'delete_intervening_results', 'enabled']
27
- const snakeCase = { allowNoMatch: 'allow_no_match', allowNoJobs: 'allow_no_jobs', errorTrace: 'error_trace', filterPath: 'filter_path', requestsPerSecond: 'requests_per_second', allowNoForecasts: 'allow_no_forecasts', waitForCompletion: 'wait_for_completion', linesToSample: 'lines_to_sample', lineMergeSizeLimit: 'line_merge_size_limit', hasHeaderRow: 'has_header_row', columnNames: 'column_names', shouldTrimFields: 'should_trim_fields', grokPattern: 'grok_pattern', timestampField: 'timestamp_field', timestampFormat: 'timestamp_format', calcInterim: 'calc_interim', advanceTime: 'advance_time', skipTime: 'skip_time', expiresIn: 'expires_in', maxModelMemory: 'max_model_memory', excludeInterim: 'exclude_interim', anomalyScore: 'anomaly_score', jobId: 'job_id', partitionFieldValue: 'partition_field_value', excludeGenerated: 'exclude_generated', allowNoDatafeeds: 'allow_no_datafeeds', influencerScore: 'influencer_score', topN: 'top_n', bucketSpan: 'bucket_span', overallScore: 'overall_score', recordScore: 'record_score', includeModelDefinition: 'include_model_definition', decompressDefinition: 'decompress_definition', resetStart: 'reset_start', resetEnd: 'reset_end', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', ignoreThrottled: 'ignore_throttled', expandWildcards: 'expand_wildcards', deleteInterveningResults: 'delete_intervening_results' }
26
+ const acceptedQuerystring = ['allow_no_match', 'allow_no_jobs', 'force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'requests_per_second', 'allow_no_forecasts', 'wait_for_completion', 'lines_to_sample', 'line_merge_size_limit', 'charset', 'format', 'has_header_row', 'column_names', 'delimiter', 'quote', 'should_trim_fields', 'grok_pattern', 'timestamp_field', 'timestamp_format', 'explain', 'calc_interim', 'start', 'end', 'advance_time', 'skip_time', 'duration', 'expires_in', 'max_model_memory', 'expand', 'exclude_interim', 'from', 'size', 'anomaly_score', 'sort', 'desc', 'job_id', 'partition_field_value', 'exclude_generated', 'verbose', 'allow_no_datafeeds', 'influencer_score', 'top_n', 'bucket_span', 'overall_score', 'record_score', 'include', 'include_model_definition', 'decompress_definition', 'tags', 'reset_start', 'reset_end', 'ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'defer_definition_decompression', 'reassign', 'delete_intervening_results', 'enabled']
27
+ const snakeCase = { allowNoMatch: 'allow_no_match', allowNoJobs: 'allow_no_jobs', errorTrace: 'error_trace', filterPath: 'filter_path', requestsPerSecond: 'requests_per_second', allowNoForecasts: 'allow_no_forecasts', waitForCompletion: 'wait_for_completion', linesToSample: 'lines_to_sample', lineMergeSizeLimit: 'line_merge_size_limit', hasHeaderRow: 'has_header_row', columnNames: 'column_names', shouldTrimFields: 'should_trim_fields', grokPattern: 'grok_pattern', timestampField: 'timestamp_field', timestampFormat: 'timestamp_format', calcInterim: 'calc_interim', advanceTime: 'advance_time', skipTime: 'skip_time', expiresIn: 'expires_in', maxModelMemory: 'max_model_memory', excludeInterim: 'exclude_interim', anomalyScore: 'anomaly_score', jobId: 'job_id', partitionFieldValue: 'partition_field_value', excludeGenerated: 'exclude_generated', allowNoDatafeeds: 'allow_no_datafeeds', influencerScore: 'influencer_score', topN: 'top_n', bucketSpan: 'bucket_span', overallScore: 'overall_score', recordScore: 'record_score', includeModelDefinition: 'include_model_definition', decompressDefinition: 'decompress_definition', resetStart: 'reset_start', resetEnd: 'reset_end', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', ignoreThrottled: 'ignore_throttled', expandWildcards: 'expand_wildcards', deferDefinitionDecompression: 'defer_definition_decompression', deleteInterveningResults: 'delete_intervening_results' }
28
28
 
29
29
  function MlApi (transport, ConfigurationError) {
30
30
  this.transport = transport
package/api/api/nodes.js CHANGED
@@ -23,7 +23,7 @@
23
23
  /* eslint no-unused-vars: 0 */
24
24
 
25
25
  const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
26
- const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path', 'interval', 'snapshots', 'threads', 'ignore_idle_threads', 'type', 'timeout', 'flat_settings', 'completion_fields', 'fielddata_fields', 'fields', 'groups', 'level', 'types', 'include_segment_file_sizes', 'include_unloaded_segments']
26
+ const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path', 'interval', 'snapshots', 'threads', 'ignore_idle_threads', 'type', 'sort', 'timeout', 'flat_settings', 'completion_fields', 'fielddata_fields', 'fields', 'groups', 'level', 'types', 'include_segment_file_sizes', 'include_unloaded_segments']
27
27
  const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', ignoreIdleThreads: 'ignore_idle_threads', flatSettings: 'flat_settings', completionFields: 'completion_fields', fielddataFields: 'fielddata_fields', includeSegmentFileSizes: 'include_segment_file_sizes', includeUnloadedSegments: 'include_unloaded_segments' }
28
28
 
29
29
  function NodesApi (transport, ConfigurationError) {
@@ -34,6 +34,10 @@ function openPointInTimeApi (params, options, callback) {
34
34
  const err = new this[kConfigurationError]('Missing required parameter: index')
35
35
  return handleError(err, callback)
36
36
  }
37
+ if (params.keep_alive == null && params.keepAlive == null) {
38
+ const err = new this[kConfigurationError]('Missing required parameter: keep_alive or keepAlive')
39
+ return handleError(err, callback)
40
+ }
37
41
 
38
42
  let { method, body, index, ...querystring } = params
39
43
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
@@ -23,8 +23,8 @@
23
23
  /* eslint no-unused-vars: 0 */
24
24
 
25
25
  const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
26
- const acceptedQuerystring = ['exact_bounds', 'extent', 'grid_precision', 'grid_type', 'size', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
27
- const snakeCase = { exactBounds: 'exact_bounds', gridPrecision: 'grid_precision', gridType: 'grid_type', errorTrace: 'error_trace', filterPath: 'filter_path' }
26
+ const acceptedQuerystring = ['exact_bounds', 'extent', 'grid_precision', 'grid_type', 'size', 'track_total_hits', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
27
+ const snakeCase = { exactBounds: 'exact_bounds', gridPrecision: 'grid_precision', gridType: 'grid_type', trackTotalHits: 'track_total_hits', errorTrace: 'error_trace', filterPath: 'filter_path' }
28
28
 
29
29
  function searchMvtApi (params, options, callback) {
30
30
  ;[params, options, callback] = normalizeArguments(params, options, callback)
@@ -23,8 +23,8 @@
23
23
  /* eslint no-unused-vars: 0 */
24
24
 
25
25
  const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
26
- 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']
27
- 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' }
26
+ const acceptedQuerystring = ['force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'from', 'size', 'allow_no_match', 'exclude_generated', 'defer_validation', 'wait_for_completion', 'wait_for_checkpoint', 'dry_run']
27
+ 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', dryRun: 'dry_run' }
28
28
 
29
29
  function TransformApi (transport, ConfigurationError) {
30
30
  this.transport = transport
@@ -114,18 +114,17 @@ TransformApi.prototype.getTransformStats = function transformGetTransformStatsAp
114
114
  TransformApi.prototype.previewTransform = function transformPreviewTransformApi (params, options, callback) {
115
115
  ;[params, options, callback] = normalizeArguments(params, options, callback)
116
116
 
117
- // check required parameters
118
- if (params.body == null) {
119
- const err = new this[kConfigurationError]('Missing required parameter: body')
120
- return handleError(err, callback)
121
- }
122
-
123
- let { method, body, ...querystring } = params
117
+ let { method, body, transformId, transform_id, ...querystring } = params
124
118
  querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
125
119
 
126
120
  let path = ''
127
- if (method == null) method = 'POST'
128
- path = '/' + '_transform' + '/' + '_preview'
121
+ if ((transform_id || transformId) != null) {
122
+ if (method == null) method = body == null ? 'GET' : 'POST'
123
+ path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_preview'
124
+ } else {
125
+ if (method == null) method = body == null ? 'GET' : 'POST'
126
+ path = '/' + '_transform' + '/' + '_preview'
127
+ }
129
128
 
130
129
  // build request object
131
130
  const request = {
@@ -254,6 +253,27 @@ TransformApi.prototype.updateTransform = function transformUpdateTransformApi (p
254
253
  return this.transport.request(request, options, callback)
255
254
  }
256
255
 
256
+ TransformApi.prototype.upgradeTransforms = function transformUpgradeTransformsApi (params, options, callback) {
257
+ ;[params, options, callback] = normalizeArguments(params, options, callback)
258
+
259
+ let { method, body, ...querystring } = params
260
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
261
+
262
+ let path = ''
263
+ if (method == null) method = 'POST'
264
+ path = '/' + '_transform' + '/' + '_upgrade'
265
+
266
+ // build request object
267
+ const request = {
268
+ method,
269
+ path,
270
+ body: body || '',
271
+ querystring
272
+ }
273
+
274
+ return this.transport.request(request, options, callback)
275
+ }
276
+
257
277
  Object.defineProperties(TransformApi.prototype, {
258
278
  delete_transform: { get () { return this.deleteTransform } },
259
279
  get_transform: { get () { return this.getTransform } },
@@ -262,7 +282,8 @@ Object.defineProperties(TransformApi.prototype, {
262
282
  put_transform: { get () { return this.putTransform } },
263
283
  start_transform: { get () { return this.startTransform } },
264
284
  stop_transform: { get () { return this.stopTransform } },
265
- update_transform: { get () { return this.updateTransform } }
285
+ update_transform: { get () { return this.updateTransform } },
286
+ upgrade_transforms: { get () { return this.upgradeTransforms } }
266
287
  })
267
288
 
268
289
  module.exports = TransformApi
@@ -23,8 +23,8 @@
23
23
  /* eslint no-unused-vars: 0 */
24
24
 
25
25
  const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
26
- 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']
27
- 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' }
26
+ 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', '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']
27
+ 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', 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' }
28
28
 
29
29
  function updateByQueryApi (params, options, callback) {
30
30
  ;[params, options, callback] = normalizeArguments(params, options, callback)