Compare commits

..

53 Commits
v8.1.0 ... 8.5

Author SHA1 Message Date
5f7495fc70 [Backport 8.5] Use correct user-agent header by default (#1872)
Co-authored-by: Josh Mock <josh@joshmock.com>
2023-05-05 11:19:29 -05:00
170a6df61c [8.5] [DOCS] Includes source_branch in docs index 2023-02-22 07:48:54 -06:00
d8fd861931 [8.5] Bump @elastic/transport to 8.3.1
Co-authored-by: Rudolf Meijering <skaapgif@gmail.com>
2023-01-05 10:29:00 -06:00
123c72acb4 Bumps 8.5 to 8.5.2 2022-11-15 06:57:45 -06:00
43d553927c [8.5] Add a changelog for 8.5.0
Co-authored-by: Seth Michael Larson <seth.larson@elastic.co>
2022-11-03 11:42:31 -05:00
bd93eb0c15 Update APIs to 8.5-SNAPSHOT 2022-11-02 21:28:03 -05:00
1088053816 Update APIs for 8.5-SNAPSHOT 2022-10-28 15:57:24 -05:00
ea1cf7e633 Remove broken URLs from auto-generated docs 2022-09-28 11:32:10 -05:00
9fa98b4b5b Remove unnecessary ts-expect-error
Co-authored-by: Seth Michael Larson <seth.larson@elastic.co>
2022-09-27 07:52:23 -05:00
f96e80c575 Fix docs URLs to use '8.5' instead of 'master' 2022-09-27 06:41:15 -05:00
6ccdab5280 Add changelog for 8.4.0 2022-08-31 14:04:50 -05:00
8f9ed67fda Update APIs to 8.5.0-SNAPSHOT 2022-08-15 10:40:56 -05:00
4ebffbc0e8 Bumps to version 8.5.0 2022-07-28 08:18:46 -05:00
282c76fb6a Change 'current' to 'master' in user profile API links 2022-06-24 15:59:43 -05:00
0a510b15f9 Fix typo in changelog
Fixes a typo: `storngly` -> `strongly`

Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co>
2022-06-21 15:49:45 -05:00
24890fd11d Changelog for 8.2.1 (#1703) 2022-05-25 18:15:47 +02:00
be54dcd301 Bumped v8.3.0-canary.1 2022-05-23 16:36:35 +02:00
33e0873ecf API generation 2022-05-23 16:33:56 +02:00
27748779c6 Update CI conf 2022-05-20 14:28:42 +02:00
697b594ea2 Add make.sh workflows (#1696) 2022-05-19 18:23:24 +02:00
911af982b2 Fix integration test (#1689) 2022-05-06 15:15:19 +02:00
651165d842 Updated changelog.asciidoc (#1683) 2022-05-03 19:37:44 +02:00
c58e93a77a Updated dependencies (#1684)
* Updated dependencies

* Updated dependencies
2022-05-03 19:31:42 +02:00
c4e793ca71 Update TypeScript docs and export estypes (#1675)
* Update docs

* Update issue template

* Export estypes
2022-04-12 10:33:54 +02:00
8604da555f Drop Node.js v12 (#1670) 2022-03-31 09:37:50 +02:00
57426c968b Bump versions 2022-03-30 13:39:47 +02:00
96b5b8eaba More lenient parameter checks (#1662) 2022-03-30 13:34:36 +02:00
eac00e1200 Update connecting documentation (#1666) 2022-03-28 12:22:47 +02:00
77c1ef36aa Bumped v8.2.0-canary.2 2022-03-23 11:33:41 +01:00
720b5b449b API generation 2022-03-23 11:31:34 +01:00
a298517692 Updated changelog.asciidoc 2022-03-09 11:49:26 +01:00
53ccd17dbf Changelog for 8.1 (#1657) 2022-03-09 11:43:48 +01:00
f6c14b7268 README: use correct license reference (#1642) 2022-03-04 08:22:53 +01:00
4f1713c894 [DOCS] Add discrete tags to API ref (#1654) 2022-03-03 17:46:45 +01:00
af97ece807 Export SniffingTransport (#1648) 2022-03-03 16:10:32 +01:00
46b2c99b7c Update API reference for v8 (#1646) 2022-03-03 16:08:45 +01:00
e0f54c789b Update v8 changelog (#1647) 2022-03-03 16:07:41 +01:00
6d2774d2a0 [DOCS] Add redirects for authentication and migration guide (#1634)
* [DOCS] Add redirects for authentication and migration guide

* Update auth refs
2022-02-28 15:56:10 +01:00
25d9afbc0b Remove old jobs 2022-02-24 16:06:02 +01:00
d7e5ff5191 Bumped v8.2.0-canary.1 2022-02-24 11:43:14 +01:00
904c3bb28c [DOCS] Fix double backticks for inline code snippets (#1540) 2022-02-24 11:39:49 +01:00
33c4630a34 docs: fix typo (#1628) 2022-02-24 11:38:48 +01:00
3e79c8e825 Remove custom kibana interface (#1633) 2022-02-24 11:37:33 +01:00
d01582803c Fix onFlushTimeout timer not being cleared when upstream errors (#1616) 2022-02-24 11:29:20 +01:00
e7c5b3dafa API generation 2022-02-24 11:11:52 +01:00
10277e217c Bump transport version (#1629) 2022-02-21 19:17:17 +01:00
03ecf707c9 API generation 2022-02-11 14:30:43 +01:00
ca6948fb82 Update docs index 2022-02-11 12:26:05 +01:00
82cf15097d Changelog for 8.0 (#1621) 2022-02-11 12:02:40 +01:00
759138c375 Update docs for v8 (#1572) 2022-02-11 10:23:07 +01:00
a0c5c98a99 Upgrade transport (#1618) 2022-02-11 09:19:34 +01:00
451a805ecd Bumped v8.2.0 2022-02-03 10:52:42 +01:00
071a6ba4bb Updated CI configuration 2022-02-02 17:35:58 +01:00
69 changed files with 5552 additions and 3620 deletions

View File

@ -1,4 +1,4 @@
ARG NODE_JS_VERSION=10
ARG NODE_JS_VERSION=16
FROM node:${NODE_JS_VERSION}
# Create app directory

View File

@ -1,15 +0,0 @@
---
- job:
name: elastic+elasticsearch-js+5.x
display-name: 'elastic / elasticsearch-js # 5.x'
description: Testing the elasticsearch-js 5.x branch.
junit_results: "*-junit.xml"
parameters:
- string:
name: branch_specifier
default: refs/heads/5.x
description: the Git branch specifier to build (&lt;branchName&gt;, &lt;tagName&gt;,
&lt;commitId&gt;, etc.)
triggers:
- github
- timed: '@weekly'

View File

@ -1,15 +0,0 @@
---
- job:
name: elastic+elasticsearch-js+7.16
display-name: 'elastic / elasticsearch-js # 7.16'
description: Testing the elasticsearch-js 7.16 branch.
junit_results: "*-junit.xml"
parameters:
- string:
name: branch_specifier
default: refs/heads/7.16
description: the Git branch specifier to build (&lt;branchName&gt;, &lt;tagName&gt;,
&lt;commitId&gt;, etc.)
triggers:
- github
- timed: 'H */12 * * *'

View File

@ -1,15 +0,0 @@
---
- job:
name: elastic+elasticsearch-js+8.0
display-name: 'elastic / elasticsearch-js # 8.0'
description: Testing the elasticsearch-js 8.0 branch.
junit_results: "*-junit.xml"
parameters:
- string:
name: branch_specifier
default: refs/heads/8.0
description: the Git branch specifier to build (&lt;branchName&gt;, &lt;tagName&gt;,
&lt;commitId&gt;, etc.)
triggers:
- github
- timed: 'H */12 * * *'

View File

@ -1,13 +1,13 @@
---
- job:
name: elastic+elasticsearch-js+6.x
display-name: 'elastic / elasticsearch-js # 6.x'
description: Testing the elasticsearch-js 6.x branch.
name: elastic+elasticsearch-js+8.2
display-name: 'elastic / elasticsearch-js # 8.2'
description: Testing the elasticsearch-js 8.2 branch.
junit_results: "*-junit.xml"
parameters:
- string:
name: branch_specifier
default: refs/heads/6.x
default: refs/heads/8.2
description: the Git branch specifier to build (&lt;branchName&gt;, &lt;tagName&gt;,
&lt;commitId&gt;, etc.)
triggers:

125
.ci/make.mjs Normal file
View File

@ -0,0 +1,125 @@
/*
* 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.
*/
/* global $ argv */
'use strict'
import 'zx/globals'
import { readFile, writeFile } from 'fs/promises'
import assert from 'assert'
import { join } from 'desm'
import semver from 'semver'
assert(typeof argv.task === 'string', 'Missing task parameter')
switch (argv.task) {
case 'release':
release(argv._).catch(onError)
break
case 'bump':
bump(argv._).catch(onError)
break
case 'codegen':
codegen(argv._).catch(onError)
break
default:
console.log(`Unknown task: ${argv.task}`)
process.exit(1)
}
async function release (args) {
assert(args.length === 2, 'Release task expects two parameters')
let [version, outputFolder] = args
if (process.env.WORKFLOW === 'snapshot' && !version.endsWith('SNAPSHOT')) {
version = `${version}-SNAPSHOT`
}
await bump([version])
const packageJson = JSON.parse(await readFile(
join(import.meta.url, '..', 'package.json'),
'utf8'
))
await $`npm run build`
await $`npm pack`
await $`zip elasticsearch-js-${version}.zip elastic-elasticsearch-${packageJson.version}.tgz`
await $`rm elastic-elasticsearch-${packageJson.version}.tgz`
await $`mv ${join(import.meta.url, '..', `elasticsearch-js-${version}.zip`)} ${join(import.meta.url, '..', outputFolder, `elasticsearch-js-${version}.zip`)}`
}
async function bump (args) {
assert(args.length === 1, 'Bump task expects one parameter')
const [version] = args
const packageJson = JSON.parse(await readFile(
join(import.meta.url, '..', 'package.json'),
'utf8'
))
const cleanVersion = semver.clean(version.includes('SNAPSHOT') ? version.split('-')[0] : version)
assert(semver.valid(cleanVersion))
packageJson.version = cleanVersion
packageJson.versionCanary = `${cleanVersion}-canary.0`
await writeFile(
join(import.meta.url, '..', 'package.json'),
JSON.stringify(packageJson, null, 2),
'utf8'
)
const testMatrix = await readFile(join(import.meta.url, 'test-matrix.yml'), 'utf8')
await writeFile(
join(import.meta.url, 'test-matrix.yml'),
testMatrix.replace(/STACK_VERSION:\s+\- "[0-9]+[0-9\.]*[0-9](?:\-SNAPSHOT)?"/, `STACK_VERSION:\n - "${cleanVersion}-SNAPSHOT"`), // eslint-disable-line
'utf8'
)
}
// this command can only be executed locally for now
async function codegen (args) {
assert(args.length === 1, 'Bump task expects one parameter')
const clientGeneratorPath = join(import.meta.url, '..', '..', 'elastic-client-generator-js')
const [version] = args
const isGeneratorCloned = await $`[[ -d ${clientGeneratorPath} ]]`.exitCode === 0
assert(isGeneratorCloned, 'You must clone the elastic-client-generator-js first')
await $`npm install --prefix ${clientGeneratorPath}`
// this command will take a while!
if (version === 'main') {
await $`npm run elasticsearch --prefix ${clientGeneratorPath} -- --version main`
} else {
await $`npm run elasticsearch --prefix ${clientGeneratorPath} -- --version ${version.split('.').slice(0, 2).join('.')}`
}
await $`npm run lint --prefix ${clientGeneratorPath}`
await $`rm -rf ${join(import.meta.url, '..', 'src', 'api')}`
await $`mkdir ${join(import.meta.url, '..', 'src', 'api')}`
await $`cp -R ${join(import.meta.url, '..', '..', 'elastic-client-generator-js', 'output')}/* ${join(import.meta.url, '..', 'src', 'api')}`
await $`mv ${join(import.meta.url, '..', 'src', 'api', 'reference.asciidoc')} ${join(import.meta.url, '..', 'docs', 'reference.asciidoc')}`
await $`npm run build`
}
function onError (err) {
console.log(err)
process.exit(1)
}

180
.ci/make.sh Executable file
View File

@ -0,0 +1,180 @@
#!/usr/bin/env bash
# ------------------------------------------------------- #
#
# Skeleton for common build entry script for all elastic
# clients. Needs to be adapted to individual client usage.
#
# Must be called: ./.ci/make.sh <target> <params>
#
# Version: 1.1.0
#
# Targets:
# ---------------------------
# assemble <VERSION> : build client artefacts with version
# bump <VERSION> : bump client internals to version
# codegen <VERSION> : generate endpoints
# docsgen <VERSION> : generate documentation
# examplegen : generate the doc examples
# clean : clean workspace
#
# ------------------------------------------------------- #
# ------------------------------------------------------- #
# Bootstrap
# ------------------------------------------------------- #
script_path=$(dirname "$(realpath -s "$0")")
repo=$(realpath "$script_path/../")
generator=$(realpath "$script_path/../../elastic-client-generator-js")
# shellcheck disable=SC1090
CMD=$1
TASK=$1
TASK_ARGS=()
VERSION=$2
STACK_VERSION=$VERSION
NODE_JS_VERSION=16
WORKFLOW=${WORKFLOW-staging}
set -euo pipefail
product="elastic/elasticsearch-js"
output_folder=".ci/output"
OUTPUT_DIR="$repo/${output_folder}"
REPO_BINDING="${OUTPUT_DIR}:/sln/${output_folder}"
mkdir -p "$OUTPUT_DIR"
echo -e "\033[34;1mINFO:\033[0m PRODUCT ${product}\033[0m"
echo -e "\033[34;1mINFO:\033[0m VERSION ${STACK_VERSION}\033[0m"
echo -e "\033[34;1mINFO:\033[0m OUTPUT_DIR ${OUTPUT_DIR}\033[0m"
# ------------------------------------------------------- #
# Parse Command
# ------------------------------------------------------- #
case $CMD in
clean)
echo -e "\033[36;1mTARGET: clean workspace $output_folder\033[0m"
rm -rf "$output_folder"
echo -e "\033[32;1mdone.\033[0m"
exit 0
;;
assemble)
if [ -v $VERSION ]; then
echo -e "\033[31;1mTARGET: assemble -> missing version parameter\033[0m"
exit 1
fi
echo -e "\033[36;1mTARGET: assemble artefact $VERSION\033[0m"
TASK=release
TASK_ARGS=("$VERSION" "$output_folder")
;;
codegen)
if [ -v $VERSION ]; then
echo -e "\033[31;1mTARGET: codegen -> missing version parameter\033[0m"
exit 1
fi
echo -e "\033[36;1mTARGET: codegen API v$VERSION\033[0m"
TASK=codegen
# VERSION is BRANCH here for now
TASK_ARGS=("$VERSION")
;;
docsgen)
if [ -v $VERSION ]; then
echo -e "\033[31;1mTARGET: docsgen -> missing version parameter\033[0m"
exit 1
fi
echo -e "\033[36;1mTARGET: generate docs for $VERSION\033[0m"
TASK=codegen
# VERSION is BRANCH here for now
TASK_ARGS=("$VERSION" "$codegen_folder")
;;
examplesgen)
echo -e "\033[36;1mTARGET: generate examples\033[0m"
TASK=codegen
# VERSION is BRANCH here for now
TASK_ARGS=("$VERSION" "$codegen_folder")
;;
bump)
if [ -v $VERSION ]; then
echo -e "\033[31;1mTARGET: bump -> missing version parameter\033[0m"
exit 1
fi
echo -e "\033[36;1mTARGET: bump to version $VERSION\033[0m"
TASK=bump
# VERSION is BRANCH here for now
TASK_ARGS=("$VERSION")
;;
*)
echo -e "\nUsage:\n\t $CMD is not supported right now\n"
exit 1
esac
# ------------------------------------------------------- #
# Build Container
# ------------------------------------------------------- #
echo -e "\033[34;1mINFO: building $product container\033[0m"
docker build \
--file .ci/Dockerfile \
--tag ${product} \
--build-arg NODE_JS_VERSION=${NODE_JS_VERSION} \
--build-arg USER_ID="$(id -u)" \
--build-arg GROUP_ID="$(id -g)" \
.
# ------------------------------------------------------- #
# Run the Container
# ------------------------------------------------------- #
echo -e "\033[34;1mINFO: running $product container\033[0m"
docker run \
--volume $repo:/usr/src/app \
--volume $generator:/usr/src/elastic-client-generator-js \
--volume /usr/src/app/node_modules \
--env "WORKFLOW=${WORKFLOW}" \
--name make-elasticsearch-js \
--rm \
$product \
node .ci/make.mjs --task $TASK ${TASK_ARGS[*]}
# ------------------------------------------------------- #
# Post Command tasks & checks
# ------------------------------------------------------- #
if [[ "$CMD" == "assemble" ]]; then
if compgen -G ".ci/output/*" > /dev/null; then
echo -e "\033[32;1mTARGET: successfully assembled client v$VERSION\033[0m"
else
echo -e "\033[31;1mTARGET: assemble failed, empty workspace!\033[0m"
exit 1
fi
fi
if [[ "$CMD" == "bump" ]]; then
if [ -n "$(git status --porcelain)" ]; then
echo -e "\033[32;1mTARGET: successfully bumped client v$VERSION\033[0m"
else
echo -e "\033[31;1mTARGET: failed bumped client v$VERSION\033[0m"
exit 1
fi
fi
if [[ "$CMD" == "codegen" ]]; then
if [ -n "$(git status --porcelain)" ]; then
echo -e "\033[32;1mTARGET: successfully generated client v$VERSION\033[0m"
else
echo -e "\033[31;1mTARGET: failed generating client v$VERSION\033[0m"
exit 1
fi
fi
if [[ "$CMD" == "docsgen" ]]; then
echo "TODO"
fi
if [[ "$CMD" == "examplesgen" ]]; then
echo "TODO"
fi

View File

@ -2,9 +2,9 @@
source /usr/local/bin/bash_standard_lib.sh
DOCKER_IMAGES="node:16-alpine
DOCKER_IMAGES="node:17-alpine
node:16-alpine
node:14-alpine
node:12-alpine
"
for di in ${DOCKER_IMAGES}

View File

@ -9,7 +9,7 @@ script_path=$(dirname $(realpath -s $0))
source $script_path/functions/imports.sh
set -euo pipefail
NODE_JS_VERSION=${NODE_JS_VERSION-12}
NODE_JS_VERSION=${NODE_JS_VERSION-16}
ELASTICSEARCH_URL=${ELASTICSEARCH_URL-"$elasticsearch_url"}
elasticsearch_container=${elasticsearch_container-}

View File

@ -1,11 +1,11 @@
---
STACK_VERSION:
- 8.1.0-SNAPSHOT
- "8.5.2-SNAPSHOT"
NODE_JS_VERSION:
- 18
- 16
- 14
- 12
TEST_SUITE:
- free

View File

@ -51,5 +51,6 @@ Paste the results here:
- *node version*: 6,8,10
- `@elastic/elasticsearch` *version*: >=7.0.0
- *typescript version*: 4.x (if applicable)
- *os*: Mac, Windows, Linux
- *any other relevant information*

View File

@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
node-version: [14.x, 16.x, 18.x]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
@ -176,7 +176,7 @@ jobs:
strategy:
matrix:
node-version: [14.x]
node-version: [16.x]
steps:
- uses: actions/checkout@v2

View File

@ -72,7 +72,3 @@ CODE_OF_CONDUCT.md
CONTRIBUTING.md
src
# CANARY-PACKAGE
lib/api/kibana.*
# /CANARY-PACKAGE

View File

@ -2,7 +2,7 @@
# Elasticsearch Node.js client
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/) [![Build Status](https://clients-ci.elastic.co/buildStatus/icon?job=elastic%2Belasticsearch-js%2Bmain)](https://clients-ci.elastic.co/view/Javascript/job/elastic+elasticsearch-js+main/) [![Node CI](https://github.com/elastic/elasticsearch-js/actions/workflows/nodejs.yml/badge.svg)](https://github.com/elastic/elasticsearch-js/actions/workflows/nodejs.yml) [![codecov](https://codecov.io/gh/elastic/elasticsearch-js/branch/master/graph/badge.svg)](https://codecov.io/gh/elastic/elasticsearch-js) [![NPM downloads](https://img.shields.io/npm/dm/@elastic/elasticsearch.svg?style=flat)](https://www.npmjs.com/package/@elastic/elasticsearch)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/) [![Build Status](https://clients-ci.elastic.co/buildStatus/icon?job=elastic%2Belasticsearch-js%2Bmain)](https://clients-ci.elastic.co/view/JavaScript/job/elastic+elasticsearch-js+main/) [![Node CI](https://github.com/elastic/elasticsearch-js/actions/workflows/nodejs.yml/badge.svg)](https://github.com/elastic/elasticsearch-js/actions/workflows/nodejs.yml) [![codecov](https://codecov.io/gh/elastic/elasticsearch-js/branch/master/graph/badge.svg)](https://codecov.io/gh/elastic/elasticsearch-js) [![NPM downloads](https://img.shields.io/npm/dm/@elastic/elasticsearch.svg?style=flat)](https://www.npmjs.com/package/@elastic/elasticsearch)
The official Node.js client for Elasticsearch.
@ -22,7 +22,7 @@ npm install @elastic/elasticsearch
### Node.js support
NOTE: The minimum supported version of Node.js is `v12`.
NOTE: The minimum supported version of Node.js is `v14`.
The client versioning follows the Elastic Stack versioning, this means that
major, minor, and patch releases are done following a precise schedule that
@ -44,8 +44,9 @@ of `^7.10.0`).
| Node.js Version | Node.js EOL date | End of support |
| --------------- |------------------| ---------------------- |
| `8.x` | `December 2019` | `7.11` (early 2021) |
| `10.x` | `April 2021` | `7.12` (mid 2021) |
| `12.x` | `April 2022` | `8.2` (early 2022) |
| `10.x` | `April 2021` | `7.12` (mid 2021) |
| `12.x` | `April 2022` | `8.2` (early 2022) |
| `14.x` | `April 2023` | `8.8` (early 2023) |
### Compatibility
@ -89,7 +90,10 @@ We recommend that you write a lightweight proxy that uses this client instead, y
'use strict'
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
async function run () {
// Let's start by indexing some data
@ -159,8 +163,14 @@ You will require the packages from your code by using the alias you have defined
const { Client: Client6 } = require('es6')
const { Client: Client7 } = require('es7')
const client6 = new Client6({ node: 'http://localhost:9200' })
const client7 = new Client7({ node: 'http://localhost:9201' })
const client6 = new Client6({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
const client7 = new Client7({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
client6.info().then(console.log, console.log)
client7.info().then(console.log, console.log)
@ -173,4 +183,4 @@ npm install esmain@github:elastic/elasticsearch-js
## License
This software is licensed under the [Apache 2 license](./LICENSE).
This software is licensed under the [Apache License 2.0](./LICENSE).

View File

@ -30,7 +30,9 @@ class MyConnectionPool extends ConnectionPool {
}
const client = new Client({
ConnectionPool: MyConnectionPool
ConnectionPool: MyConnectionPool,
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
----
@ -54,7 +56,9 @@ class MyConnection extends BaseConnection {
}
const client = new Client({
Connection: MyConnection
Connection: MyConnection,
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
----
@ -81,7 +85,9 @@ class MySerializer extends Serializer {
}
const client = new Client({
Serializer: MySerializer
Serializer: MySerializer,
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
----
@ -89,12 +95,12 @@ const client = new Client({
==== Migrate to v8
The Node.js client can be configured to emit an HTTP header
``Accept: application/vnd.elasticsearch+json; compatible-with=7``
`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
`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``.
`ELASTIC_CLIENT_APIVERSIONING` to `true`.

View File

@ -10,7 +10,8 @@ offers.
const { Client } = require('@elastic/elasticsearch')
const client = new Client({
node: 'http://localhost:9200',
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
maxRetries: 5,
requestTimeout: 60000,
sniffOnStart: true
@ -241,7 +242,7 @@ _Cloud configuration example:_
----
const client = new Client({
cloud: {
id: 'name:bG9jYWxob3N0JGFiY2QkZWZnaA=='
id: '<cloud-id>'
},
auth: {
username: 'elastic',

View File

@ -1,6 +1,102 @@
[[changelog-client]]
== Release notes
[discrete]
=== 8.5.0
[discrete]
===== Support for Elasticsearch `v8.5.0`
You can find all the API changes
https://www.elastic.co/guide/en/elasticsearch/reference/8.5/release-notes-8.5.0.html[here].
[discrete]
=== 8.4.0
[discrete]
===== Support for Elasticsearch `v8.4.0`
You can find all the API changes
https://www.elastic.co/guide/en/elasticsearch/reference/8.4/release-notes-8.4.0.html[here].
[discrete]
=== 8.2.1
[discrete]
==== Fixes
[discrete]
===== Support for Elasticsearch `v8.2.1`
You can find all the API changes
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/release-notes-8.2.1.html[here].
[discrete]
===== Fix ndjson APIs https://github.com/elastic/elasticsearch-js/pull/1688[#1688]
The previous release contained a bug that broken ndjson APIs.
We have released `v8.2.0-patch.1` to address this.
This fix is the same as the one we have released and we strongly recommend upgrading to this version.
[discrete]
===== Fix node shutdown apis https://github.com/elastic/elasticsearch-js/pull/1697[#1697]
The shutdown APIs wheren't complete, this fix completes them.
[discrete]
==== Types: move query keys to body https://github.com/elastic/elasticsearch-js/pull/1693[#1693]
The types definitions where wrongly representing the types of fields present in both query and body.
[discrete]
=== 8.2.0
[discrete]
==== Breaking changes
[discrete]
===== Drop Node.js v12 https://github.com/elastic/elasticsearch-js/pull/1670[#1670]
According to our https://github.com/elastic/elasticsearch-js#nodejs-support[Node.js support matrix].
[discrete]
==== Features
[discrete]
===== Support for Elasticsearch `v8.2`
You can find all the API changes
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/release-notes-8.2.0.html[here].
[discrete]
===== More lenient parameter checks https://github.com/elastic/elasticsearch-js/pull/1662[#1662]
When creating a new client, an `undefined` `caFingerprint` no longer trigger an error for a http connection.
[discrete]
===== Update TypeScript docs and export estypes https://github.com/elastic/elasticsearch-js/pull/1675[#1675]
You can import the full TypeScript requests & responses definitions as it follows:
[source,ts]
----
import { estypes } from '@elastic/elasticsearch'
----
If you need the legacy definitions with the body, you can do the following:
[source,ts]
----
import { estypesWithBody } from '@elastic/elasticsearch'
----
[discrete]
==== Fixes
[discrete]
===== Updated hpagent to the latest version https://github.com/elastic/elastic-transport-js/pull/49[transport/#49]
You can fing the related changes https://github.com/delvedor/hpagent/releases/tag/v1.0.0[here].
[discrete]
=== 8.1.0
@ -21,6 +117,11 @@ Now the client exports the SniffingTransport class.
[discrete]
==== Fixes
[discrete]
===== Fix onFlushTimeout timer not being cleared when upstream errors https://github.com/elastic/elasticsearch-js/pull/1616[#1616]
Fixes a memory leak caused by an error in the upstream dataset of the bulk helper.
[discrete]
===== Cleanup abort listener https://github.com/elastic/elastic-transport-js/pull/42[transport/#42]

View File

@ -22,7 +22,10 @@ will be closed.
[source,js]
----
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
const child = client.child({
headers: { 'x-foo': 'bar' },
requestTimeout: 1000

View File

@ -46,7 +46,7 @@ to know more.
const { Client } = require('@elastic/elasticsearch')
const client = new Client({
cloud: {
id: 'name:bG9jYWxob3N0JGFiY2QkZWZnaA==',
id: '<cloud-id>'
},
auth: {
username: 'elastic',
@ -55,6 +55,152 @@ const client = new Client({
})
----
[discrete]
[[connect-self-managed-new]]
=== Connecting to a self-managed cluster
By default {es} will start with security features like authentication and TLS
enabled. To connect to the {es} cluster you'll need to configure the Node.js {es}
client to use HTTPS with the generated CA certificate in order to make requests
successfully.
If you're just getting started with {es} we recommend reading the documentation
on https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html[configuring]
and
https://www.elastic.co/guide/en/elasticsearch/reference/current/starting-elasticsearch.html[starting {es}]
to ensure your cluster is running as expected.
When you start {es} for the first time you'll see a distinct block like the one
below in the output from {es} (you may have to scroll up if it's been a while):
[source,sh]
----
-> Elasticsearch security features have been automatically configured!
-> Authentication is enabled and cluster connections are encrypted.
-> Password for the elastic user (reset with `bin/elasticsearch-reset-password -u elastic`):
lhQpLELkjkrawaBoaz0Q
-> HTTP CA certificate SHA-256 fingerprint:
a52dd93511e8c6045e21f16654b77c9ee0f34aea26d9f40320b531c474676228
...
----
Depending on the circumstances there are two options for verifying the HTTPS
connection, either verifying with the CA certificate itself or via the HTTP CA
certificate fingerprint.
[discrete]
[[auth-tls]]
==== TLS configuration
The generated root CA certificate can be found in the `certs` directory in your
{es} config location (`$ES_CONF_PATH/certs/http_ca.crt`). If you're running {es}
in Docker there is
https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html[additional documentation for retrieving the CA certificate].
Without any additional configuration you can specify `https://` node urls, and
the certificates used to sign these requests will be verified. To turn off
certificate verification, you must specify an `tls` object in the top level
config and set `rejectUnauthorized: false`. The default `tls` values are the
same that Node.js's https://nodejs.org/api/tls.html#tls_tls_connect_options_callback[`tls.connect()`]
uses.
[source,js]
----
const { Client } = require('@elastic/elasticsearch')
const client = new Client({
node: 'https://localhost:9200',
auth: {
username: 'elastic',
password: 'changeme'
},
tls: {
ca: fs.readFileSync('./http_ca.crt'),
rejectUnauthorized: false
}
})
----
[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.
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:...',
tls: {
// might be required if it's a self-signed certificate
rejectUnauthorized: false
}
})
----
The certificate fingerprint can be calculated using `openssl x509` with the
certificate file:
[source,sh]
----
openssl x509 -fingerprint -sha256 -noout -in /path/to/http_ca.crt
----
If you don't have access to the generated CA file from {es} you can use the
following script to output the root CA fingerprint of the {es} instance with
`openssl s_client`:
[source,sh]
----
# Replace the values of 'localhost' and '9200' to the
# corresponding host and port values for the cluster.
openssl s_client -connect localhost:9200 -servername localhost -showcerts </dev/null 2>/dev/null \
| openssl x509 -fingerprint -sha256 -noout -in /dev/stdin
----
The output of `openssl x509` will look something like this:
[source,sh]
----
SHA256 Fingerprint=A5:2D:D9:35:11:E8:C6:04:5E:21:F1:66:54:B7:7C:9E:E0:F3:4A:EA:26:D9:F4:03:20:B5:31:C4:74:67:62:28
----
[discrete]
[[connect-no-security]]
=== Connecting without security enabled
WARNING: Running {es} without security enabled is not recommended.
If your cluster is configured with
https://www.elastic.co/guide/en/elasticsearch/reference/current/security-settings.html[security explicitly disabled]
then you can connect via HTTP:
[source,js]
----
const { Client } = require('@elastic/elasticsearch')
const client = new Client({
node: 'http://example.com'
})
----
[discrete]
[[auth-strategies]]
=== Authentication strategies
Following you can find all the supported authentication strategies.
[discrete]
[[auth-apikey]]
@ -150,57 +296,6 @@ const client = new Client({
----
[discrete]
[[auth-tls]]
==== TLS configuration
Without any additional configuration you can specify `https://` node urls, and
the certificates used to sign these requests will be verified. To turn off
certificate verification, you must specify an `tls` object in the top level
config and set `rejectUnauthorized: false`. The default `tls` values are the
same that Node.js's https://nodejs.org/api/tls.html#tls_tls_connect_options_callback[`tls.connect()`]
uses.
[source,js]
----
const { Client } = require('@elastic/elasticsearch')
const client = new Client({
node: 'https://localhost:9200',
auth: {
username: 'elastic',
password: 'changeme'
},
tls: {
ca: fs.readFileSync('./cacert.pem'),
rejectUnauthorized: false
}
})
----
[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:...',
tls: {
// might be required if it's a self-signed certificate
rejectUnauthorized: false
}
})
----
[discrete]
[[client-usage]]
=== Usage
@ -212,7 +307,10 @@ and every method exposes the same signature.
[source,js]
----
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
const result = await client.search({
index: 'my-index',
@ -229,7 +327,10 @@ you must specify `meta: true` in the request options:
[source,js]
----
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
const result = await client.search({
index: 'my-index',
@ -266,7 +367,10 @@ CAUTION: If you abort a request, the request will fail with a
----
const AbortController = require('node-abort-controller')
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
const abortController = new AbortController()
setImmediate(() => abortController.abort())

View File

@ -9,7 +9,10 @@ data.
'use strict'
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
async function run () {
const bulkResponse = await client.bulk({
@ -83,7 +86,10 @@ send it directly to another source.
'use strict'
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
const fastify = require('fastify')()
fastify.post('/search/:index', async (req, reply) => {

View File

@ -13,7 +13,8 @@ NOTE: Did you know that we provide an helper for sending bulk request? You can f
require('array.prototype.flatmap').shim()
const { Client } = require('@elastic/elasticsearch')
const client = new Client({
node: 'http://localhost:9200'
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
async function run () {

View File

@ -10,7 +10,10 @@ NOTE: Since this API uses the `HEAD` method, the body value will be boolean.
'use strict'
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
async function run () {
await client.index({

View File

@ -10,7 +10,10 @@ The following example gets a JSON document from an index called
'use strict'
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
async function run () {
await client.index({

View File

@ -8,7 +8,10 @@ HTTP status codes which should not be considered errors for this request.
'use strict'
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
async function run () {
const bulkResponse = await client.bulk({

View File

@ -9,7 +9,10 @@ API.
'use strict'
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
async function run () {
const bulkResponse = await client.bulk({

View File

@ -15,7 +15,10 @@ the house Stark and remove the `house` field from the document source.
'use strict'
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
async function run () {
await client.index({

View File

@ -26,7 +26,10 @@ NOTE: Did you know that we provide an helper for sending scroll requests? You ca
'use strict'
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
async function run () {
const allQuotes = []
@ -118,7 +121,10 @@ async iteration!
'use strict'
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
// Scroll utility
async function * scrollSearch (params) {

View File

@ -12,7 +12,10 @@ https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-request-body.
'use strict'
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
async function run () {
// Let's start by indexing some data

View File

@ -17,7 +17,10 @@ manipulate the result to obtain an object easy to navigate.
'use strict'
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
async function run () {
await client.index({

View File

@ -12,7 +12,10 @@ request. If the query part is left out, only suggestions are returned.
'use strict'
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
async function run () {
const bulkResponse = await client.bulk({

View File

@ -20,7 +20,10 @@ maintain.
'use strict'
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
async function run () {
const bulkResponse = await client.bulk({

View File

@ -10,7 +10,10 @@ a character has said the given quote, and then we will update the `times` field.
'use strict'
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
async function run () {
await client.index({
@ -54,7 +57,10 @@ With the update API, you can also run a partial update of a document.
'use strict'
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
async function run () {
await client.index({

View File

@ -10,7 +10,10 @@ property or some other online mapping change.
'use strict'
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
async function run () {
await client.index({

View File

@ -27,7 +27,10 @@ const { createReadStream } = require('fs')
const split = require('split2')
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
const result = await client.helpers.bulk({
datasource: createReadStream('./dataset.ndjson').pipe(split()),
onDocument (doc) {
@ -248,7 +251,10 @@ const { createReadStream } = require('fs')
const split = require('split2')
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
const b = client.helpers.bulk({
datasource: createReadStream('./dataset.ndjson').pipe(split()),
onDocument (doc) {
@ -304,7 +310,10 @@ async function * generator () {
}
}
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
const result = await client.helpers.bulk({
datasource: generator(),
onDocument (doc) {
@ -338,7 +347,10 @@ sources.
----
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
const m = client.helpers.msearch()
m.search(
@ -427,7 +439,10 @@ running will not be stopped.
----
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
const m = client.helpers.msearch()
m.search(

View File

@ -1,6 +1,6 @@
= Elasticsearch JavaScript Client
:branch: master
include::{asciidoc-dir}/../../shared/versions/stack/{source_branch}.asciidoc[]
include::{asciidoc-dir}/../../shared/attributes.asciidoc[]
include::introduction.asciidoc[]

View File

@ -24,7 +24,7 @@ To learn more about the supported major versions, please refer to the
[[nodejs-support]]
=== Node.js support
NOTE: The minimum supported version of Node.js is `v12`.
NOTE: The minimum supported version of Node.js is `v14`.
The client versioning follows the {stack} versioning, this means that
major, minor, and patch releases are done following a precise schedule that
@ -60,6 +60,10 @@ of `^7.10.0`).
|`12.x`
|April 2022
|`8.2` (early 2022)
|`14.x`
|April 2023
|`8.8` (early 2023)
|===
[discrete]

View File

@ -25,7 +25,10 @@ about the features of the client.
'use strict'
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
async function run () {
// Let's start by indexing some data
@ -116,8 +119,14 @@ Require the packages from your code by using the alias you have defined.
const { Client: Client6 } = require('es6')
const { Client: Client7 } = require('es7')
const client6 = new Client6({ node: 'http://localhost:9200' })
const client7 = new Client7({ node: 'http://localhost:9201' })
const client6 = new Client6({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
const client7 = new Client7({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
client6.info().then(console.log, console.log)
client7.info().then(console.log, console.log)

View File

@ -34,7 +34,10 @@ response and error that is happening during the use of the client.
----
const logger = require('my-logger')()
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
client.diagnostic.on('response', (err, result) => {
if (err) {
@ -152,7 +155,7 @@ request: {
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`]
https://github.com/elastic/elasticsearch-js/blob/main/test/acceptance/events-order.test.js[`test/acceptance/events-order.test.js`]
how the order changes based on the situation.
[source]
@ -183,7 +186,10 @@ handle this problem.
[source,js]
----
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
client.diagnostic.on('request', (err, result) => {
const { id } = result.meta.request
@ -213,7 +219,8 @@ By default the id is an incremental integer, but you can configure it with the
----
const { Client } = require('@elastic/elasticsearch')
const client = new Client({
node: 'http://localhost:9200',
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' },
// it takes two parameters, the request parameters and options
generateRequestId: function (params, options) {
// your id generation logic
@ -246,7 +253,10 @@ can do that via the `context` option of a request:
[source,js]
----
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
client.diagnostic.on('request', (err, result) => {
const { id } = result.meta.request
@ -280,7 +290,8 @@ merged, and the API level object will take precedence.
----
const { Client } = require('@elastic/elasticsearch')
const client = new Client({
node: 'http://localhost:9200',
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' },
context: { winter: 'is coming' }
})
@ -321,7 +332,8 @@ options help you in this regard.
----
const { Client } = require('@elastic/elasticsearch')
const client = new Client({
node: 'http://localhost:9200',
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' },
name: 'parent-client' // default to 'elasticsearch-js'
})
@ -365,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/current/logging.html#deprecation-logging[deprecation logs],
helps you with https://www.elastic.co/guide/en/elasticsearch/reference/current/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/current/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
@ -377,7 +389,8 @@ resulting header will be `{ 'X-Opaque-Id': 'my-search' }`.
----
const { Client } = require('@elastic/elasticsearch')
const client = new Client({
node: 'http://localhost:9200'
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
client.search({
@ -398,7 +411,8 @@ doing this, the client offers a top-level configuration option:
----
const { Client } = require('@elastic/elasticsearch')
const client = new Client({
node: 'http://localhost:9200',
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' },
opaqueIdPrefix: 'proxy-client::'
})

File diff suppressed because it is too large Load Diff

View File

@ -61,7 +61,8 @@ const Mock = require('@elastic/elasticsearch-mock')
const mock = new Mock()
const client = new Client({
node: 'http://localhost:9200',
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' },
Connection: mock.getConnection()
})

View File

@ -6,7 +6,8 @@ errors, it also handles sniffing.
[source,js]
----
const { Client, Transport } = require('@elastic/elasticsearch')
const { Client } = require('@elastic/elasticsearch')
const { Transport } = require('@elastic/transport')
class MyTransport extends Transport {
request (params, options, callback) {

View File

@ -7,6 +7,10 @@ of type definitions of Elasticsearch's API surface.
The types are not 100% complete yet. Some APIs are missing (the newest ones, e.g. EQL),
and others may contain some errors, but we are continuously pushing fixes & improvements.
NOTE: The client is developed against the https://www.npmjs.com/package/typescript?activeTab=versions[latest]
version of TypeScript. Furthermore, unless you have set `skipLibCheck` to `true`,
you should configure `esModuleInterop` to `true`.
[discrete]
==== Example
@ -14,7 +18,10 @@ and others may contain some errors, but we are continuously pushing fixes & impr
----
import { Client } from '@elastic/elasticsearch'
const client = new Client({ node: 'http://localhost:9200' })
const client = new Client({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
interface Document {
character: string
@ -68,9 +75,16 @@ run().catch(console.log)
[discrete]
==== Request & Response types
You can import the full TypeScript requests & responses defintions as it follows:
You can import the full TypeScript requests & responses definitions as it follows:
[source,ts]
----
import { estypes } from '@elastic/elasticsearch'
----
If you need the legacy definitions with the body, you can do the following:
[source,ts]
----
import { estypesWithBody } from '@elastic/elasticsearch'
----

2
index.d.ts vendored
View File

@ -21,5 +21,7 @@ import Client from './lib/client'
import SniffingTransport from './lib/sniffingTransport'
export * from '@elastic/transport'
export * as estypes from './lib/api/types'
export * as estypesWithBody from './lib/api/types'
export { Client, SniffingTransport }
export type { ClientOptions, NodeOptions } from './lib/client'

View File

@ -1,7 +1,7 @@
{
"name": "@elastic/elasticsearch",
"version": "8.1.0",
"versionCanary": "8.1.0-canary.3",
"version": "8.5.2",
"versionCanary": "8.5.2-canary.0",
"description": "The official Elasticsearch client for Node.js",
"main": "index.js",
"types": "index.d.ts",
@ -45,43 +45,44 @@
},
"homepage": "http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html",
"engines": {
"node": ">=12"
"node": ">=14"
},
"devDependencies": {
"@sinonjs/fake-timers": "github:sinonjs/fake-timers#0bfffc1",
"@types/debug": "^4.1.6",
"@types/debug": "^4.1.7",
"@types/ms": "^0.7.31",
"@types/node": "^16.4.1",
"@types/sinonjs__fake-timers": "^6.0.3",
"@types/node": "^17.0.31",
"@types/sinonjs__fake-timers": "^8.1.2",
"@types/split2": "^3.2.1",
"@types/stoppable": "^1.1.1",
"@types/tap": "^15.0.5",
"@types/tap": "^15.0.7",
"cross-zip": "^4.0.0",
"desm": "^1.2.0",
"fast-deep-equal": "^3.1.3",
"into-stream": "^6.0.0",
"into-stream": "^7.0.0",
"js-yaml": "^4.1.0",
"license-checker": "^25.0.1",
"minimist": "^1.2.5",
"minimist": "^1.2.6",
"ms": "^2.1.3",
"node-abort-controller": "^2.0.0",
"node-fetch": "^2.6.2",
"node-abort-controller": "^3.0.1",
"node-fetch": "^2.6.7",
"ora": "^5.4.1",
"proxy": "^1.0.2",
"rimraf": "^3.0.2",
"semver": "^7.3.5",
"split2": "^3.2.2",
"standard": "^16.0.3",
"semver": "^7.3.7",
"split2": "^4.1.0",
"stoppable": "^1.1.0",
"tap": "^15.0.9",
"ts-node": "^10.1.0",
"ts-standard": "^10.0.0",
"typescript": "^4.3.5",
"tap": "^16.1.0",
"ts-node": "^10.7.0",
"ts-standard": "^11.0.0",
"typescript": "^4.6.4",
"workq": "^3.0.0",
"xmlbuilder2": "^3.0.2"
"xmlbuilder2": "^3.0.2",
"zx": "^6.1.0"
},
"dependencies": {
"@elastic/transport": "^8.0.2",
"tslib": "^2.3.0"
"@elastic/transport": "^8.3.1",
"tslib": "^2.4.0"
},
"tap": {
"ts": true,

View File

@ -31,7 +31,6 @@ async function release (opts) {
const originalVersion = packageJson.version
const currentCanaryVersion = packageJson.versionCanary
const originalTypes = packageJson.types
const originalNpmIgnore = await readFile(join(__dirname, '..', '.npmignore'), 'utf8')
const newCanaryInteger = opts.reset ? 1 : (Number(currentCanaryVersion.split('-')[1].split('.')[1]) + 1)
const newCanaryVersion = `${originalVersion.split('-')[0]}-canary.${newCanaryInteger}`
@ -49,15 +48,6 @@ async function release (opts) {
'utf8'
)
// update the npmignore to publish the kibana types as well
const newNpmIgnore = originalNpmIgnore.slice(0, originalNpmIgnore.indexOf('# CANARY-PACKAGE')) +
originalNpmIgnore.slice(originalNpmIgnore.indexOf('# /CANARY-PACKAGE') + 17)
await writeFile(
join(__dirname, '..', '.npmignore'),
newNpmIgnore,
'utf8'
)
// confirm the package.json changes with the user
const diff = execSync('git diff').toString().split('\n').map(colorDiff).join('\n')
console.log(diff)
@ -81,12 +71,6 @@ async function release (opts) {
JSON.stringify(packageJson, null, 2) + '\n',
'utf8'
)
await writeFile(
join(__dirname, '..', '.npmignore'),
originalNpmIgnore,
'utf8'
)
}
function confirm (question) {

View File

@ -1,111 +0,0 @@
/*
* 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.
*/
/* eslint-disable import/export */
/* eslint-disable @typescript-eslint/no-misused-new */
/* eslint-disable @typescript-eslint/no-extraneous-class */
/* eslint-disable @typescript-eslint/no-unused-vars */
// This file was automatically generated by elastic/elastic-client-generator-js
// DO NOT MODIFY IT BY HAND. Instead, modify the source open api file,
// and elastic/elastic-client-generator-js to regenerate this file again.
import {
Transport,
TransportRequestOptions,
TransportRequestOptionsWithMeta,
TransportRequestOptionsWithOutMeta,
TransportResult
} from '@elastic/transport'
import * as T from '../types'
import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
export default class Internal {
transport: Transport
constructor (transport: Transport) {
this.transport = transport
}
async deleteDesiredNodes (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async deleteDesiredNodes (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async deleteDesiredNodes (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async deleteDesiredNodes (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = []
const querystring: Record<string, any> = {}
const body = undefined
params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
querystring[key] = params[key]
}
}
const method = 'DELETE'
const path = '/_internal/desired_nodes'
return await this.transport.request({ path, method, querystring, body }, options)
}
async getDesiredNodes (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async getDesiredNodes (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async getDesiredNodes (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async getDesiredNodes (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = []
const querystring: Record<string, any> = {}
const body = undefined
params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
querystring[key] = params[key]
}
}
const method = 'GET'
const path = '/_internal/desired_nodes/_latest'
return await this.transport.request({ path, method, querystring, body }, options)
}
async updateDesiredNodes (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async updateDesiredNodes (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async updateDesiredNodes (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async updateDesiredNodes (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['history_id', 'version']
const querystring: Record<string, any> = {}
const body = undefined
params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
querystring[key] = params[key]
}
}
const method = 'PUT'
const path = `/_internal/desired_nodes/${encodeURIComponent(params.history_id.toString())}/${encodeURIComponent(params.version.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
}
}

View File

@ -65,10 +65,10 @@ export default class AsyncSearch {
return await this.transport.request({ path, method, querystring, body }, options)
}
async get<TDocument = unknown> (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.AsyncSearchGetResponse<TDocument>>
async get<TDocument = unknown> (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.AsyncSearchGetResponse<TDocument>, unknown>>
async get<TDocument = unknown> (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptions): Promise<T.AsyncSearchGetResponse<TDocument>>
async get<TDocument = unknown> (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptions): Promise<any> {
async get<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.AsyncSearchGetResponse<TDocument, TAggregations>>
async get<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.AsyncSearchGetResponse<TDocument, TAggregations>, unknown>>
async get<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptions): Promise<T.AsyncSearchGetResponse<TDocument, TAggregations>>
async get<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.AsyncSearchGetRequest | TB.AsyncSearchGetRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['id']
const querystring: Record<string, any> = {}
const body = undefined
@ -109,12 +109,12 @@ export default class AsyncSearch {
return await this.transport.request({ path, method, querystring, body }, options)
}
async submit<TDocument = unknown> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.AsyncSearchSubmitResponse<TDocument>>
async submit<TDocument = unknown> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.AsyncSearchSubmitResponse<TDocument>, unknown>>
async submit<TDocument = unknown> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptions): Promise<T.AsyncSearchSubmitResponse<TDocument>>
async submit<TDocument = unknown> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptions): Promise<any> {
async submit<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.AsyncSearchSubmitResponse<TDocument, TAggregations>>
async submit<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.AsyncSearchSubmitResponse<TDocument, TAggregations>, unknown>>
async submit<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptions): Promise<T.AsyncSearchSubmitResponse<TDocument, TAggregations>>
async submit<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params?: T.AsyncSearchSubmitRequest | TB.AsyncSearchSubmitRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['aggregations', 'aggs', 'collapse', 'explain', 'from', 'highlight', 'track_total_hits', 'indices_boost', 'docvalue_fields', 'min_score', 'post_filter', 'profile', 'query', 'rescore', 'script_fields', 'search_after', 'size', 'slice', 'sort', '_source', 'fields', 'suggest', 'terminate_after', 'timeout', 'track_scores', 'version', 'seq_no_primary_term', 'stored_fields', 'pit', 'runtime_mappings', 'stats']
const acceptedBody: string[] = ['aggregations', 'aggs', 'collapse', 'explain', 'ext', 'from', 'highlight', 'track_total_hits', 'indices_boost', 'docvalue_fields', 'knn', 'min_score', 'post_filter', 'profile', 'query', 'rescore', 'script_fields', 'search_after', 'size', 'slice', 'sort', '_source', 'fields', 'suggest', 'terminate_after', 'timeout', 'track_scores', 'version', 'seq_no_primary_term', 'stored_fields', 'pit', 'runtime_mappings', 'stats']
const querystring: Record<string, any> = {}
// @ts-expect-error
const userBody: any = params?.body
@ -130,7 +130,8 @@ export default class AsyncSearch {
if (acceptedBody.includes(key)) {
body = body ?? {}
// @ts-expect-error
if (key === 'sort' && typeof params[key] === 'string' && params[key].includes(':')) {
if (key === 'sort' && typeof params[key] === 'string' && params[key].includes(':')) { // eslint-disable-line
// @ts-expect-error
querystring[key] = params[key]
} else {
// @ts-expect-error

View File

@ -103,6 +103,36 @@ export default class Cat {
return await this.transport.request({ path, method, querystring, body }, options)
}
async componentTemplates (this: That, params?: T.CatComponentTemplatesRequest | TB.CatComponentTemplatesRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatComponentTemplatesResponse>
async componentTemplates (this: That, params?: T.CatComponentTemplatesRequest | TB.CatComponentTemplatesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatComponentTemplatesResponse, unknown>>
async componentTemplates (this: That, params?: T.CatComponentTemplatesRequest | TB.CatComponentTemplatesRequest, options?: TransportRequestOptions): Promise<T.CatComponentTemplatesResponse>
async componentTemplates (this: That, params?: T.CatComponentTemplatesRequest | TB.CatComponentTemplatesRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['name']
const querystring: Record<string, any> = {}
const body = undefined
params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
let method = ''
let path = ''
if (params.name != null) {
method = 'GET'
path = `/_cat/component_templates/${encodeURIComponent(params.name.toString())}`
} else {
method = 'GET'
path = '/_cat/component_templates'
}
return await this.transport.request({ path, method, querystring, body }, options)
}
async count (this: That, params?: T.CatCountRequest | TB.CatCountRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.CatCountResponse>
async count (this: That, params?: T.CatCountRequest | TB.CatCountRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatCountResponse, unknown>>
async count (this: That, params?: T.CatCountRequest | TB.CatCountRequest, options?: TransportRequestOptions): Promise<T.CatCountResponse>

View File

@ -122,7 +122,7 @@ export default class Enrich {
async putPolicy (this: That, params: T.EnrichPutPolicyRequest | TB.EnrichPutPolicyRequest, options?: TransportRequestOptions): Promise<T.EnrichPutPolicyResponse>
async putPolicy (this: That, params: T.EnrichPutPolicyRequest | TB.EnrichPutPolicyRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['name']
const acceptedBody: string[] = ['geo_match', 'match']
const acceptedBody: string[] = ['geo_match', 'match', 'range']
const querystring: Record<string, any> = {}
// @ts-expect-error
const userBody: any = params?.body

View File

@ -37,12 +37,12 @@ import * as T from '../types'
import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }
export default async function FieldCapsApi (this: That, params: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FieldCapsResponse>
export default async function FieldCapsApi (this: That, params: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FieldCapsResponse, unknown>>
export default async function FieldCapsApi (this: That, params: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptions): Promise<T.FieldCapsResponse>
export default async function FieldCapsApi (this: That, params: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptions): Promise<any> {
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FieldCapsResponse>
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FieldCapsResponse, unknown>>
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptions): Promise<T.FieldCapsResponse>
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['index_filter', 'runtime_mappings']
const acceptedBody: string[] = ['fields', 'index_filter', 'runtime_mappings']
const querystring: Record<string, any> = {}
// @ts-expect-error
const userBody: any = params?.body
@ -53,6 +53,7 @@ export default async function FieldCapsApi (this: That, params: T.FieldCapsReque
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}
for (const key in params) {
if (acceptedBody.includes(key)) {
body = body ?? {}

View File

@ -104,7 +104,7 @@ export default class Fleet {
async search<TDocument = unknown> (this: That, params: T.FleetSearchRequest | TB.FleetSearchRequest, options?: TransportRequestOptions): Promise<T.FleetSearchResponse<TDocument>>
async search<TDocument = unknown> (this: That, params: T.FleetSearchRequest | TB.FleetSearchRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['aggregations', 'aggs', 'collapse', 'explain', 'from', 'highlight', 'track_total_hits', 'indices_boost', 'docvalue_fields', 'min_score', 'post_filter', 'profile', 'query', 'rescore', 'script_fields', 'search_after', 'size', 'slice', 'sort', '_source', 'fields', 'suggest', 'terminate_after', 'timeout', 'track_scores', 'version', 'seq_no_primary_term', 'stored_fields', 'pit', 'runtime_mappings', 'stats']
const acceptedBody: string[] = ['aggregations', 'aggs', 'collapse', 'explain', 'ext', 'from', 'highlight', 'track_total_hits', 'indices_boost', 'docvalue_fields', 'min_score', 'post_filter', 'profile', 'query', 'rescore', 'script_fields', 'search_after', 'size', 'slice', 'sort', '_source', 'fields', 'suggest', 'terminate_after', 'timeout', 'track_scores', 'version', 'seq_no_primary_term', 'stored_fields', 'pit', 'runtime_mappings', 'stats']
const querystring: Record<string, any> = {}
// @ts-expect-error
const userBody: any = params?.body

View File

@ -418,6 +418,33 @@ export default class Indices {
return await this.transport.request({ path, method, querystring, body }, options)
}
async downsample (this: That, params: T.IndicesDownsampleRequest | TB.IndicesDownsampleRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesDownsampleResponse>
async downsample (this: That, params: T.IndicesDownsampleRequest | TB.IndicesDownsampleRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesDownsampleResponse, unknown>>
async downsample (this: That, params: T.IndicesDownsampleRequest | TB.IndicesDownsampleRequest, options?: TransportRequestOptions): Promise<T.IndicesDownsampleResponse>
async downsample (this: That, params: T.IndicesDownsampleRequest | TB.IndicesDownsampleRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['index', 'target_index']
const acceptedBody: string[] = ['config']
const querystring: Record<string, any> = {}
// @ts-expect-error
let body: any = params.body ?? undefined
for (const key in params) {
if (acceptedBody.includes(key)) {
// @ts-expect-error
body = params[key]
} else if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
const method = 'POST'
const path = `/${encodeURIComponent(params.index.toString())}/_downsample/${encodeURIComponent(params.target_index.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
}
async exists (this: That, params: T.IndicesExistsRequest | TB.IndicesExistsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesExistsResponse>
async exists (this: That, params: T.IndicesExistsRequest | TB.IndicesExistsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesExistsResponse, unknown>>
async exists (this: That, params: T.IndicesExistsRequest | TB.IndicesExistsRequest, options?: TransportRequestOptions): Promise<T.IndicesExistsResponse>
@ -860,19 +887,31 @@ export default class Indices {
return await this.transport.request({ path, method, querystring, body }, options)
}
async modifyDataStream (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async modifyDataStream (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async modifyDataStream (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async modifyDataStream (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
async modifyDataStream (this: That, params: T.IndicesModifyDataStreamRequest | TB.IndicesModifyDataStreamRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesModifyDataStreamResponse>
async modifyDataStream (this: That, params: T.IndicesModifyDataStreamRequest | TB.IndicesModifyDataStreamRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesModifyDataStreamResponse, unknown>>
async modifyDataStream (this: That, params: T.IndicesModifyDataStreamRequest | TB.IndicesModifyDataStreamRequest, options?: TransportRequestOptions): Promise<T.IndicesModifyDataStreamResponse>
async modifyDataStream (this: That, params: T.IndicesModifyDataStreamRequest | TB.IndicesModifyDataStreamRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = []
const acceptedBody: string[] = ['actions']
const querystring: Record<string, any> = {}
const body = undefined
// @ts-expect-error
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
if (acceptedBody.includes(key)) {
body = body ?? {}
// @ts-expect-error
body[key] = params[key]
} else if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}

View File

@ -42,7 +42,7 @@ export default async function KnnSearchApi<TDocument = unknown> (this: That, par
export default async function KnnSearchApi<TDocument = unknown> (this: That, params: T.KnnSearchRequest | TB.KnnSearchRequest, options?: TransportRequestOptions): Promise<T.KnnSearchResponse<TDocument>>
export default async function KnnSearchApi<TDocument = unknown> (this: That, params: T.KnnSearchRequest | TB.KnnSearchRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['_source', 'docvalue_fields', 'stored_fields', 'fields', 'knn']
const acceptedBody: string[] = ['_source', 'docvalue_fields', 'stored_fields', 'fields', 'filter', 'knn']
const querystring: Record<string, any> = {}
// @ts-expect-error
const userBody: any = params?.body

View File

@ -135,10 +135,10 @@ export default class License {
return await this.transport.request({ path, method, querystring, body }, options)
}
async post (this: That, params: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.LicensePostResponse>
async post (this: That, params: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.LicensePostResponse, unknown>>
async post (this: That, params: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptions): Promise<T.LicensePostResponse>
async post (this: That, params: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptions): Promise<any> {
async post (this: That, params?: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.LicensePostResponse>
async post (this: That, params?: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.LicensePostResponse, unknown>>
async post (this: That, params?: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptions): Promise<T.LicensePostResponse>
async post (this: That, params?: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = []
const acceptedBody: string[] = ['license', 'licenses']
const querystring: Record<string, any> = {}
@ -151,6 +151,7 @@ export default class License {
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}
for (const key in params) {
if (acceptedBody.includes(key)) {
body = body ?? {}

View File

@ -73,10 +73,10 @@ export default class Migration {
return await this.transport.request({ path, method, querystring, body }, options)
}
async getFeatureUpgradeStatus (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async getFeatureUpgradeStatus (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async getFeatureUpgradeStatus (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async getFeatureUpgradeStatus (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
async getFeatureUpgradeStatus (this: That, params?: T.MigrationGetFeatureUpgradeStatusRequest | TB.MigrationGetFeatureUpgradeStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.MigrationGetFeatureUpgradeStatusResponse>
async getFeatureUpgradeStatus (this: That, params?: T.MigrationGetFeatureUpgradeStatusRequest | TB.MigrationGetFeatureUpgradeStatusRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.MigrationGetFeatureUpgradeStatusResponse, unknown>>
async getFeatureUpgradeStatus (this: That, params?: T.MigrationGetFeatureUpgradeStatusRequest | TB.MigrationGetFeatureUpgradeStatusRequest, options?: TransportRequestOptions): Promise<T.MigrationGetFeatureUpgradeStatusResponse>
async getFeatureUpgradeStatus (this: That, params?: T.MigrationGetFeatureUpgradeStatusRequest | TB.MigrationGetFeatureUpgradeStatusRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = []
const querystring: Record<string, any> = {}
const body = undefined
@ -86,6 +86,7 @@ export default class Migration {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
@ -95,10 +96,10 @@ export default class Migration {
return await this.transport.request({ path, method, querystring, body }, options)
}
async postFeatureUpgrade (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async postFeatureUpgrade (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async postFeatureUpgrade (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async postFeatureUpgrade (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
async postFeatureUpgrade (this: That, params?: T.MigrationPostFeatureUpgradeRequest | TB.MigrationPostFeatureUpgradeRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.MigrationPostFeatureUpgradeResponse>
async postFeatureUpgrade (this: That, params?: T.MigrationPostFeatureUpgradeRequest | TB.MigrationPostFeatureUpgradeRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.MigrationPostFeatureUpgradeResponse, unknown>>
async postFeatureUpgrade (this: That, params?: T.MigrationPostFeatureUpgradeRequest | TB.MigrationPostFeatureUpgradeRequest, options?: TransportRequestOptions): Promise<T.MigrationPostFeatureUpgradeResponse>
async postFeatureUpgrade (this: That, params?: T.MigrationPostFeatureUpgradeRequest | TB.MigrationPostFeatureUpgradeRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = []
const querystring: Record<string, any> = {}
const body = undefined
@ -108,6 +109,7 @@ export default class Migration {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}

View File

@ -43,6 +43,28 @@ export default class Ml {
this.transport = transport
}
async clearTrainedModelDeploymentCache (this: That, params: T.MlClearTrainedModelDeploymentCacheRequest | TB.MlClearTrainedModelDeploymentCacheRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.MlClearTrainedModelDeploymentCacheResponse>
async clearTrainedModelDeploymentCache (this: That, params: T.MlClearTrainedModelDeploymentCacheRequest | TB.MlClearTrainedModelDeploymentCacheRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.MlClearTrainedModelDeploymentCacheResponse, unknown>>
async clearTrainedModelDeploymentCache (this: That, params: T.MlClearTrainedModelDeploymentCacheRequest | TB.MlClearTrainedModelDeploymentCacheRequest, options?: TransportRequestOptions): Promise<T.MlClearTrainedModelDeploymentCacheResponse>
async clearTrainedModelDeploymentCache (this: That, params: T.MlClearTrainedModelDeploymentCacheRequest | TB.MlClearTrainedModelDeploymentCacheRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['model_id']
const querystring: Record<string, any> = {}
const body = undefined
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
const method = 'POST'
const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}/deployment/cache/_clear`
return await this.transport.request({ path, method, querystring, body }, options)
}
async closeJob (this: That, params: T.MlCloseJobRequest | TB.MlCloseJobRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.MlCloseJobResponse>
async closeJob (this: That, params: T.MlCloseJobRequest | TB.MlCloseJobRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.MlCloseJobResponse, unknown>>
async closeJob (this: That, params: T.MlCloseJobRequest | TB.MlCloseJobRequest, options?: TransportRequestOptions): Promise<T.MlCloseJobResponse>
@ -937,11 +959,11 @@ export default class Ml {
return await this.transport.request({ path, method, querystring, body }, options)
}
async getModelSnapshotUpgradeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async getModelSnapshotUpgradeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async getModelSnapshotUpgradeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async getModelSnapshotUpgradeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['job_id', 'snapshot_id']
async getMemoryStats (this: That, params?: T.MlGetMemoryStatsRequest | TB.MlGetMemoryStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.MlGetMemoryStatsResponse>
async getMemoryStats (this: That, params?: T.MlGetMemoryStatsRequest | TB.MlGetMemoryStatsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.MlGetMemoryStatsResponse, unknown>>
async getMemoryStats (this: That, params?: T.MlGetMemoryStatsRequest | TB.MlGetMemoryStatsRequest, options?: TransportRequestOptions): Promise<T.MlGetMemoryStatsResponse>
async getMemoryStats (this: That, params?: T.MlGetMemoryStatsRequest | TB.MlGetMemoryStatsRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['node_id']
const querystring: Record<string, any> = {}
const body = undefined
@ -950,6 +972,36 @@ export default class Ml {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
let method = ''
let path = ''
if (params.node_id != null) {
method = 'GET'
path = `/_ml/memory/${encodeURIComponent(params.node_id.toString())}/_stats`
} else {
method = 'GET'
path = '/_ml/memory/_stats'
}
return await this.transport.request({ path, method, querystring, body }, options)
}
async getModelSnapshotUpgradeStats (this: That, params: T.MlGetModelSnapshotUpgradeStatsRequest | TB.MlGetModelSnapshotUpgradeStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.MlGetModelSnapshotUpgradeStatsResponse>
async getModelSnapshotUpgradeStats (this: That, params: T.MlGetModelSnapshotUpgradeStatsRequest | TB.MlGetModelSnapshotUpgradeStatsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.MlGetModelSnapshotUpgradeStatsResponse, unknown>>
async getModelSnapshotUpgradeStats (this: That, params: T.MlGetModelSnapshotUpgradeStatsRequest | TB.MlGetModelSnapshotUpgradeStatsRequest, options?: TransportRequestOptions): Promise<T.MlGetModelSnapshotUpgradeStatsResponse>
async getModelSnapshotUpgradeStats (this: That, params: T.MlGetModelSnapshotUpgradeStatsRequest | TB.MlGetModelSnapshotUpgradeStatsRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['job_id', 'snapshot_id']
const querystring: Record<string, any> = {}
const body = undefined
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
@ -1128,12 +1180,12 @@ export default class Ml {
return await this.transport.request({ path, method, querystring, body }, options)
}
async inferTrainedModelDeployment (this: That, params: T.MlInferTrainedModelDeploymentRequest | TB.MlInferTrainedModelDeploymentRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.MlInferTrainedModelDeploymentResponse>
async inferTrainedModelDeployment (this: That, params: T.MlInferTrainedModelDeploymentRequest | TB.MlInferTrainedModelDeploymentRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.MlInferTrainedModelDeploymentResponse, unknown>>
async inferTrainedModelDeployment (this: That, params: T.MlInferTrainedModelDeploymentRequest | TB.MlInferTrainedModelDeploymentRequest, options?: TransportRequestOptions): Promise<T.MlInferTrainedModelDeploymentResponse>
async inferTrainedModelDeployment (this: That, params: T.MlInferTrainedModelDeploymentRequest | TB.MlInferTrainedModelDeploymentRequest, options?: TransportRequestOptions): Promise<any> {
async inferTrainedModel (this: That, params: T.MlInferTrainedModelRequest | TB.MlInferTrainedModelRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.MlInferTrainedModelResponse>
async inferTrainedModel (this: That, params: T.MlInferTrainedModelRequest | TB.MlInferTrainedModelRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.MlInferTrainedModelResponse, unknown>>
async inferTrainedModel (this: That, params: T.MlInferTrainedModelRequest | TB.MlInferTrainedModelRequest, options?: TransportRequestOptions): Promise<T.MlInferTrainedModelResponse>
async inferTrainedModel (this: That, params: T.MlInferTrainedModelRequest | TB.MlInferTrainedModelRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['model_id']
const acceptedBody: string[] = ['docs']
const acceptedBody: string[] = ['docs', 'inference_config']
const querystring: Record<string, any> = {}
// @ts-expect-error
const userBody: any = params?.body
@ -1158,7 +1210,7 @@ export default class Ml {
}
const method = 'POST'
const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}/deployment/_infer`
const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}/_infer`
return await this.transport.request({ path, method, querystring, body }, options)
}
@ -1651,7 +1703,7 @@ export default class Ml {
async putTrainedModelVocabulary (this: That, params: T.MlPutTrainedModelVocabularyRequest | TB.MlPutTrainedModelVocabularyRequest, options?: TransportRequestOptions): Promise<T.MlPutTrainedModelVocabularyResponse>
async putTrainedModelVocabulary (this: That, params: T.MlPutTrainedModelVocabularyRequest | TB.MlPutTrainedModelVocabularyRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['model_id']
const acceptedBody: string[] = ['vocabulary']
const acceptedBody: string[] = ['vocabulary', 'merges']
const querystring: Record<string, any> = {}
// @ts-expect-error
const userBody: any = params?.body

View File

@ -181,33 +181,6 @@ export default class Rollup {
return await this.transport.request({ path, method, querystring, body }, options)
}
async rollup (this: That, params: T.RollupRollupRequest | TB.RollupRollupRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.RollupRollupResponse>
async rollup (this: That, params: T.RollupRollupRequest | TB.RollupRollupRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.RollupRollupResponse, unknown>>
async rollup (this: That, params: T.RollupRollupRequest | TB.RollupRollupRequest, options?: TransportRequestOptions): Promise<T.RollupRollupResponse>
async rollup (this: That, params: T.RollupRollupRequest | TB.RollupRollupRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['index', 'rollup_index']
const acceptedBody: string[] = ['config']
const querystring: Record<string, any> = {}
// @ts-expect-error
let body: any = params.body ?? undefined
for (const key in params) {
if (acceptedBody.includes(key)) {
// @ts-expect-error
body = params[key]
} else if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
const method = 'POST'
const path = `/${encodeURIComponent(params.index.toString())}/_rollup/${encodeURIComponent(params.rollup_index.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
}
async rollupSearch<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.RollupRollupSearchRequest | TB.RollupRollupSearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.RollupRollupSearchResponse<TDocument, TAggregations>>
async rollupSearch<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.RollupRollupSearchRequest | TB.RollupRollupSearchRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.RollupRollupSearchResponse<TDocument, TAggregations>, unknown>>
async rollupSearch<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.RollupRollupSearchRequest | TB.RollupRollupSearchRequest, options?: TransportRequestOptions): Promise<T.RollupRollupSearchResponse<TDocument, TAggregations>>

View File

@ -42,7 +42,7 @@ export default async function SearchApi<TDocument = unknown, TAggregations = Rec
export default async function SearchApi<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params?: T.SearchRequest | TB.SearchRequest, options?: TransportRequestOptions): Promise<T.SearchResponse<TDocument, TAggregations>>
export default async function SearchApi<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params?: T.SearchRequest | TB.SearchRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['aggregations', 'aggs', 'collapse', 'explain', 'from', 'highlight', 'track_total_hits', 'indices_boost', 'docvalue_fields', 'min_score', 'post_filter', 'profile', 'query', 'rescore', 'script_fields', 'search_after', 'size', 'slice', 'sort', '_source', 'fields', 'suggest', 'terminate_after', 'timeout', 'track_scores', 'version', 'seq_no_primary_term', 'stored_fields', 'pit', 'runtime_mappings', 'stats']
const acceptedBody: string[] = ['aggregations', 'aggs', 'collapse', 'explain', 'ext', 'from', 'highlight', 'track_total_hits', 'indices_boost', 'docvalue_fields', 'knn', 'min_score', 'post_filter', 'profile', 'query', 'rescore', 'script_fields', 'search_after', 'size', 'slice', 'sort', '_source', 'fields', 'suggest', 'terminate_after', 'timeout', 'track_scores', 'version', 'seq_no_primary_term', 'stored_fields', 'pit', 'runtime_mappings', 'stats']
const querystring: Record<string, any> = {}
// @ts-expect-error
const userBody: any = params?.body
@ -58,7 +58,8 @@ export default async function SearchApi<TDocument = unknown, TAggregations = Rec
if (acceptedBody.includes(key)) {
body = body ?? {}
// @ts-expect-error
if (key === 'sort' && typeof params[key] === 'string' && params[key].includes(':')) {
if (key === 'sort' && typeof params[key] === 'string' && params[key].includes(':')) { // eslint-disable-line
// @ts-expect-error
querystring[key] = params[key]
} else {
// @ts-expect-error

View File

@ -43,6 +43,40 @@ export default class Security {
this.transport = transport
}
async activateUserProfile (this: That, params: T.SecurityActivateUserProfileRequest | TB.SecurityActivateUserProfileRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SecurityActivateUserProfileResponse>
async activateUserProfile (this: That, params: T.SecurityActivateUserProfileRequest | TB.SecurityActivateUserProfileRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SecurityActivateUserProfileResponse, unknown>>
async activateUserProfile (this: That, params: T.SecurityActivateUserProfileRequest | TB.SecurityActivateUserProfileRequest, options?: TransportRequestOptions): Promise<T.SecurityActivateUserProfileResponse>
async activateUserProfile (this: That, params: T.SecurityActivateUserProfileRequest | TB.SecurityActivateUserProfileRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = []
const acceptedBody: string[] = ['access_token', 'grant_type', 'password', 'username']
const querystring: Record<string, any> = {}
// @ts-expect-error
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
if (acceptedBody.includes(key)) {
body = body ?? {}
// @ts-expect-error
body[key] = params[key]
} else if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
const method = 'POST'
const path = '/_security/profile/_activate'
return await this.transport.request({ path, method, querystring, body }, options)
}
async authenticate (this: That, params?: T.SecurityAuthenticateRequest | TB.SecurityAuthenticateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SecurityAuthenticateResponse>
async authenticate (this: That, params?: T.SecurityAuthenticateRequest | TB.SecurityAuthenticateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SecurityAuthenticateResponse, unknown>>
async authenticate (this: That, params?: T.SecurityAuthenticateRequest | TB.SecurityAuthenticateRequest, options?: TransportRequestOptions): Promise<T.SecurityAuthenticateResponse>
@ -66,6 +100,28 @@ export default class Security {
return await this.transport.request({ path, method, querystring, body }, options)
}
async bulkUpdateApiKeys (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async bulkUpdateApiKeys (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async bulkUpdateApiKeys (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async bulkUpdateApiKeys (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = []
const querystring: Record<string, any> = {}
const body = undefined
params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
querystring[key] = params[key]
}
}
const method = 'POST'
const path = '/_security/api_key/_bulk_update'
return await this.transport.request({ path, method, querystring, body }, options)
}
async changePassword (this: That, params?: T.SecurityChangePasswordRequest | TB.SecurityChangePasswordRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SecurityChangePasswordResponse>
async changePassword (this: That, params?: T.SecurityChangePasswordRequest | TB.SecurityChangePasswordRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SecurityChangePasswordResponse, unknown>>
async changePassword (this: That, params?: T.SecurityChangePasswordRequest | TB.SecurityChangePasswordRequest, options?: TransportRequestOptions): Promise<T.SecurityChangePasswordResponse>
@ -414,6 +470,28 @@ export default class Security {
return await this.transport.request({ path, method, querystring, body }, options)
}
async disableUserProfile (this: That, params: T.SecurityDisableUserProfileRequest | TB.SecurityDisableUserProfileRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SecurityDisableUserProfileResponse>
async disableUserProfile (this: That, params: T.SecurityDisableUserProfileRequest | TB.SecurityDisableUserProfileRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SecurityDisableUserProfileResponse, unknown>>
async disableUserProfile (this: That, params: T.SecurityDisableUserProfileRequest | TB.SecurityDisableUserProfileRequest, options?: TransportRequestOptions): Promise<T.SecurityDisableUserProfileResponse>
async disableUserProfile (this: That, params: T.SecurityDisableUserProfileRequest | TB.SecurityDisableUserProfileRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['uid']
const querystring: Record<string, any> = {}
const body = undefined
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
const method = 'PUT'
const path = `/_security/profile/${encodeURIComponent(params.uid.toString())}/_disable`
return await this.transport.request({ path, method, querystring, body }, options)
}
async enableUser (this: That, params: T.SecurityEnableUserRequest | TB.SecurityEnableUserRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SecurityEnableUserResponse>
async enableUser (this: That, params: T.SecurityEnableUserRequest | TB.SecurityEnableUserRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SecurityEnableUserResponse, unknown>>
async enableUser (this: That, params: T.SecurityEnableUserRequest | TB.SecurityEnableUserRequest, options?: TransportRequestOptions): Promise<T.SecurityEnableUserResponse>
@ -436,6 +514,28 @@ export default class Security {
return await this.transport.request({ path, method, querystring, body }, options)
}
async enableUserProfile (this: That, params: T.SecurityEnableUserProfileRequest | TB.SecurityEnableUserProfileRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SecurityEnableUserProfileResponse>
async enableUserProfile (this: That, params: T.SecurityEnableUserProfileRequest | TB.SecurityEnableUserProfileRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SecurityEnableUserProfileResponse, unknown>>
async enableUserProfile (this: That, params: T.SecurityEnableUserProfileRequest | TB.SecurityEnableUserProfileRequest, options?: TransportRequestOptions): Promise<T.SecurityEnableUserProfileResponse>
async enableUserProfile (this: That, params: T.SecurityEnableUserProfileRequest | TB.SecurityEnableUserProfileRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['uid']
const querystring: Record<string, any> = {}
const body = undefined
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
const method = 'PUT'
const path = `/_security/profile/${encodeURIComponent(params.uid.toString())}/_enable`
return await this.transport.request({ path, method, querystring, body }, options)
}
async enrollKibana (this: That, params?: T.SecurityEnrollKibanaRequest | TB.SecurityEnrollKibanaRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SecurityEnrollKibanaResponse>
async enrollKibana (this: That, params?: T.SecurityEnrollKibanaRequest | TB.SecurityEnrollKibanaRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SecurityEnrollKibanaResponse, unknown>>
async enrollKibana (this: That, params?: T.SecurityEnrollKibanaRequest | TB.SecurityEnrollKibanaRequest, options?: TransportRequestOptions): Promise<T.SecurityEnrollKibanaResponse>
@ -764,12 +864,34 @@ export default class Security {
return await this.transport.request({ path, method, querystring, body }, options)
}
async getUserProfile (this: That, params: T.SecurityGetUserProfileRequest | TB.SecurityGetUserProfileRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SecurityGetUserProfileResponse>
async getUserProfile (this: That, params: T.SecurityGetUserProfileRequest | TB.SecurityGetUserProfileRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SecurityGetUserProfileResponse, unknown>>
async getUserProfile (this: That, params: T.SecurityGetUserProfileRequest | TB.SecurityGetUserProfileRequest, options?: TransportRequestOptions): Promise<T.SecurityGetUserProfileResponse>
async getUserProfile (this: That, params: T.SecurityGetUserProfileRequest | TB.SecurityGetUserProfileRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['uid']
const querystring: Record<string, any> = {}
const body = undefined
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
const method = 'GET'
const path = `/_security/profile/${encodeURIComponent(params.uid.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
}
async grantApiKey (this: That, params: T.SecurityGrantApiKeyRequest | TB.SecurityGrantApiKeyRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SecurityGrantApiKeyResponse>
async grantApiKey (this: That, params: T.SecurityGrantApiKeyRequest | TB.SecurityGrantApiKeyRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SecurityGrantApiKeyResponse, unknown>>
async grantApiKey (this: That, params: T.SecurityGrantApiKeyRequest | TB.SecurityGrantApiKeyRequest, options?: TransportRequestOptions): Promise<T.SecurityGrantApiKeyResponse>
async grantApiKey (this: That, params: T.SecurityGrantApiKeyRequest | TB.SecurityGrantApiKeyRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = []
const acceptedBody: string[] = ['api_key', 'grant_type', 'access_token', 'username', 'password']
const acceptedBody: string[] = ['api_key', 'grant_type', 'access_token', 'username', 'password', 'run_as']
const querystring: Record<string, any> = {}
// @ts-expect-error
const userBody: any = params?.body
@ -840,6 +962,40 @@ export default class Security {
return await this.transport.request({ path, method, querystring, body }, options)
}
async hasPrivilegesUserProfile (this: That, params: T.SecurityHasPrivilegesUserProfileRequest | TB.SecurityHasPrivilegesUserProfileRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SecurityHasPrivilegesUserProfileResponse>
async hasPrivilegesUserProfile (this: That, params: T.SecurityHasPrivilegesUserProfileRequest | TB.SecurityHasPrivilegesUserProfileRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SecurityHasPrivilegesUserProfileResponse, unknown>>
async hasPrivilegesUserProfile (this: That, params: T.SecurityHasPrivilegesUserProfileRequest | TB.SecurityHasPrivilegesUserProfileRequest, options?: TransportRequestOptions): Promise<T.SecurityHasPrivilegesUserProfileResponse>
async hasPrivilegesUserProfile (this: That, params: T.SecurityHasPrivilegesUserProfileRequest | TB.SecurityHasPrivilegesUserProfileRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = []
const acceptedBody: string[] = ['uids', 'privileges']
const querystring: Record<string, any> = {}
// @ts-expect-error
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
if (acceptedBody.includes(key)) {
body = body ?? {}
// @ts-expect-error
body[key] = params[key]
} else if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
const method = body != null ? 'POST' : 'GET'
const path = '/_security/profile/_has_privileges'
return await this.transport.request({ path, method, querystring, body }, options)
}
async invalidateApiKey (this: That, params?: T.SecurityInvalidateApiKeyRequest | TB.SecurityInvalidateApiKeyRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SecurityInvalidateApiKeyResponse>
async invalidateApiKey (this: That, params?: T.SecurityInvalidateApiKeyRequest | TB.SecurityInvalidateApiKeyRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SecurityInvalidateApiKeyResponse, unknown>>
async invalidateApiKey (this: That, params?: T.SecurityInvalidateApiKeyRequest | TB.SecurityInvalidateApiKeyRequest, options?: TransportRequestOptions): Promise<T.SecurityInvalidateApiKeyResponse>
@ -1332,4 +1488,107 @@ export default class Security {
const path = `/_security/saml/metadata/${encodeURIComponent(params.realm_name.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
}
async suggestUserProfiles (this: That, params?: T.SecuritySuggestUserProfilesRequest | TB.SecuritySuggestUserProfilesRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SecuritySuggestUserProfilesResponse>
async suggestUserProfiles (this: That, params?: T.SecuritySuggestUserProfilesRequest | TB.SecuritySuggestUserProfilesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SecuritySuggestUserProfilesResponse, unknown>>
async suggestUserProfiles (this: That, params?: T.SecuritySuggestUserProfilesRequest | TB.SecuritySuggestUserProfilesRequest, options?: TransportRequestOptions): Promise<T.SecuritySuggestUserProfilesResponse>
async suggestUserProfiles (this: That, params?: T.SecuritySuggestUserProfilesRequest | TB.SecuritySuggestUserProfilesRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = []
const acceptedBody: string[] = ['name', 'size', 'data', 'hint']
const querystring: Record<string, any> = {}
// @ts-expect-error
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
body = userBody != null ? { ...userBody } : undefined
}
params = params ?? {}
for (const key in params) {
if (acceptedBody.includes(key)) {
body = body ?? {}
// @ts-expect-error
body[key] = params[key]
} else if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
const method = body != null ? 'POST' : 'GET'
const path = '/_security/profile/_suggest'
return await this.transport.request({ path, method, querystring, body }, options)
}
async updateApiKey (this: That, params: T.SecurityUpdateApiKeyRequest | TB.SecurityUpdateApiKeyRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SecurityUpdateApiKeyResponse>
async updateApiKey (this: That, params: T.SecurityUpdateApiKeyRequest | TB.SecurityUpdateApiKeyRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SecurityUpdateApiKeyResponse, unknown>>
async updateApiKey (this: That, params: T.SecurityUpdateApiKeyRequest | TB.SecurityUpdateApiKeyRequest, options?: TransportRequestOptions): Promise<T.SecurityUpdateApiKeyResponse>
async updateApiKey (this: That, params: T.SecurityUpdateApiKeyRequest | TB.SecurityUpdateApiKeyRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['id']
const acceptedBody: string[] = ['role_descriptors', 'metadata']
const querystring: Record<string, any> = {}
// @ts-expect-error
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
if (acceptedBody.includes(key)) {
body = body ?? {}
// @ts-expect-error
body[key] = params[key]
} else if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
const method = 'PUT'
const path = `/_security/api_key/${encodeURIComponent(params.id.toString())}`
return await this.transport.request({ path, method, querystring, body }, options)
}
async updateUserProfileData (this: That, params: T.SecurityUpdateUserProfileDataRequest | TB.SecurityUpdateUserProfileDataRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SecurityUpdateUserProfileDataResponse>
async updateUserProfileData (this: That, params: T.SecurityUpdateUserProfileDataRequest | TB.SecurityUpdateUserProfileDataRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SecurityUpdateUserProfileDataResponse, unknown>>
async updateUserProfileData (this: That, params: T.SecurityUpdateUserProfileDataRequest | TB.SecurityUpdateUserProfileDataRequest, options?: TransportRequestOptions): Promise<T.SecurityUpdateUserProfileDataResponse>
async updateUserProfileData (this: That, params: T.SecurityUpdateUserProfileDataRequest | TB.SecurityUpdateUserProfileDataRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['uid']
const acceptedBody: string[] = ['labels', 'data']
const querystring: Record<string, any> = {}
// @ts-expect-error
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
if (acceptedBody.includes(key)) {
body = body ?? {}
// @ts-expect-error
body[key] = params[key]
} else if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
const method = 'PUT'
const path = `/_security/profile/${encodeURIComponent(params.uid.toString())}/_data`
return await this.transport.request({ path, method, querystring, body }, options)
}
}

View File

@ -100,11 +100,23 @@ export default class Shutdown {
async putNode (this: That, params: T.ShutdownPutNodeRequest | TB.ShutdownPutNodeRequest, options?: TransportRequestOptions): Promise<T.ShutdownPutNodeResponse>
async putNode (this: That, params: T.ShutdownPutNodeRequest | TB.ShutdownPutNodeRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['node_id']
const acceptedBody: string[] = ['type', 'reason', 'allocation_delay', 'target_node_name']
const querystring: Record<string, any> = {}
const body = undefined
// @ts-expect-error
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
body = userBody != null ? { ...userBody } : undefined
}
for (const key in params) {
if (acceptedPath.includes(key)) {
if (acceptedBody.includes(key)) {
body = body ?? {}
// @ts-expect-error
body[key] = params[key]
} else if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error

View File

@ -26,7 +26,6 @@
// DO NOT MODIFY IT BY HAND. Instead, modify the source open api file,
// and elastic/elastic-client-generator-js to regenerate this file again.
import InternalApi from './api/_internal'
import AsyncSearchApi from './api/async_search'
import AutoscalingApi from './api/autoscaling'
import bulkApi from './api/bulk'
@ -106,7 +105,6 @@ import XpackApi from './api/xpack'
export default interface API {
new(): API
Internal: InternalApi
asyncSearch: AsyncSearchApi
autoscaling: AutoscalingApi
bulk: typeof bulkApi
@ -185,7 +183,6 @@ export default interface API {
xpack: XpackApi
}
const kInternal = Symbol('Internal')
const kAsyncSearch = Symbol('AsyncSearch')
const kAutoscaling = Symbol('Autoscaling')
const kCat = Symbol('Cat')
@ -221,7 +218,6 @@ const kWatcher = Symbol('Watcher')
const kXpack = Symbol('Xpack')
export default class API {
[kInternal]: symbol | null
[kAsyncSearch]: symbol | null
[kAutoscaling]: symbol | null
[kCat]: symbol | null
@ -256,7 +252,6 @@ export default class API {
[kWatcher]: symbol | null
[kXpack]: symbol | null
constructor () {
this[kInternal] = null
this[kAsyncSearch] = null
this[kAutoscaling] = null
this[kCat] = null
@ -338,9 +333,6 @@ API.prototype.updateByQuery = updateByQueryApi
API.prototype.updateByQueryRethrottle = updateByQueryRethrottleApi
Object.defineProperties(API.prototype, {
Internal: {
get () { return this[kInternal] === null ? (this[kInternal] = new InternalApi(this.transport)) : this[kInternal] }
},
asyncSearch: {
get () { return this[kAsyncSearch] === null ? (this[kAsyncSearch] = new AsyncSearchApi(this.transport)) : this[kAsyncSearch] }
},

View File

@ -1,527 +0,0 @@
/*
* 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.
*/
/* eslint-disable import/export */
/* eslint-disable @typescript-eslint/no-misused-new */
/* eslint-disable @typescript-eslint/no-extraneous-class */
/* eslint-disable @typescript-eslint/no-unused-vars */
// This file was automatically generated by elastic/elastic-client-generator-js
// DO NOT MODIFY IT BY HAND. Instead, modify the source open api file,
// and elastic/elastic-client-generator-js to regenerate this file again.
import {
Serializer,
Diagnostic,
BaseConnectionPool,
TransportRequestParams,
TransportRequestOptions,
TransportResult
} from '@elastic/transport'
import * as T from './types'
import * as TB from './typesWithBodyKey'
import SniffingTransport from '../sniffingTransport'
import Helpers from '../helpers'
import { ClientOptions } from '../client'
interface KibanaClient {
diagnostic: Diagnostic
name: string | symbol
connectionPool: BaseConnectionPool
transport: Omit<SniffingTransport, 'request'> & {
request: <TResponse = unknown, TContext = any>(params: TransportRequestParams, options?: TransportRequestOptions) => Promise<TransportResult<TResponse, TContext>>
}
serializer: Serializer
helpers: Helpers
child: (opts?: ClientOptions) => KibanaClient
close: () => Promise<void>
Internal: {
deleteDesiredNodes: <TContext = unknown>(params?: T.TODO, options?: TransportRequestOptions) => Promise<TransportResult<T.TODO, unknown>>
getDesiredNodes: <TContext = unknown>(params?: T.TODO, options?: TransportRequestOptions) => Promise<TransportResult<T.TODO, unknown>>
updateDesiredNodes: <TContext = unknown>(params?: T.TODO, options?: TransportRequestOptions) => Promise<TransportResult<T.TODO, unknown>>
}
asyncSearch: {
delete: <TContext = unknown>(params: T.AsyncSearchDeleteRequest| TB.AsyncSearchDeleteRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.AsyncSearchDeleteResponse, TContext>>
get: <TDocument = unknown, TContext = unknown>(params: T.AsyncSearchGetRequest| TB.AsyncSearchGetRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.AsyncSearchGetResponse<TDocument>, TContext>>
status: <TContext = unknown>(params: T.AsyncSearchStatusRequest| TB.AsyncSearchStatusRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.AsyncSearchStatusResponse, TContext>>
submit: <TDocument = unknown, TContext = unknown>(params?: T.AsyncSearchSubmitRequest| TB.AsyncSearchSubmitRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.AsyncSearchSubmitResponse<TDocument>, TContext>>
}
autoscaling: {
deleteAutoscalingPolicy: <TContext = unknown>(params: T.AutoscalingDeleteAutoscalingPolicyRequest| TB.AutoscalingDeleteAutoscalingPolicyRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.AutoscalingDeleteAutoscalingPolicyResponse, TContext>>
getAutoscalingCapacity: <TContext = unknown>(params?: T.AutoscalingGetAutoscalingCapacityRequest| TB.AutoscalingGetAutoscalingCapacityRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.AutoscalingGetAutoscalingCapacityResponse, TContext>>
getAutoscalingPolicy: <TContext = unknown>(params: T.AutoscalingGetAutoscalingPolicyRequest| TB.AutoscalingGetAutoscalingPolicyRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.AutoscalingGetAutoscalingPolicyResponse, TContext>>
putAutoscalingPolicy: <TContext = unknown>(params: T.AutoscalingPutAutoscalingPolicyRequest| TB.AutoscalingPutAutoscalingPolicyRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.AutoscalingPutAutoscalingPolicyResponse, TContext>>
}
bulk: <TDocument = unknown, TPartialDocument = unknown, TContext = unknown>(params: T.BulkRequest<TDocument, TPartialDocument>| TB.BulkRequest<TDocument, TPartialDocument>, options?: TransportRequestOptions) => Promise<TransportResult<T.BulkResponse, TContext>>
cat: {
aliases: <TContext = unknown>(params?: T.CatAliasesRequest| TB.CatAliasesRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CatAliasesResponse, TContext>>
allocation: <TContext = unknown>(params?: T.CatAllocationRequest| TB.CatAllocationRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CatAllocationResponse, TContext>>
count: <TContext = unknown>(params?: T.CatCountRequest| TB.CatCountRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CatCountResponse, TContext>>
fielddata: <TContext = unknown>(params?: T.CatFielddataRequest| TB.CatFielddataRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CatFielddataResponse, TContext>>
health: <TContext = unknown>(params?: T.CatHealthRequest| TB.CatHealthRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CatHealthResponse, TContext>>
help: <TContext = unknown>(params?: T.CatHelpRequest| TB.CatHelpRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CatHelpResponse, TContext>>
indices: <TContext = unknown>(params?: T.CatIndicesRequest| TB.CatIndicesRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CatIndicesResponse, TContext>>
master: <TContext = unknown>(params?: T.CatMasterRequest| TB.CatMasterRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CatMasterResponse, TContext>>
mlDataFrameAnalytics: <TContext = unknown>(params?: T.CatMlDataFrameAnalyticsRequest| TB.CatMlDataFrameAnalyticsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CatMlDataFrameAnalyticsResponse, TContext>>
mlDatafeeds: <TContext = unknown>(params?: T.CatMlDatafeedsRequest| TB.CatMlDatafeedsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CatMlDatafeedsResponse, TContext>>
mlJobs: <TContext = unknown>(params?: T.CatMlJobsRequest| TB.CatMlJobsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CatMlJobsResponse, TContext>>
mlTrainedModels: <TContext = unknown>(params?: T.CatMlTrainedModelsRequest| TB.CatMlTrainedModelsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CatMlTrainedModelsResponse, TContext>>
nodeattrs: <TContext = unknown>(params?: T.CatNodeattrsRequest| TB.CatNodeattrsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CatNodeattrsResponse, TContext>>
nodes: <TContext = unknown>(params?: T.CatNodesRequest| TB.CatNodesRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CatNodesResponse, TContext>>
pendingTasks: <TContext = unknown>(params?: T.CatPendingTasksRequest| TB.CatPendingTasksRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CatPendingTasksResponse, TContext>>
plugins: <TContext = unknown>(params?: T.CatPluginsRequest| TB.CatPluginsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CatPluginsResponse, TContext>>
recovery: <TContext = unknown>(params?: T.CatRecoveryRequest| TB.CatRecoveryRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CatRecoveryResponse, TContext>>
repositories: <TContext = unknown>(params?: T.CatRepositoriesRequest| TB.CatRepositoriesRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CatRepositoriesResponse, TContext>>
segments: <TContext = unknown>(params?: T.CatSegmentsRequest| TB.CatSegmentsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CatSegmentsResponse, TContext>>
shards: <TContext = unknown>(params?: T.CatShardsRequest| TB.CatShardsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CatShardsResponse, TContext>>
snapshots: <TContext = unknown>(params?: T.CatSnapshotsRequest| TB.CatSnapshotsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CatSnapshotsResponse, TContext>>
tasks: <TContext = unknown>(params?: T.CatTasksRequest| TB.CatTasksRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CatTasksResponse, TContext>>
templates: <TContext = unknown>(params?: T.CatTemplatesRequest| TB.CatTemplatesRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CatTemplatesResponse, TContext>>
threadPool: <TContext = unknown>(params?: T.CatThreadPoolRequest| TB.CatThreadPoolRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CatThreadPoolResponse, TContext>>
transforms: <TContext = unknown>(params?: T.CatTransformsRequest| TB.CatTransformsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CatTransformsResponse, TContext>>
}
ccr: {
deleteAutoFollowPattern: <TContext = unknown>(params: T.CcrDeleteAutoFollowPatternRequest| TB.CcrDeleteAutoFollowPatternRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CcrDeleteAutoFollowPatternResponse, TContext>>
follow: <TContext = unknown>(params: T.CcrFollowRequest| TB.CcrFollowRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CcrFollowResponse, TContext>>
followInfo: <TContext = unknown>(params: T.CcrFollowInfoRequest| TB.CcrFollowInfoRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CcrFollowInfoResponse, TContext>>
followStats: <TContext = unknown>(params: T.CcrFollowStatsRequest| TB.CcrFollowStatsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CcrFollowStatsResponse, TContext>>
forgetFollower: <TContext = unknown>(params: T.CcrForgetFollowerRequest| TB.CcrForgetFollowerRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CcrForgetFollowerResponse, TContext>>
getAutoFollowPattern: <TContext = unknown>(params?: T.CcrGetAutoFollowPatternRequest| TB.CcrGetAutoFollowPatternRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CcrGetAutoFollowPatternResponse, TContext>>
pauseAutoFollowPattern: <TContext = unknown>(params: T.CcrPauseAutoFollowPatternRequest| TB.CcrPauseAutoFollowPatternRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CcrPauseAutoFollowPatternResponse, TContext>>
pauseFollow: <TContext = unknown>(params: T.CcrPauseFollowRequest| TB.CcrPauseFollowRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CcrPauseFollowResponse, TContext>>
putAutoFollowPattern: <TContext = unknown>(params: T.CcrPutAutoFollowPatternRequest| TB.CcrPutAutoFollowPatternRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CcrPutAutoFollowPatternResponse, TContext>>
resumeAutoFollowPattern: <TContext = unknown>(params: T.CcrResumeAutoFollowPatternRequest| TB.CcrResumeAutoFollowPatternRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CcrResumeAutoFollowPatternResponse, TContext>>
resumeFollow: <TContext = unknown>(params: T.CcrResumeFollowRequest| TB.CcrResumeFollowRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CcrResumeFollowResponse, TContext>>
stats: <TContext = unknown>(params?: T.CcrStatsRequest| TB.CcrStatsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CcrStatsResponse, TContext>>
unfollow: <TContext = unknown>(params: T.CcrUnfollowRequest| TB.CcrUnfollowRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CcrUnfollowResponse, TContext>>
}
clearScroll: <TContext = unknown>(params?: T.ClearScrollRequest| TB.ClearScrollRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.ClearScrollResponse, TContext>>
closePointInTime: <TContext = unknown>(params?: T.ClosePointInTimeRequest| TB.ClosePointInTimeRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.ClosePointInTimeResponse, TContext>>
cluster: {
allocationExplain: <TContext = unknown>(params?: T.ClusterAllocationExplainRequest| TB.ClusterAllocationExplainRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.ClusterAllocationExplainResponse, TContext>>
deleteComponentTemplate: <TContext = unknown>(params: T.ClusterDeleteComponentTemplateRequest| TB.ClusterDeleteComponentTemplateRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.ClusterDeleteComponentTemplateResponse, TContext>>
deleteVotingConfigExclusions: <TContext = unknown>(params?: T.ClusterDeleteVotingConfigExclusionsRequest| TB.ClusterDeleteVotingConfigExclusionsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.ClusterDeleteVotingConfigExclusionsResponse, TContext>>
existsComponentTemplate: <TContext = unknown>(params: T.ClusterExistsComponentTemplateRequest| TB.ClusterExistsComponentTemplateRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.ClusterExistsComponentTemplateResponse, TContext>>
getComponentTemplate: <TContext = unknown>(params?: T.ClusterGetComponentTemplateRequest| TB.ClusterGetComponentTemplateRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.ClusterGetComponentTemplateResponse, TContext>>
getSettings: <TContext = unknown>(params?: T.ClusterGetSettingsRequest| TB.ClusterGetSettingsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.ClusterGetSettingsResponse, TContext>>
health: <TContext = unknown>(params?: T.ClusterHealthRequest| TB.ClusterHealthRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.ClusterHealthResponse, TContext>>
pendingTasks: <TContext = unknown>(params?: T.ClusterPendingTasksRequest| TB.ClusterPendingTasksRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.ClusterPendingTasksResponse, TContext>>
postVotingConfigExclusions: <TContext = unknown>(params?: T.ClusterPostVotingConfigExclusionsRequest| TB.ClusterPostVotingConfigExclusionsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.ClusterPostVotingConfigExclusionsResponse, TContext>>
putComponentTemplate: <TContext = unknown>(params: T.ClusterPutComponentTemplateRequest| TB.ClusterPutComponentTemplateRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.ClusterPutComponentTemplateResponse, TContext>>
putSettings: <TContext = unknown>(params?: T.ClusterPutSettingsRequest| TB.ClusterPutSettingsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.ClusterPutSettingsResponse, TContext>>
remoteInfo: <TContext = unknown>(params?: T.ClusterRemoteInfoRequest| TB.ClusterRemoteInfoRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.ClusterRemoteInfoResponse, TContext>>
reroute: <TContext = unknown>(params?: T.ClusterRerouteRequest| TB.ClusterRerouteRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.ClusterRerouteResponse, TContext>>
state: <TContext = unknown>(params?: T.ClusterStateRequest| TB.ClusterStateRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.ClusterStateResponse, TContext>>
stats: <TContext = unknown>(params?: T.ClusterStatsRequest| TB.ClusterStatsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.ClusterStatsResponse, TContext>>
}
count: <TContext = unknown>(params?: T.CountRequest| TB.CountRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.CountResponse, TContext>>
create: <TDocument = unknown, TContext = unknown>(params: T.CreateRequest<TDocument>| TB.CreateRequest<TDocument>, options?: TransportRequestOptions) => Promise<TransportResult<T.CreateResponse, TContext>>
danglingIndices: {
deleteDanglingIndex: <TContext = unknown>(params: T.DanglingIndicesDeleteDanglingIndexRequest| TB.DanglingIndicesDeleteDanglingIndexRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.DanglingIndicesDeleteDanglingIndexResponse, TContext>>
importDanglingIndex: <TContext = unknown>(params: T.DanglingIndicesImportDanglingIndexRequest| TB.DanglingIndicesImportDanglingIndexRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.DanglingIndicesImportDanglingIndexResponse, TContext>>
listDanglingIndices: <TContext = unknown>(params?: T.DanglingIndicesListDanglingIndicesRequest| TB.DanglingIndicesListDanglingIndicesRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.DanglingIndicesListDanglingIndicesResponse, TContext>>
}
delete: <TContext = unknown>(params: T.DeleteRequest| TB.DeleteRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.DeleteResponse, TContext>>
deleteByQuery: <TContext = unknown>(params: T.DeleteByQueryRequest| TB.DeleteByQueryRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.DeleteByQueryResponse, TContext>>
deleteByQueryRethrottle: <TContext = unknown>(params: T.DeleteByQueryRethrottleRequest| TB.DeleteByQueryRethrottleRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.DeleteByQueryRethrottleResponse, TContext>>
deleteScript: <TContext = unknown>(params: T.DeleteScriptRequest| TB.DeleteScriptRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.DeleteScriptResponse, TContext>>
enrich: {
deletePolicy: <TContext = unknown>(params: T.EnrichDeletePolicyRequest| TB.EnrichDeletePolicyRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.EnrichDeletePolicyResponse, TContext>>
executePolicy: <TContext = unknown>(params: T.EnrichExecutePolicyRequest| TB.EnrichExecutePolicyRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.EnrichExecutePolicyResponse, TContext>>
getPolicy: <TContext = unknown>(params?: T.EnrichGetPolicyRequest| TB.EnrichGetPolicyRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.EnrichGetPolicyResponse, TContext>>
putPolicy: <TContext = unknown>(params: T.EnrichPutPolicyRequest| TB.EnrichPutPolicyRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.EnrichPutPolicyResponse, TContext>>
stats: <TContext = unknown>(params?: T.EnrichStatsRequest| TB.EnrichStatsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.EnrichStatsResponse, TContext>>
}
eql: {
delete: <TContext = unknown>(params: T.EqlDeleteRequest| TB.EqlDeleteRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.EqlDeleteResponse, TContext>>
get: <TEvent = unknown, TContext = unknown>(params: T.EqlGetRequest| TB.EqlGetRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.EqlGetResponse<TEvent>, TContext>>
getStatus: <TContext = unknown>(params: T.EqlGetStatusRequest| TB.EqlGetStatusRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.EqlGetStatusResponse, TContext>>
search: <TEvent = unknown, TContext = unknown>(params: T.EqlSearchRequest| TB.EqlSearchRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.EqlSearchResponse<TEvent>, TContext>>
}
exists: <TContext = unknown>(params: T.ExistsRequest| TB.ExistsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.ExistsResponse, TContext>>
existsSource: <TContext = unknown>(params: T.ExistsSourceRequest| TB.ExistsSourceRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.ExistsSourceResponse, TContext>>
explain: <TDocument = unknown, TContext = unknown>(params: T.ExplainRequest| TB.ExplainRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.ExplainResponse<TDocument>, TContext>>
features: {
getFeatures: <TContext = unknown>(params?: T.FeaturesGetFeaturesRequest| TB.FeaturesGetFeaturesRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.FeaturesGetFeaturesResponse, TContext>>
resetFeatures: <TContext = unknown>(params?: T.FeaturesResetFeaturesRequest| TB.FeaturesResetFeaturesRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.FeaturesResetFeaturesResponse, TContext>>
}
fieldCaps: <TContext = unknown>(params: T.FieldCapsRequest| TB.FieldCapsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.FieldCapsResponse, TContext>>
fleet: {
globalCheckpoints: <TContext = unknown>(params: T.FleetGlobalCheckpointsRequest| TB.FleetGlobalCheckpointsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.FleetGlobalCheckpointsResponse, TContext>>
msearch: <TDocument = unknown, TContext = unknown>(params: T.FleetMsearchRequest| TB.FleetMsearchRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.FleetMsearchResponse<TDocument>, TContext>>
search: <TDocument = unknown, TContext = unknown>(params: T.FleetSearchRequest| TB.FleetSearchRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.FleetSearchResponse<TDocument>, TContext>>
}
get: <TDocument = unknown, TContext = unknown>(params: T.GetRequest| TB.GetRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.GetResponse<TDocument>, TContext>>
getScript: <TContext = unknown>(params: T.GetScriptRequest| TB.GetScriptRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.GetScriptResponse, TContext>>
getScriptContext: <TContext = unknown>(params?: T.GetScriptContextRequest| TB.GetScriptContextRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.GetScriptContextResponse, TContext>>
getScriptLanguages: <TContext = unknown>(params?: T.GetScriptLanguagesRequest| TB.GetScriptLanguagesRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.GetScriptLanguagesResponse, TContext>>
getSource: <TDocument = unknown, TContext = unknown>(params: T.GetSourceRequest| TB.GetSourceRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.GetSourceResponse<TDocument>, TContext>>
graph: {
explore: <TContext = unknown>(params: T.GraphExploreRequest| TB.GraphExploreRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.GraphExploreResponse, TContext>>
}
ilm: {
deleteLifecycle: <TContext = unknown>(params: T.IlmDeleteLifecycleRequest| TB.IlmDeleteLifecycleRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IlmDeleteLifecycleResponse, TContext>>
explainLifecycle: <TContext = unknown>(params: T.IlmExplainLifecycleRequest| TB.IlmExplainLifecycleRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IlmExplainLifecycleResponse, TContext>>
getLifecycle: <TContext = unknown>(params?: T.IlmGetLifecycleRequest| TB.IlmGetLifecycleRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IlmGetLifecycleResponse, TContext>>
getStatus: <TContext = unknown>(params?: T.IlmGetStatusRequest| TB.IlmGetStatusRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IlmGetStatusResponse, TContext>>
migrateToDataTiers: <TContext = unknown>(params?: T.IlmMigrateToDataTiersRequest| TB.IlmMigrateToDataTiersRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IlmMigrateToDataTiersResponse, TContext>>
moveToStep: <TContext = unknown>(params: T.IlmMoveToStepRequest| TB.IlmMoveToStepRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IlmMoveToStepResponse, TContext>>
putLifecycle: <TContext = unknown>(params: T.IlmPutLifecycleRequest| TB.IlmPutLifecycleRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IlmPutLifecycleResponse, TContext>>
removePolicy: <TContext = unknown>(params: T.IlmRemovePolicyRequest| TB.IlmRemovePolicyRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IlmRemovePolicyResponse, TContext>>
retry: <TContext = unknown>(params: T.IlmRetryRequest| TB.IlmRetryRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IlmRetryResponse, TContext>>
start: <TContext = unknown>(params?: T.IlmStartRequest| TB.IlmStartRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IlmStartResponse, TContext>>
stop: <TContext = unknown>(params?: T.IlmStopRequest| TB.IlmStopRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IlmStopResponse, TContext>>
}
index: <TDocument = unknown, TContext = unknown>(params: T.IndexRequest<TDocument>| TB.IndexRequest<TDocument>, options?: TransportRequestOptions) => Promise<TransportResult<T.IndexResponse, TContext>>
indices: {
addBlock: <TContext = unknown>(params: T.IndicesAddBlockRequest| TB.IndicesAddBlockRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesAddBlockResponse, TContext>>
analyze: <TContext = unknown>(params?: T.IndicesAnalyzeRequest| TB.IndicesAnalyzeRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesAnalyzeResponse, TContext>>
clearCache: <TContext = unknown>(params?: T.IndicesClearCacheRequest| TB.IndicesClearCacheRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesClearCacheResponse, TContext>>
clone: <TContext = unknown>(params: T.IndicesCloneRequest| TB.IndicesCloneRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesCloneResponse, TContext>>
close: <TContext = unknown>(params: T.IndicesCloseRequest| TB.IndicesCloseRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesCloseResponse, TContext>>
create: <TContext = unknown>(params: T.IndicesCreateRequest| TB.IndicesCreateRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesCreateResponse, TContext>>
createDataStream: <TContext = unknown>(params: T.IndicesCreateDataStreamRequest| TB.IndicesCreateDataStreamRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesCreateDataStreamResponse, TContext>>
dataStreamsStats: <TContext = unknown>(params?: T.IndicesDataStreamsStatsRequest| TB.IndicesDataStreamsStatsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesDataStreamsStatsResponse, TContext>>
delete: <TContext = unknown>(params: T.IndicesDeleteRequest| TB.IndicesDeleteRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesDeleteResponse, TContext>>
deleteAlias: <TContext = unknown>(params: T.IndicesDeleteAliasRequest| TB.IndicesDeleteAliasRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesDeleteAliasResponse, TContext>>
deleteDataStream: <TContext = unknown>(params: T.IndicesDeleteDataStreamRequest| TB.IndicesDeleteDataStreamRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesDeleteDataStreamResponse, TContext>>
deleteIndexTemplate: <TContext = unknown>(params: T.IndicesDeleteIndexTemplateRequest| TB.IndicesDeleteIndexTemplateRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesDeleteIndexTemplateResponse, TContext>>
deleteTemplate: <TContext = unknown>(params: T.IndicesDeleteTemplateRequest| TB.IndicesDeleteTemplateRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesDeleteTemplateResponse, TContext>>
diskUsage: <TContext = unknown>(params: T.IndicesDiskUsageRequest| TB.IndicesDiskUsageRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesDiskUsageResponse, TContext>>
exists: <TContext = unknown>(params: T.IndicesExistsRequest| TB.IndicesExistsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesExistsResponse, TContext>>
existsAlias: <TContext = unknown>(params: T.IndicesExistsAliasRequest| TB.IndicesExistsAliasRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesExistsAliasResponse, TContext>>
existsIndexTemplate: <TContext = unknown>(params: T.IndicesExistsIndexTemplateRequest| TB.IndicesExistsIndexTemplateRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesExistsIndexTemplateResponse, TContext>>
existsTemplate: <TContext = unknown>(params: T.IndicesExistsTemplateRequest| TB.IndicesExistsTemplateRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesExistsTemplateResponse, TContext>>
fieldUsageStats: <TContext = unknown>(params: T.IndicesFieldUsageStatsRequest| TB.IndicesFieldUsageStatsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesFieldUsageStatsResponse, TContext>>
flush: <TContext = unknown>(params?: T.IndicesFlushRequest| TB.IndicesFlushRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesFlushResponse, TContext>>
forcemerge: <TContext = unknown>(params?: T.IndicesForcemergeRequest| TB.IndicesForcemergeRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesForcemergeResponse, TContext>>
get: <TContext = unknown>(params: T.IndicesGetRequest| TB.IndicesGetRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesGetResponse, TContext>>
getAlias: <TContext = unknown>(params?: T.IndicesGetAliasRequest| TB.IndicesGetAliasRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesGetAliasResponse, TContext>>
getDataStream: <TContext = unknown>(params?: T.IndicesGetDataStreamRequest| TB.IndicesGetDataStreamRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesGetDataStreamResponse, TContext>>
getFieldMapping: <TContext = unknown>(params: T.IndicesGetFieldMappingRequest| TB.IndicesGetFieldMappingRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesGetFieldMappingResponse, TContext>>
getIndexTemplate: <TContext = unknown>(params?: T.IndicesGetIndexTemplateRequest| TB.IndicesGetIndexTemplateRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesGetIndexTemplateResponse, TContext>>
getMapping: <TContext = unknown>(params?: T.IndicesGetMappingRequest| TB.IndicesGetMappingRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesGetMappingResponse, TContext>>
getSettings: <TContext = unknown>(params?: T.IndicesGetSettingsRequest| TB.IndicesGetSettingsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesGetSettingsResponse, TContext>>
getTemplate: <TContext = unknown>(params?: T.IndicesGetTemplateRequest| TB.IndicesGetTemplateRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesGetTemplateResponse, TContext>>
migrateToDataStream: <TContext = unknown>(params: T.IndicesMigrateToDataStreamRequest| TB.IndicesMigrateToDataStreamRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesMigrateToDataStreamResponse, TContext>>
modifyDataStream: <TContext = unknown>(params?: T.TODO, options?: TransportRequestOptions) => Promise<TransportResult<T.TODO, unknown>>
open: <TContext = unknown>(params: T.IndicesOpenRequest| TB.IndicesOpenRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesOpenResponse, TContext>>
promoteDataStream: <TContext = unknown>(params: T.IndicesPromoteDataStreamRequest| TB.IndicesPromoteDataStreamRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesPromoteDataStreamResponse, TContext>>
putAlias: <TContext = unknown>(params: T.IndicesPutAliasRequest| TB.IndicesPutAliasRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesPutAliasResponse, TContext>>
putIndexTemplate: <TContext = unknown>(params: T.IndicesPutIndexTemplateRequest| TB.IndicesPutIndexTemplateRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesPutIndexTemplateResponse, TContext>>
putMapping: <TContext = unknown>(params: T.IndicesPutMappingRequest| TB.IndicesPutMappingRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesPutMappingResponse, TContext>>
putSettings: <TContext = unknown>(params?: T.IndicesPutSettingsRequest| TB.IndicesPutSettingsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesPutSettingsResponse, TContext>>
putTemplate: <TContext = unknown>(params: T.IndicesPutTemplateRequest| TB.IndicesPutTemplateRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesPutTemplateResponse, TContext>>
recovery: <TContext = unknown>(params?: T.IndicesRecoveryRequest| TB.IndicesRecoveryRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesRecoveryResponse, TContext>>
refresh: <TContext = unknown>(params?: T.IndicesRefreshRequest| TB.IndicesRefreshRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesRefreshResponse, TContext>>
reloadSearchAnalyzers: <TContext = unknown>(params: T.IndicesReloadSearchAnalyzersRequest| TB.IndicesReloadSearchAnalyzersRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesReloadSearchAnalyzersResponse, TContext>>
resolveIndex: <TContext = unknown>(params: T.IndicesResolveIndexRequest| TB.IndicesResolveIndexRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesResolveIndexResponse, TContext>>
rollover: <TContext = unknown>(params: T.IndicesRolloverRequest| TB.IndicesRolloverRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesRolloverResponse, TContext>>
segments: <TContext = unknown>(params?: T.IndicesSegmentsRequest| TB.IndicesSegmentsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesSegmentsResponse, TContext>>
shardStores: <TContext = unknown>(params?: T.IndicesShardStoresRequest| TB.IndicesShardStoresRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesShardStoresResponse, TContext>>
shrink: <TContext = unknown>(params: T.IndicesShrinkRequest| TB.IndicesShrinkRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesShrinkResponse, TContext>>
simulateIndexTemplate: <TContext = unknown>(params: T.IndicesSimulateIndexTemplateRequest| TB.IndicesSimulateIndexTemplateRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesSimulateIndexTemplateResponse, TContext>>
simulateTemplate: <TContext = unknown>(params?: T.IndicesSimulateTemplateRequest| TB.IndicesSimulateTemplateRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesSimulateTemplateResponse, TContext>>
split: <TContext = unknown>(params: T.IndicesSplitRequest| TB.IndicesSplitRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesSplitResponse, TContext>>
stats: <TContext = unknown>(params?: T.IndicesStatsRequest| TB.IndicesStatsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesStatsResponse, TContext>>
unfreeze: <TContext = unknown>(params: T.IndicesUnfreezeRequest| TB.IndicesUnfreezeRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesUnfreezeResponse, TContext>>
updateAliases: <TContext = unknown>(params?: T.IndicesUpdateAliasesRequest| TB.IndicesUpdateAliasesRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesUpdateAliasesResponse, TContext>>
validateQuery: <TContext = unknown>(params?: T.IndicesValidateQueryRequest| TB.IndicesValidateQueryRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IndicesValidateQueryResponse, TContext>>
}
info: <TContext = unknown>(params?: T.InfoRequest| TB.InfoRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.InfoResponse, TContext>>
ingest: {
deletePipeline: <TContext = unknown>(params: T.IngestDeletePipelineRequest| TB.IngestDeletePipelineRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IngestDeletePipelineResponse, TContext>>
geoIpStats: <TContext = unknown>(params?: T.IngestGeoIpStatsRequest| TB.IngestGeoIpStatsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IngestGeoIpStatsResponse, TContext>>
getPipeline: <TContext = unknown>(params?: T.IngestGetPipelineRequest| TB.IngestGetPipelineRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IngestGetPipelineResponse, TContext>>
processorGrok: <TContext = unknown>(params?: T.IngestProcessorGrokRequest| TB.IngestProcessorGrokRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IngestProcessorGrokResponse, TContext>>
putPipeline: <TContext = unknown>(params: T.IngestPutPipelineRequest| TB.IngestPutPipelineRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IngestPutPipelineResponse, TContext>>
simulate: <TContext = unknown>(params?: T.IngestSimulateRequest| TB.IngestSimulateRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.IngestSimulateResponse, TContext>>
}
knnSearch: <TDocument = unknown, TContext = unknown>(params: T.KnnSearchRequest| TB.KnnSearchRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.KnnSearchResponse<TDocument>, TContext>>
license: {
delete: <TContext = unknown>(params?: T.LicenseDeleteRequest| TB.LicenseDeleteRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.LicenseDeleteResponse, TContext>>
get: <TContext = unknown>(params?: T.LicenseGetRequest| TB.LicenseGetRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.LicenseGetResponse, TContext>>
getBasicStatus: <TContext = unknown>(params?: T.LicenseGetBasicStatusRequest| TB.LicenseGetBasicStatusRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.LicenseGetBasicStatusResponse, TContext>>
getTrialStatus: <TContext = unknown>(params?: T.LicenseGetTrialStatusRequest| TB.LicenseGetTrialStatusRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.LicenseGetTrialStatusResponse, TContext>>
post: <TContext = unknown>(params?: T.LicensePostRequest| TB.LicensePostRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.LicensePostResponse, TContext>>
postStartBasic: <TContext = unknown>(params?: T.LicensePostStartBasicRequest| TB.LicensePostStartBasicRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.LicensePostStartBasicResponse, TContext>>
postStartTrial: <TContext = unknown>(params?: T.LicensePostStartTrialRequest| TB.LicensePostStartTrialRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.LicensePostStartTrialResponse, TContext>>
}
logstash: {
deletePipeline: <TContext = unknown>(params: T.LogstashDeletePipelineRequest| TB.LogstashDeletePipelineRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.LogstashDeletePipelineResponse, TContext>>
getPipeline: <TContext = unknown>(params: T.LogstashGetPipelineRequest| TB.LogstashGetPipelineRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.LogstashGetPipelineResponse, TContext>>
putPipeline: <TContext = unknown>(params: T.LogstashPutPipelineRequest| TB.LogstashPutPipelineRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.LogstashPutPipelineResponse, TContext>>
}
mget: <TDocument = unknown, TContext = unknown>(params?: T.MgetRequest| TB.MgetRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MgetResponse<TDocument>, TContext>>
migration: {
deprecations: <TContext = unknown>(params?: T.MigrationDeprecationsRequest| TB.MigrationDeprecationsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MigrationDeprecationsResponse, TContext>>
getFeatureUpgradeStatus: <TContext = unknown>(params?: T.TODO, options?: TransportRequestOptions) => Promise<TransportResult<T.TODO, unknown>>
postFeatureUpgrade: <TContext = unknown>(params?: T.TODO, options?: TransportRequestOptions) => Promise<TransportResult<T.TODO, unknown>>
}
ml: {
closeJob: <TContext = unknown>(params: T.MlCloseJobRequest| TB.MlCloseJobRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlCloseJobResponse, TContext>>
deleteCalendar: <TContext = unknown>(params: T.MlDeleteCalendarRequest| TB.MlDeleteCalendarRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlDeleteCalendarResponse, TContext>>
deleteCalendarEvent: <TContext = unknown>(params: T.MlDeleteCalendarEventRequest| TB.MlDeleteCalendarEventRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlDeleteCalendarEventResponse, TContext>>
deleteCalendarJob: <TContext = unknown>(params: T.MlDeleteCalendarJobRequest| TB.MlDeleteCalendarJobRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlDeleteCalendarJobResponse, TContext>>
deleteDataFrameAnalytics: <TContext = unknown>(params: T.MlDeleteDataFrameAnalyticsRequest| TB.MlDeleteDataFrameAnalyticsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlDeleteDataFrameAnalyticsResponse, TContext>>
deleteDatafeed: <TContext = unknown>(params: T.MlDeleteDatafeedRequest| TB.MlDeleteDatafeedRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlDeleteDatafeedResponse, TContext>>
deleteExpiredData: <TContext = unknown>(params?: T.MlDeleteExpiredDataRequest| TB.MlDeleteExpiredDataRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlDeleteExpiredDataResponse, TContext>>
deleteFilter: <TContext = unknown>(params: T.MlDeleteFilterRequest| TB.MlDeleteFilterRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlDeleteFilterResponse, TContext>>
deleteForecast: <TContext = unknown>(params: T.MlDeleteForecastRequest| TB.MlDeleteForecastRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlDeleteForecastResponse, TContext>>
deleteJob: <TContext = unknown>(params: T.MlDeleteJobRequest| TB.MlDeleteJobRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlDeleteJobResponse, TContext>>
deleteModelSnapshot: <TContext = unknown>(params: T.MlDeleteModelSnapshotRequest| TB.MlDeleteModelSnapshotRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlDeleteModelSnapshotResponse, TContext>>
deleteTrainedModel: <TContext = unknown>(params: T.MlDeleteTrainedModelRequest| TB.MlDeleteTrainedModelRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlDeleteTrainedModelResponse, TContext>>
deleteTrainedModelAlias: <TContext = unknown>(params: T.MlDeleteTrainedModelAliasRequest| TB.MlDeleteTrainedModelAliasRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlDeleteTrainedModelAliasResponse, TContext>>
estimateModelMemory: <TContext = unknown>(params?: T.MlEstimateModelMemoryRequest| TB.MlEstimateModelMemoryRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlEstimateModelMemoryResponse, TContext>>
evaluateDataFrame: <TContext = unknown>(params?: T.MlEvaluateDataFrameRequest| TB.MlEvaluateDataFrameRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlEvaluateDataFrameResponse, TContext>>
explainDataFrameAnalytics: <TContext = unknown>(params?: T.MlExplainDataFrameAnalyticsRequest| TB.MlExplainDataFrameAnalyticsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlExplainDataFrameAnalyticsResponse, TContext>>
flushJob: <TContext = unknown>(params: T.MlFlushJobRequest| TB.MlFlushJobRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlFlushJobResponse, TContext>>
forecast: <TContext = unknown>(params: T.MlForecastRequest| TB.MlForecastRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlForecastResponse, TContext>>
getBuckets: <TContext = unknown>(params: T.MlGetBucketsRequest| TB.MlGetBucketsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlGetBucketsResponse, TContext>>
getCalendarEvents: <TContext = unknown>(params: T.MlGetCalendarEventsRequest| TB.MlGetCalendarEventsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlGetCalendarEventsResponse, TContext>>
getCalendars: <TContext = unknown>(params?: T.MlGetCalendarsRequest| TB.MlGetCalendarsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlGetCalendarsResponse, TContext>>
getCategories: <TContext = unknown>(params: T.MlGetCategoriesRequest| TB.MlGetCategoriesRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlGetCategoriesResponse, TContext>>
getDataFrameAnalytics: <TContext = unknown>(params?: T.MlGetDataFrameAnalyticsRequest| TB.MlGetDataFrameAnalyticsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlGetDataFrameAnalyticsResponse, TContext>>
getDataFrameAnalyticsStats: <TContext = unknown>(params?: T.MlGetDataFrameAnalyticsStatsRequest| TB.MlGetDataFrameAnalyticsStatsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlGetDataFrameAnalyticsStatsResponse, TContext>>
getDatafeedStats: <TContext = unknown>(params?: T.MlGetDatafeedStatsRequest| TB.MlGetDatafeedStatsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlGetDatafeedStatsResponse, TContext>>
getDatafeeds: <TContext = unknown>(params?: T.MlGetDatafeedsRequest| TB.MlGetDatafeedsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlGetDatafeedsResponse, TContext>>
getFilters: <TContext = unknown>(params?: T.MlGetFiltersRequest| TB.MlGetFiltersRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlGetFiltersResponse, TContext>>
getInfluencers: <TContext = unknown>(params: T.MlGetInfluencersRequest| TB.MlGetInfluencersRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlGetInfluencersResponse, TContext>>
getJobStats: <TContext = unknown>(params?: T.MlGetJobStatsRequest| TB.MlGetJobStatsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlGetJobStatsResponse, TContext>>
getJobs: <TContext = unknown>(params?: T.MlGetJobsRequest| TB.MlGetJobsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlGetJobsResponse, TContext>>
getModelSnapshotUpgradeStats: <TContext = unknown>(params?: T.TODO, options?: TransportRequestOptions) => Promise<TransportResult<T.TODO, unknown>>
getModelSnapshots: <TContext = unknown>(params: T.MlGetModelSnapshotsRequest| TB.MlGetModelSnapshotsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlGetModelSnapshotsResponse, TContext>>
getOverallBuckets: <TContext = unknown>(params: T.MlGetOverallBucketsRequest| TB.MlGetOverallBucketsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlGetOverallBucketsResponse, TContext>>
getRecords: <TContext = unknown>(params: T.MlGetRecordsRequest| TB.MlGetRecordsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlGetRecordsResponse, TContext>>
getTrainedModels: <TContext = unknown>(params?: T.MlGetTrainedModelsRequest| TB.MlGetTrainedModelsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlGetTrainedModelsResponse, TContext>>
getTrainedModelsStats: <TContext = unknown>(params?: T.MlGetTrainedModelsStatsRequest| TB.MlGetTrainedModelsStatsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlGetTrainedModelsStatsResponse, TContext>>
inferTrainedModelDeployment: <TContext = unknown>(params: T.MlInferTrainedModelDeploymentRequest| TB.MlInferTrainedModelDeploymentRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlInferTrainedModelDeploymentResponse, TContext>>
info: <TContext = unknown>(params?: T.MlInfoRequest| TB.MlInfoRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlInfoResponse, TContext>>
openJob: <TContext = unknown>(params: T.MlOpenJobRequest| TB.MlOpenJobRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlOpenJobResponse, TContext>>
postCalendarEvents: <TContext = unknown>(params: T.MlPostCalendarEventsRequest| TB.MlPostCalendarEventsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlPostCalendarEventsResponse, TContext>>
postData: <TData = unknown, TContext = unknown>(params: T.MlPostDataRequest<TData>| TB.MlPostDataRequest<TData>, options?: TransportRequestOptions) => Promise<TransportResult<T.MlPostDataResponse, TContext>>
previewDataFrameAnalytics: <TContext = unknown>(params?: T.MlPreviewDataFrameAnalyticsRequest| TB.MlPreviewDataFrameAnalyticsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlPreviewDataFrameAnalyticsResponse, TContext>>
previewDatafeed: <TDocument = unknown, TContext = unknown>(params?: T.MlPreviewDatafeedRequest| TB.MlPreviewDatafeedRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlPreviewDatafeedResponse<TDocument>, TContext>>
putCalendar: <TContext = unknown>(params: T.MlPutCalendarRequest| TB.MlPutCalendarRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlPutCalendarResponse, TContext>>
putCalendarJob: <TContext = unknown>(params: T.MlPutCalendarJobRequest| TB.MlPutCalendarJobRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlPutCalendarJobResponse, TContext>>
putDataFrameAnalytics: <TContext = unknown>(params: T.MlPutDataFrameAnalyticsRequest| TB.MlPutDataFrameAnalyticsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlPutDataFrameAnalyticsResponse, TContext>>
putDatafeed: <TContext = unknown>(params: T.MlPutDatafeedRequest| TB.MlPutDatafeedRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlPutDatafeedResponse, TContext>>
putFilter: <TContext = unknown>(params: T.MlPutFilterRequest| TB.MlPutFilterRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlPutFilterResponse, TContext>>
putJob: <TContext = unknown>(params: T.MlPutJobRequest| TB.MlPutJobRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlPutJobResponse, TContext>>
putTrainedModel: <TContext = unknown>(params: T.MlPutTrainedModelRequest| TB.MlPutTrainedModelRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlPutTrainedModelResponse, TContext>>
putTrainedModelAlias: <TContext = unknown>(params: T.MlPutTrainedModelAliasRequest| TB.MlPutTrainedModelAliasRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlPutTrainedModelAliasResponse, TContext>>
putTrainedModelDefinitionPart: <TContext = unknown>(params: T.MlPutTrainedModelDefinitionPartRequest| TB.MlPutTrainedModelDefinitionPartRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlPutTrainedModelDefinitionPartResponse, TContext>>
putTrainedModelVocabulary: <TContext = unknown>(params: T.MlPutTrainedModelVocabularyRequest| TB.MlPutTrainedModelVocabularyRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlPutTrainedModelVocabularyResponse, TContext>>
resetJob: <TContext = unknown>(params: T.MlResetJobRequest| TB.MlResetJobRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlResetJobResponse, TContext>>
revertModelSnapshot: <TContext = unknown>(params: T.MlRevertModelSnapshotRequest| TB.MlRevertModelSnapshotRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlRevertModelSnapshotResponse, TContext>>
setUpgradeMode: <TContext = unknown>(params?: T.MlSetUpgradeModeRequest| TB.MlSetUpgradeModeRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlSetUpgradeModeResponse, TContext>>
startDataFrameAnalytics: <TContext = unknown>(params: T.MlStartDataFrameAnalyticsRequest| TB.MlStartDataFrameAnalyticsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlStartDataFrameAnalyticsResponse, TContext>>
startDatafeed: <TContext = unknown>(params: T.MlStartDatafeedRequest| TB.MlStartDatafeedRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlStartDatafeedResponse, TContext>>
startTrainedModelDeployment: <TContext = unknown>(params: T.MlStartTrainedModelDeploymentRequest| TB.MlStartTrainedModelDeploymentRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlStartTrainedModelDeploymentResponse, TContext>>
stopDataFrameAnalytics: <TContext = unknown>(params: T.MlStopDataFrameAnalyticsRequest| TB.MlStopDataFrameAnalyticsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlStopDataFrameAnalyticsResponse, TContext>>
stopDatafeed: <TContext = unknown>(params: T.MlStopDatafeedRequest| TB.MlStopDatafeedRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlStopDatafeedResponse, TContext>>
stopTrainedModelDeployment: <TContext = unknown>(params: T.MlStopTrainedModelDeploymentRequest| TB.MlStopTrainedModelDeploymentRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlStopTrainedModelDeploymentResponse, TContext>>
updateDataFrameAnalytics: <TContext = unknown>(params: T.MlUpdateDataFrameAnalyticsRequest| TB.MlUpdateDataFrameAnalyticsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlUpdateDataFrameAnalyticsResponse, TContext>>
updateDatafeed: <TContext = unknown>(params: T.MlUpdateDatafeedRequest| TB.MlUpdateDatafeedRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlUpdateDatafeedResponse, TContext>>
updateFilter: <TContext = unknown>(params: T.MlUpdateFilterRequest| TB.MlUpdateFilterRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlUpdateFilterResponse, TContext>>
updateJob: <TContext = unknown>(params: T.MlUpdateJobRequest| TB.MlUpdateJobRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlUpdateJobResponse, TContext>>
updateModelSnapshot: <TContext = unknown>(params: T.MlUpdateModelSnapshotRequest| TB.MlUpdateModelSnapshotRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlUpdateModelSnapshotResponse, TContext>>
upgradeJobSnapshot: <TContext = unknown>(params: T.MlUpgradeJobSnapshotRequest| TB.MlUpgradeJobSnapshotRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlUpgradeJobSnapshotResponse, TContext>>
validate: <TContext = unknown>(params?: T.MlValidateRequest| TB.MlValidateRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlValidateResponse, TContext>>
validateDetector: <TContext = unknown>(params?: T.MlValidateDetectorRequest| TB.MlValidateDetectorRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MlValidateDetectorResponse, TContext>>
}
monitoring: {
bulk: <TDocument = unknown, TPartialDocument = unknown, TContext = unknown>(params: T.MonitoringBulkRequest<TDocument, TPartialDocument>| TB.MonitoringBulkRequest<TDocument, TPartialDocument>, options?: TransportRequestOptions) => Promise<TransportResult<T.MonitoringBulkResponse, TContext>>
}
msearch: <TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>, TContext = unknown>(params?: T.MsearchRequest| TB.MsearchRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MsearchResponse<TDocument, TAggregations>, TContext>>
msearchTemplate: <TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>, TContext = unknown>(params?: T.MsearchTemplateRequest| TB.MsearchTemplateRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MsearchTemplateResponse<TDocument, TAggregations>, TContext>>
mtermvectors: <TContext = unknown>(params?: T.MtermvectorsRequest| TB.MtermvectorsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MtermvectorsResponse, TContext>>
nodes: {
clearRepositoriesMeteringArchive: <TContext = unknown>(params: T.NodesClearRepositoriesMeteringArchiveRequest| TB.NodesClearRepositoriesMeteringArchiveRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.NodesClearRepositoriesMeteringArchiveResponse, TContext>>
getRepositoriesMeteringInfo: <TContext = unknown>(params: T.NodesGetRepositoriesMeteringInfoRequest| TB.NodesGetRepositoriesMeteringInfoRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.NodesGetRepositoriesMeteringInfoResponse, TContext>>
hotThreads: <TContext = unknown>(params?: T.NodesHotThreadsRequest| TB.NodesHotThreadsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.NodesHotThreadsResponse, TContext>>
info: <TContext = unknown>(params?: T.NodesInfoRequest| TB.NodesInfoRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.NodesInfoResponse, TContext>>
reloadSecureSettings: <TContext = unknown>(params?: T.NodesReloadSecureSettingsRequest| TB.NodesReloadSecureSettingsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.NodesReloadSecureSettingsResponse, TContext>>
stats: <TContext = unknown>(params?: T.NodesStatsRequest| TB.NodesStatsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.NodesStatsResponse, TContext>>
usage: <TContext = unknown>(params?: T.NodesUsageRequest| TB.NodesUsageRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.NodesUsageResponse, TContext>>
}
openPointInTime: <TContext = unknown>(params: T.OpenPointInTimeRequest| TB.OpenPointInTimeRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.OpenPointInTimeResponse, TContext>>
ping: <TContext = unknown>(params?: T.PingRequest| TB.PingRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.PingResponse, TContext>>
putScript: <TContext = unknown>(params: T.PutScriptRequest| TB.PutScriptRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.PutScriptResponse, TContext>>
rankEval: <TContext = unknown>(params: T.RankEvalRequest| TB.RankEvalRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.RankEvalResponse, TContext>>
reindex: <TContext = unknown>(params?: T.ReindexRequest| TB.ReindexRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.ReindexResponse, TContext>>
reindexRethrottle: <TContext = unknown>(params: T.ReindexRethrottleRequest| TB.ReindexRethrottleRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.ReindexRethrottleResponse, TContext>>
renderSearchTemplate: <TContext = unknown>(params?: T.RenderSearchTemplateRequest| TB.RenderSearchTemplateRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.RenderSearchTemplateResponse, TContext>>
rollup: {
deleteJob: <TContext = unknown>(params: T.RollupDeleteJobRequest| TB.RollupDeleteJobRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.RollupDeleteJobResponse, TContext>>
getJobs: <TContext = unknown>(params?: T.RollupGetJobsRequest| TB.RollupGetJobsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.RollupGetJobsResponse, TContext>>
getRollupCaps: <TContext = unknown>(params?: T.RollupGetRollupCapsRequest| TB.RollupGetRollupCapsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.RollupGetRollupCapsResponse, TContext>>
getRollupIndexCaps: <TContext = unknown>(params: T.RollupGetRollupIndexCapsRequest| TB.RollupGetRollupIndexCapsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.RollupGetRollupIndexCapsResponse, TContext>>
putJob: <TContext = unknown>(params: T.RollupPutJobRequest| TB.RollupPutJobRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.RollupPutJobResponse, TContext>>
rollup: <TContext = unknown>(params: T.RollupRollupRequest| TB.RollupRollupRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.RollupRollupResponse, TContext>>
rollupSearch: <TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>, TContext = unknown>(params: T.RollupRollupSearchRequest| TB.RollupRollupSearchRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.RollupRollupSearchResponse<TDocument, TAggregations>, TContext>>
startJob: <TContext = unknown>(params: T.RollupStartJobRequest| TB.RollupStartJobRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.RollupStartJobResponse, TContext>>
stopJob: <TContext = unknown>(params: T.RollupStopJobRequest| TB.RollupStopJobRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.RollupStopJobResponse, TContext>>
}
scriptsPainlessExecute: <TResult = unknown, TContext = unknown>(params?: T.ScriptsPainlessExecuteRequest| TB.ScriptsPainlessExecuteRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.ScriptsPainlessExecuteResponse<TResult>, TContext>>
scroll: <TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>, TContext = unknown>(params?: T.ScrollRequest| TB.ScrollRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.ScrollResponse<TDocument, TAggregations>, TContext>>
search: <TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>, TContext = unknown>(params?: T.SearchRequest| TB.SearchRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SearchResponse<TDocument, TAggregations>, TContext>>
searchMvt: <TContext = unknown>(params: T.SearchMvtRequest| TB.SearchMvtRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SearchMvtResponse, TContext>>
searchShards: <TContext = unknown>(params?: T.SearchShardsRequest| TB.SearchShardsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SearchShardsResponse, TContext>>
searchTemplate: <TDocument = unknown, TContext = unknown>(params?: T.SearchTemplateRequest| TB.SearchTemplateRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SearchTemplateResponse<TDocument>, TContext>>
searchableSnapshots: {
cacheStats: <TContext = unknown>(params?: T.SearchableSnapshotsCacheStatsRequest| TB.SearchableSnapshotsCacheStatsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SearchableSnapshotsCacheStatsResponse, TContext>>
clearCache: <TContext = unknown>(params?: T.SearchableSnapshotsClearCacheRequest| TB.SearchableSnapshotsClearCacheRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SearchableSnapshotsClearCacheResponse, TContext>>
mount: <TContext = unknown>(params: T.SearchableSnapshotsMountRequest| TB.SearchableSnapshotsMountRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SearchableSnapshotsMountResponse, TContext>>
stats: <TContext = unknown>(params?: T.SearchableSnapshotsStatsRequest| TB.SearchableSnapshotsStatsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SearchableSnapshotsStatsResponse, TContext>>
}
security: {
authenticate: <TContext = unknown>(params?: T.SecurityAuthenticateRequest| TB.SecurityAuthenticateRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityAuthenticateResponse, TContext>>
changePassword: <TContext = unknown>(params?: T.SecurityChangePasswordRequest| TB.SecurityChangePasswordRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityChangePasswordResponse, TContext>>
clearApiKeyCache: <TContext = unknown>(params: T.SecurityClearApiKeyCacheRequest| TB.SecurityClearApiKeyCacheRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityClearApiKeyCacheResponse, TContext>>
clearCachedPrivileges: <TContext = unknown>(params: T.SecurityClearCachedPrivilegesRequest| TB.SecurityClearCachedPrivilegesRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityClearCachedPrivilegesResponse, TContext>>
clearCachedRealms: <TContext = unknown>(params: T.SecurityClearCachedRealmsRequest| TB.SecurityClearCachedRealmsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityClearCachedRealmsResponse, TContext>>
clearCachedRoles: <TContext = unknown>(params: T.SecurityClearCachedRolesRequest| TB.SecurityClearCachedRolesRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityClearCachedRolesResponse, TContext>>
clearCachedServiceTokens: <TContext = unknown>(params: T.SecurityClearCachedServiceTokensRequest| TB.SecurityClearCachedServiceTokensRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityClearCachedServiceTokensResponse, TContext>>
createApiKey: <TContext = unknown>(params?: T.SecurityCreateApiKeyRequest| TB.SecurityCreateApiKeyRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityCreateApiKeyResponse, TContext>>
createServiceToken: <TContext = unknown>(params: T.SecurityCreateServiceTokenRequest| TB.SecurityCreateServiceTokenRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityCreateServiceTokenResponse, TContext>>
deletePrivileges: <TContext = unknown>(params: T.SecurityDeletePrivilegesRequest| TB.SecurityDeletePrivilegesRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityDeletePrivilegesResponse, TContext>>
deleteRole: <TContext = unknown>(params: T.SecurityDeleteRoleRequest| TB.SecurityDeleteRoleRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityDeleteRoleResponse, TContext>>
deleteRoleMapping: <TContext = unknown>(params: T.SecurityDeleteRoleMappingRequest| TB.SecurityDeleteRoleMappingRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityDeleteRoleMappingResponse, TContext>>
deleteServiceToken: <TContext = unknown>(params: T.SecurityDeleteServiceTokenRequest| TB.SecurityDeleteServiceTokenRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityDeleteServiceTokenResponse, TContext>>
deleteUser: <TContext = unknown>(params: T.SecurityDeleteUserRequest| TB.SecurityDeleteUserRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityDeleteUserResponse, TContext>>
disableUser: <TContext = unknown>(params: T.SecurityDisableUserRequest| TB.SecurityDisableUserRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityDisableUserResponse, TContext>>
enableUser: <TContext = unknown>(params: T.SecurityEnableUserRequest| TB.SecurityEnableUserRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityEnableUserResponse, TContext>>
enrollKibana: <TContext = unknown>(params?: T.SecurityEnrollKibanaRequest| TB.SecurityEnrollKibanaRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityEnrollKibanaResponse, TContext>>
enrollNode: <TContext = unknown>(params?: T.SecurityEnrollNodeRequest| TB.SecurityEnrollNodeRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityEnrollNodeResponse, TContext>>
getApiKey: <TContext = unknown>(params?: T.SecurityGetApiKeyRequest| TB.SecurityGetApiKeyRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityGetApiKeyResponse, TContext>>
getBuiltinPrivileges: <TContext = unknown>(params?: T.SecurityGetBuiltinPrivilegesRequest| TB.SecurityGetBuiltinPrivilegesRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityGetBuiltinPrivilegesResponse, TContext>>
getPrivileges: <TContext = unknown>(params?: T.SecurityGetPrivilegesRequest| TB.SecurityGetPrivilegesRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityGetPrivilegesResponse, TContext>>
getRole: <TContext = unknown>(params?: T.SecurityGetRoleRequest| TB.SecurityGetRoleRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityGetRoleResponse, TContext>>
getRoleMapping: <TContext = unknown>(params?: T.SecurityGetRoleMappingRequest| TB.SecurityGetRoleMappingRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityGetRoleMappingResponse, TContext>>
getServiceAccounts: <TContext = unknown>(params?: T.SecurityGetServiceAccountsRequest| TB.SecurityGetServiceAccountsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityGetServiceAccountsResponse, TContext>>
getServiceCredentials: <TContext = unknown>(params: T.SecurityGetServiceCredentialsRequest| TB.SecurityGetServiceCredentialsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityGetServiceCredentialsResponse, TContext>>
getToken: <TContext = unknown>(params?: T.SecurityGetTokenRequest| TB.SecurityGetTokenRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityGetTokenResponse, TContext>>
getUser: <TContext = unknown>(params?: T.SecurityGetUserRequest| TB.SecurityGetUserRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityGetUserResponse, TContext>>
getUserPrivileges: <TContext = unknown>(params?: T.SecurityGetUserPrivilegesRequest| TB.SecurityGetUserPrivilegesRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityGetUserPrivilegesResponse, TContext>>
grantApiKey: <TContext = unknown>(params?: T.SecurityGrantApiKeyRequest| TB.SecurityGrantApiKeyRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityGrantApiKeyResponse, TContext>>
hasPrivileges: <TContext = unknown>(params?: T.SecurityHasPrivilegesRequest| TB.SecurityHasPrivilegesRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityHasPrivilegesResponse, TContext>>
invalidateApiKey: <TContext = unknown>(params?: T.SecurityInvalidateApiKeyRequest| TB.SecurityInvalidateApiKeyRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityInvalidateApiKeyResponse, TContext>>
invalidateToken: <TContext = unknown>(params?: T.SecurityInvalidateTokenRequest| TB.SecurityInvalidateTokenRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityInvalidateTokenResponse, TContext>>
oidcAuthenticate: <TContext = unknown>(params?: T.TODO, options?: TransportRequestOptions) => Promise<TransportResult<T.TODO, unknown>>
oidcLogout: <TContext = unknown>(params?: T.TODO, options?: TransportRequestOptions) => Promise<TransportResult<T.TODO, unknown>>
oidcPrepareAuthentication: <TContext = unknown>(params?: T.TODO, options?: TransportRequestOptions) => Promise<TransportResult<T.TODO, unknown>>
putPrivileges: <TContext = unknown>(params?: T.SecurityPutPrivilegesRequest| TB.SecurityPutPrivilegesRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityPutPrivilegesResponse, TContext>>
putRole: <TContext = unknown>(params: T.SecurityPutRoleRequest| TB.SecurityPutRoleRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityPutRoleResponse, TContext>>
putRoleMapping: <TContext = unknown>(params: T.SecurityPutRoleMappingRequest| TB.SecurityPutRoleMappingRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityPutRoleMappingResponse, TContext>>
putUser: <TContext = unknown>(params: T.SecurityPutUserRequest| TB.SecurityPutUserRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityPutUserResponse, TContext>>
queryApiKeys: <TContext = unknown>(params?: T.SecurityQueryApiKeysRequest| TB.SecurityQueryApiKeysRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecurityQueryApiKeysResponse, TContext>>
samlAuthenticate: <TContext = unknown>(params?: T.SecuritySamlAuthenticateRequest| TB.SecuritySamlAuthenticateRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecuritySamlAuthenticateResponse, TContext>>
samlCompleteLogout: <TContext = unknown>(params?: T.SecuritySamlCompleteLogoutRequest| TB.SecuritySamlCompleteLogoutRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecuritySamlCompleteLogoutResponse, TContext>>
samlInvalidate: <TContext = unknown>(params?: T.SecuritySamlInvalidateRequest| TB.SecuritySamlInvalidateRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecuritySamlInvalidateResponse, TContext>>
samlLogout: <TContext = unknown>(params?: T.SecuritySamlLogoutRequest| TB.SecuritySamlLogoutRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecuritySamlLogoutResponse, TContext>>
samlPrepareAuthentication: <TContext = unknown>(params?: T.SecuritySamlPrepareAuthenticationRequest| TB.SecuritySamlPrepareAuthenticationRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecuritySamlPrepareAuthenticationResponse, TContext>>
samlServiceProviderMetadata: <TContext = unknown>(params: T.SecuritySamlServiceProviderMetadataRequest| TB.SecuritySamlServiceProviderMetadataRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SecuritySamlServiceProviderMetadataResponse, TContext>>
}
shutdown: {
deleteNode: <TContext = unknown>(params: T.ShutdownDeleteNodeRequest| TB.ShutdownDeleteNodeRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.ShutdownDeleteNodeResponse, TContext>>
getNode: <TContext = unknown>(params?: T.ShutdownGetNodeRequest| TB.ShutdownGetNodeRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.ShutdownGetNodeResponse, TContext>>
putNode: <TContext = unknown>(params: T.ShutdownPutNodeRequest| TB.ShutdownPutNodeRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.ShutdownPutNodeResponse, TContext>>
}
slm: {
deleteLifecycle: <TContext = unknown>(params: T.SlmDeleteLifecycleRequest| TB.SlmDeleteLifecycleRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SlmDeleteLifecycleResponse, TContext>>
executeLifecycle: <TContext = unknown>(params: T.SlmExecuteLifecycleRequest| TB.SlmExecuteLifecycleRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SlmExecuteLifecycleResponse, TContext>>
executeRetention: <TContext = unknown>(params?: T.SlmExecuteRetentionRequest| TB.SlmExecuteRetentionRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SlmExecuteRetentionResponse, TContext>>
getLifecycle: <TContext = unknown>(params?: T.SlmGetLifecycleRequest| TB.SlmGetLifecycleRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SlmGetLifecycleResponse, TContext>>
getStats: <TContext = unknown>(params?: T.SlmGetStatsRequest| TB.SlmGetStatsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SlmGetStatsResponse, TContext>>
getStatus: <TContext = unknown>(params?: T.SlmGetStatusRequest| TB.SlmGetStatusRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SlmGetStatusResponse, TContext>>
putLifecycle: <TContext = unknown>(params: T.SlmPutLifecycleRequest| TB.SlmPutLifecycleRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SlmPutLifecycleResponse, TContext>>
start: <TContext = unknown>(params?: T.SlmStartRequest| TB.SlmStartRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SlmStartResponse, TContext>>
stop: <TContext = unknown>(params?: T.SlmStopRequest| TB.SlmStopRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SlmStopResponse, TContext>>
}
snapshot: {
cleanupRepository: <TContext = unknown>(params: T.SnapshotCleanupRepositoryRequest| TB.SnapshotCleanupRepositoryRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SnapshotCleanupRepositoryResponse, TContext>>
clone: <TContext = unknown>(params: T.SnapshotCloneRequest| TB.SnapshotCloneRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SnapshotCloneResponse, TContext>>
create: <TContext = unknown>(params: T.SnapshotCreateRequest| TB.SnapshotCreateRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SnapshotCreateResponse, TContext>>
createRepository: <TContext = unknown>(params: T.SnapshotCreateRepositoryRequest| TB.SnapshotCreateRepositoryRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SnapshotCreateRepositoryResponse, TContext>>
delete: <TContext = unknown>(params: T.SnapshotDeleteRequest| TB.SnapshotDeleteRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SnapshotDeleteResponse, TContext>>
deleteRepository: <TContext = unknown>(params: T.SnapshotDeleteRepositoryRequest| TB.SnapshotDeleteRepositoryRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SnapshotDeleteRepositoryResponse, TContext>>
get: <TContext = unknown>(params: T.SnapshotGetRequest| TB.SnapshotGetRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SnapshotGetResponse, TContext>>
getRepository: <TContext = unknown>(params?: T.SnapshotGetRepositoryRequest| TB.SnapshotGetRepositoryRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SnapshotGetRepositoryResponse, TContext>>
repositoryAnalyze: <TContext = unknown>(params?: T.TODO, options?: TransportRequestOptions) => Promise<TransportResult<T.TODO, unknown>>
restore: <TContext = unknown>(params: T.SnapshotRestoreRequest| TB.SnapshotRestoreRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SnapshotRestoreResponse, TContext>>
status: <TContext = unknown>(params?: T.SnapshotStatusRequest| TB.SnapshotStatusRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SnapshotStatusResponse, TContext>>
verifyRepository: <TContext = unknown>(params: T.SnapshotVerifyRepositoryRequest| TB.SnapshotVerifyRepositoryRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SnapshotVerifyRepositoryResponse, TContext>>
}
sql: {
clearCursor: <TContext = unknown>(params?: T.SqlClearCursorRequest| TB.SqlClearCursorRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SqlClearCursorResponse, TContext>>
deleteAsync: <TContext = unknown>(params: T.SqlDeleteAsyncRequest| TB.SqlDeleteAsyncRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SqlDeleteAsyncResponse, TContext>>
getAsync: <TContext = unknown>(params: T.SqlGetAsyncRequest| TB.SqlGetAsyncRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SqlGetAsyncResponse, TContext>>
getAsyncStatus: <TContext = unknown>(params: T.SqlGetAsyncStatusRequest| TB.SqlGetAsyncStatusRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SqlGetAsyncStatusResponse, TContext>>
query: <TContext = unknown>(params?: T.SqlQueryRequest| TB.SqlQueryRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SqlQueryResponse, TContext>>
translate: <TContext = unknown>(params?: T.SqlTranslateRequest| TB.SqlTranslateRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SqlTranslateResponse, TContext>>
}
ssl: {
certificates: <TContext = unknown>(params?: T.SslCertificatesRequest| TB.SslCertificatesRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.SslCertificatesResponse, TContext>>
}
tasks: {
cancel: <TContext = unknown>(params?: T.TasksCancelRequest| TB.TasksCancelRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.TasksCancelResponse, TContext>>
get: <TContext = unknown>(params: T.TasksGetRequest| TB.TasksGetRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.TasksGetResponse, TContext>>
list: <TContext = unknown>(params?: T.TasksListRequest| TB.TasksListRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.TasksListResponse, TContext>>
}
termsEnum: <TContext = unknown>(params: T.TermsEnumRequest| TB.TermsEnumRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.TermsEnumResponse, TContext>>
termvectors: <TDocument = unknown, TContext = unknown>(params: T.TermvectorsRequest<TDocument>| TB.TermvectorsRequest<TDocument>, options?: TransportRequestOptions) => Promise<TransportResult<T.TermvectorsResponse, TContext>>
textStructure: {
findStructure: <TJsonDocument = unknown, TContext = unknown>(params: T.TextStructureFindStructureRequest<TJsonDocument>| TB.TextStructureFindStructureRequest<TJsonDocument>, options?: TransportRequestOptions) => Promise<TransportResult<T.TextStructureFindStructureResponse, TContext>>
}
transform: {
deleteTransform: <TContext = unknown>(params: T.TransformDeleteTransformRequest| TB.TransformDeleteTransformRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.TransformDeleteTransformResponse, TContext>>
getTransform: <TContext = unknown>(params?: T.TransformGetTransformRequest| TB.TransformGetTransformRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.TransformGetTransformResponse, TContext>>
getTransformStats: <TContext = unknown>(params: T.TransformGetTransformStatsRequest| TB.TransformGetTransformStatsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.TransformGetTransformStatsResponse, TContext>>
previewTransform: <TTransform = unknown, TContext = unknown>(params?: T.TransformPreviewTransformRequest| TB.TransformPreviewTransformRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.TransformPreviewTransformResponse<TTransform>, TContext>>
putTransform: <TContext = unknown>(params: T.TransformPutTransformRequest| TB.TransformPutTransformRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.TransformPutTransformResponse, TContext>>
resetTransform: <TContext = unknown>(params: T.TransformResetTransformRequest| TB.TransformResetTransformRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.TransformResetTransformResponse, TContext>>
startTransform: <TContext = unknown>(params: T.TransformStartTransformRequest| TB.TransformStartTransformRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.TransformStartTransformResponse, TContext>>
stopTransform: <TContext = unknown>(params: T.TransformStopTransformRequest| TB.TransformStopTransformRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.TransformStopTransformResponse, TContext>>
updateTransform: <TContext = unknown>(params: T.TransformUpdateTransformRequest| TB.TransformUpdateTransformRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.TransformUpdateTransformResponse, TContext>>
upgradeTransforms: <TContext = unknown>(params?: T.TransformUpgradeTransformsRequest| TB.TransformUpgradeTransformsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.TransformUpgradeTransformsResponse, TContext>>
}
update: <TDocumentR = unknown, TDocument = unknown, TPartialDocument = unknown, TContext = unknown>(params: T.UpdateRequest<TDocument, TPartialDocument>| TB.UpdateRequest<TDocument, TPartialDocument>, options?: TransportRequestOptions) => Promise<TransportResult<T.UpdateResponse<TDocumentR>, TContext>>
updateByQuery: <TContext = unknown>(params: T.UpdateByQueryRequest| TB.UpdateByQueryRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.UpdateByQueryResponse, TContext>>
updateByQueryRethrottle: <TContext = unknown>(params: T.UpdateByQueryRethrottleRequest| TB.UpdateByQueryRethrottleRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.UpdateByQueryRethrottleResponse, TContext>>
watcher: {
ackWatch: <TContext = unknown>(params: T.WatcherAckWatchRequest| TB.WatcherAckWatchRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.WatcherAckWatchResponse, TContext>>
activateWatch: <TContext = unknown>(params: T.WatcherActivateWatchRequest| TB.WatcherActivateWatchRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.WatcherActivateWatchResponse, TContext>>
deactivateWatch: <TContext = unknown>(params: T.WatcherDeactivateWatchRequest| TB.WatcherDeactivateWatchRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.WatcherDeactivateWatchResponse, TContext>>
deleteWatch: <TContext = unknown>(params: T.WatcherDeleteWatchRequest| TB.WatcherDeleteWatchRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.WatcherDeleteWatchResponse, TContext>>
executeWatch: <TContext = unknown>(params?: T.WatcherExecuteWatchRequest| TB.WatcherExecuteWatchRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.WatcherExecuteWatchResponse, TContext>>
getWatch: <TContext = unknown>(params: T.WatcherGetWatchRequest| TB.WatcherGetWatchRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.WatcherGetWatchResponse, TContext>>
putWatch: <TContext = unknown>(params: T.WatcherPutWatchRequest| TB.WatcherPutWatchRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.WatcherPutWatchResponse, TContext>>
queryWatches: <TContext = unknown>(params?: T.WatcherQueryWatchesRequest| TB.WatcherQueryWatchesRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.WatcherQueryWatchesResponse, TContext>>
start: <TContext = unknown>(params?: T.WatcherStartRequest| TB.WatcherStartRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.WatcherStartResponse, TContext>>
stats: <TContext = unknown>(params?: T.WatcherStatsRequest| TB.WatcherStatsRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.WatcherStatsResponse, TContext>>
stop: <TContext = unknown>(params?: T.WatcherStopRequest| TB.WatcherStopRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.WatcherStopResponse, TContext>>
}
xpack: {
info: <TContext = unknown>(params?: T.XpackInfoRequest| TB.XpackInfoRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.XpackInfoResponse, TContext>>
usage: <TContext = unknown>(params?: T.XpackUsageRequest| TB.XpackUsageRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.XpackUsageResponse, TContext>>
}
}
export type { KibanaClient }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -20,6 +20,7 @@
import { ConnectionOptions as TlsConnectionOptions } from 'tls'
import { URL } from 'url'
import buffer from 'buffer'
import os from 'os'
import {
Transport,
UndiciConnection,
@ -173,7 +174,9 @@ export default class Client extends API {
tls: null,
caFingerprint: null,
agent: null,
headers: {},
headers: {
'user-agent': `elasticsearch-js/${clientVersion} Node.js ${nodeVersion}; Transport ${transportVersion}; (${os.platform()} ${os.release()} ${os.arch()})`
},
nodeFilter: null,
generateRequestId: null,
name: 'elasticsearch-js',
@ -186,15 +189,15 @@ export default class Client extends API {
maxCompressedResponseSize: null
}, opts)
if (options.caFingerprint !== null && isHttpConnection(opts.node ?? opts.nodes)) {
if (options.caFingerprint != null && isHttpConnection(opts.node ?? opts.nodes)) {
throw new errors.ConfigurationError('You can\'t configure the caFingerprint with a http connection')
}
if (options.maxResponseSize !== null && options.maxResponseSize > buffer.constants.MAX_STRING_LENGTH) {
if (options.maxResponseSize != null && options.maxResponseSize > buffer.constants.MAX_STRING_LENGTH) {
throw new errors.ConfigurationError(`The maxResponseSize cannot be bigger than ${buffer.constants.MAX_STRING_LENGTH}`)
}
if (options.maxCompressedResponseSize !== null && options.maxCompressedResponseSize > buffer.constants.MAX_LENGTH) {
if (options.maxCompressedResponseSize != null && options.maxCompressedResponseSize > buffer.constants.MAX_LENGTH) {
throw new errors.ConfigurationError(`The maxCompressedResponseSize cannot be bigger than ${buffer.constants.MAX_LENGTH}`)
}

View File

@ -19,6 +19,7 @@
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable @typescript-eslint/promise-function-async */
/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */
import assert from 'assert'
import { promisify } from 'util'
@ -228,7 +229,6 @@ export default class Helpers {
rest_total_hits_as_int: params.rest_total_hits_as_int,
scroll_id
}, options as TransportRequestOptionsWithMeta)
// @ts-expect-error
response = r as TransportResult<T.ScrollResponse<TDocument, TAggregations>, unknown>
assert(response !== undefined, 'The response is undefined, please file a bug report')
if (response.statusCode !== 429) break

View File

@ -43,6 +43,10 @@ const MAX_FILE_TIME = 1000 * 30
const MAX_TEST_TIME = 1000 * 3
const freeSkips = {
// not supported yet
'/free/cluster.desired_nodes/10_basic.yml': ['*'],
'/free/health/30_feature.yml': ['*'],
'/free/health/40_useractions.yml': ['*'],
// the v8 client never sends the scroll_id in querystgring,
// the way the test is structured causes a security exception
'free/scroll/10_basic.yml': ['Body params override query string'],
@ -63,13 +67,17 @@ const freeSkips = {
// the expected error is returning a 503,
// which triggers a retry and the node to be marked as dead
'search.aggregation/240_max_buckets.yml': ['*'],
// long values and json do not play nicely together
'search.aggregation/40_range.yml': ['Min and max long range bounds'],
// the yaml runner assumes that null means "does not exists",
// while null is a valid json value, so the check will fail
'search/320_disallow_queries.yml': ['Test disallow expensive queries'],
'free/tsdb/90_unsupported_operations.yml': ['noop update']
}
const platinumBlackList = {
'api_key/10_basic.yml': ['Test get api key'],
'api_key/20_query.yml': ['*'],
'api_key/11_invalidation.yml': ['Test invalidate api key by realm name'],
'analytics/histogram.yml': ['Histogram requires values in increasing order'],
// this two test cases are broken, we should
// return on those in the future.
@ -107,6 +115,7 @@ const platinumBlackList = {
// Investigate why is failing
'ml/inference_crud.yml': ['*'],
'ml/categorization_agg.yml': ['Test categorization aggregation with poor settings'],
'ml/filter_crud.yml': ['*'],
// investigate why this is failing
'monitoring/bulk/10_basic.yml': ['*'],
'monitoring/bulk/20_privileges.yml': ['*'],
@ -119,6 +128,8 @@ const platinumBlackList = {
'service_accounts/10_basic.yml': ['*'],
// we are setting two certificates in the docker config
'ssl/10_basic.yml': ['*'],
'token/10_basic.yml': ['*'],
'token/11_invalidation.yml': ['*'],
// very likely, the index template has not been loaded yet.
// we should run a indices.existsTemplate, but the name of the
// template may vary during time.

View File

@ -188,6 +188,45 @@ function build (opts = {}) {
client, 'tasks.cancel',
tasks.map(id => ({ task_id: id }))
)
// cleanup ml
const jobsList = await client.ml.getJobs()
const jobsIds = jobsList.jobs.map(j => j.job_id)
await helper.runInParallel(
client, 'ml.deleteJob',
jobsIds.map(j => ({ job_id: j, force: true }))
)
const dataFrame = await client.ml.getDataFrameAnalytics()
const dataFrameIds = dataFrame.data_frame_analytics.map(d => d.id)
await helper.runInParallel(
client, 'ml.deleteDataFrameAnalytics',
dataFrameIds.map(d => ({ id: d, force: true }))
)
const calendars = await client.ml.getCalendars()
const calendarsId = calendars.calendars.map(c => c.calendar_id)
await helper.runInParallel(
client, 'ml.deleteCalendar',
calendarsId.map(c => ({ calendar_id: c }))
)
const training = await client.ml.getTrainedModels()
const trainingId = training.trained_model_configs
.filter(t => t.created_by !== '_xpack')
.map(t => t.model_id)
await helper.runInParallel(
client, 'ml.deleteTrainedModel',
trainingId.map(t => ({ model_id: t, force: true }))
)
// cleanup transforms
const transforms = await client.transform.getTransform()
const transformsId = transforms.transforms.map(t => t.id)
await helper.runInParallel(
client, 'transform.deleteTransform',
transformsId.map(t => ({ transform_id: t, force: true }))
)
}
const shutdownNodes = await client.shutdown.getNode()

View File

@ -432,3 +432,12 @@ test('caFingerprint can\'t be configured over http / 2', t => {
)
t.end()
})
test('user agent is in the correct format', t => {
const client = new Client({ node: 'http://localhost:9200' })
const agentRaw = client.transport[symbols.kHeaders]['user-agent'] || ''
const agentSplit = agentRaw.split(/\s+/)
t.equal(agentSplit[0].split('/')[0], 'elasticsearch-js')
t.ok(/^\d+\.\d+\.\d+/.test(agentSplit[0].split('/')[1]))
t.end()
})