Compare commits
94 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1cb32b09b1 | |||
| 555368a283 | |||
| 54bc1b455d | |||
| de5ac5c7d0 | |||
| 23030139af | |||
| 6020625912 | |||
| 0652f5ab31 | |||
| fa91d1a832 | |||
| bb7393a084 | |||
| dc905aaabc | |||
| 4e2f25b5cd | |||
| 249d2a6398 | |||
| d0a421b25c | |||
| e6eeeeb6af | |||
| d2ee3be9e0 | |||
| cb7421ecfc | |||
| a5f48d0962 | |||
| 54642b9c9d | |||
| 9ff5fc34bc | |||
| 1ad8501d73 | |||
| 158ea917e2 | |||
| 26887ca76b | |||
| 53ba8ba726 | |||
| 8ad6d993e6 | |||
| fb363fe5c3 | |||
| 1e7ccfab33 | |||
| 1362fb568e | |||
| 34a168dd99 | |||
| be1c0f235c | |||
| da0bfd2fb5 | |||
| 9daf8f360c | |||
| f6180fae6b | |||
| 996ee29009 | |||
| bb8f397742 | |||
| 7c69f043e5 | |||
| 93a7e52be0 | |||
| 642b15cd5c | |||
| ee867daad0 | |||
| ef11962ad4 | |||
| 65fabb267d | |||
| c520967790 | |||
| f555329496 | |||
| c55b287c63 | |||
| 1a2665b13b | |||
| 791cfdb186 | |||
| f3a2cbffe9 | |||
| 1777d091bb | |||
| 37c2959e92 | |||
| 6aaba8af07 | |||
| 64f62c91e0 | |||
| 432df0c3db | |||
| 0f35880143 | |||
| 3bd3748feb | |||
| 559acd32be | |||
| a48ebc9442 | |||
| 563b7746cd | |||
| a287c71147 | |||
| db5476ad5d | |||
| e8b4eb8b9b | |||
| 67db0c57bf | |||
| 743c53dfe0 | |||
| adc5c2b146 | |||
| 7358fd0c83 | |||
| 9baa42ac1b | |||
| 28d8ff799e | |||
| ea2c8d2d4d | |||
| 2f0aeec108 | |||
| 74c6e187a2 | |||
| 7bf627f76b | |||
| 496887cec0 | |||
| 1040e76ce2 | |||
| b3ca264a0b | |||
| ea3df650f1 | |||
| 51594424d5 | |||
| a2614bd84e | |||
| 4ec32601e7 | |||
| 1e5d143d0c | |||
| 9a021f8445 | |||
| aad5fdf144 | |||
| bc607ffbd1 | |||
| ecff306004 | |||
| 9b0f45f390 | |||
| 2016dd2ef6 | |||
| 95daf256f6 | |||
| 7ef266bdb0 | |||
| f7450de64e | |||
| f7c9c64e1d | |||
| 4441de678f | |||
| c9808fb067 | |||
| b812c51dce | |||
| 7a83df8445 | |||
| bfae6066af | |||
| 23ababaffc | |||
| fe3ec491de |
@ -26,10 +26,11 @@ if [[ -z $es_node_name ]]; then
|
||||
export es_node_name=instance
|
||||
export elastic_password=changeme
|
||||
export elasticsearch_image=elasticsearch
|
||||
export elasticsearch_url=https://elastic:${elastic_password}@${es_node_name}:9200
|
||||
export elasticsearch_scheme="https"
|
||||
if [[ $TEST_SUITE != "platinum" ]]; then
|
||||
export elasticsearch_url=http://${es_node_name}:9200
|
||||
export elasticsearch_scheme="http"
|
||||
fi
|
||||
export elasticsearch_url=${elasticsearch_scheme}://elastic:${elastic_password}@${es_node_name}:9200
|
||||
export external_elasticsearch_url=${elasticsearch_url/$es_node_name/localhost}
|
||||
export elasticsearch_container="${elasticsearch_image}:${STACK_VERSION}"
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
# Export the TEST_SUITE variable, eg. 'free' or 'platinum' defaults to 'free'.
|
||||
# Export the NUMBER_OF_NODES variable to start more than 1 node
|
||||
|
||||
# Version 1.2.0
|
||||
# Version 1.6.0
|
||||
# - Initial version of the run-elasticsearch.sh script
|
||||
# - Deleting the volume should not dependent on the container still running
|
||||
# - Fixed `ES_JAVA_OPTS` config
|
||||
@ -15,6 +15,11 @@
|
||||
# - Refactored into functions and imports
|
||||
# - Support NUMBER_OF_NODES
|
||||
# - Added 5 retries on docker pull for fixing transient network errors
|
||||
# - Added flags to make local CCR configurations work
|
||||
# - Added action.destructive_requires_name=false as the default will be true in v8
|
||||
# - Added ingest.geoip.downloader.enabled=false as it causes false positives in testing
|
||||
# - Moved ELASTIC_PASSWORD and xpack.security.enabled to the base arguments for "Security On by default"
|
||||
# - Use https only when TEST_SUITE is "platinum", when "free" use http
|
||||
|
||||
script_path=$(dirname $(realpath -s $0))
|
||||
source $script_path/functions/imports.sh
|
||||
@ -28,6 +33,8 @@ cluster_name=${moniker}${suffix}
|
||||
|
||||
declare -a volumes
|
||||
environment=($(cat <<-END
|
||||
--env ELASTIC_PASSWORD=$elastic_password
|
||||
--env xpack.security.enabled=true
|
||||
--env node.name=$es_node_name
|
||||
--env cluster.name=$cluster_name
|
||||
--env cluster.initial_master_nodes=$master_node_name
|
||||
@ -37,19 +44,21 @@ environment=($(cat <<-END
|
||||
--env node.attr.testattr=test
|
||||
--env path.repo=/tmp
|
||||
--env repositories.url.allowed_urls=http://snapshot.test*
|
||||
--env action.destructive_requires_name=false
|
||||
--env ingest.geoip.downloader.enabled=false
|
||||
--env cluster.deprecation_indexing.enabled=false
|
||||
END
|
||||
))
|
||||
if [[ "$TEST_SUITE" == "platinum" ]]; then
|
||||
environment+=($(cat <<-END
|
||||
--env ELASTIC_PASSWORD=$elastic_password
|
||||
--env xpack.license.self_generated.type=trial
|
||||
--env xpack.security.enabled=true
|
||||
--env xpack.security.http.ssl.enabled=true
|
||||
--env xpack.security.http.ssl.verification_mode=certificate
|
||||
--env xpack.security.http.ssl.key=certs/testnode.key
|
||||
--env xpack.security.http.ssl.certificate=certs/testnode.crt
|
||||
--env xpack.security.http.ssl.certificate_authorities=certs/ca.crt
|
||||
--env xpack.security.transport.ssl.enabled=true
|
||||
--env xpack.security.transport.ssl.verification_mode=certificate
|
||||
--env xpack.security.transport.ssl.key=certs/testnode.key
|
||||
--env xpack.security.transport.ssl.certificate=certs/testnode.crt
|
||||
--env xpack.security.transport.ssl.certificate_authorities=certs/ca.crt
|
||||
@ -61,6 +70,11 @@ END
|
||||
--volume $ssl_ca:/usr/share/elasticsearch/config/certs/ca.crt
|
||||
END
|
||||
))
|
||||
else
|
||||
environment+=($(cat <<-END
|
||||
--env xpack.security.http.ssl.enabled=false
|
||||
END
|
||||
))
|
||||
fi
|
||||
|
||||
cert_validation_flags=""
|
||||
@ -104,7 +118,7 @@ END
|
||||
docker run \
|
||||
--name "$node_name" \
|
||||
--network "$network_name" \
|
||||
--env "ES_JAVA_OPTS=-Xms1g -Xmx1g" \
|
||||
--env "ES_JAVA_OPTS=-Xms1g -Xmx1g -da:org.elasticsearch.xpack.ccr.index.engine.FollowingEngineAssertions" \
|
||||
"${environment[@]}" \
|
||||
"${volumes[@]}" \
|
||||
--publish "$http_port":9200 \
|
||||
|
||||
@ -30,17 +30,14 @@ docker build \
|
||||
echo -e "\033[1m>>>>> NPM run test:integration >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m"
|
||||
|
||||
repo=$(realpath $(dirname $(realpath -s $0))/../)
|
||||
run_script_args=""
|
||||
if [[ "$NODE_JS_VERSION" == "8" ]]; then
|
||||
run_script_args="--harmony-async-iteration"
|
||||
fi
|
||||
|
||||
docker run \
|
||||
--network=${network_name} \
|
||||
--env "TEST_ES_SERVER=${ELASTICSEARCH_URL}" \
|
||||
--env "TEST_SUITE=${TEST_SUITE}" \
|
||||
--volume $repo:/usr/src/app \
|
||||
--volume /usr/src/app/node_modules \
|
||||
--name elasticsearch-js \
|
||||
--rm \
|
||||
elastic/elasticsearch-js \
|
||||
node ${run_script_args} test/integration/index.js
|
||||
npm run test:integration
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
---
|
||||
STACK_VERSION:
|
||||
- 7.x-SNAPSHOT
|
||||
- 7.16-SNAPSHOT
|
||||
|
||||
NODE_JS_VERSION:
|
||||
- 16
|
||||
- 14
|
||||
- 12
|
||||
- 10
|
||||
|
||||
TEST_SUITE:
|
||||
- free
|
||||
|
||||
33
.github/workflows/nodejs.yml
vendored
33
.github/workflows/nodejs.yml
vendored
@ -9,7 +9,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [10.x, 12.x, 14.x, 15.x]
|
||||
node-version: [12.x, 14.x, 16.x]
|
||||
os: [ubuntu-latest, windows-latest, macOS-latest]
|
||||
|
||||
steps:
|
||||
@ -46,7 +46,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [10.x, 12.x, 14.x]
|
||||
node-version: [12.x, 14.x, 16.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
@ -61,7 +61,7 @@ jobs:
|
||||
- name: Runs Elasticsearch
|
||||
uses: elastic/elastic-github-actions/elasticsearch@master
|
||||
with:
|
||||
stack-version: 7.x-SNAPSHOT
|
||||
stack-version: 7.16-SNAPSHOT
|
||||
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
@ -93,7 +93,7 @@ jobs:
|
||||
- name: Runs Elasticsearch
|
||||
uses: elastic/elastic-github-actions/elasticsearch@master
|
||||
with:
|
||||
stack-version: 8.0.0-SNAPSHOT
|
||||
stack-version: 7.16-SNAPSHOT
|
||||
|
||||
- name: Use Node.js 14.x
|
||||
uses: actions/setup-node@v1
|
||||
@ -119,13 +119,34 @@ jobs:
|
||||
npm start --prefix test/bundlers/rollup-test
|
||||
npm start --prefix test/bundlers/webpack-test
|
||||
|
||||
mock-support:
|
||||
name: Mock support
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Use Node.js 14.x
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14.x
|
||||
|
||||
- name: Install
|
||||
run: |
|
||||
npm install
|
||||
npm install --prefix test/mock
|
||||
|
||||
- name: Run test
|
||||
run: |
|
||||
npm test --prefix test/mock
|
||||
|
||||
code-coverage:
|
||||
name: Code coverage
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [12.x]
|
||||
node-version: [14.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
@ -159,7 +180,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [12.x]
|
||||
node-version: [14.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
@ -58,14 +58,24 @@ Once your changes are ready to submit for review:
|
||||
|
||||
### Code generation
|
||||
|
||||
The entire content of the API folder is generated as well as the `docs/reference.asciidoc` file.<br/>
|
||||
If you want to run the code generation you should run the following command:
|
||||
The contents of the API folder and the `docs/reference.asciidoc` file are generated by a script.<br/>
|
||||
To run the script, use the following command:
|
||||
|
||||
```sh
|
||||
node scripts/generate --tag <tag name>
|
||||
# or
|
||||
node scripts/generate --branch <branch name>
|
||||
node scripts/generate --version <version name>
|
||||
```
|
||||
|
||||
For example:
|
||||
|
||||
```sh
|
||||
node scripts/generate --version 7.15.0
|
||||
```
|
||||
|
||||
To run the script for an unreleased snapshot version, append `-SNAPSHOT` to the version name. For example:
|
||||
|
||||
```sh
|
||||
node scripts/generate --version 8.0.0-SNAPSHOT
|
||||
```
|
||||
Then you should copy the content of `api/generated.d.ts` into the `index.d.ts` file *(automate this step would be a nice pr!)*.
|
||||
|
||||
### Testing
|
||||
There are different test scripts, usually during development you only need to run `npm test`, but if you want you can run just a part of the suite, following you will find all the testing scripts and what they do.
|
||||
|
||||
@ -28,7 +28,7 @@ npm install @elastic/elasticsearch
|
||||
|
||||
### Node.js support
|
||||
|
||||
NOTE: The minimum supported version of Node.js is `v10`.
|
||||
NOTE: The minimum supported version of Node.js is `v12`.
|
||||
|
||||
The client versioning follows the Elastc Stack versioning, this means that
|
||||
major, minor, and patch releases are done following a precise schedule that
|
||||
@ -49,12 +49,13 @@ of `^7.10.0`).
|
||||
|
||||
| Node.js Version | Node.js EOL date | End of support |
|
||||
| --------------- |------------------| ---------------------- |
|
||||
| `8.x` | `December 2019` | `7.11` (early 2021) |
|
||||
| `10.x` | `Apri 2021` | `7.12` (mid 2021) |
|
||||
| `8.x` | `December 2019` | `7.11` (early 2021) |
|
||||
| `10.x` | `April 2021` | `7.12` (mid 2021) |
|
||||
|
||||
### Compatibility
|
||||
|
||||
The library is compatible with all Elasticsearch versions since 5.x, and you should use the same major version of the Elasticsearch instance that you are using.
|
||||
Language clients are forward compatible; meaning that clients support communicating with greater or equal minor versions of Elasticsearch.
|
||||
Elasticsearch language clients are only backwards compatible with default distributions and without guarantees made.
|
||||
|
||||
| Elasticsearch Version | Client Version |
|
||||
| --------------------- |----------------|
|
||||
|
||||
@ -23,8 +23,8 @@
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
||||
const acceptedQuerystring = ['analyzer', 'analyze_wildcard', 'default_operator', 'df', 'from', 'ignore_unavailable', 'allow_no_indices', 'conflicts', 'expand_wildcards', 'lenient', 'preference', 'q', 'routing', 'scroll', 'search_type', 'search_timeout', 'size', 'max_docs', 'sort', '_source', '_source_excludes', '_source_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', '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', terminateAfter: 'terminate_after', requestCache: 'request_cache', waitForActiveShards: 'wait_for_active_shards', scrollSize: 'scroll_size', waitForCompletion: 'wait_for_completion', requestsPerSecond: 'requests_per_second', errorTrace: 'error_trace', filterPath: 'filter_path' }
|
||||
|
||||
function deleteByQueryApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
124
api/api/fleet.js
Normal file
124
api/api/fleet.js
Normal file
@ -0,0 +1,124 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
||||
const acceptedQuerystring = ['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']
|
||||
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' }
|
||||
|
||||
function FleetApi (transport, ConfigurationError) {
|
||||
this.transport = transport
|
||||
this[kConfigurationError] = ConfigurationError
|
||||
}
|
||||
|
||||
FleetApi.prototype.globalCheckpoints = function fleetGlobalCheckpointsApi (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)
|
||||
}
|
||||
|
||||
let { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_fleet' + '/' + 'global_checkpoints'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
FleetApi.prototype.msearch = function fleetMsearchApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.body == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if ((index) != null) {
|
||||
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_fleet' + '/' + '_fleet_msearch'
|
||||
} else {
|
||||
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||
path = '/' + '_fleet' + '/' + '_fleet_msearch'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
bulkBody: body,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
FleetApi.prototype.search = function fleetSearchApi (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)
|
||||
}
|
||||
|
||||
let { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_fleet' + '/' + '_fleet_search'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
Object.defineProperties(FleetApi.prototype, {
|
||||
global_checkpoints: { get () { return this.globalCheckpoints } }
|
||||
})
|
||||
|
||||
module.exports = FleetApi
|
||||
@ -23,8 +23,8 @@
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
||||
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path', 'only_managed', 'only_errors']
|
||||
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', onlyManaged: 'only_managed', onlyErrors: 'only_errors' }
|
||||
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path', 'only_managed', 'only_errors', 'dry_run']
|
||||
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', onlyManaged: 'only_managed', onlyErrors: 'only_errors', dryRun: 'dry_run' }
|
||||
|
||||
function IlmApi (transport, ConfigurationError) {
|
||||
this.transport = transport
|
||||
@ -132,6 +132,27 @@ IlmApi.prototype.getStatus = function ilmGetStatusApi (params, options, callback
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IlmApi.prototype.migrateToDataTiers = function ilmMigrateToDataTiersApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
let { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_ilm' + '/' + 'migrate_to_data_tiers'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IlmApi.prototype.moveToStep = function ilmMoveToStepApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -287,6 +308,7 @@ Object.defineProperties(IlmApi.prototype, {
|
||||
explain_lifecycle: { get () { return this.explainLifecycle } },
|
||||
get_lifecycle: { get () { return this.getLifecycle } },
|
||||
get_status: { get () { return this.getStatus } },
|
||||
migrate_to_data_tiers: { get () { return this.migrateToDataTiers } },
|
||||
move_to_step: { get () { return this.moveToStep } },
|
||||
put_lifecycle: { get () { return this.putLifecycle } },
|
||||
remove_policy: { get () { return this.removePolicy } }
|
||||
|
||||
@ -23,8 +23,8 @@
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
||||
const acceptedQuerystring = ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'index', 'fielddata', 'fields', 'query', 'request', 'wait_for_active_shards', 'include_type_name', 'local', 'flat_settings', 'include_defaults', 'force', 'wait_if_ongoing', 'flush', 'max_num_segments', 'only_expunge_deletes', 'create', 'cause', 'write_index_only', 'preserve_existing', 'order', 'detailed', 'active_only', 'dry_run', 'verbose', 'status', 'copy_settings', 'completion_fields', 'fielddata_fields', 'groups', 'level', 'types', 'include_segment_file_sizes', 'include_unloaded_segments', 'forbid_closed_indices', 'wait_for_completion', 'only_ancient_segments', 'explain', 'q', 'analyzer', 'analyze_wildcard', 'default_operator', 'df', 'lenient', 'rewrite', 'all_shards']
|
||||
const snakeCase = { masterTimeout: 'master_timeout', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', waitForActiveShards: 'wait_for_active_shards', includeTypeName: 'include_type_name', flatSettings: 'flat_settings', includeDefaults: 'include_defaults', waitIfOngoing: 'wait_if_ongoing', maxNumSegments: 'max_num_segments', onlyExpungeDeletes: 'only_expunge_deletes', writeIndexOnly: 'write_index_only', preserveExisting: 'preserve_existing', activeOnly: 'active_only', dryRun: 'dry_run', copySettings: 'copy_settings', completionFields: 'completion_fields', fielddataFields: 'fielddata_fields', includeSegmentFileSizes: 'include_segment_file_sizes', includeUnloadedSegments: 'include_unloaded_segments', forbidClosedIndices: 'forbid_closed_indices', waitForCompletion: 'wait_for_completion', onlyAncientSegments: 'only_ancient_segments', analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', allShards: 'all_shards' }
|
||||
const acceptedQuerystring = ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'index', 'fielddata', 'fields', 'query', 'request', 'wait_for_active_shards', 'include_type_name', 'run_expensive_tasks', 'flush', 'local', 'flat_settings', 'include_defaults', 'force', 'wait_if_ongoing', 'max_num_segments', 'only_expunge_deletes', 'create', 'cause', 'write_index_only', 'preserve_existing', 'order', 'detailed', 'active_only', 'dry_run', 'verbose', 'status', 'copy_settings', 'completion_fields', 'fielddata_fields', 'groups', 'level', 'types', 'include_segment_file_sizes', 'include_unloaded_segments', 'forbid_closed_indices', 'wait_for_completion', 'only_ancient_segments', 'explain', 'q', 'analyzer', 'analyze_wildcard', 'default_operator', 'df', 'lenient', 'rewrite', 'all_shards']
|
||||
const snakeCase = { masterTimeout: 'master_timeout', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', waitForActiveShards: 'wait_for_active_shards', includeTypeName: 'include_type_name', runExpensiveTasks: 'run_expensive_tasks', flatSettings: 'flat_settings', includeDefaults: 'include_defaults', waitIfOngoing: 'wait_if_ongoing', maxNumSegments: 'max_num_segments', onlyExpungeDeletes: 'only_expunge_deletes', writeIndexOnly: 'write_index_only', preserveExisting: 'preserve_existing', activeOnly: 'active_only', dryRun: 'dry_run', copySettings: 'copy_settings', completionFields: 'completion_fields', fielddataFields: 'fielddata_fields', includeSegmentFileSizes: 'include_segment_file_sizes', includeUnloadedSegments: 'include_unloaded_segments', forbidClosedIndices: 'forbid_closed_indices', waitForCompletion: 'wait_for_completion', onlyAncientSegments: 'only_ancient_segments', analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', allShards: 'all_shards' }
|
||||
|
||||
function IndicesApi (transport, ConfigurationError) {
|
||||
this.transport = transport
|
||||
@ -414,6 +414,33 @@ IndicesApi.prototype.deleteTemplate = function indicesDeleteTemplateApi (params,
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.diskUsage = function indicesDiskUsageApi (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)
|
||||
}
|
||||
|
||||
let { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_disk_usage'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.exists = function indicesExistsApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -564,6 +591,33 @@ IndicesApi.prototype.existsType = function indicesExistsTypeApi (params, options
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.fieldUsageStats = function indicesFieldUsageStatsApi (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)
|
||||
}
|
||||
|
||||
let { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_field_usage_stats'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.flush = function indicesFlushApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -951,6 +1005,33 @@ IndicesApi.prototype.migrateToDataStream = function indicesMigrateToDataStreamAp
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.modifyDataStream = function indicesModifyDataStreamApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.body == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_data_stream' + '/' + '_modify'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.open = function indicesOpenApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -1665,10 +1746,12 @@ Object.defineProperties(IndicesApi.prototype, {
|
||||
delete_data_stream: { get () { return this.deleteDataStream } },
|
||||
delete_index_template: { get () { return this.deleteIndexTemplate } },
|
||||
delete_template: { get () { return this.deleteTemplate } },
|
||||
disk_usage: { get () { return this.diskUsage } },
|
||||
exists_alias: { get () { return this.existsAlias } },
|
||||
exists_index_template: { get () { return this.existsIndexTemplate } },
|
||||
exists_template: { get () { return this.existsTemplate } },
|
||||
exists_type: { get () { return this.existsType } },
|
||||
field_usage_stats: { get () { return this.fieldUsageStats } },
|
||||
flush_synced: { get () { return this.flushSynced } },
|
||||
get_alias: { get () { return this.getAlias } },
|
||||
get_data_stream: { get () { return this.getDataStream } },
|
||||
@ -1679,6 +1762,7 @@ Object.defineProperties(IndicesApi.prototype, {
|
||||
get_template: { get () { return this.getTemplate } },
|
||||
get_upgrade: { get () { return this.getUpgrade } },
|
||||
migrate_to_data_stream: { get () { return this.migrateToDataStream } },
|
||||
modify_data_stream: { get () { return this.modifyDataStream } },
|
||||
promote_data_stream: { get () { return this.promoteDataStream } },
|
||||
put_alias: { get () { return this.putAlias } },
|
||||
put_index_template: { get () { return this.putIndexTemplate } },
|
||||
|
||||
@ -23,8 +23,8 @@
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
||||
const acceptedQuerystring = ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'summary', 'verbose']
|
||||
const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' }
|
||||
const acceptedQuerystring = ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'summary', 'if_version', 'verbose']
|
||||
const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path', ifVersion: 'if_version' }
|
||||
|
||||
function IngestApi (transport, ConfigurationError) {
|
||||
this.transport = transport
|
||||
|
||||
@ -57,4 +57,51 @@ MigrationApi.prototype.deprecations = function migrationDeprecationsApi (params,
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
MigrationApi.prototype.getFeatureUpgradeStatus = function migrationGetFeatureUpgradeStatusApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
let { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_migration' + '/' + 'system_features'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
MigrationApi.prototype.postFeatureUpgrade = function migrationPostFeatureUpgradeApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
let { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_migration' + '/' + 'system_features'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
Object.defineProperties(MigrationApi.prototype, {
|
||||
get_feature_upgrade_status: { get () { return this.getFeatureUpgradeStatus } },
|
||||
post_feature_upgrade: { get () { return this.postFeatureUpgrade } }
|
||||
})
|
||||
|
||||
module.exports = MigrationApi
|
||||
|
||||
@ -23,8 +23,8 @@
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
||||
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']
|
||||
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' }
|
||||
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']
|
||||
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' }
|
||||
|
||||
function MlApi (transport, ConfigurationError) {
|
||||
this.transport = transport
|
||||
@ -1493,6 +1493,33 @@ MlApi.prototype.putTrainedModelAlias = function mlPutTrainedModelAliasApi (param
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
MlApi.prototype.resetJob = function mlResetJobApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.job_id == null && params.jobId == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: job_id or jobId')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, jobId, job_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_reset'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
MlApi.prototype.revertModelSnapshot = function mlRevertModelSnapshotApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -1964,6 +1991,7 @@ Object.defineProperties(MlApi.prototype, {
|
||||
put_job: { get () { return this.putJob } },
|
||||
put_trained_model: { get () { return this.putTrainedModel } },
|
||||
put_trained_model_alias: { get () { return this.putTrainedModelAlias } },
|
||||
reset_job: { get () { return this.resetJob } },
|
||||
revert_model_snapshot: { get () { return this.revertModelSnapshot } },
|
||||
set_upgrade_mode: { get () { return this.setUpgradeMode } },
|
||||
start_data_frame_analytics: { get () { return this.startDataFrameAnalytics } },
|
||||
|
||||
@ -56,7 +56,7 @@ MonitoringApi.prototype.bulk = function monitoringBulkApi (params, options, call
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
bulkBody: body,
|
||||
querystring
|
||||
}
|
||||
|
||||
|
||||
@ -23,14 +23,78 @@
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
||||
const acceptedQuerystring = ['interval', 'snapshots', 'threads', 'ignore_idle_threads', 'type', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'flat_settings', 'completion_fields', 'fielddata_fields', 'fields', 'groups', 'level', 'types', 'include_segment_file_sizes', 'include_unloaded_segments']
|
||||
const snakeCase = { ignoreIdleThreads: 'ignore_idle_threads', errorTrace: 'error_trace', filterPath: 'filter_path', flatSettings: 'flat_settings', completionFields: 'completion_fields', fielddataFields: 'fielddata_fields', includeSegmentFileSizes: 'include_segment_file_sizes', includeUnloadedSegments: 'include_unloaded_segments' }
|
||||
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']
|
||||
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' }
|
||||
|
||||
function NodesApi (transport, ConfigurationError) {
|
||||
this.transport = transport
|
||||
this[kConfigurationError] = ConfigurationError
|
||||
}
|
||||
|
||||
NodesApi.prototype.clearRepositoriesMeteringArchive = function nodesClearRepositoriesMeteringArchiveApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.node_id == null && params.nodeId == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: node_id or nodeId')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.max_archive_version == null && params.maxArchiveVersion == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: max_archive_version or maxArchiveVersion')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// check required url components
|
||||
if ((params.max_archive_version != null || params.maxArchiveVersion != null) && ((params.node_id == null && params.nodeId == null))) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter of the url: node_id')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, nodeId, node_id, maxArchiveVersion, max_archive_version, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'DELETE'
|
||||
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + '_repositories_metering' + '/' + encodeURIComponent(max_archive_version || maxArchiveVersion)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
NodesApi.prototype.getRepositoriesMeteringInfo = function nodesGetRepositoriesMeteringInfoApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.node_id == null && params.nodeId == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: node_id or nodeId')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, nodeId, node_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + '_repositories_metering'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
NodesApi.prototype.hotThreads = function nodesHotThreadsApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -195,6 +259,8 @@ NodesApi.prototype.usage = function nodesUsageApi (params, options, callback) {
|
||||
}
|
||||
|
||||
Object.defineProperties(NodesApi.prototype, {
|
||||
clear_repositories_metering_archive: { get () { return this.clearRepositoriesMeteringArchive } },
|
||||
get_repositories_metering_info: { get () { return this.getRepositoriesMeteringInfo } },
|
||||
hot_threads: { get () { return this.hotThreads } },
|
||||
reload_secure_settings: { get () { return this.reloadSecureSettings } }
|
||||
})
|
||||
|
||||
@ -29,17 +29,22 @@ const snakeCase = { ignoreUnavailable: 'ignore_unavailable', expandWildcards: 'e
|
||||
function openPointInTimeApi (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.keep_alive == null && params.keepAlive == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: keep_alive or keepAlive')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if ((index) != null) {
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_pit'
|
||||
} else {
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_pit'
|
||||
}
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_pit'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
|
||||
87
api/api/search_mvt.js
Normal file
87
api/api/search_mvt.js
Normal file
@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
||||
const acceptedQuerystring = ['exact_bounds', 'extent', 'grid_precision', 'grid_type', 'size', 'track_total_hits', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
|
||||
const snakeCase = { exactBounds: 'exact_bounds', gridPrecision: 'grid_precision', gridType: 'grid_type', trackTotalHits: 'track_total_hits', errorTrace: 'error_trace', filterPath: 'filter_path' }
|
||||
|
||||
function searchMvtApi (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.field == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: field')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.zoom == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: zoom')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.x == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: x')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.y == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: y')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// check required url components
|
||||
if (params.y != null && (params.x == null || params.zoom == null || params.field == null || params.index == null)) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter of the url: x, zoom, field, index')
|
||||
return handleError(err, callback)
|
||||
} else if (params.x != null && (params.zoom == null || params.field == null || params.index == null)) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter of the url: zoom, field, index')
|
||||
return handleError(err, callback)
|
||||
} else if (params.zoom != null && (params.field == null || params.index == null)) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter of the url: field, index')
|
||||
return handleError(err, callback)
|
||||
} else if (params.field != null && (params.index == null)) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, index, field, zoom, x, y, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_mvt' + '/' + encodeURIComponent(field) + '/' + encodeURIComponent(zoom) + '/' + encodeURIComponent(x) + '/' + encodeURIComponent(y)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
module.exports = searchMvtApi
|
||||
@ -23,14 +23,40 @@
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
||||
const acceptedQuerystring = ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'index', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'master_timeout', 'wait_for_completion', 'storage', 'level']
|
||||
const snakeCase = { ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', masterTimeout: 'master_timeout', waitForCompletion: 'wait_for_completion' }
|
||||
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'index', 'master_timeout', 'wait_for_completion', 'storage', 'level']
|
||||
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', masterTimeout: 'master_timeout', waitForCompletion: 'wait_for_completion' }
|
||||
|
||||
function SearchableSnapshotsApi (transport, ConfigurationError) {
|
||||
this.transport = transport
|
||||
this[kConfigurationError] = ConfigurationError
|
||||
}
|
||||
|
||||
SearchableSnapshotsApi.prototype.cacheStats = function searchableSnapshotsCacheStatsApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
let { method, body, nodeId, node_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if ((node_id || nodeId) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_searchable_snapshots' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'cache' + '/' + 'stats'
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_searchable_snapshots' + '/' + 'cache' + '/' + 'stats'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SearchableSnapshotsApi.prototype.clearCache = function searchableSnapshotsClearCacheApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -152,6 +178,7 @@ SearchableSnapshotsApi.prototype.stats = function searchableSnapshotsStatsApi (p
|
||||
}
|
||||
|
||||
Object.defineProperties(SearchableSnapshotsApi.prototype, {
|
||||
cache_stats: { get () { return this.cacheStats } },
|
||||
clear_cache: { get () { return this.clearCache } },
|
||||
repository_stats: { get () { return this.repositoryStats } }
|
||||
})
|
||||
|
||||
@ -192,6 +192,50 @@ SecurityApi.prototype.clearCachedRoles = function securityClearCachedRolesApi (p
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SecurityApi.prototype.clearCachedServiceTokens = function securityClearCachedServiceTokensApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.namespace == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: namespace')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.service == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: service')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.name == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: name')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// check required url components
|
||||
if (params.name != null && (params.service == null || params.namespace == null)) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter of the url: service, namespace')
|
||||
return handleError(err, callback)
|
||||
} else if (params.service != null && (params.namespace == null)) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter of the url: namespace')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, namespace, service, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_security' + '/' + 'service' + '/' + encodeURIComponent(namespace) + '/' + encodeURIComponent(service) + '/' + 'credential' + '/' + 'token' + '/' + encodeURIComponent(name) + '/' + '_clear_cache'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SecurityApi.prototype.createApiKey = function securityCreateApiKeyApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -219,6 +263,51 @@ SecurityApi.prototype.createApiKey = function securityCreateApiKeyApi (params, o
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SecurityApi.prototype.createServiceToken = function securityCreateServiceTokenApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.namespace == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: namespace')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.service == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: service')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// check required url components
|
||||
if (params.name != null && (params.service == null || params.namespace == null)) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter of the url: service, namespace')
|
||||
return handleError(err, callback)
|
||||
} else if (params.service != null && (params.namespace == null)) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter of the url: namespace')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, namespace, service, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if ((namespace) != null && (service) != null && (name) != null) {
|
||||
if (method == null) method = 'PUT'
|
||||
path = '/' + '_security' + '/' + 'service' + '/' + encodeURIComponent(namespace) + '/' + encodeURIComponent(service) + '/' + 'credential' + '/' + 'token' + '/' + encodeURIComponent(name)
|
||||
} else {
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_security' + '/' + 'service' + '/' + encodeURIComponent(namespace) + '/' + encodeURIComponent(service) + '/' + 'credential' + '/' + 'token'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SecurityApi.prototype.deletePrivileges = function securityDeletePrivilegesApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -310,6 +399,50 @@ SecurityApi.prototype.deleteRoleMapping = function securityDeleteRoleMappingApi
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SecurityApi.prototype.deleteServiceToken = function securityDeleteServiceTokenApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.namespace == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: namespace')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.service == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: service')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.name == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: name')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// check required url components
|
||||
if (params.name != null && (params.service == null || params.namespace == null)) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter of the url: service, namespace')
|
||||
return handleError(err, callback)
|
||||
} else if (params.service != null && (params.namespace == null)) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter of the url: namespace')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, namespace, service, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'DELETE'
|
||||
path = '/' + '_security' + '/' + 'service' + '/' + encodeURIComponent(namespace) + '/' + encodeURIComponent(service) + '/' + 'credential' + '/' + 'token' + '/' + encodeURIComponent(name)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SecurityApi.prototype.deleteUser = function securityDeleteUserApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -520,6 +653,78 @@ SecurityApi.prototype.getRoleMapping = function securityGetRoleMappingApi (param
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SecurityApi.prototype.getServiceAccounts = function securityGetServiceAccountsApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required url components
|
||||
if (params.service != null && (params.namespace == null)) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter of the url: namespace')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, namespace, service, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if ((namespace) != null && (service) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_security' + '/' + 'service' + '/' + encodeURIComponent(namespace) + '/' + encodeURIComponent(service)
|
||||
} else if ((namespace) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_security' + '/' + 'service' + '/' + encodeURIComponent(namespace)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_security' + '/' + 'service'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SecurityApi.prototype.getServiceCredentials = function securityGetServiceCredentialsApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.namespace == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: namespace')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.service == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: service')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// check required url components
|
||||
if (params.service != null && (params.namespace == null)) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter of the url: namespace')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, namespace, service, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_security' + '/' + 'service' + '/' + encodeURIComponent(namespace) + '/' + encodeURIComponent(service) + '/' + 'credential'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SecurityApi.prototype.getToken = function securityGetTokenApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -827,16 +1032,202 @@ SecurityApi.prototype.putUser = function securityPutUserApi (params, options, ca
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SecurityApi.prototype.queryApiKeys = function securityQueryApiKeysApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
let { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||
path = '/' + '_security' + '/' + '_query' + '/' + 'api_key'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SecurityApi.prototype.samlAuthenticate = function securitySamlAuthenticateApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.body == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_security' + '/' + 'saml' + '/' + 'authenticate'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SecurityApi.prototype.samlCompleteLogout = function securitySamlCompleteLogoutApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.body == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_security' + '/' + 'saml' + '/' + 'complete_logout'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SecurityApi.prototype.samlInvalidate = function securitySamlInvalidateApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.body == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_security' + '/' + 'saml' + '/' + 'invalidate'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SecurityApi.prototype.samlLogout = function securitySamlLogoutApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.body == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_security' + '/' + 'saml' + '/' + 'logout'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SecurityApi.prototype.samlPrepareAuthentication = function securitySamlPrepareAuthenticationApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.body == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_security' + '/' + 'saml' + '/' + 'prepare'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SecurityApi.prototype.samlServiceProviderMetadata = function securitySamlServiceProviderMetadataApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.realm_name == null && params.realmName == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: realm_name or realmName')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, realmName, realm_name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_security' + '/' + 'saml' + '/' + 'metadata' + '/' + encodeURIComponent(realm_name || realmName)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
Object.defineProperties(SecurityApi.prototype, {
|
||||
change_password: { get () { return this.changePassword } },
|
||||
clear_api_key_cache: { get () { return this.clearApiKeyCache } },
|
||||
clear_cached_privileges: { get () { return this.clearCachedPrivileges } },
|
||||
clear_cached_realms: { get () { return this.clearCachedRealms } },
|
||||
clear_cached_roles: { get () { return this.clearCachedRoles } },
|
||||
clear_cached_service_tokens: { get () { return this.clearCachedServiceTokens } },
|
||||
create_api_key: { get () { return this.createApiKey } },
|
||||
create_service_token: { get () { return this.createServiceToken } },
|
||||
delete_privileges: { get () { return this.deletePrivileges } },
|
||||
delete_role: { get () { return this.deleteRole } },
|
||||
delete_role_mapping: { get () { return this.deleteRoleMapping } },
|
||||
delete_service_token: { get () { return this.deleteServiceToken } },
|
||||
delete_user: { get () { return this.deleteUser } },
|
||||
disable_user: { get () { return this.disableUser } },
|
||||
enable_user: { get () { return this.enableUser } },
|
||||
@ -845,6 +1236,8 @@ Object.defineProperties(SecurityApi.prototype, {
|
||||
get_privileges: { get () { return this.getPrivileges } },
|
||||
get_role: { get () { return this.getRole } },
|
||||
get_role_mapping: { get () { return this.getRoleMapping } },
|
||||
get_service_accounts: { get () { return this.getServiceAccounts } },
|
||||
get_service_credentials: { get () { return this.getServiceCredentials } },
|
||||
get_token: { get () { return this.getToken } },
|
||||
get_user: { get () { return this.getUser } },
|
||||
get_user_privileges: { get () { return this.getUserPrivileges } },
|
||||
@ -855,7 +1248,14 @@ Object.defineProperties(SecurityApi.prototype, {
|
||||
put_privileges: { get () { return this.putPrivileges } },
|
||||
put_role: { get () { return this.putRole } },
|
||||
put_role_mapping: { get () { return this.putRoleMapping } },
|
||||
put_user: { get () { return this.putUser } }
|
||||
put_user: { get () { return this.putUser } },
|
||||
query_api_keys: { get () { return this.queryApiKeys } },
|
||||
saml_authenticate: { get () { return this.samlAuthenticate } },
|
||||
saml_complete_logout: { get () { return this.samlCompleteLogout } },
|
||||
saml_invalidate: { get () { return this.samlInvalidate } },
|
||||
saml_logout: { get () { return this.samlLogout } },
|
||||
saml_prepare_authentication: { get () { return this.samlPrepareAuthentication } },
|
||||
saml_service_provider_metadata: { get () { return this.samlServiceProviderMetadata } }
|
||||
})
|
||||
|
||||
module.exports = SecurityApi
|
||||
|
||||
@ -23,8 +23,8 @@
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
||||
const acceptedQuerystring = ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'wait_for_completion', 'verify', 'ignore_unavailable', 'verbose', 'local']
|
||||
const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path', waitForCompletion: 'wait_for_completion', ignoreUnavailable: 'ignore_unavailable' }
|
||||
const acceptedQuerystring = ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'wait_for_completion', 'verify', 'ignore_unavailable', 'index_details', 'include_repository', 'verbose', 'local', 'blob_count', 'concurrency', 'read_node_count', 'early_read_node_count', 'seed', 'rare_action_probability', 'max_blob_size', 'max_total_data_size', 'detailed', 'rarely_abort_writes']
|
||||
const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path', waitForCompletion: 'wait_for_completion', ignoreUnavailable: 'ignore_unavailable', indexDetails: 'index_details', includeRepository: 'include_repository', blobCount: 'blob_count', readNodeCount: 'read_node_count', earlyReadNodeCount: 'early_read_node_count', rareActionProbability: 'rare_action_probability', maxBlobSize: 'max_blob_size', maxTotalDataSize: 'max_total_data_size', rarelyAbortWrites: 'rarely_abort_writes' }
|
||||
|
||||
function SnapshotApi (transport, ConfigurationError) {
|
||||
this.transport = transport
|
||||
@ -301,6 +301,33 @@ SnapshotApi.prototype.getRepository = function snapshotGetRepositoryApi (params,
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SnapshotApi.prototype.repositoryAnalyze = function snapshotRepositoryAnalyzeApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.repository == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: repository')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, repository, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_snapshot' + '/' + encodeURIComponent(repository) + '/' + '_analyze'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SnapshotApi.prototype.restore = function snapshotRestoreApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -405,6 +432,7 @@ Object.defineProperties(SnapshotApi.prototype, {
|
||||
create_repository: { get () { return this.createRepository } },
|
||||
delete_repository: { get () { return this.deleteRepository } },
|
||||
get_repository: { get () { return this.getRepository } },
|
||||
repository_analyze: { get () { return this.repositoryAnalyze } },
|
||||
verify_repository: { get () { return this.verifyRepository } }
|
||||
})
|
||||
|
||||
|
||||
@ -23,8 +23,8 @@
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
||||
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path', 'format']
|
||||
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
|
||||
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path', 'delimiter', 'format', 'keep_alive', 'wait_for_completion_timeout']
|
||||
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', keepAlive: 'keep_alive', waitForCompletionTimeout: 'wait_for_completion_timeout' }
|
||||
|
||||
function SqlApi (transport, ConfigurationError) {
|
||||
this.transport = transport
|
||||
@ -58,6 +58,87 @@ SqlApi.prototype.clearCursor = function sqlClearCursorApi (params, options, call
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SqlApi.prototype.deleteAsync = function sqlDeleteAsyncApi (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)
|
||||
}
|
||||
|
||||
let { method, body, id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'DELETE'
|
||||
path = '/' + '_sql' + '/' + 'async' + '/' + 'delete' + '/' + encodeURIComponent(id)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SqlApi.prototype.getAsync = function sqlGetAsyncApi (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)
|
||||
}
|
||||
|
||||
let { method, body, id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_sql' + '/' + 'async' + '/' + encodeURIComponent(id)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SqlApi.prototype.getAsyncStatus = function sqlGetAsyncStatusApi (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)
|
||||
}
|
||||
|
||||
let { method, body, id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_sql' + '/' + 'async' + '/' + 'status' + '/' + encodeURIComponent(id)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SqlApi.prototype.query = function sqlQueryApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -113,7 +194,10 @@ SqlApi.prototype.translate = function sqlTranslateApi (params, options, callback
|
||||
}
|
||||
|
||||
Object.defineProperties(SqlApi.prototype, {
|
||||
clear_cursor: { get () { return this.clearCursor } }
|
||||
clear_cursor: { get () { return this.clearCursor } },
|
||||
delete_async: { get () { return this.deleteAsync } },
|
||||
get_async: { get () { return this.getAsync } },
|
||||
get_async_status: { get () { return this.getAsyncStatus } }
|
||||
})
|
||||
|
||||
module.exports = SqlApi
|
||||
|
||||
56
api/api/terms_enum.js
Normal file
56
api/api/terms_enum.js
Normal file
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
||||
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']
|
||||
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
|
||||
|
||||
function termsEnumApi (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)
|
||||
}
|
||||
|
||||
let { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_terms_enum'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
module.exports = termsEnumApi
|
||||
@ -23,8 +23,8 @@
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
||||
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' }
|
||||
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']
|
||||
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' }
|
||||
|
||||
function TransformApi (transport, ConfigurationError) {
|
||||
this.transport = transport
|
||||
@ -114,18 +114,17 @@ TransformApi.prototype.getTransformStats = function transformGetTransformStatsAp
|
||||
TransformApi.prototype.previewTransform = function transformPreviewTransformApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.body == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, ...querystring } = params
|
||||
let { method, body, transformId, transform_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_transform' + '/' + '_preview'
|
||||
if ((transform_id || transformId) != null) {
|
||||
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||
path = '/' + '_transform' + '/' + encodeURIComponent(transform_id || transformId) + '/' + '_preview'
|
||||
} else {
|
||||
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||
path = '/' + '_transform' + '/' + '_preview'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
@ -254,6 +253,27 @@ TransformApi.prototype.updateTransform = function transformUpdateTransformApi (p
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
TransformApi.prototype.upgradeTransforms = function transformUpgradeTransformsApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
let { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_transform' + '/' + '_upgrade'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
Object.defineProperties(TransformApi.prototype, {
|
||||
delete_transform: { get () { return this.deleteTransform } },
|
||||
get_transform: { get () { return this.getTransform } },
|
||||
@ -262,7 +282,8 @@ Object.defineProperties(TransformApi.prototype, {
|
||||
put_transform: { get () { return this.putTransform } },
|
||||
start_transform: { get () { return this.startTransform } },
|
||||
stop_transform: { get () { return this.stopTransform } },
|
||||
update_transform: { get () { return this.updateTransform } }
|
||||
update_transform: { get () { return this.updateTransform } },
|
||||
upgrade_transforms: { get () { return this.upgradeTransforms } }
|
||||
})
|
||||
|
||||
module.exports = TransformApi
|
||||
|
||||
@ -23,8 +23,8 @@
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
||||
const acceptedQuerystring = ['analyzer', 'analyze_wildcard', 'default_operator', 'df', 'from', 'ignore_unavailable', 'allow_no_indices', 'conflicts', 'expand_wildcards', 'lenient', 'pipeline', 'preference', 'q', 'routing', 'scroll', 'search_type', 'search_timeout', 'size', 'max_docs', 'sort', '_source', '_source_excludes', '_source_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', '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', terminateAfter: 'terminate_after', versionType: 'version_type', requestCache: 'request_cache', waitForActiveShards: 'wait_for_active_shards', scrollSize: 'scroll_size', waitForCompletion: 'wait_for_completion', requestsPerSecond: 'requests_per_second', errorTrace: 'error_trace', filterPath: 'filter_path' }
|
||||
|
||||
function updateByQueryApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
17
api/index.js
17
api/index.js
@ -41,6 +41,7 @@ const existsSourceApi = require('./api/exists_source')
|
||||
const explainApi = require('./api/explain')
|
||||
const FeaturesApi = require('./api/features')
|
||||
const fieldCapsApi = require('./api/field_caps')
|
||||
const FleetApi = require('./api/fleet')
|
||||
const getApi = require('./api/get')
|
||||
const getScriptApi = require('./api/get_script')
|
||||
const getScriptContextApi = require('./api/get_script_context')
|
||||
@ -73,6 +74,7 @@ const RollupApi = require('./api/rollup')
|
||||
const scriptsPainlessExecuteApi = require('./api/scripts_painless_execute')
|
||||
const scrollApi = require('./api/scroll')
|
||||
const searchApi = require('./api/search')
|
||||
const searchMvtApi = require('./api/search_mvt')
|
||||
const searchShardsApi = require('./api/search_shards')
|
||||
const searchTemplateApi = require('./api/search_template')
|
||||
const SearchableSnapshotsApi = require('./api/searchable_snapshots')
|
||||
@ -83,6 +85,7 @@ const SnapshotApi = require('./api/snapshot')
|
||||
const SqlApi = require('./api/sql')
|
||||
const SslApi = require('./api/ssl')
|
||||
const TasksApi = require('./api/tasks')
|
||||
const termsEnumApi = require('./api/terms_enum')
|
||||
const termvectorsApi = require('./api/termvectors')
|
||||
const TextStructureApi = require('./api/text_structure')
|
||||
const TransformApi = require('./api/transform')
|
||||
@ -102,6 +105,7 @@ const kDanglingIndices = Symbol('DanglingIndices')
|
||||
const kEnrich = Symbol('Enrich')
|
||||
const kEql = Symbol('Eql')
|
||||
const kFeatures = Symbol('Features')
|
||||
const kFleet = Symbol('Fleet')
|
||||
const kGraph = Symbol('Graph')
|
||||
const kIlm = Symbol('Ilm')
|
||||
const kIndices = Symbol('Indices')
|
||||
@ -137,6 +141,7 @@ function ESAPI (opts) {
|
||||
this[kEnrich] = null
|
||||
this[kEql] = null
|
||||
this[kFeatures] = null
|
||||
this[kFleet] = null
|
||||
this[kGraph] = null
|
||||
this[kIlm] = null
|
||||
this[kIndices] = null
|
||||
@ -196,8 +201,10 @@ ESAPI.prototype.renderSearchTemplate = renderSearchTemplateApi
|
||||
ESAPI.prototype.scriptsPainlessExecute = scriptsPainlessExecuteApi
|
||||
ESAPI.prototype.scroll = scrollApi
|
||||
ESAPI.prototype.search = searchApi
|
||||
ESAPI.prototype.searchMvt = searchMvtApi
|
||||
ESAPI.prototype.searchShards = searchShardsApi
|
||||
ESAPI.prototype.searchTemplate = searchTemplateApi
|
||||
ESAPI.prototype.termsEnum = termsEnumApi
|
||||
ESAPI.prototype.termvectors = termvectorsApi
|
||||
ESAPI.prototype.update = updateApi
|
||||
ESAPI.prototype.updateByQuery = updateByQueryApi
|
||||
@ -285,6 +292,14 @@ Object.defineProperties(ESAPI.prototype, {
|
||||
}
|
||||
},
|
||||
field_caps: { get () { return this.fieldCaps } },
|
||||
fleet: {
|
||||
get () {
|
||||
if (this[kFleet] === null) {
|
||||
this[kFleet] = new FleetApi(this.transport, this[kConfigurationError])
|
||||
}
|
||||
return this[kFleet]
|
||||
}
|
||||
},
|
||||
get_script: { get () { return this.getScript } },
|
||||
get_script_context: { get () { return this.getScriptContext } },
|
||||
get_script_languages: { get () { return this.getScriptLanguages } },
|
||||
@ -384,6 +399,7 @@ Object.defineProperties(ESAPI.prototype, {
|
||||
}
|
||||
},
|
||||
scripts_painless_execute: { get () { return this.scriptsPainlessExecute } },
|
||||
search_mvt: { get () { return this.searchMvt } },
|
||||
search_shards: { get () { return this.searchShards } },
|
||||
search_template: { get () { return this.searchTemplate } },
|
||||
searchableSnapshots: {
|
||||
@ -451,6 +467,7 @@ Object.defineProperties(ESAPI.prototype, {
|
||||
return this[kTasks]
|
||||
}
|
||||
},
|
||||
terms_enum: { get () { return this.termsEnum } },
|
||||
textStructure: {
|
||||
get () {
|
||||
if (this[kTextStructure] === null) {
|
||||
|
||||
596
api/kibana.d.ts
vendored
596
api/kibana.d.ts
vendored
@ -85,10 +85,10 @@ interface KibanaClient {
|
||||
submit<TDocument = unknown, TContext = unknown>(params?: T.AsyncSearchSubmitRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.AsyncSearchSubmitResponse<TDocument>, TContext>>
|
||||
}
|
||||
autoscaling: {
|
||||
deleteAutoscalingPolicy<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getAutoscalingCapacity<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getAutoscalingPolicy<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
putAutoscalingPolicy<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
deleteAutoscalingPolicy<TContext = unknown>(params: T.AutoscalingDeleteAutoscalingPolicyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.AutoscalingDeleteAutoscalingPolicyResponse, TContext>>
|
||||
getAutoscalingCapacity<TContext = unknown>(params?: T.AutoscalingGetAutoscalingCapacityRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.AutoscalingGetAutoscalingCapacityResponse, TContext>>
|
||||
getAutoscalingPolicy<TContext = unknown>(params: T.AutoscalingGetAutoscalingPolicyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.AutoscalingGetAutoscalingPolicyResponse, TContext>>
|
||||
putAutoscalingPolicy<TContext = unknown>(params: T.AutoscalingPutAutoscalingPolicyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.AutoscalingPutAutoscalingPolicyResponse, TContext>>
|
||||
}
|
||||
bulk<TSource = unknown, TContext = unknown>(params: T.BulkRequest<TSource>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.BulkResponse, TContext>>
|
||||
cat: {
|
||||
@ -100,11 +100,11 @@ interface KibanaClient {
|
||||
help<TContext = unknown>(params?: T.CatHelpRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatHelpResponse, TContext>>
|
||||
indices<TContext = unknown>(params?: T.CatIndicesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatIndicesResponse, TContext>>
|
||||
master<TContext = unknown>(params?: T.CatMasterRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatMasterResponse, TContext>>
|
||||
mlDataFrameAnalytics<TContext = unknown>(params?: T.CatDataFrameAnalyticsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatDataFrameAnalyticsResponse, TContext>>
|
||||
mlDatafeeds<TContext = unknown>(params?: T.CatDatafeedsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatDatafeedsResponse, TContext>>
|
||||
mlJobs<TContext = unknown>(params?: T.CatJobsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatJobsResponse, TContext>>
|
||||
mlTrainedModels<TContext = unknown>(params?: T.CatTrainedModelsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatTrainedModelsResponse, TContext>>
|
||||
nodeattrs<TContext = unknown>(params?: T.CatNodeAttributesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatNodeAttributesResponse, TContext>>
|
||||
mlDataFrameAnalytics<TContext = unknown>(params?: T.CatMlDataFrameAnalyticsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatMlDataFrameAnalyticsResponse, TContext>>
|
||||
mlDatafeeds<TContext = unknown>(params?: T.CatMlDatafeedsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatMlDatafeedsResponse, TContext>>
|
||||
mlJobs<TContext = unknown>(params?: T.CatMlJobsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatMlJobsResponse, TContext>>
|
||||
mlTrainedModels<TContext = unknown>(params?: T.CatMlTrainedModelsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatMlTrainedModelsResponse, TContext>>
|
||||
nodeattrs<TContext = unknown>(params?: T.CatNodeattrsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatNodeattrsResponse, TContext>>
|
||||
nodes<TContext = unknown>(params?: T.CatNodesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatNodesResponse, TContext>>
|
||||
pendingTasks<TContext = unknown>(params?: T.CatPendingTasksRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatPendingTasksResponse, TContext>>
|
||||
plugins<TContext = unknown>(params?: T.CatPluginsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatPluginsResponse, TContext>>
|
||||
@ -119,35 +119,35 @@ interface KibanaClient {
|
||||
transforms<TContext = unknown>(params?: T.CatTransformsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatTransformsResponse, TContext>>
|
||||
}
|
||||
ccr: {
|
||||
deleteAutoFollowPattern<TContext = unknown>(params: T.DeleteAutoFollowPatternRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteAutoFollowPatternResponse, TContext>>
|
||||
follow<TContext = unknown>(params: T.CreateFollowIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CreateFollowIndexResponse, TContext>>
|
||||
followInfo<TContext = unknown>(params: T.FollowInfoRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.FollowInfoResponse, TContext>>
|
||||
followStats<TContext = unknown>(params: T.FollowIndexStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.FollowIndexStatsResponse, TContext>>
|
||||
forgetFollower<TContext = unknown>(params: T.ForgetFollowerIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ForgetFollowerIndexResponse, TContext>>
|
||||
getAutoFollowPattern<TContext = unknown>(params?: T.GetAutoFollowPatternRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetAutoFollowPatternResponse, TContext>>
|
||||
pauseAutoFollowPattern<TContext = unknown>(params: T.PauseAutoFollowPatternRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PauseAutoFollowPatternResponse, TContext>>
|
||||
pauseFollow<TContext = unknown>(params: T.PauseFollowIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PauseFollowIndexResponse, TContext>>
|
||||
putAutoFollowPattern<TContext = unknown>(params: T.PutAutoFollowPatternRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutAutoFollowPatternResponse, TContext>>
|
||||
resumeAutoFollowPattern<TContext = unknown>(params: T.ResumeAutoFollowPatternRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ResumeAutoFollowPatternResponse, TContext>>
|
||||
resumeFollow<TContext = unknown>(params: T.ResumeFollowIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ResumeFollowIndexResponse, TContext>>
|
||||
deleteAutoFollowPattern<TContext = unknown>(params: T.CcrDeleteAutoFollowPatternRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CcrDeleteAutoFollowPatternResponse, TContext>>
|
||||
follow<TContext = unknown>(params: T.CcrFollowRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CcrFollowResponse, TContext>>
|
||||
followInfo<TContext = unknown>(params: T.CcrFollowInfoRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CcrFollowInfoResponse, TContext>>
|
||||
followStats<TContext = unknown>(params: T.CcrFollowStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CcrFollowStatsResponse, TContext>>
|
||||
forgetFollower<TContext = unknown>(params: T.CcrForgetFollowerRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CcrForgetFollowerResponse, TContext>>
|
||||
getAutoFollowPattern<TContext = unknown>(params?: T.CcrGetAutoFollowPatternRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CcrGetAutoFollowPatternResponse, TContext>>
|
||||
pauseAutoFollowPattern<TContext = unknown>(params: T.CcrPauseAutoFollowPatternRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CcrPauseAutoFollowPatternResponse, TContext>>
|
||||
pauseFollow<TContext = unknown>(params: T.CcrPauseFollowRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CcrPauseFollowResponse, TContext>>
|
||||
putAutoFollowPattern<TContext = unknown>(params: T.CcrPutAutoFollowPatternRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CcrPutAutoFollowPatternResponse, TContext>>
|
||||
resumeAutoFollowPattern<TContext = unknown>(params: T.CcrResumeAutoFollowPatternRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CcrResumeAutoFollowPatternResponse, TContext>>
|
||||
resumeFollow<TContext = unknown>(params: T.CcrResumeFollowRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CcrResumeFollowResponse, TContext>>
|
||||
stats<TContext = unknown>(params?: T.CcrStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CcrStatsResponse, TContext>>
|
||||
unfollow<TContext = unknown>(params: T.UnfollowIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.UnfollowIndexResponse, TContext>>
|
||||
unfollow<TContext = unknown>(params: T.CcrUnfollowRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CcrUnfollowResponse, TContext>>
|
||||
}
|
||||
clearScroll<TContext = unknown>(params?: T.ClearScrollRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClearScrollResponse, TContext>>
|
||||
closePointInTime<TContext = unknown>(params?: T.ClosePointInTimeRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClosePointInTimeResponse, TContext>>
|
||||
cluster: {
|
||||
allocationExplain<TContext = unknown>(params?: T.ClusterAllocationExplainRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClusterAllocationExplainResponse, TContext>>
|
||||
deleteComponentTemplate<TContext = unknown>(params: T.ClusterDeleteComponentTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClusterDeleteComponentTemplateResponse, TContext>>
|
||||
deleteVotingConfigExclusions<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
existsComponentTemplate<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getComponentTemplate<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
deleteVotingConfigExclusions<TContext = unknown>(params?: T.ClusterDeleteVotingConfigExclusionsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClusterDeleteVotingConfigExclusionsResponse, TContext>>
|
||||
existsComponentTemplate<TContext = unknown>(params: T.ClusterExistsComponentTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClusterExistsComponentTemplateResponse, TContext>>
|
||||
getComponentTemplate<TContext = unknown>(params?: T.ClusterGetComponentTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClusterGetComponentTemplateResponse, TContext>>
|
||||
getSettings<TContext = unknown>(params?: T.ClusterGetSettingsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClusterGetSettingsResponse, TContext>>
|
||||
health<TContext = unknown>(params?: T.ClusterHealthRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClusterHealthResponse, TContext>>
|
||||
pendingTasks<TContext = unknown>(params?: T.ClusterPendingTasksRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClusterPendingTasksResponse, TContext>>
|
||||
postVotingConfigExclusions<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
putComponentTemplate<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
postVotingConfigExclusions<TContext = unknown>(params?: T.ClusterPostVotingConfigExclusionsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClusterPostVotingConfigExclusionsResponse, TContext>>
|
||||
putComponentTemplate<TContext = unknown>(params: T.ClusterPutComponentTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClusterPutComponentTemplateResponse, TContext>>
|
||||
putSettings<TContext = unknown>(params?: T.ClusterPutSettingsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClusterPutSettingsResponse, TContext>>
|
||||
remoteInfo<TContext = unknown>(params?: T.RemoteInfoRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RemoteInfoResponse, TContext>>
|
||||
remoteInfo<TContext = unknown>(params?: T.ClusterRemoteInfoRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClusterRemoteInfoResponse, TContext>>
|
||||
reroute<TContext = unknown>(params?: T.ClusterRerouteRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClusterRerouteResponse, TContext>>
|
||||
state<TContext = unknown>(params?: T.ClusterStateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClusterStateResponse, TContext>>
|
||||
stats<TContext = unknown>(params?: T.ClusterStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClusterStatsResponse, TContext>>
|
||||
@ -155,9 +155,9 @@ interface KibanaClient {
|
||||
count<TContext = unknown>(params?: T.CountRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CountResponse, TContext>>
|
||||
create<TDocument = unknown, TContext = unknown>(params: T.CreateRequest<TDocument>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CreateResponse, TContext>>
|
||||
danglingIndices: {
|
||||
deleteDanglingIndex<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
importDanglingIndex<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
listDanglingIndices<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
deleteDanglingIndex<TContext = unknown>(params: T.DanglingIndicesDeleteDanglingIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DanglingIndicesDeleteDanglingIndexResponse, TContext>>
|
||||
importDanglingIndex<TContext = unknown>(params: T.DanglingIndicesImportDanglingIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DanglingIndicesImportDanglingIndexResponse, TContext>>
|
||||
listDanglingIndices<TContext = unknown>(params?: T.DanglingIndicesListDanglingIndicesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DanglingIndicesListDanglingIndicesResponse, TContext>>
|
||||
}
|
||||
dataFrameTransformDeprecated: {
|
||||
deleteTransform<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
@ -174,10 +174,10 @@ interface KibanaClient {
|
||||
deleteByQueryRethrottle<TContext = unknown>(params: T.DeleteByQueryRethrottleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteByQueryRethrottleResponse, TContext>>
|
||||
deleteScript<TContext = unknown>(params: T.DeleteScriptRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteScriptResponse, TContext>>
|
||||
enrich: {
|
||||
deletePolicy<TContext = unknown>(params: T.DeleteEnrichPolicyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteEnrichPolicyResponse, TContext>>
|
||||
executePolicy<TContext = unknown>(params: T.ExecuteEnrichPolicyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ExecuteEnrichPolicyResponse, TContext>>
|
||||
getPolicy<TContext = unknown>(params?: T.GetEnrichPolicyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetEnrichPolicyResponse, TContext>>
|
||||
putPolicy<TContext = unknown>(params: T.PutEnrichPolicyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutEnrichPolicyResponse, TContext>>
|
||||
deletePolicy<TContext = unknown>(params: T.EnrichDeletePolicyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.EnrichDeletePolicyResponse, TContext>>
|
||||
executePolicy<TContext = unknown>(params: T.EnrichExecutePolicyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.EnrichExecutePolicyResponse, TContext>>
|
||||
getPolicy<TContext = unknown>(params?: T.EnrichGetPolicyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.EnrichGetPolicyResponse, TContext>>
|
||||
putPolicy<TContext = unknown>(params: T.EnrichPutPolicyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.EnrichPutPolicyResponse, TContext>>
|
||||
stats<TContext = unknown>(params?: T.EnrichStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.EnrichStatsResponse, TContext>>
|
||||
}
|
||||
eql: {
|
||||
@ -186,333 +186,367 @@ interface KibanaClient {
|
||||
getStatus<TContext = unknown>(params: T.EqlGetStatusRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.EqlGetStatusResponse, TContext>>
|
||||
search<TEvent = unknown, TContext = unknown>(params: T.EqlSearchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.EqlSearchResponse<TEvent>, TContext>>
|
||||
}
|
||||
exists<TContext = unknown>(params: T.DocumentExistsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DocumentExistsResponse, TContext>>
|
||||
existsSource<TContext = unknown>(params: T.SourceExistsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SourceExistsResponse, TContext>>
|
||||
exists<TContext = unknown>(params: T.ExistsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ExistsResponse, TContext>>
|
||||
existsSource<TContext = unknown>(params: T.ExistsSourceRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ExistsSourceResponse, TContext>>
|
||||
explain<TDocument = unknown, TContext = unknown>(params: T.ExplainRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ExplainResponse<TDocument>, TContext>>
|
||||
features: {
|
||||
getFeatures<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
resetFeatures<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getFeatures<TContext = unknown>(params?: T.FeaturesGetFeaturesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.FeaturesGetFeaturesResponse, TContext>>
|
||||
resetFeatures<TContext = unknown>(params?: T.FeaturesResetFeaturesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.FeaturesResetFeaturesResponse, TContext>>
|
||||
}
|
||||
fieldCaps<TContext = unknown>(params?: T.FieldCapsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.FieldCapsResponse, TContext>>
|
||||
fleet: {
|
||||
globalCheckpoints<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
msearch<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
search<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
}
|
||||
fieldCaps<TContext = unknown>(params?: T.FieldCapabilitiesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.FieldCapabilitiesResponse, TContext>>
|
||||
get<TDocument = unknown, TContext = unknown>(params: T.GetRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetResponse<TDocument>, TContext>>
|
||||
getScript<TContext = unknown>(params: T.GetScriptRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetScriptResponse, TContext>>
|
||||
getScriptContext<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getScriptLanguages<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getSource<TDocument = unknown, TContext = unknown>(params: T.SourceRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SourceResponse<TDocument>, TContext>>
|
||||
getScriptContext<TContext = unknown>(params?: T.GetScriptContextRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetScriptContextResponse, TContext>>
|
||||
getScriptLanguages<TContext = unknown>(params?: T.GetScriptLanguagesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetScriptLanguagesResponse, TContext>>
|
||||
getSource<TDocument = unknown, TContext = unknown>(params: T.GetSourceRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetSourceResponse<TDocument>, TContext>>
|
||||
graph: {
|
||||
explore<TContext = unknown>(params: T.GraphExploreRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GraphExploreResponse, TContext>>
|
||||
}
|
||||
ilm: {
|
||||
deleteLifecycle<TContext = unknown>(params: T.DeleteLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteLifecycleResponse, TContext>>
|
||||
explainLifecycle<TContext = unknown>(params: T.ExplainLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ExplainLifecycleResponse, TContext>>
|
||||
getLifecycle<TContext = unknown>(params?: T.GetLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetLifecycleResponse, TContext>>
|
||||
getStatus<TContext = unknown>(params?: T.GetIlmStatusRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetIlmStatusResponse, TContext>>
|
||||
moveToStep<TContext = unknown>(params: T.MoveToStepRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MoveToStepResponse, TContext>>
|
||||
putLifecycle<TContext = unknown>(params?: T.PutLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutLifecycleResponse, TContext>>
|
||||
removePolicy<TContext = unknown>(params: T.RemovePolicyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RemovePolicyResponse, TContext>>
|
||||
retry<TContext = unknown>(params: T.RetryIlmRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RetryIlmResponse, TContext>>
|
||||
start<TContext = unknown>(params?: T.StartIlmRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.StartIlmResponse, TContext>>
|
||||
stop<TContext = unknown>(params?: T.StopIlmRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.StopIlmResponse, TContext>>
|
||||
deleteLifecycle<TContext = unknown>(params: T.IlmDeleteLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IlmDeleteLifecycleResponse, TContext>>
|
||||
explainLifecycle<TContext = unknown>(params: T.IlmExplainLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IlmExplainLifecycleResponse, TContext>>
|
||||
getLifecycle<TContext = unknown>(params?: T.IlmGetLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IlmGetLifecycleResponse, TContext>>
|
||||
getStatus<TContext = unknown>(params?: T.IlmGetStatusRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IlmGetStatusResponse, TContext>>
|
||||
migrateToDataTiers<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
moveToStep<TContext = unknown>(params: T.IlmMoveToStepRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IlmMoveToStepResponse, TContext>>
|
||||
putLifecycle<TContext = unknown>(params: T.IlmPutLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IlmPutLifecycleResponse, TContext>>
|
||||
removePolicy<TContext = unknown>(params: T.IlmRemovePolicyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IlmRemovePolicyResponse, TContext>>
|
||||
retry<TContext = unknown>(params: T.IlmRetryRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IlmRetryResponse, TContext>>
|
||||
start<TContext = unknown>(params?: T.IlmStartRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IlmStartResponse, TContext>>
|
||||
stop<TContext = unknown>(params?: T.IlmStopRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IlmStopResponse, TContext>>
|
||||
}
|
||||
index<TDocument = unknown, TContext = unknown>(params: T.IndexRequest<TDocument>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndexResponse, TContext>>
|
||||
indices: {
|
||||
addBlock<TContext = unknown>(params: T.IndexAddBlockRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndexAddBlockResponse, TContext>>
|
||||
analyze<TContext = unknown>(params?: T.AnalyzeRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.AnalyzeResponse, TContext>>
|
||||
clearCache<TContext = unknown>(params?: T.ClearCacheRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClearCacheResponse, TContext>>
|
||||
clone<TContext = unknown>(params: T.CloneIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CloneIndexResponse, TContext>>
|
||||
close<TContext = unknown>(params: T.CloseIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CloseIndexResponse, TContext>>
|
||||
create<TContext = unknown>(params: T.CreateIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CreateIndexResponse, TContext>>
|
||||
addBlock<TContext = unknown>(params: T.IndicesAddBlockRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesAddBlockResponse, TContext>>
|
||||
analyze<TContext = unknown>(params?: T.IndicesAnalyzeRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesAnalyzeResponse, TContext>>
|
||||
clearCache<TContext = unknown>(params?: T.IndicesClearCacheRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesClearCacheResponse, TContext>>
|
||||
clone<TContext = unknown>(params: T.IndicesCloneRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesCloneResponse, TContext>>
|
||||
close<TContext = unknown>(params: T.IndicesCloseRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesCloseResponse, TContext>>
|
||||
create<TContext = unknown>(params: T.IndicesCreateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesCreateResponse, TContext>>
|
||||
createDataStream<TContext = unknown>(params: T.IndicesCreateDataStreamRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesCreateDataStreamResponse, TContext>>
|
||||
dataStreamsStats<TContext = unknown>(params?: T.IndicesDataStreamsStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesDataStreamsStatsResponse, TContext>>
|
||||
delete<TContext = unknown>(params: T.DeleteIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteIndexResponse, TContext>>
|
||||
deleteAlias<TContext = unknown>(params: T.DeleteAliasRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteAliasResponse, TContext>>
|
||||
delete<TContext = unknown>(params: T.IndicesDeleteRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesDeleteResponse, TContext>>
|
||||
deleteAlias<TContext = unknown>(params: T.IndicesDeleteAliasRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesDeleteAliasResponse, TContext>>
|
||||
deleteDataStream<TContext = unknown>(params: T.IndicesDeleteDataStreamRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesDeleteDataStreamResponse, TContext>>
|
||||
deleteIndexTemplate<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
deleteTemplate<TContext = unknown>(params: T.DeleteIndexTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteIndexTemplateResponse, TContext>>
|
||||
exists<TContext = unknown>(params: T.IndexExistsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndexExistsResponse, TContext>>
|
||||
existsAlias<TContext = unknown>(params: T.AliasExistsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.AliasExistsResponse, TContext>>
|
||||
existsIndexTemplate<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
existsTemplate<TContext = unknown>(params: T.IndexTemplateExistsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndexTemplateExistsResponse, TContext>>
|
||||
existsType<TContext = unknown>(params: T.TypeExistsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.TypeExistsResponse, TContext>>
|
||||
flush<TContext = unknown>(params?: T.FlushRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.FlushResponse, TContext>>
|
||||
flushSynced<TContext = unknown>(params?: T.SyncedFlushRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SyncedFlushResponse, TContext>>
|
||||
forcemerge<TContext = unknown>(params?: T.ForceMergeRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ForceMergeResponse, TContext>>
|
||||
freeze<TContext = unknown>(params: T.FreezeIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.FreezeIndexResponse, TContext>>
|
||||
get<TContext = unknown>(params: T.GetIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetIndexResponse, TContext>>
|
||||
getAlias<TContext = unknown>(params?: T.GetAliasRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetAliasResponse, TContext>>
|
||||
deleteIndexTemplate<TContext = unknown>(params: T.IndicesDeleteIndexTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesDeleteIndexTemplateResponse, TContext>>
|
||||
deleteTemplate<TContext = unknown>(params: T.IndicesDeleteTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesDeleteTemplateResponse, TContext>>
|
||||
diskUsage<TContext = unknown>(params: T.IndicesDiskUsageRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesDiskUsageResponse, TContext>>
|
||||
exists<TContext = unknown>(params: T.IndicesExistsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesExistsResponse, TContext>>
|
||||
existsAlias<TContext = unknown>(params: T.IndicesExistsAliasRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesExistsAliasResponse, TContext>>
|
||||
existsIndexTemplate<TContext = unknown>(params: T.IndicesExistsIndexTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesExistsIndexTemplateResponse, TContext>>
|
||||
existsTemplate<TContext = unknown>(params: T.IndicesExistsTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesExistsTemplateResponse, TContext>>
|
||||
existsType<TContext = unknown>(params: T.IndicesExistsTypeRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesExistsTypeResponse, TContext>>
|
||||
fieldUsageStats<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
flush<TContext = unknown>(params?: T.IndicesFlushRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesFlushResponse, TContext>>
|
||||
flushSynced<TContext = unknown>(params?: T.IndicesFlushSyncedRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesFlushSyncedResponse, TContext>>
|
||||
forcemerge<TContext = unknown>(params?: T.IndicesForcemergeRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesForcemergeResponse, TContext>>
|
||||
freeze<TContext = unknown>(params: T.IndicesFreezeRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesFreezeResponse, TContext>>
|
||||
get<TContext = unknown>(params: T.IndicesGetRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesGetResponse, TContext>>
|
||||
getAlias<TContext = unknown>(params?: T.IndicesGetAliasRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesGetAliasResponse, TContext>>
|
||||
getDataStream<TContext = unknown>(params?: T.IndicesGetDataStreamRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesGetDataStreamResponse, TContext>>
|
||||
getFieldMapping<TContext = unknown>(params: T.GetFieldMappingRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetFieldMappingResponse, TContext>>
|
||||
getIndexTemplate<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getMapping<TContext = unknown>(params?: T.GetMappingRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetMappingResponse, TContext>>
|
||||
getSettings<TContext = unknown>(params?: T.GetIndexSettingsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetIndexSettingsResponse, TContext>>
|
||||
getTemplate<TContext = unknown>(params?: T.GetIndexTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetIndexTemplateResponse, TContext>>
|
||||
getUpgrade<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getFieldMapping<TContext = unknown>(params: T.IndicesGetFieldMappingRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesGetFieldMappingResponse, TContext>>
|
||||
getIndexTemplate<TContext = unknown>(params?: T.IndicesGetIndexTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesGetIndexTemplateResponse, TContext>>
|
||||
getMapping<TContext = unknown>(params?: T.IndicesGetMappingRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesGetMappingResponse, TContext>>
|
||||
getSettings<TContext = unknown>(params?: T.IndicesGetSettingsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesGetSettingsResponse, TContext>>
|
||||
getTemplate<TContext = unknown>(params?: T.IndicesGetTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesGetTemplateResponse, TContext>>
|
||||
getUpgrade<TContext = unknown>(params?: T.IndicesGetUpgradeRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesGetUpgradeResponse, TContext>>
|
||||
migrateToDataStream<TContext = unknown>(params: T.IndicesMigrateToDataStreamRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesMigrateToDataStreamResponse, TContext>>
|
||||
open<TContext = unknown>(params: T.OpenIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.OpenIndexResponse, TContext>>
|
||||
promoteDataStream<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
putAlias<TContext = unknown>(params: T.PutAliasRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutAliasResponse, TContext>>
|
||||
putIndexTemplate<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
putMapping<TContext = unknown>(params?: T.PutMappingRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutMappingResponse, TContext>>
|
||||
putSettings<TContext = unknown>(params?: T.UpdateIndexSettingsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.UpdateIndexSettingsResponse, TContext>>
|
||||
putTemplate<TContext = unknown>(params: T.PutIndexTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutIndexTemplateResponse, TContext>>
|
||||
recovery<TContext = unknown>(params?: T.RecoveryStatusRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RecoveryStatusResponse, TContext>>
|
||||
refresh<TContext = unknown>(params?: T.RefreshRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RefreshResponse, TContext>>
|
||||
reloadSearchAnalyzers<TContext = unknown>(params: T.ReloadSearchAnalyzersRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ReloadSearchAnalyzersResponse, TContext>>
|
||||
resolveIndex<TContext = unknown>(params: T.ResolveIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ResolveIndexResponse, TContext>>
|
||||
rollover<TContext = unknown>(params: T.RolloverIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RolloverIndexResponse, TContext>>
|
||||
segments<TContext = unknown>(params?: T.SegmentsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SegmentsResponse, TContext>>
|
||||
modifyDataStream<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
open<TContext = unknown>(params: T.IndicesOpenRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesOpenResponse, TContext>>
|
||||
promoteDataStream<TContext = unknown>(params: T.IndicesPromoteDataStreamRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesPromoteDataStreamResponse, TContext>>
|
||||
putAlias<TContext = unknown>(params: T.IndicesPutAliasRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesPutAliasResponse, TContext>>
|
||||
putIndexTemplate<TContext = unknown>(params: T.IndicesPutIndexTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesPutIndexTemplateResponse, TContext>>
|
||||
putMapping<TContext = unknown>(params: T.IndicesPutMappingRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesPutMappingResponse, TContext>>
|
||||
putSettings<TContext = unknown>(params?: T.IndicesPutSettingsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesPutSettingsResponse, TContext>>
|
||||
putTemplate<TContext = unknown>(params: T.IndicesPutTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesPutTemplateResponse, TContext>>
|
||||
recovery<TContext = unknown>(params?: T.IndicesRecoveryRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesRecoveryResponse, TContext>>
|
||||
refresh<TContext = unknown>(params?: T.IndicesRefreshRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesRefreshResponse, TContext>>
|
||||
reloadSearchAnalyzers<TContext = unknown>(params: T.IndicesReloadSearchAnalyzersRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesReloadSearchAnalyzersResponse, TContext>>
|
||||
resolveIndex<TContext = unknown>(params: T.IndicesResolveIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesResolveIndexResponse, TContext>>
|
||||
rollover<TContext = unknown>(params: T.IndicesRolloverRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesRolloverResponse, TContext>>
|
||||
segments<TContext = unknown>(params?: T.IndicesSegmentsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesSegmentsResponse, TContext>>
|
||||
shardStores<TContext = unknown>(params?: T.IndicesShardStoresRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesShardStoresResponse, TContext>>
|
||||
shrink<TContext = unknown>(params: T.ShrinkIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ShrinkIndexResponse, TContext>>
|
||||
simulateIndexTemplate<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
simulateTemplate<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
split<TContext = unknown>(params: T.SplitIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SplitIndexResponse, TContext>>
|
||||
shrink<TContext = unknown>(params: T.IndicesShrinkRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesShrinkResponse, TContext>>
|
||||
simulateIndexTemplate<TContext = unknown>(params: T.IndicesSimulateIndexTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesSimulateIndexTemplateResponse, TContext>>
|
||||
simulateTemplate<TContext = unknown>(params?: T.IndicesSimulateTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesSimulateTemplateResponse, TContext>>
|
||||
split<TContext = unknown>(params: T.IndicesSplitRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesSplitResponse, TContext>>
|
||||
stats<TContext = unknown>(params?: T.IndicesStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesStatsResponse, TContext>>
|
||||
unfreeze<TContext = unknown>(params: T.UnfreezeIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.UnfreezeIndexResponse, TContext>>
|
||||
updateAliases<TContext = unknown>(params?: T.BulkAliasRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.BulkAliasResponse, TContext>>
|
||||
upgrade<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
validateQuery<TContext = unknown>(params?: T.ValidateQueryRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ValidateQueryResponse, TContext>>
|
||||
unfreeze<TContext = unknown>(params: T.IndicesUnfreezeRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesUnfreezeResponse, TContext>>
|
||||
updateAliases<TContext = unknown>(params?: T.IndicesUpdateAliasesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesUpdateAliasesResponse, TContext>>
|
||||
upgrade<TContext = unknown>(params?: T.IndicesUpgradeRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesUpgradeResponse, TContext>>
|
||||
validateQuery<TContext = unknown>(params?: T.IndicesValidateQueryRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesValidateQueryResponse, TContext>>
|
||||
}
|
||||
info<TContext = unknown>(params?: T.RootNodeInfoRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RootNodeInfoResponse, TContext>>
|
||||
info<TContext = unknown>(params?: T.InfoRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.InfoResponse, TContext>>
|
||||
ingest: {
|
||||
deletePipeline<TContext = unknown>(params: T.DeletePipelineRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeletePipelineResponse, TContext>>
|
||||
geoIpStats<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getPipeline<TContext = unknown>(params?: T.GetPipelineRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetPipelineResponse, TContext>>
|
||||
processorGrok<TContext = unknown>(params?: T.GrokProcessorPatternsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GrokProcessorPatternsResponse, TContext>>
|
||||
putPipeline<TContext = unknown>(params: T.PutPipelineRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutPipelineResponse, TContext>>
|
||||
simulate<TContext = unknown>(params?: T.SimulatePipelineRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SimulatePipelineResponse, TContext>>
|
||||
deletePipeline<TContext = unknown>(params: T.IngestDeletePipelineRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IngestDeletePipelineResponse, TContext>>
|
||||
geoIpStats<TContext = unknown>(params?: T.IngestGeoIpStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IngestGeoIpStatsResponse, TContext>>
|
||||
getPipeline<TContext = unknown>(params?: T.IngestGetPipelineRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IngestGetPipelineResponse, TContext>>
|
||||
processorGrok<TContext = unknown>(params?: T.IngestProcessorGrokRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IngestProcessorGrokResponse, TContext>>
|
||||
putPipeline<TContext = unknown>(params: T.IngestPutPipelineRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IngestPutPipelineResponse, TContext>>
|
||||
simulate<TContext = unknown>(params?: T.IngestSimulateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IngestSimulateResponse, TContext>>
|
||||
}
|
||||
license: {
|
||||
delete<TContext = unknown>(params?: T.DeleteLicenseRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteLicenseResponse, TContext>>
|
||||
get<TContext = unknown>(params?: T.GetLicenseRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetLicenseResponse, TContext>>
|
||||
getBasicStatus<TContext = unknown>(params?: T.GetBasicLicenseStatusRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetBasicLicenseStatusResponse, TContext>>
|
||||
getTrialStatus<TContext = unknown>(params?: T.GetTrialLicenseStatusRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetTrialLicenseStatusResponse, TContext>>
|
||||
post<TContext = unknown>(params?: T.PostLicenseRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PostLicenseResponse, TContext>>
|
||||
postStartBasic<TContext = unknown>(params?: T.StartBasicLicenseRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.StartBasicLicenseResponse, TContext>>
|
||||
postStartTrial<TContext = unknown>(params?: T.StartTrialLicenseRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.StartTrialLicenseResponse, TContext>>
|
||||
delete<TContext = unknown>(params?: T.LicenseDeleteRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.LicenseDeleteResponse, TContext>>
|
||||
get<TContext = unknown>(params?: T.LicenseGetRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.LicenseGetResponse, TContext>>
|
||||
getBasicStatus<TContext = unknown>(params?: T.LicenseGetBasicStatusRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.LicenseGetBasicStatusResponse, TContext>>
|
||||
getTrialStatus<TContext = unknown>(params?: T.LicenseGetTrialStatusRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.LicenseGetTrialStatusResponse, TContext>>
|
||||
post<TContext = unknown>(params?: T.LicensePostRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.LicensePostResponse, TContext>>
|
||||
postStartBasic<TContext = unknown>(params?: T.LicensePostStartBasicRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.LicensePostStartBasicResponse, TContext>>
|
||||
postStartTrial<TContext = unknown>(params?: T.LicensePostStartTrialRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.LicensePostStartTrialResponse, TContext>>
|
||||
}
|
||||
logstash: {
|
||||
deletePipeline<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getPipeline<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
putPipeline<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
deletePipeline<TContext = unknown>(params: T.LogstashDeletePipelineRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.LogstashDeletePipelineResponse, TContext>>
|
||||
getPipeline<TContext = unknown>(params: T.LogstashGetPipelineRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.LogstashGetPipelineResponse, TContext>>
|
||||
putPipeline<TContext = unknown>(params: T.LogstashPutPipelineRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.LogstashPutPipelineResponse, TContext>>
|
||||
}
|
||||
mget<TDocument = unknown, TContext = unknown>(params?: T.MultiGetRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MultiGetResponse<TDocument>, TContext>>
|
||||
mget<TDocument = unknown, TContext = unknown>(params?: T.MgetRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MgetResponse<TDocument>, TContext>>
|
||||
migration: {
|
||||
deprecations<TContext = unknown>(params?: T.DeprecationInfoRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeprecationInfoResponse, TContext>>
|
||||
deprecations<TContext = unknown>(params?: T.MigrationDeprecationsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MigrationDeprecationsResponse, TContext>>
|
||||
getFeatureUpgradeStatus<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
postFeatureUpgrade<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
}
|
||||
ml: {
|
||||
closeJob<TContext = unknown>(params: T.CloseJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CloseJobResponse, TContext>>
|
||||
deleteCalendar<TContext = unknown>(params: T.DeleteCalendarRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteCalendarResponse, TContext>>
|
||||
deleteCalendarEvent<TContext = unknown>(params: T.DeleteCalendarEventRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteCalendarEventResponse, TContext>>
|
||||
deleteCalendarJob<TContext = unknown>(params: T.DeleteCalendarJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteCalendarJobResponse, TContext>>
|
||||
deleteDataFrameAnalytics<TContext = unknown>(params: T.DeleteDataFrameAnalyticsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteDataFrameAnalyticsResponse, TContext>>
|
||||
deleteDatafeed<TContext = unknown>(params: T.DeleteDatafeedRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteDatafeedResponse, TContext>>
|
||||
deleteExpiredData<TContext = unknown>(params?: T.DeleteExpiredDataRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteExpiredDataResponse, TContext>>
|
||||
deleteFilter<TContext = unknown>(params: T.DeleteFilterRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteFilterResponse, TContext>>
|
||||
deleteForecast<TContext = unknown>(params: T.DeleteForecastRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteForecastResponse, TContext>>
|
||||
deleteJob<TContext = unknown>(params: T.DeleteJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteJobResponse, TContext>>
|
||||
deleteModelSnapshot<TContext = unknown>(params: T.DeleteModelSnapshotRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteModelSnapshotResponse, TContext>>
|
||||
deleteTrainedModel<TContext = unknown>(params: T.DeleteTrainedModelRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteTrainedModelResponse, TContext>>
|
||||
deleteTrainedModelAlias<TContext = unknown>(params: T.DeleteTrainedModelAliasRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteTrainedModelAliasResponse, TContext>>
|
||||
estimateModelMemory<TContext = unknown>(params?: T.EstimateModelMemoryRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.EstimateModelMemoryResponse, TContext>>
|
||||
evaluateDataFrame<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
explainDataFrameAnalytics<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
closeJob<TContext = unknown>(params: T.MlCloseJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlCloseJobResponse, TContext>>
|
||||
deleteCalendar<TContext = unknown>(params: T.MlDeleteCalendarRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlDeleteCalendarResponse, TContext>>
|
||||
deleteCalendarEvent<TContext = unknown>(params: T.MlDeleteCalendarEventRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlDeleteCalendarEventResponse, TContext>>
|
||||
deleteCalendarJob<TContext = unknown>(params: T.MlDeleteCalendarJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlDeleteCalendarJobResponse, TContext>>
|
||||
deleteDataFrameAnalytics<TContext = unknown>(params: T.MlDeleteDataFrameAnalyticsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlDeleteDataFrameAnalyticsResponse, TContext>>
|
||||
deleteDatafeed<TContext = unknown>(params: T.MlDeleteDatafeedRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlDeleteDatafeedResponse, TContext>>
|
||||
deleteExpiredData<TContext = unknown>(params?: T.MlDeleteExpiredDataRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlDeleteExpiredDataResponse, TContext>>
|
||||
deleteFilter<TContext = unknown>(params: T.MlDeleteFilterRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlDeleteFilterResponse, TContext>>
|
||||
deleteForecast<TContext = unknown>(params: T.MlDeleteForecastRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlDeleteForecastResponse, TContext>>
|
||||
deleteJob<TContext = unknown>(params: T.MlDeleteJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlDeleteJobResponse, TContext>>
|
||||
deleteModelSnapshot<TContext = unknown>(params: T.MlDeleteModelSnapshotRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlDeleteModelSnapshotResponse, TContext>>
|
||||
deleteTrainedModel<TContext = unknown>(params: T.MlDeleteTrainedModelRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlDeleteTrainedModelResponse, TContext>>
|
||||
deleteTrainedModelAlias<TContext = unknown>(params: T.MlDeleteTrainedModelAliasRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlDeleteTrainedModelAliasResponse, TContext>>
|
||||
estimateModelMemory<TContext = unknown>(params?: T.MlEstimateModelMemoryRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlEstimateModelMemoryResponse, TContext>>
|
||||
evaluateDataFrame<TContext = unknown>(params?: T.MlEvaluateDataFrameRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlEvaluateDataFrameResponse, TContext>>
|
||||
explainDataFrameAnalytics<TContext = unknown>(params?: T.MlExplainDataFrameAnalyticsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlExplainDataFrameAnalyticsResponse, TContext>>
|
||||
findFileStructure<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
flushJob<TContext = unknown>(params: T.FlushJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.FlushJobResponse, TContext>>
|
||||
forecast<TContext = unknown>(params: T.ForecastJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ForecastJobResponse, TContext>>
|
||||
getBuckets<TContext = unknown>(params: T.GetBucketsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetBucketsResponse, TContext>>
|
||||
getCalendarEvents<TContext = unknown>(params: T.GetCalendarEventsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetCalendarEventsResponse, TContext>>
|
||||
getCalendars<TContext = unknown>(params?: T.GetCalendarsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetCalendarsResponse, TContext>>
|
||||
getCategories<TContext = unknown>(params: T.GetCategoriesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetCategoriesResponse, TContext>>
|
||||
getDataFrameAnalytics<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getDataFrameAnalyticsStats<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getDatafeedStats<TContext = unknown>(params?: T.GetDatafeedStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetDatafeedStatsResponse, TContext>>
|
||||
getDatafeeds<TContext = unknown>(params?: T.GetDatafeedsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetDatafeedsResponse, TContext>>
|
||||
getFilters<TContext = unknown>(params?: T.GetFiltersRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetFiltersResponse, TContext>>
|
||||
getInfluencers<TContext = unknown>(params: T.GetInfluencersRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetInfluencersResponse, TContext>>
|
||||
getJobStats<TContext = unknown>(params?: T.GetJobStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetJobStatsResponse, TContext>>
|
||||
getJobs<TContext = unknown>(params?: T.GetJobsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetJobsResponse, TContext>>
|
||||
getModelSnapshots<TContext = unknown>(params: T.GetModelSnapshotsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetModelSnapshotsResponse, TContext>>
|
||||
getOverallBuckets<TContext = unknown>(params: T.GetOverallBucketsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetOverallBucketsResponse, TContext>>
|
||||
getRecords<TContext = unknown>(params: T.GetAnomalyRecordsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetAnomalyRecordsResponse, TContext>>
|
||||
getTrainedModels<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getTrainedModelsStats<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
info<TContext = unknown>(params?: T.MachineLearningInfoRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MachineLearningInfoResponse, TContext>>
|
||||
openJob<TContext = unknown>(params: T.OpenJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.OpenJobResponse, TContext>>
|
||||
postCalendarEvents<TContext = unknown>(params: T.PostCalendarEventsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PostCalendarEventsResponse, TContext>>
|
||||
postData<TContext = unknown>(params: T.PostJobDataRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PostJobDataResponse, TContext>>
|
||||
previewDataFrameAnalytics<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
previewDatafeed<TDocument = unknown, TContext = unknown>(params: T.PreviewDatafeedRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PreviewDatafeedResponse<TDocument>, TContext>>
|
||||
putCalendar<TContext = unknown>(params: T.PutCalendarRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutCalendarResponse, TContext>>
|
||||
putCalendarJob<TContext = unknown>(params: T.PutCalendarJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutCalendarJobResponse, TContext>>
|
||||
putDataFrameAnalytics<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
putDatafeed<TContext = unknown>(params: T.PutDatafeedRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutDatafeedResponse, TContext>>
|
||||
putFilter<TContext = unknown>(params: T.PutFilterRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutFilterResponse, TContext>>
|
||||
putJob<TContext = unknown>(params: T.PutJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutJobResponse, TContext>>
|
||||
putTrainedModel<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
putTrainedModelAlias<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
revertModelSnapshot<TContext = unknown>(params: T.RevertModelSnapshotRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RevertModelSnapshotResponse, TContext>>
|
||||
setUpgradeMode<TContext = unknown>(params?: T.SetUpgradeModeRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SetUpgradeModeResponse, TContext>>
|
||||
startDataFrameAnalytics<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
startDatafeed<TContext = unknown>(params: T.StartDatafeedRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.StartDatafeedResponse, TContext>>
|
||||
stopDataFrameAnalytics<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
stopDatafeed<TContext = unknown>(params: T.StopDatafeedRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.StopDatafeedResponse, TContext>>
|
||||
updateDataFrameAnalytics<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
updateDatafeed<TContext = unknown>(params: T.UpdateDatafeedRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.UpdateDatafeedResponse, TContext>>
|
||||
updateFilter<TContext = unknown>(params: T.UpdateFilterRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.UpdateFilterResponse, TContext>>
|
||||
updateJob<TContext = unknown>(params: T.UpdateJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.UpdateJobResponse, TContext>>
|
||||
updateModelSnapshot<TContext = unknown>(params: T.UpdateModelSnapshotRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.UpdateModelSnapshotResponse, TContext>>
|
||||
upgradeJobSnapshot<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
validate<TContext = unknown>(params?: T.ValidateJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ValidateJobResponse, TContext>>
|
||||
validateDetector<TContext = unknown>(params?: T.ValidateDetectorRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ValidateDetectorResponse, TContext>>
|
||||
flushJob<TContext = unknown>(params: T.MlFlushJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlFlushJobResponse, TContext>>
|
||||
forecast<TContext = unknown>(params: T.MlForecastRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlForecastResponse, TContext>>
|
||||
getBuckets<TContext = unknown>(params: T.MlGetBucketsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlGetBucketsResponse, TContext>>
|
||||
getCalendarEvents<TContext = unknown>(params: T.MlGetCalendarEventsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlGetCalendarEventsResponse, TContext>>
|
||||
getCalendars<TContext = unknown>(params?: T.MlGetCalendarsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlGetCalendarsResponse, TContext>>
|
||||
getCategories<TContext = unknown>(params: T.MlGetCategoriesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlGetCategoriesResponse, TContext>>
|
||||
getDataFrameAnalytics<TContext = unknown>(params?: T.MlGetDataFrameAnalyticsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlGetDataFrameAnalyticsResponse, TContext>>
|
||||
getDataFrameAnalyticsStats<TContext = unknown>(params?: T.MlGetDataFrameAnalyticsStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlGetDataFrameAnalyticsStatsResponse, TContext>>
|
||||
getDatafeedStats<TContext = unknown>(params?: T.MlGetDatafeedStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlGetDatafeedStatsResponse, TContext>>
|
||||
getDatafeeds<TContext = unknown>(params?: T.MlGetDatafeedsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlGetDatafeedsResponse, TContext>>
|
||||
getFilters<TContext = unknown>(params?: T.MlGetFiltersRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlGetFiltersResponse, TContext>>
|
||||
getInfluencers<TContext = unknown>(params: T.MlGetInfluencersRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlGetInfluencersResponse, TContext>>
|
||||
getJobStats<TContext = unknown>(params?: T.MlGetJobStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlGetJobStatsResponse, TContext>>
|
||||
getJobs<TContext = unknown>(params?: T.MlGetJobsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlGetJobsResponse, TContext>>
|
||||
getModelSnapshots<TContext = unknown>(params: T.MlGetModelSnapshotsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlGetModelSnapshotsResponse, TContext>>
|
||||
getOverallBuckets<TContext = unknown>(params: T.MlGetOverallBucketsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlGetOverallBucketsResponse, TContext>>
|
||||
getRecords<TContext = unknown>(params: T.MlGetRecordsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlGetRecordsResponse, TContext>>
|
||||
getTrainedModels<TContext = unknown>(params?: T.MlGetTrainedModelsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlGetTrainedModelsResponse, TContext>>
|
||||
getTrainedModelsStats<TContext = unknown>(params?: T.MlGetTrainedModelsStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlGetTrainedModelsStatsResponse, TContext>>
|
||||
info<TContext = unknown>(params?: T.MlInfoRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlInfoResponse, TContext>>
|
||||
openJob<TContext = unknown>(params: T.MlOpenJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlOpenJobResponse, TContext>>
|
||||
postCalendarEvents<TContext = unknown>(params: T.MlPostCalendarEventsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlPostCalendarEventsResponse, TContext>>
|
||||
postData<TData = unknown, TContext = unknown>(params: T.MlPostDataRequest<TData>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlPostDataResponse, TContext>>
|
||||
previewDataFrameAnalytics<TContext = unknown>(params?: T.MlPreviewDataFrameAnalyticsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlPreviewDataFrameAnalyticsResponse, TContext>>
|
||||
previewDatafeed<TDocument = unknown, TContext = unknown>(params?: T.MlPreviewDatafeedRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlPreviewDatafeedResponse<TDocument>, TContext>>
|
||||
putCalendar<TContext = unknown>(params: T.MlPutCalendarRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlPutCalendarResponse, TContext>>
|
||||
putCalendarJob<TContext = unknown>(params: T.MlPutCalendarJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlPutCalendarJobResponse, TContext>>
|
||||
putDataFrameAnalytics<TContext = unknown>(params: T.MlPutDataFrameAnalyticsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlPutDataFrameAnalyticsResponse, TContext>>
|
||||
putDatafeed<TContext = unknown>(params: T.MlPutDatafeedRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlPutDatafeedResponse, TContext>>
|
||||
putFilter<TContext = unknown>(params: T.MlPutFilterRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlPutFilterResponse, TContext>>
|
||||
putJob<TContext = unknown>(params: T.MlPutJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlPutJobResponse, TContext>>
|
||||
putTrainedModel<TContext = unknown>(params: T.MlPutTrainedModelRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlPutTrainedModelResponse, TContext>>
|
||||
putTrainedModelAlias<TContext = unknown>(params: T.MlPutTrainedModelAliasRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlPutTrainedModelAliasResponse, TContext>>
|
||||
resetJob<TContext = unknown>(params: T.MlResetJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlResetJobResponse, TContext>>
|
||||
revertModelSnapshot<TContext = unknown>(params: T.MlRevertModelSnapshotRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlRevertModelSnapshotResponse, TContext>>
|
||||
setUpgradeMode<TContext = unknown>(params?: T.MlSetUpgradeModeRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlSetUpgradeModeResponse, TContext>>
|
||||
startDataFrameAnalytics<TContext = unknown>(params: T.MlStartDataFrameAnalyticsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlStartDataFrameAnalyticsResponse, TContext>>
|
||||
startDatafeed<TContext = unknown>(params: T.MlStartDatafeedRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlStartDatafeedResponse, TContext>>
|
||||
stopDataFrameAnalytics<TContext = unknown>(params: T.MlStopDataFrameAnalyticsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlStopDataFrameAnalyticsResponse, TContext>>
|
||||
stopDatafeed<TContext = unknown>(params: T.MlStopDatafeedRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlStopDatafeedResponse, TContext>>
|
||||
updateDataFrameAnalytics<TContext = unknown>(params: T.MlUpdateDataFrameAnalyticsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlUpdateDataFrameAnalyticsResponse, TContext>>
|
||||
updateDatafeed<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
updateFilter<TContext = unknown>(params: T.MlUpdateFilterRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlUpdateFilterResponse, TContext>>
|
||||
updateJob<TContext = unknown>(params: T.MlUpdateJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlUpdateJobResponse, TContext>>
|
||||
updateModelSnapshot<TContext = unknown>(params: T.MlUpdateModelSnapshotRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlUpdateModelSnapshotResponse, TContext>>
|
||||
upgradeJobSnapshot<TContext = unknown>(params: T.MlUpgradeJobSnapshotRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlUpgradeJobSnapshotResponse, TContext>>
|
||||
validate<TContext = unknown>(params?: T.MlValidateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlValidateResponse, TContext>>
|
||||
validateDetector<TContext = unknown>(params?: T.MlValidateDetectorRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlValidateDetectorResponse, TContext>>
|
||||
}
|
||||
monitoring: {
|
||||
bulk<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
bulk<TSource = unknown, TContext = unknown>(params: T.MonitoringBulkRequest<TSource>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MonitoringBulkResponse, TContext>>
|
||||
}
|
||||
msearch<TDocument = unknown, TContext = unknown>(params?: T.MultiSearchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MultiSearchResponse<TDocument>, TContext>>
|
||||
msearchTemplate<TContext = unknown>(params?: T.MultiSearchTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MultiSearchTemplateResponse, TContext>>
|
||||
mtermvectors<TContext = unknown>(params?: T.MultiTermVectorsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MultiTermVectorsResponse, TContext>>
|
||||
msearch<TDocument = unknown, TContext = unknown>(params?: T.MsearchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MsearchResponse<TDocument>, TContext>>
|
||||
msearchTemplate<TDocument = unknown, TContext = unknown>(params?: T.MsearchTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MsearchTemplateResponse<TDocument>, TContext>>
|
||||
mtermvectors<TContext = unknown>(params?: T.MtermvectorsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MtermvectorsResponse, TContext>>
|
||||
nodes: {
|
||||
clearRepositoriesMeteringArchive<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getRepositoriesMeteringInfo<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
hotThreads<TContext = unknown>(params?: T.NodesHotThreadsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.NodesHotThreadsResponse, TContext>>
|
||||
info<TContext = unknown>(params?: T.NodesInfoRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.NodesInfoResponse, TContext>>
|
||||
reloadSecureSettings<TContext = unknown>(params?: T.ReloadSecureSettingsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ReloadSecureSettingsResponse, TContext>>
|
||||
reloadSecureSettings<TContext = unknown>(params?: T.NodesReloadSecureSettingsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.NodesReloadSecureSettingsResponse, TContext>>
|
||||
stats<TContext = unknown>(params?: T.NodesStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.NodesStatsResponse, TContext>>
|
||||
usage<TContext = unknown>(params?: T.NodesUsageRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.NodesUsageResponse, TContext>>
|
||||
}
|
||||
openPointInTime<TContext = unknown>(params: T.OpenPointInTimeRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.OpenPointInTimeResponse, TContext>>
|
||||
ping<TContext = unknown>(params?: T.PingRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PingResponse, TContext>>
|
||||
putScript<TContext = unknown>(params: T.PutScriptRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutScriptResponse, TContext>>
|
||||
rankEval<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
rankEval<TContext = unknown>(params: T.RankEvalRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RankEvalResponse, TContext>>
|
||||
reindex<TContext = unknown>(params?: T.ReindexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ReindexResponse, TContext>>
|
||||
reindexRethrottle<TContext = unknown>(params: T.ReindexRethrottleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ReindexRethrottleResponse, TContext>>
|
||||
renderSearchTemplate<TContext = unknown>(params?: T.RenderSearchTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RenderSearchTemplateResponse, TContext>>
|
||||
rollup: {
|
||||
deleteJob<TContext = unknown>(params: T.DeleteRollupJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteRollupJobResponse, TContext>>
|
||||
getJobs<TContext = unknown>(params?: T.GetRollupJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetRollupJobResponse, TContext>>
|
||||
getRollupCaps<TContext = unknown>(params?: T.GetRollupCapabilitiesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetRollupCapabilitiesResponse, TContext>>
|
||||
getRollupIndexCaps<TContext = unknown>(params: T.GetRollupIndexCapabilitiesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetRollupIndexCapabilitiesResponse, TContext>>
|
||||
putJob<TContext = unknown>(params: T.CreateRollupJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CreateRollupJobResponse, TContext>>
|
||||
rollup<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
rollupSearch<TDocument = unknown, TContext = unknown>(params: T.RollupSearchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RollupSearchResponse<TDocument>, TContext>>
|
||||
startJob<TContext = unknown>(params: T.StartRollupJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.StartRollupJobResponse, TContext>>
|
||||
stopJob<TContext = unknown>(params: T.StopRollupJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.StopRollupJobResponse, TContext>>
|
||||
deleteJob<TContext = unknown>(params: T.RollupDeleteJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RollupDeleteJobResponse, TContext>>
|
||||
getJobs<TContext = unknown>(params?: T.RollupGetJobsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RollupGetJobsResponse, TContext>>
|
||||
getRollupCaps<TContext = unknown>(params?: T.RollupGetRollupCapsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RollupGetRollupCapsResponse, TContext>>
|
||||
getRollupIndexCaps<TContext = unknown>(params: T.RollupGetRollupIndexCapsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RollupGetRollupIndexCapsResponse, TContext>>
|
||||
putJob<TContext = unknown>(params: T.RollupPutJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RollupPutJobResponse, TContext>>
|
||||
rollup<TContext = unknown>(params: T.RollupRollupRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RollupRollupResponse, TContext>>
|
||||
rollupSearch<TDocument = unknown, TContext = unknown>(params: T.RollupRollupSearchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RollupRollupSearchResponse<TDocument>, TContext>>
|
||||
startJob<TContext = unknown>(params: T.RollupStartJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RollupStartJobResponse, TContext>>
|
||||
stopJob<TContext = unknown>(params: T.RollupStopJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RollupStopJobResponse, TContext>>
|
||||
}
|
||||
scriptsPainlessExecute<TResult = unknown, TContext = unknown>(params?: T.ExecutePainlessScriptRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ExecutePainlessScriptResponse<TResult>, TContext>>
|
||||
scriptsPainlessExecute<TResult = unknown, TContext = unknown>(params?: T.ScriptsPainlessExecuteRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ScriptsPainlessExecuteResponse<TResult>, TContext>>
|
||||
scroll<TDocument = unknown, TContext = unknown>(params?: T.ScrollRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ScrollResponse<TDocument>, TContext>>
|
||||
search<TDocument = unknown, TContext = unknown>(params?: T.SearchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SearchResponse<TDocument>, TContext>>
|
||||
searchMvt<TContext = unknown>(params: T.SearchMvtRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SearchMvtResponse, TContext>>
|
||||
searchShards<TContext = unknown>(params?: T.SearchShardsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SearchShardsResponse, TContext>>
|
||||
searchTemplate<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
searchTemplate<TDocument = unknown, TContext = unknown>(params?: T.SearchTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SearchTemplateResponse<TDocument>, TContext>>
|
||||
searchableSnapshots: {
|
||||
clearCache<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
cacheStats<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
clearCache<TContext = unknown>(params?: T.SearchableSnapshotsClearCacheRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SearchableSnapshotsClearCacheResponse, TContext>>
|
||||
mount<TContext = unknown>(params: T.SearchableSnapshotsMountRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SearchableSnapshotsMountResponse, TContext>>
|
||||
repositoryStats<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
stats<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
stats<TContext = unknown>(params?: T.SearchableSnapshotsStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SearchableSnapshotsStatsResponse, TContext>>
|
||||
}
|
||||
security: {
|
||||
authenticate<TContext = unknown>(params?: T.AuthenticateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.AuthenticateResponse, TContext>>
|
||||
changePassword<TContext = unknown>(params?: T.ChangePasswordRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ChangePasswordResponse, TContext>>
|
||||
clearApiKeyCache<TContext = unknown>(params?: T.ClearApiKeyCacheRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClearApiKeyCacheResponse, TContext>>
|
||||
clearCachedPrivileges<TContext = unknown>(params: T.ClearCachedPrivilegesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClearCachedPrivilegesResponse, TContext>>
|
||||
clearCachedRealms<TContext = unknown>(params: T.ClearCachedRealmsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClearCachedRealmsResponse, TContext>>
|
||||
clearCachedRoles<TContext = unknown>(params: T.ClearCachedRolesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClearCachedRolesResponse, TContext>>
|
||||
createApiKey<TContext = unknown>(params?: T.CreateApiKeyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CreateApiKeyResponse, TContext>>
|
||||
deletePrivileges<TContext = unknown>(params: T.DeletePrivilegesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeletePrivilegesResponse, TContext>>
|
||||
deleteRole<TContext = unknown>(params: T.DeleteRoleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteRoleResponse, TContext>>
|
||||
deleteRoleMapping<TContext = unknown>(params: T.DeleteRoleMappingRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteRoleMappingResponse, TContext>>
|
||||
deleteUser<TContext = unknown>(params: T.DeleteUserRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteUserResponse, TContext>>
|
||||
disableUser<TContext = unknown>(params: T.DisableUserRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DisableUserResponse, TContext>>
|
||||
enableUser<TContext = unknown>(params: T.EnableUserRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.EnableUserResponse, TContext>>
|
||||
getApiKey<TContext = unknown>(params?: T.GetApiKeyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetApiKeyResponse, TContext>>
|
||||
getBuiltinPrivileges<TContext = unknown>(params?: T.GetBuiltinPrivilegesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetBuiltinPrivilegesResponse, TContext>>
|
||||
getPrivileges<TContext = unknown>(params?: T.GetPrivilegesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetPrivilegesResponse, TContext>>
|
||||
getRole<TContext = unknown>(params?: T.GetRoleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetRoleResponse, TContext>>
|
||||
getRoleMapping<TContext = unknown>(params?: T.GetRoleMappingRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetRoleMappingResponse, TContext>>
|
||||
getToken<TContext = unknown>(params?: T.GetUserAccessTokenRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetUserAccessTokenResponse, TContext>>
|
||||
getUser<TContext = unknown>(params?: T.GetUserRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetUserResponse, TContext>>
|
||||
getUserPrivileges<TContext = unknown>(params?: T.GetUserPrivilegesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetUserPrivilegesResponse, TContext>>
|
||||
grantApiKey<TContext = unknown>(params?: T.GrantApiKeyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GrantApiKeyResponse, TContext>>
|
||||
hasPrivileges<TContext = unknown>(params?: T.HasPrivilegesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.HasPrivilegesResponse, TContext>>
|
||||
invalidateApiKey<TContext = unknown>(params?: T.InvalidateApiKeyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.InvalidateApiKeyResponse, TContext>>
|
||||
invalidateToken<TContext = unknown>(params?: T.InvalidateUserAccessTokenRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.InvalidateUserAccessTokenResponse, TContext>>
|
||||
putPrivileges<TContext = unknown>(params?: T.PutPrivilegesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutPrivilegesResponse, TContext>>
|
||||
putRole<TContext = unknown>(params: T.PutRoleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutRoleResponse, TContext>>
|
||||
putRoleMapping<TContext = unknown>(params: T.PutRoleMappingRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutRoleMappingResponse, TContext>>
|
||||
putUser<TContext = unknown>(params: T.PutUserRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutUserResponse, TContext>>
|
||||
authenticate<TContext = unknown>(params?: T.SecurityAuthenticateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityAuthenticateResponse, TContext>>
|
||||
changePassword<TContext = unknown>(params?: T.SecurityChangePasswordRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityChangePasswordResponse, TContext>>
|
||||
clearApiKeyCache<TContext = unknown>(params: T.SecurityClearApiKeyCacheRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityClearApiKeyCacheResponse, TContext>>
|
||||
clearCachedPrivileges<TContext = unknown>(params: T.SecurityClearCachedPrivilegesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityClearCachedPrivilegesResponse, TContext>>
|
||||
clearCachedRealms<TContext = unknown>(params: T.SecurityClearCachedRealmsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityClearCachedRealmsResponse, TContext>>
|
||||
clearCachedRoles<TContext = unknown>(params: T.SecurityClearCachedRolesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityClearCachedRolesResponse, TContext>>
|
||||
clearCachedServiceTokens<TContext = unknown>(params: T.SecurityClearCachedServiceTokensRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityClearCachedServiceTokensResponse, TContext>>
|
||||
createApiKey<TContext = unknown>(params?: T.SecurityCreateApiKeyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityCreateApiKeyResponse, TContext>>
|
||||
createServiceToken<TContext = unknown>(params: T.SecurityCreateServiceTokenRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityCreateServiceTokenResponse, TContext>>
|
||||
deletePrivileges<TContext = unknown>(params: T.SecurityDeletePrivilegesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityDeletePrivilegesResponse, TContext>>
|
||||
deleteRole<TContext = unknown>(params: T.SecurityDeleteRoleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityDeleteRoleResponse, TContext>>
|
||||
deleteRoleMapping<TContext = unknown>(params: T.SecurityDeleteRoleMappingRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityDeleteRoleMappingResponse, TContext>>
|
||||
deleteServiceToken<TContext = unknown>(params: T.SecurityDeleteServiceTokenRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityDeleteServiceTokenResponse, TContext>>
|
||||
deleteUser<TContext = unknown>(params: T.SecurityDeleteUserRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityDeleteUserResponse, TContext>>
|
||||
disableUser<TContext = unknown>(params: T.SecurityDisableUserRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityDisableUserResponse, TContext>>
|
||||
enableUser<TContext = unknown>(params: T.SecurityEnableUserRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityEnableUserResponse, TContext>>
|
||||
getApiKey<TContext = unknown>(params?: T.SecurityGetApiKeyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityGetApiKeyResponse, TContext>>
|
||||
getBuiltinPrivileges<TContext = unknown>(params?: T.SecurityGetBuiltinPrivilegesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityGetBuiltinPrivilegesResponse, TContext>>
|
||||
getPrivileges<TContext = unknown>(params?: T.SecurityGetPrivilegesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityGetPrivilegesResponse, TContext>>
|
||||
getRole<TContext = unknown>(params?: T.SecurityGetRoleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityGetRoleResponse, TContext>>
|
||||
getRoleMapping<TContext = unknown>(params?: T.SecurityGetRoleMappingRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityGetRoleMappingResponse, TContext>>
|
||||
getServiceAccounts<TContext = unknown>(params?: T.SecurityGetServiceAccountsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityGetServiceAccountsResponse, TContext>>
|
||||
getServiceCredentials<TContext = unknown>(params: T.SecurityGetServiceCredentialsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityGetServiceCredentialsResponse, TContext>>
|
||||
getToken<TContext = unknown>(params?: T.SecurityGetTokenRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityGetTokenResponse, TContext>>
|
||||
getUser<TContext = unknown>(params?: T.SecurityGetUserRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityGetUserResponse, TContext>>
|
||||
getUserPrivileges<TContext = unknown>(params?: T.SecurityGetUserPrivilegesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityGetUserPrivilegesResponse, TContext>>
|
||||
grantApiKey<TContext = unknown>(params?: T.SecurityGrantApiKeyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityGrantApiKeyResponse, TContext>>
|
||||
hasPrivileges<TContext = unknown>(params?: T.SecurityHasPrivilegesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityHasPrivilegesResponse, TContext>>
|
||||
invalidateApiKey<TContext = unknown>(params?: T.SecurityInvalidateApiKeyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityInvalidateApiKeyResponse, TContext>>
|
||||
invalidateToken<TContext = unknown>(params?: T.SecurityInvalidateTokenRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityInvalidateTokenResponse, TContext>>
|
||||
putPrivileges<TContext = unknown>(params?: T.SecurityPutPrivilegesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityPutPrivilegesResponse, TContext>>
|
||||
putRole<TContext = unknown>(params: T.SecurityPutRoleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityPutRoleResponse, TContext>>
|
||||
putRoleMapping<TContext = unknown>(params: T.SecurityPutRoleMappingRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityPutRoleMappingResponse, TContext>>
|
||||
putUser<TContext = unknown>(params: T.SecurityPutUserRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SecurityPutUserResponse, TContext>>
|
||||
queryApiKeys<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
samlAuthenticate<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
samlCompleteLogout<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
samlInvalidate<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
samlLogout<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
samlPrepareAuthentication<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
samlServiceProviderMetadata<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
}
|
||||
shutdown: {
|
||||
deleteNode<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getNode<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
putNode<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
deleteNode<TContext = unknown>(params: T.ShutdownDeleteNodeRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ShutdownDeleteNodeResponse, TContext>>
|
||||
getNode<TContext = unknown>(params?: T.ShutdownGetNodeRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ShutdownGetNodeResponse, TContext>>
|
||||
putNode<TContext = unknown>(params: T.ShutdownPutNodeRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ShutdownPutNodeResponse, TContext>>
|
||||
}
|
||||
slm: {
|
||||
deleteLifecycle<TContext = unknown>(params: T.DeleteSnapshotLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteSnapshotLifecycleResponse, TContext>>
|
||||
executeLifecycle<TContext = unknown>(params: T.ExecuteSnapshotLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ExecuteSnapshotLifecycleResponse, TContext>>
|
||||
executeRetention<TContext = unknown>(params?: T.ExecuteRetentionRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ExecuteRetentionResponse, TContext>>
|
||||
getLifecycle<TContext = unknown>(params?: T.GetSnapshotLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetSnapshotLifecycleResponse, TContext>>
|
||||
getStats<TContext = unknown>(params?: T.GetSnapshotLifecycleStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetSnapshotLifecycleStatsResponse, TContext>>
|
||||
getStatus<TContext = unknown>(params?: T.GetSnapshotLifecycleManagementStatusRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetSnapshotLifecycleManagementStatusResponse, TContext>>
|
||||
putLifecycle<TContext = unknown>(params: T.PutSnapshotLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutSnapshotLifecycleResponse, TContext>>
|
||||
start<TContext = unknown>(params?: T.StartSnapshotLifecycleManagementRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.StartSnapshotLifecycleManagementResponse, TContext>>
|
||||
stop<TContext = unknown>(params?: T.StopSnapshotLifecycleManagementRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.StopSnapshotLifecycleManagementResponse, TContext>>
|
||||
deleteLifecycle<TContext = unknown>(params: T.SlmDeleteLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SlmDeleteLifecycleResponse, TContext>>
|
||||
executeLifecycle<TContext = unknown>(params: T.SlmExecuteLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SlmExecuteLifecycleResponse, TContext>>
|
||||
executeRetention<TContext = unknown>(params?: T.SlmExecuteRetentionRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SlmExecuteRetentionResponse, TContext>>
|
||||
getLifecycle<TContext = unknown>(params?: T.SlmGetLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SlmGetLifecycleResponse, TContext>>
|
||||
getStats<TContext = unknown>(params?: T.SlmGetStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SlmGetStatsResponse, TContext>>
|
||||
getStatus<TContext = unknown>(params?: T.SlmGetStatusRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SlmGetStatusResponse, TContext>>
|
||||
putLifecycle<TContext = unknown>(params: T.SlmPutLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SlmPutLifecycleResponse, TContext>>
|
||||
start<TContext = unknown>(params?: T.SlmStartRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SlmStartResponse, TContext>>
|
||||
stop<TContext = unknown>(params?: T.SlmStopRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SlmStopResponse, TContext>>
|
||||
}
|
||||
snapshot: {
|
||||
cleanupRepository<TContext = unknown>(params: T.CleanupRepositoryRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CleanupRepositoryResponse, TContext>>
|
||||
clone<TContext = unknown>(params: T.CloneSnapshotRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CloneSnapshotResponse, TContext>>
|
||||
create<TContext = unknown>(params: T.SnapshotRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SnapshotResponse, TContext>>
|
||||
createRepository<TContext = unknown>(params: T.CreateRepositoryRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CreateRepositoryResponse, TContext>>
|
||||
delete<TContext = unknown>(params: T.DeleteSnapshotRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteSnapshotResponse, TContext>>
|
||||
deleteRepository<TContext = unknown>(params: T.DeleteRepositoryRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteRepositoryResponse, TContext>>
|
||||
get<TContext = unknown>(params: T.GetSnapshotRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetSnapshotResponse, TContext>>
|
||||
getRepository<TContext = unknown>(params?: T.GetRepositoryRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetRepositoryResponse, TContext>>
|
||||
restore<TContext = unknown>(params: T.RestoreRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RestoreResponse, TContext>>
|
||||
cleanupRepository<TContext = unknown>(params: T.SnapshotCleanupRepositoryRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SnapshotCleanupRepositoryResponse, TContext>>
|
||||
clone<TContext = unknown>(params: T.SnapshotCloneRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SnapshotCloneResponse, TContext>>
|
||||
create<TContext = unknown>(params: T.SnapshotCreateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SnapshotCreateResponse, TContext>>
|
||||
createRepository<TContext = unknown>(params: T.SnapshotCreateRepositoryRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SnapshotCreateRepositoryResponse, TContext>>
|
||||
delete<TContext = unknown>(params: T.SnapshotDeleteRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SnapshotDeleteResponse, TContext>>
|
||||
deleteRepository<TContext = unknown>(params: T.SnapshotDeleteRepositoryRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SnapshotDeleteRepositoryResponse, TContext>>
|
||||
get<TContext = unknown>(params: T.SnapshotGetRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SnapshotGetResponse, TContext>>
|
||||
getRepository<TContext = unknown>(params?: T.SnapshotGetRepositoryRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SnapshotGetRepositoryResponse, TContext>>
|
||||
repositoryAnalyze<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
restore<TContext = unknown>(params: T.SnapshotRestoreRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SnapshotRestoreResponse, TContext>>
|
||||
status<TContext = unknown>(params?: T.SnapshotStatusRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SnapshotStatusResponse, TContext>>
|
||||
verifyRepository<TContext = unknown>(params: T.VerifyRepositoryRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.VerifyRepositoryResponse, TContext>>
|
||||
verifyRepository<TContext = unknown>(params: T.SnapshotVerifyRepositoryRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SnapshotVerifyRepositoryResponse, TContext>>
|
||||
}
|
||||
sql: {
|
||||
clearCursor<TContext = unknown>(params?: T.ClearSqlCursorRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClearSqlCursorResponse, TContext>>
|
||||
query<TContext = unknown>(params?: T.QuerySqlRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.QuerySqlResponse, TContext>>
|
||||
translate<TContext = unknown>(params?: T.TranslateSqlRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.TranslateSqlResponse, TContext>>
|
||||
clearCursor<TContext = unknown>(params?: T.SqlClearCursorRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SqlClearCursorResponse, TContext>>
|
||||
deleteAsync<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getAsync<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getAsyncStatus<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
query<TContext = unknown>(params?: T.SqlQueryRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SqlQueryResponse, TContext>>
|
||||
translate<TContext = unknown>(params?: T.SqlTranslateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SqlTranslateResponse, TContext>>
|
||||
}
|
||||
ssl: {
|
||||
certificates<TContext = unknown>(params?: T.GetCertificatesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetCertificatesResponse, TContext>>
|
||||
certificates<TContext = unknown>(params?: T.SslCertificatesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SslCertificatesResponse, TContext>>
|
||||
}
|
||||
tasks: {
|
||||
cancel<TContext = unknown>(params?: T.CancelTasksRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CancelTasksResponse, TContext>>
|
||||
get<TContext = unknown>(params: T.GetTaskRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetTaskResponse, TContext>>
|
||||
list<TContext = unknown>(params?: T.ListTasksRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ListTasksResponse, TContext>>
|
||||
cancel<TContext = unknown>(params?: T.TasksCancelRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.TasksCancelResponse, TContext>>
|
||||
get<TContext = unknown>(params: T.TasksGetRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.TasksGetResponse, TContext>>
|
||||
list<TContext = unknown>(params?: T.TasksListRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.TasksListResponse, TContext>>
|
||||
}
|
||||
termvectors<TDocument = unknown, TContext = unknown>(params: T.TermVectorsRequest<TDocument>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.TermVectorsResponse, TContext>>
|
||||
termsEnum<TContext = unknown>(params: T.TermsEnumRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.TermsEnumResponse, TContext>>
|
||||
termvectors<TDocument = unknown, TContext = unknown>(params: T.TermvectorsRequest<TDocument>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.TermvectorsResponse, TContext>>
|
||||
textStructure: {
|
||||
findStructure<TBody = unknown, TContext = unknown>(params: T.FindStructureRequest<TBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.FindStructureResponse, TContext>>
|
||||
findStructure<TJsonDocument = unknown, TContext = unknown>(params: T.TextStructureFindStructureRequest<TJsonDocument>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.TextStructureFindStructureResponse, TContext>>
|
||||
}
|
||||
transform: {
|
||||
deleteTransform<TContext = unknown>(params: T.DeleteTransformRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteTransformResponse, TContext>>
|
||||
getTransform<TContext = unknown>(params?: T.GetTransformRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetTransformResponse, TContext>>
|
||||
getTransformStats<TContext = unknown>(params: T.GetTransformStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetTransformStatsResponse, TContext>>
|
||||
previewTransform<TTransform = unknown, TContext = unknown>(params?: T.PreviewTransformRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PreviewTransformResponse<TTransform>, TContext>>
|
||||
putTransform<TContext = unknown>(params: T.PutTransformRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutTransformResponse, TContext>>
|
||||
startTransform<TContext = unknown>(params: T.StartTransformRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.StartTransformResponse, TContext>>
|
||||
stopTransform<TContext = unknown>(params: T.StopTransformRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.StopTransformResponse, TContext>>
|
||||
updateTransform<TContext = unknown>(params: T.UpdateTransformRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.UpdateTransformResponse, TContext>>
|
||||
deleteTransform<TContext = unknown>(params: T.TransformDeleteTransformRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.TransformDeleteTransformResponse, TContext>>
|
||||
getTransform<TContext = unknown>(params?: T.TransformGetTransformRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.TransformGetTransformResponse, TContext>>
|
||||
getTransformStats<TContext = unknown>(params: T.TransformGetTransformStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.TransformGetTransformStatsResponse, TContext>>
|
||||
previewTransform<TTransform = unknown, TContext = unknown>(params?: T.TransformPreviewTransformRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.TransformPreviewTransformResponse<TTransform>, TContext>>
|
||||
putTransform<TContext = unknown>(params: T.TransformPutTransformRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.TransformPutTransformResponse, TContext>>
|
||||
startTransform<TContext = unknown>(params: T.TransformStartTransformRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.TransformStartTransformResponse, TContext>>
|
||||
stopTransform<TContext = unknown>(params: T.TransformStopTransformRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.TransformStopTransformResponse, TContext>>
|
||||
updateTransform<TContext = unknown>(params: T.TransformUpdateTransformRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.TransformUpdateTransformResponse, TContext>>
|
||||
upgradeTransforms<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
}
|
||||
update<TDocumentR = unknown, TDocument = unknown, TPartialDocument = unknown, TContext = unknown>(params: T.UpdateRequest<TDocument, TPartialDocument>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.UpdateResponse<TDocumentR>, TContext>>
|
||||
updateByQuery<TContext = unknown>(params: T.UpdateByQueryRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.UpdateByQueryResponse, TContext>>
|
||||
updateByQueryRethrottle<TContext = unknown>(params: T.UpdateByQueryRethrottleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.UpdateByQueryRethrottleResponse, TContext>>
|
||||
watcher: {
|
||||
ackWatch<TContext = unknown>(params: T.AcknowledgeWatchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.AcknowledgeWatchResponse, TContext>>
|
||||
activateWatch<TContext = unknown>(params: T.ActivateWatchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ActivateWatchResponse, TContext>>
|
||||
deactivateWatch<TContext = unknown>(params: T.DeactivateWatchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeactivateWatchResponse, TContext>>
|
||||
deleteWatch<TContext = unknown>(params: T.DeleteWatchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteWatchResponse, TContext>>
|
||||
executeWatch<TContext = unknown>(params?: T.ExecuteWatchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ExecuteWatchResponse, TContext>>
|
||||
getWatch<TContext = unknown>(params: T.GetWatchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetWatchResponse, TContext>>
|
||||
putWatch<TContext = unknown>(params: T.PutWatchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutWatchResponse, TContext>>
|
||||
queryWatches<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
start<TContext = unknown>(params?: T.StartWatcherRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.StartWatcherResponse, TContext>>
|
||||
ackWatch<TContext = unknown>(params: T.WatcherAckWatchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.WatcherAckWatchResponse, TContext>>
|
||||
activateWatch<TContext = unknown>(params: T.WatcherActivateWatchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.WatcherActivateWatchResponse, TContext>>
|
||||
deactivateWatch<TContext = unknown>(params: T.WatcherDeactivateWatchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.WatcherDeactivateWatchResponse, TContext>>
|
||||
deleteWatch<TContext = unknown>(params: T.WatcherDeleteWatchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.WatcherDeleteWatchResponse, TContext>>
|
||||
executeWatch<TContext = unknown>(params?: T.WatcherExecuteWatchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.WatcherExecuteWatchResponse, TContext>>
|
||||
getWatch<TContext = unknown>(params: T.WatcherGetWatchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.WatcherGetWatchResponse, TContext>>
|
||||
putWatch<TContext = unknown>(params: T.WatcherPutWatchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.WatcherPutWatchResponse, TContext>>
|
||||
queryWatches<TContext = unknown>(params?: T.WatcherQueryWatchesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.WatcherQueryWatchesResponse, TContext>>
|
||||
start<TContext = unknown>(params?: T.WatcherStartRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.WatcherStartResponse, TContext>>
|
||||
stats<TContext = unknown>(params?: T.WatcherStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.WatcherStatsResponse, TContext>>
|
||||
stop<TContext = unknown>(params?: T.StopWatcherRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.StopWatcherResponse, TContext>>
|
||||
stop<TContext = unknown>(params?: T.WatcherStopRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.WatcherStopResponse, TContext>>
|
||||
}
|
||||
xpack: {
|
||||
info<TContext = unknown>(params?: T.XPackInfoRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.XPackInfoResponse, TContext>>
|
||||
usage<TContext = unknown>(params?: T.XPackUsageRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.XPackUsageResponse, TContext>>
|
||||
info<TContext = unknown>(params?: T.XpackInfoRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.XpackInfoResponse, TContext>>
|
||||
usage<TContext = unknown>(params?: T.XpackUsageRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.XpackUsageResponse, TContext>>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
2088
api/new.d.ts
vendored
2088
api/new.d.ts
vendored
File diff suppressed because it is too large
Load Diff
233
api/requestParams.d.ts
vendored
233
api/requestParams.d.ts
vendored
@ -653,8 +653,6 @@ export interface Delete extends Generic {
|
||||
export interface DeleteByQuery<T = RequestBody> extends Generic {
|
||||
index: string | string[];
|
||||
type?: string | string[];
|
||||
_source_exclude?: string | string[];
|
||||
_source_include?: string | string[];
|
||||
analyzer?: string;
|
||||
analyze_wildcard?: boolean;
|
||||
default_operator?: 'AND' | 'OR';
|
||||
@ -674,9 +672,6 @@ export interface DeleteByQuery<T = RequestBody> extends Generic {
|
||||
size?: number;
|
||||
max_docs?: number;
|
||||
sort?: string | string[];
|
||||
_source?: string | string[];
|
||||
_source_excludes?: string | string[];
|
||||
_source_includes?: string | string[];
|
||||
terminate_after?: number;
|
||||
stats?: string | string[];
|
||||
version?: boolean;
|
||||
@ -818,6 +813,27 @@ export interface FieldCaps<T = RequestBody> extends Generic {
|
||||
body?: T;
|
||||
}
|
||||
|
||||
export interface FleetGlobalCheckpoints extends Generic {
|
||||
index: string;
|
||||
wait_for_advance?: boolean;
|
||||
wait_for_index?: boolean;
|
||||
checkpoints?: string | string[];
|
||||
timeout?: string;
|
||||
}
|
||||
|
||||
export interface FleetMsearch<T = RequestNDBody> extends Generic {
|
||||
index?: string;
|
||||
body: T;
|
||||
}
|
||||
|
||||
export interface FleetSearch<T = RequestBody> extends Generic {
|
||||
index: string;
|
||||
wait_for_checkpoints?: string | string[];
|
||||
wait_for_checkpoints_timeout?: string;
|
||||
allow_partial_search_results?: boolean;
|
||||
body?: T;
|
||||
}
|
||||
|
||||
export interface Get extends Generic {
|
||||
id: string;
|
||||
index: string;
|
||||
@ -889,6 +905,11 @@ export interface IlmGetLifecycle extends Generic {
|
||||
export interface IlmGetStatus extends Generic {
|
||||
}
|
||||
|
||||
export interface IlmMigrateToDataTiers<T = RequestBody> extends Generic {
|
||||
dry_run?: boolean;
|
||||
body?: T;
|
||||
}
|
||||
|
||||
export interface IlmMoveToStep<T = RequestBody> extends Generic {
|
||||
index: string;
|
||||
body?: T;
|
||||
@ -1026,6 +1047,15 @@ export interface IndicesDeleteTemplate extends Generic {
|
||||
master_timeout?: string;
|
||||
}
|
||||
|
||||
export interface IndicesDiskUsage extends Generic {
|
||||
index: string;
|
||||
run_expensive_tasks?: boolean;
|
||||
flush?: boolean;
|
||||
ignore_unavailable?: boolean;
|
||||
allow_no_indices?: boolean;
|
||||
expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all';
|
||||
}
|
||||
|
||||
export interface IndicesExists extends Generic {
|
||||
index: string | string[];
|
||||
local?: boolean;
|
||||
@ -1068,6 +1098,14 @@ export interface IndicesExistsType extends Generic {
|
||||
local?: boolean;
|
||||
}
|
||||
|
||||
export interface IndicesFieldUsageStats extends Generic {
|
||||
index: string;
|
||||
fields?: string | string[];
|
||||
ignore_unavailable?: boolean;
|
||||
allow_no_indices?: boolean;
|
||||
expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all';
|
||||
}
|
||||
|
||||
export interface IndicesFlush extends Generic {
|
||||
index?: string | string[];
|
||||
force?: boolean;
|
||||
@ -1143,7 +1181,7 @@ export interface IndicesGetFieldMapping extends Generic {
|
||||
}
|
||||
|
||||
export interface IndicesGetIndexTemplate extends Generic {
|
||||
name?: string | string[];
|
||||
name?: string;
|
||||
flat_settings?: boolean;
|
||||
master_timeout?: string;
|
||||
local?: boolean;
|
||||
@ -1191,6 +1229,10 @@ export interface IndicesMigrateToDataStream extends Generic {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface IndicesModifyDataStream<T = RequestBody> extends Generic {
|
||||
body: T;
|
||||
}
|
||||
|
||||
export interface IndicesOpen extends Generic {
|
||||
index: string | string[];
|
||||
timeout?: string;
|
||||
@ -1424,6 +1466,7 @@ export interface IngestProcessorGrok extends Generic {
|
||||
|
||||
export interface IngestPutPipeline<T = RequestBody> extends Generic {
|
||||
id: string;
|
||||
if_version?: number;
|
||||
master_timeout?: string;
|
||||
timeout?: string;
|
||||
body: T;
|
||||
@ -1496,6 +1539,12 @@ export interface MigrationDeprecations extends Generic {
|
||||
index?: string;
|
||||
}
|
||||
|
||||
export interface MigrationGetFeatureUpgradeStatus extends Generic {
|
||||
}
|
||||
|
||||
export interface MigrationPostFeatureUpgrade extends Generic {
|
||||
}
|
||||
|
||||
export interface MlCloseJob<T = RequestBody> extends Generic {
|
||||
job_id: string;
|
||||
allow_no_match?: boolean;
|
||||
@ -1609,11 +1658,12 @@ export interface MlFlushJob<T = RequestBody> extends Generic {
|
||||
body?: T;
|
||||
}
|
||||
|
||||
export interface MlForecast extends Generic {
|
||||
export interface MlForecast<T = RequestBody> extends Generic {
|
||||
job_id: string;
|
||||
duration?: string;
|
||||
expires_in?: string;
|
||||
max_model_memory?: string;
|
||||
body?: T;
|
||||
}
|
||||
|
||||
export interface MlGetBuckets<T = RequestBody> extends Generic {
|
||||
@ -1777,8 +1827,9 @@ export interface MlGetTrainedModelsStats extends Generic {
|
||||
export interface MlInfo extends Generic {
|
||||
}
|
||||
|
||||
export interface MlOpenJob extends Generic {
|
||||
export interface MlOpenJob<T = RequestBody> extends Generic {
|
||||
job_id: string;
|
||||
body?: T;
|
||||
}
|
||||
|
||||
export interface MlPostCalendarEvents<T = RequestBody> extends Generic {
|
||||
@ -1834,11 +1885,16 @@ export interface MlPutFilter<T = RequestBody> extends Generic {
|
||||
|
||||
export interface MlPutJob<T = RequestBody> extends Generic {
|
||||
job_id: string;
|
||||
ignore_unavailable?: boolean;
|
||||
allow_no_indices?: boolean;
|
||||
ignore_throttled?: boolean;
|
||||
expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all';
|
||||
body: T;
|
||||
}
|
||||
|
||||
export interface MlPutTrainedModel<T = RequestBody> extends Generic {
|
||||
model_id: string;
|
||||
defer_definition_decompression?: boolean;
|
||||
body: T;
|
||||
}
|
||||
|
||||
@ -1848,6 +1904,11 @@ export interface MlPutTrainedModelAlias extends Generic {
|
||||
reassign?: boolean;
|
||||
}
|
||||
|
||||
export interface MlResetJob extends Generic {
|
||||
job_id: string;
|
||||
wait_for_completion?: boolean;
|
||||
}
|
||||
|
||||
export interface MlRevertModelSnapshot<T = RequestBody> extends Generic {
|
||||
job_id: string;
|
||||
snapshot_id: string;
|
||||
@ -1936,7 +1997,7 @@ export interface MlValidateDetector<T = RequestBody> extends Generic {
|
||||
body: T;
|
||||
}
|
||||
|
||||
export interface MonitoringBulk<T = RequestBody> extends Generic {
|
||||
export interface MonitoringBulk<T = RequestNDBody> extends Generic {
|
||||
type?: string;
|
||||
system_id?: string;
|
||||
system_api_version?: string;
|
||||
@ -1947,7 +2008,7 @@ export interface MonitoringBulk<T = RequestBody> extends Generic {
|
||||
export interface Msearch<T = RequestNDBody> extends Generic {
|
||||
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' | 'dfs_query_then_fetch';
|
||||
max_concurrent_searches?: number;
|
||||
typed_keys?: boolean;
|
||||
pre_filter_shard_size?: number;
|
||||
@ -1960,7 +2021,7 @@ export interface Msearch<T = RequestNDBody> extends Generic {
|
||||
export interface MsearchTemplate<T = RequestNDBody> extends Generic {
|
||||
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' | 'dfs_query_then_fetch';
|
||||
typed_keys?: boolean;
|
||||
max_concurrent_searches?: number;
|
||||
rest_total_hits_as_int?: boolean;
|
||||
@ -1986,13 +2047,23 @@ export interface Mtermvectors<T = RequestBody> extends Generic {
|
||||
body?: T;
|
||||
}
|
||||
|
||||
export interface NodesClearRepositoriesMeteringArchive extends Generic {
|
||||
node_id: string | string[];
|
||||
max_archive_version: number;
|
||||
}
|
||||
|
||||
export interface NodesGetRepositoriesMeteringInfo extends Generic {
|
||||
node_id: string | string[];
|
||||
}
|
||||
|
||||
export interface NodesHotThreads extends Generic {
|
||||
node_id?: string | string[];
|
||||
interval?: string;
|
||||
snapshots?: number;
|
||||
threads?: number;
|
||||
ignore_idle_threads?: boolean;
|
||||
type?: 'cpu' | 'wait' | 'block';
|
||||
type?: 'cpu' | 'wait' | 'block' | 'mem';
|
||||
sort?: 'cpu' | 'total';
|
||||
timeout?: string;
|
||||
}
|
||||
|
||||
@ -2031,12 +2102,12 @@ export interface NodesUsage extends Generic {
|
||||
}
|
||||
|
||||
export interface OpenPointInTime extends Generic {
|
||||
index?: string | string[];
|
||||
index: string | string[];
|
||||
preference?: string;
|
||||
routing?: string;
|
||||
ignore_unavailable?: boolean;
|
||||
expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all';
|
||||
keep_alive?: string;
|
||||
keep_alive: string;
|
||||
}
|
||||
|
||||
export interface Ping extends Generic {
|
||||
@ -2188,6 +2259,21 @@ export interface Search<T = RequestBody> extends Generic {
|
||||
body?: T;
|
||||
}
|
||||
|
||||
export interface SearchMvt<T = RequestBody> extends Generic {
|
||||
index: string | string[];
|
||||
field: string;
|
||||
zoom: number;
|
||||
x: number;
|
||||
y: number;
|
||||
exact_bounds?: boolean;
|
||||
extent?: number;
|
||||
grid_precision?: number;
|
||||
grid_type?: 'grid' | 'point' | 'centroid';
|
||||
size?: number;
|
||||
track_total_hits?: boolean | number;
|
||||
body?: T;
|
||||
}
|
||||
|
||||
export interface SearchShards extends Generic {
|
||||
index?: string | string[];
|
||||
preference?: string;
|
||||
@ -2208,7 +2294,7 @@ export interface SearchTemplate<T = RequestBody> extends Generic {
|
||||
preference?: string;
|
||||
routing?: string | string[];
|
||||
scroll?: string;
|
||||
search_type?: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch';
|
||||
search_type?: 'query_then_fetch' | 'dfs_query_then_fetch';
|
||||
explain?: boolean;
|
||||
profile?: boolean;
|
||||
typed_keys?: boolean;
|
||||
@ -2217,6 +2303,10 @@ export interface SearchTemplate<T = RequestBody> extends Generic {
|
||||
body: T;
|
||||
}
|
||||
|
||||
export interface SearchableSnapshotsCacheStats extends Generic {
|
||||
node_id?: string | string[];
|
||||
}
|
||||
|
||||
export interface SearchableSnapshotsClearCache extends Generic {
|
||||
index?: string | string[];
|
||||
ignore_unavailable?: boolean;
|
||||
@ -2268,11 +2358,24 @@ export interface SecurityClearCachedRoles extends Generic {
|
||||
name: string | string[];
|
||||
}
|
||||
|
||||
export interface SecurityClearCachedServiceTokens extends Generic {
|
||||
namespace: string;
|
||||
service: string;
|
||||
name: string | string[];
|
||||
}
|
||||
|
||||
export interface SecurityCreateApiKey<T = RequestBody> extends Generic {
|
||||
refresh?: 'wait_for' | boolean;
|
||||
body: T;
|
||||
}
|
||||
|
||||
export interface SecurityCreateServiceToken extends Generic {
|
||||
namespace: string;
|
||||
service: string;
|
||||
name?: string;
|
||||
refresh?: 'wait_for' | boolean;
|
||||
}
|
||||
|
||||
export interface SecurityDeletePrivileges extends Generic {
|
||||
application: string;
|
||||
name: string;
|
||||
@ -2289,6 +2392,13 @@ export interface SecurityDeleteRoleMapping extends Generic {
|
||||
refresh?: 'wait_for' | boolean;
|
||||
}
|
||||
|
||||
export interface SecurityDeleteServiceToken extends Generic {
|
||||
namespace: string;
|
||||
service: string;
|
||||
name: string;
|
||||
refresh?: 'wait_for' | boolean;
|
||||
}
|
||||
|
||||
export interface SecurityDeleteUser extends Generic {
|
||||
username: string;
|
||||
refresh?: 'wait_for' | boolean;
|
||||
@ -2328,6 +2438,16 @@ export interface SecurityGetRoleMapping extends Generic {
|
||||
name?: string | string[];
|
||||
}
|
||||
|
||||
export interface SecurityGetServiceAccounts extends Generic {
|
||||
namespace?: string;
|
||||
service?: string;
|
||||
}
|
||||
|
||||
export interface SecurityGetServiceCredentials extends Generic {
|
||||
namespace: string;
|
||||
service: string;
|
||||
}
|
||||
|
||||
export interface SecurityGetToken<T = RequestBody> extends Generic {
|
||||
body: T;
|
||||
}
|
||||
@ -2380,6 +2500,34 @@ export interface SecurityPutUser<T = RequestBody> extends Generic {
|
||||
body: T;
|
||||
}
|
||||
|
||||
export interface SecurityQueryApiKeys<T = RequestBody> extends Generic {
|
||||
body?: T;
|
||||
}
|
||||
|
||||
export interface SecuritySamlAuthenticate<T = RequestBody> extends Generic {
|
||||
body: T;
|
||||
}
|
||||
|
||||
export interface SecuritySamlCompleteLogout<T = RequestBody> extends Generic {
|
||||
body: T;
|
||||
}
|
||||
|
||||
export interface SecuritySamlInvalidate<T = RequestBody> extends Generic {
|
||||
body: T;
|
||||
}
|
||||
|
||||
export interface SecuritySamlLogout<T = RequestBody> extends Generic {
|
||||
body: T;
|
||||
}
|
||||
|
||||
export interface SecuritySamlPrepareAuthentication<T = RequestBody> extends Generic {
|
||||
body: T;
|
||||
}
|
||||
|
||||
export interface SecuritySamlServiceProviderMetadata extends Generic {
|
||||
realm_name: string;
|
||||
}
|
||||
|
||||
export interface ShutdownDeleteNode extends Generic {
|
||||
node_id: string;
|
||||
}
|
||||
@ -2472,6 +2620,8 @@ export interface SnapshotGet extends Generic {
|
||||
snapshot: string | string[];
|
||||
master_timeout?: string;
|
||||
ignore_unavailable?: boolean;
|
||||
index_details?: boolean;
|
||||
include_repository?: boolean;
|
||||
verbose?: boolean;
|
||||
}
|
||||
|
||||
@ -2481,6 +2631,21 @@ export interface SnapshotGetRepository extends Generic {
|
||||
local?: boolean;
|
||||
}
|
||||
|
||||
export interface SnapshotRepositoryAnalyze extends Generic {
|
||||
repository: string;
|
||||
blob_count?: number;
|
||||
concurrency?: number;
|
||||
read_node_count?: number;
|
||||
early_read_node_count?: number;
|
||||
seed?: number;
|
||||
rare_action_probability?: number;
|
||||
max_blob_size?: string;
|
||||
max_total_data_size?: string;
|
||||
timeout?: string;
|
||||
detailed?: boolean;
|
||||
rarely_abort_writes?: boolean;
|
||||
}
|
||||
|
||||
export interface SnapshotRestore<T = RequestBody> extends Generic {
|
||||
repository: string;
|
||||
snapshot: string;
|
||||
@ -2506,6 +2671,22 @@ export interface SqlClearCursor<T = RequestBody> extends Generic {
|
||||
body: T;
|
||||
}
|
||||
|
||||
export interface SqlDeleteAsync extends Generic {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface SqlGetAsync extends Generic {
|
||||
id: string;
|
||||
delimiter?: string;
|
||||
format?: string;
|
||||
keep_alive?: string;
|
||||
wait_for_completion_timeout?: string;
|
||||
}
|
||||
|
||||
export interface SqlGetAsyncStatus extends Generic {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface SqlQuery<T = RequestBody> extends Generic {
|
||||
format?: string;
|
||||
body: T;
|
||||
@ -2542,6 +2723,11 @@ export interface TasksList extends Generic {
|
||||
timeout?: string;
|
||||
}
|
||||
|
||||
export interface TermsEnum<T = RequestBody> extends Generic {
|
||||
index: string | string[];
|
||||
body?: T;
|
||||
}
|
||||
|
||||
export interface Termvectors<T = RequestBody> extends Generic {
|
||||
index: string;
|
||||
id?: string;
|
||||
@ -2581,6 +2767,7 @@ export interface TextStructureFindStructure<T = RequestNDBody> extends Generic {
|
||||
export interface TransformDeleteTransform extends Generic {
|
||||
transform_id: string;
|
||||
force?: boolean;
|
||||
timeout?: string;
|
||||
}
|
||||
|
||||
export interface TransformGetTransform extends Generic {
|
||||
@ -2599,12 +2786,15 @@ export interface TransformGetTransformStats extends Generic {
|
||||
}
|
||||
|
||||
export interface TransformPreviewTransform<T = RequestBody> extends Generic {
|
||||
body: T;
|
||||
transform_id?: string;
|
||||
timeout?: string;
|
||||
body?: T;
|
||||
}
|
||||
|
||||
export interface TransformPutTransform<T = RequestBody> extends Generic {
|
||||
transform_id: string;
|
||||
defer_validation?: boolean;
|
||||
timeout?: string;
|
||||
body: T;
|
||||
}
|
||||
|
||||
@ -2625,9 +2815,15 @@ export interface TransformStopTransform extends Generic {
|
||||
export interface TransformUpdateTransform<T = RequestBody> extends Generic {
|
||||
transform_id: string;
|
||||
defer_validation?: boolean;
|
||||
timeout?: string;
|
||||
body: T;
|
||||
}
|
||||
|
||||
export interface TransformUpgradeTransforms extends Generic {
|
||||
dry_run?: boolean;
|
||||
timeout?: string;
|
||||
}
|
||||
|
||||
export interface Update<T = RequestBody> extends Generic {
|
||||
id: string;
|
||||
index: string;
|
||||
@ -2652,8 +2848,6 @@ export interface Update<T = RequestBody> extends Generic {
|
||||
export interface UpdateByQuery<T = RequestBody> extends Generic {
|
||||
index: string | string[];
|
||||
type?: string | string[];
|
||||
_source_exclude?: string | string[];
|
||||
_source_include?: string | string[];
|
||||
analyzer?: string;
|
||||
analyze_wildcard?: boolean;
|
||||
default_operator?: 'AND' | 'OR';
|
||||
@ -2674,9 +2868,6 @@ export interface UpdateByQuery<T = RequestBody> extends Generic {
|
||||
size?: number;
|
||||
max_docs?: number;
|
||||
sort?: string | string[];
|
||||
_source?: string | string[];
|
||||
_source_excludes?: string | string[];
|
||||
_source_includes?: string | string[];
|
||||
terminate_after?: number;
|
||||
stats?: string | string[];
|
||||
version?: boolean;
|
||||
|
||||
24502
api/types.d.ts
vendored
24502
api/types.d.ts
vendored
File diff suppressed because it is too large
Load Diff
@ -83,4 +83,18 @@ class MySerializer extends Serializer {
|
||||
const client = new Client({
|
||||
Serializer: MySerializer
|
||||
})
|
||||
----
|
||||
----
|
||||
|
||||
[discrete]
|
||||
==== Migrate to v8
|
||||
|
||||
The Node.js client can be configured to emit an HTTP header
|
||||
``Accept: application/vnd.elasticsearch+json; compatible-with=7``
|
||||
which signals to Elasticsearch that the client is requesting
|
||||
``7.x`` version of request and response bodies. This allows for
|
||||
upgrading from 7.x to 8.x version of Elasticsearch without upgrading
|
||||
everything at once. Elasticsearch should be upgraded first after
|
||||
the compatibility header is configured and clients should be upgraded
|
||||
second.
|
||||
To enable to setting, configure the environment variable
|
||||
``ELASTIC_CLIENT_APIVERSIONING`` to ``true``.
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
[[basic-config]]
|
||||
=== Basic configuration
|
||||
|
||||
This page shows you the possible basic configuration options that the clients
|
||||
This page shows you the possible basic configuration options that the clients
|
||||
offers.
|
||||
|
||||
|
||||
@ -46,9 +46,9 @@ node: {
|
||||
----
|
||||
|
||||
|`auth`
|
||||
a|Your authentication data. You can use both basic authentication and
|
||||
a|Your authentication data. You can use both basic authentication and
|
||||
{ref}/security-api-create-api-key.html[ApiKey]. +
|
||||
See https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/auth-reference.html[Authentication]
|
||||
See https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/auth-reference.html[Authentication]
|
||||
for more details. +
|
||||
_Default:_ `null`
|
||||
|
||||
@ -67,6 +67,13 @@ auth: {
|
||||
apiKey: 'base64EncodedKey'
|
||||
}
|
||||
----
|
||||
Bearer authentication, useful for https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-service-token.html[service account tokens]. Be aware that it does not handle automatic token refresh:
|
||||
[source,js]
|
||||
----
|
||||
auth: {
|
||||
bearer: 'token'
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
|`maxRetries`
|
||||
@ -134,7 +141,7 @@ const client = new Client({
|
||||
----
|
||||
|
||||
|`agent`
|
||||
a|`http.AgentOptions, function` - http agent https://nodejs.org/api/http.html#http_new_agent_options[options],
|
||||
a|`http.AgentOptions, function` - http agent https://nodejs.org/api/http.html#http_new_agent_options[options],
|
||||
or a function that returns an actual http agent instance. If you want to disable the http agent use entirely
|
||||
(and disable the `keep-alive` feature), set the agent to `false`. +
|
||||
_Default:_ `null`
|
||||
@ -189,7 +196,7 @@ function nodeSelector (connections) {
|
||||
----
|
||||
|
||||
|`generateRequestId`
|
||||
a|`function` - function to generate the request id for every request, it takes
|
||||
a|`function` - function to generate the request id for every request, it takes
|
||||
two parameters, the request parameters and options. +
|
||||
By default it generates an incremental integer for every request. +
|
||||
_Custom function example:_
|
||||
@ -226,17 +233,17 @@ such as the client and platform version. +
|
||||
_Default:_ `true`
|
||||
|
||||
|`cloud`
|
||||
a|`object` - Custom configuration for connecting to
|
||||
https://cloud.elastic.co[Elastic Cloud]. See https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/auth-reference.html[Authentication]
|
||||
a|`object` - Custom configuration for connecting to
|
||||
https://cloud.elastic.co[Elastic Cloud]. See https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/auth-reference.html[Authentication]
|
||||
for more details. +
|
||||
_Default:_ `null` +
|
||||
_Cloud configuration example:_
|
||||
_Default:_ `null` +
|
||||
_Cloud configuration example:_
|
||||
[source,js]
|
||||
----
|
||||
const client = new Client({
|
||||
cloud: {
|
||||
id: 'name:bG9jYWxob3N0JGFiY2QkZWZnaA=='
|
||||
},
|
||||
},
|
||||
auth: {
|
||||
username: 'elastic',
|
||||
password: 'changeme'
|
||||
@ -248,4 +255,36 @@ const client = new Client({
|
||||
|`boolean`, `'proto'`, `'constructor'` - By the default the client will protect you against prototype poisoning attacks. Read https://web.archive.org/web/20200319091159/https://hueniverse.com/square-brackets-are-the-enemy-ff5b9fd8a3e8?gi=184a27ee2a08[this article] to learn more. If needed you can disable prototype poisoning protection entirely or one of the two checks. Read the `secure-json-parse` https://github.com/fastify/secure-json-parse[documentation] to learn more. +
|
||||
_Default:_ `false`
|
||||
|
||||
|===
|
||||
|`caFingerprint`
|
||||
|`string` - If configured, verify that the fingerprint of the CA certificate that has signed the certificate of the server matches the supplied fingerprint. Only accepts SHA256 digest fingerprints. +
|
||||
_Default:_ `null`
|
||||
|
||||
|`maxResponseSize`
|
||||
|`number` - When configured, it verifies that the uncompressed response size is lower than the configured number, if it's higher it will abort the request. It cannot be higher than buffer.constants.MAX_STRING_LENTGH +
|
||||
_Default:_ `null`
|
||||
|
||||
|`maxCompressedResponseSize`
|
||||
|`number` - When configured, it verifies that the compressed response size is lower than the configured number, if it's higher it will abort the request. It cannot be higher than buffer.constants.MAX_LENTGH +
|
||||
_Default:_ `null`
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
==== Performances considerations
|
||||
|
||||
By default, the client will protection you against prototype poisoning attacks.
|
||||
Read https://web.archive.org/web/20200319091159/https://hueniverse.com/square-brackets-are-the-enemy-ff5b9fd8a3e8?gi=184a27ee2a08[this article] to learn more.
|
||||
If needed you can disable prototype poisoning protection entirely or one of the two checks.
|
||||
Read the `secure-json-parse` https://github.com/fastify/secure-json-parse[documentation] to learn more.
|
||||
|
||||
While it's good to be safe, you should know that security always comes with a cost.
|
||||
With big enough payloads, this security check could causea drop in the overall performances,
|
||||
which might be a problem for your application.
|
||||
If you know you can trust the data stored in Elasticsearch, you can safely disable this check.
|
||||
|
||||
[source,js]
|
||||
----
|
||||
const client = new Client({
|
||||
disablePrototypePoisoningProtection: true
|
||||
})
|
||||
----
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
[[breaking-changes]]
|
||||
== Breaking changes coming from the old client
|
||||
=== Breaking changes coming from the old client
|
||||
|
||||
If you were already using the previous version of this client – the one you used
|
||||
to install with `npm install elasticsearch` – you will encounter some breaking
|
||||
@ -7,7 +7,7 @@ changes.
|
||||
|
||||
|
||||
[discrete]
|
||||
=== Don’t panic!
|
||||
==== Don’t panic!
|
||||
|
||||
Every breaking change was carefully weighed, and each is justified. Furthermore,
|
||||
the new codebase has been rewritten with modern JavaScript and has been
|
||||
@ -15,7 +15,7 @@ carefully designed to be easy to maintain.
|
||||
|
||||
|
||||
[discrete]
|
||||
=== Breaking changes
|
||||
==== Breaking changes
|
||||
|
||||
* Minimum supported version of Node.js is `v8`.
|
||||
|
||||
@ -212,7 +212,7 @@ client.transport.request({
|
||||
----
|
||||
|
||||
[discrete]
|
||||
=== Talk is cheap. Show me the code.
|
||||
==== Talk is cheap. Show me the code.
|
||||
|
||||
You can find a code snippet with the old client below followed by the same code
|
||||
logic but with the new client.
|
||||
|
||||
@ -1,5 +1,180 @@
|
||||
[[changelog-client]]
|
||||
== Changelog
|
||||
== Release notes
|
||||
|
||||
[discrete]
|
||||
=== 7.16.0
|
||||
|
||||
[discrete]
|
||||
==== Features
|
||||
|
||||
[discrete]
|
||||
===== Support for Elasticsearch `v7.16`
|
||||
|
||||
You can find all the API changes
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/7.16/release-notes-7.16.0.html[here].
|
||||
|
||||
[discrete]
|
||||
==== Fixes
|
||||
|
||||
[discrete]
|
||||
===== Fixed "Cannot read property 'then' of null" https://github.com/elastic/elasticsearch-js/pull/1594[#1594]
|
||||
|
||||
[discrete]
|
||||
===== Fixed export field deprecation log https://github.com/elastic/elasticsearch-js/pull/1593#[#1593]
|
||||
|
||||
|
||||
[discrete]
|
||||
=== 7.15.0
|
||||
|
||||
[discrete]
|
||||
==== Features
|
||||
|
||||
[discrete]
|
||||
===== Support for Elasticsearch `v7.15`
|
||||
|
||||
You can find all the API changes
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/7.15/release-notes-7.15.0.html[here].
|
||||
|
||||
[discrete]
|
||||
===== Support mapbox content type https://github.com/elastic/elasticsearch-js/pull/1500[#1500]
|
||||
|
||||
If you call an API that returns a mapbox conten type, the response body will be a buffer.
|
||||
|
||||
[discrete]
|
||||
===== Support CA fingerprint validation https://github.com/elastic/elasticsearch-js/pull/1499[#1499]
|
||||
|
||||
You can configure the client to only trust certificates that are signed by a specific CA certificate ( CA certificate pinning ) by providing a `caFingerprint` option. This will verify that the fingerprint of the CA certificate that has signed the certificate of the server matches the supplied value.
|
||||
a `caFingerprint` option, which will verify the supplied certificate authority fingerprint.
|
||||
You must configure a SHA256 digest.
|
||||
|
||||
[source,js]
|
||||
----
|
||||
const { Client } = require('@elastic/elasticsearch')
|
||||
const client = new Client({
|
||||
node: 'https://example.com'
|
||||
auth: { ... },
|
||||
// the fingerprint (SHA256) of the CA certificate that is used to sign the certificate that the Elasticsearch node presents for TLS.
|
||||
caFingerprint: '20:0D:CA:FA:76:...',
|
||||
ssl: {
|
||||
// might be required if it's a self-signed certificate
|
||||
rejectUnauthorized: false
|
||||
}
|
||||
})
|
||||
----
|
||||
|
||||
[discrete]
|
||||
===== Show the body as string if the response error can't be read as ES error https://github.com/elastic/elasticsearch-js/pull/1509[#1509]
|
||||
|
||||
Useful if the errored response does not come from Elasticsearch, but a proxy in the middle for example.
|
||||
|
||||
[discrete]
|
||||
===== Always display request params and options in request event https://github.com/elastic/elasticsearch-js/pull/1531[#1531]
|
||||
|
||||
In some edge cases the params and options weren't available in observabilty events, now they are always defined.
|
||||
|
||||
[discrete]
|
||||
===== Always emit request aborted event https://github.com/elastic/elasticsearch-js/pull/1534[#1534]
|
||||
|
||||
If the client is busy running an async operation, the `.abort()` call might be executed before sending the actual request. In such case, the error was swallowed, now it will always be emitted, either in the `request` or `response` event.
|
||||
|
||||
[discrete]
|
||||
=== 7.14.0
|
||||
|
||||
[discrete]
|
||||
==== Features
|
||||
|
||||
[discrete]
|
||||
===== Support for Elasticsearch `v7.14`
|
||||
|
||||
You can find all the API changes
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/7.14/release-notes-7.14.0.html[here].
|
||||
|
||||
[discrete]
|
||||
===== Verify connection to Elasticsearch https://github.com/elastic/elasticsearch-js/pull/1487[#1487]
|
||||
|
||||
The client will verify if it's working with a supported release of Elasticsearch.
|
||||
Elastic language clients are guaranteed to be able to communicate with Elasticsearch or Elastic solutions running on the same major version and greater or equal minor version.
|
||||
|
||||
Language clients are forward compatible; meaning that clients support communicating with greater minor versions of Elasticsearch. Elastic language clients are not guaranteed to be backwards compatible.
|
||||
|
||||
[discrete]
|
||||
===== Add api compatibility header support https://github.com/elastic/elasticsearch-js/pull/1478[#1478]
|
||||
|
||||
If you configure the `ELASTIC_CLIENT_APIVERSIONING` to `true` the client will send a compatibility header
|
||||
to allow you to use a 7.x client against a 8.x cluster. In this way it will be easier to migrate your code to a newer release of Elasticsearch.
|
||||
|
||||
[discrete]
|
||||
===== Add support for bearer auth https://github.com/elastic/elasticsearch-js/pull/1488[#1488]
|
||||
|
||||
Bearer authentication, useful for https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-service-token.html[service account tokens].
|
||||
Be aware that it does not handle automatic token refresh:
|
||||
|
||||
[source,js]
|
||||
----
|
||||
auth: {
|
||||
bearer: 'token'
|
||||
}
|
||||
----
|
||||
|
||||
[discrete]
|
||||
===== Bulk update improvements https://github.com/elastic/elasticsearch-js/pull/1428[#1428]
|
||||
|
||||
The final stats object will let you know how many `noop` operations happened.
|
||||
Also, a new `.stats` getter has been added to allow you to read the stats before
|
||||
the operation finishes.
|
||||
|
||||
[source,js]
|
||||
----
|
||||
const b = client.helpers.bulk({ ... })
|
||||
...
|
||||
console.log(b.stats)
|
||||
----
|
||||
|
||||
[discrete]
|
||||
=== 7.13.0
|
||||
|
||||
[discrete]
|
||||
==== Breaking changes
|
||||
|
||||
[discrete]
|
||||
===== Remove Node.js v10 support https://github.com/elastic/elasticsearch-js/pull/1471[#1471]
|
||||
|
||||
According to our
|
||||
https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/installation.html#nodejs-support[support matrix].
|
||||
|
||||
[discrete]
|
||||
==== Features
|
||||
|
||||
[discrete]
|
||||
===== Support for Elasticsearch `v7.13`
|
||||
|
||||
You can find all the API changes
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/7.13/release-notes-7.13.0.html[here].
|
||||
|
||||
[discrete]
|
||||
===== Added new TypeScript definitions
|
||||
|
||||
The new type definition is more advanced compared to the legacy one.
|
||||
In the legacy type definitions you were expected to configure via generics both request and response bodies.
|
||||
The new type definitions comes with a complete type definition for every Elasticsearch endpoint.
|
||||
|
||||
You can see how to use them now https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/typescript.html[here].
|
||||
|
||||
[discrete]
|
||||
===== Improve response error message https://github.com/elastic/elasticsearch-js/pull/1457[#1457]
|
||||
|
||||
In case of Elasticsearch errors, now the error message show more info about the underlying issue,
|
||||
improving the debugging experience.
|
||||
|
||||
|
||||
[discrete]
|
||||
==== Fixes
|
||||
|
||||
[discrete]
|
||||
===== Catch HEAD errors https://github.com/elastic/elasticsearch-js/pull/1460[#1460]
|
||||
|
||||
In case of http errors in HEAD request, the client was swalling the response body.
|
||||
This is now fixed and in case of error you will get the full body response.
|
||||
|
||||
[discrete]
|
||||
=== 7.12.0
|
||||
@ -10,15 +185,17 @@
|
||||
[discrete]
|
||||
===== Remove Node.js v8 support https://github.com/elastic/elasticsearch-js/pull/1402[#1402]
|
||||
|
||||
According to our https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/installation.html#nodejs-support[support matrix].
|
||||
According to our
|
||||
https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/installation.html#nodejs-support[support matrix].
|
||||
|
||||
[discrete]
|
||||
==== Features
|
||||
|
||||
[discrete]
|
||||
===== Support for Elasticsearch `v7.12`.
|
||||
===== Support for Elasticsearch `v7.12`
|
||||
|
||||
You can find all the API changes https://www.elastic.co/guide/en/elasticsearch/reference/7.12/release-notes-7.12.0.html[here].
|
||||
You can find all the API changes
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/7.12/release-notes-7.12.0.html[here].
|
||||
|
||||
[discrete]
|
||||
===== Add support for transport options to all helpers https://github.com/elastic/elasticsearch-js/pull/1400[#1400]
|
||||
@ -41,16 +218,18 @@ Now the thenable offers a `.finally` method as well.
|
||||
==== Features
|
||||
|
||||
[discrete]
|
||||
===== Support for Elasticsearch `v7.11`.
|
||||
===== Support for Elasticsearch `v7.11`
|
||||
|
||||
You can find all the API changes https://www.elastic.co/guide/en/elasticsearch/reference/7.11/release-notes-7.11.0.html[here].
|
||||
You can find all the API changes
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/7.11/release-notes-7.11.0.html[here].
|
||||
|
||||
[discrete]
|
||||
===== Added new observability events https://github.com/elastic/elasticsearch-js/pull/1365[#1365]
|
||||
|
||||
Two new observability events has been introduced: `serialization` and `deserialization`.
|
||||
The event order is described in the following graph, in some edge cases, the order is not guaranteed.
|
||||
You can find in https://github.com/elastic/elasticsearch-js/blob/master/test/acceptance/events-order.test.js[`test/acceptance/events-order.test.js`]
|
||||
Two new observability events has been introduced: `serialization` and
|
||||
`deserialization`. The event order is described in the following graph, in some
|
||||
edge cases, the order is not guaranteed. You can find in
|
||||
https://github.com/elastic/elasticsearch-js/blob/master/test/acceptance/events-order.test.js[`test/acceptance/events-order.test.js`]
|
||||
how the order changes based on the situation.
|
||||
|
||||
----
|
||||
@ -72,8 +251,8 @@ serialization
|
||||
[discrete]
|
||||
===== Added x-elastic-client-meta header https://github.com/elastic/elasticsearch-js/pull/1373[#1373]
|
||||
|
||||
Adds the `x-elastic-client-meta` HTTP header which is used by Elastic Cloud
|
||||
and can be disabled with the `enableMetaHeader` parameter set to `false`.
|
||||
Adds the `x-elastic-client-meta` HTTP header which is used by Elastic Cloud and
|
||||
can be disabled with the `enableMetaHeader` parameter set to `false`.
|
||||
|
||||
[discrete]
|
||||
==== Fixes
|
||||
@ -81,9 +260,10 @@ and can be disabled with the `enableMetaHeader` parameter set to `false`.
|
||||
[discrete]
|
||||
===== Fixes req.abort() with a body that is a stream calls callback(err) twice https://github.com/elastic/elasticsearch-js/pull/1376[#1376]
|
||||
|
||||
When using a body that is a stream to client.search(), and calling req.abort(), the callback is called twice.
|
||||
Once for the RequestAbortedError, as expected, and once for a "premature close" error from end-of-stream, used by pump, used by the client.
|
||||
This issue has now been fixed.
|
||||
When using a body that is a stream to client.search(), and calling req.abort(),
|
||||
the callback is called twice. Once for the RequestAbortedError, as expected, and
|
||||
once for a "premature close" error from end-of-stream, used by pump, used by the
|
||||
client. This issue has now been fixed.
|
||||
|
||||
[discrete]
|
||||
=== 7.10.0
|
||||
@ -94,14 +274,15 @@ This issue has now been fixed.
|
||||
[discrete]
|
||||
===== Support for Elasticsearch `v7.10`.
|
||||
|
||||
You can find all the API changes https://www.elastic.co/guide/en/elasticsearch/reference/7.10/release-notes-7.10.0.html[here].
|
||||
You can find all the API changes
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/7.10/release-notes-7.10.0.html[here].
|
||||
|
||||
[discrete]
|
||||
===== Added proxy support https://github.com/elastic/elasticsearch-js/pull/1260[#1260]
|
||||
|
||||
If you need to pass through an http(s) proxy for connecting to Elasticsearch, the client offers
|
||||
out of the box a handy configuration for helping you with it. Under the hood it
|
||||
uses the https://github.com/delvedor/hpagent[`hpagent`] module.
|
||||
If you need to pass through an http(s) proxy for connecting to {es}, the client
|
||||
offers out of the box a handy configuration for helping you with it. Under the
|
||||
hood it uses the https://github.com/delvedor/hpagent[`hpagent`] module.
|
||||
|
||||
[source,js]
|
||||
----
|
||||
@ -127,14 +308,16 @@ const client = new Client({
|
||||
[discrete]
|
||||
===== Scroll search should clear the scroll at the end https://github.com/elastic/elasticsearch-js/pull/1331[#1331]
|
||||
|
||||
From now on the scroll search helper will automatically close the scroll on Elasticsearch,
|
||||
by doing so, Elasticsearch will free resources faster.
|
||||
From now on the scroll search helper will automatically close the scroll on
|
||||
{es}, by doing so, {es} will free resources faster.
|
||||
|
||||
[discrete]
|
||||
===== Handle connectivity issues while reading the body https://github.com/elastic/elasticsearch-js/pull/1343[#1343]
|
||||
|
||||
It might happen that the underlying socket stops working due to an external cause while reading the body.
|
||||
This could lead to an unwanted `DeserialzationError`. From now, this will be handled as a generic `ConnectionError`.
|
||||
It might happen that the underlying socket stops working due to an external
|
||||
cause while reading the body. This could lead to an unwanted
|
||||
`DeserialzationError`. From now, this will be handled as a generic
|
||||
`ConnectionError`.
|
||||
|
||||
[discrete]
|
||||
==== Warnings
|
||||
@ -142,12 +325,14 @@ This could lead to an unwanted `DeserialzationError`. From now, this will be han
|
||||
[discrete]
|
||||
===== Add warning log about nodejs version support https://github.com/elastic/elasticsearch-js/pull/1349[#1349]
|
||||
|
||||
`7.11` will be the last version of the client that will support Node.js v8, while `7.12` will be
|
||||
the last one that supports Node.js v10. If you are eusing this versions you will see a
|
||||
`DeprecationWaring` in your logs. We strongly recommend to upgrade to newer versions of Node.js
|
||||
as usng an EOL version will expose you to securty risks.
|
||||
`7.11` will be the last version of the client that will support Node.js v8,
|
||||
while `7.12` will be the last one that supports Node.js v10. If you are using
|
||||
this versions you will see a `DeprecationWaring` in your logs. We strongly
|
||||
recommend to upgrade to newer versions of Node.js as usng an EOL version will
|
||||
expose you to securty risks.
|
||||
|
||||
Please refer to https://ela.st/nodejs-support[ela.st/nodejs-support] for additional information.
|
||||
Please refer to https://ela.st/nodejs-support[ela.st/nodejs-support] for
|
||||
additional information.
|
||||
|
||||
[discrete]
|
||||
=== 7.9.1
|
||||
@ -158,24 +343,33 @@ Please refer to https://ela.st/nodejs-support[ela.st/nodejs-support] for additio
|
||||
[discrete]
|
||||
===== Improve child performances https://github.com/elastic/elasticsearch-js/pull/1314[#1314]
|
||||
|
||||
The client code has been refactored to speed up the performances of the child method.
|
||||
Before this pr, creating many children per second would have caused a high memory consumption and a spike in CPU usage.
|
||||
This pr changes the way the client is created by refactoring the code generation, now the clients methods are no longer added to the instance with a for loop but via prototypal inheritance. Thus, the overall performances are way better, now creating a child is ~5 times faster, and it consumes ~70% less memory.
|
||||
The client code has been refactored to speed up the performances of the child
|
||||
method. Before this pr, creating many children per second would have caused a
|
||||
high memory consumption and a spike in CPU usage. This pr changes the way the
|
||||
client is created by refactoring the code generation, now the clients methods
|
||||
are no longer added to the instance with a for loop but via prototypal
|
||||
inheritance. Thus, the overall performances are way better, now creating a child
|
||||
is ~5 times faster, and it consumes ~70% less memory.
|
||||
|
||||
This change should not cause any breaking change unless you were mocking the client methods. In such case you should refactor it, or use https://github.com/elastic/elasticsearch-js-mock[elasticsearch-js-mock].
|
||||
This change should not cause any breaking change unless you were mocking the
|
||||
client methods. In such case you should refactor it, or use
|
||||
https://github.com/elastic/elasticsearch-js-mock[elasticsearch-js-mock].
|
||||
|
||||
Finally, this change should also fix once and of all the bundlers support.
|
||||
|
||||
[discrete]
|
||||
===== Throw all errors asynchronously https://github.com/elastic/elasticsearch-js/pull/1295[#1295]
|
||||
|
||||
Some validation errors were thrown synchronously, causing the callback to be called in th same tick.
|
||||
This issue is known as _"The release fo Zalgo"_ (see https://blog.izs.me/2013/08/designing-apis-for-asynchrony[here]).
|
||||
Some validation errors were thrown synchronously, causing the callback to be
|
||||
called in th same tick. This issue is known as _"The release fo Zalgo"_ (see
|
||||
https://blog.izs.me/2013/08/designing-apis-for-asynchrony[here]).
|
||||
|
||||
[discrete]
|
||||
===== Fix `maxRetries` request option handling https://github.com/elastic/elasticsearch-js/pull/1296[#1296]
|
||||
|
||||
The `maxRetries` parameter can be configured on a per requets basis, if set to zero it was defaulting to the client default. Now the client is honoring the request specific configuration.
|
||||
The `maxRetries` parameter can be configured on a per requets basis, if set to
|
||||
zero it was defaulting to the client default. Now the client is honoring the
|
||||
request specific configuration.
|
||||
|
||||
[discrete]
|
||||
===== Fix RequestOptions.body type to include null https://github.com/elastic/elasticsearch-js/pull/1300[#1300]
|
||||
@ -185,8 +379,8 @@ The Connection requets option types were not accepting `null` as valid value.
|
||||
[discrete]
|
||||
===== Fixed `size` and `maxRetries` parameters in helpers https://github.com/elastic/elasticsearch-js/pull/1284[#1284]
|
||||
|
||||
The `size` parameter was being passed too the scroll request, which was causing an error.
|
||||
`maxRetries` setted to 0 was resulting in no request at all.
|
||||
The `size` parameter was being passed too the scroll request, which was causing
|
||||
an error. Value of `maxRetries` set to 0 was resulting in no request at all.
|
||||
|
||||
[discrete]
|
||||
=== 7.9.0
|
||||
@ -197,7 +391,7 @@ The `size` parameter was being passed too the scroll request, which was causing
|
||||
[discrete]
|
||||
===== Add ability to disable the http agent https://github.com/elastic/elasticsearch-js/pull/1251[#1251]
|
||||
|
||||
If needed, the http agent can be disabled by setting it to `false`
|
||||
If needed, the http agent can be disabled by setting it to `false`.
|
||||
|
||||
[source,js]
|
||||
----
|
||||
@ -211,8 +405,9 @@ const client = new Client({
|
||||
[discrete]
|
||||
===== Add support for a global context option https://github.com/elastic/elasticsearch-js/pull/1256[#1256]
|
||||
|
||||
Before this, you could set a `context` option in each request, but there was no way of setting it globally.
|
||||
Now you can by configuring the `context` object in the global configuration, that will be merged with the local one.
|
||||
Before this, you could set a `context` option in each request, but there was no
|
||||
way of setting it globally. Now you can by configuring the `context` object in
|
||||
the global configuration, that will be merged with the local one.
|
||||
|
||||
[source,js]
|
||||
----
|
||||
@ -239,7 +434,8 @@ import { Client } from '@elastic/elasticsearch'
|
||||
[discrete]
|
||||
===== Allow the client name to be a symbol https://github.com/elastic/elasticsearch-js/pull/1254[#1254]
|
||||
|
||||
It was possible in plain JavaScript, but not in TypeScript, now you can do it in TypeScript as well.
|
||||
It was possible in plain JavaScript, but not in TypeScript, now you can do it in
|
||||
TypeScript as well.
|
||||
|
||||
[source,js]
|
||||
----
|
||||
@ -258,14 +454,18 @@ Only `Record<string, any>` was allowed. Now `string` is allowed as well.
|
||||
[discrete]
|
||||
===== Fixed type definitions https://github.com/elastic/elasticsearch-js/pull/1263[#1263]
|
||||
|
||||
* The `transport.request` defintion was incorrect, it was returning a `Promise<T>` instead of `TransportRequestPromise<T>`.
|
||||
* The `refresh` parameter of most APIs was declared as `'true' | 'false' | 'wait_for'`, which was clunky. Now is `'wait_for' | boolean`.
|
||||
* The `transport.request` defintion was incorrect, it was returning a
|
||||
`Promise<T>` instead of `TransportRequestPromise<T>`.
|
||||
* The `refresh` parameter of most APIs was declared as
|
||||
`'true' | 'false' | 'wait_for'`, which was clunky. Now is
|
||||
`'wait_for' | boolean`.
|
||||
|
||||
[discrete]
|
||||
===== Generate response type as boolean if the request is HEAD only https://github.com/elastic/elasticsearch-js/pull/1275[#1275]
|
||||
|
||||
All HEAD request will have the body casted to a boolean value, `true` in case of a 200 response, `false` in case of
|
||||
a 404 response. The type definitions were not reflecting this behavior.
|
||||
All HEAD request will have the body casted to a boolean value, `true` in case of
|
||||
a 200 response, `false` in case of a 404 response. The type definitions were not
|
||||
reflecting this behavior.
|
||||
|
||||
[source,ts]
|
||||
----
|
||||
@ -284,19 +484,24 @@ console.log(body) // either `true` or `false`
|
||||
[discrete]
|
||||
===== Updated default http agent configuration https://github.com/elastic/elasticsearch-js/pull/1242[#1242]
|
||||
|
||||
Added the scheduling: 'lifo' option to the default HTTP agent configuration to avoid maximizing the open sockets
|
||||
against Elasticsearch and lowering the risk of encountering socket timeouts.
|
||||
This feature is only available from Node v14.5+, but it should be backported to v10 and v12. (https://github.com/nodejs/node/pull/33278[nodejs/node#33278])
|
||||
Added the scheduling: 'lifo' option to the default HTTP agent configuration to
|
||||
avoid maximizing the open sockets against {es} and lowering the risk of
|
||||
encountering socket timeouts. This feature is only available from Node v14.5+,
|
||||
but it should be backported to v10 and v12
|
||||
(https://github.com/nodejs/node/pull/33278[nodejs/node#33278]).
|
||||
|
||||
[discrete]
|
||||
===== Improve child API https://github.com/elastic/elasticsearch-js/pull/1245[#1245]
|
||||
|
||||
This pr introduce two changes which should not impact the surface API:
|
||||
|
||||
* Refactored the `client.child` API to allocate fewer objects, this change improves memory consumption over time
|
||||
and improves the child creation performances by ~12%.
|
||||
* The client no longer inherits from the EventEmitter class, but instead has an internal event emitter and exposes
|
||||
only the API useful for the users, namely `emit, `on`, `once`, and `off`. The type definitions have been updated accordingly.
|
||||
* Refactored the `client.child` API to allocate fewer objects, this change
|
||||
improves memory consumption over time and improves the child creation
|
||||
performances by ~12%.
|
||||
* The client no longer inherits from the EventEmitter class, but instead has an
|
||||
internal event emitter and exposes only the API useful for the users, namely
|
||||
`emit, `on`, `once`, and `off`. The type definitions have been updated
|
||||
accordingly.
|
||||
|
||||
[discrete]
|
||||
=== 7.8.0
|
||||
@ -312,9 +517,11 @@ You can find all the API changes https://www.elastic.co/guide/en/elasticsearch/r
|
||||
[discrete]
|
||||
===== Added multi search helper https://github.com/elastic/elasticsearch-js/pull/1186[#1186]
|
||||
|
||||
If you are sending search request at a high rate, this helper might be useful for you.
|
||||
It will use the mutli search API under the hood to batch the requests and improve the overall performances of your application. +
|
||||
The `result` exposes a `documents` property as well, which allows you to access directly the hits sources.
|
||||
If you are sending search request at a high rate, this helper might be useful
|
||||
for you. It will use the mutli search API under the hood to batch the requests
|
||||
and improve the overall performances of your application. The `result` exposes a
|
||||
`documents` property as well, which allows you to access directly the hits
|
||||
sources.
|
||||
|
||||
[source,js]
|
||||
----
|
||||
@ -345,8 +552,11 @@ m.search(
|
||||
[discrete]
|
||||
===== Added timeout support in bulk and msearch helpers https://github.com/elastic/elasticsearch-js/pull/1206[#1206]
|
||||
|
||||
If there is a slow producer, the bulk helper might send data with a very large period of time, and if the process crashes for any reason, the data would be lost.
|
||||
This pr introduces a `flushInterval` option in the bulk helper to avoid this issue. By default, the bulk helper will flush the data automatically every 30 seconds, unless the threshold has been reached before.
|
||||
If there is a slow producer, the bulk helper might send data with a very large
|
||||
period of time, and if the process crashes for any reason, the data would be
|
||||
lost. This pr introduces a `flushInterval` option in the bulk helper to avoid
|
||||
this issue. By default, the bulk helper will flush the data automatically every
|
||||
30 seconds, unless the threshold has been reached before.
|
||||
|
||||
[source,js]
|
||||
----
|
||||
@ -355,7 +565,9 @@ const b = client.helpers.bulk({
|
||||
})
|
||||
----
|
||||
|
||||
The same problem might happen with the multi search helper, where the user is not sending search requests fast enough. A `flushInterval` options has been added as well, with a default value of 500 milliseconds.
|
||||
The same problem might happen with the multi search helper, where the user is
|
||||
not sending search requests fast enough. A `flushInterval` options has been
|
||||
added as well, with a default value of 500 milliseconds.
|
||||
|
||||
[source,js]
|
||||
----
|
||||
@ -370,12 +582,17 @@ const m = client.helpers.msearch({
|
||||
[discrete]
|
||||
===== Use filter_path for improving the search helpers performances https://github.com/elastic/elasticsearch-js/pull/1199[#1199]
|
||||
|
||||
From now on, all he search helpers will use the `filter_path` option automatically when needed to retrieve only the hits source. This change will result in less netwprk traffic and improved deserialization performances.
|
||||
From now on, all he search helpers will use the `filter_path` option
|
||||
automatically when needed to retrieve only the hits source. This change will
|
||||
result in less netwprk traffic and improved deserialization performances.
|
||||
|
||||
[discrete]
|
||||
===== Search helpers documents getter https://github.com/elastic/elasticsearch-js/pull/1186[#1186]
|
||||
|
||||
Before this, the `documents` key that you can access in any search helper was computed as soon as we got the search result from Elasticsearch. With this change the `documents` key is now a getter, which makes this procees lazy, resulting in better performances and lower memory impact.
|
||||
Before this, the `documents` key that you can access in any search helper was
|
||||
computed as soon as we got the search result from Elasticsearch. With this
|
||||
change the `documents` key is now a getter, which makes this process lazy,
|
||||
resulting in better performances and lower memory impact.
|
||||
|
||||
[discrete]
|
||||
=== 7.7.1
|
||||
@ -386,13 +603,15 @@ Before this, the `documents` key that you can access in any search helper was co
|
||||
[discrete]
|
||||
===== Disable client Helpers in Node.js < 10 - https://github.com/elastic/elasticsearch-js/pull/1194[#1194]
|
||||
|
||||
The client helpers can't be used in Node.js < 10 because it needs a custom flag to be able to use them.
|
||||
Given that not every provider allows the user to specify cuatom Node.js flags, the Helpers has been disabled completely in Node.js < 10.
|
||||
The client helpers can't be used in Node.js < 10 because it needs a custom flag
|
||||
to be able to use them. Given that not every provider allows the user to specify
|
||||
custom Node.js flags, the Helpers has been disabled completely in Node.js < 10.
|
||||
|
||||
[discrete]
|
||||
===== Force lowercase in all headers - https://github.com/elastic/elasticsearch-js/pull/1187[#1187]
|
||||
|
||||
Now all the user-provided headers names will be lowercased by default, so there will be no conflicts in case of the same header with different casing.
|
||||
Now all the user-provided headers names will be lowercased by default, so there
|
||||
will be no conflicts in case of the same header with different casing.
|
||||
|
||||
[discrete]
|
||||
=== 7.7.0
|
||||
@ -403,14 +622,17 @@ Now all the user-provided headers names will be lowercased by default, so there
|
||||
[discrete]
|
||||
===== Support for Elasticsearch `v7.7`.
|
||||
|
||||
You can find all the API changes https://www.elastic.co/guide/en/elasticsearch/reference/7.7/release-notes-7.7.0.html[here].
|
||||
You can find all the API changes
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/7.7/release-notes-7.7.0.html[here].
|
||||
|
||||
[discrete]
|
||||
===== Introduced client helpers - https://github.com/elastic/elasticsearch-js/pull/1107[#1107]
|
||||
|
||||
From now on, the client comes with an handy collection of helpers to give you a more comfortable experience with some APIs.
|
||||
From now on, the client comes with an handy collection of helpers to give you a
|
||||
more comfortable experience with some APIs.
|
||||
|
||||
CAUTION: The client helpers are experimental, and the API may change in the next minor releases.
|
||||
CAUTION: The client helpers are experimental, and the API may change in the next
|
||||
minor releases.
|
||||
|
||||
The following helpers has been introduced:
|
||||
|
||||
@ -422,13 +644,17 @@ The following helpers has been introduced:
|
||||
[discrete]
|
||||
===== The `ConnectionPool.getConnection` now always returns a `Connection` - https://github.com/elastic/elasticsearch-js/pull/1127[#1127]
|
||||
|
||||
What does this mean? It means that you will see less `NoLivingConnectionError`, which now can only be caused if you set a selector/filter too strict.
|
||||
For improving the debugging experience, the `NoLivingConnectionsError` error message has been updated.
|
||||
What does this mean? It means that you will see less `NoLivingConnectionError`,
|
||||
which now can only be caused if you set a selector/filter too strict. For
|
||||
improving the debugging experience, the `NoLivingConnectionsError` error message
|
||||
has been updated.
|
||||
|
||||
[discrete]
|
||||
===== Abortable promises - https://github.com/elastic/elasticsearch-js/pull/1141[#1141]
|
||||
|
||||
From now on, it will be possible to abort a request generated with the promise-styl API. If you abort a request generated from a promise, the promise will be rejected with a `RequestAbortedError`.
|
||||
From now on, it will be possible to abort a request generated with the
|
||||
promise-styl API. If you abort a request generated from a promise, the promise
|
||||
will be rejected with a `RequestAbortedError`.
|
||||
|
||||
|
||||
[source,js]
|
||||
@ -449,7 +675,10 @@ promise.abort()
|
||||
[discrete]
|
||||
===== Major refactor of the Type Definitions - https://github.com/elastic/elasticsearch-js/pull/1119[#1119] https://github.com/elastic/elasticsearch-js/issues/1130[#1130] https://github.com/elastic/elasticsearch-js/pull/1132[#1132]
|
||||
|
||||
Now every API makes better use of the generics and overloading, so you can (or not, by default request/response bodies are `Record<string, any>`) define the request/response bodies in the generics.
|
||||
Now every API makes better use of the generics and overloading, so you can (or
|
||||
not, by default request/response bodies are `Record<string, any>`) define the
|
||||
request/response bodies in the generics.
|
||||
|
||||
[source,ts]
|
||||
----
|
||||
// request and response bodies are generics
|
||||
@ -460,7 +689,11 @@ client.search<SearchResponse>(...)
|
||||
client.search<SearchResponse, SearchBody>(...)
|
||||
----
|
||||
|
||||
This *should* not be a breaking change, as every generics defaults to `any`. It might happen to some users that the code breaks, but our test didn't detect any of it, probably because they were not robust enough. However, given the gigantic improvement in the developer experience, we have decided to release this change in the 7.x line.
|
||||
This *should* not be a breaking change, as every generics defaults to `any`. It
|
||||
might happen to some users that the code breaks, but our test didn't detect any
|
||||
of it, probably because they were not robust enough. However, given the gigantic
|
||||
improvement in the developer experience, we have decided to release this change
|
||||
in the 7.x line.
|
||||
|
||||
[discrete]
|
||||
==== Fixes
|
||||
@ -468,35 +701,51 @@ This *should* not be a breaking change, as every generics defaults to `any`. It
|
||||
[discrete]
|
||||
===== The `ConnectionPool.update` method now cleans the `dead` list - https://github.com/elastic/elasticsearch-js/issues/1122[#1122] https://github.com/elastic/elasticsearch-js/pull/1127[#1127]
|
||||
|
||||
It can happen in a situation where we are updating the connections list and running sniff, leaving the `dead` list in a dirty state. Now the `ConnectionPool.update` cleans up the `dead` list every time, which makes way more sense given that all the new connections are alive.
|
||||
It can happen in a situation where we are updating the connections list and
|
||||
running sniff, leaving the `dead` list in a dirty state. Now the
|
||||
`ConnectionPool.update` cleans up the `dead` list every time, which makes way
|
||||
more sense given that all the new connections are alive.
|
||||
|
||||
[discrete]
|
||||
===== `ConnectionPoolmarkDead` should ignore connections that no longer exists - https://github.com/elastic/elasticsearch-js/pull/1159[#1159]
|
||||
|
||||
It might happen that markDead is called just after a pool update, and in such case, the clint was adding the dead list a node that no longer exists, causing unhandled exceptions later.
|
||||
It might happen that markDead is called just after a pool update, and in such
|
||||
case, the client was adding the dead list a node that no longer exists, causing
|
||||
unhandled exceptions later.
|
||||
|
||||
[discrete]
|
||||
===== Do not retry a request if the body is a stream - https://github.com/elastic/elasticsearch-js/pull/1143[#1143]
|
||||
|
||||
The client should not retry if it's sending a stream body, because it should store in memory a copy of the stream to be able to send it again, but since it doesn't know in advance the size of the stream, it risks to take too much memory.
|
||||
Furthermore, copying everytime the stream is very an expensive operation.
|
||||
The client should not retry if it's sending a stream body, because it should
|
||||
store in memory a copy of the stream to be able to send it again, but since it
|
||||
doesn't know in advance the size of the stream, it risks to take too much
|
||||
memory. Furthermore, copying everytime the stream is very an expensive
|
||||
operation.
|
||||
|
||||
[discrete]
|
||||
===== Return an error if the request has been aborted - https://github.com/elastic/elasticsearch-js/pull/1141[#1141]
|
||||
|
||||
Until now, aborting a request was blocking the HTTP request, but never calling the callback or resolving the promise to notify the user. This is a bug because it could lead to dangerous memory leaks. From now on if the user calls the `request.abort()` method, the callback style API will be called with a `RequestAbortedError`, the promise will be rejected with `RequestAbortedError` as well.
|
||||
Until now, aborting a request was blocking the HTTP request, but never calling
|
||||
the callback or resolving the promise to notify the user. This is a bug because
|
||||
it could lead to dangerous memory leaks. From now on if the user calls the
|
||||
`request.abort()` method, the callback style API will be called with a
|
||||
`RequestAbortedError`, the promise will be rejected with `RequestAbortedError`
|
||||
as well.
|
||||
|
||||
[discrete]
|
||||
=== 7.6.1
|
||||
|
||||
**Fixes:**
|
||||
|
||||
- Secure json parsing - https://github.com/elastic/elasticsearch-js/pull/1110[#1110]
|
||||
- ApiKey should take precedence over basic auth - https://github.com/elastic/elasticsearch-js/pull/1115[#1115]
|
||||
- Secure json parsing -
|
||||
https://github.com/elastic/elasticsearch-js/pull/1110[#1110]
|
||||
- ApiKey should take precedence over basic auth -
|
||||
https://github.com/elastic/elasticsearch-js/pull/1115[#1115]
|
||||
|
||||
**Documentation:**
|
||||
|
||||
- Fix typo in api reference - https://github.com/elastic/elasticsearch-js/pull/1109[#1109]
|
||||
- Fix typo in api reference -
|
||||
https://github.com/elastic/elasticsearch-js/pull/1109[#1109]
|
||||
|
||||
[discrete]
|
||||
=== 7.6.0
|
||||
@ -508,16 +757,23 @@ Support for Elasticsearch `v7.6`.
|
||||
|
||||
**Fixes:**
|
||||
|
||||
- Skip compression in case of empty string body - https://github.com/elastic/elasticsearch-js/pull/1080[#1080]
|
||||
- Fix typo in NoLivingConnectionsError - https://github.com/elastic/elasticsearch-js/pull/1045[#1045]
|
||||
- Change TransportRequestOptions.ignore to number[] - https://github.com/elastic/elasticsearch-js/pull/1053[#1053]
|
||||
- ClientOptions["cloud"] should have optional auth fields - https://github.com/elastic/elasticsearch-js/pull/1032[#1032]
|
||||
- Skip compression in case of empty string body -
|
||||
https://github.com/elastic/elasticsearch-js/pull/1080[#1080]
|
||||
- Fix typo in NoLivingConnectionsError -
|
||||
https://github.com/elastic/elasticsearch-js/pull/1045[#1045]
|
||||
- Change TransportRequestOptions.ignore to number[] -
|
||||
https://github.com/elastic/elasticsearch-js/pull/1053[#1053]
|
||||
- ClientOptions["cloud"] should have optional auth fields -
|
||||
https://github.com/elastic/elasticsearch-js/pull/1032[#1032]
|
||||
|
||||
**Documentation:**
|
||||
|
||||
- Docs: Return super in example Transport subclass - https://github.com/elastic/elasticsearch-js/pull/980[#980]
|
||||
- Add examples to reference - https://github.com/elastic/elasticsearch-js/pull/1076[#1076]
|
||||
- Added new examples - https://github.com/elastic/elasticsearch-js/pull/1031[#1031]
|
||||
- Docs: Return super in example Transport subclass -
|
||||
https://github.com/elastic/elasticsearch-js/pull/980[#980]
|
||||
- Add examples to reference -
|
||||
https://github.com/elastic/elasticsearch-js/pull/1076[#1076]
|
||||
- Added new examples -
|
||||
https://github.com/elastic/elasticsearch-js/pull/1031[#1031]
|
||||
|
||||
[discrete]
|
||||
=== 7.5.0
|
||||
@ -535,16 +791,22 @@ Support for Elasticsearch `v7.4`.
|
||||
|
||||
**Fixes:**
|
||||
|
||||
- Fix issue; node roles are defaulting to true when undefined is breaking usage of nodeFilter option - https://github.com/elastic/elasticsearch-js/pull/967[#967]
|
||||
- Fix issue; node roles are defaulting to true when undefined is breaking usage
|
||||
of nodeFilter option -
|
||||
https://github.com/elastic/elasticsearch-js/pull/967[#967]
|
||||
|
||||
**Documentation:**
|
||||
|
||||
- Updated API reference doc - https://github.com/elastic/elasticsearch-js/pull/945[#945] https://github.com/elastic/elasticsearch-js/pull/969[#969]
|
||||
- Fix inaccurate description sniffEndpoint - https://github.com/elastic/elasticsearch-js/pull/959[#959]
|
||||
- Updated API reference doc -
|
||||
https://github.com/elastic/elasticsearch-js/pull/945[#945],
|
||||
https://github.com/elastic/elasticsearch-js/pull/969[#969]
|
||||
- Fix inaccurate description sniffEndpoint -
|
||||
https://github.com/elastic/elasticsearch-js/pull/959[#959]
|
||||
|
||||
**Internals:**
|
||||
|
||||
- Update code generation https://github.com/elastic/elasticsearch-js/pull/969[#969]
|
||||
- Update code generation
|
||||
https://github.com/elastic/elasticsearch-js/pull/969[#969]
|
||||
|
||||
[discrete]
|
||||
=== 7.3.0
|
||||
@ -553,21 +815,27 @@ Support for Elasticsearch `v7.3`.
|
||||
|
||||
**Features:**
|
||||
|
||||
- Added `auth` option - https://github.com/elastic/elasticsearch-js/pull/908[#908]
|
||||
- Added support for `ApiKey` authentication - https://github.com/elastic/elasticsearch-js/pull/908[#908]
|
||||
- Added `auth` option -
|
||||
https://github.com/elastic/elasticsearch-js/pull/908[#908]
|
||||
- Added support for `ApiKey` authentication -
|
||||
https://github.com/elastic/elasticsearch-js/pull/908[#908]
|
||||
|
||||
**Fixes:**
|
||||
|
||||
- fix(Typings): sniffInterval can also be boolean - https://github.com/elastic/elasticsearch-js/pull/914[#914]
|
||||
- fix(Typings): sniffInterval can also be boolean -
|
||||
https://github.com/elastic/elasticsearch-js/pull/914[#914]
|
||||
|
||||
**Internals:**
|
||||
|
||||
- Refactored connection pool - https://github.com/elastic/elasticsearch-js/pull/913[#913]
|
||||
- Refactored connection pool -
|
||||
https://github.com/elastic/elasticsearch-js/pull/913[#913]
|
||||
|
||||
**Documentation:**
|
||||
|
||||
- Better reference code examples - https://github.com/elastic/elasticsearch-js/pull/920[#920]
|
||||
- Improve README - https://github.com/elastic/elasticsearch-js/pull/909[#909]
|
||||
- Better reference code examples -
|
||||
https://github.com/elastic/elasticsearch-js/pull/920[#920]
|
||||
- Improve README -
|
||||
https://github.com/elastic/elasticsearch-js/pull/909[#909]
|
||||
|
||||
[discrete]
|
||||
=== 7.2.0
|
||||
@ -576,7 +844,8 @@ Support for Elasticsearch `v7.2`
|
||||
|
||||
**Fixes:**
|
||||
|
||||
- Remove auth data from inspect and toJSON in connection class - https://github.com/elastic/elasticsearch-js/pull/887[#887]
|
||||
- Remove auth data from inspect and toJSON in connection class -
|
||||
https://github.com/elastic/elasticsearch-js/pull/887[#887]
|
||||
|
||||
[discrete]
|
||||
=== 7.1.0
|
||||
@ -585,18 +854,28 @@ Support for Elasticsearch `v7.1`
|
||||
|
||||
**Fixes:**
|
||||
|
||||
- Support for non-friendly chars in url username and password - https://github.com/elastic/elasticsearch-js/pull/858[#858]
|
||||
- Patch deprecated parameters - https://github.com/elastic/elasticsearch-js/pull/851[#851]
|
||||
- Support for non-friendly chars in url username and password -
|
||||
https://github.com/elastic/elasticsearch-js/pull/858[#858]
|
||||
- Patch deprecated parameters -
|
||||
https://github.com/elastic/elasticsearch-js/pull/851[#851]
|
||||
|
||||
[discrete]
|
||||
=== 7.0.1
|
||||
|
||||
**Fixes:**
|
||||
|
||||
- Fix TypeScript export *(issue https://github.com/elastic/elasticsearch-js/pull/841[#841])* - https://github.com/elastic/elasticsearch-js/pull/842[#842]
|
||||
- Fix http and https port handling *(issue https://github.com/elastic/elasticsearch-js/pull/843[#843])* - https://github.com/elastic/elasticsearch-js/pull/845[#845]
|
||||
- Fix TypeScript definiton *(issue https://github.com/elastic/elasticsearch-js/pull/803[#803])* - https://github.com/elastic/elasticsearch-js/pull/846[#846]
|
||||
- Added toJSON method to Connection class *(issue https://github.com/elastic/elasticsearch-js/pull/848[#848])* - https://github.com/elastic/elasticsearch-js/pull/849[#849]
|
||||
- Fix TypeScript export *(issue
|
||||
https://github.com/elastic/elasticsearch-js/pull/841[#841])* -
|
||||
https://github.com/elastic/elasticsearch-js/pull/842[#842]
|
||||
- Fix http and https port handling *(issue
|
||||
https://github.com/elastic/elasticsearch-js/pull/843[#843])* -
|
||||
https://github.com/elastic/elasticsearch-js/pull/845[#845]
|
||||
- Fix TypeScript definiton *(issue
|
||||
https://github.com/elastic/elasticsearch-js/pull/803[#803])* -
|
||||
https://github.com/elastic/elasticsearch-js/pull/846[#846]
|
||||
- Added toJSON method to Connection class *(issue
|
||||
https://github.com/elastic/elasticsearch-js/pull/848[#848])* -
|
||||
https://github.com/elastic/elasticsearch-js/pull/849[#849]
|
||||
|
||||
[discrete]
|
||||
=== 7.0.0
|
||||
|
||||
@ -8,8 +8,10 @@ This page contains the information you need to connect and use the Client with
|
||||
|
||||
* <<auth-reference, Authentication options>>
|
||||
* <<client-usage, Using the client>>
|
||||
* <<client-faas-env, Using the Client in a Function-as-a-Service Environment>>
|
||||
* <<client-connect-proxy, Connecting through a proxy>>
|
||||
* <<client-error-handling, Handling errors>>
|
||||
* <<product-check, Automatic product check>>
|
||||
|
||||
[discrete]
|
||||
[[authentication]]
|
||||
@ -59,11 +61,12 @@ const client = new Client({
|
||||
==== ApiKey authentication
|
||||
|
||||
You can use the
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-create-api-key.html[ApiKey]
|
||||
{ref-7x}/security-api-create-api-key.html[ApiKey]
|
||||
authentication by passing the `apiKey` parameter via the `auth` option. The
|
||||
`apiKey` parameter can be either a base64 encoded string or an object with the
|
||||
values that you can obtain from the
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-create-api-key.html[create api key endpoint].
|
||||
{ref-7x}/security-api-create-api-key.html[create api key endpoint].
|
||||
|
||||
|
||||
NOTE: If you provide both basic authentication credentials and the ApiKey
|
||||
configuration, the ApiKey takes precedence.
|
||||
@ -93,6 +96,26 @@ const client = new Client({
|
||||
})
|
||||
----
|
||||
|
||||
[discrete]
|
||||
[[auth-bearer]]
|
||||
==== Bearer authentication
|
||||
|
||||
You can provide your credentials by passing the `bearer` token
|
||||
parameter via the `auth` option.
|
||||
Useful for https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-service-token.html[service account tokens].
|
||||
Be aware that it does not handle automatic token refresh.
|
||||
|
||||
[source,js]
|
||||
----
|
||||
const { Client } = require('@elastic/elasticsearch')
|
||||
const client = new Client({
|
||||
node: 'https://localhost:9200',
|
||||
auth: {
|
||||
bearer: 'token'
|
||||
}
|
||||
})
|
||||
----
|
||||
|
||||
|
||||
[discrete]
|
||||
[[auth-basic]]
|
||||
@ -156,6 +179,29 @@ const client = new Client({
|
||||
})
|
||||
----
|
||||
|
||||
[discrete]
|
||||
[[auth-ca-fingerprint]]
|
||||
==== CA fingerprint
|
||||
|
||||
You can configure the client to only trust certificates that are signed by a specific CA certificate ( CA certificate pinning ) by providing a `caFingerprint` option. This will verify that the fingerprint of the CA certificate that has signed the certificate of the server matches the supplied value.
|
||||
a `caFingerprint` option, which will verify the supplied certificate authority fingerprint.
|
||||
You must configure a SHA256 digest.
|
||||
|
||||
[source,js]
|
||||
----
|
||||
const { Client } = require('@elastic/elasticsearch')
|
||||
const client = new Client({
|
||||
node: 'https://example.com'
|
||||
auth: { ... },
|
||||
// the fingerprint (SHA256) of the CA certificate that is used to sign the certificate that the Elasticsearch node presents for TLS.
|
||||
caFingerprint: '20:0D:CA:FA:76:...',
|
||||
ssl: {
|
||||
// might be required if it's a self-signed certificate
|
||||
rejectUnauthorized: false
|
||||
}
|
||||
})
|
||||
----
|
||||
|
||||
[discrete]
|
||||
[[client-usage]]
|
||||
=== Usage
|
||||
@ -373,8 +419,87 @@ _Default:_ `null`
|
||||
|`context`
|
||||
|`any` - Custom object per request. _(you can use it to pass data to the clients events)_ +
|
||||
_Default:_ `null`
|
||||
|
||||
|`maxResponseSize`
|
||||
|`number` - When configured, it verifies that the uncompressed response size is lower than the configured number, if it's higher it will abort the request. It cannot be higher than buffer.constants.MAX_STRING_LENTGH +
|
||||
_Default:_ `null`
|
||||
|
||||
|`maxCompressedResponseSize`
|
||||
|`number` - When configured, it verifies that the compressed response size is lower than the configured number, if it's higher it will abort the request. It cannot be higher than buffer.constants.MAX_LENTGH +
|
||||
_Default:_ `null`
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
[[client-faas-env]]
|
||||
=== Using the Client in a Function-as-a-Service Environment
|
||||
|
||||
This section illustrates the best practices for leveraging the {es} client in a Function-as-a-Service (FaaS) environment.
|
||||
The most influential optimization is to initialize the client outside of the function, the global scope.
|
||||
This practice does not only improve performance but also enables background functionality as – for example – https://www.elastic.co/blog/elasticsearch-sniffing-best-practices-what-when-why-how[sniffing].
|
||||
The following examples provide a skeleton for the best practices.
|
||||
|
||||
[discrete]
|
||||
==== GCP Cloud Functions
|
||||
|
||||
[source,js]
|
||||
----
|
||||
'use strict'
|
||||
|
||||
const { Client } = require('@elastic/elasticsearch')
|
||||
|
||||
const client = new Client({
|
||||
// client initialisation
|
||||
})
|
||||
|
||||
exports.testFunction = async function (req, res) {
|
||||
// use the client
|
||||
}
|
||||
----
|
||||
|
||||
[discrete]
|
||||
==== AWS Lambda
|
||||
|
||||
[source,js]
|
||||
----
|
||||
'use strict'
|
||||
|
||||
const { Client } = require('@elastic/elasticsearch')
|
||||
|
||||
const client = new Client({
|
||||
// client initialisation
|
||||
})
|
||||
|
||||
exports.handler = async function (event, context) {
|
||||
// use the client
|
||||
}
|
||||
----
|
||||
|
||||
[discrete]
|
||||
==== Azure Functions
|
||||
|
||||
[source,js]
|
||||
----
|
||||
'use strict'
|
||||
|
||||
const { Client } = require('@elastic/elasticsearch')
|
||||
|
||||
const client = new Client({
|
||||
// client initialisation
|
||||
})
|
||||
|
||||
module.exports = async function (context, req) {
|
||||
// use the client
|
||||
}
|
||||
----
|
||||
|
||||
Resources used to assess these recommendations:
|
||||
|
||||
- https://cloud.google.com/functions/docs/bestpractices/tips#use_global_variables_to_reuse_objects_in_future_invocations[GCP Cloud Functions: Tips & Tricks]
|
||||
- https://docs.aws.amazon.com/lambda/latest/dg/best-practices.html[Best practices for working with AWS Lambda functions]
|
||||
- https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-python?tabs=azurecli-linux%2Capplication-level#global-variables[Azure Functions Python developer guide]
|
||||
- https://docs.aws.amazon.com/lambda/latest/operatorguide/global-scope.html[AWS Lambda: Comparing the effect of global scope]
|
||||
|
||||
|
||||
[discrete]
|
||||
[[client-connect-proxy]]
|
||||
@ -497,3 +622,15 @@ a|* `name` - `string`
|
||||
* `statusCode` - `object`, the response headers
|
||||
* `headers` - `object`, the response status code
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
[[product-check]]
|
||||
=== Automatic product check
|
||||
|
||||
Since v7.14.0, the client performs a required product check before the first call.
|
||||
This pre-flight product check allows the client to establish the version of Elasticsearch
|
||||
that it is communicating with. The product check requires one additional HTTP request to
|
||||
be sent to the server as part of the request pipeline before the main API call is sent.
|
||||
In most cases, this will succeed during the very first API call that the client sends.
|
||||
Once the product check completes, no further product check HTTP requests are sent for
|
||||
subsequent API calls.
|
||||
|
||||
@ -1,22 +1,26 @@
|
||||
[[client-helpers]]
|
||||
== Client Helpers
|
||||
== Client helpers
|
||||
|
||||
The client comes with an handy collection of helpers to give you a more comfortable experience with some APIs.
|
||||
The client comes with an handy collection of helpers to give you a more
|
||||
comfortable experience with some APIs.
|
||||
|
||||
CAUTION: The client helpers are experimental, and the API may change in the next minor releases.
|
||||
The helpers will not work in any Node.js version lower than 10.
|
||||
CAUTION: The client helpers are experimental, and the API may change in the next
|
||||
minor releases. The helpers will not work in any Node.js version lower than 10.
|
||||
|
||||
|
||||
[discrete]
|
||||
=== Bulk Helper
|
||||
[[bulk-helper]]
|
||||
=== Bulk helper
|
||||
|
||||
~Added~ ~in~ ~`v7.7.0`~
|
||||
|
||||
Running Bulk requests can be complex due to the shape of the API, this helper aims to provide a nicer developer experience around the Bulk API.
|
||||
Running bulk requests can be complex due to the shape of the API, this helper
|
||||
aims to provide a nicer developer experience around the Bulk API.
|
||||
|
||||
|
||||
[discrete]
|
||||
==== Usage
|
||||
|
||||
[source,js]
|
||||
----
|
||||
const { createReadStream } = require('fs')
|
||||
@ -45,13 +49,14 @@ console.log(result)
|
||||
// }
|
||||
----
|
||||
|
||||
To create a new instance of the Bulk helper, you should access it as shown in the example above, the configuration options are:
|
||||
To create a new instance of the Bulk helper, access it as shown in the example
|
||||
above, the configuration options are:
|
||||
[cols=2*]
|
||||
|===
|
||||
|`datasource`
|
||||
a|An array, async generator or a readable stream with the data you need to index/create/update/delete.
|
||||
It can be an array of strings or objects, but also a stream of json strings or JavaScript objects. +
|
||||
If it is a stream, we recommend to use the https://www.npmjs.com/package/split2[`split2`] package, that will split the stream on new lines delimiters. +
|
||||
If it is a stream, we recommend to use the https://www.npmjs.com/package/split2[`split2`] package, that splits the stream on new lines delimiters. +
|
||||
This parameter is mandatory.
|
||||
[source,js]
|
||||
----
|
||||
@ -66,7 +71,7 @@ const b = client.helpers.bulk({
|
||||
----
|
||||
|
||||
|`onDocument`
|
||||
a|A function that will be called for each document of the datasource. Inside this function you can manipulate the document and you must return the operation you want to execute with the document. Look at the link:{ref}/docs-bulk.html[Bulk API documentation] to see the supported operations. +
|
||||
a|A function that is called for each document of the datasource. Inside this function you can manipulate the document and you must return the operation you want to execute with the document. Look at the link:{ref}/docs-bulk.html[Bulk API documentation] to see the supported operations. +
|
||||
This parameter is mandatory.
|
||||
[source,js]
|
||||
----
|
||||
@ -80,7 +85,7 @@ const b = client.helpers.bulk({
|
||||
----
|
||||
|
||||
|`onDrop`
|
||||
a|A function that will be called for everytime a document can't be indexed and it has reached the maximum amount of retries.
|
||||
a|A function that is called for everytime a document can't be indexed and it has reached the maximum amount of retries.
|
||||
[source,js]
|
||||
----
|
||||
const b = client.helpers.bulk({
|
||||
@ -91,7 +96,7 @@ const b = client.helpers.bulk({
|
||||
----
|
||||
|
||||
|`flushBytes`
|
||||
a|The size of the bulk body in bytes to reach before to send it. Default of 5MB. +
|
||||
a|The size of the bulk body in bytes to reach before sending it. Default of 5MB. +
|
||||
_Default:_ `5000000`
|
||||
[source,js]
|
||||
----
|
||||
@ -101,7 +106,7 @@ const b = client.helpers.bulk({
|
||||
----
|
||||
|
||||
|`flushInterval`
|
||||
a|How much time (in milliseconds) the helper will wait before flushing the body from the last document read. +
|
||||
a|How much time (in milliseconds) the helper waits before flushing the body from the last document read. +
|
||||
_Default:_ `30000`
|
||||
[source,js]
|
||||
----
|
||||
@ -111,7 +116,7 @@ const b = client.helpers.bulk({
|
||||
----
|
||||
|
||||
|`concurrency`
|
||||
a|How many request will be executed at the same time. +
|
||||
a|How many request is executed at the same time. +
|
||||
_Default:_ `5`
|
||||
[source,js]
|
||||
----
|
||||
@ -121,7 +126,7 @@ const b = client.helpers.bulk({
|
||||
----
|
||||
|
||||
|`retries`
|
||||
a|How many times a document will be retried before to call the `onDrop` callback. +
|
||||
a|How many times a document is retried before to call the `onDrop` callback. +
|
||||
_Default:_ Client max retries.
|
||||
[source,js]
|
||||
----
|
||||
@ -141,7 +146,7 @@ const b = client.helpers.bulk({
|
||||
----
|
||||
|
||||
|`refreshOnCompletion`
|
||||
a|If `true`, at the end of the bulk operation it will run a refresh on all indices or on the specified indices. +
|
||||
a|If `true`, at the end of the bulk operation it runs a refresh on all indices or on the specified indices. +
|
||||
_Default:_ false.
|
||||
[source,js]
|
||||
----
|
||||
@ -161,6 +166,7 @@ const b = client.helpers.bulk({
|
||||
|
||||
[discrete]
|
||||
===== Index
|
||||
|
||||
[source,js]
|
||||
----
|
||||
client.helpers.bulk({
|
||||
@ -176,6 +182,7 @@ client.helpers.bulk({
|
||||
|
||||
[discrete]
|
||||
===== Create
|
||||
|
||||
[source,js]
|
||||
----
|
||||
client.helpers.bulk({
|
||||
@ -228,9 +235,12 @@ client.helpers.bulk({
|
||||
[discrete]
|
||||
==== Abort a bulk operation
|
||||
|
||||
If needed, you can abort a bulk operation at any time. The bulk helper returns a https://promisesaplus.com/[thenable], which has an `abort` method.
|
||||
If needed, you can abort a bulk operation at any time. The bulk helper returns a
|
||||
https://promisesaplus.com/[thenable], which has an `abort` method.
|
||||
|
||||
NOTE: The abort method will stop the execution of the bulk operation, but if you are using a concurrency higher than one, the operations that are already running will not be stopped.
|
||||
NOTE: The abort method stops the execution of the bulk operation, but if you
|
||||
are using a concurrency higher than one, the operations that are already running
|
||||
will not be stopped.
|
||||
|
||||
[source,js]
|
||||
----
|
||||
@ -258,8 +268,9 @@ console.log(await b)
|
||||
[discrete]
|
||||
==== Passing custom options to the Bulk API
|
||||
|
||||
You can pass any option supported by the link:{ref}/docs-bulk.html#docs-bulk-api-query-params[Bulk API] to the helper, and the helper will use those options in conjuction with the Bulk
|
||||
API call.
|
||||
You can pass any option supported by the link:
|
||||
{ref}/docs-bulk.html#docs-bulk-api-query-params[Bulk API] to the helper, and the
|
||||
helper uses those options in conjunction with the Bulk API call.
|
||||
|
||||
[source,js]
|
||||
----
|
||||
@ -308,13 +319,16 @@ console.log(result)
|
||||
|
||||
|
||||
[discrete]
|
||||
=== Multi Search Helper
|
||||
[[multi-search-helper]]
|
||||
=== Multi search helper
|
||||
|
||||
~Added~ ~in~ ~`v7.8.0`~
|
||||
|
||||
If you are sending search request at a high rate, this helper might be useful for you.
|
||||
It will use the mutli search API under the hood to batch the requests and improve the overall performances of your application. +
|
||||
The `result` exposes a `documents` property as well, which allows you to access directly the hits sources.
|
||||
If you send search request at a high rate, this helper might be useful
|
||||
for you. It uses the multi search API under the hood to batch the requests
|
||||
and improve the overall performances of your application. The `result` exposes a
|
||||
`documents` property as well, which allows you to access directly the hits
|
||||
sources.
|
||||
|
||||
|
||||
[discrete]
|
||||
@ -346,7 +360,8 @@ m.search(
|
||||
)
|
||||
----
|
||||
|
||||
To create a new instance of the Msearch helper, you should access it as shown in the example above, the configuration options are:
|
||||
To create a new instance of the multi search (msearch) helper, you should access
|
||||
it as shown in the example above, the configuration options are:
|
||||
[cols=2*]
|
||||
|===
|
||||
|`operations`
|
||||
@ -360,7 +375,7 @@ const m = client.helpers.msearch({
|
||||
----
|
||||
|
||||
|`flushInterval`
|
||||
a|How much time (in milliseconds) the helper will wait before flushing the operations from the last operation read. +
|
||||
a|How much time (in milliseconds) the helper waits before flushing the operations from the last operation read. +
|
||||
_Default:_ `500`
|
||||
[source,js]
|
||||
----
|
||||
@ -370,7 +385,7 @@ const m = client.helpers.msearch({
|
||||
----
|
||||
|
||||
|`concurrency`
|
||||
a|How many request will be executed at the same time. +
|
||||
a|How many request is executed at the same time. +
|
||||
_Default:_ `5`
|
||||
[source,js]
|
||||
----
|
||||
@ -380,7 +395,7 @@ const m = client.helpers.msearch({
|
||||
----
|
||||
|
||||
|`retries`
|
||||
a|How many times an operation will be retried before to resolve the request. An operation will be retried only in case of a 429 error. +
|
||||
a|How many times an operation is retried before to resolve the request. An operation is retried only in case of a 429 error. +
|
||||
_Default:_ Client max retries.
|
||||
[source,js]
|
||||
----
|
||||
@ -403,15 +418,21 @@ const m = client.helpers.msearch({
|
||||
|
||||
|
||||
[discrete]
|
||||
==== Stopping the Msearch Helper
|
||||
==== Stopping the msearch helper
|
||||
|
||||
If needed, you can stop a msearch processor at any time. The msearch helper returns a https://promisesaplus.com/[thenable], which has an `stop` method.
|
||||
If needed, you can stop an msearch processor at any time. The msearch helper
|
||||
returns a https://promisesaplus.com/[thenable], which has an `stop` method.
|
||||
|
||||
If you are creating multiple msearch helpers instances and using them for a limitied period of time, remember to always use the `stop` method once you have finished using them, otherwise your application will start leaking memory.
|
||||
If you are creating multiple msearch helpers instances and using them for a
|
||||
limitied period of time, remember to always use the `stop` method once you have
|
||||
finished using them, otherwise your application will start leaking memory.
|
||||
|
||||
The `stop` method accepts an optional error, that will be dispatched every subsequent search request.
|
||||
The `stop` method accepts an optional error, that will be dispatched every
|
||||
subsequent search request.
|
||||
|
||||
NOTE: The stop method will stop the execution of the msearch processor, but if you are using a concurrency higher than one, the operations that are already running will not be stopped.
|
||||
NOTE: The stop method stops the execution of the msearch processor, but if
|
||||
you are using a concurrency higher than one, the operations that are already
|
||||
running will not be stopped.
|
||||
|
||||
[source,js]
|
||||
----
|
||||
@ -439,12 +460,15 @@ setImmediate(() => m.stop())
|
||||
|
||||
|
||||
[discrete]
|
||||
=== Search Helper
|
||||
[[search-helper]]
|
||||
=== Search helper
|
||||
|
||||
~Added~ ~in~ ~`v7.7.0`~
|
||||
|
||||
A simple wrapper around the search API. Instead of returning the entire `result` object it will return only the search documents source.
|
||||
For improving the performances, this helper automatically adds `filter_path=hits.hits._source` to the querystring.
|
||||
A simple wrapper around the search API. Instead of returning the entire `result`
|
||||
object it returns only the search documents source. For improving the
|
||||
performances, this helper automatically adds `filter_path=hits.hits._source` to
|
||||
the query string.
|
||||
|
||||
[source,js]
|
||||
----
|
||||
@ -466,12 +490,16 @@ for (const doc of documents) {
|
||||
|
||||
|
||||
[discrete]
|
||||
=== Scroll Search Helper
|
||||
[[scroll-search-helper]]
|
||||
=== Scroll search helper
|
||||
|
||||
~Added~ ~in~ ~`v7.7.0`~
|
||||
|
||||
This helpers offers a simple and intuitive way to use the scroll search API. Once called, it returns an https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of[async iterator] which can be used in conjuction with a for-await...of. +
|
||||
It handles automatically the `429` error and uses the client's `maxRetries` option.
|
||||
This helpers offers a simple and intuitive way to use the scroll search API.
|
||||
Once called, it returns an
|
||||
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function[async iterator]
|
||||
which can be used in conjuction with a for-await...of. It handles automatically
|
||||
the `429` error and uses the `maxRetries` option of the client.
|
||||
|
||||
[source,js]
|
||||
----
|
||||
@ -510,7 +538,8 @@ for await (const result of scrollSearch) {
|
||||
[discrete]
|
||||
==== Quickly getting the documents
|
||||
|
||||
If you only need the documents from the result of a scroll search, you can access them via `result.documents`:
|
||||
If you only need the documents from the result of a scroll search, you can
|
||||
access them via `result.documents`:
|
||||
|
||||
[source,js]
|
||||
----
|
||||
@ -521,12 +550,15 @@ for await (const result of scrollSearch) {
|
||||
|
||||
|
||||
[discrete]
|
||||
=== Scroll Documents Helper
|
||||
[[scroll-documents-helper]]
|
||||
=== Scroll documents helper
|
||||
|
||||
~Added~ ~in~ ~`v7.7.0`~
|
||||
|
||||
It works in the same way as the scroll search helper, but it returns only the documents instead. Note, every loop cycle will return you a single document, and you can't use the `clear` method.
|
||||
For improving the performances, this helper automatically adds `filter_path=hits.hits._source` to the querystring.
|
||||
It works in the same way as the scroll search helper, but it returns only the
|
||||
documents instead. Note, every loop cycle returns a single document, and you
|
||||
can't use the `clear` method. For improving the performances, this helper
|
||||
automatically adds `filter_path=hits.hits._source` to the query string.
|
||||
|
||||
[source,js]
|
||||
----
|
||||
@ -544,4 +576,4 @@ const scrollSearch = client.helpers.scrollDocuments({
|
||||
for await (const doc of scrollSearch) {
|
||||
console.log(doc)
|
||||
}
|
||||
----
|
||||
----
|
||||
|
||||
@ -1,12 +1,11 @@
|
||||
= Elasticsearch Node.js client
|
||||
= Elasticsearch JavaScript Client
|
||||
|
||||
:branch: 7.x
|
||||
include::{asciidoc-dir}/../../shared/versions/stack/{source_branch}.asciidoc[]
|
||||
include::{asciidoc-dir}/../../shared/attributes.asciidoc[]
|
||||
|
||||
include::introduction.asciidoc[]
|
||||
include::installation.asciidoc[]
|
||||
include::connecting.asciidoc[]
|
||||
include::changelog.asciidoc[]
|
||||
include::configuration.asciidoc[]
|
||||
include::basic-config.asciidoc[]
|
||||
include::advanced-config.asciidoc[]
|
||||
@ -19,6 +18,6 @@ include::transport.asciidoc[]
|
||||
include::typescript.asciidoc[]
|
||||
include::reference.asciidoc[]
|
||||
include::examples/index.asciidoc[]
|
||||
include::breaking-changes.asciidoc[]
|
||||
include::helpers.asciidoc[]
|
||||
include::changelog.asciidoc[]
|
||||
include::redirects.asciidoc[]
|
||||
|
||||
@ -17,14 +17,14 @@ To install a specific major version of the client, run the following command:
|
||||
npm install @elastic/elasticsearch@<major>
|
||||
----
|
||||
|
||||
To learn more about the supported major versions, please refer to the
|
||||
To learn more about the supported major versions, please refer to the
|
||||
<<js-compatibility-matrix>>.
|
||||
|
||||
[discrete]
|
||||
[[nodejs-support]]
|
||||
=== Node.js support
|
||||
|
||||
NOTE: The minimum supported version of Node.js is `v10`.
|
||||
NOTE: The minimum supported version of Node.js is `v12`.
|
||||
|
||||
The client versioning follows the {stack} versioning, this means that
|
||||
major, minor, and patch releases are done following a precise schedule that
|
||||
@ -37,7 +37,7 @@ to support that version for at least another minor release. If you are using the
|
||||
with a version of Node.js that will be unsupported soon, you will see a warning
|
||||
in your logs (the client will start logging the warning with two minors in advance).
|
||||
|
||||
Unless you are *always* using a supported version of Node.js,
|
||||
Unless you are *always* using a supported version of Node.js,
|
||||
we recommend defining the client dependency in your
|
||||
`package.json` with the `~` instead of `^`. In this way, you will lock the
|
||||
dependency on the minor release and not the major. (for example, `~7.10.0` instead
|
||||
@ -62,9 +62,8 @@ of `^7.10.0`).
|
||||
[[js-compatibility-matrix]]
|
||||
=== Compatibility matrix
|
||||
|
||||
The library is compatible with all {es} versions since 5.x. We recommend you to
|
||||
use the same major version of the client as the {es} instance that you are
|
||||
using.
|
||||
Language clients are forward compatible; meaning that clients support communicating with greater or equal minor versions of Elasticsearch.
|
||||
Elasticsearch language clients are only backwards compatible with default distributions and without guarantees made.
|
||||
|
||||
[%header,cols=2*]
|
||||
|===
|
||||
@ -91,4 +90,4 @@ using.
|
||||
WARNING: There is no official support for the browser environment. It exposes
|
||||
your {es} instance to everyone, which could lead to security issues. We
|
||||
recommend you to write a lightweight proxy that uses this client instead,
|
||||
you can see a proxy example https://github.com/elastic/elasticsearch-js/tree/master/docs/examples/proxy[here].
|
||||
you can see a proxy example https://github.com/elastic/elasticsearch-js/tree/master/docs/examples/proxy[here].
|
||||
|
||||
@ -4,6 +4,8 @@
|
||||
This is the official Node.js client for {es}. This page gives a quick overview
|
||||
about the features of the client.
|
||||
|
||||
Refer to <<breaking-changes,this page>> for breaking changes coming from the old
|
||||
client.
|
||||
|
||||
[discrete]
|
||||
=== Features
|
||||
@ -130,6 +132,9 @@ async function run () {
|
||||
run().catch(console.log)
|
||||
----
|
||||
|
||||
TIP: For an elaborate example of how to ingest data into Elastic Cloud,
|
||||
refer to {cloud}/ec-getting-started-node-js.html[this page].
|
||||
|
||||
[discrete]
|
||||
==== Install multiple versions
|
||||
|
||||
@ -189,3 +194,5 @@ npm install esmaster@github:elastic/elasticsearch-js
|
||||
----
|
||||
WARNING: This command installs the master branch of the client which is not
|
||||
considered stable.
|
||||
|
||||
include::breaking-changes.asciidoc[]
|
||||
@ -377,9 +377,9 @@ child.search({
|
||||
To improve observability, the client offers an easy way to configure the
|
||||
`X-Opaque-Id` header. If you set the `X-Opaque-Id` in a specific request, this
|
||||
allows you to discover this identifier in the
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/logging.html#deprecation-logging[deprecation logs],
|
||||
helps you with https://www.elastic.co/guide/en/elasticsearch/reference/master/index-modules-slowlog.html#_identifying_search_slow_log_origin[identifying search slow log origin]
|
||||
as well as https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html#_identifying_running_tasks[identifying running tasks].
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/7.16/logging.html#deprecation-logging[deprecation logs],
|
||||
helps you with https://www.elastic.co/guide/en/elasticsearch/reference/7.16/index-modules-slowlog.html#_identifying_search_slow_log_origin[identifying search slow log origin]
|
||||
as well as https://www.elastic.co/guide/en/elasticsearch/reference/7.16/tasks.html#_identifying_running_tasks[identifying running tasks].
|
||||
|
||||
The `X-Opaque-Id` should be configured in each request, for doing that you can
|
||||
use the `opaqueId` option, as you can see in the following example. The
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -32,3 +32,10 @@ class MyTransport extends Transport {
|
||||
}
|
||||
----
|
||||
|
||||
==== Supported content types
|
||||
|
||||
- `application/json`, in this case the transport will return a plain JavaScript object
|
||||
- `text/plain`, in this case the transport will return a plain string
|
||||
- `application/vnd.mapbox-vector-tile`, in this case the transport will return a Buffer
|
||||
- `application/vnd.elasticsearch+json`, in this case the transport will return a plain JavaScript object
|
||||
|
||||
|
||||
298
index.d.ts
vendored
298
index.d.ts
vendored
@ -43,7 +43,8 @@ import {
|
||||
CloudConnectionPool,
|
||||
ResurrectEvent,
|
||||
BasicAuth,
|
||||
ApiKeyAuth
|
||||
ApiKeyAuth,
|
||||
BearerAuth
|
||||
} from './lib/pool';
|
||||
import Serializer from './lib/Serializer';
|
||||
import Helpers from './lib/Helpers';
|
||||
@ -106,7 +107,7 @@ interface ClientOptions {
|
||||
opaqueIdPrefix?: string;
|
||||
generateRequestId?: generateRequestIdFn;
|
||||
name?: string | symbol;
|
||||
auth?: BasicAuth | ApiKeyAuth;
|
||||
auth?: BasicAuth | ApiKeyAuth | BearerAuth;
|
||||
context?: Context;
|
||||
proxy?: string | URL;
|
||||
enableMetaHeader?: boolean;
|
||||
@ -117,6 +118,9 @@ interface ClientOptions {
|
||||
password?: string;
|
||||
};
|
||||
disablePrototypePoisoningProtection?: boolean | 'proto' | 'constructor';
|
||||
caFingerprint?: string;
|
||||
maxResponseSize?: number;
|
||||
maxCompressedResponseSize?: number;
|
||||
}
|
||||
|
||||
declare class Client {
|
||||
@ -747,6 +751,24 @@ declare class Client {
|
||||
fieldCaps<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
fieldCaps<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.FieldCaps<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
fieldCaps<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.FieldCaps<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
fleet: {
|
||||
global_checkpoints<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.FleetGlobalCheckpoints, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
global_checkpoints<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
global_checkpoints<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.FleetGlobalCheckpoints, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
global_checkpoints<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.FleetGlobalCheckpoints, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
globalCheckpoints<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.FleetGlobalCheckpoints, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
globalCheckpoints<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
globalCheckpoints<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.FleetGlobalCheckpoints, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
globalCheckpoints<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.FleetGlobalCheckpoints, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
msearch<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params?: RequestParams.FleetMsearch<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
msearch<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
msearch<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params: RequestParams.FleetMsearch<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
msearch<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params: RequestParams.FleetMsearch<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
search<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.FleetSearch<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
search<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
search<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.FleetSearch<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
search<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.FleetSearch<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
}
|
||||
get<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.Get, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
get<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.Get, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -822,6 +844,14 @@ declare class Client {
|
||||
getStatus<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getStatus<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IlmGetStatus, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getStatus<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IlmGetStatus, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
migrate_to_data_tiers<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IlmMigrateToDataTiers<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
migrate_to_data_tiers<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
migrate_to_data_tiers<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.IlmMigrateToDataTiers<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
migrate_to_data_tiers<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.IlmMigrateToDataTiers<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
migrateToDataTiers<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IlmMigrateToDataTiers<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
migrateToDataTiers<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
migrateToDataTiers<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.IlmMigrateToDataTiers<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
migrateToDataTiers<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.IlmMigrateToDataTiers<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
move_to_step<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IlmMoveToStep<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
move_to_step<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
move_to_step<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.IlmMoveToStep<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -948,6 +978,14 @@ declare class Client {
|
||||
deleteTemplate<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
deleteTemplate<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IndicesDeleteTemplate, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
deleteTemplate<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IndicesDeleteTemplate, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
disk_usage<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesDiskUsage, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
disk_usage<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
disk_usage<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IndicesDiskUsage, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
disk_usage<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IndicesDiskUsage, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
diskUsage<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesDiskUsage, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
diskUsage<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
diskUsage<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IndicesDiskUsage, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
diskUsage<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IndicesDiskUsage, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
exists<TResponse = boolean, TContext = Context>(params?: RequestParams.IndicesExists, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
exists<TResponse = boolean, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
exists<TResponse = boolean, TContext = Context>(params: RequestParams.IndicesExists, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -984,6 +1022,14 @@ declare class Client {
|
||||
existsType<TResponse = boolean, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
existsType<TResponse = boolean, TContext = Context>(params: RequestParams.IndicesExistsType, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
existsType<TResponse = boolean, TContext = Context>(params: RequestParams.IndicesExistsType, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
field_usage_stats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesFieldUsageStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
field_usage_stats<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
field_usage_stats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IndicesFieldUsageStats, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
field_usage_stats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IndicesFieldUsageStats, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
fieldUsageStats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesFieldUsageStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
fieldUsageStats<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
fieldUsageStats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IndicesFieldUsageStats, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
fieldUsageStats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IndicesFieldUsageStats, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
flush<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesFlush, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
flush<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
flush<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IndicesFlush, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -1080,6 +1126,14 @@ declare class Client {
|
||||
migrateToDataStream<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
migrateToDataStream<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IndicesMigrateToDataStream, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
migrateToDataStream<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IndicesMigrateToDataStream, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
modify_data_stream<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesModifyDataStream<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
modify_data_stream<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
modify_data_stream<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.IndicesModifyDataStream<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
modify_data_stream<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.IndicesModifyDataStream<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
modifyDataStream<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesModifyDataStream<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
modifyDataStream<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
modifyDataStream<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.IndicesModifyDataStream<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
modifyDataStream<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.IndicesModifyDataStream<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
open<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesOpen, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
open<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
open<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IndicesOpen, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -1356,6 +1410,22 @@ declare class Client {
|
||||
deprecations<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
deprecations<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MigrationDeprecations, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
deprecations<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MigrationDeprecations, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_feature_upgrade_status<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MigrationGetFeatureUpgradeStatus, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
get_feature_upgrade_status<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_feature_upgrade_status<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MigrationGetFeatureUpgradeStatus, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_feature_upgrade_status<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MigrationGetFeatureUpgradeStatus, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getFeatureUpgradeStatus<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MigrationGetFeatureUpgradeStatus, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getFeatureUpgradeStatus<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getFeatureUpgradeStatus<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MigrationGetFeatureUpgradeStatus, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getFeatureUpgradeStatus<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MigrationGetFeatureUpgradeStatus, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
post_feature_upgrade<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MigrationPostFeatureUpgrade, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
post_feature_upgrade<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
post_feature_upgrade<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MigrationPostFeatureUpgrade, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
post_feature_upgrade<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MigrationPostFeatureUpgrade, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
postFeatureUpgrade<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MigrationPostFeatureUpgrade, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
postFeatureUpgrade<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
postFeatureUpgrade<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MigrationPostFeatureUpgrade, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
postFeatureUpgrade<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MigrationPostFeatureUpgrade, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
}
|
||||
ml: {
|
||||
close_job<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlCloseJob<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
@ -1502,10 +1572,10 @@ declare class Client {
|
||||
flushJob<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
flushJob<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlFlushJob<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
flushJob<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlFlushJob<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
forecast<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlForecast, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
forecast<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
forecast<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlForecast, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
forecast<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlForecast, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
forecast<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlForecast<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
forecast<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
forecast<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlForecast<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
forecast<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlForecast<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_buckets<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlGetBuckets<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
get_buckets<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_buckets<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlGetBuckets<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -1646,14 +1716,14 @@ declare class Client {
|
||||
info<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
info<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlInfo, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
info<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlInfo, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
open_job<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlOpenJob, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
open_job<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
open_job<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlOpenJob, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
open_job<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlOpenJob, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
openJob<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlOpenJob, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
openJob<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
openJob<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlOpenJob, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
openJob<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlOpenJob, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
open_job<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlOpenJob<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
open_job<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
open_job<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlOpenJob<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
open_job<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlOpenJob<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
openJob<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlOpenJob<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
openJob<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
openJob<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlOpenJob<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
openJob<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlOpenJob<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
post_calendar_events<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlPostCalendarEvents<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
post_calendar_events<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
post_calendar_events<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlPostCalendarEvents<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -1750,6 +1820,14 @@ declare class Client {
|
||||
putTrainedModelAlias<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
putTrainedModelAlias<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlPutTrainedModelAlias, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
putTrainedModelAlias<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlPutTrainedModelAlias, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
reset_job<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlResetJob, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
reset_job<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
reset_job<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlResetJob, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
reset_job<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlResetJob, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
resetJob<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlResetJob, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
resetJob<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
resetJob<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlResetJob, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
resetJob<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlResetJob, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
revert_model_snapshot<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlRevertModelSnapshot<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
revert_model_snapshot<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
revert_model_snapshot<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlRevertModelSnapshot<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -1860,10 +1938,10 @@ declare class Client {
|
||||
validateDetector<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlValidateDetector<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
}
|
||||
monitoring: {
|
||||
bulk<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MonitoringBulk<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
bulk<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
bulk<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MonitoringBulk<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
bulk<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MonitoringBulk<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
bulk<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params?: RequestParams.MonitoringBulk<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
bulk<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
bulk<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params: RequestParams.MonitoringBulk<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
bulk<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params: RequestParams.MonitoringBulk<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
}
|
||||
msearch<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params?: RequestParams.Msearch<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
msearch<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -1882,6 +1960,22 @@ declare class Client {
|
||||
mtermvectors<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.Mtermvectors<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
mtermvectors<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.Mtermvectors<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
nodes: {
|
||||
clear_repositories_metering_archive<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.NodesClearRepositoriesMeteringArchive, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
clear_repositories_metering_archive<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clear_repositories_metering_archive<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.NodesClearRepositoriesMeteringArchive, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clear_repositories_metering_archive<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.NodesClearRepositoriesMeteringArchive, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clearRepositoriesMeteringArchive<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.NodesClearRepositoriesMeteringArchive, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
clearRepositoriesMeteringArchive<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clearRepositoriesMeteringArchive<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.NodesClearRepositoriesMeteringArchive, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clearRepositoriesMeteringArchive<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.NodesClearRepositoriesMeteringArchive, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_repositories_metering_info<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.NodesGetRepositoriesMeteringInfo, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
get_repositories_metering_info<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_repositories_metering_info<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.NodesGetRepositoriesMeteringInfo, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_repositories_metering_info<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.NodesGetRepositoriesMeteringInfo, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getRepositoriesMeteringInfo<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.NodesGetRepositoriesMeteringInfo, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getRepositoriesMeteringInfo<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getRepositoriesMeteringInfo<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.NodesGetRepositoriesMeteringInfo, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getRepositoriesMeteringInfo<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.NodesGetRepositoriesMeteringInfo, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
hot_threads<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.NodesHotThreads, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
hot_threads<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
hot_threads<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.NodesHotThreads, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -2045,6 +2139,14 @@ declare class Client {
|
||||
search<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
search<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.Search<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
search<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.Search<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
search_mvt<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SearchMvt<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
search_mvt<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
search_mvt<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SearchMvt<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
search_mvt<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SearchMvt<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
searchMvt<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SearchMvt<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
searchMvt<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
searchMvt<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SearchMvt<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
searchMvt<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SearchMvt<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
search_shards<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SearchShards, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
search_shards<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
search_shards<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SearchShards, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -2062,6 +2164,14 @@ declare class Client {
|
||||
searchTemplate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SearchTemplate<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
searchTemplate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SearchTemplate<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
searchable_snapshots: {
|
||||
cache_stats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SearchableSnapshotsCacheStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
cache_stats<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
cache_stats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SearchableSnapshotsCacheStats, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
cache_stats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SearchableSnapshotsCacheStats, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
cacheStats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SearchableSnapshotsCacheStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
cacheStats<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
cacheStats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SearchableSnapshotsCacheStats, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
cacheStats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SearchableSnapshotsCacheStats, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clear_cache<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SearchableSnapshotsClearCache, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
clear_cache<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clear_cache<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SearchableSnapshotsClearCache, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -2088,6 +2198,14 @@ declare class Client {
|
||||
stats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SearchableSnapshotsStats, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
}
|
||||
searchableSnapshots: {
|
||||
cache_stats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SearchableSnapshotsCacheStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
cache_stats<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
cache_stats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SearchableSnapshotsCacheStats, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
cache_stats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SearchableSnapshotsCacheStats, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
cacheStats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SearchableSnapshotsCacheStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
cacheStats<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
cacheStats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SearchableSnapshotsCacheStats, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
cacheStats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SearchableSnapshotsCacheStats, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clear_cache<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SearchableSnapshotsClearCache, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
clear_cache<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clear_cache<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SearchableSnapshotsClearCache, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -2158,6 +2276,14 @@ declare class Client {
|
||||
clearCachedRoles<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clearCachedRoles<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityClearCachedRoles, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clearCachedRoles<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityClearCachedRoles, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clear_cached_service_tokens<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityClearCachedServiceTokens, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
clear_cached_service_tokens<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clear_cached_service_tokens<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityClearCachedServiceTokens, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clear_cached_service_tokens<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityClearCachedServiceTokens, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clearCachedServiceTokens<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityClearCachedServiceTokens, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
clearCachedServiceTokens<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clearCachedServiceTokens<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityClearCachedServiceTokens, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clearCachedServiceTokens<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityClearCachedServiceTokens, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
create_api_key<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityCreateApiKey<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
create_api_key<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
create_api_key<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecurityCreateApiKey<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -2166,6 +2292,14 @@ declare class Client {
|
||||
createApiKey<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
createApiKey<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecurityCreateApiKey<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
createApiKey<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecurityCreateApiKey<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
create_service_token<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityCreateServiceToken, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
create_service_token<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
create_service_token<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityCreateServiceToken, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
create_service_token<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityCreateServiceToken, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
createServiceToken<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityCreateServiceToken, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
createServiceToken<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
createServiceToken<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityCreateServiceToken, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
createServiceToken<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityCreateServiceToken, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
delete_privileges<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityDeletePrivileges, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
delete_privileges<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
delete_privileges<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityDeletePrivileges, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -2190,6 +2324,14 @@ declare class Client {
|
||||
deleteRoleMapping<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
deleteRoleMapping<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityDeleteRoleMapping, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
deleteRoleMapping<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityDeleteRoleMapping, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
delete_service_token<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityDeleteServiceToken, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
delete_service_token<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
delete_service_token<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityDeleteServiceToken, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
delete_service_token<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityDeleteServiceToken, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
deleteServiceToken<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityDeleteServiceToken, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteServiceToken<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
deleteServiceToken<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityDeleteServiceToken, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
deleteServiceToken<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityDeleteServiceToken, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
delete_user<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityDeleteUser, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
delete_user<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
delete_user<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityDeleteUser, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -2254,6 +2396,22 @@ declare class Client {
|
||||
getRoleMapping<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getRoleMapping<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityGetRoleMapping, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getRoleMapping<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityGetRoleMapping, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_service_accounts<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityGetServiceAccounts, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
get_service_accounts<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_service_accounts<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityGetServiceAccounts, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_service_accounts<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityGetServiceAccounts, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getServiceAccounts<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityGetServiceAccounts, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getServiceAccounts<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getServiceAccounts<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityGetServiceAccounts, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getServiceAccounts<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityGetServiceAccounts, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_service_credentials<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityGetServiceCredentials, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
get_service_credentials<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_service_credentials<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityGetServiceCredentials, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_service_credentials<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityGetServiceCredentials, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getServiceCredentials<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityGetServiceCredentials, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getServiceCredentials<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getServiceCredentials<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityGetServiceCredentials, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getServiceCredentials<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityGetServiceCredentials, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_token<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityGetToken<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
get_token<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_token<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecurityGetToken<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -2342,6 +2500,62 @@ declare class Client {
|
||||
putUser<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
putUser<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecurityPutUser<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
putUser<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecurityPutUser<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
query_api_keys<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityQueryApiKeys<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
query_api_keys<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
query_api_keys<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecurityQueryApiKeys<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
query_api_keys<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecurityQueryApiKeys<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
queryApiKeys<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityQueryApiKeys<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
queryApiKeys<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
queryApiKeys<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecurityQueryApiKeys<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
queryApiKeys<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecurityQueryApiKeys<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
saml_authenticate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SecuritySamlAuthenticate<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
saml_authenticate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
saml_authenticate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecuritySamlAuthenticate<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
saml_authenticate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecuritySamlAuthenticate<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
samlAuthenticate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SecuritySamlAuthenticate<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
samlAuthenticate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
samlAuthenticate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecuritySamlAuthenticate<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
samlAuthenticate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecuritySamlAuthenticate<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
saml_complete_logout<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SecuritySamlCompleteLogout<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
saml_complete_logout<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
saml_complete_logout<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecuritySamlCompleteLogout<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
saml_complete_logout<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecuritySamlCompleteLogout<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
samlCompleteLogout<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SecuritySamlCompleteLogout<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
samlCompleteLogout<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
samlCompleteLogout<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecuritySamlCompleteLogout<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
samlCompleteLogout<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecuritySamlCompleteLogout<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
saml_invalidate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SecuritySamlInvalidate<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
saml_invalidate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
saml_invalidate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecuritySamlInvalidate<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
saml_invalidate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecuritySamlInvalidate<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
samlInvalidate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SecuritySamlInvalidate<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
samlInvalidate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
samlInvalidate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecuritySamlInvalidate<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
samlInvalidate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecuritySamlInvalidate<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
saml_logout<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SecuritySamlLogout<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
saml_logout<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
saml_logout<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecuritySamlLogout<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
saml_logout<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecuritySamlLogout<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
samlLogout<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SecuritySamlLogout<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
samlLogout<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
samlLogout<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecuritySamlLogout<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
samlLogout<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecuritySamlLogout<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
saml_prepare_authentication<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SecuritySamlPrepareAuthentication<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
saml_prepare_authentication<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
saml_prepare_authentication<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecuritySamlPrepareAuthentication<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
saml_prepare_authentication<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecuritySamlPrepareAuthentication<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
samlPrepareAuthentication<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SecuritySamlPrepareAuthentication<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
samlPrepareAuthentication<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
samlPrepareAuthentication<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecuritySamlPrepareAuthentication<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
samlPrepareAuthentication<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecuritySamlPrepareAuthentication<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
saml_service_provider_metadata<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecuritySamlServiceProviderMetadata, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
saml_service_provider_metadata<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
saml_service_provider_metadata<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecuritySamlServiceProviderMetadata, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
saml_service_provider_metadata<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecuritySamlServiceProviderMetadata, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
samlServiceProviderMetadata<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecuritySamlServiceProviderMetadata, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
samlServiceProviderMetadata<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
samlServiceProviderMetadata<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecuritySamlServiceProviderMetadata, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
samlServiceProviderMetadata<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecuritySamlServiceProviderMetadata, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
}
|
||||
shutdown: {
|
||||
delete_node<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.ShutdownDeleteNode, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
@ -2484,6 +2698,14 @@ declare class Client {
|
||||
getRepository<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getRepository<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SnapshotGetRepository, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getRepository<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SnapshotGetRepository, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
repository_analyze<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotRepositoryAnalyze, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
repository_analyze<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
repository_analyze<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SnapshotRepositoryAnalyze, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
repository_analyze<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SnapshotRepositoryAnalyze, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
repositoryAnalyze<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotRepositoryAnalyze, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
repositoryAnalyze<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
repositoryAnalyze<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SnapshotRepositoryAnalyze, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
repositoryAnalyze<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SnapshotRepositoryAnalyze, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
restore<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotRestore<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
restore<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
restore<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SnapshotRestore<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -2510,6 +2732,30 @@ declare class Client {
|
||||
clearCursor<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clearCursor<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SqlClearCursor<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clearCursor<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SqlClearCursor<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
delete_async<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SqlDeleteAsync, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
delete_async<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
delete_async<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SqlDeleteAsync, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
delete_async<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SqlDeleteAsync, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
deleteAsync<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SqlDeleteAsync, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteAsync<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
deleteAsync<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SqlDeleteAsync, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
deleteAsync<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SqlDeleteAsync, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_async<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SqlGetAsync, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
get_async<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_async<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SqlGetAsync, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_async<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SqlGetAsync, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getAsync<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SqlGetAsync, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getAsync<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getAsync<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SqlGetAsync, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getAsync<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SqlGetAsync, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_async_status<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SqlGetAsyncStatus, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
get_async_status<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_async_status<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SqlGetAsyncStatus, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_async_status<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SqlGetAsyncStatus, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getAsyncStatus<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SqlGetAsyncStatus, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getAsyncStatus<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getAsyncStatus<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SqlGetAsyncStatus, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getAsyncStatus<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SqlGetAsyncStatus, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
query<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SqlQuery<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
query<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
query<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SqlQuery<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -2539,6 +2785,14 @@ declare class Client {
|
||||
list<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.TasksList, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
list<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.TasksList, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
}
|
||||
terms_enum<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.TermsEnum<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
terms_enum<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
terms_enum<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.TermsEnum<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
terms_enum<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.TermsEnum<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
termsEnum<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.TermsEnum<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
termsEnum<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
termsEnum<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.TermsEnum<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
termsEnum<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.TermsEnum<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
termvectors<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.Termvectors<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
termvectors<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
termvectors<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.Termvectors<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -2628,6 +2882,14 @@ declare class Client {
|
||||
updateTransform<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
updateTransform<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.TransformUpdateTransform<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
updateTransform<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.TransformUpdateTransform<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
upgrade_transforms<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.TransformUpgradeTransforms, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
upgrade_transforms<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
upgrade_transforms<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.TransformUpgradeTransforms, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
upgrade_transforms<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.TransformUpgradeTransforms, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
upgradeTransforms<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.TransformUpgradeTransforms, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
upgradeTransforms<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
upgradeTransforms<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.TransformUpgradeTransforms, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
upgradeTransforms<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.TransformUpgradeTransforms, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
}
|
||||
update<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.Update<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
update<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
|
||||
50
index.js
50
index.js
@ -19,10 +19,9 @@
|
||||
|
||||
'use strict'
|
||||
|
||||
const nodeMajor = Number(process.versions.node.split('.')[0])
|
||||
|
||||
const { EventEmitter } = require('events')
|
||||
const { URL } = require('url')
|
||||
const buffer = require('buffer')
|
||||
const debug = require('debug')('elasticsearch')
|
||||
const Transport = require('./lib/Transport')
|
||||
const Connection = require('./lib/Connection')
|
||||
@ -47,15 +46,6 @@ const kEventEmitter = Symbol('elasticsearchjs-event-emitter')
|
||||
|
||||
const ESAPI = require('./api')
|
||||
|
||||
/* istanbul ignore next */
|
||||
if (nodeMajor >= 10 && nodeMajor < 12) {
|
||||
process.emitWarning('You are using a version of Node.js that will reach EOL in April 2021. ' +
|
||||
'The support for this version will be dropped in 7.13. ' +
|
||||
'Please refer to https://ela.st/nodejs-support for additional information.',
|
||||
'DeprecationWarning'
|
||||
)
|
||||
}
|
||||
|
||||
class Client extends ESAPI {
|
||||
constructor (opts = {}) {
|
||||
super({ ConfigurationError })
|
||||
@ -113,6 +103,7 @@ class Client extends ESAPI {
|
||||
suggestCompression: false,
|
||||
compression: false,
|
||||
ssl: null,
|
||||
caFingerprint: null,
|
||||
agent: null,
|
||||
headers: {},
|
||||
nodeFilter: null,
|
||||
@ -124,9 +115,27 @@ class Client extends ESAPI {
|
||||
context: null,
|
||||
proxy: null,
|
||||
enableMetaHeader: true,
|
||||
disablePrototypePoisoningProtection: false
|
||||
disablePrototypePoisoningProtection: false,
|
||||
maxResponseSize: null,
|
||||
maxCompressedResponseSize: null
|
||||
}, opts)
|
||||
|
||||
if (options.maxResponseSize !== null && options.maxResponseSize > buffer.constants.MAX_STRING_LENGTH) {
|
||||
throw new ConfigurationError(`The maxResponseSize cannot be bigger than ${buffer.constants.MAX_STRING_LENGTH}`)
|
||||
}
|
||||
|
||||
if (options.maxCompressedResponseSize !== null && options.maxCompressedResponseSize > buffer.constants.MAX_LENGTH) {
|
||||
throw new ConfigurationError(`The maxCompressedResponseSize cannot be bigger than ${buffer.constants.MAX_LENGTH}`)
|
||||
}
|
||||
|
||||
if (options.caFingerprint !== null && isHttpConnection(opts.node || opts.nodes)) {
|
||||
throw new ConfigurationError('You can\'t configure the caFingerprint with a http connection')
|
||||
}
|
||||
|
||||
if (process.env.ELASTIC_CLIENT_APIVERSIONING === 'true') {
|
||||
options.headers = Object.assign({ accept: 'application/vnd.elasticsearch+json; compatible-with=7' }, options.headers)
|
||||
}
|
||||
|
||||
this[kInitialOptions] = options
|
||||
this[kExtensions] = []
|
||||
this.name = options.name
|
||||
@ -153,6 +162,7 @@ class Client extends ESAPI {
|
||||
Connection: options.Connection,
|
||||
auth: options.auth,
|
||||
emit: this[kEventEmitter].emit.bind(this[kEventEmitter]),
|
||||
caFingerprint: options.caFingerprint,
|
||||
sniffEnabled: options.sniffInterval !== false ||
|
||||
options.sniffOnStart !== false ||
|
||||
options.sniffOnConnectionFault !== false
|
||||
@ -179,7 +189,9 @@ class Client extends ESAPI {
|
||||
generateRequestId: options.generateRequestId,
|
||||
name: options.name,
|
||||
opaqueIdPrefix: options.opaqueIdPrefix,
|
||||
context: options.context
|
||||
context: options.context,
|
||||
maxResponseSize: options.maxResponseSize,
|
||||
maxCompressedResponseSize: options.maxCompressedResponseSize
|
||||
})
|
||||
|
||||
this.helpers = new Helpers({
|
||||
@ -262,6 +274,10 @@ class Client extends ESAPI {
|
||||
}
|
||||
|
||||
const client = new Client(options)
|
||||
// sync product check
|
||||
const tSymbol = Object.getOwnPropertySymbols(this.transport)
|
||||
.filter(symbol => symbol.description === 'product check')[0]
|
||||
client.transport[tSymbol] = this.transport[tSymbol]
|
||||
// Add parent extensions
|
||||
if (this[kExtensions].length > 0) {
|
||||
this[kExtensions].forEach(({ name, opts, fn }) => {
|
||||
@ -318,6 +334,14 @@ function getAuth (node) {
|
||||
}
|
||||
}
|
||||
|
||||
function isHttpConnection (node) {
|
||||
if (Array.isArray(node)) {
|
||||
return node.some((n) => (typeof n === 'string' ? new URL(n).protocol : n.url.protocol) === 'http:')
|
||||
} else {
|
||||
return (typeof node === 'string' ? new URL(node).protocol : node.url.protocol) === 'http:'
|
||||
}
|
||||
}
|
||||
|
||||
const events = {
|
||||
RESPONSE: 'response',
|
||||
REQUEST: 'request',
|
||||
|
||||
1
lib/Connection.d.ts
vendored
1
lib/Connection.d.ts
vendored
@ -40,6 +40,7 @@ export interface ConnectionOptions {
|
||||
roles?: ConnectionRoles;
|
||||
auth?: BasicAuth | ApiKeyAuth;
|
||||
proxy?: string | URL;
|
||||
caFingerprint?: string;
|
||||
}
|
||||
|
||||
interface ConnectionRoles {
|
||||
|
||||
@ -25,7 +25,7 @@ const hpagent = require('hpagent')
|
||||
const http = require('http')
|
||||
const https = require('https')
|
||||
const debug = require('debug')('elasticsearch')
|
||||
const pump = require('pump')
|
||||
const { pipeline } = require('stream')
|
||||
const INVALID_PATH_REGEX = /[^\u0021-\u00ff]/
|
||||
const {
|
||||
ConnectionError,
|
||||
@ -42,6 +42,7 @@ class Connection {
|
||||
this.headers = prepareHeaders(opts.headers, opts.auth)
|
||||
this.deadCount = 0
|
||||
this.resurrectTimeout = 0
|
||||
this.caFingerprint = opts.caFingerprint
|
||||
|
||||
this._openRequests = 0
|
||||
this._status = opts.status || Connection.statuses.ALIVE
|
||||
@ -112,7 +113,14 @@ class Connection {
|
||||
const onError = err => {
|
||||
cleanListeners()
|
||||
this._openRequests--
|
||||
callback(new ConnectionError(err.message), null)
|
||||
let message = err.message
|
||||
if (err.code === 'ECONNRESET') {
|
||||
/* istanbul ignore next */
|
||||
const socket = request.socket || {}
|
||||
/* istanbul ignore next */
|
||||
message += ` - Local: ${socket.localAddress || 'unknown'}:${socket.localPort || 'unknown'}, Remote: ${socket.remoteAddress || 'unknown'}:${socket.remotePort || 'unknown'}`
|
||||
}
|
||||
callback(new ConnectionError(message), null)
|
||||
}
|
||||
|
||||
const onAbort = () => {
|
||||
@ -123,17 +131,43 @@ class Connection {
|
||||
callback(new RequestAbortedError(), null)
|
||||
}
|
||||
|
||||
const onSocket = socket => {
|
||||
/* istanbul ignore else */
|
||||
if (!socket.isSessionReused()) {
|
||||
socket.once('secureConnect', () => {
|
||||
const issuerCertificate = getIssuerCertificate(socket)
|
||||
/* istanbul ignore next */
|
||||
if (issuerCertificate == null) {
|
||||
onError(new Error('Invalid or malformed certificate'))
|
||||
request.once('error', () => {}) // we need to catch the request aborted error
|
||||
return request.abort()
|
||||
}
|
||||
|
||||
// Check if fingerprint matches
|
||||
/* istanbul ignore else */
|
||||
if (this.caFingerprint !== issuerCertificate.fingerprint256) {
|
||||
onError(new Error('Server certificate CA fingerprint does not match the value configured in caFingerprint'))
|
||||
request.once('error', () => {}) // we need to catch the request aborted error
|
||||
return request.abort()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
request.on('response', onResponse)
|
||||
request.on('timeout', onTimeout)
|
||||
request.on('error', onError)
|
||||
request.on('abort', onAbort)
|
||||
if (this.caFingerprint != null) {
|
||||
request.on('socket', onSocket)
|
||||
}
|
||||
|
||||
// Disables the Nagle algorithm
|
||||
request.setNoDelay(true)
|
||||
|
||||
// starts the request
|
||||
if (isStream(params.body) === true) {
|
||||
pump(params.body, request, err => {
|
||||
pipeline(params.body, request, err => {
|
||||
/* istanbul ignore if */
|
||||
if (err != null && cleanedListeners === false) {
|
||||
cleanListeners()
|
||||
@ -152,6 +186,7 @@ class Connection {
|
||||
request.removeListener('timeout', onTimeout)
|
||||
request.removeListener('error', onError)
|
||||
request.removeListener('abort', onAbort)
|
||||
request.removeListener('socket', onSocket)
|
||||
cleanedListeners = true
|
||||
}
|
||||
}
|
||||
@ -331,6 +366,8 @@ function prepareHeaders (headers = {}, auth) {
|
||||
} else {
|
||||
headers.authorization = `ApiKey ${auth.apiKey}`
|
||||
}
|
||||
} else if (auth.bearer) {
|
||||
headers.authorization = `Bearer ${auth.bearer}`
|
||||
} else if (auth.username && auth.password) {
|
||||
headers.authorization = 'Basic ' + Buffer.from(`${auth.username}:${auth.password}`).toString('base64')
|
||||
}
|
||||
@ -338,5 +375,25 @@ function prepareHeaders (headers = {}, auth) {
|
||||
return headers
|
||||
}
|
||||
|
||||
function getIssuerCertificate (socket) {
|
||||
let certificate = socket.getPeerCertificate(true)
|
||||
while (certificate && Object.keys(certificate).length > 0) {
|
||||
// invalid certificate
|
||||
if (certificate.issuerCertificate == null) {
|
||||
return null
|
||||
}
|
||||
|
||||
// We have reached the root certificate.
|
||||
// In case of self-signed certificates, `issuerCertificate` may be a circular reference.
|
||||
if (certificate.fingerprint256 === certificate.issuerCertificate.fingerprint256) {
|
||||
break
|
||||
}
|
||||
|
||||
// continue the loop
|
||||
certificate = certificate.issuerCertificate
|
||||
}
|
||||
return certificate
|
||||
}
|
||||
|
||||
module.exports = Connection
|
||||
module.exports.internals = { prepareHeaders }
|
||||
module.exports.internals = { prepareHeaders, getIssuerCertificate }
|
||||
|
||||
2
lib/Helpers.d.ts
vendored
2
lib/Helpers.d.ts
vendored
@ -36,6 +36,7 @@ export interface ScrollSearchResponse<TDocument = unknown, TResponse = Record<st
|
||||
|
||||
export interface BulkHelper<T> extends Promise<T> {
|
||||
abort: () => BulkHelper<T>
|
||||
readonly stats: BulkStats
|
||||
}
|
||||
|
||||
export interface BulkStats {
|
||||
@ -43,6 +44,7 @@ export interface BulkStats {
|
||||
failed: number
|
||||
retry: number
|
||||
successful: number
|
||||
noop: number
|
||||
time: number
|
||||
bytes: number
|
||||
aborted: boolean
|
||||
|
||||
@ -456,6 +456,7 @@ class Helpers {
|
||||
failed: 0,
|
||||
retry: 0,
|
||||
successful: 0,
|
||||
noop: 0,
|
||||
time: 0,
|
||||
bytes: 0,
|
||||
aborted: false
|
||||
@ -463,6 +464,9 @@ class Helpers {
|
||||
|
||||
const p = iterate()
|
||||
const helper = {
|
||||
get stats () {
|
||||
return stats
|
||||
},
|
||||
then (onFulfilled, onRejected) {
|
||||
return p.then(onFulfilled, onRejected)
|
||||
},
|
||||
@ -692,6 +696,11 @@ class Helpers {
|
||||
if (err) return callback(err, null)
|
||||
if (body.errors === false) {
|
||||
stats.successful += body.items.length
|
||||
for (const item of body.items) {
|
||||
if (item.update && item.update.result === 'noop') {
|
||||
stats.noop++
|
||||
}
|
||||
}
|
||||
return callback(null, [])
|
||||
}
|
||||
const retry = []
|
||||
|
||||
11
lib/Transport.d.ts
vendored
11
lib/Transport.d.ts
vendored
@ -26,7 +26,8 @@ import * as errors from './errors';
|
||||
export type ApiError = errors.ConfigurationError | errors.ConnectionError |
|
||||
errors.DeserializationError | errors.SerializationError |
|
||||
errors.NoLivingConnectionsError | errors.ResponseError |
|
||||
errors.TimeoutError | errors.RequestAbortedError
|
||||
errors.TimeoutError | errors.RequestAbortedError |
|
||||
errors.ProductNotSupportedError
|
||||
|
||||
export type Context = unknown
|
||||
|
||||
@ -60,6 +61,8 @@ interface TransportOptions {
|
||||
generateRequestId?: generateRequestIdFn;
|
||||
name?: string;
|
||||
opaqueIdPrefix?: string;
|
||||
maxResponseSize?: number;
|
||||
maxCompressedResponseSize?: number;
|
||||
}
|
||||
|
||||
export interface RequestEvent<TResponse = Record<string, any>, TContext = Context> {
|
||||
@ -112,6 +115,8 @@ export interface TransportRequestOptions {
|
||||
context?: Context;
|
||||
warnings?: string[];
|
||||
opaqueId?: string;
|
||||
maxResponseSize?: number;
|
||||
maxCompressedResponseSize?: number;
|
||||
}
|
||||
|
||||
export interface TransportRequestCallback {
|
||||
@ -154,8 +159,8 @@ export default class Transport {
|
||||
_nextSniff: number;
|
||||
_isSniffing: boolean;
|
||||
constructor(opts: TransportOptions);
|
||||
request(params: TransportRequestParams, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse>;
|
||||
request(params: TransportRequestParams, options?: TransportRequestOptions, callback?: (err: ApiError, result: ApiResponse) => void): TransportRequestCallback;
|
||||
request<TResponse = Record<string, any>, TContext = Context>(params: TransportRequestParams, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>;
|
||||
request<TResponse = Record<string, any>, TContext = Context>(params: TransportRequestParams, options?: TransportRequestOptions, callback?: (err: ApiError, result: ApiResponse<TResponse, TContext>) => void): TransportRequestCallback;
|
||||
getConnection(opts: TransportGetConnectionOptions): Connection | null;
|
||||
sniff(opts?: TransportSniffOptions, callback?: (...args: any[]) => void): void;
|
||||
}
|
||||
|
||||
301
lib/Transport.js
301
lib/Transport.js
@ -24,12 +24,14 @@ const os = require('os')
|
||||
const { gzip, unzip, createGzip } = require('zlib')
|
||||
const buffer = require('buffer')
|
||||
const ms = require('ms')
|
||||
const { EventEmitter } = require('events')
|
||||
const {
|
||||
ConnectionError,
|
||||
RequestAbortedError,
|
||||
NoLivingConnectionsError,
|
||||
ResponseError,
|
||||
ConfigurationError
|
||||
ConfigurationError,
|
||||
ProductNotSupportedError
|
||||
} = require('./errors')
|
||||
|
||||
const noop = () => {}
|
||||
@ -38,6 +40,11 @@ const clientVersion = require('../package.json').version
|
||||
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
|
||||
const kProductCheck = Symbol('product check')
|
||||
const kApiVersioning = Symbol('api versioning')
|
||||
const kEventEmitter = Symbol('event emitter')
|
||||
const kMaxResponseSize = Symbol('max response size')
|
||||
const kMaxCompressedResponseSize = Symbol('max compressed response size')
|
||||
|
||||
class Transport {
|
||||
constructor (opts) {
|
||||
@ -64,6 +71,11 @@ class Transport {
|
||||
this.generateRequestId = opts.generateRequestId || generateRequestId()
|
||||
this.name = opts.name
|
||||
this.opaqueIdPrefix = opts.opaqueIdPrefix
|
||||
this[kProductCheck] = 0 // 0 = to be checked, 1 = checking, 2 = checked-ok, 3 checked-notok, 4 checked-nodefault
|
||||
this[kApiVersioning] = process.env.ELASTIC_CLIENT_APIVERSIONING === 'true'
|
||||
this[kEventEmitter] = new EventEmitter()
|
||||
this[kMaxResponseSize] = opts.maxResponseSize || MAX_STRING_LENGTH
|
||||
this[kMaxCompressedResponseSize] = opts.maxCompressedResponseSize || MAX_BUFFER_LENGTH
|
||||
|
||||
this.nodeFilter = opts.nodeFilter || defaultNodeFilter
|
||||
if (typeof opts.nodeSelector === 'function') {
|
||||
@ -81,7 +93,11 @@ class Transport {
|
||||
this._isSniffing = false
|
||||
|
||||
if (opts.sniffOnStart === true) {
|
||||
this.sniff({ reason: Transport.sniffReasons.SNIFF_ON_START })
|
||||
// timer needed otherwise it will clash
|
||||
// with the product check testing
|
||||
setTimeout(() => {
|
||||
this.sniff({ reason: Transport.sniffReasons.SNIFF_ON_START })
|
||||
}, 10)
|
||||
}
|
||||
}
|
||||
|
||||
@ -150,13 +166,19 @@ class Transport {
|
||||
? 0
|
||||
: (typeof options.maxRetries === 'number' ? options.maxRetries : this.maxRetries)
|
||||
const compression = options.compression !== undefined ? options.compression : this.compression
|
||||
const maxResponseSize = options.maxResponseSize || this[kMaxResponseSize]
|
||||
const maxCompressedResponseSize = options.maxCompressedResponseSize || this[kMaxCompressedResponseSize]
|
||||
let request = { abort: noop }
|
||||
const transportReturn = {
|
||||
then (onFulfilled, onRejected) {
|
||||
return p.then(onFulfilled, onRejected)
|
||||
if (p != null) {
|
||||
return p.then(onFulfilled, onRejected)
|
||||
}
|
||||
},
|
||||
catch (onRejected) {
|
||||
return p.catch(onRejected)
|
||||
if (p != null) {
|
||||
return p.catch(onRejected)
|
||||
}
|
||||
},
|
||||
abort () {
|
||||
meta.aborted = true
|
||||
@ -165,12 +187,15 @@ class Transport {
|
||||
return this
|
||||
},
|
||||
finally (onFinally) {
|
||||
return p.finally(onFinally)
|
||||
if (p != null) {
|
||||
return p.finally(onFinally)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const makeRequest = () => {
|
||||
if (meta.aborted === true) {
|
||||
this.emit('request', new RequestAbortedError(), result)
|
||||
return process.nextTick(callback, new RequestAbortedError(), result)
|
||||
}
|
||||
meta.connection = this.getConnection({ requestId: meta.request.id })
|
||||
@ -226,26 +251,28 @@ class Transport {
|
||||
|
||||
const contentEncoding = (result.headers['content-encoding'] || '').toLowerCase()
|
||||
const isCompressed = contentEncoding.indexOf('gzip') > -1 || contentEncoding.indexOf('deflate') > -1
|
||||
const isVectorTile = (result.headers['content-type'] || '').indexOf('application/vnd.mapbox-vector-tile') > -1
|
||||
|
||||
/* istanbul ignore else */
|
||||
if (result.headers['content-length'] !== undefined) {
|
||||
const contentLength = Number(result.headers['content-length'])
|
||||
if (isCompressed && contentLength > MAX_BUFFER_LENGTH) {
|
||||
if (isCompressed && contentLength > maxCompressedResponseSize) {
|
||||
response.destroy()
|
||||
return onConnectionError(
|
||||
new RequestAbortedError(`The content length (${contentLength}) is bigger than the maximum allowed buffer (${MAX_BUFFER_LENGTH})`, result)
|
||||
new RequestAbortedError(`The content length (${contentLength}) is bigger than the maximum allowed buffer (${maxCompressedResponseSize})`, result)
|
||||
)
|
||||
} else if (contentLength > MAX_STRING_LENGTH) {
|
||||
} else if (contentLength > maxResponseSize) {
|
||||
response.destroy()
|
||||
return onConnectionError(
|
||||
new RequestAbortedError(`The content length (${contentLength}) is bigger than the maximum allowed string (${MAX_STRING_LENGTH})`, result)
|
||||
new RequestAbortedError(`The content length (${contentLength}) is bigger than the maximum allowed string (${maxResponseSize})`, result)
|
||||
)
|
||||
}
|
||||
}
|
||||
// if the response is compressed, we must handle it
|
||||
// as buffer for allowing decompression later
|
||||
let payload = isCompressed ? [] : ''
|
||||
const onData = isCompressed
|
||||
// while if it's a vector tile, we should return it as buffer
|
||||
let payload = isCompressed || isVectorTile ? [] : ''
|
||||
const onData = isCompressed || isVectorTile
|
||||
? chunk => { payload.push(chunk) }
|
||||
: chunk => { payload += chunk }
|
||||
const onEnd = err => {
|
||||
@ -261,7 +288,7 @@ class Transport {
|
||||
if (isCompressed) {
|
||||
unzip(Buffer.concat(payload), onBody)
|
||||
} else {
|
||||
onBody(null, payload)
|
||||
onBody(null, isVectorTile ? Buffer.concat(payload) : payload)
|
||||
}
|
||||
}
|
||||
|
||||
@ -270,7 +297,7 @@ class Transport {
|
||||
onEnd(new Error('Response aborted while reading the body'))
|
||||
}
|
||||
|
||||
if (!isCompressed) {
|
||||
if (!isCompressed && !isVectorTile) {
|
||||
response.setEncoding('utf8')
|
||||
}
|
||||
|
||||
@ -286,7 +313,9 @@ class Transport {
|
||||
this.emit('response', err, result)
|
||||
return callback(err, result)
|
||||
}
|
||||
if (Buffer.isBuffer(payload)) {
|
||||
|
||||
const isVectorTile = (result.headers['content-type'] || '').indexOf('application/vnd.mapbox-vector-tile') > -1
|
||||
if (Buffer.isBuffer(payload) && !isVectorTile) {
|
||||
payload = payload.toString()
|
||||
}
|
||||
const isHead = params.method === 'HEAD'
|
||||
@ -295,7 +324,8 @@ class Transport {
|
||||
// - the request is not a HEAD request
|
||||
// - the payload is not an empty string
|
||||
if (result.headers['content-type'] !== undefined &&
|
||||
result.headers['content-type'].indexOf('application/json') > -1 &&
|
||||
(result.headers['content-type'].indexOf('application/json') > -1 ||
|
||||
result.headers['content-type'].indexOf('application/vnd.elasticsearch+json') > -1) &&
|
||||
isHead === false &&
|
||||
payload !== ''
|
||||
) {
|
||||
@ -306,8 +336,8 @@ class Transport {
|
||||
return callback(err, result)
|
||||
}
|
||||
} else {
|
||||
// cast to boolean if the request method was HEAD
|
||||
result.body = isHead === true ? true : payload
|
||||
// cast to boolean if the request method was HEAD and there was no error
|
||||
result.body = isHead === true && result.statusCode < 400 ? true : payload
|
||||
}
|
||||
|
||||
// we should ignore the statusCode if the user has configured the `ignore` field with
|
||||
@ -347,91 +377,130 @@ class Transport {
|
||||
}
|
||||
}
|
||||
|
||||
this.emit('serialization', null, result)
|
||||
const headers = Object.assign({}, this.headers, lowerCaseHeaders(options.headers))
|
||||
const prepareRequest = () => {
|
||||
this.emit('serialization', null, result)
|
||||
const headers = Object.assign({}, this.headers, lowerCaseHeaders(options.headers))
|
||||
|
||||
if (options.opaqueId !== undefined) {
|
||||
headers['x-opaque-id'] = this.opaqueIdPrefix !== null
|
||||
? this.opaqueIdPrefix + options.opaqueId
|
||||
: options.opaqueId
|
||||
}
|
||||
if (options.opaqueId !== undefined) {
|
||||
headers['x-opaque-id'] = this.opaqueIdPrefix !== null
|
||||
? this.opaqueIdPrefix + options.opaqueId
|
||||
: options.opaqueId
|
||||
}
|
||||
|
||||
// handle json body
|
||||
if (params.body != null) {
|
||||
if (shouldSerialize(params.body) === true) {
|
||||
try {
|
||||
params.body = this.serializer.serialize(params.body)
|
||||
} catch (err) {
|
||||
this.emit('request', err, result)
|
||||
process.nextTick(callback, err, result)
|
||||
return transportReturn
|
||||
// handle json body
|
||||
if (params.body != null) {
|
||||
if (shouldSerialize(params.body) === true) {
|
||||
try {
|
||||
params.body = this.serializer.serialize(params.body)
|
||||
} catch (err) {
|
||||
this.emit('request', err, result)
|
||||
process.nextTick(callback, err, result)
|
||||
return transportReturn
|
||||
}
|
||||
}
|
||||
|
||||
if (params.body !== '') {
|
||||
headers['content-type'] = headers['content-type'] || (this[kApiVersioning] ? 'application/vnd.elasticsearch+json; compatible-with=7' : 'application/json')
|
||||
}
|
||||
|
||||
// handle ndjson body
|
||||
} else if (params.bulkBody != null) {
|
||||
if (shouldSerialize(params.bulkBody) === true) {
|
||||
try {
|
||||
params.body = this.serializer.ndserialize(params.bulkBody)
|
||||
} catch (err) {
|
||||
this.emit('request', err, result)
|
||||
process.nextTick(callback, err, result)
|
||||
return transportReturn
|
||||
}
|
||||
} else {
|
||||
params.body = params.bulkBody
|
||||
}
|
||||
if (params.body !== '') {
|
||||
headers['content-type'] = headers['content-type'] || (this[kApiVersioning] ? 'application/vnd.elasticsearch+x-ndjson; compatible-with=7' : 'application/x-ndjson')
|
||||
}
|
||||
}
|
||||
|
||||
if (params.body !== '') {
|
||||
headers['content-type'] = headers['content-type'] || 'application/json'
|
||||
params.headers = headers
|
||||
// serializes the querystring
|
||||
if (options.querystring == null) {
|
||||
params.querystring = this.serializer.qserialize(params.querystring)
|
||||
} else {
|
||||
params.querystring = this.serializer.qserialize(
|
||||
Object.assign({}, params.querystring, options.querystring)
|
||||
)
|
||||
}
|
||||
|
||||
// handle ndjson body
|
||||
} else if (params.bulkBody != null) {
|
||||
if (shouldSerialize(params.bulkBody) === true) {
|
||||
try {
|
||||
params.body = this.serializer.ndserialize(params.bulkBody)
|
||||
} catch (err) {
|
||||
this.emit('request', err, result)
|
||||
process.nextTick(callback, err, result)
|
||||
return transportReturn
|
||||
// handles request timeout
|
||||
params.timeout = toMs(options.requestTimeout || this.requestTimeout)
|
||||
if (options.asStream === true) params.asStream = true
|
||||
|
||||
// handle compression
|
||||
if (params.body !== '' && params.body != null) {
|
||||
if (isStream(params.body) === true) {
|
||||
if (compression === 'gzip') {
|
||||
params.headers['content-encoding'] = compression
|
||||
params.body = params.body.pipe(createGzip())
|
||||
}
|
||||
makeRequest()
|
||||
} else if (compression === 'gzip') {
|
||||
gzip(params.body, (err, buffer) => {
|
||||
/* istanbul ignore next */
|
||||
if (err) {
|
||||
this.emit('request', err, result)
|
||||
return callback(err, result)
|
||||
}
|
||||
params.headers['content-encoding'] = compression
|
||||
params.headers['content-length'] = '' + Buffer.byteLength(buffer)
|
||||
params.body = buffer
|
||||
makeRequest()
|
||||
})
|
||||
} else {
|
||||
params.headers['content-length'] = '' + Buffer.byteLength(params.body)
|
||||
makeRequest()
|
||||
}
|
||||
} else {
|
||||
params.body = params.bulkBody
|
||||
}
|
||||
if (params.body !== '') {
|
||||
headers['content-type'] = headers['content-type'] || 'application/x-ndjson'
|
||||
makeRequest()
|
||||
}
|
||||
}
|
||||
|
||||
params.headers = headers
|
||||
// serializes the querystring
|
||||
if (options.querystring == null) {
|
||||
params.querystring = this.serializer.qserialize(params.querystring)
|
||||
} else {
|
||||
params.querystring = this.serializer.qserialize(
|
||||
Object.assign({}, params.querystring, options.querystring)
|
||||
)
|
||||
}
|
||||
|
||||
// handles request timeout
|
||||
params.timeout = toMs(options.requestTimeout || this.requestTimeout)
|
||||
if (options.asStream === true) params.asStream = true
|
||||
meta.request.params = params
|
||||
meta.request.options = options
|
||||
|
||||
// handle compression
|
||||
if (params.body !== '' && params.body != null) {
|
||||
if (isStream(params.body) === true) {
|
||||
if (compression === 'gzip') {
|
||||
params.headers['content-encoding'] = compression
|
||||
params.body = params.body.pipe(createGzip())
|
||||
}
|
||||
makeRequest()
|
||||
} else if (compression === 'gzip') {
|
||||
gzip(params.body, (err, buffer) => {
|
||||
/* istanbul ignore next */
|
||||
if (err) {
|
||||
this.emit('request', err, result)
|
||||
return callback(err, result)
|
||||
}
|
||||
params.headers['content-encoding'] = compression
|
||||
params.headers['content-length'] = '' + Buffer.byteLength(buffer)
|
||||
params.body = buffer
|
||||
makeRequest()
|
||||
})
|
||||
// still need to check the product or waiting for the check to finish
|
||||
if (this[kProductCheck] === 0 || this[kProductCheck] === 1) {
|
||||
// let pass info requests
|
||||
if (params.method === 'GET' && params.path === '/') {
|
||||
prepareRequest()
|
||||
} else {
|
||||
params.headers['content-length'] = '' + Buffer.byteLength(params.body)
|
||||
makeRequest()
|
||||
// wait for product check to finish
|
||||
this[kEventEmitter].once('product-check', (error, status) => {
|
||||
if (status === false) {
|
||||
const err = error || new ProductNotSupportedError(result)
|
||||
if (this[kProductCheck] === 4) {
|
||||
err.message = 'The client noticed that the server is not a supported distribution of Elasticsearch'
|
||||
}
|
||||
this.emit('request', err, result)
|
||||
process.nextTick(callback, err, result)
|
||||
} else {
|
||||
prepareRequest()
|
||||
}
|
||||
})
|
||||
// the very first request triggers the product check
|
||||
if (this[kProductCheck] === 0) {
|
||||
this.productCheck()
|
||||
}
|
||||
}
|
||||
// the product check is finished and it's not Elasticsearch
|
||||
} else if (this[kProductCheck] === 3 || this[kProductCheck] === 4) {
|
||||
const err = new ProductNotSupportedError(result)
|
||||
if (this[kProductCheck] === 4) {
|
||||
err.message = 'The client noticed that the server is not a supported distribution of Elasticsearch'
|
||||
}
|
||||
this.emit('request', err, result)
|
||||
process.nextTick(callback, err, result)
|
||||
// the product check finished and it's Elasticsearch
|
||||
} else {
|
||||
makeRequest()
|
||||
prepareRequest()
|
||||
}
|
||||
|
||||
return transportReturn
|
||||
@ -491,6 +560,68 @@ class Transport {
|
||||
callback(null, hosts)
|
||||
})
|
||||
}
|
||||
|
||||
productCheck () {
|
||||
debug('Start product check')
|
||||
this[kProductCheck] = 1
|
||||
this.request({
|
||||
method: 'GET',
|
||||
path: '/'
|
||||
}, (err, result) => {
|
||||
this[kProductCheck] = 3
|
||||
if (err) {
|
||||
debug('Product check failed', err)
|
||||
if (err.statusCode === 401 || err.statusCode === 403) {
|
||||
this[kProductCheck] = 2
|
||||
process.emitWarning(
|
||||
'The client is unable to verify that the server is Elasticsearch due to security privileges on the server side. Some functionality may not be compatible if the server is running an unsupported product.',
|
||||
'ProductNotSupportedSecurityError'
|
||||
)
|
||||
this[kEventEmitter].emit('product-check', null, true)
|
||||
} else {
|
||||
this[kProductCheck] = 0
|
||||
this[kEventEmitter].emit('product-check', err, false)
|
||||
}
|
||||
} else {
|
||||
debug('Checking elasticsearch version', result.body, result.headers)
|
||||
if (result.body.version == null || typeof result.body.version.number !== 'string') {
|
||||
debug('Can\'t access Elasticsearch version')
|
||||
return this[kEventEmitter].emit('product-check', null, false)
|
||||
}
|
||||
const tagline = result.body.tagline
|
||||
const version = result.body.version.number.split('.')
|
||||
const major = Number(version[0])
|
||||
const minor = Number(version[1])
|
||||
if (major < 6) {
|
||||
return this[kEventEmitter].emit('product-check', null, false)
|
||||
} else if (major >= 6 && major < 7) {
|
||||
if (tagline !== 'You Know, for Search') {
|
||||
debug('Bad tagline')
|
||||
return this[kEventEmitter].emit('product-check', null, false)
|
||||
}
|
||||
} else if (major === 7 && minor < 14) {
|
||||
if (tagline !== 'You Know, for Search') {
|
||||
debug('Bad tagline')
|
||||
return this[kEventEmitter].emit('product-check', null, false)
|
||||
}
|
||||
|
||||
if (result.body.version.build_flavor !== 'default') {
|
||||
debug('Bad build_flavor')
|
||||
this[kProductCheck] = 4
|
||||
return this[kEventEmitter].emit('product-check', null, false)
|
||||
}
|
||||
} else {
|
||||
if (result.headers['x-elastic-product'] !== 'Elasticsearch') {
|
||||
debug('x-elastic-product not recognized')
|
||||
return this[kEventEmitter].emit('product-check', null, false)
|
||||
}
|
||||
}
|
||||
debug('Valid Elasticsearch distribution')
|
||||
this[kProductCheck] = 2
|
||||
this[kEventEmitter].emit('product-check', null, true)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Transport.sniffReasons = {
|
||||
|
||||
7
lib/errors.d.ts
vendored
7
lib/errors.d.ts
vendored
@ -81,3 +81,10 @@ export declare class RequestAbortedError<TResponse = Record<string, any>, TConte
|
||||
meta: ApiResponse<TResponse, TContext>;
|
||||
constructor(message: string, meta: ApiResponse);
|
||||
}
|
||||
|
||||
export declare class ProductNotSupportedError<TResponse = Record<string, any>, TContext = Context> extends ElasticsearchClientError {
|
||||
name: string;
|
||||
message: string;
|
||||
meta: ApiResponse<TResponse, TContext>;
|
||||
constructor(meta: ApiResponse);
|
||||
}
|
||||
|
||||
@ -90,7 +90,18 @@ class ResponseError extends ElasticsearchClientError {
|
||||
super('Response Error')
|
||||
Error.captureStackTrace(this, ResponseError)
|
||||
this.name = 'ResponseError'
|
||||
this.message = (meta.body && meta.body.error && meta.body.error.type) || 'Response Error'
|
||||
if (meta.body && meta.body.error && meta.body.error.type) {
|
||||
if (Array.isArray(meta.body.error.root_cause)) {
|
||||
this.message = meta.body.error.type + ': '
|
||||
this.message += meta.body.error.root_cause.map(entry => `[${entry.type}] Reason: ${entry.reason}`).join('; ')
|
||||
} else {
|
||||
this.message = meta.body.error.type
|
||||
}
|
||||
} else if (typeof meta.body === 'object' && meta.body != null) {
|
||||
this.message = JSON.stringify(meta.body)
|
||||
} else {
|
||||
this.message = meta.body || 'Response Error'
|
||||
}
|
||||
this.meta = meta
|
||||
}
|
||||
|
||||
@ -108,6 +119,10 @@ class ResponseError extends ElasticsearchClientError {
|
||||
get headers () {
|
||||
return this.meta.headers
|
||||
}
|
||||
|
||||
toString () {
|
||||
return JSON.stringify(this.meta.body)
|
||||
}
|
||||
}
|
||||
|
||||
class RequestAbortedError extends ElasticsearchClientError {
|
||||
@ -120,6 +135,16 @@ class RequestAbortedError extends ElasticsearchClientError {
|
||||
}
|
||||
}
|
||||
|
||||
class ProductNotSupportedError extends ElasticsearchClientError {
|
||||
constructor (meta) {
|
||||
super('Product Not Supported Error')
|
||||
Error.captureStackTrace(this, ProductNotSupportedError)
|
||||
this.name = 'ProductNotSupportedError'
|
||||
this.message = 'The client noticed that the server is not Elasticsearch and we do not support this unknown product.'
|
||||
this.meta = meta
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
ElasticsearchClientError,
|
||||
TimeoutError,
|
||||
@ -129,5 +154,6 @@ module.exports = {
|
||||
DeserializationError,
|
||||
ConfigurationError,
|
||||
ResponseError,
|
||||
RequestAbortedError
|
||||
RequestAbortedError,
|
||||
ProductNotSupportedError
|
||||
}
|
||||
|
||||
@ -36,6 +36,7 @@ class BaseConnectionPool {
|
||||
this._ssl = opts.ssl
|
||||
this._agent = opts.agent
|
||||
this._proxy = opts.proxy || null
|
||||
this._caFingerprint = opts.caFingerprint || null
|
||||
}
|
||||
|
||||
getConnection () {
|
||||
@ -72,6 +73,8 @@ class BaseConnectionPool {
|
||||
if (opts.agent == null) opts.agent = this._agent
|
||||
/* istanbul ignore else */
|
||||
if (opts.proxy == null) opts.proxy = this._proxy
|
||||
/* istanbul ignore else */
|
||||
if (opts.caFingerprint == null) opts.caFingerprint = this._caFingerprint
|
||||
|
||||
const connection = new this.Connection(opts)
|
||||
|
||||
|
||||
6
lib/pool/index.d.ts
vendored
6
lib/pool/index.d.ts
vendored
@ -31,6 +31,7 @@ interface BaseConnectionPoolOptions {
|
||||
auth?: BasicAuth | ApiKeyAuth;
|
||||
emit: (event: string | symbol, ...args: any[]) => boolean;
|
||||
Connection: typeof Connection;
|
||||
caFingerprint?: string;
|
||||
}
|
||||
|
||||
interface ConnectionPoolOptions extends BaseConnectionPoolOptions {
|
||||
@ -61,6 +62,10 @@ interface BasicAuth {
|
||||
password: string;
|
||||
}
|
||||
|
||||
interface BearerAuth {
|
||||
bearer: string
|
||||
}
|
||||
|
||||
interface resurrectOptions {
|
||||
now?: number;
|
||||
requestId: string;
|
||||
@ -204,6 +209,7 @@ export {
|
||||
getConnectionOptions,
|
||||
ApiKeyAuth,
|
||||
BasicAuth,
|
||||
BearerAuth,
|
||||
internals,
|
||||
resurrectOptions,
|
||||
ResurrectEvent,
|
||||
|
||||
35
package.json
35
package.json
@ -8,11 +8,11 @@
|
||||
"require": "./index.js",
|
||||
"import": "./index.mjs"
|
||||
},
|
||||
"./": "./"
|
||||
"./*": "./*.js"
|
||||
},
|
||||
"homepage": "http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html",
|
||||
"version": "7.13.0",
|
||||
"versionCanary": "7.13.0-canary.3",
|
||||
"version": "7.16.0",
|
||||
"versionCanary": "7.16.0-canary.7",
|
||||
"keywords": [
|
||||
"elasticsearch",
|
||||
"elastic",
|
||||
@ -48,39 +48,38 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sinonjs/fake-timers": "github:sinonjs/fake-timers#0bfffc1",
|
||||
"@types/node": "^14.14.28",
|
||||
"convert-hrtime": "^3.0.0",
|
||||
"@types/node": "^15.3.1",
|
||||
"convert-hrtime": "^5.0.0",
|
||||
"cross-zip": "^4.0.0",
|
||||
"dedent": "^0.7.0",
|
||||
"deepmerge": "^4.2.2",
|
||||
"dezalgo": "^1.0.3",
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"into-stream": "^6.0.0",
|
||||
"js-yaml": "^4.0.0",
|
||||
"js-yaml": "^4.1.0",
|
||||
"license-checker": "^25.0.1",
|
||||
"minimist": "^1.2.5",
|
||||
"node-fetch": "^2.6.1",
|
||||
"ora": "^5.3.0",
|
||||
"ora": "^5.4.0",
|
||||
"pretty-hrtime": "^1.0.3",
|
||||
"proxy": "^1.0.2",
|
||||
"rimraf": "^3.0.2",
|
||||
"semver": "^7.3.4",
|
||||
"simple-git": "^2.35.0",
|
||||
"simple-statistics": "^7.4.1",
|
||||
"semver": "^7.3.5",
|
||||
"simple-git": "^2.39.0",
|
||||
"simple-statistics": "^7.7.0",
|
||||
"split2": "^3.2.2",
|
||||
"standard": "^16.0.3",
|
||||
"stoppable": "^1.1.0",
|
||||
"tap": "^14.11.0",
|
||||
"tsd": "^0.14.0",
|
||||
"tap": "^15.0.9",
|
||||
"tsd": "^0.15.1",
|
||||
"workq": "^3.0.0",
|
||||
"xmlbuilder2": "^2.4.0"
|
||||
"xmlbuilder2": "^2.4.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": "^4.3.1",
|
||||
"hpagent": "^0.1.1",
|
||||
"ms": "^2.1.3",
|
||||
"pump": "^3.0.0",
|
||||
"secure-json-parse": "^2.3.1"
|
||||
"secure-json-parse": "^2.4.0"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
@ -91,17 +90,17 @@
|
||||
"url": "https://github.com/elastic/elasticsearch-js/issues"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
"node": ">=12"
|
||||
},
|
||||
"tsd": {
|
||||
"directory": "test/types"
|
||||
},
|
||||
"tap": {
|
||||
"esm": false,
|
||||
"ts": false,
|
||||
"jsx": false,
|
||||
"flow": false,
|
||||
"coverage": false,
|
||||
"jobs-auto": true
|
||||
"jobs-auto": true,
|
||||
"check-coverage": false
|
||||
}
|
||||
}
|
||||
|
||||
@ -222,7 +222,7 @@ function generateApiDoc (spec) {
|
||||
doc += `link:${documentationUrl}[Documentation] +\n`
|
||||
}
|
||||
if (codeExamples.includes(name)) {
|
||||
doc += `{jsclient}/${name.replace(/\./g, '_')}_examples.html[Code Example] +\n`
|
||||
doc += `<<${name.replace(/\./g, '_')}_examples,Code Example>> +\n`
|
||||
}
|
||||
|
||||
if (params.length !== 0) {
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
const { test } = require('tap')
|
||||
const intoStream = require('into-stream')
|
||||
const { Client, Connection, events } = require('../../index')
|
||||
const { Connection, events } = require('../../index')
|
||||
const {
|
||||
TimeoutError,
|
||||
ConnectionError,
|
||||
@ -31,6 +31,7 @@ const {
|
||||
DeserializationError
|
||||
} = require('../../lib/errors')
|
||||
const {
|
||||
Client,
|
||||
buildServer,
|
||||
connection: {
|
||||
MockConnection,
|
||||
@ -57,27 +58,27 @@ test('No errors', t => {
|
||||
|
||||
client.on(events.SERIALIZATION, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.SERIALIZATION)
|
||||
t.equal(order.shift(), events.SERIALIZATION)
|
||||
})
|
||||
|
||||
client.on(events.REQUEST, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.REQUEST)
|
||||
t.equal(order.shift(), events.REQUEST)
|
||||
})
|
||||
|
||||
client.on(events.DESERIALIZATION, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.DESERIALIZATION)
|
||||
t.equal(order.shift(), events.DESERIALIZATION)
|
||||
})
|
||||
|
||||
client.on(events.RESPONSE, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.RESPONSE)
|
||||
t.equal(order.shift(), events.RESPONSE)
|
||||
})
|
||||
|
||||
client.info((err, result) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.length, 0)
|
||||
t.equal(order.length, 0)
|
||||
})
|
||||
})
|
||||
|
||||
@ -99,12 +100,12 @@ test('Connection error', t => {
|
||||
|
||||
client.on(events.SERIALIZATION, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.SERIALIZATION)
|
||||
t.equal(order.shift(), events.SERIALIZATION)
|
||||
})
|
||||
|
||||
client.on(events.REQUEST, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.REQUEST)
|
||||
t.equal(order.shift(), events.REQUEST)
|
||||
})
|
||||
|
||||
client.on(events.DESERIALIZATION, (_err, request) => {
|
||||
@ -113,12 +114,12 @@ test('Connection error', t => {
|
||||
|
||||
client.on(events.RESPONSE, (err, request) => {
|
||||
t.ok(err instanceof ConnectionError)
|
||||
t.strictEqual(order.shift(), events.RESPONSE)
|
||||
t.equal(order.shift(), events.RESPONSE)
|
||||
})
|
||||
|
||||
client.info((err, result) => {
|
||||
t.ok(err instanceof ConnectionError)
|
||||
t.strictEqual(order.length, 0)
|
||||
t.equal(order.length, 0)
|
||||
})
|
||||
})
|
||||
|
||||
@ -140,12 +141,12 @@ test('TimeoutError error', t => {
|
||||
|
||||
client.on(events.SERIALIZATION, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.SERIALIZATION)
|
||||
t.equal(order.shift(), events.SERIALIZATION)
|
||||
})
|
||||
|
||||
client.on(events.REQUEST, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.REQUEST)
|
||||
t.equal(order.shift(), events.REQUEST)
|
||||
})
|
||||
|
||||
client.on(events.DESERIALIZATION, (_err, request) => {
|
||||
@ -154,12 +155,12 @@ test('TimeoutError error', t => {
|
||||
|
||||
client.on(events.RESPONSE, (err, request) => {
|
||||
t.ok(err instanceof TimeoutError)
|
||||
t.strictEqual(order.shift(), events.RESPONSE)
|
||||
t.equal(order.shift(), events.RESPONSE)
|
||||
})
|
||||
|
||||
client.info((err, result) => {
|
||||
t.ok(err instanceof TimeoutError)
|
||||
t.strictEqual(order.length, 0)
|
||||
t.equal(order.length, 0)
|
||||
})
|
||||
})
|
||||
|
||||
@ -180,12 +181,12 @@ test('RequestAbortedError error', t => {
|
||||
|
||||
client.on(events.SERIALIZATION, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.SERIALIZATION)
|
||||
t.equal(order.shift(), events.SERIALIZATION)
|
||||
})
|
||||
|
||||
client.on(events.REQUEST, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.REQUEST)
|
||||
t.equal(order.shift(), events.REQUEST)
|
||||
})
|
||||
|
||||
client.on(events.DESERIALIZATION, (_err, request) => {
|
||||
@ -194,12 +195,12 @@ test('RequestAbortedError error', t => {
|
||||
|
||||
client.on(events.RESPONSE, (err, request) => {
|
||||
t.ok(err instanceof RequestAbortedError)
|
||||
t.strictEqual(order.shift(), events.RESPONSE)
|
||||
t.equal(order.shift(), events.RESPONSE)
|
||||
})
|
||||
|
||||
const request = client.info((err, result) => {
|
||||
t.ok(err instanceof RequestAbortedError)
|
||||
t.strictEqual(order.length, 0)
|
||||
t.equal(order.length, 0)
|
||||
})
|
||||
|
||||
request.abort()
|
||||
@ -232,27 +233,27 @@ test('ResponseError error (no retry)', t => {
|
||||
|
||||
client.on(events.SERIALIZATION, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.SERIALIZATION)
|
||||
t.equal(order.shift(), events.SERIALIZATION)
|
||||
})
|
||||
|
||||
client.on(events.REQUEST, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.REQUEST)
|
||||
t.equal(order.shift(), events.REQUEST)
|
||||
})
|
||||
|
||||
client.on(events.DESERIALIZATION, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.DESERIALIZATION)
|
||||
t.equal(order.shift(), events.DESERIALIZATION)
|
||||
})
|
||||
|
||||
client.on(events.RESPONSE, (err, request) => {
|
||||
t.ok(err instanceof ResponseError)
|
||||
t.strictEqual(order.shift(), events.RESPONSE)
|
||||
t.equal(order.shift(), events.RESPONSE)
|
||||
})
|
||||
|
||||
client.info((err, result) => {
|
||||
t.ok(err instanceof ResponseError)
|
||||
t.strictEqual(order.length, 0)
|
||||
t.equal(order.length, 0)
|
||||
})
|
||||
})
|
||||
|
||||
@ -285,27 +286,27 @@ test('ResponseError error (with retry)', t => {
|
||||
|
||||
client.on(events.SERIALIZATION, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.SERIALIZATION)
|
||||
t.equal(order.shift(), events.SERIALIZATION)
|
||||
})
|
||||
|
||||
client.on(events.REQUEST, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.REQUEST)
|
||||
t.equal(order.shift(), events.REQUEST)
|
||||
})
|
||||
|
||||
client.on(events.DESERIALIZATION, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.DESERIALIZATION)
|
||||
t.equal(order.shift(), events.DESERIALIZATION)
|
||||
})
|
||||
|
||||
client.on(events.RESPONSE, (err, request) => {
|
||||
t.ok(err instanceof ResponseError)
|
||||
t.strictEqual(order.shift(), events.RESPONSE)
|
||||
t.equal(order.shift(), events.RESPONSE)
|
||||
})
|
||||
|
||||
client.info((err, result) => {
|
||||
t.ok(err instanceof ResponseError)
|
||||
t.strictEqual(order.length, 0)
|
||||
t.equal(order.length, 0)
|
||||
})
|
||||
})
|
||||
|
||||
@ -325,12 +326,12 @@ test('Serialization Error', t => {
|
||||
|
||||
client.on(events.SERIALIZATION, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.SERIALIZATION)
|
||||
t.equal(order.shift(), events.SERIALIZATION)
|
||||
})
|
||||
|
||||
client.on(events.REQUEST, (err, request) => {
|
||||
t.ok(err instanceof SerializationError)
|
||||
t.strictEqual(order.shift(), events.REQUEST)
|
||||
t.equal(order.shift(), events.REQUEST)
|
||||
})
|
||||
|
||||
client.on(events.DESERIALIZATION, (_err, request) => {
|
||||
@ -345,7 +346,7 @@ test('Serialization Error', t => {
|
||||
body.o = body
|
||||
client.index({ index: 'test', body }, (err, result) => {
|
||||
t.ok(err instanceof SerializationError)
|
||||
t.strictEqual(order.length, 0)
|
||||
t.equal(order.length, 0)
|
||||
})
|
||||
})
|
||||
|
||||
@ -384,27 +385,27 @@ test('Deserialization Error', t => {
|
||||
|
||||
client.on(events.SERIALIZATION, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.SERIALIZATION)
|
||||
t.equal(order.shift(), events.SERIALIZATION)
|
||||
})
|
||||
|
||||
client.on(events.REQUEST, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.REQUEST)
|
||||
t.equal(order.shift(), events.REQUEST)
|
||||
})
|
||||
|
||||
client.on(events.DESERIALIZATION, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.DESERIALIZATION)
|
||||
t.equal(order.shift(), events.DESERIALIZATION)
|
||||
})
|
||||
|
||||
client.on(events.RESPONSE, (err, request) => {
|
||||
t.ok(err instanceof DeserializationError)
|
||||
t.strictEqual(order.shift(), events.RESPONSE)
|
||||
t.equal(order.shift(), events.RESPONSE)
|
||||
})
|
||||
|
||||
client.info((err, result) => {
|
||||
t.ok(err instanceof DeserializationError)
|
||||
t.strictEqual(order.length, 0)
|
||||
t.equal(order.length, 0)
|
||||
})
|
||||
})
|
||||
|
||||
@ -435,27 +436,27 @@ test('Socket destroyed while reading the body', t => {
|
||||
|
||||
client.on(events.SERIALIZATION, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.SERIALIZATION)
|
||||
t.equal(order.shift(), events.SERIALIZATION)
|
||||
})
|
||||
|
||||
client.on(events.REQUEST, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.REQUEST)
|
||||
t.equal(order.shift(), events.REQUEST)
|
||||
})
|
||||
|
||||
client.on(events.DESERIALIZATION, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.DESERIALIZATION)
|
||||
t.equal(order.shift(), events.DESERIALIZATION)
|
||||
})
|
||||
|
||||
client.on(events.RESPONSE, (err, request) => {
|
||||
t.ok(err instanceof ConnectionError)
|
||||
t.strictEqual(order.shift(), events.RESPONSE)
|
||||
t.equal(order.shift(), events.RESPONSE)
|
||||
})
|
||||
|
||||
client.info((err, result) => {
|
||||
t.ok(err instanceof ConnectionError)
|
||||
t.strictEqual(order.length, 0)
|
||||
t.equal(order.length, 0)
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
|
||||
@ -2,8 +2,9 @@
|
||||
|
||||
const { test } = require('tap')
|
||||
const FakeTimers = require('@sinonjs/fake-timers')
|
||||
const { Client, Transport } = require('../../index')
|
||||
const { Transport } = require('../../index')
|
||||
const {
|
||||
Client,
|
||||
connection: { MockConnection, MockConnectionSniff }
|
||||
} = require('../utils')
|
||||
const noop = () => {}
|
||||
@ -17,7 +18,7 @@ test('Request id', t => {
|
||||
t.type(genReqId, 'function')
|
||||
|
||||
for (let i = 1; i <= 10; i++) {
|
||||
t.strictEqual(genReqId(), i)
|
||||
t.equal(genReqId(), i)
|
||||
}
|
||||
|
||||
t.end()
|
||||
@ -40,12 +41,12 @@ test('Request id', t => {
|
||||
|
||||
client.on('request', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.request.id, 'custom-id')
|
||||
t.equal(meta.request.id, 'custom-id')
|
||||
})
|
||||
|
||||
client.on('response', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.request.id, 'custom-id')
|
||||
t.equal(meta.request.id, 'custom-id')
|
||||
})
|
||||
|
||||
client.info({}, options, t.error)
|
||||
@ -61,12 +62,12 @@ test('Request id', t => {
|
||||
|
||||
client.on('request', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.request.id, 'custom-id')
|
||||
t.equal(meta.request.id, 'custom-id')
|
||||
})
|
||||
|
||||
client.on('response', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.request.id, 'custom-id')
|
||||
t.equal(meta.request.id, 'custom-id')
|
||||
})
|
||||
|
||||
client.info({}, { id: 'custom-id' }, t.error)
|
||||
@ -84,7 +85,7 @@ test('Request id', t => {
|
||||
|
||||
client.on('sniff', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.request.id, 1)
|
||||
t.equal(meta.request.id, 1)
|
||||
})
|
||||
})
|
||||
|
||||
@ -99,15 +100,15 @@ test('Request id', t => {
|
||||
})
|
||||
|
||||
client.on('request', (e, { meta }) => {
|
||||
t.strictEqual(meta.request.id, 'custom')
|
||||
t.equal(meta.request.id, 'custom')
|
||||
})
|
||||
|
||||
client.on('response', (e, { meta }) => {
|
||||
t.strictEqual(meta.request.id, 'custom')
|
||||
t.equal(meta.request.id, 'custom')
|
||||
})
|
||||
|
||||
client.on('sniff', (e, { meta }) => {
|
||||
t.strictEqual(meta.request.id, 'custom')
|
||||
t.equal(meta.request.id, 'custom')
|
||||
})
|
||||
|
||||
client.transport.request({
|
||||
@ -139,7 +140,7 @@ test('Request id', t => {
|
||||
|
||||
client.on('resurrect', (err, meta) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.request.id, 'custom')
|
||||
t.equal(meta.request.id, 'custom')
|
||||
clock.uninstall()
|
||||
})
|
||||
|
||||
@ -160,12 +161,12 @@ test('Request context', t => {
|
||||
|
||||
client.on('request', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.context, null)
|
||||
t.equal(meta.context, null)
|
||||
})
|
||||
|
||||
client.on('response', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.context, null)
|
||||
t.equal(meta.context, null)
|
||||
})
|
||||
|
||||
client.info(t.error)
|
||||
@ -181,12 +182,12 @@ test('Request context', t => {
|
||||
|
||||
client.on('request', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(meta.context, { winter: 'is coming' })
|
||||
t.same(meta.context, { winter: 'is coming' })
|
||||
})
|
||||
|
||||
client.on('response', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(meta.context, { winter: 'is coming' })
|
||||
t.same(meta.context, { winter: 'is coming' })
|
||||
})
|
||||
|
||||
client.info({}, { context: { winter: 'is coming' } }, t.error)
|
||||
@ -203,12 +204,12 @@ test('Request context', t => {
|
||||
|
||||
client.on('request', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(meta.context, { winter: 'is coming' })
|
||||
t.same(meta.context, { winter: 'is coming' })
|
||||
})
|
||||
|
||||
client.on('response', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(meta.context, { winter: 'is coming' })
|
||||
t.same(meta.context, { winter: 'is coming' })
|
||||
})
|
||||
|
||||
client.info(t.error)
|
||||
@ -225,12 +226,12 @@ test('Request context', t => {
|
||||
|
||||
client.on('request', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(meta.context, { winter: 'has come' })
|
||||
t.same(meta.context, { winter: 'has come' })
|
||||
})
|
||||
|
||||
client.on('response', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(meta.context, { winter: 'has come' })
|
||||
t.same(meta.context, { winter: 'has come' })
|
||||
})
|
||||
|
||||
client.info({}, { context: { winter: 'has come' } }, t.error)
|
||||
@ -245,7 +246,7 @@ test('Client name', t => {
|
||||
node: 'http://localhost:9200',
|
||||
name: 'cluster'
|
||||
})
|
||||
t.strictEqual(client.name, 'cluster')
|
||||
t.equal(client.name, 'cluster')
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -259,17 +260,17 @@ test('Client name', t => {
|
||||
|
||||
client.on('request', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.name, 'cluster')
|
||||
t.equal(meta.name, 'cluster')
|
||||
})
|
||||
|
||||
client.on('response', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.name, 'cluster')
|
||||
t.equal(meta.name, 'cluster')
|
||||
})
|
||||
|
||||
client.info((err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.name, 'cluster')
|
||||
t.equal(meta.name, 'cluster')
|
||||
})
|
||||
})
|
||||
|
||||
@ -284,17 +285,17 @@ test('Client name', t => {
|
||||
|
||||
client.on('request', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.name, symbol)
|
||||
t.equal(meta.name, symbol)
|
||||
})
|
||||
|
||||
client.on('response', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.name, symbol)
|
||||
t.equal(meta.name, symbol)
|
||||
})
|
||||
|
||||
client.info((err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.name, symbol)
|
||||
t.equal(meta.name, symbol)
|
||||
})
|
||||
})
|
||||
|
||||
@ -310,7 +311,7 @@ test('Client name', t => {
|
||||
|
||||
client.on('sniff', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.name, 'elasticsearch-js')
|
||||
t.equal(meta.name, 'elasticsearch-js')
|
||||
})
|
||||
})
|
||||
|
||||
@ -325,15 +326,15 @@ test('Client name', t => {
|
||||
})
|
||||
|
||||
client.on('request', (e, { meta }) => {
|
||||
t.strictEqual(meta.name, 'elasticsearch-js')
|
||||
t.equal(meta.name, 'elasticsearch-js')
|
||||
})
|
||||
|
||||
client.on('response', (e, { meta }) => {
|
||||
t.strictEqual(meta.name, 'elasticsearch-js')
|
||||
t.equal(meta.name, 'elasticsearch-js')
|
||||
})
|
||||
|
||||
client.on('sniff', (e, { meta }) => {
|
||||
t.strictEqual(meta.name, 'elasticsearch-js')
|
||||
t.equal(meta.name, 'elasticsearch-js')
|
||||
})
|
||||
|
||||
client.transport.request({
|
||||
@ -364,7 +365,7 @@ test('Client name', t => {
|
||||
|
||||
client.on('resurrect', (err, meta) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.name, 'elasticsearch-js')
|
||||
t.equal(meta.name, 'elasticsearch-js')
|
||||
clock.uninstall()
|
||||
})
|
||||
|
||||
@ -392,7 +393,7 @@ test('Client name', t => {
|
||||
|
||||
client.on('resurrect', (err, meta) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.name, 'child-client')
|
||||
t.equal(meta.name, 'child-client')
|
||||
clock.uninstall()
|
||||
})
|
||||
|
||||
|
||||
1348
test/acceptance/product-check.test.js
Normal file
1348
test/acceptance/product-check.test.js
Normal file
File diff suppressed because it is too large
Load Diff
@ -4,8 +4,8 @@
|
||||
process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0
|
||||
|
||||
const { test } = require('tap')
|
||||
const { Client } = require('../../index')
|
||||
const {
|
||||
Client,
|
||||
buildProxy: {
|
||||
createProxy,
|
||||
createSecureProxy,
|
||||
@ -18,7 +18,7 @@ test('http-http proxy support', async t => {
|
||||
const server = await createServer()
|
||||
const proxy = await createProxy()
|
||||
server.on('request', (req, res) => {
|
||||
t.strictEqual(req.url, '/_cluster/health')
|
||||
t.equal(req.url, '/_cluster/health')
|
||||
res.setHeader('content-type', 'application/json')
|
||||
res.end(JSON.stringify({ hello: 'world' }))
|
||||
})
|
||||
@ -29,7 +29,7 @@ test('http-http proxy support', async t => {
|
||||
})
|
||||
|
||||
const response = await client.cluster.health()
|
||||
t.deepEqual(response.body, { hello: 'world' })
|
||||
t.same(response.body, { hello: 'world' })
|
||||
|
||||
server.close()
|
||||
proxy.close()
|
||||
@ -39,7 +39,7 @@ test('http-https proxy support', async t => {
|
||||
const server = await createSecureServer()
|
||||
const proxy = await createProxy()
|
||||
server.on('request', (req, res) => {
|
||||
t.strictEqual(req.url, '/_cluster/health')
|
||||
t.equal(req.url, '/_cluster/health')
|
||||
res.setHeader('content-type', 'application/json')
|
||||
res.end(JSON.stringify({ hello: 'world' }))
|
||||
})
|
||||
@ -50,7 +50,7 @@ test('http-https proxy support', async t => {
|
||||
})
|
||||
|
||||
const response = await client.cluster.health()
|
||||
t.deepEqual(response.body, { hello: 'world' })
|
||||
t.same(response.body, { hello: 'world' })
|
||||
|
||||
server.close()
|
||||
proxy.close()
|
||||
@ -60,7 +60,7 @@ test('https-http proxy support', async t => {
|
||||
const server = await createServer()
|
||||
const proxy = await createSecureProxy()
|
||||
server.on('request', (req, res) => {
|
||||
t.strictEqual(req.url, '/_cluster/health')
|
||||
t.equal(req.url, '/_cluster/health')
|
||||
res.setHeader('content-type', 'application/json')
|
||||
res.end(JSON.stringify({ hello: 'world' }))
|
||||
})
|
||||
@ -71,7 +71,7 @@ test('https-http proxy support', async t => {
|
||||
})
|
||||
|
||||
const response = await client.cluster.health()
|
||||
t.deepEqual(response.body, { hello: 'world' })
|
||||
t.same(response.body, { hello: 'world' })
|
||||
|
||||
server.close()
|
||||
proxy.close()
|
||||
@ -81,7 +81,7 @@ test('https-https proxy support', async t => {
|
||||
const server = await createSecureServer()
|
||||
const proxy = await createSecureProxy()
|
||||
server.on('request', (req, res) => {
|
||||
t.strictEqual(req.url, '/_cluster/health')
|
||||
t.equal(req.url, '/_cluster/health')
|
||||
res.setHeader('content-type', 'application/json')
|
||||
res.end(JSON.stringify({ hello: 'world' }))
|
||||
})
|
||||
@ -92,7 +92,7 @@ test('https-https proxy support', async t => {
|
||||
})
|
||||
|
||||
const response = await client.cluster.health()
|
||||
t.deepEqual(response.body, { hello: 'world' })
|
||||
t.same(response.body, { hello: 'world' })
|
||||
|
||||
server.close()
|
||||
proxy.close()
|
||||
@ -102,7 +102,7 @@ test('http basic authentication', async t => {
|
||||
const server = await createServer()
|
||||
const proxy = await createProxy()
|
||||
server.on('request', (req, res) => {
|
||||
t.strictEqual(req.url, '/_cluster/health')
|
||||
t.equal(req.url, '/_cluster/health')
|
||||
res.setHeader('content-type', 'application/json')
|
||||
res.end(JSON.stringify({ hello: 'world' }))
|
||||
})
|
||||
@ -117,7 +117,7 @@ test('http basic authentication', async t => {
|
||||
})
|
||||
|
||||
const response = await client.cluster.health()
|
||||
t.deepEqual(response.body, { hello: 'world' })
|
||||
t.same(response.body, { hello: 'world' })
|
||||
|
||||
server.close()
|
||||
proxy.close()
|
||||
@ -127,7 +127,7 @@ test('https basic authentication', async t => {
|
||||
const server = await createSecureServer()
|
||||
const proxy = await createProxy()
|
||||
server.on('request', (req, res) => {
|
||||
t.strictEqual(req.url, '/_cluster/health')
|
||||
t.equal(req.url, '/_cluster/health')
|
||||
res.setHeader('content-type', 'application/json')
|
||||
res.end(JSON.stringify({ hello: 'world' }))
|
||||
})
|
||||
@ -142,7 +142,7 @@ test('https basic authentication', async t => {
|
||||
})
|
||||
|
||||
const response = await client.cluster.health()
|
||||
t.deepEqual(response.body, { hello: 'world' })
|
||||
t.same(response.body, { hello: 'world' })
|
||||
|
||||
server.close()
|
||||
proxy.close()
|
||||
|
||||
@ -23,8 +23,8 @@ const { test } = require('tap')
|
||||
const { URL } = require('url')
|
||||
const FakeTimers = require('@sinonjs/fake-timers')
|
||||
const workq = require('workq')
|
||||
const { buildCluster } = require('../utils')
|
||||
const { Client, events } = require('../../index')
|
||||
const { Client, buildCluster } = require('../utils')
|
||||
const { events } = require('../../index')
|
||||
|
||||
/**
|
||||
* The aim of this test is to verify how the resurrect logic behaves
|
||||
@ -56,11 +56,11 @@ test('Should execute the recurrect API with the ping strategy', t => {
|
||||
|
||||
client.on(events.RESURRECT, (err, meta) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.strategy, 'ping')
|
||||
t.false(meta.isAlive)
|
||||
t.strictEqual(meta.connection.id, 'node0')
|
||||
t.strictEqual(meta.name, 'elasticsearch-js')
|
||||
t.deepEqual(meta.request, { id: 2 })
|
||||
t.equal(meta.strategy, 'ping')
|
||||
t.notOk(meta.isAlive)
|
||||
t.equal(meta.connection.id, 'node0')
|
||||
t.equal(meta.name, 'elasticsearch-js')
|
||||
t.same(meta.request, { id: 2 })
|
||||
})
|
||||
|
||||
q.add((q, done) => {
|
||||
@ -117,14 +117,14 @@ test('Resurrect a node and handle 502/3/4 status code', t => {
|
||||
let idCount = 2
|
||||
client.on(events.RESURRECT, (err, meta) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.strategy, 'ping')
|
||||
t.strictEqual(meta.connection.id, 'node0')
|
||||
t.strictEqual(meta.name, 'elasticsearch-js')
|
||||
t.deepEqual(meta.request, { id: idCount++ })
|
||||
t.equal(meta.strategy, 'ping')
|
||||
t.equal(meta.connection.id, 'node0')
|
||||
t.equal(meta.name, 'elasticsearch-js')
|
||||
t.same(meta.request, { id: idCount++ })
|
||||
if (count < 4) {
|
||||
t.false(meta.isAlive)
|
||||
t.notOk(meta.isAlive)
|
||||
} else {
|
||||
t.true(meta.isAlive)
|
||||
t.ok(meta.isAlive)
|
||||
}
|
||||
})
|
||||
|
||||
@ -179,11 +179,11 @@ test('Should execute the recurrect API with the optimistic strategy', t => {
|
||||
|
||||
client.on(events.RESURRECT, (err, meta) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.strategy, 'optimistic')
|
||||
t.true(meta.isAlive)
|
||||
t.strictEqual(meta.connection.id, 'node0')
|
||||
t.strictEqual(meta.name, 'elasticsearch-js')
|
||||
t.deepEqual(meta.request, { id: 2 })
|
||||
t.equal(meta.strategy, 'optimistic')
|
||||
t.ok(meta.isAlive)
|
||||
t.equal(meta.connection.id, 'node0')
|
||||
t.equal(meta.name, 'elasticsearch-js')
|
||||
t.same(meta.request, { id: 2 })
|
||||
})
|
||||
|
||||
q.add((q, done) => {
|
||||
|
||||
@ -23,8 +23,8 @@ const { test } = require('tap')
|
||||
const { URL } = require('url')
|
||||
const FakeTimers = require('@sinonjs/fake-timers')
|
||||
const workq = require('workq')
|
||||
const { buildCluster } = require('../utils')
|
||||
const { Client, Connection, Transport, events, errors } = require('../../index')
|
||||
const { Client, buildCluster } = require('../utils')
|
||||
const { Connection, Transport, events, errors } = require('../../index')
|
||||
|
||||
/**
|
||||
* The aim of this test is to verify how the sniffer behaves
|
||||
@ -43,11 +43,11 @@ test('Should update the connection pool', t => {
|
||||
const client = new Client({
|
||||
node: nodes[Object.keys(nodes)[0]].url
|
||||
})
|
||||
t.strictEqual(client.connectionPool.size, 1)
|
||||
t.equal(client.connectionPool.size, 1)
|
||||
|
||||
client.on(events.SNIFF, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
request.meta.sniff.reason,
|
||||
Transport.sniffReasons.DEFAULT
|
||||
)
|
||||
@ -56,14 +56,14 @@ test('Should update the connection pool', t => {
|
||||
// run the sniffer
|
||||
client.transport.sniff((err, hosts) => {
|
||||
t.error(err)
|
||||
t.strictEqual(hosts.length, 4)
|
||||
t.equal(hosts.length, 4)
|
||||
|
||||
const ids = Object.keys(nodes)
|
||||
for (let i = 0; i < hosts.length; i++) {
|
||||
const id = ids[i]
|
||||
// the first node will be an update of the existing one
|
||||
if (id === 'node0') {
|
||||
t.deepEqual(hosts[i], {
|
||||
t.same(hosts[i], {
|
||||
url: new URL(nodes[id].url),
|
||||
id: id,
|
||||
roles: {
|
||||
@ -74,9 +74,10 @@ test('Should update the connection pool', t => {
|
||||
}
|
||||
})
|
||||
} else {
|
||||
t.deepEqual(hosts[i], {
|
||||
t.same(hosts[i], {
|
||||
url: new URL(nodes[id].url),
|
||||
id: id,
|
||||
caFingerprint: null,
|
||||
roles: {
|
||||
master: true,
|
||||
data: true,
|
||||
@ -90,7 +91,7 @@ test('Should update the connection pool', t => {
|
||||
}
|
||||
}
|
||||
|
||||
t.strictEqual(client.connectionPool.size, 4)
|
||||
t.equal(client.connectionPool.size, 4)
|
||||
})
|
||||
t.teardown(shutdown)
|
||||
})
|
||||
@ -103,11 +104,11 @@ test('Should handle hostnames in publish_address', t => {
|
||||
const client = new Client({
|
||||
node: nodes[Object.keys(nodes)[0]].url
|
||||
})
|
||||
t.strictEqual(client.connectionPool.size, 1)
|
||||
t.equal(client.connectionPool.size, 1)
|
||||
|
||||
client.on(events.SNIFF, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
request.meta.sniff.reason,
|
||||
Transport.sniffReasons.DEFAULT
|
||||
)
|
||||
@ -116,14 +117,14 @@ test('Should handle hostnames in publish_address', t => {
|
||||
// run the sniffer
|
||||
client.transport.sniff((err, hosts) => {
|
||||
t.error(err)
|
||||
t.strictEqual(hosts.length, 4)
|
||||
t.equal(hosts.length, 4)
|
||||
|
||||
for (let i = 0; i < hosts.length; i++) {
|
||||
// the first node will be an update of the existing one
|
||||
t.strictEqual(hosts[i].url.hostname, 'localhost')
|
||||
t.equal(hosts[i].url.hostname, 'localhost')
|
||||
}
|
||||
|
||||
t.strictEqual(client.connectionPool.size, 4)
|
||||
t.equal(client.connectionPool.size, 4)
|
||||
})
|
||||
t.teardown(shutdown)
|
||||
})
|
||||
@ -144,21 +145,21 @@ test('Sniff interval', t => {
|
||||
client.on(events.SNIFF, (err, request) => {
|
||||
t.error(err)
|
||||
const { hosts, reason } = request.meta.sniff
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
client.connectionPool.size,
|
||||
hosts.length
|
||||
)
|
||||
t.strictEqual(reason, Transport.sniffReasons.SNIFF_INTERVAL)
|
||||
t.equal(reason, Transport.sniffReasons.SNIFF_INTERVAL)
|
||||
})
|
||||
|
||||
t.strictEqual(client.connectionPool.size, 1)
|
||||
t.equal(client.connectionPool.size, 1)
|
||||
|
||||
q.add((q, done) => {
|
||||
clock.tick(51)
|
||||
client.info(err => {
|
||||
t.error(err)
|
||||
waitSniffEnd(() => {
|
||||
t.strictEqual(client.connectionPool.size, 4)
|
||||
t.equal(client.connectionPool.size, 4)
|
||||
done()
|
||||
})
|
||||
})
|
||||
@ -173,7 +174,7 @@ test('Sniff interval', t => {
|
||||
client.info(err => {
|
||||
t.error(err)
|
||||
waitSniffEnd(() => {
|
||||
t.strictEqual(client.connectionPool.size, 3)
|
||||
t.equal(client.connectionPool.size, 3)
|
||||
done()
|
||||
})
|
||||
})
|
||||
@ -208,14 +209,14 @@ test('Sniff on start', t => {
|
||||
client.on(events.SNIFF, (err, request) => {
|
||||
t.error(err)
|
||||
const { hosts, reason } = request.meta.sniff
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
client.connectionPool.size,
|
||||
hosts.length
|
||||
)
|
||||
t.strictEqual(reason, Transport.sniffReasons.SNIFF_ON_START)
|
||||
t.equal(reason, Transport.sniffReasons.SNIFF_ON_START)
|
||||
})
|
||||
|
||||
t.strictEqual(client.connectionPool.size, 1)
|
||||
t.equal(client.connectionPool.size, 1)
|
||||
t.teardown(shutdown)
|
||||
})
|
||||
})
|
||||
@ -238,10 +239,10 @@ test('Should not close living connections', t => {
|
||||
Connection: MyConnection
|
||||
})
|
||||
|
||||
t.strictEqual(client.connectionPool.size, 1)
|
||||
t.equal(client.connectionPool.size, 1)
|
||||
client.transport.sniff((err, hosts) => {
|
||||
t.error(err)
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
client.connectionPool.size,
|
||||
hosts.length
|
||||
)
|
||||
@ -276,16 +277,16 @@ test('Sniff on connection fault', t => {
|
||||
Connection: MyConnection
|
||||
})
|
||||
|
||||
t.strictEqual(client.connectionPool.size, 2)
|
||||
t.equal(client.connectionPool.size, 2)
|
||||
// this event will be triggered by the connection fault
|
||||
client.on(events.SNIFF, (err, request) => {
|
||||
t.error(err)
|
||||
const { hosts, reason } = request.meta.sniff
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
client.connectionPool.size,
|
||||
hosts.length
|
||||
)
|
||||
t.strictEqual(reason, Transport.sniffReasons.SNIFF_ON_CONNECTION_FAULT)
|
||||
t.equal(reason, Transport.sniffReasons.SNIFF_ON_CONNECTION_FAULT)
|
||||
})
|
||||
|
||||
client.info((err, result) => {
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
"name": "parcel-test",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "node index.js",
|
||||
"build": "parcel build index.js --no-source-maps"
|
||||
|
||||
@ -65,6 +65,9 @@ function isXPackTemplate (name) {
|
||||
if (name.startsWith('.transform-')) {
|
||||
return true
|
||||
}
|
||||
if (name.startsWith('.deprecation-')) {
|
||||
return true
|
||||
}
|
||||
switch (name) {
|
||||
case '.watches':
|
||||
case 'logstash-index-template':
|
||||
@ -84,9 +87,7 @@ function isXPackTemplate (name) {
|
||||
case 'synthetics-settings':
|
||||
case 'synthetics-mappings':
|
||||
case '.snapshot-blob-cache':
|
||||
case '.deprecation-indexing-template':
|
||||
case '.deprecation-indexing-mappings':
|
||||
case '.deprecation-indexing-settings':
|
||||
case 'data-streams-mappings':
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
||||
@ -102,9 +102,9 @@ test('bulk index with custom id', async t => {
|
||||
id: '19273860' // id of document n° 4242
|
||||
})
|
||||
|
||||
t.strictEqual(body._index, INDEX)
|
||||
t.strictEqual(body._id, '19273860')
|
||||
t.strictEqual(body._source.id, '19273860')
|
||||
t.equal(body._index, INDEX)
|
||||
t.equal(body._id, '19273860')
|
||||
t.equal(body._source.id, '19273860')
|
||||
})
|
||||
|
||||
test('abort the operation on document drop', async t => {
|
||||
@ -113,9 +113,9 @@ test('abort the operation on document drop', async t => {
|
||||
datasource: stream.pipe(split(JSON.parse)),
|
||||
concurrency: 1,
|
||||
onDrop (doc) {
|
||||
t.strictEqual(doc.status, 400)
|
||||
t.strictEqual(doc.error.type, 'mapper_parsing_exception')
|
||||
t.strictEqual(doc.document.id, '45924372')
|
||||
t.equal(doc.status, 400)
|
||||
t.equal(doc.error.type, 'mapper_parsing_exception')
|
||||
t.equal(doc.document.id, '45924372')
|
||||
b.abort()
|
||||
},
|
||||
onDocument (doc) {
|
||||
@ -135,7 +135,7 @@ test('abort the operation on document drop', async t => {
|
||||
const result = await b
|
||||
t.type(result.time, 'number')
|
||||
t.type(result.bytes, 'number')
|
||||
t.strictEqual(result.total - 1, result.successful)
|
||||
t.equal(result.total - 1, result.successful)
|
||||
t.match(result, {
|
||||
retry: 0,
|
||||
failed: 1,
|
||||
|
||||
@ -62,7 +62,7 @@ test('Basic', t => {
|
||||
{ query: { match: { title: 'javascript' } } },
|
||||
(err, result) => {
|
||||
t.error(err)
|
||||
t.strictEqual(result.body.hits.total.value, 106)
|
||||
t.equal(result.body.hits.total.value, 106)
|
||||
}
|
||||
)
|
||||
|
||||
@ -71,7 +71,7 @@ test('Basic', t => {
|
||||
{ query: { match: { title: 'ruby' } } },
|
||||
(err, result) => {
|
||||
t.error(err)
|
||||
t.strictEqual(result.body.hits.total.value, 29)
|
||||
t.equal(result.body.hits.total.value, 29)
|
||||
}
|
||||
)
|
||||
|
||||
@ -87,7 +87,7 @@ test('Bad request', t => {
|
||||
{ query: { match: { title: 'javascript' } } },
|
||||
(err, result) => {
|
||||
t.error(err)
|
||||
t.strictEqual(result.body.hits.total.value, 106)
|
||||
t.equal(result.body.hits.total.value, 106)
|
||||
}
|
||||
)
|
||||
|
||||
@ -95,7 +95,7 @@ test('Bad request', t => {
|
||||
{ index: INDEX },
|
||||
{ query: { foo: { title: 'ruby' } } },
|
||||
(err, result) => {
|
||||
t.true(err instanceof errors.ResponseError)
|
||||
t.ok(err instanceof errors.ResponseError)
|
||||
}
|
||||
)
|
||||
|
||||
@ -112,7 +112,7 @@ test('Send multiple request concurrently over the concurrency limit', t => {
|
||||
{ query: { match: { title: 'javascript' } } },
|
||||
(err, result) => {
|
||||
t.error(err)
|
||||
t.strictEqual(result.body.hits.total.value, 106)
|
||||
t.equal(result.body.hits.total.value, 106)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@ -69,10 +69,10 @@ test('search helper', async t => {
|
||||
for await (const search of scrollSearch) {
|
||||
count += 1
|
||||
for (const doc of search.documents) {
|
||||
t.true(doc.title.toLowerCase().includes('javascript'))
|
||||
t.ok(doc.title.toLowerCase().includes('javascript'))
|
||||
}
|
||||
}
|
||||
t.strictEqual(count, 11)
|
||||
t.equal(count, 11)
|
||||
})
|
||||
|
||||
test('clear a scroll search', async t => {
|
||||
@ -94,7 +94,7 @@ test('clear a scroll search', async t => {
|
||||
search.clear()
|
||||
}
|
||||
}
|
||||
t.strictEqual(count, 2)
|
||||
t.equal(count, 2)
|
||||
})
|
||||
|
||||
test('scroll documents', async t => {
|
||||
@ -112,7 +112,7 @@ test('scroll documents', async t => {
|
||||
let count = 0
|
||||
for await (const doc of scrollSearch) {
|
||||
count += 1
|
||||
t.true(doc.title.toLowerCase().includes('javascript'))
|
||||
t.ok(doc.title.toLowerCase().includes('javascript'))
|
||||
}
|
||||
t.strictEqual(count, 106)
|
||||
t.equal(count, 106)
|
||||
})
|
||||
|
||||
@ -64,8 +64,8 @@ test('search helper', async t => {
|
||||
}
|
||||
}
|
||||
})
|
||||
t.strictEqual(results.length, 10)
|
||||
t.equal(results.length, 10)
|
||||
for (const result of results) {
|
||||
t.true(result.title.toLowerCase().includes('javascript'))
|
||||
t.ok(result.title.toLowerCase().includes('javascript'))
|
||||
}
|
||||
})
|
||||
|
||||
@ -47,6 +47,8 @@ const freeSkips = {
|
||||
// TODO: remove this once 'arbitrary_key' is implemented
|
||||
// https://github.com/elastic/elasticsearch/pull/41492
|
||||
'indices.split/30_copy_settings.yml': ['*'],
|
||||
'indices.stats/50_disk_usage.yml': ['Disk usage stats'],
|
||||
'indices.stats/60_field_usage.yml': ['Field usage stats'],
|
||||
// skipping because we are booting ES with `discovery.type=single-node`
|
||||
// and this test will fail because of this configuration
|
||||
'nodes.stats/30_discovery.yml': ['*'],
|
||||
@ -55,6 +57,7 @@ const freeSkips = {
|
||||
'search.aggregation/240_max_buckets.yml': ['*']
|
||||
}
|
||||
const platinumBlackList = {
|
||||
'analytics/histogram.yml': ['Histogram requires values in increasing order'],
|
||||
// this two test cases are broken, we should
|
||||
// return on those in the future.
|
||||
'analytics/top_metrics.yml': [
|
||||
@ -81,9 +84,11 @@ const platinumBlackList = {
|
||||
],
|
||||
// The cleanup fails with a index not found when retrieving the jobs
|
||||
'ml/get_datafeed_stats.yml': ['Test get datafeed stats when total_search_time_ms mapping is missing'],
|
||||
'ml/bucket_correlation_agg.yml': ['Test correlation bucket agg simple'],
|
||||
'ml/preview_datafeed.yml': ['*'],
|
||||
// Investigate why is failing
|
||||
'ml/inference_crud.yml': ['*'],
|
||||
'ml/categorization_agg.yml': ['Test categorization aggregation with poor settings'],
|
||||
// investigate why this is failing
|
||||
'monitoring/bulk/10_basic.yml': ['*'],
|
||||
'monitoring/bulk/20_privileges.yml': ['*'],
|
||||
@ -93,6 +98,7 @@ const platinumBlackList = {
|
||||
// the body is correct, but the regex is failing
|
||||
'sql/sql.yml': ['Getting textual representation'],
|
||||
'searchable_snapshots/10_usage.yml': ['*'],
|
||||
'service_accounts/10_basic.yml': ['*'],
|
||||
// we are setting two certificates in the docker config
|
||||
'ssl/10_basic.yml': ['*'],
|
||||
// very likely, the index template has not been loaded yet.
|
||||
@ -331,10 +337,10 @@ function generateJunitXmlReport (junit, suite) {
|
||||
}
|
||||
|
||||
if (require.main === module) {
|
||||
const node = process.env.TEST_ES_SERVER || 'http://localhost:9200'
|
||||
const node = process.env.TEST_ES_SERVER || 'http://elastic:changeme@localhost:9200'
|
||||
const opts = {
|
||||
node,
|
||||
isXPack: node.indexOf('@') > -1
|
||||
isXPack: process.env.TEST_SUITE !== 'free'
|
||||
}
|
||||
runner(opts)
|
||||
}
|
||||
|
||||
@ -80,6 +80,18 @@ function build (opts = {}) {
|
||||
|
||||
// remove 'x_pack_rest_user', used in some xpack test
|
||||
await client.security.deleteUser({ username: 'x_pack_rest_user' }, { ignore: [404] })
|
||||
|
||||
const { body: searchableSnapshotIndices } = await client.cluster.state({
|
||||
metric: 'metadata',
|
||||
filter_path: 'metadata.indices.*.settings.index.store.snapshot'
|
||||
})
|
||||
if (searchableSnapshotIndices.metadata != null && searchableSnapshotIndices.metadata.indices != null) {
|
||||
await helper.runInParallel(
|
||||
client, 'indices.delete',
|
||||
Object.keys(searchableSnapshotIndices.metadata.indices).map(i => ({ index: i })),
|
||||
{ ignore: [404] }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// clean snapshots
|
||||
@ -164,6 +176,13 @@ function build (opts = {}) {
|
||||
)
|
||||
}
|
||||
|
||||
const { body: shutdownNodes } = await client.shutdown.getNode()
|
||||
if (shutdownNodes._nodes == null && shutdownNodes.cluster_name == null) {
|
||||
for (const node of shutdownNodes.nodes) {
|
||||
await client.shutdown.deleteNode({ node_id: node.node_id })
|
||||
}
|
||||
}
|
||||
|
||||
// wait for pending task before resolving the promise
|
||||
await sleep(100)
|
||||
while (true) {
|
||||
@ -594,7 +613,7 @@ function match (val1, val2, action) {
|
||||
// tap.match(val1, new RegExp(regStr, 'm'), `should match pattern provided: ${val2}, action: ${JSON.stringify(action)}`)
|
||||
// everything else
|
||||
} else {
|
||||
assert.strictEqual(val1, val2, `should be equal: ${val1} - ${val2}, action: ${JSON.stringify(action)}`)
|
||||
assert.equal(val1, val2, `should be equal: ${val1} - ${val2}, action: ${JSON.stringify(action)}`)
|
||||
}
|
||||
}
|
||||
|
||||
@ -654,9 +673,9 @@ function gte (val1, val2) {
|
||||
*/
|
||||
function length (val, len) {
|
||||
if (typeof val === 'string' || Array.isArray(val)) {
|
||||
assert.strictEqual(val.length, len)
|
||||
assert.equal(val.length, len)
|
||||
} else if (typeof val === 'object' && val !== null) {
|
||||
assert.strictEqual(Object.keys(val).length, len)
|
||||
assert.equal(Object.keys(val).length, len)
|
||||
} else {
|
||||
assert.fail(`length: the given value is invalid: ${val}`)
|
||||
}
|
||||
|
||||
71
test/mock/index.js
Normal file
71
test/mock/index.js
Normal file
@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
const { test } = require('tap')
|
||||
const { Client, errors } = require('../../')
|
||||
const Mock = require('@elastic/elasticsearch-mock')
|
||||
|
||||
test('Mock should work', async t => {
|
||||
t.plan(1)
|
||||
|
||||
const mock = new Mock()
|
||||
const client = new Client({
|
||||
node: 'http://localhost:9200',
|
||||
Connection: mock.getConnection()
|
||||
})
|
||||
|
||||
mock.add({
|
||||
method: 'GET',
|
||||
path: '/_cat/indices'
|
||||
}, () => {
|
||||
return { status: 'ok' }
|
||||
})
|
||||
|
||||
const response = await client.cat.indices()
|
||||
t.same(response.body, { status: 'ok' })
|
||||
})
|
||||
|
||||
test('Return an error', async t => {
|
||||
t.plan(1)
|
||||
|
||||
const mock = new Mock()
|
||||
const client = new Client({
|
||||
node: 'http://localhost:9200',
|
||||
Connection: mock.getConnection()
|
||||
})
|
||||
|
||||
mock.add({
|
||||
method: 'GET',
|
||||
path: '/_cat/indices'
|
||||
}, () => {
|
||||
return new errors.ResponseError({
|
||||
body: { errors: {}, status: 500 },
|
||||
statusCode: 500
|
||||
})
|
||||
})
|
||||
|
||||
try {
|
||||
await client.cat.indices()
|
||||
t.fail('Should throw')
|
||||
} catch (err) {
|
||||
t.ok(err instanceof errors.ResponseError)
|
||||
}
|
||||
})
|
||||
18
test/mock/package.json
Normal file
18
test/mock/package.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "mock",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "standard && tap index.js"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@elastic/elasticsearch": "file:../..",
|
||||
"@elastic/elasticsearch-mock": "^0.3.1",
|
||||
"standard": "^16.0.3",
|
||||
"tap": "^15.0.9"
|
||||
}
|
||||
}
|
||||
@ -66,27 +66,27 @@ client.on('resurrect', (err, meta) => {
|
||||
// Check API returned type and optional parameters
|
||||
{
|
||||
const promise = client.info()
|
||||
expectType<TransportRequestPromise<ApiResponse<estypes.RootNodeInfoResponse, Context>>>(promise)
|
||||
expectType<TransportRequestPromise<ApiResponse<estypes.InfoResponse, Context>>>(promise)
|
||||
promise
|
||||
.then(result => expectType<ApiResponse<estypes.RootNodeInfoResponse, Context>>(result))
|
||||
.then(result => expectType<ApiResponse<estypes.InfoResponse, Context>>(result))
|
||||
.catch((err: ApiError) => expectType<ApiError>(err))
|
||||
expectType<void>(promise.abort())
|
||||
}
|
||||
|
||||
{
|
||||
const promise = client.info({ pretty: true })
|
||||
expectType<TransportRequestPromise<ApiResponse<estypes.RootNodeInfoResponse, Context>>>(promise)
|
||||
expectType<TransportRequestPromise<ApiResponse<estypes.InfoResponse, Context>>>(promise)
|
||||
promise
|
||||
.then(result => expectType<ApiResponse<estypes.RootNodeInfoResponse, Context>>(result))
|
||||
.then(result => expectType<ApiResponse<estypes.InfoResponse, Context>>(result))
|
||||
.catch((err: ApiError) => expectType<ApiError>(err))
|
||||
expectType<void>(promise.abort())
|
||||
}
|
||||
|
||||
{
|
||||
const promise = client.info({ pretty: true }, { ignore: [404] })
|
||||
expectType<TransportRequestPromise<ApiResponse<estypes.RootNodeInfoResponse, Context>>>(promise)
|
||||
expectType<TransportRequestPromise<ApiResponse<estypes.InfoResponse, Context>>>(promise)
|
||||
promise
|
||||
.then(result => expectType<ApiResponse<estypes.RootNodeInfoResponse, Context>>(result))
|
||||
.then(result => expectType<ApiResponse<estypes.InfoResponse, Context>>(result))
|
||||
.catch((err: ApiError) => expectType<ApiError>(err))
|
||||
expectType<void>(promise.abort())
|
||||
}
|
||||
|
||||
@ -66,27 +66,27 @@ client.on('resurrect', (err, meta) => {
|
||||
// Check API returned type and optional parameters
|
||||
{
|
||||
const promise = client.info()
|
||||
expectType<TransportRequestPromise<ApiResponse<estypes.RootNodeInfoResponse, Context>>>(promise)
|
||||
expectType<TransportRequestPromise<ApiResponse<estypes.InfoResponse, Context>>>(promise)
|
||||
promise
|
||||
.then(result => expectType<ApiResponse<estypes.RootNodeInfoResponse, Context>>(result))
|
||||
.then(result => expectType<ApiResponse<estypes.InfoResponse, Context>>(result))
|
||||
.catch((err: ApiError) => expectType<ApiError>(err))
|
||||
expectType<void>(promise.abort())
|
||||
}
|
||||
|
||||
{
|
||||
const promise = client.info({ pretty: true })
|
||||
expectType<TransportRequestPromise<ApiResponse<estypes.RootNodeInfoResponse, Context>>>(promise)
|
||||
expectType<TransportRequestPromise<ApiResponse<estypes.InfoResponse, Context>>>(promise)
|
||||
promise
|
||||
.then(result => expectType<ApiResponse<estypes.RootNodeInfoResponse, Context>>(result))
|
||||
.then(result => expectType<ApiResponse<estypes.InfoResponse, Context>>(result))
|
||||
.catch((err: ApiError) => expectType<ApiError>(err))
|
||||
expectType<void>(promise.abort())
|
||||
}
|
||||
|
||||
{
|
||||
const promise = client.info({ pretty: true }, { ignore: [404] })
|
||||
expectType<TransportRequestPromise<ApiResponse<estypes.RootNodeInfoResponse, Context>>>(promise)
|
||||
expectType<TransportRequestPromise<ApiResponse<estypes.InfoResponse, Context>>>(promise)
|
||||
promise
|
||||
.then(result => expectType<ApiResponse<estypes.RootNodeInfoResponse, Context>>(result))
|
||||
.then(result => expectType<ApiResponse<estypes.InfoResponse, Context>>(result))
|
||||
.catch((err: ApiError) => expectType<ApiError>(err))
|
||||
expectType<void>(promise.abort())
|
||||
}
|
||||
|
||||
@ -19,8 +19,8 @@
|
||||
|
||||
'use strict'
|
||||
|
||||
const { Client, errors } = require('../../index')
|
||||
const { buildServer } = require('../utils')
|
||||
const { errors } = require('../../index')
|
||||
const { Client, buildServer } = require('../utils')
|
||||
|
||||
function runAsyncTest (test) {
|
||||
test('async await (search)', t => {
|
||||
@ -42,7 +42,7 @@ function runAsyncTest (test) {
|
||||
type: 'doc',
|
||||
q: 'foo:bar'
|
||||
})
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
} catch (err) {
|
||||
t.fail(err)
|
||||
}
|
||||
|
||||
@ -20,8 +20,8 @@
|
||||
'use strict'
|
||||
|
||||
const { test } = require('tap')
|
||||
const { Client, errors } = require('../../index')
|
||||
const { buildServer } = require('../utils')
|
||||
const { errors } = require('../../index')
|
||||
const { Client, buildServer } = require('../utils')
|
||||
|
||||
test('Basic (callback)', t => {
|
||||
t.plan(2)
|
||||
@ -41,7 +41,7 @@ test('Basic (callback)', t => {
|
||||
q: 'foo:bar'
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -66,7 +66,7 @@ test('Basic (promises)', t => {
|
||||
q: 'foo:bar'
|
||||
})
|
||||
.then(({ body }) => {
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
.catch(t.fail)
|
||||
@ -169,7 +169,7 @@ test('Abort method (callback)', t => {
|
||||
q: 'foo:bar'
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
|
||||
@ -197,7 +197,7 @@ test('Abort method (promises)', t => {
|
||||
|
||||
request
|
||||
.then(({ body }) => {
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
.catch(t.fail)
|
||||
@ -226,7 +226,7 @@ test('Basic (options and callback)', t => {
|
||||
requestTimeout: 10000
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -253,7 +253,7 @@ test('Basic (options and promises)', t => {
|
||||
requestTimeout: 10000
|
||||
})
|
||||
.then(({ body }) => {
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
.catch(t.fail)
|
||||
@ -264,7 +264,7 @@ test('If the API uses the same key for both url and query parameter, the url sho
|
||||
t.plan(2)
|
||||
|
||||
function handler (req, res) {
|
||||
t.strictEqual(req.url, '/index/_bulk')
|
||||
t.equal(req.url, '/index/_bulk')
|
||||
res.setHeader('Content-Type', 'application/json;utf=8')
|
||||
res.end(JSON.stringify({ hello: 'world' }))
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ test('API', t => {
|
||||
const href = 'http://localhost:9200/'
|
||||
pool.addConnection(href)
|
||||
t.ok(pool.connections.find(c => c.id === href) instanceof Connection)
|
||||
t.strictEqual(pool.connections.find(c => c.id === href).status, Connection.statuses.ALIVE)
|
||||
t.equal(pool.connections.find(c => c.id === href).status, Connection.statuses.ALIVE)
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -42,7 +42,7 @@ test('API', t => {
|
||||
pool.addConnection(href)
|
||||
t.fail('Should throw')
|
||||
} catch (err) {
|
||||
t.is(err.message, `Connection with id '${href}' is already present`)
|
||||
t.equal(err.message, `Connection with id '${href}' is already present`)
|
||||
}
|
||||
t.end()
|
||||
})
|
||||
@ -52,8 +52,8 @@ test('API', t => {
|
||||
const href = 'http://us"er:p@assword@localhost:9200/'
|
||||
pool.addConnection(href)
|
||||
const conn = pool.connections[0]
|
||||
t.strictEqual(conn.url.username, 'us%22er')
|
||||
t.strictEqual(conn.url.password, 'p%40assword')
|
||||
t.equal(conn.url.username, 'us%22er')
|
||||
t.equal(conn.url.password, 'p%40assword')
|
||||
t.match(conn.headers, {
|
||||
authorization: 'Basic ' + Buffer.from('us"er:p@assword').toString('base64')
|
||||
})
|
||||
@ -66,7 +66,7 @@ test('API', t => {
|
||||
let connection = pool.addConnection(href)
|
||||
t.same(pool.markDead(connection), pool)
|
||||
connection = pool.connections.find(c => c.id === href)
|
||||
t.strictEqual(connection.status, Connection.statuses.ALIVE)
|
||||
t.equal(connection.status, Connection.statuses.ALIVE)
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -76,7 +76,7 @@ test('API', t => {
|
||||
let connection = pool.addConnection(href)
|
||||
t.same(pool.markAlive(connection), pool)
|
||||
connection = pool.connections.find(c => c.id === href)
|
||||
t.strictEqual(connection.status, Connection.statuses.ALIVE)
|
||||
t.equal(connection.status, Connection.statuses.ALIVE)
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -88,7 +88,7 @@ test('API', t => {
|
||||
pool.getConnection()
|
||||
t.fail('Should fail')
|
||||
} catch (err) {
|
||||
t.is(err.message, 'getConnection must be implemented')
|
||||
t.equal(err.message, 'getConnection must be implemented')
|
||||
}
|
||||
t.end()
|
||||
})
|
||||
@ -98,7 +98,7 @@ test('API', t => {
|
||||
const href = 'http://localhost:9200/'
|
||||
const connection = pool.addConnection(href)
|
||||
pool.removeConnection(connection)
|
||||
t.strictEqual(pool.size, 0)
|
||||
t.equal(pool.size, 0)
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -107,7 +107,7 @@ test('API', t => {
|
||||
pool.addConnection('http://localhost:9200/')
|
||||
pool.addConnection('http://localhost:9201/')
|
||||
pool.empty(() => {
|
||||
t.strictEqual(pool.size, 0)
|
||||
t.equal(pool.size, 0)
|
||||
t.end()
|
||||
})
|
||||
})
|
||||
@ -115,7 +115,7 @@ test('API', t => {
|
||||
t.test('urlToHost', t => {
|
||||
const pool = new BaseConnectionPool({ Connection })
|
||||
const url = 'http://localhost:9200'
|
||||
t.deepEqual(
|
||||
t.same(
|
||||
pool.urlToHost(url),
|
||||
{ url: new URL(url) }
|
||||
)
|
||||
@ -140,7 +140,7 @@ test('API', t => {
|
||||
}
|
||||
}
|
||||
|
||||
t.deepEqual(pool.nodesToHost(nodes, 'http:'), [{
|
||||
t.same(pool.nodesToHost(nodes, 'http:'), [{
|
||||
url: new URL('http://127.0.0.1:9200'),
|
||||
id: 'a1',
|
||||
roles: {
|
||||
@ -160,8 +160,8 @@ test('API', t => {
|
||||
}
|
||||
}])
|
||||
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[0].url.host, '127.0.0.1:9200')
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.host, '127.0.0.1:9201')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[0].url.host, '127.0.0.1:9200')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[1].url.host, '127.0.0.1:9201')
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -182,7 +182,7 @@ test('API', t => {
|
||||
}
|
||||
}
|
||||
|
||||
t.deepEqual(pool.nodesToHost(nodes, 'http:'), [{
|
||||
t.same(pool.nodesToHost(nodes, 'http:'), [{
|
||||
url: new URL('http://[::1]:9200'),
|
||||
id: 'a1',
|
||||
roles: {
|
||||
@ -202,8 +202,8 @@ test('API', t => {
|
||||
}
|
||||
}])
|
||||
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[0].url.host, '[::1]:9200')
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.host, '[::1]:9201')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[0].url.host, '[::1]:9200')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[1].url.host, '[::1]:9201')
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -224,7 +224,7 @@ test('API', t => {
|
||||
}
|
||||
}
|
||||
|
||||
t.deepEqual(pool.nodesToHost(nodes, 'http:'), [{
|
||||
t.same(pool.nodesToHost(nodes, 'http:'), [{
|
||||
url: new URL('http://example.com:9200'),
|
||||
id: 'a1',
|
||||
roles: {
|
||||
@ -244,8 +244,8 @@ test('API', t => {
|
||||
}
|
||||
}])
|
||||
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[0].url.host, 'example.com:9200')
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.host, 'example.com:9201')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[0].url.host, 'example.com:9200')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[1].url.host, 'example.com:9201')
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -266,7 +266,7 @@ test('API', t => {
|
||||
}
|
||||
}
|
||||
|
||||
t.deepEqual(pool.nodesToHost(nodes, 'http:'), [{
|
||||
t.same(pool.nodesToHost(nodes, 'http:'), [{
|
||||
url: new URL('http://example.com:9200'),
|
||||
id: 'a1',
|
||||
roles: {
|
||||
@ -286,8 +286,8 @@ test('API', t => {
|
||||
}
|
||||
}])
|
||||
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[0].url.host, 'example.com:9200')
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.host, 'example.com:9201')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[0].url.host, 'example.com:9200')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[1].url.host, 'example.com:9201')
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -308,8 +308,8 @@ test('API', t => {
|
||||
}
|
||||
}
|
||||
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'https:')[0].url.protocol, 'https:')
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.protocol, 'http:')
|
||||
t.equal(pool.nodesToHost(nodes, 'https:')[0].url.protocol, 'https:')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[1].url.protocol, 'http:')
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -425,13 +425,13 @@ test('API', t => {
|
||||
|
||||
// roles will never be updated, we only use it to do
|
||||
// a dummy check to see if the connection has been updated
|
||||
t.deepEqual(pool.connections.find(c => c.id === 'a1').roles, {
|
||||
t.same(pool.connections.find(c => c.id === 'a1').roles, {
|
||||
master: true,
|
||||
data: true,
|
||||
ingest: true,
|
||||
ml: false
|
||||
})
|
||||
t.strictEqual(pool.connections.find(c => c.id === 'http://127.0.0.1:9200/'), undefined)
|
||||
t.equal(pool.connections.find(c => c.id === 'http://127.0.0.1:9200/'), undefined)
|
||||
})
|
||||
|
||||
t.test('Add a new connection', t => {
|
||||
@ -480,9 +480,9 @@ test('API', t => {
|
||||
roles: null
|
||||
}])
|
||||
|
||||
t.false(pool.connections.find(c => c.id === 'a1'))
|
||||
t.true(pool.connections.find(c => c.id === 'a2'))
|
||||
t.true(pool.connections.find(c => c.id === 'a3'))
|
||||
t.notOk(pool.connections.find(c => c.id === 'a1'))
|
||||
t.ok(pool.connections.find(c => c.id === 'a2'))
|
||||
t.ok(pool.connections.find(c => c.id === 'a3'))
|
||||
})
|
||||
|
||||
t.end()
|
||||
@ -497,7 +497,7 @@ test('API', t => {
|
||||
pool.createConnection('http://localhost:9200')
|
||||
t.fail('Should throw')
|
||||
} catch (err) {
|
||||
t.is(err.message, 'Connection with id \'http://localhost:9200/\' is already present')
|
||||
t.equal(err.message, 'Connection with id \'http://localhost:9200/\' is already present')
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@ -20,8 +20,9 @@
|
||||
'use strict'
|
||||
|
||||
const { test } = require('tap')
|
||||
const { Client, errors } = require('../../index')
|
||||
const { errors } = require('../../index')
|
||||
const {
|
||||
Client,
|
||||
buildServer,
|
||||
connection: { MockConnection }
|
||||
} = require('../utils')
|
||||
@ -76,7 +77,7 @@ test('Should create a child client (timeout check)', t => {
|
||||
client.info((err, res) => {
|
||||
t.error(err)
|
||||
child.info((err, res) => {
|
||||
t.true(err instanceof errors.TimeoutError)
|
||||
t.ok(err instanceof errors.TimeoutError)
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -238,7 +239,7 @@ test('Should create a child client (generateRequestId check)', t => {
|
||||
let count = 0
|
||||
client.on('request', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
meta.request.id,
|
||||
count++ === 0 ? 'trace-1-0' : 'trace-2-0'
|
||||
)
|
||||
@ -263,13 +264,13 @@ test('Should create a child client (name check)', t => {
|
||||
name: 'child'
|
||||
})
|
||||
|
||||
t.strictEqual(client.name, 'parent')
|
||||
t.strictEqual(child.name, 'child')
|
||||
t.equal(client.name, 'parent')
|
||||
t.equal(child.name, 'child')
|
||||
|
||||
let count = 0
|
||||
client.on('request', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
meta.name,
|
||||
count++ === 0 ? 'parent' : 'child'
|
||||
)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -33,7 +33,7 @@ test('Should expose a cloudConnection property', t => {
|
||||
test('Get connection should always return cloudConnection', t => {
|
||||
const pool = new CloudConnectionPool({ Connection })
|
||||
const conn = pool.addConnection('http://localhost:9200/')
|
||||
t.deepEqual(pool.getConnection(), conn)
|
||||
t.same(pool.getConnection(), conn)
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -42,7 +42,7 @@ test('pool.empty should reset cloudConnection', t => {
|
||||
pool.addConnection('http://localhost:9200/')
|
||||
t.ok(pool.cloudConnection instanceof Connection)
|
||||
pool.empty(() => {
|
||||
t.strictEqual(pool.cloudConnection, null)
|
||||
t.equal(pool.cloudConnection, null)
|
||||
t.end()
|
||||
})
|
||||
})
|
||||
|
||||
@ -32,8 +32,8 @@ test('API', t => {
|
||||
const href = 'http://localhost:9200/'
|
||||
pool.addConnection(href)
|
||||
t.ok(pool.connections.find(c => c.id === href) instanceof Connection)
|
||||
t.strictEqual(pool.connections.find(c => c.id === href).status, Connection.statuses.ALIVE)
|
||||
t.deepEqual(pool.dead, [])
|
||||
t.equal(pool.connections.find(c => c.id === href).status, Connection.statuses.ALIVE)
|
||||
t.same(pool.dead, [])
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -45,7 +45,7 @@ test('API', t => {
|
||||
pool.addConnection(href)
|
||||
t.fail('Should throw')
|
||||
} catch (err) {
|
||||
t.is(err.message, `Connection with id '${href}' is already present`)
|
||||
t.equal(err.message, `Connection with id '${href}' is already present`)
|
||||
}
|
||||
t.end()
|
||||
})
|
||||
@ -55,8 +55,8 @@ test('API', t => {
|
||||
const href = 'http://us"er:p@assword@localhost:9200/'
|
||||
pool.addConnection(href)
|
||||
const conn = pool.getConnection()
|
||||
t.strictEqual(conn.url.username, 'us%22er')
|
||||
t.strictEqual(conn.url.password, 'p%40assword')
|
||||
t.equal(conn.url.username, 'us%22er')
|
||||
t.equal(conn.url.password, 'p%40assword')
|
||||
t.match(conn.headers, {
|
||||
authorization: 'Basic ' + Buffer.from('us"er:p@assword').toString('base64')
|
||||
})
|
||||
@ -69,9 +69,9 @@ test('API', t => {
|
||||
let connection = pool.addConnection(href)
|
||||
pool.markDead(connection)
|
||||
connection = pool.connections.find(c => c.id === href)
|
||||
t.strictEqual(connection.deadCount, 1)
|
||||
t.true(connection.resurrectTimeout > 0)
|
||||
t.deepEqual(pool.dead, [href])
|
||||
t.equal(connection.deadCount, 1)
|
||||
t.ok(connection.resurrectTimeout > 0)
|
||||
t.same(pool.dead, [href])
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -84,7 +84,7 @@ test('API', t => {
|
||||
pool.markDead(conn2)
|
||||
setTimeout(() => {
|
||||
pool.markDead(conn1)
|
||||
t.deepEqual(pool.dead, [href2, href1])
|
||||
t.same(pool.dead, [href2, href1])
|
||||
t.end()
|
||||
}, 10)
|
||||
})
|
||||
@ -93,7 +93,7 @@ test('API', t => {
|
||||
const pool = new ConnectionPool({ Connection, sniffEnabled: true })
|
||||
pool.addConnection('http://localhost:9200/')
|
||||
pool.markDead({ id: 'foo-bar' })
|
||||
t.deepEqual(pool.dead, [])
|
||||
t.same(pool.dead, [])
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -104,10 +104,10 @@ test('API', t => {
|
||||
pool.markDead(connection)
|
||||
pool.markAlive(connection)
|
||||
connection = pool.connections.find(c => c.id === href)
|
||||
t.strictEqual(connection.deadCount, 0)
|
||||
t.strictEqual(connection.resurrectTimeout, 0)
|
||||
t.strictEqual(connection.status, Connection.statuses.ALIVE)
|
||||
t.deepEqual(pool.dead, [])
|
||||
t.equal(connection.deadCount, 0)
|
||||
t.equal(connection.resurrectTimeout, 0)
|
||||
t.equal(connection.status, Connection.statuses.ALIVE)
|
||||
t.same(pool.dead, [])
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -129,12 +129,12 @@ test('API', t => {
|
||||
name: 'elasticsearch-js'
|
||||
}
|
||||
pool.resurrect(opts, (isAlive, connection) => {
|
||||
t.true(isAlive)
|
||||
t.ok(isAlive)
|
||||
connection = pool.connections.find(c => c.id === connection.id)
|
||||
t.strictEqual(connection.deadCount, 0)
|
||||
t.strictEqual(connection.resurrectTimeout, 0)
|
||||
t.strictEqual(connection.status, Connection.statuses.ALIVE)
|
||||
t.deepEqual(pool.dead, [])
|
||||
t.equal(connection.deadCount, 0)
|
||||
t.equal(connection.resurrectTimeout, 0)
|
||||
t.equal(connection.status, Connection.statuses.ALIVE)
|
||||
t.same(pool.dead, [])
|
||||
t.end()
|
||||
})
|
||||
})
|
||||
@ -155,12 +155,12 @@ test('API', t => {
|
||||
name: 'elasticsearch-js'
|
||||
}
|
||||
pool.resurrect(opts, (isAlive, connection) => {
|
||||
t.false(isAlive)
|
||||
t.notOk(isAlive)
|
||||
connection = pool.connections.find(c => c.id === connection.id)
|
||||
t.strictEqual(connection.deadCount, 2)
|
||||
t.true(connection.resurrectTimeout > 0)
|
||||
t.strictEqual(connection.status, Connection.statuses.DEAD)
|
||||
t.deepEqual(pool.dead, [href])
|
||||
t.equal(connection.deadCount, 2)
|
||||
t.ok(connection.resurrectTimeout > 0)
|
||||
t.equal(connection.status, Connection.statuses.DEAD)
|
||||
t.same(pool.dead, [href])
|
||||
t.end()
|
||||
})
|
||||
})
|
||||
@ -183,12 +183,12 @@ test('API', t => {
|
||||
name: 'elasticsearch-js'
|
||||
}
|
||||
pool.resurrect(opts, (isAlive, connection) => {
|
||||
t.true(isAlive)
|
||||
t.ok(isAlive)
|
||||
connection = pool.connections.find(c => c.id === connection.id)
|
||||
t.strictEqual(connection.deadCount, 1)
|
||||
t.true(connection.resurrectTimeout > 0)
|
||||
t.strictEqual(connection.status, Connection.statuses.ALIVE)
|
||||
t.deepEqual(pool.dead, [])
|
||||
t.equal(connection.deadCount, 1)
|
||||
t.ok(connection.resurrectTimeout > 0)
|
||||
t.equal(connection.status, Connection.statuses.ALIVE)
|
||||
t.same(pool.dead, [])
|
||||
t.end()
|
||||
})
|
||||
})
|
||||
@ -211,10 +211,10 @@ test('API', t => {
|
||||
t.ok(isAlive === null)
|
||||
t.ok(connection === null)
|
||||
connection = pool.connections.find(c => c.id === href)
|
||||
t.strictEqual(connection.deadCount, 1)
|
||||
t.true(connection.resurrectTimeout > 0)
|
||||
t.strictEqual(connection.status, Connection.statuses.DEAD)
|
||||
t.deepEqual(pool.dead, [href])
|
||||
t.equal(connection.deadCount, 1)
|
||||
t.ok(connection.resurrectTimeout > 0)
|
||||
t.equal(connection.status, Connection.statuses.DEAD)
|
||||
t.same(pool.dead, [href])
|
||||
t.end()
|
||||
})
|
||||
})
|
||||
@ -238,7 +238,7 @@ test('API', t => {
|
||||
pool.addConnection([href1, href2])
|
||||
|
||||
const filter = node => node.id === href1
|
||||
t.strictEqual(pool.getConnection({ filter }).id, href1)
|
||||
t.equal(pool.getConnection({ filter }).id, href1)
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -266,7 +266,7 @@ test('API', t => {
|
||||
pool.markDead(conn)
|
||||
|
||||
const filter = node => {
|
||||
t.strictEqual(node.status, Connection.statuses.ALIVE)
|
||||
t.equal(node.status, Connection.statuses.ALIVE)
|
||||
return true
|
||||
}
|
||||
pool.getConnection({ filter })
|
||||
@ -282,7 +282,7 @@ test('API', t => {
|
||||
pool.markDead(conn2)
|
||||
const conn = pool.getConnection()
|
||||
t.ok(conn instanceof Connection)
|
||||
t.is(conn.status, 'dead')
|
||||
t.equal(conn.status, 'dead')
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -295,7 +295,7 @@ test('API', t => {
|
||||
const connection = pool.addConnection(href)
|
||||
t.ok(pool.getConnection() instanceof Connection)
|
||||
pool.removeConnection(connection)
|
||||
t.strictEqual(pool.getConnection(), null)
|
||||
t.equal(pool.getConnection(), null)
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -304,8 +304,8 @@ test('API', t => {
|
||||
pool.addConnection('http://localhost:9200/')
|
||||
pool.addConnection('http://localhost:9201/')
|
||||
pool.empty(() => {
|
||||
t.strictEqual(pool.size, 0)
|
||||
t.deepEqual(pool.dead, [])
|
||||
t.equal(pool.size, 0)
|
||||
t.same(pool.dead, [])
|
||||
t.end()
|
||||
})
|
||||
})
|
||||
@ -313,7 +313,7 @@ test('API', t => {
|
||||
t.test('urlToHost', t => {
|
||||
const pool = new ConnectionPool({ Connection })
|
||||
const url = 'http://localhost:9200'
|
||||
t.deepEqual(
|
||||
t.same(
|
||||
pool.urlToHost(url),
|
||||
{ url: new URL(url) }
|
||||
)
|
||||
@ -338,7 +338,7 @@ test('API', t => {
|
||||
}
|
||||
}
|
||||
|
||||
t.deepEqual(pool.nodesToHost(nodes, 'http:'), [{
|
||||
t.same(pool.nodesToHost(nodes, 'http:'), [{
|
||||
url: new URL('http://127.0.0.1:9200'),
|
||||
id: 'a1',
|
||||
roles: {
|
||||
@ -358,8 +358,8 @@ test('API', t => {
|
||||
}
|
||||
}])
|
||||
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[0].url.host, '127.0.0.1:9200')
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.host, '127.0.0.1:9201')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[0].url.host, '127.0.0.1:9200')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[1].url.host, '127.0.0.1:9201')
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -380,7 +380,7 @@ test('API', t => {
|
||||
}
|
||||
}
|
||||
|
||||
t.deepEqual(pool.nodesToHost(nodes, 'http:'), [{
|
||||
t.same(pool.nodesToHost(nodes, 'http:'), [{
|
||||
url: new URL('http://[::1]:9200'),
|
||||
id: 'a1',
|
||||
roles: {
|
||||
@ -400,8 +400,8 @@ test('API', t => {
|
||||
}
|
||||
}])
|
||||
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[0].url.host, '[::1]:9200')
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.host, '[::1]:9201')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[0].url.host, '[::1]:9200')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[1].url.host, '[::1]:9201')
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -422,7 +422,7 @@ test('API', t => {
|
||||
}
|
||||
}
|
||||
|
||||
t.deepEqual(pool.nodesToHost(nodes, 'http:'), [{
|
||||
t.same(pool.nodesToHost(nodes, 'http:'), [{
|
||||
url: new URL('http://example.com:9200'),
|
||||
id: 'a1',
|
||||
roles: {
|
||||
@ -442,8 +442,8 @@ test('API', t => {
|
||||
}
|
||||
}])
|
||||
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[0].url.host, 'example.com:9200')
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.host, 'example.com:9201')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[0].url.host, 'example.com:9200')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[1].url.host, 'example.com:9201')
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -464,7 +464,7 @@ test('API', t => {
|
||||
}
|
||||
}
|
||||
|
||||
t.deepEqual(pool.nodesToHost(nodes, 'http:'), [{
|
||||
t.same(pool.nodesToHost(nodes, 'http:'), [{
|
||||
url: new URL('http://example.com:9200'),
|
||||
id: 'a1',
|
||||
roles: {
|
||||
@ -484,8 +484,8 @@ test('API', t => {
|
||||
}
|
||||
}])
|
||||
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[0].url.host, 'example.com:9200')
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.host, 'example.com:9201')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[0].url.host, 'example.com:9200')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[1].url.host, 'example.com:9201')
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -506,8 +506,8 @@ test('API', t => {
|
||||
}
|
||||
}
|
||||
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'https:')[0].url.protocol, 'https:')
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.protocol, 'http:')
|
||||
t.equal(pool.nodesToHost(nodes, 'https:')[0].url.protocol, 'https:')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[1].url.protocol, 'http:')
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -662,13 +662,13 @@ test('API', t => {
|
||||
|
||||
// roles will never be updated, we only use it to do
|
||||
// a dummy check to see if the connection has been updated
|
||||
t.deepEqual(pool.connections.find(c => c.id === 'a1').roles, {
|
||||
t.same(pool.connections.find(c => c.id === 'a1').roles, {
|
||||
master: true,
|
||||
data: true,
|
||||
ingest: true,
|
||||
ml: false
|
||||
})
|
||||
t.strictEqual(pool.connections.find(c => c.id === 'http://127.0.0.1:9200/'), undefined)
|
||||
t.equal(pool.connections.find(c => c.id === 'http://127.0.0.1:9200/'), undefined)
|
||||
})
|
||||
|
||||
t.test('Add a new connection', t => {
|
||||
@ -717,9 +717,9 @@ test('API', t => {
|
||||
roles: null
|
||||
}])
|
||||
|
||||
t.false(pool.connections.find(c => c.id === 'a1'))
|
||||
t.true(pool.connections.find(c => c.id === 'a2'))
|
||||
t.true(pool.connections.find(c => c.id === 'a3'))
|
||||
t.notOk(pool.connections.find(c => c.id === 'a1'))
|
||||
t.ok(pool.connections.find(c => c.id === 'a2'))
|
||||
t.ok(pool.connections.find(c => c.id === 'a3'))
|
||||
})
|
||||
|
||||
t.test('Remove old connections (markDead)', t => {
|
||||
@ -732,7 +732,7 @@ test('API', t => {
|
||||
})
|
||||
|
||||
pool.markDead(conn)
|
||||
t.deepEqual(pool.dead, ['a1'])
|
||||
t.same(pool.dead, ['a1'])
|
||||
|
||||
pool.update([{
|
||||
url: new URL('http://127.0.0.1:9200'),
|
||||
@ -744,10 +744,10 @@ test('API', t => {
|
||||
roles: null
|
||||
}])
|
||||
|
||||
t.deepEqual(pool.dead, [])
|
||||
t.false(pool.connections.find(c => c.id === 'a1'))
|
||||
t.true(pool.connections.find(c => c.id === 'a2'))
|
||||
t.true(pool.connections.find(c => c.id === 'a3'))
|
||||
t.same(pool.dead, [])
|
||||
t.notOk(pool.connections.find(c => c.id === 'a1'))
|
||||
t.ok(pool.connections.find(c => c.id === 'a2'))
|
||||
t.ok(pool.connections.find(c => c.id === 'a3'))
|
||||
})
|
||||
|
||||
t.end()
|
||||
@ -761,14 +761,14 @@ test('Node selector', t => {
|
||||
t.plan(1)
|
||||
const pool = new ConnectionPool({ Connection })
|
||||
pool.addConnection('http://localhost:9200/')
|
||||
t.true(pool.getConnection({ selector: roundRobinSelector() }) instanceof Connection)
|
||||
t.ok(pool.getConnection({ selector: roundRobinSelector() }) instanceof Connection)
|
||||
})
|
||||
|
||||
t.test('random', t => {
|
||||
t.plan(1)
|
||||
const pool = new ConnectionPool({ Connection })
|
||||
pool.addConnection('http://localhost:9200/')
|
||||
t.true(pool.getConnection({ selector: roundRobinSelector() }) instanceof Connection)
|
||||
t.ok(pool.getConnection({ selector: roundRobinSelector() }) instanceof Connection)
|
||||
})
|
||||
|
||||
t.end()
|
||||
@ -779,7 +779,7 @@ test('Node filter', t => {
|
||||
t.plan(1)
|
||||
const pool = new ConnectionPool({ Connection })
|
||||
pool.addConnection({ url: new URL('http://localhost:9200/') })
|
||||
t.true(pool.getConnection({ filter: defaultNodeFilter }) instanceof Connection)
|
||||
t.ok(pool.getConnection({ filter: defaultNodeFilter }) instanceof Connection)
|
||||
})
|
||||
|
||||
t.test('Should filter master only nodes', t => {
|
||||
@ -794,7 +794,7 @@ test('Node filter', t => {
|
||||
ml: false
|
||||
}
|
||||
})
|
||||
t.strictEqual(pool.getConnection({ filter: defaultNodeFilter }), null)
|
||||
t.equal(pool.getConnection({ filter: defaultNodeFilter }), null)
|
||||
})
|
||||
|
||||
t.end()
|
||||
|
||||
@ -28,7 +28,8 @@ const hpagent = require('hpagent')
|
||||
const intoStream = require('into-stream')
|
||||
const { buildServer } = require('../utils')
|
||||
const Connection = require('../../lib/Connection')
|
||||
const { TimeoutError, ConfigurationError, RequestAbortedError } = require('../../lib/errors')
|
||||
const { TimeoutError, ConfigurationError, RequestAbortedError, ConnectionError } = require('../../lib/errors')
|
||||
const { getIssuerCertificate } = Connection.internals
|
||||
|
||||
test('Basic (http)', t => {
|
||||
t.plan(4)
|
||||
@ -63,7 +64,7 @@ test('Basic (http)', t => {
|
||||
res.on('data', chunk => { payload += chunk })
|
||||
res.on('error', err => t.fail(err))
|
||||
res.on('end', () => {
|
||||
t.strictEqual(payload, 'ok')
|
||||
t.equal(payload, 'ok')
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -103,7 +104,7 @@ test('Basic (https)', t => {
|
||||
res.on('data', chunk => { payload += chunk })
|
||||
res.on('error', err => t.fail(err))
|
||||
res.on('end', () => {
|
||||
t.strictEqual(payload, 'ok')
|
||||
t.equal(payload, 'ok')
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -144,7 +145,7 @@ test('Basic (https with ssl agent)', t => {
|
||||
res.on('data', chunk => { payload += chunk })
|
||||
res.on('error', err => t.fail(err))
|
||||
res.on('end', () => {
|
||||
t.strictEqual(payload, 'ok')
|
||||
t.equal(payload, 'ok')
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -179,7 +180,7 @@ test('Custom http agent', t => {
|
||||
return agent
|
||||
}
|
||||
})
|
||||
t.true(connection.agent.custom)
|
||||
t.ok(connection.agent.custom)
|
||||
connection.request({
|
||||
path: '/hello',
|
||||
method: 'GET',
|
||||
@ -198,7 +199,7 @@ test('Custom http agent', t => {
|
||||
res.on('data', chunk => { payload += chunk })
|
||||
res.on('error', err => t.fail(err))
|
||||
res.on('end', () => {
|
||||
t.strictEqual(payload, 'ok')
|
||||
t.equal(payload, 'ok')
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -268,7 +269,7 @@ test('querystring', t => {
|
||||
t.plan(2)
|
||||
|
||||
function handler (req, res) {
|
||||
t.strictEqual(req.url, '/hello?hello=world&you_know=for%20search')
|
||||
t.equal(req.url, '/hello?hello=world&you_know=for%20search')
|
||||
res.end('ok')
|
||||
}
|
||||
|
||||
@ -291,7 +292,7 @@ test('querystring', t => {
|
||||
t.plan(2)
|
||||
|
||||
function handler (req, res) {
|
||||
t.strictEqual(req.url, '/hello')
|
||||
t.equal(req.url, '/hello')
|
||||
res.end('ok')
|
||||
}
|
||||
|
||||
@ -322,7 +323,7 @@ test('Body request', t => {
|
||||
req.on('data', chunk => { payload += chunk })
|
||||
req.on('error', err => t.fail(err))
|
||||
req.on('end', () => {
|
||||
t.strictEqual(payload, 'hello')
|
||||
t.equal(payload, 'hello')
|
||||
res.end('ok')
|
||||
})
|
||||
}
|
||||
@ -351,7 +352,7 @@ test('Send body as buffer', t => {
|
||||
req.on('data', chunk => { payload += chunk })
|
||||
req.on('error', err => t.fail(err))
|
||||
req.on('end', () => {
|
||||
t.strictEqual(payload, 'hello')
|
||||
t.equal(payload, 'hello')
|
||||
res.end('ok')
|
||||
})
|
||||
}
|
||||
@ -380,7 +381,7 @@ test('Send body as stream', t => {
|
||||
req.on('data', chunk => { payload += chunk })
|
||||
req.on('error', err => t.fail(err))
|
||||
req.on('end', () => {
|
||||
t.strictEqual(payload, 'hello')
|
||||
t.equal(payload, 'hello')
|
||||
res.end('ok')
|
||||
})
|
||||
}
|
||||
@ -413,7 +414,7 @@ test('Should not close a connection if there are open requests', t => {
|
||||
})
|
||||
|
||||
setTimeout(() => {
|
||||
t.strictEqual(connection._openRequests, 1)
|
||||
t.equal(connection._openRequests, 1)
|
||||
connection.close()
|
||||
}, 500)
|
||||
|
||||
@ -422,14 +423,14 @@ test('Should not close a connection if there are open requests', t => {
|
||||
method: 'GET'
|
||||
}, (err, res) => {
|
||||
t.error(err)
|
||||
t.strictEqual(connection._openRequests, 0)
|
||||
t.equal(connection._openRequests, 0)
|
||||
|
||||
let payload = ''
|
||||
res.setEncoding('utf8')
|
||||
res.on('data', chunk => { payload += chunk })
|
||||
res.on('error', err => t.fail(err))
|
||||
res.on('end', () => {
|
||||
t.strictEqual(payload, 'ok')
|
||||
t.equal(payload, 'ok')
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -450,7 +451,7 @@ test('Should not close a connection if there are open requests (with agent disab
|
||||
})
|
||||
|
||||
setTimeout(() => {
|
||||
t.strictEqual(connection._openRequests, 1)
|
||||
t.equal(connection._openRequests, 1)
|
||||
connection.close()
|
||||
}, 500)
|
||||
|
||||
@ -459,14 +460,14 @@ test('Should not close a connection if there are open requests (with agent disab
|
||||
method: 'GET'
|
||||
}, (err, res) => {
|
||||
t.error(err)
|
||||
t.strictEqual(connection._openRequests, 0)
|
||||
t.equal(connection._openRequests, 0)
|
||||
|
||||
let payload = ''
|
||||
res.setEncoding('utf8')
|
||||
res.on('data', chunk => { payload += chunk })
|
||||
res.on('error', err => t.fail(err))
|
||||
res.on('end', () => {
|
||||
t.strictEqual(payload, 'ok')
|
||||
t.equal(payload, 'ok')
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -502,7 +503,7 @@ test('Url with querystring', t => {
|
||||
t.plan(2)
|
||||
|
||||
function handler (req, res) {
|
||||
t.strictEqual(req.url, '/hello?foo=bar&baz=faz')
|
||||
t.equal(req.url, '/hello?foo=bar&baz=faz')
|
||||
res.end('ok')
|
||||
}
|
||||
|
||||
@ -546,7 +547,7 @@ test('Custom headers for connection', t => {
|
||||
}, (err, res) => {
|
||||
t.error(err)
|
||||
// should not update the default
|
||||
t.deepEqual(connection.headers, { 'x-foo': 'bar' })
|
||||
t.same(connection.headers, { 'x-foo': 'bar' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -576,7 +577,7 @@ test('asStream set to true', t => {
|
||||
res.on('data', chunk => { payload += chunk })
|
||||
res.on('error', err => t.fail(err))
|
||||
res.on('end', () => {
|
||||
t.strictEqual(payload, 'ok')
|
||||
t.equal(payload, 'ok')
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -587,7 +588,7 @@ test('Connection id should not contain credentials', t => {
|
||||
const connection = new Connection({
|
||||
url: new URL('http://user:password@localhost:9200')
|
||||
})
|
||||
t.strictEqual(connection.id, 'http://localhost:9200/')
|
||||
t.equal(connection.id, 'http://localhost:9200/')
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -595,7 +596,7 @@ test('Ipv6 support', t => {
|
||||
const connection = new Connection({
|
||||
url: new URL('http://[::1]:9200')
|
||||
})
|
||||
t.strictEqual(connection.buildRequestObject({}).hostname, '::1')
|
||||
t.equal(connection.buildRequestObject({}).hostname, '::1')
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -607,7 +608,7 @@ test('Should throw if the protocol is not http or https', t => {
|
||||
t.fail('Should throw')
|
||||
} catch (err) {
|
||||
t.ok(err instanceof ConfigurationError)
|
||||
t.is(err.message, 'Invalid protocol: \'nope:\'')
|
||||
t.equal(err.message, 'Invalid protocol: \'nope:\'')
|
||||
}
|
||||
t.end()
|
||||
})
|
||||
@ -623,7 +624,7 @@ test('Should disallow two-byte characters in URL path', t => {
|
||||
path: '/thisisinvalid\uffe2',
|
||||
method: 'GET'
|
||||
}, (err, res) => {
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
err.message,
|
||||
'ERR_UNESCAPED_CHARACTERS: /thisisinvalid\uffe2'
|
||||
)
|
||||
@ -638,7 +639,7 @@ test('setRole', t => {
|
||||
url: new URL('http://localhost:9200')
|
||||
})
|
||||
|
||||
t.deepEqual(connection.roles, {
|
||||
t.same(connection.roles, {
|
||||
master: true,
|
||||
data: true,
|
||||
ingest: true,
|
||||
@ -647,7 +648,7 @@ test('setRole', t => {
|
||||
|
||||
connection.setRole('master', false)
|
||||
|
||||
t.deepEqual(connection.roles, {
|
||||
t.same(connection.roles, {
|
||||
master: false,
|
||||
data: true,
|
||||
ingest: true,
|
||||
@ -666,8 +667,8 @@ test('setRole', t => {
|
||||
connection.setRole('car', true)
|
||||
t.fail('Shoud throw')
|
||||
} catch (err) {
|
||||
t.true(err instanceof ConfigurationError)
|
||||
t.is(err.message, 'Unsupported role: \'car\'')
|
||||
t.ok(err instanceof ConfigurationError)
|
||||
t.equal(err.message, 'Unsupported role: \'car\'')
|
||||
}
|
||||
})
|
||||
|
||||
@ -682,8 +683,8 @@ test('setRole', t => {
|
||||
connection.setRole('master', 1)
|
||||
t.fail('Shoud throw')
|
||||
} catch (err) {
|
||||
t.true(err instanceof ConfigurationError)
|
||||
t.is(err.message, 'enabled should be a boolean')
|
||||
t.ok(err instanceof ConfigurationError)
|
||||
t.equal(err.message, 'enabled should be a boolean')
|
||||
}
|
||||
})
|
||||
|
||||
@ -708,7 +709,7 @@ test('Util.inspect Connection class should hide agent, ssl and auth', t => {
|
||||
.replace(/(\r\n|\n|\r)/gm, '')
|
||||
}
|
||||
|
||||
t.strictEqual(cleanStr(inspect(connection)), cleanStr(`{ url: 'http://localhost:9200/',
|
||||
t.equal(cleanStr(inspect(connection)), cleanStr(`{ url: 'http://localhost:9200/',
|
||||
id: 'node-id',
|
||||
headers: { foo: 'bar' },
|
||||
deadCount: 0,
|
||||
@ -728,7 +729,7 @@ test('connection.toJSON should hide agent, ssl and auth', t => {
|
||||
headers: { foo: 'bar' }
|
||||
})
|
||||
|
||||
t.deepEqual(connection.toJSON(), {
|
||||
t.same(connection.toJSON(), {
|
||||
url: 'http://localhost:9200/',
|
||||
id: 'node-id',
|
||||
headers: {
|
||||
@ -754,7 +755,7 @@ test('Port handling', t => {
|
||||
url: new URL('http://localhost:80')
|
||||
})
|
||||
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
connection.buildRequestObject({}).port,
|
||||
undefined
|
||||
)
|
||||
@ -767,7 +768,7 @@ test('Port handling', t => {
|
||||
url: new URL('https://localhost:443')
|
||||
})
|
||||
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
connection.buildRequestObject({}).port,
|
||||
undefined
|
||||
)
|
||||
@ -784,7 +785,7 @@ test('Authorization header', t => {
|
||||
url: new URL('http://localhost:9200')
|
||||
})
|
||||
|
||||
t.deepEqual(connection.headers, {})
|
||||
t.same(connection.headers, {})
|
||||
|
||||
t.end()
|
||||
})
|
||||
@ -795,7 +796,7 @@ test('Authorization header', t => {
|
||||
auth: { username: 'foo', password: 'bar' }
|
||||
})
|
||||
|
||||
t.deepEqual(connection.headers, { authorization: 'Basic Zm9vOmJhcg==' })
|
||||
t.same(connection.headers, { authorization: 'Basic Zm9vOmJhcg==' })
|
||||
|
||||
t.end()
|
||||
})
|
||||
@ -806,7 +807,7 @@ test('Authorization header', t => {
|
||||
auth: { apiKey: 'Zm9vOmJhcg==' }
|
||||
})
|
||||
|
||||
t.deepEqual(connection.headers, { authorization: 'ApiKey Zm9vOmJhcg==' })
|
||||
t.same(connection.headers, { authorization: 'ApiKey Zm9vOmJhcg==' })
|
||||
|
||||
t.end()
|
||||
})
|
||||
@ -817,7 +818,7 @@ test('Authorization header', t => {
|
||||
auth: { apiKey: { id: 'foo', api_key: 'bar' } }
|
||||
})
|
||||
|
||||
t.deepEqual(connection.headers, { authorization: 'ApiKey Zm9vOmJhcg==' })
|
||||
t.same(connection.headers, { authorization: 'ApiKey Zm9vOmJhcg==' })
|
||||
|
||||
t.end()
|
||||
})
|
||||
@ -830,7 +831,7 @@ test('Should not add agent and ssl to the serialized connection', t => {
|
||||
url: new URL('http://localhost:9200')
|
||||
})
|
||||
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
JSON.stringify(connection),
|
||||
'{"url":"http://localhost:9200/","id":"http://localhost:9200/","headers":{},"deadCount":0,"resurrectTimeout":0,"_openRequests":0,"status":"alive","roles":{"master":true,"data":true,"ingest":true,"ml":false}}'
|
||||
)
|
||||
@ -890,7 +891,7 @@ test('Should correctly resolve request pathname', t => {
|
||||
url: new URL('http://localhost:80/test')
|
||||
})
|
||||
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
connection.buildRequestObject({
|
||||
path: 'hello'
|
||||
}).pathname,
|
||||
@ -906,7 +907,7 @@ test('Proxy agent (http)', t => {
|
||||
proxy: 'http://localhost:8080'
|
||||
})
|
||||
|
||||
t.true(connection.agent instanceof hpagent.HttpProxyAgent)
|
||||
t.ok(connection.agent instanceof hpagent.HttpProxyAgent)
|
||||
})
|
||||
|
||||
test('Proxy agent (https)', t => {
|
||||
@ -917,7 +918,7 @@ test('Proxy agent (https)', t => {
|
||||
proxy: 'http://localhost:8080'
|
||||
})
|
||||
|
||||
t.true(connection.agent instanceof hpagent.HttpsProxyAgent)
|
||||
t.ok(connection.agent instanceof hpagent.HttpsProxyAgent)
|
||||
})
|
||||
|
||||
test('Abort with a slow body', t => {
|
||||
@ -947,3 +948,161 @@ test('Abort with a slow body', t => {
|
||||
|
||||
setImmediate(() => request.abort())
|
||||
})
|
||||
|
||||
test('Check server fingerprint (success)', t => {
|
||||
t.plan(2)
|
||||
|
||||
function handler (req, res) {
|
||||
res.end('ok')
|
||||
}
|
||||
|
||||
buildServer(handler, { secure: true }, ({ port, caFingerprint }, server) => {
|
||||
const connection = new Connection({
|
||||
url: new URL(`https://localhost:${port}`),
|
||||
caFingerprint
|
||||
})
|
||||
|
||||
connection.request({
|
||||
path: '/hello',
|
||||
method: 'GET'
|
||||
}, (err, res) => {
|
||||
t.error(err)
|
||||
|
||||
let payload = ''
|
||||
res.setEncoding('utf8')
|
||||
res.on('data', chunk => { payload += chunk })
|
||||
res.on('error', err => t.fail(err))
|
||||
res.on('end', () => {
|
||||
t.equal(payload, 'ok')
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
test('Check server fingerprint (failure)', t => {
|
||||
t.plan(2)
|
||||
|
||||
function handler (req, res) {
|
||||
res.end('ok')
|
||||
}
|
||||
|
||||
buildServer(handler, { secure: true }, ({ port }, server) => {
|
||||
const connection = new Connection({
|
||||
url: new URL(`https://localhost:${port}`),
|
||||
caFingerprint: 'FO:OB:AR'
|
||||
})
|
||||
|
||||
connection.request({
|
||||
path: '/hello',
|
||||
method: 'GET'
|
||||
}, (err, res) => {
|
||||
t.ok(err instanceof ConnectionError)
|
||||
t.equal(err.message, 'Server certificate CA fingerprint does not match the value configured in caFingerprint')
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
test('getIssuerCertificate returns the root CA', t => {
|
||||
t.plan(2)
|
||||
const issuerCertificate = {
|
||||
fingerprint256: 'BA:ZF:AZ',
|
||||
subject: {
|
||||
C: '1',
|
||||
ST: '1',
|
||||
L: '1',
|
||||
O: '1',
|
||||
OU: '1',
|
||||
CN: '1'
|
||||
},
|
||||
issuer: {
|
||||
C: '1',
|
||||
ST: '1',
|
||||
L: '1',
|
||||
O: '1',
|
||||
OU: '1',
|
||||
CN: '1'
|
||||
}
|
||||
}
|
||||
issuerCertificate.issuerCertificate = issuerCertificate
|
||||
|
||||
const socket = {
|
||||
getPeerCertificate (bool) {
|
||||
t.ok(bool)
|
||||
return {
|
||||
fingerprint256: 'FO:OB:AR',
|
||||
subject: {
|
||||
C: '1',
|
||||
ST: '1',
|
||||
L: '1',
|
||||
O: '1',
|
||||
OU: '1',
|
||||
CN: '1'
|
||||
},
|
||||
issuer: {
|
||||
C: '2',
|
||||
ST: '2',
|
||||
L: '2',
|
||||
O: '2',
|
||||
OU: '2',
|
||||
CN: '2'
|
||||
},
|
||||
issuerCertificate
|
||||
}
|
||||
}
|
||||
}
|
||||
t.same(getIssuerCertificate(socket), issuerCertificate)
|
||||
})
|
||||
|
||||
test('getIssuerCertificate detects invalid/malformed certificates', t => {
|
||||
t.plan(2)
|
||||
const socket = {
|
||||
getPeerCertificate (bool) {
|
||||
t.ok(bool)
|
||||
return {
|
||||
fingerprint256: 'FO:OB:AR',
|
||||
subject: {
|
||||
C: '1',
|
||||
ST: '1',
|
||||
L: '1',
|
||||
O: '1',
|
||||
OU: '1',
|
||||
CN: '1'
|
||||
},
|
||||
issuer: {
|
||||
C: '2',
|
||||
ST: '2',
|
||||
L: '2',
|
||||
O: '2',
|
||||
OU: '2',
|
||||
CN: '2'
|
||||
}
|
||||
// missing issuerCertificate
|
||||
}
|
||||
}
|
||||
}
|
||||
t.equal(getIssuerCertificate(socket), null)
|
||||
})
|
||||
|
||||
test('Should show local/remote socket address in case of ECONNRESET', t => {
|
||||
t.plan(2)
|
||||
|
||||
function handler (req, res) {
|
||||
res.destroy()
|
||||
}
|
||||
|
||||
buildServer(handler, ({ port }, server) => {
|
||||
const connection = new Connection({
|
||||
url: new URL(`http://localhost:${port}`)
|
||||
})
|
||||
connection.request({
|
||||
path: '/hello',
|
||||
method: 'GET'
|
||||
}, (err, res) => {
|
||||
t.ok(err instanceof ConnectionError)
|
||||
t.match(err.message, /socket\shang\sup\s-\sLocal:\s127.0.0.1:\d+,\sRemote:\s127.0.0.1:\d+/)
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@ -26,57 +26,57 @@ const { errors } = require('../../index')
|
||||
|
||||
test('ElasticsearchClientError', t => {
|
||||
const err = new errors.ElasticsearchClientError()
|
||||
t.true(err instanceof Error)
|
||||
t.ok(err instanceof Error)
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('TimeoutError', t => {
|
||||
const err = new errors.TimeoutError()
|
||||
t.true(err instanceof Error)
|
||||
t.true(err instanceof errors.ElasticsearchClientError)
|
||||
t.true(err.hasOwnProperty('meta'))
|
||||
t.ok(err instanceof Error)
|
||||
t.ok(err instanceof errors.ElasticsearchClientError)
|
||||
t.ok(err.hasOwnProperty('meta'))
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('ConnectionError', t => {
|
||||
const err = new errors.ConnectionError()
|
||||
t.true(err instanceof Error)
|
||||
t.true(err instanceof errors.ElasticsearchClientError)
|
||||
t.true(err.hasOwnProperty('meta'))
|
||||
t.ok(err instanceof Error)
|
||||
t.ok(err instanceof errors.ElasticsearchClientError)
|
||||
t.ok(err.hasOwnProperty('meta'))
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('NoLivingConnectionsError', t => {
|
||||
const err = new errors.NoLivingConnectionsError()
|
||||
t.true(err instanceof Error)
|
||||
t.true(err instanceof errors.ElasticsearchClientError)
|
||||
t.true(err.hasOwnProperty('meta'))
|
||||
t.ok(err instanceof Error)
|
||||
t.ok(err instanceof errors.ElasticsearchClientError)
|
||||
t.ok(err.hasOwnProperty('meta'))
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('SerializationError', t => {
|
||||
const err = new errors.SerializationError()
|
||||
t.true(err instanceof Error)
|
||||
t.true(err instanceof errors.ElasticsearchClientError)
|
||||
t.false(err.hasOwnProperty('meta'))
|
||||
t.true(err.hasOwnProperty('data'))
|
||||
t.ok(err instanceof Error)
|
||||
t.ok(err instanceof errors.ElasticsearchClientError)
|
||||
t.notOk(err.hasOwnProperty('meta'))
|
||||
t.ok(err.hasOwnProperty('data'))
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('DeserializationError', t => {
|
||||
const err = new errors.DeserializationError()
|
||||
t.true(err instanceof Error)
|
||||
t.true(err instanceof errors.ElasticsearchClientError)
|
||||
t.false(err.hasOwnProperty('meta'))
|
||||
t.true(err.hasOwnProperty('data'))
|
||||
t.ok(err instanceof Error)
|
||||
t.ok(err instanceof errors.ElasticsearchClientError)
|
||||
t.notOk(err.hasOwnProperty('meta'))
|
||||
t.ok(err.hasOwnProperty('data'))
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('ConfigurationError', t => {
|
||||
const err = new errors.ConfigurationError()
|
||||
t.true(err instanceof Error)
|
||||
t.true(err instanceof errors.ElasticsearchClientError)
|
||||
t.false(err.hasOwnProperty('meta'))
|
||||
t.ok(err instanceof Error)
|
||||
t.ok(err instanceof errors.ElasticsearchClientError)
|
||||
t.notOk(err.hasOwnProperty('meta'))
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -87,9 +87,9 @@ test('ResponseError', t => {
|
||||
headers: 1
|
||||
}
|
||||
const err = new errors.ResponseError(meta)
|
||||
t.true(err instanceof Error)
|
||||
t.true(err instanceof errors.ElasticsearchClientError)
|
||||
t.true(err.hasOwnProperty('meta'))
|
||||
t.ok(err instanceof Error)
|
||||
t.ok(err instanceof errors.ElasticsearchClientError)
|
||||
t.ok(err.hasOwnProperty('meta'))
|
||||
t.ok(err.body)
|
||||
t.ok(err.statusCode)
|
||||
t.ok(err.headers)
|
||||
@ -98,8 +98,128 @@ test('ResponseError', t => {
|
||||
|
||||
test('RequestAbortedError', t => {
|
||||
const err = new errors.RequestAbortedError()
|
||||
t.true(err instanceof Error)
|
||||
t.true(err instanceof errors.ElasticsearchClientError)
|
||||
t.true(err.hasOwnProperty('meta'))
|
||||
t.ok(err instanceof Error)
|
||||
t.ok(err instanceof errors.ElasticsearchClientError)
|
||||
t.ok(err.hasOwnProperty('meta'))
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('ResponseError with meaningful message / 1', t => {
|
||||
const meta = {
|
||||
body: {
|
||||
error: {
|
||||
root_cause: [
|
||||
{
|
||||
type: 'index_not_found_exception',
|
||||
reason: 'no such index [foo]',
|
||||
'resource.type': 'index_expression',
|
||||
'resource.id': 'foo',
|
||||
index_uuid: '_na_',
|
||||
index: 'foo'
|
||||
}
|
||||
],
|
||||
type: 'index_not_found_exception',
|
||||
reason: 'no such index [foo]',
|
||||
'resource.type': 'index_expression',
|
||||
'resource.id': 'foo',
|
||||
index_uuid: '_na_',
|
||||
index: 'foo'
|
||||
},
|
||||
status: 404
|
||||
},
|
||||
statusCode: 404,
|
||||
headers: {}
|
||||
}
|
||||
const err = new errors.ResponseError(meta)
|
||||
t.equal(err.message, 'index_not_found_exception: [index_not_found_exception] Reason: no such index [foo]')
|
||||
t.equal(err.toString(), JSON.stringify(meta.body))
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('ResponseError with meaningful message / 2', t => {
|
||||
const meta = {
|
||||
body: {
|
||||
error: {
|
||||
root_cause: [
|
||||
{
|
||||
type: 'index_not_found_exception',
|
||||
reason: 'no such index [foo]',
|
||||
'resource.type': 'index_expression',
|
||||
'resource.id': 'foo',
|
||||
index_uuid: '_na_',
|
||||
index: 'foo'
|
||||
},
|
||||
{
|
||||
type: 'nested_cause',
|
||||
reason: 'this is a nested cause',
|
||||
'resource.type': 'index_expression',
|
||||
'resource.id': 'foo',
|
||||
index_uuid: '_na_',
|
||||
index: 'foo'
|
||||
}
|
||||
],
|
||||
type: 'index_not_found_exception',
|
||||
reason: 'no such index [foo]',
|
||||
'resource.type': 'index_expression',
|
||||
'resource.id': 'foo',
|
||||
index_uuid: '_na_',
|
||||
index: 'foo'
|
||||
},
|
||||
status: 404
|
||||
},
|
||||
statusCode: 404,
|
||||
headers: {}
|
||||
}
|
||||
const err = new errors.ResponseError(meta)
|
||||
t.equal(err.message, 'index_not_found_exception: [index_not_found_exception] Reason: no such index [foo]; [nested_cause] Reason: this is a nested cause')
|
||||
t.equal(err.toString(), JSON.stringify(meta.body))
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('ResponseError with meaningful message / 3', t => {
|
||||
const meta = {
|
||||
body: {
|
||||
error: {
|
||||
type: 'index_not_found_exception',
|
||||
reason: 'no such index [foo]',
|
||||
'resource.type': 'index_expression',
|
||||
'resource.id': 'foo',
|
||||
index_uuid: '_na_',
|
||||
index: 'foo'
|
||||
},
|
||||
status: 404
|
||||
},
|
||||
statusCode: 404,
|
||||
headers: {}
|
||||
}
|
||||
const err = new errors.ResponseError(meta)
|
||||
t.equal(err.message, 'index_not_found_exception')
|
||||
t.equal(err.toString(), JSON.stringify(meta.body))
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('ResponseError with meaningful message when body is not json', t => {
|
||||
const meta = {
|
||||
statusCode: 400,
|
||||
body: '<html><body>error!</body></html>',
|
||||
headers: { 'content-type': 'text/html' }
|
||||
}
|
||||
const err = new errors.ResponseError(meta)
|
||||
t.equal(err.name, 'ResponseError')
|
||||
t.equal(err.message, '<html><body>error!</body></html>')
|
||||
t.equal(err.toString(), JSON.stringify(meta.body))
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('ResponseError with meaningful message when body is falsy', t => {
|
||||
const meta = {
|
||||
statusCode: 400,
|
||||
body: '',
|
||||
headers: { 'content-type': 'text/plain' }
|
||||
}
|
||||
const err = new errors.ResponseError(meta)
|
||||
t.equal(err.name, 'ResponseError')
|
||||
t.equal(err.message, 'Response Error')
|
||||
t.equal(err.toString(), JSON.stringify(meta.body))
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -4,5 +4,5 @@ import { Client } from '../../../index.mjs'
|
||||
t.test('esm support', t => {
|
||||
t.plan(1)
|
||||
const client = new Client({ node: 'http://localhost:9200' })
|
||||
t.strictEqual(client.name, 'elasticsearch-js')
|
||||
t.equal(client.name, 'elasticsearch-js')
|
||||
})
|
||||
|
||||
@ -20,9 +20,10 @@
|
||||
'use strict'
|
||||
|
||||
const { test } = require('tap')
|
||||
const { Client, events } = require('../../index')
|
||||
const { events } = require('../../index')
|
||||
const { TimeoutError } = require('../../lib/errors')
|
||||
const {
|
||||
Client,
|
||||
connection: {
|
||||
MockConnection,
|
||||
MockConnectionTimeout
|
||||
@ -289,7 +290,7 @@ test('Emit event', t => {
|
||||
|
||||
client.on(events.REQUEST, (err, request) => {
|
||||
t.error(err)
|
||||
t.deepEqual(request, { hello: 'world' })
|
||||
t.same(request, { hello: 'world' })
|
||||
})
|
||||
|
||||
client.emit(events.REQUEST, null, { hello: 'world' })
|
||||
|
||||
@ -24,8 +24,8 @@ const { join } = require('path')
|
||||
const split = require('split2')
|
||||
const FakeTimers = require('@sinonjs/fake-timers')
|
||||
const { test } = require('tap')
|
||||
const { Client, errors } = require('../../../')
|
||||
const { buildServer, connection } = require('../../utils')
|
||||
const { errors } = require('../../../')
|
||||
const { Client, buildServer, connection } = require('../../utils')
|
||||
let clientVersion = require('../../../package.json').version
|
||||
if (clientVersion.includes('-')) {
|
||||
clientVersion = clientVersion.slice(0, clientVersion.indexOf('-')) + 'p'
|
||||
@ -44,14 +44,14 @@ test('bulk index', t => {
|
||||
let count = 0
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.equal(params.path, '/_bulk')
|
||||
t.match(params.headers, {
|
||||
'content-type': 'application/x-ndjson',
|
||||
'x-elastic-client-meta': `es=${clientVersion},js=${nodeVersion},t=${clientVersion},hc=${nodeVersion},h=bp`
|
||||
})
|
||||
const [action, payload] = params.body.split('\n')
|
||||
t.deepEqual(JSON.parse(action), { index: { _index: 'test' } })
|
||||
t.deepEqual(JSON.parse(payload), dataset[count++])
|
||||
t.same(JSON.parse(action), { index: { _index: 'test' } })
|
||||
t.same(JSON.parse(payload), dataset[count++])
|
||||
return { body: { errors: false, items: [{}] } }
|
||||
}
|
||||
})
|
||||
@ -89,14 +89,14 @@ test('bulk index', t => {
|
||||
let count = 0
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.equal(params.path, '/_bulk')
|
||||
t.match(params.headers, { 'content-type': 'application/x-ndjson' })
|
||||
t.notMatch(params.headers, {
|
||||
'x-elastic-client-meta': `es=${clientVersion},js=${nodeVersion},t=${clientVersion},hc=${nodeVersion},h=bp`
|
||||
})
|
||||
const [action, payload] = params.body.split('\n')
|
||||
t.deepEqual(JSON.parse(action), { index: { _index: 'test' } })
|
||||
t.deepEqual(JSON.parse(payload), dataset[count++])
|
||||
t.same(JSON.parse(action), { index: { _index: 'test' } })
|
||||
t.same(JSON.parse(payload), dataset[count++])
|
||||
return { body: { errors: false, items: [{}] } }
|
||||
}
|
||||
})
|
||||
@ -134,9 +134,9 @@ test('bulk index', t => {
|
||||
t.test('Should perform a bulk request (high flush size)', async t => {
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.equal(params.path, '/_bulk')
|
||||
t.match(params.headers, { 'content-type': 'application/x-ndjson' })
|
||||
t.strictEqual(params.body.split('\n').filter(Boolean).length, 6)
|
||||
t.equal(params.body.split('\n').filter(Boolean).length, 6)
|
||||
return { body: { errors: false, items: new Array(3).fill({}) } }
|
||||
}
|
||||
})
|
||||
@ -175,14 +175,14 @@ test('bulk index', t => {
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
if (params.method === 'GET') {
|
||||
t.strictEqual(params.path, '/_all/_refresh')
|
||||
t.equal(params.path, '/_all/_refresh')
|
||||
return { body: { acknowledged: true } }
|
||||
} else {
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.equal(params.path, '/_bulk')
|
||||
t.match(params.headers, { 'content-type': 'application/x-ndjson' })
|
||||
const [action, payload] = params.body.split('\n')
|
||||
t.deepEqual(JSON.parse(action), { index: { _index: 'test' } })
|
||||
t.deepEqual(JSON.parse(payload), dataset[count++])
|
||||
t.same(JSON.parse(action), { index: { _index: 'test' } })
|
||||
t.same(JSON.parse(payload), dataset[count++])
|
||||
return { body: { errors: false, items: [{}] } }
|
||||
}
|
||||
}
|
||||
@ -220,14 +220,14 @@ test('bulk index', t => {
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
if (params.method === 'GET') {
|
||||
t.strictEqual(params.path, '/test/_refresh')
|
||||
t.equal(params.path, '/test/_refresh')
|
||||
return { body: { acknowledged: true } }
|
||||
} else {
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.equal(params.path, '/_bulk')
|
||||
t.match(params.headers, { 'content-type': 'application/x-ndjson' })
|
||||
const [action, payload] = params.body.split('\n')
|
||||
t.deepEqual(JSON.parse(action), { index: { _index: 'test' } })
|
||||
t.deepEqual(JSON.parse(payload), dataset[count++])
|
||||
t.same(JSON.parse(action), { index: { _index: 'test' } })
|
||||
t.same(JSON.parse(payload), dataset[count++])
|
||||
return { body: { errors: false, items: [{}] } }
|
||||
}
|
||||
}
|
||||
@ -264,11 +264,11 @@ test('bulk index', t => {
|
||||
let count = 0
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.equal(params.path, '/_bulk')
|
||||
t.match(params.headers, { 'content-type': 'application/x-ndjson' })
|
||||
const [action, payload] = params.body.split('\n')
|
||||
t.deepEqual(JSON.parse(action), { index: { _index: 'test', _id: count } })
|
||||
t.deepEqual(JSON.parse(payload), dataset[count++])
|
||||
t.same(JSON.parse(action), { index: { _index: 'test', _id: count } })
|
||||
t.same(JSON.parse(payload), dataset[count++])
|
||||
return { body: { errors: false, items: [{}] } }
|
||||
}
|
||||
})
|
||||
@ -308,7 +308,7 @@ test('bulk index', t => {
|
||||
|
||||
t.test('Should perform a bulk request (retry)', async t => {
|
||||
async function handler (req, res) {
|
||||
t.strictEqual(req.url, '/_bulk')
|
||||
t.equal(req.url, '/_bulk')
|
||||
t.match(req.headers, { 'content-type': 'application/x-ndjson' })
|
||||
|
||||
let body = ''
|
||||
@ -353,7 +353,7 @@ test('bulk index', t => {
|
||||
}
|
||||
},
|
||||
onDrop (doc) {
|
||||
t.deepEqual(doc, {
|
||||
t.same(doc, {
|
||||
status: 429,
|
||||
error: null,
|
||||
operation: { index: { _index: 'test' } },
|
||||
@ -402,7 +402,7 @@ test('bulk index', t => {
|
||||
}
|
||||
},
|
||||
onDrop (doc) {
|
||||
t.deepEqual(doc, {
|
||||
t.same(doc, {
|
||||
status: 429,
|
||||
error: null,
|
||||
operation: { index: { _index: 'test' } },
|
||||
@ -426,7 +426,7 @@ test('bulk index', t => {
|
||||
|
||||
t.test('Should perform a bulk request (failure)', async t => {
|
||||
async function handler (req, res) {
|
||||
t.strictEqual(req.url, '/_bulk')
|
||||
t.equal(req.url, '/_bulk')
|
||||
t.match(req.headers, { 'content-type': 'application/x-ndjson' })
|
||||
|
||||
let body = ''
|
||||
@ -471,7 +471,7 @@ test('bulk index', t => {
|
||||
}
|
||||
},
|
||||
onDrop (doc) {
|
||||
t.deepEqual(doc, {
|
||||
t.same(doc, {
|
||||
status: 400,
|
||||
error: { something: 'went wrong' },
|
||||
operation: { index: { _index: 'test' } },
|
||||
@ -525,7 +525,7 @@ test('bulk index', t => {
|
||||
await b
|
||||
t.fail('Should throw')
|
||||
} catch (err) {
|
||||
t.true(err instanceof errors.ResponseError)
|
||||
t.ok(err instanceof errors.ResponseError)
|
||||
}
|
||||
})
|
||||
|
||||
@ -561,13 +561,13 @@ test('bulk index', t => {
|
||||
await b
|
||||
t.fail('Should throw')
|
||||
} catch (err) {
|
||||
t.true(err instanceof errors.ResponseError)
|
||||
t.ok(err instanceof errors.ResponseError)
|
||||
}
|
||||
})
|
||||
|
||||
t.test('Should abort a bulk request', async t => {
|
||||
async function handler (req, res) {
|
||||
t.strictEqual(req.url, '/_bulk')
|
||||
t.equal(req.url, '/_bulk')
|
||||
t.match(req.headers, { 'content-type': 'application/x-ndjson' })
|
||||
|
||||
let body = ''
|
||||
@ -653,8 +653,8 @@ test('bulk index', t => {
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
t.true(err instanceof errors.ConfigurationError)
|
||||
t.is(err.message, 'Bulk helper invalid action: \'foo\'')
|
||||
t.ok(err instanceof errors.ConfigurationError)
|
||||
t.equal(err.message, 'Bulk helper invalid action: \'foo\'')
|
||||
})
|
||||
})
|
||||
|
||||
@ -666,11 +666,11 @@ test('bulk index', t => {
|
||||
let count = 0
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.equal(params.path, '/_bulk')
|
||||
t.match(params.headers, { 'content-type': 'application/x-ndjson' })
|
||||
const [action, payload] = params.body.split('\n')
|
||||
t.deepEqual(JSON.parse(action), { index: { _index: 'test', _id: count } })
|
||||
t.deepEqual(JSON.parse(payload), dataset[count++])
|
||||
t.same(JSON.parse(action), { index: { _index: 'test', _id: count } })
|
||||
t.same(JSON.parse(payload), dataset[count++])
|
||||
return { body: { errors: false, items: [{}] } }
|
||||
}
|
||||
})
|
||||
@ -718,11 +718,11 @@ test('bulk index', t => {
|
||||
let count = 0
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.equal(params.path, '/_bulk')
|
||||
t.match(params.headers, { 'content-type': 'application/x-ndjson' })
|
||||
const [action, payload] = params.body.split('\n')
|
||||
t.deepEqual(JSON.parse(action), { index: { _index: 'test' } })
|
||||
t.deepEqual(JSON.parse(payload), dataset[count++])
|
||||
t.same(JSON.parse(action), { index: { _index: 'test' } })
|
||||
t.same(JSON.parse(payload), dataset[count++])
|
||||
return { body: { errors: false, items: [{}] } }
|
||||
}
|
||||
})
|
||||
@ -774,11 +774,11 @@ test('bulk create', t => {
|
||||
let count = 0
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.equal(params.path, '/_bulk')
|
||||
t.match(params.headers, { 'content-type': 'application/x-ndjson' })
|
||||
const [action, payload] = params.body.split('\n')
|
||||
t.deepEqual(JSON.parse(action), { create: { _index: 'test', _id: count } })
|
||||
t.deepEqual(JSON.parse(payload), dataset[count++])
|
||||
t.same(JSON.parse(action), { create: { _index: 'test', _id: count } })
|
||||
t.same(JSON.parse(payload), dataset[count++])
|
||||
return { body: { errors: false, items: [{}] } }
|
||||
}
|
||||
})
|
||||
@ -823,11 +823,11 @@ test('bulk update', t => {
|
||||
let count = 0
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.equal(params.path, '/_bulk')
|
||||
t.match(params.headers, { 'content-type': 'application/x-ndjson' })
|
||||
const [action, payload] = params.body.split('\n')
|
||||
t.deepEqual(JSON.parse(action), { update: { _index: 'test', _id: count } })
|
||||
t.deepEqual(JSON.parse(payload), { doc: dataset[count++], doc_as_upsert: true })
|
||||
t.same(JSON.parse(action), { update: { _index: 'test', _id: count } })
|
||||
t.same(JSON.parse(payload), { doc: dataset[count++], doc_as_upsert: true })
|
||||
return { body: { errors: false, items: [{}] } }
|
||||
}
|
||||
})
|
||||
@ -871,11 +871,11 @@ test('bulk update', t => {
|
||||
let count = 0
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.equal(params.path, '/_bulk')
|
||||
t.match(params.headers, { 'content-type': 'application/x-ndjson' })
|
||||
const [action, payload] = params.body.split('\n')
|
||||
t.deepEqual(JSON.parse(action), { update: { _index: 'test', _id: count } })
|
||||
t.deepEqual(JSON.parse(payload), { doc: dataset[count++] })
|
||||
t.same(JSON.parse(action), { update: { _index: 'test', _id: count } })
|
||||
t.same(JSON.parse(payload), { doc: dataset[count++] })
|
||||
return { body: { errors: false, items: [{}] } }
|
||||
}
|
||||
})
|
||||
@ -913,6 +913,55 @@ test('bulk update', t => {
|
||||
})
|
||||
})
|
||||
|
||||
t.test('Should track the number of noop results', async t => {
|
||||
let count = 0
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.match(params.headers, { 'content-type': 'application/x-ndjson' })
|
||||
const [action, payload] = params.body.split('\n')
|
||||
t.deepEqual(JSON.parse(action), { update: { _index: 'test', _id: count } })
|
||||
t.deepEqual(JSON.parse(payload), { doc: dataset[count++], doc_as_upsert: true })
|
||||
return { body: { errors: false, items: [{ update: { result: 'noop' } }] } }
|
||||
}
|
||||
})
|
||||
|
||||
const client = new Client({
|
||||
node: 'http://localhost:9200',
|
||||
Connection: MockConnection
|
||||
})
|
||||
let id = 0
|
||||
const result = await client.helpers.bulk({
|
||||
datasource: dataset.slice(),
|
||||
flushBytes: 1,
|
||||
concurrency: 1,
|
||||
onDocument (doc) {
|
||||
return [{
|
||||
update: {
|
||||
_index: 'test',
|
||||
_id: id++
|
||||
}
|
||||
}, {
|
||||
doc_as_upsert: true
|
||||
}]
|
||||
},
|
||||
onDrop (doc) {
|
||||
t.fail('This should never be called')
|
||||
}
|
||||
})
|
||||
|
||||
t.type(result.time, 'number')
|
||||
t.type(result.bytes, 'number')
|
||||
t.match(result, {
|
||||
total: 3,
|
||||
successful: 3,
|
||||
noop: 3,
|
||||
retry: 0,
|
||||
failed: 0,
|
||||
aborted: false
|
||||
})
|
||||
})
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -921,9 +970,9 @@ test('bulk delete', t => {
|
||||
let count = 0
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.equal(params.path, '/_bulk')
|
||||
t.match(params.headers, { 'content-type': 'application/x-ndjson' })
|
||||
t.deepEqual(JSON.parse(params.body), { delete: { _index: 'test', _id: count++ } })
|
||||
t.same(JSON.parse(params.body), { delete: { _index: 'test', _id: count++ } })
|
||||
return { body: { errors: false, items: [{}] } }
|
||||
}
|
||||
})
|
||||
@ -963,7 +1012,7 @@ test('bulk delete', t => {
|
||||
|
||||
t.test('Should perform a bulk request (failure)', async t => {
|
||||
async function handler (req, res) {
|
||||
t.strictEqual(req.url, '/_bulk')
|
||||
t.equal(req.url, '/_bulk')
|
||||
t.match(req.headers, { 'content-type': 'application/x-ndjson' })
|
||||
|
||||
let body = ''
|
||||
@ -1011,7 +1060,7 @@ test('bulk delete', t => {
|
||||
}
|
||||
},
|
||||
onDrop (doc) {
|
||||
t.deepEqual(doc, {
|
||||
t.same(doc, {
|
||||
status: 400,
|
||||
error: { something: 'went wrong' },
|
||||
operation: { delete: { _index: 'test', _id: 1 } },
|
||||
@ -1051,7 +1100,7 @@ test('transport options', t => {
|
||||
return { body: { errors: false, items: [{}] } }
|
||||
}
|
||||
|
||||
t.strictEqual(params.path, '/_all/_refresh')
|
||||
t.equal(params.path, '/_all/_refresh')
|
||||
t.match(params.headers, {
|
||||
foo: 'bar'
|
||||
})
|
||||
@ -1081,7 +1130,7 @@ test('transport options', t => {
|
||||
}
|
||||
})
|
||||
|
||||
t.strictEqual(count, 4) // three bulk requests, one refresh
|
||||
t.equal(count, 4) // three bulk requests, one refresh
|
||||
t.type(result.time, 'number')
|
||||
t.type(result.bytes, 'number')
|
||||
t.match(result, {
|
||||
@ -1111,8 +1160,8 @@ test('errors', t => {
|
||||
}
|
||||
})
|
||||
} catch (err) {
|
||||
t.true(err instanceof errors.ConfigurationError)
|
||||
t.is(err.message, 'bulk helper: the datasource must be an array or a buffer or a readable stream or an async generator')
|
||||
t.ok(err instanceof errors.ConfigurationError)
|
||||
t.equal(err.message, 'bulk helper: the datasource must be an array or a buffer or a readable stream or an async generator')
|
||||
}
|
||||
})
|
||||
|
||||
@ -1129,8 +1178,8 @@ test('errors', t => {
|
||||
}
|
||||
})
|
||||
} catch (err) {
|
||||
t.true(err instanceof errors.ConfigurationError)
|
||||
t.is(err.message, 'bulk helper: the datasource is required')
|
||||
t.ok(err instanceof errors.ConfigurationError)
|
||||
t.equal(err.message, 'bulk helper: the datasource is required')
|
||||
}
|
||||
})
|
||||
|
||||
@ -1143,8 +1192,8 @@ test('errors', t => {
|
||||
datasource: dataset.slice()
|
||||
})
|
||||
} catch (err) {
|
||||
t.true(err instanceof errors.ConfigurationError)
|
||||
t.is(err.message, 'bulk helper: the onDocument callback is required')
|
||||
t.ok(err instanceof errors.ConfigurationError)
|
||||
t.equal(err.message, 'bulk helper: the onDocument callback is required')
|
||||
}
|
||||
})
|
||||
|
||||
@ -1159,11 +1208,11 @@ test('Flush interval', t => {
|
||||
let count = 0
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.equal(params.path, '/_bulk')
|
||||
t.match(params.headers, { 'content-type': 'application/x-ndjson' })
|
||||
const [action, payload] = params.body.split('\n')
|
||||
t.deepEqual(JSON.parse(action), { index: { _index: 'test' } })
|
||||
t.deepEqual(JSON.parse(payload), dataset[count++])
|
||||
t.same(JSON.parse(action), { index: { _index: 'test' } })
|
||||
t.same(JSON.parse(payload), dataset[count++])
|
||||
return { body: { errors: false, items: [{}] } }
|
||||
}
|
||||
})
|
||||
@ -1210,12 +1259,12 @@ test('Flush interval', t => {
|
||||
let count = 0
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.true(count < 2)
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.ok(count < 2)
|
||||
t.equal(params.path, '/_bulk')
|
||||
t.match(params.headers, { 'content-type': 'application/x-ndjson' })
|
||||
const [action, payload] = params.body.split('\n')
|
||||
t.deepEqual(JSON.parse(action), { index: { _index: 'test' } })
|
||||
t.deepEqual(JSON.parse(payload), dataset[count++])
|
||||
t.same(JSON.parse(action), { index: { _index: 'test' } })
|
||||
t.same(JSON.parse(payload), dataset[count++])
|
||||
return { body: { errors: false, items: [{}] } }
|
||||
}
|
||||
})
|
||||
@ -1263,5 +1312,52 @@ test('Flush interval', t => {
|
||||
})
|
||||
})
|
||||
|
||||
t.test('Operation stats', async t => {
|
||||
let count = 0
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.match(params.headers, {
|
||||
'content-type': 'application/x-ndjson',
|
||||
'x-elastic-client-meta': `es=${clientVersion},js=${nodeVersion},t=${clientVersion},hc=${nodeVersion},h=bp`
|
||||
})
|
||||
const [action, payload] = params.body.split('\n')
|
||||
t.deepEqual(JSON.parse(action), { index: { _index: 'test' } })
|
||||
t.deepEqual(JSON.parse(payload), dataset[count++])
|
||||
return { body: { errors: false, items: [{}] } }
|
||||
}
|
||||
})
|
||||
|
||||
const client = new Client({
|
||||
node: 'http://localhost:9200',
|
||||
Connection: MockConnection
|
||||
})
|
||||
const b = client.helpers.bulk({
|
||||
datasource: dataset.slice(),
|
||||
flushBytes: 1,
|
||||
concurrency: 1,
|
||||
onDocument (doc) {
|
||||
return {
|
||||
index: { _index: 'test' }
|
||||
}
|
||||
},
|
||||
onDrop (doc) {
|
||||
t.fail('This should never be called')
|
||||
}
|
||||
})
|
||||
const result = await b
|
||||
|
||||
t.type(result.time, 'number')
|
||||
t.type(result.bytes, 'number')
|
||||
t.match(result, b.stats)
|
||||
t.match(result, {
|
||||
total: 3,
|
||||
successful: 3,
|
||||
retry: 0,
|
||||
failed: 0,
|
||||
aborted: false
|
||||
})
|
||||
})
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -20,8 +20,8 @@
|
||||
'use strict'
|
||||
|
||||
const { test } = require('tap')
|
||||
const { Client, errors } = require('../../../')
|
||||
const { connection } = require('../../utils')
|
||||
const { errors } = require('../../../')
|
||||
const { Client, connection } = require('../../utils')
|
||||
const FakeTimers = require('@sinonjs/fake-timers')
|
||||
|
||||
test('Basic', async t => {
|
||||
@ -56,7 +56,7 @@ test('Basic', async t => {
|
||||
{ query: { match: { foo: 'bar' } } }
|
||||
)
|
||||
|
||||
t.deepEqual(result.body, {
|
||||
t.same(result.body, {
|
||||
status: 200,
|
||||
hits: {
|
||||
hits: [
|
||||
@ -67,7 +67,7 @@ test('Basic', async t => {
|
||||
}
|
||||
})
|
||||
|
||||
t.deepEqual(result.documents, [
|
||||
t.same(result.documents, [
|
||||
{ one: 'one' },
|
||||
{ two: 'two' },
|
||||
{ three: 'three' }
|
||||
@ -116,7 +116,7 @@ test('Multiple searches (inside async iterator)', t => {
|
||||
|
||||
m.search({ index: 'test' }, { query: { match: { foo: 'bar' } } }, (err, result) => {
|
||||
t.error(err)
|
||||
t.deepEqual(result.body, {
|
||||
t.same(result.body, {
|
||||
status: 200,
|
||||
hits: {
|
||||
hits: [
|
||||
@ -127,7 +127,7 @@ test('Multiple searches (inside async iterator)', t => {
|
||||
}
|
||||
})
|
||||
|
||||
t.deepEqual(result.documents, [
|
||||
t.same(result.documents, [
|
||||
{ one: 'one' },
|
||||
{ two: 'two' },
|
||||
{ three: 'three' }
|
||||
@ -136,7 +136,7 @@ test('Multiple searches (inside async iterator)', t => {
|
||||
|
||||
m.search({ index: 'test' }, { query: { match: { foo: 'bar' } } }, (err, result) => {
|
||||
t.error(err)
|
||||
t.deepEqual(result.body, {
|
||||
t.same(result.body, {
|
||||
status: 200,
|
||||
hits: {
|
||||
hits: [
|
||||
@ -147,7 +147,7 @@ test('Multiple searches (inside async iterator)', t => {
|
||||
}
|
||||
})
|
||||
|
||||
t.deepEqual(result.documents, [
|
||||
t.same(result.documents, [
|
||||
{ four: 'four' },
|
||||
{ five: 'five' },
|
||||
{ six: 'six' }
|
||||
@ -197,7 +197,7 @@ test('Multiple searches (async iterator exits)', t => {
|
||||
|
||||
m.search({ index: 'test' }, { query: {} }, (err, result) => {
|
||||
t.error(err)
|
||||
t.deepEqual(result.body, {
|
||||
t.same(result.body, {
|
||||
status: 200,
|
||||
hits: {
|
||||
hits: [
|
||||
@ -208,7 +208,7 @@ test('Multiple searches (async iterator exits)', t => {
|
||||
}
|
||||
})
|
||||
|
||||
t.deepEqual(result.documents, [
|
||||
t.same(result.documents, [
|
||||
{ one: 'one' },
|
||||
{ two: 'two' },
|
||||
{ three: 'three' }
|
||||
@ -217,7 +217,7 @@ test('Multiple searches (async iterator exits)', t => {
|
||||
|
||||
m.search({ index: 'test' }, { query: { match: { foo: 'bar' } } }, (err, result) => {
|
||||
t.error(err)
|
||||
t.deepEqual(result.body, {
|
||||
t.same(result.body, {
|
||||
status: 200,
|
||||
hits: {
|
||||
hits: [
|
||||
@ -228,7 +228,7 @@ test('Multiple searches (async iterator exits)', t => {
|
||||
}
|
||||
})
|
||||
|
||||
t.deepEqual(result.documents, [
|
||||
t.same(result.documents, [
|
||||
{ four: 'four' },
|
||||
{ five: 'five' },
|
||||
{ six: 'six' }
|
||||
@ -260,7 +260,7 @@ test('Stop a msearch processor (promises)', async t => {
|
||||
{ query: { match: { foo: 'bar' } } }
|
||||
)
|
||||
} catch (err) {
|
||||
t.strictEqual(err.message, 'The msearch processor has been stopped')
|
||||
t.equal(err.message, 'The msearch processor has been stopped')
|
||||
}
|
||||
|
||||
t.teardown(() => m.stop())
|
||||
@ -285,7 +285,7 @@ test('Stop a msearch processor (callbacks)', t => {
|
||||
m.stop()
|
||||
|
||||
m.search({ index: 'test' }, { query: { match: { foo: 'bar' } } }, (err, result) => {
|
||||
t.strictEqual(err.message, 'The msearch processor has been stopped')
|
||||
t.equal(err.message, 'The msearch processor has been stopped')
|
||||
})
|
||||
})
|
||||
|
||||
@ -306,12 +306,12 @@ test('Bad header', t => {
|
||||
const m = client.helpers.msearch()
|
||||
|
||||
m.search(null, { query: { match: { foo: 'bar' } } }, (err, result) => {
|
||||
t.strictEqual(err.message, 'The header should be an object')
|
||||
t.equal(err.message, 'The header should be an object')
|
||||
})
|
||||
|
||||
m.search(null, { query: { match: { foo: 'bar' } } })
|
||||
.catch(err => {
|
||||
t.strictEqual(err.message, 'The header should be an object')
|
||||
t.equal(err.message, 'The header should be an object')
|
||||
})
|
||||
|
||||
t.teardown(() => m.stop())
|
||||
@ -334,12 +334,12 @@ test('Bad body', t => {
|
||||
const m = client.helpers.msearch()
|
||||
|
||||
m.search({ index: 'test' }, null, (err, result) => {
|
||||
t.strictEqual(err.message, 'The body should be an object')
|
||||
t.equal(err.message, 'The body should be an object')
|
||||
})
|
||||
|
||||
m.search({ index: 'test' }, null)
|
||||
.catch(err => {
|
||||
t.strictEqual(err.message, 'The body should be an object')
|
||||
t.equal(err.message, 'The body should be an object')
|
||||
})
|
||||
|
||||
t.teardown(() => m.stop())
|
||||
@ -389,7 +389,7 @@ test('Retry on 429', async t => {
|
||||
{ query: { match: { foo: 'bar' } } }
|
||||
)
|
||||
|
||||
t.deepEqual(result.body, {
|
||||
t.same(result.body, {
|
||||
status: 200,
|
||||
hits: {
|
||||
hits: [
|
||||
@ -400,7 +400,7 @@ test('Retry on 429', async t => {
|
||||
}
|
||||
})
|
||||
|
||||
t.deepEqual(result.documents, [
|
||||
t.same(result.documents, [
|
||||
{ one: 'one' },
|
||||
{ two: 'two' },
|
||||
{ three: 'three' }
|
||||
@ -436,7 +436,7 @@ test('Single search errors', async t => {
|
||||
{ query: { match: { foo: 'bar' } } }
|
||||
)
|
||||
} catch (err) {
|
||||
t.true(err instanceof errors.ResponseError)
|
||||
t.ok(err instanceof errors.ResponseError)
|
||||
}
|
||||
|
||||
t.teardown(() => m.stop())
|
||||
@ -465,13 +465,13 @@ test('Entire msearch fails', t => {
|
||||
const m = client.helpers.msearch({ operations: 1 })
|
||||
|
||||
m.search({ index: 'test' }, { query: {} }, (err, result) => {
|
||||
t.true(err instanceof errors.ResponseError)
|
||||
t.deepEqual(result.documents, [])
|
||||
t.ok(err instanceof errors.ResponseError)
|
||||
t.same(result.documents, [])
|
||||
})
|
||||
|
||||
m.search({ index: 'test' }, { query: {} }, (err, result) => {
|
||||
t.true(err instanceof errors.ResponseError)
|
||||
t.deepEqual(result.documents, [])
|
||||
t.ok(err instanceof errors.ResponseError)
|
||||
t.same(result.documents, [])
|
||||
})
|
||||
|
||||
t.teardown(() => m.stop())
|
||||
@ -523,13 +523,13 @@ test('Stop the msearch helper with an error', t => {
|
||||
|
||||
m.then(
|
||||
() => t.fail('Should fail'),
|
||||
err => t.is(err.message, 'kaboom')
|
||||
err => t.equal(err.message, 'kaboom')
|
||||
)
|
||||
|
||||
m.catch(err => t.is(err.message, 'kaboom'))
|
||||
m.catch(err => t.equal(err.message, 'kaboom'))
|
||||
|
||||
m.search({ index: 'test' }, { query: {} }, (err, result) => {
|
||||
t.is(err.message, 'kaboom')
|
||||
t.equal(err.message, 'kaboom')
|
||||
})
|
||||
})
|
||||
|
||||
@ -564,7 +564,7 @@ test('Multiple searches (concurrency = 1)', t => {
|
||||
|
||||
m.search({ index: 'test' }, { query: {} }, (err, result) => {
|
||||
t.error(err)
|
||||
t.deepEqual(result.body, {
|
||||
t.same(result.body, {
|
||||
status: 200,
|
||||
hits: {
|
||||
hits: [
|
||||
@ -575,7 +575,7 @@ test('Multiple searches (concurrency = 1)', t => {
|
||||
}
|
||||
})
|
||||
|
||||
t.deepEqual(result.documents, [
|
||||
t.same(result.documents, [
|
||||
{ one: 'one' },
|
||||
{ two: 'two' },
|
||||
{ three: 'three' }
|
||||
@ -584,7 +584,7 @@ test('Multiple searches (concurrency = 1)', t => {
|
||||
|
||||
m.search({ index: 'test' }, { query: {} }, (err, result) => {
|
||||
t.error(err)
|
||||
t.deepEqual(result.body, {
|
||||
t.same(result.body, {
|
||||
status: 200,
|
||||
hits: {
|
||||
hits: [
|
||||
@ -595,7 +595,7 @@ test('Multiple searches (concurrency = 1)', t => {
|
||||
}
|
||||
})
|
||||
|
||||
t.deepEqual(result.documents, [
|
||||
t.same(result.documents, [
|
||||
{ one: 'one' },
|
||||
{ two: 'two' },
|
||||
{ three: 'three' }
|
||||
@ -647,12 +647,12 @@ test('Flush interval', t => {
|
||||
|
||||
m.search({ index: 'test' }, { query: { match: { foo: 'bar' } } }, (err, result) => {
|
||||
t.error(err)
|
||||
t.is(result.documents.length, 3)
|
||||
t.equal(result.documents.length, 3)
|
||||
})
|
||||
|
||||
m.search({ index: 'test' }, { query: { match: { foo: 'bar' } } }, (err, result) => {
|
||||
t.error(err)
|
||||
t.is(result.documents.length, 3)
|
||||
t.equal(result.documents.length, 3)
|
||||
})
|
||||
|
||||
setImmediate(clock.next)
|
||||
@ -691,7 +691,7 @@ test('Flush interval - early stop', t => {
|
||||
|
||||
m.search({ index: 'test' }, { query: { match: { foo: 'bar' } } }, (err, result) => {
|
||||
t.error(err)
|
||||
t.is(result.documents.length, 3)
|
||||
t.equal(result.documents.length, 3)
|
||||
})
|
||||
|
||||
setImmediate(() => {
|
||||
@ -750,11 +750,11 @@ test('Stop should resolve the helper (error)', t => {
|
||||
setImmediate(m.stop, new Error('kaboom'))
|
||||
|
||||
m.then(() => t.fail('Should not fail'))
|
||||
.catch(err => t.is(err.message, 'kaboom'))
|
||||
.catch(err => t.equal(err.message, 'kaboom'))
|
||||
|
||||
m.catch(err => t.is(err.message, 'kaboom'))
|
||||
m.catch(err => t.equal(err.message, 'kaboom'))
|
||||
|
||||
m.then(() => t.fail('Should not fail'), err => t.is(err.message, 'kaboom'))
|
||||
m.then(() => t.fail('Should not fail'), err => t.equal(err.message, 'kaboom'))
|
||||
})
|
||||
|
||||
test('Should use req options', async t => {
|
||||
|
||||
@ -20,8 +20,8 @@
|
||||
'use strict'
|
||||
|
||||
const { test } = require('tap')
|
||||
const { Client, errors } = require('../../../')
|
||||
const { connection } = require('../../utils')
|
||||
const { errors } = require('../../../')
|
||||
const { Client, connection } = require('../../utils')
|
||||
let clientVersion = require('../../../package.json').version
|
||||
if (clientVersion.includes('-')) {
|
||||
clientVersion = clientVersion.slice(0, clientVersion.indexOf('-')) + 'p'
|
||||
@ -38,11 +38,11 @@ test('Scroll search', async t => {
|
||||
|
||||
count += 1
|
||||
if (params.method === 'POST') {
|
||||
t.strictEqual(params.querystring, 'scroll=1m')
|
||||
t.equal(params.querystring, 'scroll=1m')
|
||||
}
|
||||
if (count === 4) {
|
||||
// final automated clear
|
||||
t.strictEqual(params.method, 'DELETE')
|
||||
t.equal(params.method, 'DELETE')
|
||||
}
|
||||
return {
|
||||
body: {
|
||||
@ -73,8 +73,8 @@ test('Scroll search', async t => {
|
||||
})
|
||||
|
||||
for await (const result of scrollSearch) {
|
||||
t.strictEqual(result.body.count, count)
|
||||
t.strictEqual(result.body._scroll_id, 'id')
|
||||
t.equal(result.body.count, count)
|
||||
t.equal(result.body._scroll_id, 'id')
|
||||
}
|
||||
})
|
||||
|
||||
@ -87,7 +87,7 @@ test('Clear a scroll search', async t => {
|
||||
})
|
||||
if (params.method === 'DELETE') {
|
||||
const body = JSON.parse(params.body)
|
||||
t.strictEqual(body.scroll_id, 'id')
|
||||
t.equal(body.scroll_id, 'id')
|
||||
}
|
||||
return {
|
||||
body: {
|
||||
@ -120,7 +120,7 @@ test('Clear a scroll search', async t => {
|
||||
if (count === 2) {
|
||||
t.fail('The scroll search should be cleared')
|
||||
}
|
||||
t.strictEqual(result.body.count, count)
|
||||
t.equal(result.body.count, count)
|
||||
if (count === 1) {
|
||||
await result.clear()
|
||||
}
|
||||
@ -138,7 +138,7 @@ test('Scroll search (retry)', async t => {
|
||||
}
|
||||
if (count === 5) {
|
||||
// final automated clear
|
||||
t.strictEqual(params.method, 'DELETE')
|
||||
t.equal(params.method, 'DELETE')
|
||||
}
|
||||
return {
|
||||
statusCode: 200,
|
||||
@ -172,9 +172,9 @@ test('Scroll search (retry)', async t => {
|
||||
})
|
||||
|
||||
for await (const result of scrollSearch) {
|
||||
t.strictEqual(result.body.count, count)
|
||||
t.notStrictEqual(result.body.count, 1)
|
||||
t.strictEqual(result.body._scroll_id, 'id')
|
||||
t.equal(result.body.count, count)
|
||||
t.not(result.body.count, 1)
|
||||
t.equal(result.body._scroll_id, 'id')
|
||||
}
|
||||
})
|
||||
|
||||
@ -208,9 +208,9 @@ test('Scroll search (retry throws and maxRetries)', async t => {
|
||||
t.fail('we should not be here')
|
||||
}
|
||||
} catch (err) {
|
||||
t.true(err instanceof errors.ResponseError)
|
||||
t.strictEqual(err.statusCode, 429)
|
||||
t.strictEqual(count, expectedAttempts)
|
||||
t.ok(err instanceof errors.ResponseError)
|
||||
t.equal(err.statusCode, 429)
|
||||
t.equal(count, expectedAttempts)
|
||||
}
|
||||
})
|
||||
|
||||
@ -222,7 +222,7 @@ test('Scroll search (retry throws later)', async t => {
|
||||
onRequest (params) {
|
||||
count += 1
|
||||
// filter_path should not be added if is not already present
|
||||
t.strictEqual(params.querystring, 'scroll=1m')
|
||||
t.equal(params.querystring, 'scroll=1m')
|
||||
if (count > 1) {
|
||||
return { body: {}, statusCode: 429 }
|
||||
}
|
||||
@ -258,12 +258,12 @@ test('Scroll search (retry throws later)', async t => {
|
||||
|
||||
try {
|
||||
for await (const result of scrollSearch) { // eslint-disable-line
|
||||
t.strictEqual(result.body.count, count)
|
||||
t.equal(result.body.count, count)
|
||||
}
|
||||
} catch (err) {
|
||||
t.true(err instanceof errors.ResponseError)
|
||||
t.strictEqual(err.statusCode, 429)
|
||||
t.strictEqual(count, expectedAttempts)
|
||||
t.ok(err instanceof errors.ResponseError)
|
||||
t.equal(err.statusCode, 429)
|
||||
t.equal(count, expectedAttempts)
|
||||
}
|
||||
})
|
||||
|
||||
@ -272,11 +272,11 @@ test('Scroll search documents', async t => {
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
if (count === 0) {
|
||||
t.strictEqual(params.querystring, 'filter_path=hits.hits._source%2C_scroll_id&scroll=1m')
|
||||
t.equal(params.querystring, 'filter_path=hits.hits._source%2C_scroll_id&scroll=1m')
|
||||
} else {
|
||||
if (params.method !== 'DELETE') {
|
||||
t.strictEqual(params.querystring, 'scroll=1m')
|
||||
t.strictEqual(params.body, '{"scroll_id":"id"}')
|
||||
t.equal(params.querystring, 'scroll=1m')
|
||||
t.equal(params.body, '{"scroll_id":"id"}')
|
||||
}
|
||||
}
|
||||
return {
|
||||
@ -309,7 +309,7 @@ test('Scroll search documents', async t => {
|
||||
|
||||
let n = 1
|
||||
for await (const hit of scrollSearch) {
|
||||
t.deepEqual(hit, { val: n * count })
|
||||
t.same(hit, { val: n * count })
|
||||
n += 1
|
||||
if (n === 4) {
|
||||
count += 1
|
||||
@ -348,9 +348,9 @@ test('Should not retry if maxRetries = 0', async t => {
|
||||
t.fail('we should not be here')
|
||||
}
|
||||
} catch (err) {
|
||||
t.true(err instanceof errors.ResponseError)
|
||||
t.strictEqual(err.statusCode, 429)
|
||||
t.strictEqual(count, expectedAttempts)
|
||||
t.ok(err instanceof errors.ResponseError)
|
||||
t.equal(err.statusCode, 429)
|
||||
t.equal(count, expectedAttempts)
|
||||
}
|
||||
})
|
||||
|
||||
@ -359,10 +359,10 @@ test('Fix querystring for scroll search', async t => {
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
if (count === 0) {
|
||||
t.strictEqual(params.querystring, 'size=1&scroll=1m')
|
||||
t.equal(params.querystring, 'size=1&scroll=1m')
|
||||
} else {
|
||||
if (params.method !== 'DELETE') {
|
||||
t.strictEqual(params.querystring, 'scroll=1m')
|
||||
t.equal(params.querystring, 'scroll=1m')
|
||||
}
|
||||
}
|
||||
return {
|
||||
@ -392,7 +392,7 @@ test('Fix querystring for scroll search', async t => {
|
||||
})
|
||||
|
||||
for await (const response of scrollSearch) {
|
||||
t.strictEqual(response.body.hits.hits.length, 1)
|
||||
t.equal(response.body.hits.hits.length, 1)
|
||||
count += 1
|
||||
}
|
||||
})
|
||||
|
||||
@ -20,13 +20,12 @@
|
||||
'use strict'
|
||||
|
||||
const { test } = require('tap')
|
||||
const { Client } = require('../../../')
|
||||
const { connection } = require('../../utils')
|
||||
const { Client, connection } = require('../../utils')
|
||||
|
||||
test('Search should have an additional documents property', async t => {
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.querystring, 'filter_path=hits.hits._source')
|
||||
t.equal(params.querystring, 'filter_path=hits.hits._source')
|
||||
return {
|
||||
body: {
|
||||
hits: {
|
||||
@ -50,7 +49,7 @@ test('Search should have an additional documents property', async t => {
|
||||
index: 'test',
|
||||
body: { foo: 'bar' }
|
||||
})
|
||||
t.deepEqual(result, [
|
||||
t.same(result, [
|
||||
{ one: 'one' },
|
||||
{ two: 'two' },
|
||||
{ three: 'three' }
|
||||
@ -60,7 +59,7 @@ test('Search should have an additional documents property', async t => {
|
||||
test('kGetHits fallback', async t => {
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.querystring, 'filter_path=hits.hits._source')
|
||||
t.equal(params.querystring, 'filter_path=hits.hits._source')
|
||||
return { body: {} }
|
||||
}
|
||||
})
|
||||
@ -74,13 +73,13 @@ test('kGetHits fallback', async t => {
|
||||
index: 'test',
|
||||
body: { foo: 'bar' }
|
||||
})
|
||||
t.deepEqual(result, [])
|
||||
t.same(result, [])
|
||||
})
|
||||
|
||||
test('Merge filter paths (snake_case)', async t => {
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.querystring, 'filter_path=foo%2Chits.hits._source')
|
||||
t.equal(params.querystring, 'filter_path=foo%2Chits.hits._source')
|
||||
return {
|
||||
body: {
|
||||
hits: {
|
||||
@ -105,7 +104,7 @@ test('Merge filter paths (snake_case)', async t => {
|
||||
filter_path: 'foo',
|
||||
body: { foo: 'bar' }
|
||||
})
|
||||
t.deepEqual(result, [
|
||||
t.same(result, [
|
||||
{ one: 'one' },
|
||||
{ two: 'two' },
|
||||
{ three: 'three' }
|
||||
@ -115,7 +114,7 @@ test('Merge filter paths (snake_case)', async t => {
|
||||
test('Merge filter paths (camelCase)', async t => {
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.querystring, 'filter_path=foo%2Chits.hits._source')
|
||||
t.equal(params.querystring, 'filter_path=foo%2Chits.hits._source')
|
||||
return {
|
||||
body: {
|
||||
hits: {
|
||||
@ -140,7 +139,7 @@ test('Merge filter paths (camelCase)', async t => {
|
||||
filterPath: 'foo',
|
||||
body: { foo: 'bar' }
|
||||
})
|
||||
t.deepEqual(result, [
|
||||
t.same(result, [
|
||||
{ one: 'one' },
|
||||
{ two: 'two' },
|
||||
{ three: 'three' }
|
||||
|
||||
@ -28,7 +28,7 @@ test('RoundRobinSelector', t => {
|
||||
|
||||
t.plan(arr.length + 1)
|
||||
for (let i = 0; i <= arr.length; i++) {
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
selector(arr),
|
||||
i === arr.length ? arr[0] : arr[i]
|
||||
)
|
||||
|
||||
@ -29,8 +29,8 @@ test('Basic', t => {
|
||||
const s = new Serializer()
|
||||
const obj = { hello: 'world' }
|
||||
const json = JSON.stringify(obj)
|
||||
t.strictEqual(s.serialize(obj), json)
|
||||
t.deepEqual(s.deserialize(json), obj)
|
||||
t.equal(s.serialize(obj), json)
|
||||
t.same(s.deserialize(json), obj)
|
||||
})
|
||||
|
||||
test('ndserialize', t => {
|
||||
@ -41,7 +41,7 @@ test('ndserialize', t => {
|
||||
{ winter: 'is coming' },
|
||||
{ you_know: 'for search' }
|
||||
]
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
s.ndserialize(obj),
|
||||
JSON.stringify(obj[0]) + '\n' +
|
||||
JSON.stringify(obj[1]) + '\n' +
|
||||
@ -57,7 +57,7 @@ test('ndserialize (strings)', t => {
|
||||
JSON.stringify({ winter: 'is coming' }),
|
||||
JSON.stringify({ you_know: 'for search' })
|
||||
]
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
s.ndserialize(obj),
|
||||
obj[0] + '\n' +
|
||||
obj[1] + '\n' +
|
||||
@ -73,7 +73,7 @@ test('qserialize', t => {
|
||||
you_know: 'for search'
|
||||
}
|
||||
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
s.qserialize(obj),
|
||||
stringify(obj)
|
||||
)
|
||||
@ -87,7 +87,7 @@ test('qserialize (array)', t => {
|
||||
arr: ['foo', 'bar']
|
||||
}
|
||||
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
s.qserialize(obj),
|
||||
'hello=world&arr=foo%2Cbar'
|
||||
)
|
||||
@ -101,7 +101,7 @@ test('qserialize (string)', t => {
|
||||
you_know: 'for search'
|
||||
}
|
||||
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
s.qserialize(stringify(obj)),
|
||||
stringify(obj)
|
||||
)
|
||||
@ -116,7 +116,7 @@ test('qserialize (key with undefined value)', t => {
|
||||
foo: 'bar'
|
||||
}
|
||||
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
s.qserialize(obj),
|
||||
'hello=world&foo=bar'
|
||||
)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -133,7 +133,7 @@ function buildMockConnection (opts) {
|
||||
|
||||
class MockConnection extends Connection {
|
||||
request (params, callback) {
|
||||
let { body, statusCode } = opts.onRequest(params)
|
||||
let { body, statusCode, headers } = opts.onRequest(params)
|
||||
if (typeof body !== 'string') {
|
||||
body = JSON.stringify(body)
|
||||
}
|
||||
@ -144,7 +144,8 @@ function buildMockConnection (opts) {
|
||||
'content-type': 'application/json;utf=8',
|
||||
date: new Date().toISOString(),
|
||||
connection: 'keep-alive',
|
||||
'content-length': Buffer.byteLength(body)
|
||||
'content-length': Buffer.byteLength(body),
|
||||
...headers
|
||||
}
|
||||
process.nextTick(() => {
|
||||
if (!aborted) {
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
|
||||
'use strict'
|
||||
|
||||
const crypto = require('crypto')
|
||||
const debug = require('debug')('elasticsearch-test')
|
||||
const stoppable = require('stoppable')
|
||||
|
||||
@ -35,6 +36,13 @@ const secureOpts = {
|
||||
cert: readFileSync(join(__dirname, '..', 'fixtures', 'https.cert'), 'utf8')
|
||||
}
|
||||
|
||||
const caFingerprint = getFingerprint(secureOpts.cert
|
||||
.split('\n')
|
||||
.slice(1, -1)
|
||||
.map(line => line.trim())
|
||||
.join('')
|
||||
)
|
||||
|
||||
let id = 0
|
||||
function buildServer (handler, opts, cb) {
|
||||
const serverId = id++
|
||||
@ -58,7 +66,7 @@ function buildServer (handler, opts, cb) {
|
||||
server.listen(0, () => {
|
||||
const port = server.address().port
|
||||
debug(`Server '${serverId}' booted on port ${port}`)
|
||||
resolve([Object.assign({}, secureOpts, { port }), server])
|
||||
resolve([Object.assign({}, secureOpts, { port, caFingerprint }), server])
|
||||
})
|
||||
})
|
||||
} else {
|
||||
@ -70,4 +78,11 @@ function buildServer (handler, opts, cb) {
|
||||
}
|
||||
}
|
||||
|
||||
function getFingerprint (content, inputEncoding = 'base64', outputEncoding = 'hex') {
|
||||
const shasum = crypto.createHash('sha256')
|
||||
shasum.update(content, inputEncoding)
|
||||
const res = shasum.digest(outputEncoding)
|
||||
return res.toUpperCase().match(/.{1,2}/g).join(':')
|
||||
}
|
||||
|
||||
module.exports = buildServer
|
||||
|
||||
@ -25,6 +25,7 @@ const buildServer = require('./buildServer')
|
||||
const buildCluster = require('./buildCluster')
|
||||
const buildProxy = require('./buildProxy')
|
||||
const connection = require('./MockConnection')
|
||||
const { Client } = require('../../')
|
||||
|
||||
async function waitCluster (client, waitForStatus = 'green', timeout = '50s', times = 0) {
|
||||
if (!client) {
|
||||
@ -41,10 +42,25 @@ async function waitCluster (client, waitForStatus = 'green', timeout = '50s', ti
|
||||
}
|
||||
}
|
||||
|
||||
function skipProductCheck (client) {
|
||||
const tSymbol = Object.getOwnPropertySymbols(client.transport || client)
|
||||
.filter(symbol => symbol.description === 'product check')[0]
|
||||
;(client.transport || client)[tSymbol] = 2
|
||||
}
|
||||
|
||||
class NoProductCheckClient extends Client {
|
||||
constructor (opts) {
|
||||
super(opts)
|
||||
skipProductCheck(this)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
buildServer,
|
||||
buildCluster,
|
||||
buildProxy,
|
||||
connection,
|
||||
waitCluster
|
||||
waitCluster,
|
||||
skipProductCheck,
|
||||
Client: NoProductCheckClient
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user