Compare commits
100 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cd7f55ab9a | |||
| bf3a5c449a | |||
| d85529e929 | |||
| 936bcee72d | |||
| 1f925676ed | |||
| 8072097170 | |||
| 0e983bd2c3 | |||
| 9c000df8a1 | |||
| c6ae866d1a | |||
| 1fb44787cc | |||
| 4a1860b29c | |||
| 26e04997eb | |||
| 295e3ed48c | |||
| cbf46454f2 | |||
| 678e9d9f70 | |||
| 9cb5ac4f93 | |||
| 588d080710 | |||
| 087c26568f | |||
| 7ab6fa9624 | |||
| a33c7af5e8 | |||
| 4a4624b3ad | |||
| 28f56835fe | |||
| d5904a8bb1 | |||
| 41cc5fa4dd | |||
| 0d4a29171a | |||
| 230cb77419 | |||
| a927c5c14c | |||
| c82005855f | |||
| 2c277ee2ba | |||
| a4ceb47e8d | |||
| 398a8fd0f1 | |||
| 996f818b1a | |||
| ce37b0fdf1 | |||
| 948f44a7a0 | |||
| 43ecba4dfa | |||
| f90f4306c2 | |||
| c5da6683f7 | |||
| 09d802a0ac | |||
| 096ef47d6a | |||
| 38e4b23831 | |||
| 04634af552 | |||
| f79f4e8f25 | |||
| 560dfd3763 | |||
| ebbc2961e0 | |||
| 6ccdab5280 | |||
| 8f9ed67fda | |||
| 4ebffbc0e8 | |||
| 282c76fb6a | |||
| 0a510b15f9 | |||
| 24890fd11d | |||
| be54dcd301 | |||
| 33e0873ecf | |||
| 27748779c6 | |||
| 697b594ea2 | |||
| 911af982b2 | |||
| 651165d842 | |||
| c58e93a77a | |||
| c4e793ca71 | |||
| 8604da555f | |||
| 57426c968b | |||
| 96b5b8eaba | |||
| eac00e1200 | |||
| 77c1ef36aa | |||
| 720b5b449b | |||
| a298517692 | |||
| 53ccd17dbf | |||
| f6c14b7268 | |||
| 4f1713c894 | |||
| af97ece807 | |||
| 46b2c99b7c | |||
| e0f54c789b | |||
| 6d2774d2a0 | |||
| 25d9afbc0b | |||
| d7e5ff5191 | |||
| 904c3bb28c | |||
| 33c4630a34 | |||
| 3e79c8e825 | |||
| d01582803c | |||
| e7c5b3dafa | |||
| 10277e217c | |||
| 03ecf707c9 | |||
| ca6948fb82 | |||
| 82cf15097d | |||
| 759138c375 | |||
| a0c5c98a99 | |||
| 451a805ecd | |||
| 071a6ba4bb | |||
| 7985aab860 | |||
| 4643a359fe | |||
| e915e4b9af | |||
| 048ad273b2 | |||
| 0fbdf10a68 | |||
| 16cefd8383 | |||
| f718b22e9b | |||
| b3c24659d8 | |||
| 3cfc31902e | |||
| 85d1968ce5 | |||
| 7e84827593 | |||
| 4ad5daeaf4 | |||
| dbfc8fc4d1 |
14
.buildkite/Dockerfile
Normal file
14
.buildkite/Dockerfile
Normal file
@ -0,0 +1,14 @@
|
||||
ARG NODE_VERSION=${NODE_VERSION:-18}
|
||||
FROM node:$NODE_VERSION
|
||||
|
||||
# Install required tools
|
||||
RUN apt-get clean -y && \
|
||||
apt-get -qy update && \
|
||||
apt-get -y install zip && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY . .
|
||||
RUN npm install --production=false
|
||||
21
.buildkite/certs/testnode.crt
Executable file
21
.buildkite/certs/testnode.crt
Executable file
@ -0,0 +1,21 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDYjCCAkqgAwIBAgIVAIClHav09e9XGWJrnshywAjUHTnXMA0GCSqGSIb3DQEB
|
||||
CwUAMDQxMjAwBgNVBAMTKUVsYXN0aWMgQ2VydGlmaWNhdGUgVG9vbCBBdXRvZ2Vu
|
||||
ZXJhdGVkIENBMB4XDTIzMDMyODE3MDIzOVoXDTI2MDMyNzE3MDIzOVowEzERMA8G
|
||||
A1UEAxMIaW5zdGFuY2UwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCV
|
||||
+t5/g6u2r3awCtzqp17KG0hRxzkVoJoF8DYzVh+Rv9ymxQW0C/U8dQihAjkZHaIA
|
||||
n49lSyNLkwWtmqQgPcimV4d6XuTYx2ahDixXYtjmoOSwH5dRtovKPCNKDPkUj9Vq
|
||||
NwMW0uB1VxniMKI4DnYFqBgHL9kQKhQqvas6Gx0X6ptGRCLYCtVxeFcau6nnkZJt
|
||||
urb+HNV5waOh0uTmsqnnslK3NjCQ/f030vPKxM5fOqOU5ajUHpZFJ6ZFmS32074H
|
||||
l+mZoRT/GtbnVtIg+CJXsWThF3/L4iBImv+rkY9MKX5fyMLJgmIJG68S90IQGR8c
|
||||
Z2lZYzC0J7zjMsYlODbDAgMBAAGjgYswgYgwHQYDVR0OBBYEFIDIcECn3AVHc3jk
|
||||
MpQ4r7Kc3WCsMB8GA1UdIwQYMBaAFJYCWKn16g+acbing4Vl45QGUBs0MDsGA1Ud
|
||||
EQQ0MDKCCWxvY2FsaG9zdIIIaW5zdGFuY2WHBH8AAAGHEAAAAAAAAAAAAAAAAAAA
|
||||
AAGCA2VzMTAJBgNVHRMEAjAAMA0GCSqGSIb3DQEBCwUAA4IBAQBtX3RQ5ATpfORM
|
||||
lrnhaUPGOWkjnb3p3BrdAWUaWoh136QhaXqxKiALQQhTtTerkXOcuquy9MmAyYvS
|
||||
9fDdGvLCAO8pPCXjnzonCHerCLGdS7f/eqvSFWCdy7LPHzTAFYfVWVvbZed+83TL
|
||||
bDY63AMwIexj34vJEStMapuFwWx05fstE8qZWIbYCL87sF5H/MRhzlz3ScAhQ1N7
|
||||
tODH7zvLzSxFGGEzCIKZ0iPFKbd3Y0wE6SptDSKhOqlnC8kkNeI2GjWsqVfHKsoF
|
||||
pDFmri7IfOucuvalXJ6xiHPr9RDbuxEXs0u8mteT5nFQo7EaEGdHpg1pNGbfBOzP
|
||||
lmj/dRS9
|
||||
-----END CERTIFICATE-----
|
||||
27
.buildkite/certs/testnode.key
Executable file
27
.buildkite/certs/testnode.key
Executable file
@ -0,0 +1,27 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEowIBAAKCAQEAlfref4Ortq92sArc6qdeyhtIUcc5FaCaBfA2M1Yfkb/cpsUF
|
||||
tAv1PHUIoQI5GR2iAJ+PZUsjS5MFrZqkID3IpleHel7k2MdmoQ4sV2LY5qDksB+X
|
||||
UbaLyjwjSgz5FI/VajcDFtLgdVcZ4jCiOA52BagYBy/ZECoUKr2rOhsdF+qbRkQi
|
||||
2ArVcXhXGrup55GSbbq2/hzVecGjodLk5rKp57JStzYwkP39N9LzysTOXzqjlOWo
|
||||
1B6WRSemRZkt9tO+B5fpmaEU/xrW51bSIPgiV7Fk4Rd/y+IgSJr/q5GPTCl+X8jC
|
||||
yYJiCRuvEvdCEBkfHGdpWWMwtCe84zLGJTg2wwIDAQABAoIBAAEP7HYNNnDWdYMD
|
||||
+WAtYM12X/W5s/wUP94juaBI4u4iZH2EZodlixEdZUCTXgq43WsDUhxX05s7cE+p
|
||||
H5DuSCHtoo2WHvGKAposwRDm2f3YVWQ2Xyb2ahNt69LYHHWrO+XQ60YYTa3r8Gn3
|
||||
7dFR3I016/jyn5DeEVaglvS1dfj2UG4ybR4KkMfcKd94X0rKvz3wzAhHIh+hwMtv
|
||||
sVk7V4vSnKf2mJXwIVECTolnEJEkCjWjjymgUJYKT8yN7JnAsHRcvMa6kWwIGrLp
|
||||
oQCEaJwYM6ynCRS989pLt3vA2iu5VkYhiHXJ9Ds/5b5yzhzmj+ymzKbFKrrUUrmn
|
||||
+2Jp1K0CgYEAw8BchALsD/+JuoXjinA14MH7PZjIsXyhtPk+c4pk42iMNyg1J8XF
|
||||
Y/ITepLYsl2bZqQI1jOJdDqsTwIsva9r749lsmkYI3VOxhi7+qBK0sThR66C87lX
|
||||
iU2QpnZ9NloC6ort4a3MEvZ/gRQcXdBrNlNoza2p7PHAVDTnsdSrNKUCgYEAxCQV
|
||||
uo85oZyfnMufn/gcI9IeYOgiB0tO3a8cAFX2wQW1y935t6Z13ApUQc4EnCOH7ZBc
|
||||
td5kT+xGdRWnfPZ38FM1dd5MBdGE69s3q8pJDUExSgNLqaF6/5bD32qui66L3ugu
|
||||
eMjxrzqJsc2uQTPCs18SGsyRmf54DpY8HglOmUcCgYAGRDgx+a347SNJl1OrcOAo
|
||||
q80RMbzrAaRjmL8JD9se9I/YjC73cPtasbsx51WMkDaTWJj30nqJ//7YIKeyAtWf
|
||||
u6Vzyq19JRo6eTw7T7pVePwFQW7rwnks6hDBY3WqscL6IyxuVxP7X2zBgxVNY4ir
|
||||
Gox2WSLhdPPFPlRUewxoCQKBgAJvqE1u5fpZ5ame5dao0ECppXLyrymEB/C88g4X
|
||||
Az+WgJGNqkJbsO8QuccvdeMylcefmWcw4fIULzPZFwF4VjkH74wNPMh9t7buPBzI
|
||||
IGwnuSMAM3ph5RMzni8yNgTKIDaej6U0abwRcBBjS5zHtc1giusGS3CsNnWH7Cs7
|
||||
VlyVAoGBAK+prq9t9x3tC3NfCZH8/Wfs/X0T1qm11RiL5+tOhmbguWAqSSBy8OjX
|
||||
Yh8AOXrFuMGldcaTXxMeiKvI2cyybnls1MFsPoeV/fSMJbex7whdeJeTi66NOSKr
|
||||
oftUHvkHS0Vv/LicMEOufFGslb4T9aPJ7oyhoSlz9CfAutDWk/q/
|
||||
-----END RSA PRIVATE KEY-----
|
||||
0
.ci/functions/cleanup.sh → .buildkite/functions/cleanup.sh
Normal file → Executable file
0
.ci/functions/cleanup.sh → .buildkite/functions/cleanup.sh
Normal file → Executable file
0
.ci/functions/imports.sh → .buildkite/functions/imports.sh
Normal file → Executable file
0
.ci/functions/imports.sh → .buildkite/functions/imports.sh
Normal file → Executable file
0
.ci/functions/wait-for-container.sh → .buildkite/functions/wait-for-container.sh
Normal file → Executable file
0
.ci/functions/wait-for-container.sh → .buildkite/functions/wait-for-container.sh
Normal file → Executable file
30
.buildkite/pipeline.yml
Normal file
30
.buildkite/pipeline.yml
Normal file
@ -0,0 +1,30 @@
|
||||
steps:
|
||||
- label: ":elasticsearch: :javascript: ES JavaScript ({{ matrix.nodejs }}) Test Suite: {{ matrix.suite }}"
|
||||
agents:
|
||||
provider: "gcp"
|
||||
env:
|
||||
NODE_VERSION: "{{ matrix.nodejs }}"
|
||||
TEST_SUITE: "{{ matrix.suite }}"
|
||||
STACK_VERSION: 8.8.0-SNAPSHOT
|
||||
matrix:
|
||||
setup:
|
||||
suite:
|
||||
- "free"
|
||||
- "platinum"
|
||||
nodejs:
|
||||
- "16"
|
||||
- "18"
|
||||
- "20"
|
||||
command: ./.buildkite/run-tests.sh
|
||||
artifact_paths: "./junit-output/junit-*.xml"
|
||||
- wait: ~
|
||||
continue_on_failure: true
|
||||
- label: ":junit: Test results"
|
||||
agents:
|
||||
provider: "gcp"
|
||||
image: family/core-ubuntu-2204
|
||||
plugins:
|
||||
- junit-annotate#v2.4.1:
|
||||
artifacts: "junit-output/junit-*.xml"
|
||||
job-uuid-file-pattern: 'junit-(.*).xml'
|
||||
fail-build-on-error: true
|
||||
31
.buildkite/run-client.sh
Executable file
31
.buildkite/run-client.sh
Executable file
@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Once called Elasticsearch should be up and running
|
||||
#
|
||||
script_path=$(dirname "$(realpath -s "$0")")
|
||||
set -euo pipefail
|
||||
repo=$(pwd)
|
||||
|
||||
export NODE_VERSION=${NODE_VERSION:-18}
|
||||
|
||||
echo "--- :javascript: Building Docker image"
|
||||
docker build \
|
||||
--file "$script_path/Dockerfile" \
|
||||
--tag elastic/elasticsearch-js \
|
||||
--build-arg NODE_VERSION="$NODE_VERSION" \
|
||||
.
|
||||
|
||||
echo "--- :javascript: Running $TEST_SUITE tests"
|
||||
mkdir -p "$repo/junit-output"
|
||||
docker run \
|
||||
--network="${network_name}" \
|
||||
--env "TEST_ES_SERVER=${elasticsearch_url}" \
|
||||
--env "ELASTIC_PASSWORD=${elastic_password}" \
|
||||
--env "TEST_SUITE=${TEST_SUITE}" \
|
||||
--env "ELASTIC_USER=elastic" \
|
||||
--env "BUILDKITE=true" \
|
||||
--volume "$repo/junit-output:/junit-output" \
|
||||
--name elasticsearch-js \
|
||||
--rm \
|
||||
elastic/elasticsearch-js \
|
||||
bash -c "npm run test:integration; [ -f ./$TEST_SUITE-report-junit.xml ] && mv ./$TEST_SUITE-report-junit.xml /junit-output/junit-$BUILDKITE_JOB_ID.xml || echo 'No JUnit artifact found'"
|
||||
@ -26,12 +26,15 @@ script_path=$(dirname $(realpath -s $0))
|
||||
source $script_path/functions/imports.sh
|
||||
set -euo pipefail
|
||||
|
||||
echo -e "\033[34;1mINFO:\033[0m Take down node if called twice with the same arguments (DETACH=true) or on seperate terminals \033[0m"
|
||||
echo -e "\033[34;1mINFO:\033[0m Take down node if called twice with the same arguments (DETACH=true) or on separate terminals \033[0m"
|
||||
cleanup_node $es_node_name
|
||||
|
||||
master_node_name=${es_node_name}
|
||||
cluster_name=${moniker}${suffix}
|
||||
|
||||
# Set vm.max_map_count kernel setting to 262144
|
||||
sudo sysctl -w vm.max_map_count=262144
|
||||
|
||||
declare -a volumes
|
||||
environment=($(cat <<-END
|
||||
--env ELASTIC_PASSWORD=$elastic_password
|
||||
@ -73,6 +76,7 @@ END
|
||||
))
|
||||
else
|
||||
environment+=($(cat <<-END
|
||||
--env node.roles=data,data_cold,data_content,data_frozen,data_hot,data_warm,ingest,master,ml,remote_cluster_client,transform
|
||||
--env xpack.security.enabled=false
|
||||
--env xpack.security.http.ssl.enabled=false
|
||||
END
|
||||
@ -84,6 +88,13 @@ if [[ "$TEST_SUITE" == "platinum" ]]; then
|
||||
cert_validation_flags="--insecure --cacert /usr/share/elasticsearch/config/certs/ca.crt --resolve ${es_node_name}:443:127.0.0.1"
|
||||
fi
|
||||
|
||||
echo "--- :elasticsearch: Environment setup"
|
||||
echo "TEST_SUITE: $TEST_SUITE"
|
||||
echo "Elasticsearch URL: $elasticsearch_url"
|
||||
echo "Elasticsearch External URL: $external_elasticsearch_url"
|
||||
|
||||
|
||||
echo "--- :elasticsearch: Running container"
|
||||
# Pull the container, retry on failures up to 5 times with
|
||||
# short delays between each attempt. Fixes most transient network errors.
|
||||
docker_pull_attempts=0
|
||||
@ -138,6 +149,4 @@ END
|
||||
if wait_for_container "$es_node_name" "$network_name"; then
|
||||
echo -e "\033[32;1mSUCCESS:\033[0m Running on: $node_url\033[0m"
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
16
.buildkite/run-tests.sh
Executable file
16
.buildkite/run-tests.sh
Executable file
@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Script to run Elasticsearch container and Elasticsearch client integration tests on Buildkite
|
||||
#
|
||||
# Version 0.1
|
||||
#
|
||||
script_path=$(dirname "$(realpath -s "$0")")
|
||||
source "$script_path/functions/imports.sh"
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
echo "--- :elasticsearch: Starting Elasticsearch"
|
||||
DETACH=true bash "$script_path/run-elasticsearch.sh"
|
||||
|
||||
echo "+++ :javascript: Run Client"
|
||||
bash "$script_path/run-client.sh"
|
||||
@ -1,4 +1,4 @@
|
||||
ARG NODE_JS_VERSION=10
|
||||
ARG NODE_JS_VERSION=18
|
||||
FROM node:${NODE_JS_VERSION}
|
||||
|
||||
# Create app directory
|
||||
|
||||
@ -1,19 +0,0 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDIzCCAgugAwIBAgIVAMTO6uVx9dLox2t0lY4IcBKZXb5WMA0GCSqGSIb3DQEB
|
||||
CwUAMDQxMjAwBgNVBAMTKUVsYXN0aWMgQ2VydGlmaWNhdGUgVG9vbCBBdXRvZ2Vu
|
||||
ZXJhdGVkIENBMB4XDTIwMDIyNjA1NTA1OVoXDTIzMDIyNTA1NTA1OVowEzERMA8G
|
||||
A1UEAxMIaW5zdGFuY2UwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDK
|
||||
YLTOikVENiN/qYupOsoXd7VYYnryyfCC/dK4FC2aozkbqjFzBdvPGAasoc4yEiH5
|
||||
CGeXMgJuOjk1maqetmdIsw00j4oHJviYsnGXzxxS5swhD7spcW4Uk4V4tAUzrbfT
|
||||
vW/2WW/yYCLe5phVb2chz0jL+WYb4bBmdfs/t6RtP9RqsplYAmVp3gZ6lt2YNtvE
|
||||
k9gz0TVk3DuO1TquIClfRYUjuywS6xDSvxJ8Jl91EfDWM8QU+9F+YAtiv74xl2U3
|
||||
P0wwMqNvMxf9/3ak3lTQGsgO4L6cwbKpVLMMzxSVunZz/sgl19xy3qHHz1Qr2MjJ
|
||||
/2c2J7vahUL4NPRkjJClAgMBAAGjTTBLMB0GA1UdDgQWBBS2Wn8E2VZv4oenY+pR
|
||||
O8G3zfQXhzAfBgNVHSMEGDAWgBSWAlip9eoPmnG4p4OFZeOUBlAbNDAJBgNVHRME
|
||||
AjAAMA0GCSqGSIb3DQEBCwUAA4IBAQAvwPvCiJJ6v9jYcyvYY8I3gP0oCwrylpRL
|
||||
n91UlgRSHUmuAObyOoVN5518gSV/bTU2SDrstcLkLFxHvnfpoGJoxsQEHuGxwDRI
|
||||
nhYNd62EKLerehNM/F9ILKmvTh8f6QPCzjUuExTXv+63l2Sr6dBS7FHsGs6UKUYO
|
||||
llM/y9wMZ1LCuZuBg9RhtgpFXRSgDM9Z7Begu0d/BPX9od/qAeZg9Arz4rwUiCN4
|
||||
IJOMEBEPi5q1tgeS0Fb1Grpqd0Uz5tZKtEHNKzLG+zSMmkneL62Nk2HsmEFZKwzg
|
||||
u2pU42UaUE596G6o78s1aLn9ICcElPHTjiuZNSiyuu9IzvFDjGQw
|
||||
-----END CERTIFICATE-----
|
||||
@ -1,27 +0,0 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEogIBAAKCAQEAymC0zopFRDYjf6mLqTrKF3e1WGJ68snwgv3SuBQtmqM5G6ox
|
||||
cwXbzxgGrKHOMhIh+QhnlzICbjo5NZmqnrZnSLMNNI+KByb4mLJxl88cUubMIQ+7
|
||||
KXFuFJOFeLQFM623071v9llv8mAi3uaYVW9nIc9Iy/lmG+GwZnX7P7ekbT/UarKZ
|
||||
WAJlad4GepbdmDbbxJPYM9E1ZNw7jtU6riApX0WFI7ssEusQ0r8SfCZfdRHw1jPE
|
||||
FPvRfmALYr++MZdlNz9MMDKjbzMX/f92pN5U0BrIDuC+nMGyqVSzDM8Ulbp2c/7I
|
||||
Jdfcct6hx89UK9jIyf9nNie72oVC+DT0ZIyQpQIDAQABAoIBADAh7f7NjgnaInlD
|
||||
ds8KB3SraPsbeQhzlPtiqRJU4j/MIFH/GYG03AGWQkget67a9y+GmzSvlTpoKKEh
|
||||
6h2TXl9BDpv4o6ht0WRn1HJ5tM/Wyqf2WNpTew3zxCPgFPikkXsPrChYPzLTQJfp
|
||||
GkP/mfTFmxfAOlPZSp4j41zVLYs53eDkAegFPVfKSr1XNNJ3QODLPcIBfxBYsiC9
|
||||
oU+jRW8xYuj31cEl5k5UqrChJ1rm3mt6cguqXKbISuoSvi13gXI6DccqhuLAU+Kr
|
||||
ib2XYrRP+pWocZo/pM9WUVoNGtFxfY88sAQtvG6gDKo2AURtFyq84Ow0h9mdixV/
|
||||
gRIDPcECgYEA5nEqE3OKuG9WuUFGXvjtn4C0F6JjflYWh7AbX51S4F6LKrW6/XHL
|
||||
Rg4BtF+XReT7OQ6llsV8kZeUxsUckkgDLzSaA8lysNDV5KkhAWHfRqH//QKFbqZi
|
||||
JL9t3x63Qt81US8s2hQk3khPYTRM8ZB3xHiXvZYSGC/0x/DxfEO3QJECgYEA4NK5
|
||||
sxtrat8sFz6SK9nWEKimPjDVzxJ0hxdX4tRq/JdOO5RncawVqt6TNP9gTuxfBvhW
|
||||
MhJYEsQj8iUoL1dxo9d1eP8HEANNV0iX5OBvJNmgBp+2OyRSyr+PA55+wAxYuAE7
|
||||
QKaitOjW57fpArNRt2hQyiSzTuqUFRWTWJHCWNUCgYAEurPTXF6vdFGCUc2g61jt
|
||||
GhYYGhQSpq+lrz6Qksj9o9MVWE9zHh++21C7o+6V16I0RJGva3QoBMVf4vG4KtQt
|
||||
5tV2WG8LI+4P2Ey+G4UajP6U8bVNVQrUmD0oBBhcvfn5JY+1Fg6/pRpD82/U0VMz
|
||||
7AmpMWhDqNBMPiymkTk0kQKBgCuWb05cSI0ly4SOKwS5bRk5uVFhYnKNH255hh6C
|
||||
FGP4acB/WzbcqC7CjEPAJ0nl5d6SExQOHmk1AcsWjR3wlCWxxiK5PwNJwJrlhh1n
|
||||
reS1FKN0H36D4lFQpkeLWQOe4Sx7gKNeKzlr0w6Fx3Uwku0+Gju2tdTdAey8jB6l
|
||||
08opAoGAEe1AuR/OFp2xw6V8TH9UHkkpGxy+OrXI6PX6tgk29PgB+uiMu4RwbjVz
|
||||
1di1KKq2XecAilVbnyqY+edADxYGbSnci9x5wQRIebfMi3VXKtV8NQBv2as6qwtW
|
||||
JDcQUWotOHjpdvmfJWWkcBhbAKrgX8ukww00ZI/lC3/rmkGnBBg=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
@ -1,7 +0,0 @@
|
||||
ARG NODE_JS_VERSION=10
|
||||
FROM node:${NODE_JS_VERSION}-alpine
|
||||
|
||||
RUN apk --no-cache add git
|
||||
|
||||
# Create app directory
|
||||
WORKDIR /usr/src/app
|
||||
@ -1,81 +0,0 @@
|
||||
---
|
||||
|
||||
##### GLOBAL METADATA
|
||||
|
||||
- meta:
|
||||
cluster: clients-ci
|
||||
|
||||
##### JOB DEFAULTS
|
||||
|
||||
- job:
|
||||
project-type: matrix
|
||||
logrotate:
|
||||
daysToKeep: 30
|
||||
numToKeep: 100
|
||||
parameters:
|
||||
- string:
|
||||
name: branch_specifier
|
||||
default: refs/heads/main
|
||||
description: the Git branch specifier to build (<branchName>, <tagName>,
|
||||
<commitId>, etc.)
|
||||
properties:
|
||||
- github:
|
||||
url: https://github.com/elastic/elasticsearch-js/
|
||||
- inject:
|
||||
properties-content: HOME=$JENKINS_HOME
|
||||
concurrent: true
|
||||
node: flyweight
|
||||
scm:
|
||||
- git:
|
||||
name: origin
|
||||
credentials-id: f6c7695a-671e-4f4f-a331-acdce44ff9ba
|
||||
reference-repo: /var/lib/jenkins/.git-references/elasticsearch-js.git
|
||||
branches:
|
||||
- ${branch_specifier}
|
||||
url: https://github.com/elastic/elasticsearch-js.git
|
||||
basedir: ''
|
||||
wipe-workspace: 'True'
|
||||
triggers:
|
||||
- github
|
||||
vault:
|
||||
# vault read auth/approle/role/clients-ci/role-id
|
||||
role_id: ddbd0d44-0e51-105b-177a-c8fdfd445126
|
||||
axes:
|
||||
- axis:
|
||||
type: slave
|
||||
name: label
|
||||
values:
|
||||
- linux
|
||||
- axis:
|
||||
type: yaml
|
||||
filename: .ci/test-matrix.yml
|
||||
name: STACK_VERSION
|
||||
- axis:
|
||||
type: yaml
|
||||
filename: .ci/test-matrix.yml
|
||||
name: NODE_JS_VERSION
|
||||
- axis:
|
||||
type: yaml
|
||||
filename: .ci/test-matrix.yml
|
||||
name: TEST_SUITE
|
||||
yaml-strategy:
|
||||
exclude-key: exclude
|
||||
filename: .ci/test-matrix.yml
|
||||
wrappers:
|
||||
- ansicolor
|
||||
- timeout:
|
||||
type: absolute
|
||||
timeout: 120
|
||||
fail: true
|
||||
- timestamps
|
||||
- workspace-cleanup
|
||||
builders:
|
||||
- shell: |-
|
||||
#!/usr/local/bin/runbld
|
||||
.ci/run-tests
|
||||
publishers:
|
||||
- email:
|
||||
recipients: build-lang-clients@elastic.co
|
||||
- junit:
|
||||
results: "**/*-junit.xml"
|
||||
allow-empty-results: true
|
||||
@ -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 (<branchName>, <tagName>,
|
||||
<commitId>, etc.)
|
||||
triggers:
|
||||
- github
|
||||
- timed: '@weekly'
|
||||
@ -1,15 +0,0 @@
|
||||
---
|
||||
- job:
|
||||
name: elastic+elasticsearch-js+6.x
|
||||
display-name: 'elastic / elasticsearch-js # 6.x'
|
||||
description: Testing the elasticsearch-js 6.x branch.
|
||||
junit_results: "*-junit.xml"
|
||||
parameters:
|
||||
- string:
|
||||
name: branch_specifier
|
||||
default: refs/heads/6.x
|
||||
description: the Git branch specifier to build (<branchName>, <tagName>,
|
||||
<commitId>, etc.)
|
||||
triggers:
|
||||
- github
|
||||
- timed: 'H */12 * * *'
|
||||
@ -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 (<branchName>, <tagName>,
|
||||
<commitId>, etc.)
|
||||
triggers:
|
||||
- github
|
||||
- timed: 'H */12 * * *'
|
||||
@ -1,15 +0,0 @@
|
||||
---
|
||||
- job:
|
||||
name: elastic+elasticsearch-js+7.17
|
||||
display-name: 'elastic / elasticsearch-js # 7.17'
|
||||
description: Testing the elasticsearch-js 7.17 branch.
|
||||
junit_results: "*-junit.xml"
|
||||
parameters:
|
||||
- string:
|
||||
name: branch_specifier
|
||||
default: refs/heads/7.17
|
||||
description: the Git branch specifier to build (<branchName>, <tagName>,
|
||||
<commitId>, etc.)
|
||||
triggers:
|
||||
- github
|
||||
- timed: 'H */12 * * *'
|
||||
@ -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 (<branchName>, <tagName>,
|
||||
<commitId>, etc.)
|
||||
triggers:
|
||||
- github
|
||||
- timed: 'H */12 * * *'
|
||||
@ -1,15 +0,0 @@
|
||||
---
|
||||
- job:
|
||||
name: elastic+elasticsearch-js+8.1
|
||||
display-name: 'elastic / elasticsearch-js # 8.1'
|
||||
description: Testing the elasticsearch-js 8.1 branch.
|
||||
junit_results: "*-junit.xml"
|
||||
parameters:
|
||||
- string:
|
||||
name: branch_specifier
|
||||
default: refs/heads/8.1
|
||||
description: the Git branch specifier to build (<branchName>, <tagName>,
|
||||
<commitId>, etc.)
|
||||
triggers:
|
||||
- github
|
||||
- timed: 'H */12 * * *'
|
||||
@ -1,15 +0,0 @@
|
||||
---
|
||||
- job:
|
||||
name: elastic+elasticsearch-js+main
|
||||
display-name: 'elastic / elasticsearch-js # main'
|
||||
description: Testing the elasticsearch-js main branch.
|
||||
junit_results: "*-junit.xml"
|
||||
parameters:
|
||||
- string:
|
||||
name: branch_specifier
|
||||
default: refs/heads/main
|
||||
description: the Git branch specifier to build (<branchName>, <tagName>,
|
||||
<commitId>, etc.)
|
||||
triggers:
|
||||
- github
|
||||
- timed: 'H */12 * * *'
|
||||
@ -1,19 +0,0 @@
|
||||
---
|
||||
- job:
|
||||
name: elastic+elasticsearch-js+pull-request
|
||||
display-name: 'elastic / elasticsearch-js # pull-request'
|
||||
description: Testing of elasticsearch-js pull requests.
|
||||
junit_results: "*-junit.xml"
|
||||
scm:
|
||||
- git:
|
||||
branches:
|
||||
- ${ghprbActualCommit}
|
||||
refspec: +refs/pull/*:refs/remotes/origin/pr/*
|
||||
triggers:
|
||||
- github-pull-request:
|
||||
org-list:
|
||||
- elastic
|
||||
allow-whitelist-orgs-as-admins: true
|
||||
github-hooks: true
|
||||
status-context: clients-ci
|
||||
cancel-builds-on-update: true
|
||||
127
.ci/make.mjs
Normal file
127
.ci/make.mjs
Normal file
@ -0,0 +1,127 @@
|
||||
/*
|
||||
* 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 pipeline = await readFile(join(import.meta.url, '..', '.buildkite', 'pipeline.yml'))
|
||||
await writeFile(
|
||||
join(import.meta.url, '..', '.buildkite', 'pipeline.yml'),
|
||||
pipeline.replace(/STACK_VERSION: [0-9]+[0-9\.]*[0-9](?:\-SNAPSHOT)?/, `STACK_VERSION: - ${cleanVersion}-SNAPSHOT`), // eslint-disable-line
|
||||
'utf8'
|
||||
)
|
||||
}
|
||||
|
||||
// this command can only be executed locally for now
|
||||
async function codegen (args) {
|
||||
assert(args.length === 1, 'Codegen task expects one parameter')
|
||||
const [version] = args
|
||||
|
||||
const clientGeneratorPath = join(import.meta.url, '..', '..', 'elastic-client-generator-js')
|
||||
const isGeneratorCloned = await $`[[ -d ${clientGeneratorPath} ]]`.exitCode === 0
|
||||
assert(isGeneratorCloned, 'You must clone the elastic-client-generator-js first')
|
||||
|
||||
await $`npm install --prefix ${clientGeneratorPath}`
|
||||
|
||||
// generate elasticsearch client. 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('.')}`
|
||||
}
|
||||
// clean up fixable linter issues
|
||||
await $`npm run fix --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)
|
||||
}
|
||||
187
.ci/make.sh
Executable file
187
.ci/make.sh
Executable file
@ -0,0 +1,187 @@
|
||||
#!/usr/bin/env bash
|
||||
# ------------------------------------------------------- #
|
||||
#
|
||||
# Build entry script for elasticsearch-js
|
||||
#
|
||||
# Must be called: ./.ci/make.sh <target> <params>
|
||||
#
|
||||
# Version: 1.1.0
|
||||
#
|
||||
# Targets:
|
||||
# ---------------------------
|
||||
# assemble <VERSION> : build client artifacts with version
|
||||
# bump <VERSION> : bump client internals to version
|
||||
# bumpmatrix <VERSION> : bump stack version in test matrix to version
|
||||
# codegen : 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
|
||||
set -euo pipefail
|
||||
|
||||
product="elastic/elasticsearch-js"
|
||||
output_folder=".ci/output"
|
||||
codegen_folder=".ci/output"
|
||||
OUTPUT_DIR="$repo/${output_folder}"
|
||||
# REPO_BINDING="${OUTPUT_DIR}:/sln/${output_folder}"
|
||||
NODE_JS_VERSION=18
|
||||
WORKFLOW=${WORKFLOW-staging}
|
||||
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"
|
||||
|
||||
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")
|
||||
;;
|
||||
bumpmatrix)
|
||||
if [ -v $VERSION ]; then
|
||||
echo -e "\033[31;1mTARGET: bumpmatrix -> missing version parameter\033[0m"
|
||||
exit 1
|
||||
fi
|
||||
echo -e "\033[36;1mTARGET: bump stack in test matrix to version $VERSION\033[0m"
|
||||
TASK=bumpmatrix
|
||||
TASK_ARGS=("$VERSION")
|
||||
;;
|
||||
*)
|
||||
echo -e "\n'$CMD' is not supported right now\n"
|
||||
echo -e "\nUsage:"
|
||||
echo -e "\t $0 release \$VERSION\n"
|
||||
echo -e "\t $0 bump \$VERSION"
|
||||
echo -e "\t $0 codegen \$VERSION"
|
||||
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" \
|
||||
.
|
||||
|
||||
# ------------------------------------------------------- #
|
||||
# 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 \
|
||||
-u "$(id -u):$(id -g)" \
|
||||
--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
|
||||
@ -1,14 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source /usr/local/bin/bash_standard_lib.sh
|
||||
|
||||
DOCKER_IMAGES="node:16-alpine
|
||||
node:14-alpine
|
||||
node:12-alpine
|
||||
"
|
||||
|
||||
for di in ${DOCKER_IMAGES}
|
||||
do
|
||||
(retry 2 docker pull "${di}") || echo "Error pulling ${di} Docker image, we continue"
|
||||
done
|
||||
|
||||
@ -1,43 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# parameters are available to this script
|
||||
|
||||
# STACK_VERSION -- version e.g Major.Minor.Patch(-Prelease)
|
||||
# TEST_SUITE -- which test suite to run: free or platinum
|
||||
# ELASTICSEARCH_URL -- The url at which elasticsearch is reachable, a default is composed based on STACK_VERSION and TEST_SUITE
|
||||
# NODE_JS_VERSION -- node js version (defined in test-matrix.yml, a default is hardcoded here)
|
||||
script_path=$(dirname $(realpath -s $0))
|
||||
source $script_path/functions/imports.sh
|
||||
set -euo pipefail
|
||||
|
||||
NODE_JS_VERSION=${NODE_JS_VERSION-12}
|
||||
ELASTICSEARCH_URL=${ELASTICSEARCH_URL-"$elasticsearch_url"}
|
||||
elasticsearch_container=${elasticsearch_container-}
|
||||
|
||||
echo -e "\033[34;1mINFO:\033[0m VERSION ${STACK_VERSION}\033[0m"
|
||||
echo -e "\033[34;1mINFO:\033[0m TEST_SUITE ${TEST_SUITE}\033[0m"
|
||||
echo -e "\033[34;1mINFO:\033[0m URL ${ELASTICSEARCH_URL}\033[0m"
|
||||
echo -e "\033[34;1mINFO:\033[0m CONTAINER ${elasticsearch_container}\033[0m"
|
||||
echo -e "\033[34;1mINFO:\033[0m NODE_JS_VERSION ${NODE_JS_VERSION}\033[0m"
|
||||
|
||||
echo -e "\033[1m>>>>> Build docker container >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m"
|
||||
|
||||
docker build \
|
||||
--file .ci/Dockerfile \
|
||||
--tag elastic/elasticsearch-js \
|
||||
--build-arg NODE_JS_VERSION=${NODE_JS_VERSION} \
|
||||
.
|
||||
|
||||
echo -e "\033[1m>>>>> NPM run test:integration >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m"
|
||||
|
||||
repo=$(realpath $(dirname $(realpath -s $0))/../)
|
||||
|
||||
docker run \
|
||||
--network=${network_name} \
|
||||
--env "TEST_ES_SERVER=${ELASTICSEARCH_URL}" \
|
||||
--env "TEST_SUITE=${TEST_SUITE}" \
|
||||
--volume $repo:/usr/src/app \
|
||||
--volume /usr/src/app/node_modules \
|
||||
--name elasticsearch-js \
|
||||
--rm \
|
||||
elastic/elasticsearch-js \
|
||||
npm run test:integration
|
||||
@ -1,23 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Version 1.1
|
||||
# - Moved to .ci folder and seperated out `run-repository.sh`
|
||||
# - Add `$RUNSCRIPTS` env var for running Elasticsearch dependent products
|
||||
script_path=$(dirname $(realpath -s $0))
|
||||
source $script_path/functions/imports.sh
|
||||
set -euo pipefail
|
||||
|
||||
echo -e "\033[1m>>>>> Start [$STACK_VERSION container] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m"
|
||||
DETACH=true bash .ci/run-elasticsearch.sh
|
||||
|
||||
if [[ -n "$RUNSCRIPTS" ]]; then
|
||||
for RUNSCRIPT in ${RUNSCRIPTS//,/ } ; do
|
||||
echo -e "\033[1m>>>>> Running run-$RUNSCRIPT.sh >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m"
|
||||
CONTAINER_NAME=${RUNSCRIPT} \
|
||||
DETACH=true \
|
||||
bash .ci/run-${RUNSCRIPT}.sh
|
||||
done
|
||||
fi
|
||||
|
||||
echo -e "\033[1m>>>>> Repository specific tests >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m"
|
||||
bash .ci/run-repository.sh
|
||||
@ -1,14 +0,0 @@
|
||||
---
|
||||
STACK_VERSION:
|
||||
- 8.0.0-SNAPSHOT
|
||||
|
||||
NODE_JS_VERSION:
|
||||
- 16
|
||||
- 14
|
||||
- 12
|
||||
|
||||
TEST_SUITE:
|
||||
- free
|
||||
- platinum
|
||||
|
||||
exclude: ~
|
||||
1
.github/ISSUE_TEMPLATE/regression.md
vendored
1
.github/ISSUE_TEMPLATE/regression.md
vendored
@ -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*
|
||||
|
||||
2
.github/workflows/backport.yml
vendored
2
.github/workflows/backport.yml
vendored
@ -11,6 +11,6 @@ jobs:
|
||||
name: Backport
|
||||
steps:
|
||||
- name: Backport
|
||||
uses: tibdex/backport@v1
|
||||
uses: tibdex/backport@v2
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
199
.github/workflows/nodejs.yml
vendored
199
.github/workflows/nodejs.yml
vendored
@ -1,3 +1,4 @@
|
||||
---
|
||||
name: Node CI
|
||||
|
||||
on: [push, pull_request]
|
||||
@ -8,167 +9,37 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node-version: [12.x, 14.x, 16.x]
|
||||
node-version: [14.x, 16.x, 18.x, 20.x]
|
||||
os: [ubuntu-latest, windows-latest, macOS-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
- name: Install
|
||||
run: |
|
||||
npm install
|
||||
# workaround for failing tests on Node.js 14.x
|
||||
# see https://github.com/actions/setup-node/issues/411
|
||||
- name: Force install specific npm version
|
||||
run: |
|
||||
npm install --global npm@8.3.1
|
||||
npm install --global npm@9.7.1
|
||||
|
||||
- name: Lint
|
||||
run: |
|
||||
npm run lint
|
||||
- name: Install
|
||||
run: |
|
||||
npm install
|
||||
|
||||
- name: Unit test
|
||||
run: |
|
||||
npm run test:unit
|
||||
- name: Lint
|
||||
run: |
|
||||
npm run lint
|
||||
|
||||
# - name: Acceptance test
|
||||
# run: |
|
||||
# npm run test:acceptance
|
||||
|
||||
# helpers-integration-test:
|
||||
# name: Helpers integration test
|
||||
# runs-on: ubuntu-latest
|
||||
|
||||
# strategy:
|
||||
# matrix:
|
||||
# node-version: [12.x, 14.x, 16.x]
|
||||
|
||||
# steps:
|
||||
# - uses: actions/checkout@v2
|
||||
|
||||
# - name: Configure sysctl limits
|
||||
# run: |
|
||||
# sudo swapoff -a
|
||||
# sudo sysctl -w vm.swappiness=1
|
||||
# sudo sysctl -w fs.file-max=262144
|
||||
# sudo sysctl -w vm.max_map_count=262144
|
||||
|
||||
# - name: Runs Elasticsearch
|
||||
# uses: elastic/elastic-github-actions/elasticsearch@master
|
||||
# with:
|
||||
# stack-version: 8.0.0-SNAPSHOT
|
||||
|
||||
# - name: Use Node.js ${{ matrix.node-version }}
|
||||
# uses: actions/setup-node@v1
|
||||
# with:
|
||||
# node-version: ${{ matrix.node-version }}
|
||||
|
||||
# - name: Install
|
||||
# run: |
|
||||
# npm install
|
||||
|
||||
# - name: Integration test
|
||||
# run: |
|
||||
# npm run test:integration:helpers
|
||||
|
||||
# bundler-support:
|
||||
# name: Bundler support
|
||||
# runs-on: ubuntu-latest
|
||||
|
||||
# steps:
|
||||
# - uses: actions/checkout@v2
|
||||
|
||||
# - name: Configure sysctl limits
|
||||
# run: |
|
||||
# sudo swapoff -a
|
||||
# sudo sysctl -w vm.swappiness=1
|
||||
# sudo sysctl -w fs.file-max=262144
|
||||
# sudo sysctl -w vm.max_map_count=262144
|
||||
|
||||
# - name: Runs Elasticsearch
|
||||
# uses: elastic/elastic-github-actions/elasticsearch@master
|
||||
# with:
|
||||
# stack-version: 8.0.0-SNAPSHOT
|
||||
|
||||
# - name: Use Node.js 14.x
|
||||
# uses: actions/setup-node@v1
|
||||
# with:
|
||||
# node-version: 14.x
|
||||
|
||||
# - name: Install
|
||||
# run: |
|
||||
# npm install
|
||||
# npm install --prefix test/bundlers/parcel-test
|
||||
# npm install --prefix test/bundlers/rollup-test
|
||||
# npm install --prefix test/bundlers/webpack-test
|
||||
|
||||
# - name: Build
|
||||
# run: |
|
||||
# npm run build --prefix test/bundlers/parcel-test
|
||||
# npm run build --prefix test/bundlers/rollup-test
|
||||
# npm run build --prefix test/bundlers/webpack-test
|
||||
|
||||
# - name: Run bundle
|
||||
# run: |
|
||||
# npm start --prefix test/bundlers/parcel-test
|
||||
# npm start --prefix test/bundlers/rollup-test
|
||||
# npm start --prefix test/bundlers/webpack-test
|
||||
|
||||
# mock-support:
|
||||
# name: Mock support
|
||||
# runs-on: ubuntu-latest
|
||||
|
||||
# steps:
|
||||
# - uses: actions/checkout@v2
|
||||
|
||||
# - name: Use Node.js 14.x
|
||||
# uses: actions/setup-node@v1
|
||||
# with:
|
||||
# node-version: 14.x
|
||||
|
||||
# - name: Install
|
||||
# run: |
|
||||
# npm install
|
||||
# npm install --prefix test/mock
|
||||
|
||||
# - name: Run test
|
||||
# run: |
|
||||
# npm test --prefix test/mock
|
||||
|
||||
# code-coverage:
|
||||
# name: Code coverage
|
||||
# runs-on: ubuntu-latest
|
||||
|
||||
# strategy:
|
||||
# matrix:
|
||||
# node-version: [14.x]
|
||||
|
||||
# steps:
|
||||
# - uses: actions/checkout@v2
|
||||
|
||||
# - name: Use Node.js ${{ matrix.node-version }}
|
||||
# uses: actions/setup-node@v1
|
||||
# with:
|
||||
# node-version: ${{ matrix.node-version }}
|
||||
|
||||
# - name: Install
|
||||
# run: |
|
||||
# npm install
|
||||
|
||||
# - name: Code coverage report
|
||||
# run: |
|
||||
# npm run test:coverage-report
|
||||
|
||||
# - name: Upload coverage to Codecov
|
||||
# uses: codecov/codecov-action@v1
|
||||
# with:
|
||||
# file: ./coverage.lcov
|
||||
# fail_ci_if_error: true
|
||||
|
||||
# - name: Code coverage 100%
|
||||
# run: |
|
||||
# npm run test:coverage-100
|
||||
- name: Unit test
|
||||
run: |
|
||||
npm run test:unit
|
||||
|
||||
license:
|
||||
name: License check
|
||||
@ -176,20 +47,20 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [14.x]
|
||||
node-version: [20.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
- name: Install
|
||||
run: |
|
||||
npm install
|
||||
- name: Install
|
||||
run: |
|
||||
npm install
|
||||
|
||||
- name: License checker
|
||||
run: |
|
||||
npm run license-checker
|
||||
- name: License checker
|
||||
run: |
|
||||
npm run license-checker
|
||||
|
||||
@ -72,7 +72,3 @@ CODE_OF_CONDUCT.md
|
||||
CONTRIBUTING.md
|
||||
|
||||
src
|
||||
|
||||
# CANARY-PACKAGE
|
||||
lib/api/kibana.*
|
||||
# /CANARY-PACKAGE
|
||||
|
||||
3
CHANGELOG.md
Normal file
3
CHANGELOG.md
Normal file
@ -0,0 +1,3 @@
|
||||
303 See Other
|
||||
|
||||
Location: https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/changelog-client.html
|
||||
11
Makefile
Normal file
11
Makefile
Normal file
@ -0,0 +1,11 @@
|
||||
.PHONY: integration-setup
|
||||
integration-setup: integration-cleanup
|
||||
DETACH=true .ci/run-elasticsearch.sh
|
||||
|
||||
.PHONY: integration-cleanup
|
||||
integration-cleanup:
|
||||
docker container rm --force --volumes instance || true
|
||||
|
||||
.PHONY: integration
|
||||
integration: integration-setup
|
||||
npm run test:integration
|
||||
2
NOTICE.txt
Normal file
2
NOTICE.txt
Normal file
@ -0,0 +1,2 @@
|
||||
Elasticsearch JavaScript Client
|
||||
Copyright 2022 Elasticsearch B.V.
|
||||
17
README.md
17
README.md
@ -2,16 +2,10 @@
|
||||
|
||||
# Elasticsearch Node.js client
|
||||
|
||||
[](http://standardjs.com/) [](https://clients-ci.elastic.co/view/Javascript/job/elastic+elasticsearch-js+master/) [](https://codecov.io/gh/elastic/elasticsearch-js) [](https://www.npmjs.com/package/@elastic/elasticsearch)
|
||||
[](http://standardjs.com/) [](https://clients-ci.elastic.co/view/JavaScript/job/elastic+elasticsearch-js+main/) [](https://github.com/elastic/elasticsearch-js/actions/workflows/nodejs.yml) [](https://codecov.io/gh/elastic/elasticsearch-js) [](https://www.npmjs.com/package/@elastic/elasticsearch)
|
||||
|
||||
The official Node.js client for Elasticsearch.
|
||||
|
||||
---
|
||||
|
||||
**Note:** In the past months we have worked on the new Elasticsearch Node.js client and you can use it by following the instructions below. If you're going to use the legacy one or report an issue, however, please check out [elastic/elasticsearch-js-legacy](https://github.com/elastic/elasticsearch-js-legacy).
|
||||
|
||||
---
|
||||
|
||||
## Features
|
||||
- One-to-one mapping with REST API.
|
||||
- Generalized, pluggable architecture.
|
||||
@ -28,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
|
||||
@ -50,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
|
||||
|
||||
@ -188,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).
|
||||
|
||||
49
catalog-info.yaml
Normal file
49
catalog-info.yaml
Normal file
@ -0,0 +1,49 @@
|
||||
---
|
||||
# yaml-language-server: $schema=https://json.schemastore.org/catalog-info.json
|
||||
apiVersion: backstage.io/v1alpha1
|
||||
kind: Component
|
||||
metadata:
|
||||
name: elasticsearch-js
|
||||
spec:
|
||||
type: library
|
||||
owner: group:clients-team
|
||||
lifecycle: production
|
||||
|
||||
---
|
||||
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/e57ee3bed7a6f73077a3f55a38e76e40ec87a7cf/rre.schema.json
|
||||
apiVersion: backstage.io/v1alpha1
|
||||
kind: Resource
|
||||
metadata:
|
||||
name: elasticsearch-js-integration-tests
|
||||
description: Elasticsearch JavaScript client integration tests
|
||||
spec:
|
||||
type: buildkite-pipeline
|
||||
owner: group:clients-team
|
||||
system: buildkite
|
||||
implementation:
|
||||
apiVersion: buildkite.elastic.dev/v1
|
||||
kind: Pipeline
|
||||
metadata:
|
||||
name: Elasticsearch JavaScript client integration tests
|
||||
spec:
|
||||
repository: elastic/elasticsearch-js
|
||||
pipeline_file: .buildkite/pipeline.yml
|
||||
teams:
|
||||
clients-team:
|
||||
access_level: MANAGE_BUILD_AND_READ
|
||||
everyone:
|
||||
access_level: READ_ONLY
|
||||
provider_settings:
|
||||
build_pull_requests: false
|
||||
cancel_intermediate_builds: true
|
||||
cancel_intermediate_builds_branch_filter: '!main'
|
||||
schedules:
|
||||
main_semi_daily:
|
||||
branch: 'main'
|
||||
cronline: '*/12 * * *'
|
||||
8_8_semi_daily:
|
||||
branch: '8.8'
|
||||
cronline: '*/12 * * *'
|
||||
8_7_daily:
|
||||
branch: '8.7'
|
||||
cronline: '@daily'
|
||||
@ -95,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`.
|
||||
|
||||
@ -11,7 +11,7 @@ const { Client } = require('@elastic/elasticsearch')
|
||||
|
||||
const client = new Client({
|
||||
cloud: { id: '<cloud-id>' },
|
||||
auth: { apiKey: 'base64EncodedKey' }
|
||||
auth: { apiKey: 'base64EncodedKey' },
|
||||
maxRetries: 5,
|
||||
requestTimeout: 60000,
|
||||
sniffOnStart: true
|
||||
@ -267,4 +267,4 @@ _Default:_ `null`
|
||||
|`number` - When configured, it verifies that the compressed response size is lower than the configured number, if it's higher it will abort the request. It cannot be higher than buffer.constants.MAX_LENTGH +
|
||||
_Default:_ `null`
|
||||
|
||||
|===
|
||||
|===
|
||||
|
||||
@ -1,13 +1,208 @@
|
||||
[[changelog-client]]
|
||||
== Release notes
|
||||
|
||||
[discrete]
|
||||
=== 8.8.1
|
||||
|
||||
===== Support for Elasticsearch `v8.8.1`
|
||||
|
||||
You can find all the API changes
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.8/release-notes-8.8.1.html[here].
|
||||
|
||||
[discrete]
|
||||
==== Fixes
|
||||
|
||||
[discrete]
|
||||
===== Fix index drift bug in bulk helper https://github.com/elastic/elasticsearch-js/pull/1759[#1759]
|
||||
|
||||
Fixes a bug in the bulk helper that would cause `onDrop` to send back the wrong JSON document or error on a nonexistent document when an error occurred on a bulk HTTP request that contained a `delete` action.
|
||||
|
||||
[discrete]
|
||||
===== Fix a memory leak caused by an outdated version of Undici https://github.com/elastic/elasticsearch-js/pull/1902[#1902]
|
||||
|
||||
Undici 5.5.1, used by https://github.com/elastic/elastic-transport-js[elastic-transport-js], could create a memory leak when a high volume of requests created too many HTTP `abort` listeners. Upgrading Undici to 5.22.1 removed the memory leak.
|
||||
|
||||
[discrete]
|
||||
=== 8.8.0
|
||||
|
||||
[discrete]
|
||||
==== Features
|
||||
|
||||
[discrete]
|
||||
===== Support for Elasticsearch `v8.8.0`
|
||||
|
||||
You can find all the API changes
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.8/release-notes-8.8.0.html[here].
|
||||
|
||||
[discrete]
|
||||
==== Fixes
|
||||
|
||||
[discrete]
|
||||
===== Fix type declarations for legacy types with a body key https://github.com/elastic/elasticsearch-js/pull/1784[#1784]
|
||||
|
||||
Prior releases contained a bug where type declarations for legacy types that include a `body` key were not actually importing the type that includes the `body` key.
|
||||
|
||||
[discrete]
|
||||
=== 8.7.0
|
||||
|
||||
[discrete]
|
||||
===== Support for Elasticsearch `v8.7.0`
|
||||
|
||||
You can find all the API changes
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.7/release-notes-8.7.0.html[here].
|
||||
|
||||
[discrete]
|
||||
=== 8.6.0
|
||||
|
||||
[discrete]
|
||||
===== Bump @elastic/transport to 8.3.1+ https://github.com/elastic/elasticsearch-js/pull/1802[#1802]
|
||||
|
||||
The `@elastic/transport` dependency has been bumped to `~8.3.1` to ensure
|
||||
fixes to the `maxResponseSize` option are available in the client.
|
||||
|
||||
[discrete]
|
||||
===== Support for Elasticsearch `v8.6.0`
|
||||
|
||||
You can find all the API changes
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.6/release-notes-8.6.0.html[here].
|
||||
|
||||
[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
|
||||
|
||||
[discrete]
|
||||
==== Features
|
||||
|
||||
[discrete]
|
||||
===== Support for Elasticsearch `v8.1`
|
||||
|
||||
You can find all the API changes
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.1/release-notes-8.1.0.html[here].
|
||||
|
||||
[discrete]
|
||||
===== Export SniffingTransport https://github.com/elastic/elasticsearch-js/pull/1653[#1653]
|
||||
|
||||
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]
|
||||
|
||||
The legacy http client was not cleaning up the abort listener, which could cause a memory leak.
|
||||
|
||||
[discrete]
|
||||
===== Improve undici performances https://github.com/elastic/elastic-transport-js/pull/41[transport/#41]
|
||||
|
||||
Improve the stream body collection and keep alive timeout.
|
||||
|
||||
[discrete]
|
||||
=== 8.0.0
|
||||
|
||||
[discrete]
|
||||
==== Features
|
||||
|
||||
[discrete]
|
||||
[discrete]
|
||||
===== Support for Elasticsearch `v8.0`
|
||||
|
||||
|
||||
@ -77,8 +77,8 @@ async function run () {
|
||||
// fix the document before to try it again.
|
||||
status: action[operation].status,
|
||||
error: action[operation].error,
|
||||
operation: body[i * 2],
|
||||
document: body[i * 2 + 1]
|
||||
operation: operations[i * 2],
|
||||
document: operations[i * 2 + 1]
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
@ -103,7 +103,7 @@ async function run () {
|
||||
// get the next response if there are more quotes to fetch
|
||||
responseQueue.push(
|
||||
await client.scroll({
|
||||
scrollId: body._scroll_id,
|
||||
scroll_id: body._scroll_id,
|
||||
scroll: '30s'
|
||||
})
|
||||
)
|
||||
@ -146,7 +146,7 @@ async function * scrollSearch (params) {
|
||||
}
|
||||
|
||||
response = await client.scroll({
|
||||
scrollId: response._scroll_id,
|
||||
scroll_id: response._scroll_id,
|
||||
scroll: params.scroll
|
||||
})
|
||||
}
|
||||
|
||||
185
docs/index-custom-title-page.html
Normal file
185
docs/index-custom-title-page.html
Normal file
@ -0,0 +1,185 @@
|
||||
<style>
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.card {
|
||||
cursor: pointer;
|
||||
padding: 16px;
|
||||
text-align: left;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.card:hover {
|
||||
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
|
||||
padding: 16px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#guide a.no-text-decoration:hover {
|
||||
text-decoration: none!important;
|
||||
}
|
||||
|
||||
.icon {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
background-position: bottom;
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.ul-col-1 {
|
||||
columns: 1;
|
||||
-webkit-columns: 1;
|
||||
-moz-columns: 1;
|
||||
}
|
||||
|
||||
@media (min-width:769px) {
|
||||
.ul-col-md-2 {
|
||||
columns: 2;
|
||||
-webkit-columns: 2;
|
||||
-moz-columns: 2;
|
||||
}
|
||||
}
|
||||
|
||||
#guide h3.gtk {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.mb-4, .my-4 {
|
||||
margin-bottom: 0!important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="legalnotice"></div>
|
||||
|
||||
<div class="row my-4">
|
||||
<div class="col-md-6 col-12">
|
||||
<p></p>
|
||||
<p>
|
||||
<h2>Documentation</h2>
|
||||
</p>
|
||||
<p>
|
||||
The official Node.js client provides one-to-one mapping with Elasticsearch REST APIs.
|
||||
</p>
|
||||
<p>
|
||||
<a href="https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/installation.html">
|
||||
<button class="btn btn-primary">Get started</button>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-md-6 col-12">
|
||||
<img class="w-100" src="https://images.contentstack.io/v3/assets/bltefdd0b53724fa2ce/blt3826dd36882ab258/641c4e9d542f593a7e8ba656/js-es-lp-hero.png" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3 class="gtk">Get to know the JavaScript client</h3>
|
||||
|
||||
<div class="my-5">
|
||||
<div class="d-flex align-items-center mb-3">
|
||||
<h4 class="mt-3">
|
||||
<span class="inline-block float-left icon mr-2" style="background-image: url('https://images.contentstack.io/v3/assets/bltefdd0b53724fa2ce/bltfd59779217093221/641ae0c8db18f61d68e9c377/64x64_Color_icon-connected-circles64-color.png');"></span>
|
||||
Connecting
|
||||
</h4>
|
||||
</div>
|
||||
<ul class="ul-col-md-2 ul-col-1">
|
||||
<li>
|
||||
<a href="introduction.html">Introduction to the client</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="installation.html">Installing the client</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="client-connecting.html">Connecting to Elasticsearch</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="client-configuration.html">Configuration options</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="my-5">
|
||||
<div class="d-flex align-items-center mb-3">
|
||||
<h4 class="mt-3">
|
||||
<span class="inline-block float-left icon mr-2" style="background-image: url('https://images.contentstack.io/v3/assets/bltefdd0b53724fa2ce/bltca09fd8c807816ce/641ae17733e7f95594918557/icon-monitor-cog-64-color.png');"></span>
|
||||
Using the JS client
|
||||
</h4>
|
||||
</div>
|
||||
<ul class="ul-col-md-2 ul-col-1">
|
||||
<li>
|
||||
<a href="bulk_examples.html">Bulk indexing</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="get_examples.html">Getting documents</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="search_examples.html">Searching</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="examples.html">More examples</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="my-5">
|
||||
<div class="d-flex align-items-center mb-3">
|
||||
<h4 class="mt-3">
|
||||
<span class="inline-block float-left icon mr-2" style="background-image: url('https://images.contentstack.io/v3/assets/bltefdd0b53724fa2ce/blteacd058910f155d8/636925a6e0ff7c532db636d7/64x64_Color_icon-dev-tools-64-color.png');"></span>
|
||||
API and developer docs
|
||||
</h4>
|
||||
</div>
|
||||
<ul class="ul-col-md-2 ul-col-1">
|
||||
<li>
|
||||
<a href="api-reference.html">API reference</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="client-helpers.html">Client helpers</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="integrations.html">Integrations</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="changelog-client.html">Release notes</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<h3 class="explore">Explore by use case</h3>
|
||||
|
||||
<div class="row my-4">
|
||||
<div class="col-md-4 col-12 mb-2">
|
||||
<a class="no-text-decoration" href="https://www.elastic.co/guide/en/enterprise-search/current/start.html">
|
||||
<div class="card h-100">
|
||||
<h4 class="mt-3">
|
||||
<span class="inline-block float-left icon mr-2" style="background-image: url('https://images.contentstack.io/v3/assets/bltefdd0b53724fa2ce/blt11200907c1c033aa/634d9da119d8652169cf9b2b/enterprise-search-logo-color-32px.png');"></span>
|
||||
Search my data
|
||||
</h4>
|
||||
<p>Create search experiences for your content, wherever it lives.</p>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-4 col-12 mb-2">
|
||||
<a class="no-text-decoration" href="https://www.elastic.co/guide/en/welcome-to-elastic/current/getting-started-observability.html">
|
||||
<div class="card h-100">
|
||||
<h4 class="mt-3">
|
||||
<span class="inline-block float-left icon mr-2" style="background-image: url('https://images.contentstack.io/v3/assets/bltefdd0b53724fa2ce/bltaa08b370a00bbecc/634d9da14e565f1cdce27f7c/observability-logo-color-32px.png');"></span>
|
||||
Observe my data
|
||||
</h4>
|
||||
<p>Follow our guides to monitor logs, metrics, and traces.</p>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-4 col-12 mb-2">
|
||||
<a class="no-text-decoration" href="https://www.elastic.co/guide/en/security/current/es-overview.html">
|
||||
<div class="card h-100">
|
||||
<h4 class="mt-3">
|
||||
<span class="inline-block float-left icon mr-2" style="background-image: url('https://images.contentstack.io/v3/assets/bltefdd0b53724fa2ce/blt5e0e0ad9a13e6b8c/634d9da18473831f96bbdf1e/security-logo-color-32px.png');"></span>
|
||||
Protect my environment
|
||||
</h4>
|
||||
<p>Learn how to defend against threats across your environment.</p>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="my-4"><a href="https://www.elastic.co/guide/index.html">View all Elastic docs</a></p>
|
||||
@ -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]
|
||||
|
||||
@ -155,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]
|
||||
@ -377,9 +377,9 @@ child.search({
|
||||
To improve observability, the client offers an easy way to configure the
|
||||
`X-Opaque-Id` header. If you set the `X-Opaque-Id` in a specific request, this
|
||||
allows you to discover this identifier in the
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/8.0/logging.html#deprecation-logging[deprecation logs],
|
||||
helps you with https://www.elastic.co/guide/en/elasticsearch/reference/8.0/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/8.0/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
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -6,6 +6,11 @@ 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.
|
||||
Contribute type fixes and improvements to https://github.com/elastic/elasticsearch-specification[elasticsearch-specification github repository].
|
||||
|
||||
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
|
||||
@ -71,9 +76,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'
|
||||
----
|
||||
5
index.d.ts
vendored
5
index.d.ts
vendored
@ -18,7 +18,10 @@
|
||||
*/
|
||||
|
||||
import Client from './lib/client'
|
||||
import SniffingTransport from './lib/sniffingTransport'
|
||||
|
||||
export * from '@elastic/transport'
|
||||
export { Client }
|
||||
export * as estypes from './lib/api/types'
|
||||
export * as estypesWithBody from './lib/api/typesWithBodyKey'
|
||||
export { Client, SniffingTransport }
|
||||
export type { ClientOptions, NodeOptions } from './lib/client'
|
||||
|
||||
2
index.js
2
index.js
@ -35,9 +35,11 @@ const {
|
||||
} = require('@elastic/transport')
|
||||
|
||||
const { default: Client } = require('./lib/client')
|
||||
const { default: SniffingTransport } = require('./lib/sniffingTransport')
|
||||
|
||||
module.exports = {
|
||||
Client,
|
||||
SniffingTransport,
|
||||
Diagnostic,
|
||||
Transport,
|
||||
WeightedConnectionPool,
|
||||
|
||||
66
package.json
66
package.json
@ -1,17 +1,16 @@
|
||||
{
|
||||
"name": "@elastic/elasticsearch",
|
||||
"version": "8.0.0",
|
||||
"versionCanary": "8.0.0-canary.37",
|
||||
"version": "8.8.1",
|
||||
"versionCanary": "8.8.1-canary.2",
|
||||
"description": "The official Elasticsearch client for Node.js",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"scripts": {
|
||||
"test": "npm run build && npm run lint && tap test/{unit,acceptance}/{*,**/*}.test.ts",
|
||||
"test": "npm run build && npm run lint && tap test/unit/{*,**/*}.test.ts",
|
||||
"test:unit": "npm run build && tap test/unit/{*,**/*}.test.ts",
|
||||
"test:acceptance": "npm run build && tap test/acceptance/*.test.ts",
|
||||
"test:coverage-100": "npm run build && tap test/{unit,acceptance}/{*,**/*}.test.ts --coverage --100",
|
||||
"test:coverage-report": "npm run build && tap test/{unit,acceptance}/{*,**/*}.test.ts --coverage && nyc report --reporter=text-lcov > coverage.lcov",
|
||||
"test:coverage-ui": "npm run build && tap test/{unit,acceptance}/{*,**/*}.test.ts --coverage --coverage-report=html",
|
||||
"test:coverage-100": "npm run build && tap test/unit/{*,**/*}.test.ts --coverage --100",
|
||||
"test:coverage-report": "npm run build && tap test/unit/{*,**/*}.test.ts --coverage && nyc report --reporter=text-lcov > coverage.lcov",
|
||||
"test:coverage-ui": "npm run build && tap test/unit/{*,**/*}.test.ts --coverage --coverage-report=html",
|
||||
"test:integration": "tsc && node test/integration/index.js",
|
||||
"lint": "ts-standard src",
|
||||
"lint:fix": "ts-standard --fix src",
|
||||
@ -31,10 +30,16 @@
|
||||
"client",
|
||||
"index"
|
||||
],
|
||||
"author": {
|
||||
"name": "Tomas Della Vedova",
|
||||
"company": "Elastic BV"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Tomas Della Vedova",
|
||||
"company": "Elastic BV"
|
||||
},
|
||||
{
|
||||
"name": "Josh Mock",
|
||||
"company": "Elastic BV"
|
||||
}
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -45,43 +50,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.2",
|
||||
"tslib": "^2.4.0"
|
||||
},
|
||||
"tap": {
|
||||
"ts": true,
|
||||
|
||||
@ -22,16 +22,29 @@ const { join } = require('path')
|
||||
const minimist = require('minimist')
|
||||
const chalk = require('chalk')
|
||||
|
||||
async function release (opts) {
|
||||
assert(process.cwd() !== __dirname, 'You should run the script from the top level directory of the repository')
|
||||
assert(typeof opts.otp === 'string', 'Missing OTP')
|
||||
const packageJson = JSON.parse(await readFile(join(__dirname, '..', 'package.json'), 'utf8'))
|
||||
const helpMessage = `usage: node scripts/release-canary.js [options]
|
||||
|
||||
--otp <code> One-time password (required)
|
||||
--reset Reset the canary version to 1
|
||||
--dry-run Run everything but don't actually publish
|
||||
-h, --help Show this help message`
|
||||
|
||||
async function release (opts) {
|
||||
if (opts.help) {
|
||||
console.log(helpMessage)
|
||||
process.exit(0)
|
||||
}
|
||||
|
||||
assert(process.cwd() !== __dirname, 'You should run the script from the top level directory of the repository')
|
||||
if (!opts['dry-run']) {
|
||||
assert(typeof opts.otp === 'string', 'Missing OTP')
|
||||
}
|
||||
|
||||
const packageJson = JSON.parse(await readFile(join(__dirname, '..', 'package.json'), 'utf8'))
|
||||
const originalName = packageJson.name
|
||||
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,19 +62,11 @@ 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)
|
||||
const answer = await confirm()
|
||||
|
||||
// release on npm with provided otp
|
||||
if (answer) {
|
||||
execSync(`npm publish --otp ${opts.otp} ${opts['dry-run'] ? '--dry-run' : ''}`, { stdio: 'inherit' })
|
||||
@ -81,16 +86,10 @@ async function release (opts) {
|
||||
JSON.stringify(packageJson, null, 2) + '\n',
|
||||
'utf8'
|
||||
)
|
||||
|
||||
await writeFile(
|
||||
join(__dirname, '..', '.npmignore'),
|
||||
originalNpmIgnore,
|
||||
'utf8'
|
||||
)
|
||||
}
|
||||
|
||||
function confirm (question) {
|
||||
return new Promise((resolve, reject) => {
|
||||
function confirm () {
|
||||
return new Promise((resolve) => {
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout
|
||||
@ -126,12 +125,18 @@ release(
|
||||
boolean: [
|
||||
// Reset the canary version to '1'
|
||||
'reset',
|
||||
// run all the steps but publish
|
||||
'dry-run'
|
||||
]
|
||||
|
||||
// run all the steps but don't publish
|
||||
'dry-run',
|
||||
|
||||
// help text
|
||||
'help',
|
||||
],
|
||||
alias: { help: 'h' },
|
||||
})
|
||||
)
|
||||
.catch(err => {
|
||||
console.log(err)
|
||||
console.log('\n' + helpMessage)
|
||||
process.exit(1)
|
||||
})
|
||||
|
||||
@ -228,7 +228,7 @@ function generateSingleApi (version, spec, common) {
|
||||
|
||||
${genUrlValidation(paths, api)}
|
||||
|
||||
let { ${genQueryBlacklist(false)}, ...querystring } = params
|
||||
let { ${genQueryDenylist(false)}, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
@ -316,20 +316,20 @@ function generateSingleApi (version, spec, common) {
|
||||
}, {})
|
||||
}
|
||||
|
||||
function genQueryBlacklist (addQuotes = true) {
|
||||
function genQueryDenylist (addQuotes = true) {
|
||||
const toCamelCase = str => {
|
||||
return str[0] === '_'
|
||||
? '_' + str.slice(1).replace(/_([a-z])/g, k => k[1].toUpperCase())
|
||||
: str.replace(/_([a-z])/g, k => k[1].toUpperCase())
|
||||
}
|
||||
|
||||
const blacklist = ['method', 'body']
|
||||
const denylist = ['method', 'body']
|
||||
parts.forEach(p => {
|
||||
const camelStr = toCamelCase(p)
|
||||
if (camelStr !== p) blacklist.push(`${camelStr}`)
|
||||
blacklist.push(`${p}`)
|
||||
if (camelStr !== p) denylist.push(`${camelStr}`)
|
||||
denylist.push(`${p}`)
|
||||
})
|
||||
return addQuotes ? blacklist.map(q => `'${q}'`) : blacklist
|
||||
return addQuotes ? denylist.map(q => `'${q}'`) : denylist
|
||||
}
|
||||
|
||||
function buildPath () {
|
||||
|
||||
@ -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
|
||||
@ -87,10 +87,10 @@ export default class AsyncSearch {
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async status<TDocument = unknown> (this: That, params: T.AsyncSearchStatusRequest | TB.AsyncSearchStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.AsyncSearchStatusResponse<TDocument>>
|
||||
async status<TDocument = unknown> (this: That, params: T.AsyncSearchStatusRequest | TB.AsyncSearchStatusRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.AsyncSearchStatusResponse<TDocument>, unknown>>
|
||||
async status<TDocument = unknown> (this: That, params: T.AsyncSearchStatusRequest | TB.AsyncSearchStatusRequest, options?: TransportRequestOptions): Promise<T.AsyncSearchStatusResponse<TDocument>>
|
||||
async status<TDocument = unknown> (this: That, params: T.AsyncSearchStatusRequest | TB.AsyncSearchStatusRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
async status (this: That, params: T.AsyncSearchStatusRequest | TB.AsyncSearchStatusRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.AsyncSearchStatusResponse>
|
||||
async status (this: That, params: T.AsyncSearchStatusRequest | TB.AsyncSearchStatusRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.AsyncSearchStatusResponse, unknown>>
|
||||
async status (this: That, params: T.AsyncSearchStatusRequest | TB.AsyncSearchStatusRequest, options?: TransportRequestOptions): Promise<T.AsyncSearchStatusResponse>
|
||||
async status (this: That, params: T.AsyncSearchStatusRequest | TB.AsyncSearchStatusRequest, 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
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -279,7 +279,7 @@ export default class Cluster {
|
||||
async putComponentTemplate (this: That, params: T.ClusterPutComponentTemplateRequest | TB.ClusterPutComponentTemplateRequest, options?: TransportRequestOptions): Promise<T.ClusterPutComponentTemplateResponse>
|
||||
async putComponentTemplate (this: That, params: T.ClusterPutComponentTemplateRequest | TB.ClusterPutComponentTemplateRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
const acceptedBody: string[] = ['template', 'aliases', 'mappings', 'settings', 'version', '_meta']
|
||||
const acceptedBody: string[] = ['template', 'version', '_meta', 'allow_auto_create']
|
||||
const querystring: Record<string, any> = {}
|
||||
// @ts-expect-error
|
||||
const userBody: any = params?.body
|
||||
|
||||
@ -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
|
||||
|
||||
@ -42,7 +42,7 @@ export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequ
|
||||
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
|
||||
|
||||
@ -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
|
||||
|
||||
68
src/api/api/health_report.ts
Normal file
68
src/api/api/health_report.ts
Normal file
@ -0,0 +1,68 @@
|
||||
/*
|
||||
* 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 async function HealthReportApi (this: That, params?: T.HealthReportRequest | TB.HealthReportRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.HealthReportResponse>
|
||||
export default async function HealthReportApi (this: That, params?: T.HealthReportRequest | TB.HealthReportRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.HealthReportResponse, unknown>>
|
||||
export default async function HealthReportApi (this: That, params?: T.HealthReportRequest | TB.HealthReportRequest, options?: TransportRequestOptions): Promise<T.HealthReportResponse>
|
||||
export default async function HealthReportApi (this: That, params?: T.HealthReportRequest | TB.HealthReportRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['feature']
|
||||
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.feature != null) {
|
||||
method = 'GET'
|
||||
path = `/_health_report/${encodeURIComponent(params.feature.toString())}`
|
||||
} else {
|
||||
method = 'GET'
|
||||
path = '/_health_report'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
@ -330,6 +330,28 @@ export default class Indices {
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async deleteDataLifecycle (this: That, params: T.IndicesDeleteDataLifecycleRequest | TB.IndicesDeleteDataLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesDeleteDataLifecycleResponse>
|
||||
async deleteDataLifecycle (this: That, params: T.IndicesDeleteDataLifecycleRequest | TB.IndicesDeleteDataLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesDeleteDataLifecycleResponse, unknown>>
|
||||
async deleteDataLifecycle (this: That, params: T.IndicesDeleteDataLifecycleRequest | TB.IndicesDeleteDataLifecycleRequest, options?: TransportRequestOptions): Promise<T.IndicesDeleteDataLifecycleResponse>
|
||||
async deleteDataLifecycle (this: That, params: T.IndicesDeleteDataLifecycleRequest | TB.IndicesDeleteDataLifecycleRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
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 = 'DELETE'
|
||||
const path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_lifecycle`
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async deleteDataStream (this: That, params: T.IndicesDeleteDataStreamRequest | TB.IndicesDeleteDataStreamRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesDeleteDataStreamResponse>
|
||||
async deleteDataStream (this: That, params: T.IndicesDeleteDataStreamRequest | TB.IndicesDeleteDataStreamRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesDeleteDataStreamResponse, unknown>>
|
||||
async deleteDataStream (this: That, params: T.IndicesDeleteDataStreamRequest | TB.IndicesDeleteDataStreamRequest, options?: TransportRequestOptions): Promise<T.IndicesDeleteDataStreamResponse>
|
||||
@ -418,6 +440,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>
|
||||
@ -513,6 +562,28 @@ export default class Indices {
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async explainDataLifecycle (this: That, params: T.IndicesExplainDataLifecycleRequest | TB.IndicesExplainDataLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesExplainDataLifecycleResponse>
|
||||
async explainDataLifecycle (this: That, params: T.IndicesExplainDataLifecycleRequest | TB.IndicesExplainDataLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesExplainDataLifecycleResponse, unknown>>
|
||||
async explainDataLifecycle (this: That, params: T.IndicesExplainDataLifecycleRequest | TB.IndicesExplainDataLifecycleRequest, options?: TransportRequestOptions): Promise<T.IndicesExplainDataLifecycleResponse>
|
||||
async explainDataLifecycle (this: That, params: T.IndicesExplainDataLifecycleRequest | TB.IndicesExplainDataLifecycleRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['index']
|
||||
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 = `/${encodeURIComponent(params.index.toString())}/_lifecycle/explain`
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async fieldUsageStats (this: That, params: T.IndicesFieldUsageStatsRequest | TB.IndicesFieldUsageStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesFieldUsageStatsResponse>
|
||||
async fieldUsageStats (this: That, params: T.IndicesFieldUsageStatsRequest | TB.IndicesFieldUsageStatsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesFieldUsageStatsResponse, unknown>>
|
||||
async fieldUsageStats (this: That, params: T.IndicesFieldUsageStatsRequest | TB.IndicesFieldUsageStatsRequest, options?: TransportRequestOptions): Promise<T.IndicesFieldUsageStatsResponse>
|
||||
@ -653,6 +724,28 @@ export default class Indices {
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async getDataLifecycle (this: That, params: T.IndicesGetDataLifecycleRequest | TB.IndicesGetDataLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesGetDataLifecycleResponse>
|
||||
async getDataLifecycle (this: That, params: T.IndicesGetDataLifecycleRequest | TB.IndicesGetDataLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesGetDataLifecycleResponse, unknown>>
|
||||
async getDataLifecycle (this: That, params: T.IndicesGetDataLifecycleRequest | TB.IndicesGetDataLifecycleRequest, options?: TransportRequestOptions): Promise<T.IndicesGetDataLifecycleResponse>
|
||||
async getDataLifecycle (this: That, params: T.IndicesGetDataLifecycleRequest | TB.IndicesGetDataLifecycleRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
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 = `/_data_stream/${encodeURIComponent(params.name.toString())}/_lifecycle`
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async getDataStream (this: That, params?: T.IndicesGetDataStreamRequest | TB.IndicesGetDataStreamRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesGetDataStreamResponse>
|
||||
async getDataStream (this: That, params?: T.IndicesGetDataStreamRequest | TB.IndicesGetDataStreamRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesGetDataStreamResponse, unknown>>
|
||||
async getDataStream (this: That, params?: T.IndicesGetDataStreamRequest | TB.IndicesGetDataStreamRequest, options?: TransportRequestOptions): Promise<T.IndicesGetDataStreamResponse>
|
||||
@ -860,19 +953,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]
|
||||
}
|
||||
}
|
||||
@ -967,6 +1072,40 @@ export default class Indices {
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async putDataLifecycle (this: That, params: T.IndicesPutDataLifecycleRequest | TB.IndicesPutDataLifecycleRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesPutDataLifecycleResponse>
|
||||
async putDataLifecycle (this: That, params: T.IndicesPutDataLifecycleRequest | TB.IndicesPutDataLifecycleRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesPutDataLifecycleResponse, unknown>>
|
||||
async putDataLifecycle (this: That, params: T.IndicesPutDataLifecycleRequest | TB.IndicesPutDataLifecycleRequest, options?: TransportRequestOptions): Promise<T.IndicesPutDataLifecycleResponse>
|
||||
async putDataLifecycle (this: That, params: T.IndicesPutDataLifecycleRequest | TB.IndicesPutDataLifecycleRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
const acceptedBody: string[] = ['data_retention']
|
||||
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 = `/_data_stream/${encodeURIComponent(params.name.toString())}/_lifecycle`
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async putIndexTemplate (this: That, params: T.IndicesPutIndexTemplateRequest | TB.IndicesPutIndexTemplateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesPutIndexTemplateResponse>
|
||||
async putIndexTemplate (this: That, params: T.IndicesPutIndexTemplateRequest | TB.IndicesPutIndexTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesPutIndexTemplateResponse, unknown>>
|
||||
async putIndexTemplate (this: That, params: T.IndicesPutIndexTemplateRequest | TB.IndicesPutIndexTemplateRequest, options?: TransportRequestOptions): Promise<T.IndicesPutIndexTemplateResponse>
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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 ?? {}
|
||||
|
||||
@ -82,8 +82,15 @@ export default class Logstash {
|
||||
}
|
||||
}
|
||||
|
||||
const method = 'GET'
|
||||
const path = `/_logstash/pipeline/${encodeURIComponent(params.id.toString())}`
|
||||
let method = ''
|
||||
let path = ''
|
||||
if (params.id != null) {
|
||||
method = 'GET'
|
||||
path = `/_logstash/pipeline/${encodeURIComponent(params.id.toString())}`
|
||||
} else {
|
||||
method = 'GET'
|
||||
path = '/_logstash/pipeline'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
|
||||
@ -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>
|
||||
@ -688,7 +710,7 @@ export default class Ml {
|
||||
path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/results/categories/${encodeURIComponent(params.category_id.toString())}`
|
||||
} else {
|
||||
method = body != null ? 'POST' : 'GET'
|
||||
path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/results/categories/`
|
||||
path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/results/categories`
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
@ -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
|
||||
@ -1954,7 +2006,7 @@ export default class Ml {
|
||||
async updateDatafeed (this: That, params: T.MlUpdateDatafeedRequest | TB.MlUpdateDatafeedRequest, options?: TransportRequestOptions): Promise<T.MlUpdateDatafeedResponse>
|
||||
async updateDatafeed (this: That, params: T.MlUpdateDatafeedRequest | TB.MlUpdateDatafeedRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['datafeed_id']
|
||||
const acceptedBody: string[] = ['aggregations', 'chunking_config', 'delayed_data_check_config', 'frequency', 'indices', 'indexes', 'indices_options', 'max_empty_searches', 'query', 'query_delay', 'runtime_mappings', 'script_fields', 'scroll_size']
|
||||
const acceptedBody: string[] = ['aggregations', 'chunking_config', 'delayed_data_check_config', 'frequency', 'indices', 'indexes', 'indices_options', 'job_id', 'max_empty_searches', 'query', 'query_delay', 'runtime_mappings', 'script_fields', 'scroll_size']
|
||||
const querystring: Record<string, any> = {}
|
||||
// @ts-expect-error
|
||||
const userBody: any = params?.body
|
||||
@ -2022,7 +2074,7 @@ export default class Ml {
|
||||
async updateJob (this: That, params: T.MlUpdateJobRequest | TB.MlUpdateJobRequest, options?: TransportRequestOptions): Promise<T.MlUpdateJobResponse>
|
||||
async updateJob (this: That, params: T.MlUpdateJobRequest | TB.MlUpdateJobRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['job_id']
|
||||
const acceptedBody: string[] = ['allow_lazy_open', 'analysis_limits', 'background_persist_interval', 'custom_settings', 'categorization_filters', 'description', 'model_plot_config', 'daily_model_snapshot_retention_after_days', 'model_snapshot_retention_days', 'renormalization_window_days', 'results_retention_days', 'groups', 'detectors', 'per_partition_categorization']
|
||||
const acceptedBody: string[] = ['allow_lazy_open', 'analysis_limits', 'background_persist_interval', 'custom_settings', 'categorization_filters', 'description', 'model_plot_config', 'model_prune_window', 'daily_model_snapshot_retention_after_days', 'model_snapshot_retention_days', 'renormalization_window_days', 'results_retention_days', 'groups', 'detectors', 'per_partition_categorization']
|
||||
const querystring: Record<string, any> = {}
|
||||
// @ts-expect-error
|
||||
const userBody: any = params?.body
|
||||
@ -2085,6 +2137,28 @@ export default class Ml {
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async updateTrainedModelDeployment (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
|
||||
async updateTrainedModelDeployment (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
|
||||
async updateTrainedModelDeployment (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
|
||||
async updateTrainedModelDeployment (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['model_id']
|
||||
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 = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}/deployment/_update`
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async upgradeJobSnapshot (this: That, params: T.MlUpgradeJobSnapshotRequest | TB.MlUpgradeJobSnapshotRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.MlUpgradeJobSnapshotResponse>
|
||||
async upgradeJobSnapshot (this: That, params: T.MlUpgradeJobSnapshotRequest | TB.MlUpgradeJobSnapshotRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.MlUpgradeJobSnapshotResponse, unknown>>
|
||||
async upgradeJobSnapshot (this: That, params: T.MlUpgradeJobSnapshotRequest | TB.MlUpgradeJobSnapshotRequest, options?: TransportRequestOptions): Promise<T.MlUpgradeJobSnapshotResponse>
|
||||
|
||||
@ -37,10 +37,10 @@ import * as T from '../types'
|
||||
import * as TB from '../typesWithBodyKey'
|
||||
interface That { transport: Transport }
|
||||
|
||||
export default async function ReindexApi (this: That, params?: T.ReindexRequest | TB.ReindexRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ReindexResponse>
|
||||
export default async function ReindexApi (this: That, params?: T.ReindexRequest | TB.ReindexRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ReindexResponse, unknown>>
|
||||
export default async function ReindexApi (this: That, params?: T.ReindexRequest | TB.ReindexRequest, options?: TransportRequestOptions): Promise<T.ReindexResponse>
|
||||
export default async function ReindexApi (this: That, params?: T.ReindexRequest | TB.ReindexRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
export default async function ReindexApi (this: That, params: T.ReindexRequest | TB.ReindexRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.ReindexResponse>
|
||||
export default async function ReindexApi (this: That, params: T.ReindexRequest | TB.ReindexRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ReindexResponse, unknown>>
|
||||
export default async function ReindexApi (this: That, params: T.ReindexRequest | TB.ReindexRequest, options?: TransportRequestOptions): Promise<T.ReindexResponse>
|
||||
export default async function ReindexApi (this: That, params: T.ReindexRequest | TB.ReindexRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const acceptedBody: string[] = ['conflicts', 'dest', 'max_docs', 'script', 'size', 'source']
|
||||
const querystring: Record<string, any> = {}
|
||||
@ -53,7 +53,6 @@ export default async function ReindexApi (this: That, params?: T.ReindexRequest
|
||||
body = userBody != null ? { ...userBody } : undefined
|
||||
}
|
||||
|
||||
params = params ?? {}
|
||||
for (const key in params) {
|
||||
if (acceptedBody.includes(key)) {
|
||||
body = body ?? {}
|
||||
|
||||
@ -90,7 +90,7 @@ export default class Rollup {
|
||||
path = `/_rollup/job/${encodeURIComponent(params.id.toString())}`
|
||||
} else {
|
||||
method = 'GET'
|
||||
path = '/_rollup/job/'
|
||||
path = '/_rollup/job'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
@ -120,7 +120,7 @@ export default class Rollup {
|
||||
path = `/_rollup/data/${encodeURIComponent(params.id.toString())}`
|
||||
} else {
|
||||
method = 'GET'
|
||||
path = '/_rollup/data/'
|
||||
path = '/_rollup/data'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
@ -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>>
|
||||
|
||||
@ -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', 'rank', '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
|
||||
|
||||
269
src/api/api/search_application.ts
Normal file
269
src/api/api/search_application.ts
Normal file
@ -0,0 +1,269 @@
|
||||
/*
|
||||
* 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 SearchApplication {
|
||||
transport: Transport
|
||||
constructor (transport: Transport) {
|
||||
this.transport = transport
|
||||
}
|
||||
|
||||
async delete (this: That, params: T.SearchApplicationDeleteRequest | TB.SearchApplicationDeleteRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchApplicationDeleteResponse>
|
||||
async delete (this: That, params: T.SearchApplicationDeleteRequest | TB.SearchApplicationDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchApplicationDeleteResponse, unknown>>
|
||||
async delete (this: That, params: T.SearchApplicationDeleteRequest | TB.SearchApplicationDeleteRequest, options?: TransportRequestOptions): Promise<T.SearchApplicationDeleteResponse>
|
||||
async delete (this: That, params: T.SearchApplicationDeleteRequest | TB.SearchApplicationDeleteRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
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 = 'DELETE'
|
||||
const path = `/_application/search_application/${encodeURIComponent(params.name.toString())}`
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async deleteBehavioralAnalytics (this: That, params: T.SearchApplicationDeleteBehavioralAnalyticsRequest | TB.SearchApplicationDeleteBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchApplicationDeleteBehavioralAnalyticsResponse>
|
||||
async deleteBehavioralAnalytics (this: That, params: T.SearchApplicationDeleteBehavioralAnalyticsRequest | TB.SearchApplicationDeleteBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchApplicationDeleteBehavioralAnalyticsResponse, unknown>>
|
||||
async deleteBehavioralAnalytics (this: That, params: T.SearchApplicationDeleteBehavioralAnalyticsRequest | TB.SearchApplicationDeleteBehavioralAnalyticsRequest, options?: TransportRequestOptions): Promise<T.SearchApplicationDeleteBehavioralAnalyticsResponse>
|
||||
async deleteBehavioralAnalytics (this: That, params: T.SearchApplicationDeleteBehavioralAnalyticsRequest | TB.SearchApplicationDeleteBehavioralAnalyticsRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
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 = 'DELETE'
|
||||
const path = `/_application/analytics/${encodeURIComponent(params.name.toString())}`
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async get (this: That, params: T.SearchApplicationGetRequest | TB.SearchApplicationGetRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchApplicationGetResponse>
|
||||
async get (this: That, params: T.SearchApplicationGetRequest | TB.SearchApplicationGetRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchApplicationGetResponse, unknown>>
|
||||
async get (this: That, params: T.SearchApplicationGetRequest | TB.SearchApplicationGetRequest, options?: TransportRequestOptions): Promise<T.SearchApplicationGetResponse>
|
||||
async get (this: That, params: T.SearchApplicationGetRequest | TB.SearchApplicationGetRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
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 = `/_application/search_application/${encodeURIComponent(params.name.toString())}`
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async getBehavioralAnalytics (this: That, params?: T.SearchApplicationGetBehavioralAnalyticsRequest | TB.SearchApplicationGetBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchApplicationGetBehavioralAnalyticsResponse>
|
||||
async getBehavioralAnalytics (this: That, params?: T.SearchApplicationGetBehavioralAnalyticsRequest | TB.SearchApplicationGetBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchApplicationGetBehavioralAnalyticsResponse, unknown>>
|
||||
async getBehavioralAnalytics (this: That, params?: T.SearchApplicationGetBehavioralAnalyticsRequest | TB.SearchApplicationGetBehavioralAnalyticsRequest, options?: TransportRequestOptions): Promise<T.SearchApplicationGetBehavioralAnalyticsResponse>
|
||||
async getBehavioralAnalytics (this: That, params?: T.SearchApplicationGetBehavioralAnalyticsRequest | TB.SearchApplicationGetBehavioralAnalyticsRequest, 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 = `/_application/analytics/${encodeURIComponent(params.name.toString())}`
|
||||
} else {
|
||||
method = 'GET'
|
||||
path = '/_application/analytics'
|
||||
}
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async list (this: That, params?: T.SearchApplicationListRequest | TB.SearchApplicationListRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchApplicationListResponse>
|
||||
async list (this: That, params?: T.SearchApplicationListRequest | TB.SearchApplicationListRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchApplicationListResponse, unknown>>
|
||||
async list (this: That, params?: T.SearchApplicationListRequest | TB.SearchApplicationListRequest, options?: TransportRequestOptions): Promise<T.SearchApplicationListResponse>
|
||||
async list (this: That, params?: T.SearchApplicationListRequest | TB.SearchApplicationListRequest, 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') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
}
|
||||
}
|
||||
|
||||
const method = 'GET'
|
||||
const path = '/_application/search_application'
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async postBehavioralAnalyticsEvent (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
|
||||
async postBehavioralAnalyticsEvent (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
|
||||
async postBehavioralAnalyticsEvent (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
|
||||
async postBehavioralAnalyticsEvent (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['collection_name', 'event_type']
|
||||
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 = `/_application/analytics/${encodeURIComponent(params.collection_name.toString())}/event/${encodeURIComponent(params.event_type.toString())}`
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async put (this: That, params: T.SearchApplicationPutRequest | TB.SearchApplicationPutRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchApplicationPutResponse>
|
||||
async put (this: That, params: T.SearchApplicationPutRequest | TB.SearchApplicationPutRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchApplicationPutResponse, unknown>>
|
||||
async put (this: That, params: T.SearchApplicationPutRequest | TB.SearchApplicationPutRequest, options?: TransportRequestOptions): Promise<T.SearchApplicationPutResponse>
|
||||
async put (this: That, params: T.SearchApplicationPutRequest | TB.SearchApplicationPutRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
const acceptedBody: string[] = ['search_application']
|
||||
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 = 'PUT'
|
||||
const path = `/_application/search_application/${encodeURIComponent(params.name.toString())}`
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async putBehavioralAnalytics (this: That, params: T.SearchApplicationPutBehavioralAnalyticsRequest | TB.SearchApplicationPutBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchApplicationPutBehavioralAnalyticsResponse>
|
||||
async putBehavioralAnalytics (this: That, params: T.SearchApplicationPutBehavioralAnalyticsRequest | TB.SearchApplicationPutBehavioralAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchApplicationPutBehavioralAnalyticsResponse, unknown>>
|
||||
async putBehavioralAnalytics (this: That, params: T.SearchApplicationPutBehavioralAnalyticsRequest | TB.SearchApplicationPutBehavioralAnalyticsRequest, options?: TransportRequestOptions): Promise<T.SearchApplicationPutBehavioralAnalyticsResponse>
|
||||
async putBehavioralAnalytics (this: That, params: T.SearchApplicationPutBehavioralAnalyticsRequest | TB.SearchApplicationPutBehavioralAnalyticsRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
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 = `/_application/analytics/${encodeURIComponent(params.name.toString())}`
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async search<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.SearchApplicationSearchRequest | TB.SearchApplicationSearchRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SearchApplicationSearchResponse<TDocument, TAggregations>>
|
||||
async search<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.SearchApplicationSearchRequest | TB.SearchApplicationSearchRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SearchApplicationSearchResponse<TDocument, TAggregations>, unknown>>
|
||||
async search<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.SearchApplicationSearchRequest | TB.SearchApplicationSearchRequest, options?: TransportRequestOptions): Promise<T.SearchApplicationSearchResponse<TDocument, TAggregations>>
|
||||
async search<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.SearchApplicationSearchRequest | TB.SearchApplicationSearchRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
const acceptedBody: string[] = ['params']
|
||||
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 = `/_application/search_application/${encodeURIComponent(params.name.toString())}/_search`
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
}
|
||||
@ -42,7 +42,7 @@ export default async function SearchMvtApi (this: That, params: T.SearchMvtReque
|
||||
export default async function SearchMvtApi (this: That, params: T.SearchMvtRequest | TB.SearchMvtRequest, options?: TransportRequestOptions): Promise<T.SearchMvtResponse>
|
||||
export default async function SearchMvtApi (this: That, params: T.SearchMvtRequest | TB.SearchMvtRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['index', 'field', 'zoom', 'x', 'y']
|
||||
const acceptedBody: string[] = ['aggs', 'exact_bounds', 'extent', 'fields', 'grid_precision', 'grid_type', 'query', 'runtime_mappings', 'size', 'sort', 'track_total_hits']
|
||||
const acceptedBody: string[] = ['aggs', 'buffer', 'exact_bounds', 'extent', 'fields', 'grid_agg', 'grid_precision', 'grid_type', 'query', 'runtime_mappings', 'size', 'sort', 'track_total_hits', 'with_labels']
|
||||
const querystring: Record<string, any> = {}
|
||||
// @ts-expect-error
|
||||
const userBody: any = params?.body
|
||||
|
||||
@ -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>
|
||||
@ -910,6 +1066,72 @@ export default class Security {
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async oidcAuthenticate (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
|
||||
async oidcAuthenticate (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
|
||||
async oidcAuthenticate (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
|
||||
async oidcAuthenticate (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/oidc/authenticate'
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async oidcLogout (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
|
||||
async oidcLogout (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
|
||||
async oidcLogout (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
|
||||
async oidcLogout (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/oidc/logout'
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async oidcPrepareAuthentication (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
|
||||
async oidcPrepareAuthentication (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
|
||||
async oidcPrepareAuthentication (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
|
||||
async oidcPrepareAuthentication (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/oidc/prepare'
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async putPrivileges (this: That, params: T.SecurityPutPrivilegesRequest | TB.SecurityPutPrivilegesRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.SecurityPutPrivilegesResponse>
|
||||
async putPrivileges (this: That, params: T.SecurityPutPrivilegesRequest | TB.SecurityPutPrivilegesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.SecurityPutPrivilegesResponse, unknown>>
|
||||
async putPrivileges (this: That, params: T.SecurityPutPrivilegesRequest | TB.SecurityPutPrivilegesRequest, options?: TransportRequestOptions): Promise<T.SecurityPutPrivilegesResponse>
|
||||
@ -933,7 +1155,7 @@ export default class Security {
|
||||
}
|
||||
|
||||
const method = 'PUT'
|
||||
const path = '/_security/privilege/'
|
||||
const path = '/_security/privilege'
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
@ -1266,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)
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -290,7 +290,7 @@ export default class Snapshot {
|
||||
async restore (this: That, params: T.SnapshotRestoreRequest | TB.SnapshotRestoreRequest, options?: TransportRequestOptions): Promise<T.SnapshotRestoreResponse>
|
||||
async restore (this: That, params: T.SnapshotRestoreRequest | TB.SnapshotRestoreRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['repository', 'snapshot']
|
||||
const acceptedBody: string[] = ['ignore_index_settings', 'ignore_unavailable', 'include_aliases', 'include_global_state', 'index_settings', 'indices', 'partial', 'rename_pattern', 'rename_replacement']
|
||||
const acceptedBody: string[] = ['feature_states', 'ignore_index_settings', 'ignore_unavailable', 'include_aliases', 'include_global_state', 'index_settings', 'indices', 'partial', 'rename_pattern', 'rename_replacement']
|
||||
const querystring: Record<string, any> = {}
|
||||
// @ts-expect-error
|
||||
const userBody: any = params?.body
|
||||
|
||||
@ -193,6 +193,50 @@ export default class Transform {
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async resetTransform (this: That, params: T.TransformResetTransformRequest | TB.TransformResetTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformResetTransformResponse>
|
||||
async resetTransform (this: That, params: T.TransformResetTransformRequest | TB.TransformResetTransformRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformResetTransformResponse, unknown>>
|
||||
async resetTransform (this: That, params: T.TransformResetTransformRequest | TB.TransformResetTransformRequest, options?: TransportRequestOptions): Promise<T.TransformResetTransformResponse>
|
||||
async resetTransform (this: That, params: T.TransformResetTransformRequest | TB.TransformResetTransformRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['transform_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 = `/_transform/${encodeURIComponent(params.transform_id.toString())}/_reset`
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async scheduleNowTransform (this: That, params: T.TransformScheduleNowTransformRequest | TB.TransformScheduleNowTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformScheduleNowTransformResponse>
|
||||
async scheduleNowTransform (this: That, params: T.TransformScheduleNowTransformRequest | TB.TransformScheduleNowTransformRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformScheduleNowTransformResponse, unknown>>
|
||||
async scheduleNowTransform (this: That, params: T.TransformScheduleNowTransformRequest | TB.TransformScheduleNowTransformRequest, options?: TransportRequestOptions): Promise<T.TransformScheduleNowTransformResponse>
|
||||
async scheduleNowTransform (this: That, params: T.TransformScheduleNowTransformRequest | TB.TransformScheduleNowTransformRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['transform_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 = `/_transform/${encodeURIComponent(params.transform_id.toString())}/_schedule_now`
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async startTransform (this: That, params: T.TransformStartTransformRequest | TB.TransformStartTransformRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformStartTransformResponse>
|
||||
async startTransform (this: That, params: T.TransformStartTransformRequest | TB.TransformStartTransformRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformStartTransformResponse, unknown>>
|
||||
async startTransform (this: That, params: T.TransformStartTransformRequest | TB.TransformStartTransformRequest, options?: TransportRequestOptions): Promise<T.TransformStartTransformResponse>
|
||||
|
||||
@ -180,6 +180,28 @@ export default class Watcher {
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async getSettings (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
|
||||
async getSettings (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
|
||||
async getSettings (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
|
||||
async getSettings (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 = '/_watcher/settings'
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async getWatch (this: That, params: T.WatcherGetWatchRequest | TB.WatcherGetWatchRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.WatcherGetWatchResponse>
|
||||
async getWatch (this: That, params: T.WatcherGetWatchRequest | TB.WatcherGetWatchRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.WatcherGetWatchResponse, unknown>>
|
||||
async getWatch (this: That, params: T.WatcherGetWatchRequest | TB.WatcherGetWatchRequest, options?: TransportRequestOptions): Promise<T.WatcherGetWatchResponse>
|
||||
@ -346,4 +368,26 @@ export default class Watcher {
|
||||
const path = '/_watcher/_stop'
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
|
||||
async updateSettings (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
|
||||
async updateSettings (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
|
||||
async updateSettings (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
|
||||
async updateSettings (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 = 'PUT'
|
||||
const path = '/_watcher/settings'
|
||||
return await this.transport.request({ path, method, querystring, body }, options)
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,6 +55,7 @@ import getScriptContextApi from './api/get_script_context'
|
||||
import getScriptLanguagesApi from './api/get_script_languages'
|
||||
import getSourceApi from './api/get_source'
|
||||
import GraphApi from './api/graph'
|
||||
import healthReportApi from './api/health_report'
|
||||
import IlmApi from './api/ilm'
|
||||
import indexApi from './api/index'
|
||||
import IndicesApi from './api/indices'
|
||||
@ -82,6 +83,7 @@ import RollupApi from './api/rollup'
|
||||
import scriptsPainlessExecuteApi from './api/scripts_painless_execute'
|
||||
import scrollApi from './api/scroll'
|
||||
import searchApi from './api/search'
|
||||
import SearchApplicationApi from './api/search_application'
|
||||
import searchMvtApi from './api/search_mvt'
|
||||
import searchShardsApi from './api/search_shards'
|
||||
import searchTemplateApi from './api/search_template'
|
||||
@ -134,6 +136,7 @@ export default interface API {
|
||||
getScriptLanguages: typeof getScriptLanguagesApi
|
||||
getSource: typeof getSourceApi
|
||||
graph: GraphApi
|
||||
healthReport: typeof healthReportApi
|
||||
ilm: IlmApi
|
||||
index: typeof indexApi
|
||||
indices: IndicesApi
|
||||
@ -161,6 +164,7 @@ export default interface API {
|
||||
scriptsPainlessExecute: typeof scriptsPainlessExecuteApi
|
||||
scroll: typeof scrollApi
|
||||
search: typeof searchApi
|
||||
searchApplication: SearchApplicationApi
|
||||
searchMvt: typeof searchMvtApi
|
||||
searchShards: typeof searchShardsApi
|
||||
searchTemplate: typeof searchTemplateApi
|
||||
@ -204,6 +208,7 @@ const kMl = Symbol('Ml')
|
||||
const kMonitoring = Symbol('Monitoring')
|
||||
const kNodes = Symbol('Nodes')
|
||||
const kRollup = Symbol('Rollup')
|
||||
const kSearchApplication = Symbol('SearchApplication')
|
||||
const kSearchableSnapshots = Symbol('SearchableSnapshots')
|
||||
const kSecurity = Symbol('Security')
|
||||
const kShutdown = Symbol('Shutdown')
|
||||
@ -239,6 +244,7 @@ export default class API {
|
||||
[kMonitoring]: symbol | null
|
||||
[kNodes]: symbol | null
|
||||
[kRollup]: symbol | null
|
||||
[kSearchApplication]: symbol | null
|
||||
[kSearchableSnapshots]: symbol | null
|
||||
[kSecurity]: symbol | null
|
||||
[kShutdown]: symbol | null
|
||||
@ -273,6 +279,7 @@ export default class API {
|
||||
this[kMonitoring] = null
|
||||
this[kNodes] = null
|
||||
this[kRollup] = null
|
||||
this[kSearchApplication] = null
|
||||
this[kSearchableSnapshots] = null
|
||||
this[kSecurity] = null
|
||||
this[kShutdown] = null
|
||||
@ -306,6 +313,7 @@ API.prototype.getScript = getScriptApi
|
||||
API.prototype.getScriptContext = getScriptContextApi
|
||||
API.prototype.getScriptLanguages = getScriptLanguagesApi
|
||||
API.prototype.getSource = getSourceApi
|
||||
API.prototype.healthReport = healthReportApi
|
||||
API.prototype.index = indexApi
|
||||
API.prototype.info = infoApi
|
||||
API.prototype.knnSearch = knnSearchApi
|
||||
@ -396,6 +404,9 @@ Object.defineProperties(API.prototype, {
|
||||
rollup: {
|
||||
get () { return this[kRollup] === null ? (this[kRollup] = new RollupApi(this.transport)) : this[kRollup] }
|
||||
},
|
||||
searchApplication: {
|
||||
get () { return this[kSearchApplication] === null ? (this[kSearchApplication] = new SearchApplicationApi(this.transport)) : this[kSearchApplication] }
|
||||
},
|
||||
searchableSnapshots: {
|
||||
get () { return this[kSearchableSnapshots] === null ? (this[kSearchableSnapshots] = new SearchableSnapshotsApi(this.transport)) : this[kSearchableSnapshots] }
|
||||
},
|
||||
|
||||
@ -1,518 +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>
|
||||
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: <TDocument = unknown, TContext = unknown>(params: T.AsyncSearchStatusRequest| TB.AsyncSearchStatusRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.AsyncSearchStatusResponse<TDocument>, 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.MigrationGetFeatureUpgradeStatusRequest| TB.MigrationGetFeatureUpgradeStatusRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MigrationGetFeatureUpgradeStatusResponse, TContext>>
|
||||
postFeatureUpgrade: <TContext = unknown>(params?: T.MigrationPostFeatureUpgradeRequest| TB.MigrationPostFeatureUpgradeRequest, options?: TransportRequestOptions) => Promise<TransportResult<T.MigrationPostFeatureUpgradeResponse, TContext>>
|
||||
}
|
||||
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>>
|
||||
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>>
|
||||
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 }
|
||||
4307
src/api/types.ts
4307
src/api/types.ts
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -189,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}`)
|
||||
}
|
||||
|
||||
|
||||
@ -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'
|
||||
@ -37,7 +38,7 @@ export interface ScrollSearchOptions extends TransportRequestOptions {
|
||||
wait?: number
|
||||
}
|
||||
|
||||
export interface ScrollSearchResponse<TDocument> extends TransportResult<T.SearchResponse<TDocument>, unknown> {
|
||||
export interface ScrollSearchResponse<TDocument, TAggregations> extends TransportResult<T.SearchResponse<TDocument, TAggregations>, unknown> {
|
||||
clear: () => Promise<void>
|
||||
documents: TDocument[]
|
||||
}
|
||||
@ -170,7 +171,7 @@ export default class Helpers {
|
||||
* @param {object} options - The client optional configuration for this request.
|
||||
* @return {iterator} the async iterator
|
||||
*/
|
||||
async * scrollSearch<TDocument = unknown> (params: T.SearchRequest, options: ScrollSearchOptions = {}): AsyncIterable<ScrollSearchResponse<TDocument>> {
|
||||
async * scrollSearch<TDocument = unknown, TAggregations = unknown> (params: T.SearchRequest, options: ScrollSearchOptions = {}): AsyncIterable<ScrollSearchResponse<TDocument, TAggregations>> {
|
||||
options.meta = true
|
||||
if (this[kMetaHeader] !== null) {
|
||||
options.headers = options.headers ?? {}
|
||||
@ -186,9 +187,9 @@ export default class Helpers {
|
||||
params.scroll = params.scroll ?? '1m'
|
||||
appendFilterPath('_scroll_id', params, false)
|
||||
|
||||
let response: TransportResult<T.SearchResponse<TDocument>, unknown> | undefined
|
||||
let response: TransportResult<T.SearchResponse<TDocument, TAggregations>, unknown> | undefined
|
||||
for (let i = 0; i <= maxRetries; i++) {
|
||||
response = await this[kClient].search<TDocument>(params, options as TransportRequestOptionsWithMeta)
|
||||
response = await this[kClient].search<TDocument, TAggregations>(params, options as TransportRequestOptionsWithMeta)
|
||||
if (response.statusCode !== 429) break
|
||||
await sleep(wait)
|
||||
}
|
||||
@ -213,7 +214,7 @@ export default class Helpers {
|
||||
scroll_id = response.body._scroll_id
|
||||
// @ts-expect-error
|
||||
response.clear = clear
|
||||
addDocumentsGetter<TDocument>(response)
|
||||
addDocumentsGetter<TDocument, TAggregations>(response)
|
||||
|
||||
// @ts-expect-error
|
||||
yield response
|
||||
@ -228,7 +229,7 @@ export default class Helpers {
|
||||
rest_total_hits_as_int: params.rest_total_hits_as_int,
|
||||
scroll_id
|
||||
}, options as TransportRequestOptionsWithMeta)
|
||||
response = r as TransportResult<T.ScrollResponse<TDocument>, unknown>
|
||||
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
|
||||
await sleep(wait)
|
||||
@ -355,21 +356,24 @@ export default class Helpers {
|
||||
let loadedOperations = 0
|
||||
timeoutRef = setTimeout(onFlushTimeout, flushInterval) // eslint-disable-line
|
||||
|
||||
for await (const operation of operationsStream) {
|
||||
timeoutRef.refresh()
|
||||
loadedOperations += 1
|
||||
msearchBody.push(operation[0], operation[1])
|
||||
callbacks.push(operation[2])
|
||||
if (loadedOperations >= operations) {
|
||||
const send = await semaphore()
|
||||
send(msearchBody.slice(), callbacks.slice())
|
||||
msearchBody.length = 0
|
||||
callbacks.length = 0
|
||||
loadedOperations = 0
|
||||
try {
|
||||
for await (const operation of operationsStream) {
|
||||
timeoutRef.refresh()
|
||||
loadedOperations += 1
|
||||
msearchBody.push(operation[0], operation[1])
|
||||
callbacks.push(operation[2])
|
||||
if (loadedOperations >= operations) {
|
||||
const send = await semaphore()
|
||||
send(msearchBody.slice(), callbacks.slice())
|
||||
msearchBody.length = 0
|
||||
callbacks.length = 0
|
||||
loadedOperations = 0
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
clearTimeout(timeoutRef)
|
||||
}
|
||||
|
||||
clearTimeout(timeoutRef)
|
||||
// In some cases the previos http call does not have finished,
|
||||
// or we didn't reach the flush bytes threshold, so we force one last operation.
|
||||
if (loadedOperations > 0) {
|
||||
@ -520,7 +524,7 @@ export default class Helpers {
|
||||
* @param {object} reqOptions - The client optional configuration for this request.
|
||||
* @return {object} The possible operations to run with the datasource.
|
||||
*/
|
||||
bulk<TDocument = unknown> (options: BulkHelperOptions, reqOptions: TransportRequestOptions = {}): BulkHelper<TDocument> {
|
||||
bulk<TDocument = unknown> (options: BulkHelperOptions<TDocument>, reqOptions: TransportRequestOptions = {}): BulkHelper<TDocument> {
|
||||
const client = this[kClient]
|
||||
const { serializer } = client
|
||||
if (this[kMetaHeader] !== null) {
|
||||
@ -790,6 +794,7 @@ export default class Helpers {
|
||||
status: 429,
|
||||
error: null,
|
||||
operation: serializer.deserialize(bulkBody[i]),
|
||||
// @ts-expect-error
|
||||
document: operation !== 'delete'
|
||||
? serializer.deserialize(bulkBody[i + 1])
|
||||
/* istanbul ignore next */
|
||||
@ -818,13 +823,13 @@ export default class Helpers {
|
||||
}
|
||||
const retry = []
|
||||
const { items } = result
|
||||
let indexSlice = 0
|
||||
for (let i = 0, len = items.length; i < len; i++) {
|
||||
const action = items[i]
|
||||
const operation = Object.keys(action)[0]
|
||||
// @ts-expect-error
|
||||
const responseItem = action[operation as keyof T.BulkResponseItemContainer]
|
||||
assert(responseItem !== undefined, 'The responseItem is undefined, please file a bug report')
|
||||
const indexSlice = operation !== 'delete' ? i * 2 : i
|
||||
|
||||
if (responseItem.status >= 400) {
|
||||
// 429 is the only staus code where we might want to retry
|
||||
@ -841,6 +846,7 @@ export default class Helpers {
|
||||
status: responseItem.status,
|
||||
error: responseItem.error ?? null,
|
||||
operation: serializer.deserialize(bulkBody[indexSlice]),
|
||||
// @ts-expect-error
|
||||
document: operation !== 'delete'
|
||||
? serializer.deserialize(bulkBody[indexSlice + 1])
|
||||
: null,
|
||||
@ -851,6 +857,7 @@ export default class Helpers {
|
||||
} else {
|
||||
stats.successful += 1
|
||||
}
|
||||
operation === 'delete' ? indexSlice += 1 : indexSlice += 2
|
||||
}
|
||||
callback(null, retry)
|
||||
})
|
||||
@ -864,7 +871,7 @@ export default class Helpers {
|
||||
|
||||
// Using a getter will improve the overall performances of the code,
|
||||
// as we will reed the documents only if needed.
|
||||
function addDocumentsGetter<TDocument> (result: TransportResult<T.SearchResponse<TDocument>, unknown>): void {
|
||||
function addDocumentsGetter<TDocument, TAggregations> (result: TransportResult<T.SearchResponse<TDocument, TAggregations>, unknown>): void {
|
||||
Object.defineProperty(result, 'documents', {
|
||||
get () {
|
||||
if (this.body.hits?.hits != null) {
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
Yes.
|
||||
|
||||
## Background
|
||||
Elasticsearch offers its entire API via HTTP REST endpoints. You can find the whole API specification for every version [here](https://github.com/elastic/elasticsearch/tree/master/rest-api-spec/src/main/resources/rest-api-spec/api).<br/>
|
||||
To support different languages at the same time, the Elasticsearch team decided to provide a [YAML specification](https://github.com/elastic/elasticsearch/tree/master/rest-api-spec/src/main/resources/rest-api-spec/test) to test every endpoint, body, headers, warning, error and so on.<br/>
|
||||
Elasticsearch offers its entire API via HTTP REST endpoints. You can find the whole API specification for every version [here](https://github.com/elastic/elasticsearch/tree/main/rest-api-spec/src/main/resources/rest-api-spec/api).<br/>
|
||||
To support different languages at the same time, the Elasticsearch team decided to provide a [YAML specification](https://github.com/elastic/elasticsearch/tree/main/rest-api-spec/src/main/resources/rest-api-spec/test) to test every endpoint, body, headers, warning, error and so on.<br/>
|
||||
This testing suite uses that specification to generate the test for the specified version of Elasticsearch on the fly.
|
||||
|
||||
## Run
|
||||
@ -20,20 +20,45 @@ Once the Elasticsearch repository has been cloned, the testing suite will connec
|
||||
|
||||
The specification does not allow the test to be run in parallel, so it might take a while to run the entire testing suite; on my machine, `MacBookPro15,2 core i7 2.7GHz 16GB of RAM` it takes around four minutes.
|
||||
|
||||
### Running locally
|
||||
|
||||
If you want to run the integration tests on your development machine, you must have an Elasticsearch instance running first.
|
||||
A local instance can be spun up in a Docker container by running the [`.ci/run-elasticsearch.sh`](/.ci/run-elasticsearch.sh) script.
|
||||
This is the same script CI jobs use to run Elasticsearch for integration tests, so your results should be relatively consistent.
|
||||
|
||||
To simplify the process of starting a container, testing, and cleaning up the container, you can run the `make integration` target:
|
||||
|
||||
```sh
|
||||
# set some parameters
|
||||
export STACK_VERSION=8.7.0
|
||||
export TEST_SUITE=free # can be `free` or `platinum`
|
||||
make integration
|
||||
```
|
||||
|
||||
If Elasticsearch doesn't come up, run `make integration-cleanup` and then `DETACH=false .ci/run-elasticsearch.sh` manually to read the startup logs.
|
||||
|
||||
If you get an error about `vm.max_map_count` being too low, run `sudo sysctl -w vm.max_map_count=262144` to update the setting until the next reboot, or `sudo sysctl -w vm.max_map_count=262144; echo 'vm.max_map_count=262144' | sudo tee -a /etc/sysctl.conf` to update the setting permanently.
|
||||
|
||||
### Exit on the first failure
|
||||
Bu default the suite will run all the test, even if one assertion has failed. If you want to stop the test at the first failure, use the bailout option:
|
||||
|
||||
By default the suite will run all the tests, even if one assertion has failed. If you want to stop the test at the first failure, use the bailout option:
|
||||
|
||||
```sh
|
||||
npm run test:integration -- --bail
|
||||
```
|
||||
|
||||
### Calculate the code coverage
|
||||
|
||||
If you want to calculate the code coverage just run the testing suite with the following parameters, once the test ends, it will open a browser window with the results.
|
||||
|
||||
```sh
|
||||
npm run test:integration -- --cov --coverage-report=html
|
||||
```
|
||||
|
||||
## How does this thing work?
|
||||
|
||||
At first sight, it might seem complicated, but once you understand what the moving parts are, it's quite easy.
|
||||
|
||||
1. Connects to the given Elasticsearch instance
|
||||
1. Gets the ES version and build hash
|
||||
1. Checkout to the given hash (and clone the repository if it is not present)
|
||||
@ -46,7 +71,4 @@ At first sight, it might seem complicated, but once you understand what the movi
|
||||
|
||||
Inside the `index.js` file, you will find the connection, cloning, reading and parsing part of the test, while inside the `test-runner.js` file you will find the function to handle the assertions. Inside `test-runner.js`, we use a [queue](https://github.com/delvedor/workq) to be sure that everything is run in the correct order.
|
||||
|
||||
Checkout the [rest-api-spec readme](https://github.com/elastic/elasticsearch/blob/master/rest-api-spec/src/main/resources/rest-api-spec/test/README.asciidoc) if you want to know more about how the assertions work.
|
||||
|
||||
#### Why are we running the test with the `--harmony` flag?
|
||||
Because on Node v6 the regex lookbehinds are not supported.
|
||||
Check out the [rest-api-spec readme](https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/test/README.asciidoc) if you want to know more about how the assertions work.
|
||||
|
||||
@ -27,9 +27,9 @@ process.on('unhandledRejection', function (err) {
|
||||
const { writeFileSync, readFileSync, readdirSync, statSync } = require('fs')
|
||||
const { join, sep } = require('path')
|
||||
const yaml = require('js-yaml')
|
||||
const minimist = require('minimist')
|
||||
const ms = require('ms')
|
||||
const { Client } = require('../../index')
|
||||
const { kProductCheck } = require('@elastic/transport/lib/symbols')
|
||||
const build = require('./test-runner')
|
||||
const { sleep } = require('./helper')
|
||||
const createJunitReporter = require('./reporter')
|
||||
@ -42,8 +42,21 @@ const MAX_API_TIME = 1000 * 90
|
||||
const MAX_FILE_TIME = 1000 * 30
|
||||
const MAX_TEST_TIME = 1000 * 3
|
||||
|
||||
const options = minimist(process.argv.slice(2), {
|
||||
boolean: ['bail'],
|
||||
string: ['suite', 'test'],
|
||||
})
|
||||
|
||||
const freeSkips = {
|
||||
// the v8 client never sends the scroll_id in querystgring,
|
||||
// not supported yet
|
||||
'/free/cluster.desired_nodes/10_basic.yml': ['*'],
|
||||
|
||||
// Cannot find methods on `Internal` object
|
||||
'/free/cluster.desired_balance/10_basic.yml': ['*'],
|
||||
'/free/cluster.desired_nodes/20_dry_run.yml': ['*'],
|
||||
'/free/cluster.prevalidate_node_removal/10_basic.yml': ['*'],
|
||||
|
||||
// the v8 client never sends the scroll_id in querystring,
|
||||
// the way the test is structured causes a security exception
|
||||
'free/scroll/10_basic.yml': ['Body params override query string'],
|
||||
'free/scroll/11_clear.yml': [
|
||||
@ -52,73 +65,74 @@ const freeSkips = {
|
||||
],
|
||||
'free/cat.allocation/10_basic.yml': ['*'],
|
||||
'free/cat.snapshots/10_basic.yml': ['Test cat snapshots output'],
|
||||
// TODO: remove this once 'arbitrary_key' is implemented
|
||||
// https://github.com/elastic/elasticsearch/pull/41492
|
||||
'indices.split/30_copy_settings.yml': ['*'],
|
||||
|
||||
'indices.stats/50_disk_usage.yml': ['Disk usage stats'],
|
||||
'indices.stats/60_field_usage.yml': ['Field usage stats'],
|
||||
|
||||
// skipping because we are booting ES with `discovery.type=single-node`
|
||||
// and this test will fail because of this configuration
|
||||
'nodes.stats/30_discovery.yml': ['*'],
|
||||
|
||||
// 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']
|
||||
'free/tsdb/90_unsupported_operations.yml': ['noop update'],
|
||||
}
|
||||
const platinumBlackList = {
|
||||
|
||||
const platinumDenyList = {
|
||||
'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.
|
||||
'analytics/top_metrics.yml': [
|
||||
'sort by keyword field fails',
|
||||
'sort by string script fails'
|
||||
],
|
||||
'cat.aliases/10_basic.yml': ['Empty cluster'],
|
||||
'index/10_with_id.yml': ['Index with ID'],
|
||||
'indices.get_alias/10_basic.yml': ['Get alias against closed indices'],
|
||||
'indices.get_alias/20_empty.yml': ['Check empty aliases when getting all aliases via /_alias'],
|
||||
'text_structure/find_structure.yml': ['*'],
|
||||
// https://github.com/elastic/elasticsearch/pull/39400
|
||||
'ml/jobs_crud.yml': ['Test put job with id that is already taken'],
|
||||
|
||||
// object keys must me strings, and `0.0.toString()` is `0`
|
||||
'ml/evaluate_data_frame.yml': [
|
||||
'Test binary_soft_classifition precision',
|
||||
'Test binary_soft_classifition recall',
|
||||
'Test binary_soft_classifition confusion_matrix'
|
||||
],
|
||||
// it gets random failures on CI, must investigate
|
||||
'ml/set_upgrade_mode.yml': [
|
||||
'Attempt to open job when upgrade_mode is enabled',
|
||||
'Setting upgrade mode to disabled from enabled'
|
||||
],
|
||||
|
||||
// The cleanup fails with a index not found when retrieving the jobs
|
||||
'ml/get_datafeed_stats.yml': ['Test get datafeed stats when total_search_time_ms mapping is missing'],
|
||||
'ml/bucket_correlation_agg.yml': ['Test correlation bucket agg simple'],
|
||||
|
||||
// start should be a string
|
||||
'ml/jobs_get_result_overall_buckets.yml': ['Test overall buckets given epoch start and end params'],
|
||||
|
||||
// this can't happen with the client
|
||||
'ml/start_data_frame_analytics.yml': ['Test start with inconsistent body/param ids'],
|
||||
'ml/stop_data_frame_analytics.yml': ['Test stop with inconsistent body/param ids'],
|
||||
'ml/preview_datafeed.yml': ['*'],
|
||||
|
||||
// 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': ['*'],
|
||||
'license/20_put_license.yml': ['*'],
|
||||
'snapshot/10_basic.yml': ['*'],
|
||||
'snapshot/20_operator_privileges_disabled.yml': ['*'],
|
||||
|
||||
// the body is correct, but the regex is failing
|
||||
'sql/sql.yml': ['Getting textual representation'],
|
||||
'searchable_snapshots/10_usage.yml': ['*'],
|
||||
'service_accounts/10_basic.yml': ['*'],
|
||||
|
||||
// we are setting two certificates in the docker config
|
||||
'ssl/10_basic.yml': ['*'],
|
||||
'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.
|
||||
@ -136,16 +150,20 @@ const platinumBlackList = {
|
||||
'transforms_stats.yml': ['*'],
|
||||
'transforms_stats_continuous.yml': ['*'],
|
||||
'transforms_update.yml': ['*'],
|
||||
|
||||
// js does not support ulongs
|
||||
'unsigned_long/10_basic.yml': ['*'],
|
||||
'unsigned_long/20_null_value.yml': ['*'],
|
||||
'unsigned_long/30_multi_fields.yml': ['*'],
|
||||
'unsigned_long/40_different_numeric.yml': ['*'],
|
||||
'unsigned_long/50_script_values.yml': ['*'],
|
||||
|
||||
// the v8 client flattens the body into the parent object
|
||||
'platinum/users/10_basic.yml': ['Test put user with different username in body'],
|
||||
|
||||
// docker issue?
|
||||
'watcher/execute_watch/60_http_input.yml': ['*'],
|
||||
|
||||
// the checks are correct, but for some reason the test is failing on js side
|
||||
// I bet is because the backslashes in the rg
|
||||
'watcher/execute_watch/70_invalid.yml': ['*'],
|
||||
@ -159,8 +177,9 @@ const platinumBlackList = {
|
||||
'platinum/ml/delete_job_force.yml': ['Test force delete an open job that is referred by a started datafeed'],
|
||||
'platinum/ml/evaluate_data_frame.yml': ['*'],
|
||||
'platinum/ml/get_datafeed_stats.yml': ['*'],
|
||||
|
||||
// start should be a string in the yaml test
|
||||
'platinum/ml/start_stop_datafeed.yml': ['*']
|
||||
'platinum/ml/start_stop_datafeed.yml': ['*'],
|
||||
}
|
||||
|
||||
function runner (opts = {}) {
|
||||
@ -172,8 +191,6 @@ function runner (opts = {}) {
|
||||
}
|
||||
}
|
||||
const client = new Client(options)
|
||||
// TODO: remove the following line once https://github.com/elastic/elasticsearch/issues/82358 is fixed
|
||||
client.transport[kProductCheck] = null
|
||||
log('Loading yaml suite')
|
||||
start({ client, isXPack: opts.isXPack })
|
||||
.catch(err => {
|
||||
@ -278,13 +295,21 @@ async function start ({ client, isXPack }) {
|
||||
}
|
||||
|
||||
const cleanPath = file.slice(file.lastIndexOf(apiName))
|
||||
|
||||
// skip if --suite CLI arg doesn't match
|
||||
if (options.suite && !cleanPath.endsWith(options.suite)) continue
|
||||
|
||||
log(' ' + cleanPath)
|
||||
const junitTestSuite = junitTestSuites.testsuite(apiName.slice(1) + ' - ' + cleanPath)
|
||||
|
||||
for (const test of tests) {
|
||||
const testTime = now()
|
||||
const name = Object.keys(test)[0]
|
||||
|
||||
// skip setups, teardowns and anything that doesn't match --test flag when present
|
||||
if (name === 'setup' || name === 'teardown') continue
|
||||
if (options.test && !name.endsWith(options.test)) continue
|
||||
|
||||
const junitTestCase = junitTestSuite.testcase(name)
|
||||
|
||||
stats.total += 1
|
||||
@ -305,7 +330,12 @@ async function start ({ client, isXPack }) {
|
||||
junitTestSuites.end()
|
||||
generateJunitXmlReport(junit, isXPack ? 'platinum' : 'free')
|
||||
console.error(err)
|
||||
process.exit(1)
|
||||
|
||||
if (options.bail) {
|
||||
process.exit(1)
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
}
|
||||
const totalTestTime = now() - testTime
|
||||
junitTestCase.end()
|
||||
@ -369,7 +399,8 @@ function generateJunitXmlReport (junit, suite) {
|
||||
}
|
||||
|
||||
if (require.main === module) {
|
||||
const node = process.env.TEST_ES_SERVER || 'http://elastic:changeme@localhost:9200'
|
||||
const scheme = process.env.TEST_SUITE === 'platinum' ? 'https' : 'http'
|
||||
const node = process.env.TEST_ES_SERVER || `${scheme}://elastic:changeme@localhost:9200`
|
||||
const opts = {
|
||||
node,
|
||||
isXPack: process.env.TEST_SUITE !== 'free'
|
||||
@ -378,26 +409,28 @@ if (require.main === module) {
|
||||
}
|
||||
|
||||
const shouldSkip = (isXPack, file, name) => {
|
||||
if (options.suite || options.test) return false
|
||||
|
||||
let list = Object.keys(freeSkips)
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
const freeTest = freeSkips[list[i]]
|
||||
for (let j = 0; j < freeTest.length; j++) {
|
||||
if (file.endsWith(list[i]) && (name === freeTest[j] || freeTest[j] === '*')) {
|
||||
const testName = file.slice(file.indexOf(`${sep}elasticsearch${sep}`)) + ' / ' + name
|
||||
log(`Skipping test ${testName} because is blacklisted in the free test`)
|
||||
log(`Skipping test ${testName} because it is denylisted in the free test suite`)
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (file.includes('x-pack') || isXPack) {
|
||||
list = Object.keys(platinumBlackList)
|
||||
list = Object.keys(platinumDenyList)
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
const platTest = platinumBlackList[list[i]]
|
||||
const platTest = platinumDenyList[list[i]]
|
||||
for (let j = 0; j < platTest.length; j++) {
|
||||
if (file.endsWith(list[i]) && (name === platTest[j] || platTest[j] === '*')) {
|
||||
const testName = file.slice(file.indexOf(`${sep}elasticsearch${sep}`)) + ' / ' + name
|
||||
log(`Skipping test ${testName} because is blacklisted in the platinum test`)
|
||||
log(`Skipping test ${testName} because it is denylisted in the platinum test suite`)
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
@ -85,7 +85,11 @@ function build (opts = {}) {
|
||||
)
|
||||
|
||||
// remove 'x_pack_rest_user', used in some xpack test
|
||||
await client.security.deleteUser({ username: 'x_pack_rest_user' }, { ignore: [404] })
|
||||
try {
|
||||
await client.security.deleteUser({ username: 'x_pack_rest_user' }, { ignore: [404] })
|
||||
} catch {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
const searchableSnapshotIndices = await client.cluster.state({
|
||||
metric: 'metadata',
|
||||
@ -137,7 +141,11 @@ function build (opts = {}) {
|
||||
const body = await client.cluster.getComponentTemplate()
|
||||
const components = body.component_templates.filter(c => !isXPackTemplate(c.name)).map(c => c.name)
|
||||
if (components.length > 0) {
|
||||
await client.cluster.deleteComponentTemplate({ name: components.join(',') }, { ignore: [404] })
|
||||
try {
|
||||
await client.cluster.deleteComponentTemplate({ name: components.join(',') }, { ignore: [404] })
|
||||
} catch {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
|
||||
// Remove any cluster setting
|
||||
@ -157,9 +165,25 @@ function build (opts = {}) {
|
||||
if (isXPack) {
|
||||
// delete ilm policies
|
||||
const preserveIlmPolicies = [
|
||||
'ilm-history-ilm-policy', 'slm-history-ilm-policy',
|
||||
'watch-history-ilm-policy', 'ml-size-based-ilm-policy',
|
||||
'logs', 'metrics'
|
||||
"ilm-history-ilm-policy",
|
||||
"slm-history-ilm-policy",
|
||||
"watch-history-ilm-policy",
|
||||
"watch-history-ilm-policy-16",
|
||||
"ml-size-based-ilm-policy",
|
||||
"logs",
|
||||
"metrics",
|
||||
"synthetics",
|
||||
"7-days-default",
|
||||
"30-days-default",
|
||||
"90-days-default",
|
||||
"180-days-default",
|
||||
"365-days-default",
|
||||
".fleet-actions-results-ilm-policy",
|
||||
".fleet-file-data-ilm-policy",
|
||||
".fleet-files-ilm-policy",
|
||||
".deprecation-indexing-ilm-policy",
|
||||
".monitoring-8-ilm-policy",
|
||||
"behavioral_analytics-events-default_policy",
|
||||
]
|
||||
const policies = await client.ilm.getLifecycle()
|
||||
for (const policy in policies) {
|
||||
@ -188,6 +212,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()
|
||||
@ -218,7 +281,7 @@ function build (opts = {}) {
|
||||
* - cleanup
|
||||
* @param {object} setup (null if not needed)
|
||||
* @param {object} test
|
||||
* @oaram {object} teardown (null if not needed)
|
||||
* @param {object} teardown (null if not needed)
|
||||
* @returns {Promise}
|
||||
*/
|
||||
async function run (setup, test, teardown, stats, junit) {
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
import { test } from 'tap'
|
||||
import { connection } from '../utils'
|
||||
import { Client } from '../..'
|
||||
import * as T from '../../lib/api/types'
|
||||
|
||||
test('Api without body key and top level body', async t => {
|
||||
t.plan(2)
|
||||
@ -195,3 +196,107 @@ test('Using the body key with a string value', async t => {
|
||||
t.fail(err)
|
||||
}
|
||||
})
|
||||
|
||||
test('With generic document', async t => {
|
||||
t.plan(1)
|
||||
|
||||
interface Doc {
|
||||
foo: string
|
||||
}
|
||||
|
||||
const Connection = connection.buildMockConnection({
|
||||
onRequest (opts) {
|
||||
return {
|
||||
statusCode: 200,
|
||||
body: {
|
||||
took: 42,
|
||||
hits: {
|
||||
hits: [{
|
||||
_source: { foo: 'bar' }
|
||||
}]
|
||||
},
|
||||
aggregations: {
|
||||
unique: {
|
||||
buckets: [{ key: 'bar' }]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const client = new Client({
|
||||
node: 'http://localhost:9200',
|
||||
Connection
|
||||
})
|
||||
|
||||
const response = await client.search<Doc>({
|
||||
index: 'test',
|
||||
allow_no_indices: true,
|
||||
query: { match_all: {} },
|
||||
aggregations: {
|
||||
unique: {
|
||||
terms: {
|
||||
field: 'foo'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
t.equal(response.hits.hits[0]._source?.foo, 'bar')
|
||||
})
|
||||
|
||||
test('With generic document and aggregation', async t => {
|
||||
t.plan(2)
|
||||
|
||||
interface Doc {
|
||||
foo: string
|
||||
}
|
||||
|
||||
interface Aggregations {
|
||||
unique: T.AggregationsTermsAggregateBase<{ key: string }>
|
||||
}
|
||||
|
||||
const Connection = connection.buildMockConnection({
|
||||
onRequest (opts) {
|
||||
return {
|
||||
statusCode: 200,
|
||||
body: {
|
||||
took: 42,
|
||||
hits: {
|
||||
hits: [{
|
||||
_source: { foo: 'bar' }
|
||||
}]
|
||||
},
|
||||
aggregations: {
|
||||
unique: {
|
||||
buckets: [{ key: 'bar' }]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const client = new Client({
|
||||
node: 'http://localhost:9200',
|
||||
Connection
|
||||
})
|
||||
|
||||
const response = await client.search<Doc, Aggregations>({
|
||||
index: 'test',
|
||||
allow_no_indices: true,
|
||||
query: { match_all: {} },
|
||||
aggregations: {
|
||||
unique: {
|
||||
terms: {
|
||||
field: 'foo'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
t.equal(response.hits.hits[0]._source?.foo, 'bar')
|
||||
t.ok(Array.isArray(response.aggregations?.unique.buckets))
|
||||
})
|
||||
|
||||
|
||||
@ -42,6 +42,11 @@ const dataset = [
|
||||
{ user: 'tyrion', age: 39 }
|
||||
]
|
||||
|
||||
interface Document {
|
||||
user: string
|
||||
age: number
|
||||
}
|
||||
|
||||
test('bulk index', t => {
|
||||
t.test('datasource as array', t => {
|
||||
t.test('Should perform a bulk request', async t => {
|
||||
@ -65,11 +70,12 @@ test('bulk index', t => {
|
||||
node: 'http://localhost:9200',
|
||||
Connection: MockConnection
|
||||
})
|
||||
const result = await client.helpers.bulk({
|
||||
const result = await client.helpers.bulk<Document>({
|
||||
datasource: dataset.slice(),
|
||||
flushBytes: 1,
|
||||
concurrency: 1,
|
||||
onDocument (doc) {
|
||||
t.type(doc.user, 'string') // testing that doc is type of Document
|
||||
return {
|
||||
index: { _index: 'test' }
|
||||
}
|
||||
@ -1064,6 +1070,7 @@ test('bulk delete', t => {
|
||||
const [{ port }, server] = await buildServer(handler)
|
||||
const client = new Client({ node: `http://localhost:${port}` })
|
||||
let id = 0
|
||||
|
||||
const result = await client.helpers.bulk({
|
||||
datasource: dataset.slice(),
|
||||
flushBytes: 1,
|
||||
@ -1100,6 +1107,70 @@ test('bulk delete', t => {
|
||||
server.stop()
|
||||
})
|
||||
|
||||
t.test('Should call onDrop on the correct document when doing a mix of operations that includes deletes', async t => {
|
||||
// checks to ensure onDrop doesn't provide the wrong document when some operations are deletes
|
||||
// see https://github.com/elastic/elasticsearch-js/issues/1751
|
||||
async function handler (req: http.IncomingMessage, res: http.ServerResponse) {
|
||||
res.setHeader('content-type', 'application/json')
|
||||
res.end(JSON.stringify({
|
||||
took: 0,
|
||||
errors: true,
|
||||
items: [
|
||||
{ delete: { status: 200 } },
|
||||
{ index: { status: 429 } },
|
||||
{ index: { status: 200 } }
|
||||
]
|
||||
}))
|
||||
}
|
||||
|
||||
const [{ port }, server] = await buildServer(handler)
|
||||
const client = new Client({ node: `http://localhost:${port}` })
|
||||
let counter = 0
|
||||
const result = await client.helpers.bulk({
|
||||
datasource: dataset.slice(),
|
||||
concurrency: 1,
|
||||
wait: 10,
|
||||
retries: 0,
|
||||
onDocument (doc) {
|
||||
counter++
|
||||
if (counter === 1) {
|
||||
return {
|
||||
delete: {
|
||||
_index: 'test',
|
||||
_id: String(counter)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
index: {
|
||||
_index: 'test',
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
onDrop (doc) {
|
||||
t.same(doc, {
|
||||
status: 429,
|
||||
error: null,
|
||||
operation: { index: { _index: 'test' } },
|
||||
document: { user: "arya", age: 18 },
|
||||
retried: false,
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
t.type(result.time, 'number')
|
||||
t.type(result.bytes, 'number')
|
||||
t.match(result, {
|
||||
total: 3,
|
||||
successful: 2,
|
||||
retry: 0,
|
||||
failed: 1,
|
||||
aborted: false
|
||||
})
|
||||
server.stop()
|
||||
})
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
|
||||
@ -24,7 +24,9 @@ import {
|
||||
ConnectionRequestParams,
|
||||
ConnectionRequestOptions,
|
||||
ConnectionRequestResponse,
|
||||
errors
|
||||
errors,
|
||||
ConnectionRequestOptionsAsStream,
|
||||
ConnectionRequestResponseAsStream
|
||||
} from '@elastic/transport'
|
||||
const {
|
||||
ConnectionError,
|
||||
@ -32,7 +34,9 @@ const {
|
||||
} = errors
|
||||
|
||||
export class MockConnection extends BaseConnection {
|
||||
request (params: ConnectionRequestParams, options: ConnectionRequestOptions): Promise<ConnectionRequestResponse> {
|
||||
async request (params: ConnectionRequestParams, options: ConnectionRequestOptions): Promise<ConnectionRequestResponse>
|
||||
async request (params: ConnectionRequestParams, options: ConnectionRequestOptionsAsStream): Promise<ConnectionRequestResponseAsStream>
|
||||
async request (params: ConnectionRequestParams, options: any): Promise<any> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const body = JSON.stringify({ hello: 'world' })
|
||||
const statusCode = setStatusCode(params.path)
|
||||
@ -49,7 +53,9 @@ export class MockConnection extends BaseConnection {
|
||||
}
|
||||
|
||||
export class MockConnectionTimeout extends BaseConnection {
|
||||
request (params: ConnectionRequestParams, options: ConnectionRequestOptions): Promise<ConnectionRequestResponse> {
|
||||
async request (params: ConnectionRequestParams, options: ConnectionRequestOptions): Promise<ConnectionRequestResponse>
|
||||
async request (params: ConnectionRequestParams, options: ConnectionRequestOptionsAsStream): Promise<ConnectionRequestResponseAsStream>
|
||||
async request (params: ConnectionRequestParams, options: any): Promise<any> {
|
||||
return new Promise((resolve, reject) => {
|
||||
process.nextTick(reject, new TimeoutError('Request timed out'))
|
||||
})
|
||||
@ -57,7 +63,9 @@ export class MockConnectionTimeout extends BaseConnection {
|
||||
}
|
||||
|
||||
export class MockConnectionError extends BaseConnection {
|
||||
request (params: ConnectionRequestParams, options: ConnectionRequestOptions): Promise<ConnectionRequestResponse> {
|
||||
async request (params: ConnectionRequestParams, options: ConnectionRequestOptions): Promise<ConnectionRequestResponse>
|
||||
async request (params: ConnectionRequestParams, options: ConnectionRequestOptionsAsStream): Promise<ConnectionRequestResponseAsStream>
|
||||
async request (params: ConnectionRequestParams, options: any): Promise<any> {
|
||||
return new Promise((resolve, reject) => {
|
||||
process.nextTick(reject, new ConnectionError('kaboom'))
|
||||
})
|
||||
@ -65,7 +73,9 @@ export class MockConnectionError extends BaseConnection {
|
||||
}
|
||||
|
||||
export class MockConnectionSniff extends BaseConnection {
|
||||
request (params: ConnectionRequestParams, options: ConnectionRequestOptions): Promise<ConnectionRequestResponse> {
|
||||
async request (params: ConnectionRequestParams, options: ConnectionRequestOptions): Promise<ConnectionRequestResponse>
|
||||
async request (params: ConnectionRequestParams, options: ConnectionRequestOptionsAsStream): Promise<ConnectionRequestResponseAsStream>
|
||||
async request (params: ConnectionRequestParams, options: any): Promise<any> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const sniffResult = {
|
||||
nodes: {
|
||||
@ -106,7 +116,9 @@ export function buildMockConnection (opts: onRequestMock) {
|
||||
assert(opts.onRequest, 'Missing required onRequest option')
|
||||
|
||||
class MockConnection extends BaseConnection {
|
||||
request (params: ConnectionRequestParams, options: ConnectionRequestOptions): Promise<ConnectionRequestResponse> {
|
||||
async request (params: ConnectionRequestParams, options: ConnectionRequestOptions): Promise<ConnectionRequestResponse>
|
||||
async request (params: ConnectionRequestParams, options: ConnectionRequestOptionsAsStream): Promise<ConnectionRequestResponseAsStream>
|
||||
async request (params: ConnectionRequestParams, options: any): Promise<any> {
|
||||
return new Promise((resolve, reject) => {
|
||||
params.headers = { ...this.headers, ...params.headers }
|
||||
let { body, statusCode, headers } = opts.onRequest(params)
|
||||
|
||||
Reference in New Issue
Block a user