Compare commits
14 Commits
backport-2
...
v8.8.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 1fb44787cc | |||
| 4a1860b29c | |||
| 26e04997eb | |||
| 295e3ed48c | |||
| cbf46454f2 | |||
| 678e9d9f70 | |||
| 9cb5ac4f93 | |||
| 588d080710 | |||
| 087c26568f | |||
| 7ab6fa9624 | |||
| a33c7af5e8 | |||
| 4a4624b3ad | |||
| 28f56835fe | |||
| d5904a8bb1 |
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
@ -1,3 +1,31 @@
|
|||||||
steps:
|
steps:
|
||||||
- label: ":js: Greetings"
|
- label: ":elasticsearch: :javascript: ES JavaScript ({{ matrix.nodejs }}) Test Suite: {{ matrix.suite }}"
|
||||||
command: "echo 'Hello, world!'"
|
agents:
|
||||||
|
provider: "gcp"
|
||||||
|
env:
|
||||||
|
NODE_VERSION: "{{ matrix.nodejs }}"
|
||||||
|
TEST_SUITE: "{{ matrix.suite }}"
|
||||||
|
STACK_VERSION: 8.8.0-SNAPSHOT
|
||||||
|
matrix:
|
||||||
|
setup:
|
||||||
|
suite:
|
||||||
|
- "free"
|
||||||
|
- "platinum"
|
||||||
|
nodejs:
|
||||||
|
- "14"
|
||||||
|
- "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'"
|
||||||
@ -22,16 +22,19 @@
|
|||||||
# - Use https only when TEST_SUITE is "platinum", when "free" use http
|
# - Use https only when TEST_SUITE is "platinum", when "free" use http
|
||||||
# - Set xpack.security.enabled=false for "free" and xpack.security.enabled=true for "platinum"
|
# - Set xpack.security.enabled=false for "free" and xpack.security.enabled=true for "platinum"
|
||||||
|
|
||||||
script_path=$(dirname "$(realpath -s "$0")")
|
script_path=$(dirname $(realpath -s $0))
|
||||||
source "$script_path/functions/imports.sh"
|
source $script_path/functions/imports.sh
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
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"
|
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"
|
cleanup_node $es_node_name
|
||||||
|
|
||||||
master_node_name=${es_node_name}
|
master_node_name=${es_node_name}
|
||||||
cluster_name=${moniker}${suffix}
|
cluster_name=${moniker}${suffix}
|
||||||
|
|
||||||
|
# Set vm.max_map_count kernel setting to 262144
|
||||||
|
sudo sysctl -w vm.max_map_count=262144
|
||||||
|
|
||||||
declare -a volumes
|
declare -a volumes
|
||||||
environment=($(cat <<-END
|
environment=($(cat <<-END
|
||||||
--env ELASTIC_PASSWORD=$elastic_password
|
--env ELASTIC_PASSWORD=$elastic_password
|
||||||
@ -73,6 +76,7 @@ END
|
|||||||
))
|
))
|
||||||
else
|
else
|
||||||
environment+=($(cat <<-END
|
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.enabled=false
|
||||||
--env xpack.security.http.ssl.enabled=false
|
--env xpack.security.http.ssl.enabled=false
|
||||||
END
|
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"
|
cert_validation_flags="--insecure --cacert /usr/share/elasticsearch/config/certs/ca.crt --resolve ${es_node_name}:443:127.0.0.1"
|
||||||
fi
|
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
|
# Pull the container, retry on failures up to 5 times with
|
||||||
# short delays between each attempt. Fixes most transient network errors.
|
# short delays between each attempt. Fixes most transient network errors.
|
||||||
docker_pull_attempts=0
|
docker_pull_attempts=0
|
||||||
@ -138,6 +149,4 @@ END
|
|||||||
if wait_for_container "$es_node_name" "$network_name"; then
|
if wait_for_container "$es_node_name" "$network_name"; then
|
||||||
echo -e "\033[32;1mSUCCESS:\033[0m Running on: $node_url\033[0m"
|
echo -e "\033[32;1mSUCCESS:\033[0m Running on: $node_url\033[0m"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
done
|
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,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+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.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+8.2
|
|
||||||
display-name: 'elastic / elasticsearch-js # 8.2'
|
|
||||||
description: Testing the elasticsearch-js 8.2 branch.
|
|
||||||
junit_results: "*-junit.xml"
|
|
||||||
parameters:
|
|
||||||
- string:
|
|
||||||
name: branch_specifier
|
|
||||||
default: refs/heads/8.2
|
|
||||||
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.3
|
|
||||||
display-name: 'elastic / elasticsearch-js # 8.3'
|
|
||||||
description: Testing the elasticsearch-js 8.3 branch.
|
|
||||||
junit_results: "*-junit.xml"
|
|
||||||
parameters:
|
|
||||||
- string:
|
|
||||||
name: branch_specifier
|
|
||||||
default: refs/heads/8.3
|
|
||||||
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.4
|
|
||||||
display-name: 'elastic / elasticsearch-js # 8.3'
|
|
||||||
description: Testing the elasticsearch-js 8.4 branch.
|
|
||||||
junit_results: "*-junit.xml"
|
|
||||||
parameters:
|
|
||||||
- string:
|
|
||||||
name: branch_specifier
|
|
||||||
default: refs/heads/8.4
|
|
||||||
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.5
|
|
||||||
display-name: 'elastic / elasticsearch-js # 8.5'
|
|
||||||
description: Testing the elasticsearch-js 8.5 branch.
|
|
||||||
junit_results: "*-junit.xml"
|
|
||||||
parameters:
|
|
||||||
- string:
|
|
||||||
name: branch_specifier
|
|
||||||
default: refs/heads/8.5
|
|
||||||
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.6
|
|
||||||
display-name: 'elastic / elasticsearch-js # 8.6'
|
|
||||||
description: Testing the elasticsearch-js 8.6 branch.
|
|
||||||
junit_results: "*-junit.xml"
|
|
||||||
parameters:
|
|
||||||
- string:
|
|
||||||
name: branch_specifier
|
|
||||||
default: refs/heads/8.6
|
|
||||||
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.7
|
|
||||||
display-name: 'elastic / elasticsearch-js # 8.7'
|
|
||||||
description: Testing the elasticsearch-js 8.7 branch.
|
|
||||||
junit_results: "*-junit.xml"
|
|
||||||
parameters:
|
|
||||||
- string:
|
|
||||||
name: branch_specifier
|
|
||||||
default: refs/heads/8.7
|
|
||||||
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
|
|
||||||
@ -86,10 +86,10 @@ async function bump (args) {
|
|||||||
'utf8'
|
'utf8'
|
||||||
)
|
)
|
||||||
|
|
||||||
const testMatrix = await readFile(join(import.meta.url, 'test-matrix.yml'), 'utf8')
|
const pipeline = await readFile(join(import.meta.url, '..', '.buildkite', 'pipeline.yml'))
|
||||||
await writeFile(
|
await writeFile(
|
||||||
join(import.meta.url, 'test-matrix.yml'),
|
join(import.meta.url, '..', '.buildkite', 'pipeline.yml'),
|
||||||
testMatrix.replace(/STACK_VERSION:\s+\- "[0-9]+[0-9\.]*[0-9](?:\-SNAPSHOT)?"/, `STACK_VERSION:\n - "${cleanVersion}-SNAPSHOT"`), // eslint-disable-line
|
pipeline.replace(/STACK_VERSION: [0-9]+[0-9\.]*[0-9](?:\-SNAPSHOT)?/, `STACK_VERSION: - ${cleanVersion}-SNAPSHOT`), // eslint-disable-line
|
||||||
'utf8'
|
'utf8'
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,14 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
source /usr/local/bin/bash_standard_lib.sh
|
|
||||||
|
|
||||||
DOCKER_IMAGES="node:17-alpine
|
|
||||||
node:16-alpine
|
|
||||||
node:14-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-16}
|
|
||||||
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 separated 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.8.0-SNAPSHOT"
|
|
||||||
|
|
||||||
NODE_JS_VERSION:
|
|
||||||
- 18
|
|
||||||
- 16
|
|
||||||
- 14
|
|
||||||
|
|
||||||
TEST_SUITE:
|
|
||||||
- free
|
|
||||||
- platinum
|
|
||||||
|
|
||||||
exclude: ~
|
|
||||||
2
.github/workflows/backport.yml
vendored
2
.github/workflows/backport.yml
vendored
@ -11,6 +11,6 @@ jobs:
|
|||||||
name: Backport
|
name: Backport
|
||||||
steps:
|
steps:
|
||||||
- name: Backport
|
- name: Backport
|
||||||
uses: tibdex/backport@v1
|
uses: tibdex/backport@v2
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
142
.github/workflows/nodejs.yml
vendored
142
.github/workflows/nodejs.yml
vendored
@ -9,7 +9,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [14.x, 16.x, 18.x]
|
node-version: [14.x, 16.x, 18.x, 20.x]
|
||||||
os: [ubuntu-latest, windows-latest, macOS-latest]
|
os: [ubuntu-latest, windows-latest, macOS-latest]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@ -32,151 +32,13 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
npm run test:unit
|
npm run test:unit
|
||||||
|
|
||||||
# - 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@v3
|
|
||||||
|
|
||||||
# - 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@v3
|
|
||||||
# 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@v3
|
|
||||||
|
|
||||||
# - 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@v3
|
|
||||||
# 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@v3
|
|
||||||
|
|
||||||
# - name: Use Node.js 14.x
|
|
||||||
# uses: actions/setup-node@v3
|
|
||||||
# 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@v3
|
|
||||||
|
|
||||||
# - name: Use Node.js ${{ matrix.node-version }}
|
|
||||||
# uses: actions/setup-node@v3
|
|
||||||
# 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
|
|
||||||
|
|
||||||
license:
|
license:
|
||||||
name: License check
|
name: License check
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [16.x]
|
node-version: [20.x]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|||||||
53
catalog-info.yaml
Normal file
53
catalog-info.yaml
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
---
|
||||||
|
# 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
|
||||||
|
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'
|
||||||
|
8_6_daily:
|
||||||
|
branch: '8.6'
|
||||||
|
cronline: '@daily'
|
||||||
|
7_17_daily:
|
||||||
|
branch: '7.17'
|
||||||
|
cronline: '@daily'
|
||||||
@ -1,6 +1,35 @@
|
|||||||
[[changelog-client]]
|
[[changelog-client]]
|
||||||
== Release notes
|
== Release notes
|
||||||
|
|
||||||
|
[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.7.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]
|
[discrete]
|
||||||
=== 8.6.0
|
=== 8.6.0
|
||||||
|
|
||||||
|
|||||||
@ -103,7 +103,7 @@ async function run () {
|
|||||||
// get the next response if there are more quotes to fetch
|
// get the next response if there are more quotes to fetch
|
||||||
responseQueue.push(
|
responseQueue.push(
|
||||||
await client.scroll({
|
await client.scroll({
|
||||||
scrollId: body._scroll_id,
|
scroll_id: body._scroll_id,
|
||||||
scroll: '30s'
|
scroll: '30s'
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
@ -146,7 +146,7 @@ async function * scrollSearch (params) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
response = await client.scroll({
|
response = await client.scroll({
|
||||||
scrollId: response._scroll_id,
|
scroll_id: response._scroll_id,
|
||||||
scroll: params.scroll
|
scroll: params.scroll
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
2
index.d.ts
vendored
2
index.d.ts
vendored
@ -22,6 +22,6 @@ import SniffingTransport from './lib/sniffingTransport'
|
|||||||
|
|
||||||
export * from '@elastic/transport'
|
export * from '@elastic/transport'
|
||||||
export * as estypes from './lib/api/types'
|
export * as estypes from './lib/api/types'
|
||||||
export * as estypesWithBody from './lib/api/types'
|
export * as estypesWithBody from './lib/api/typesWithBodyKey'
|
||||||
export { Client, SniffingTransport }
|
export { Client, SniffingTransport }
|
||||||
export type { ClientOptions, NodeOptions } from './lib/client'
|
export type { ClientOptions, NodeOptions } from './lib/client'
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@elastic/elasticsearch",
|
"name": "@elastic/elasticsearch",
|
||||||
"version": "8.8.0",
|
"version": "8.8.0",
|
||||||
"versionCanary": "8.8.0-canary.0",
|
"versionCanary": "8.8.0-canary.2",
|
||||||
"description": "The official Elasticsearch client for Node.js",
|
"description": "The official Elasticsearch client for Node.js",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"types": "index.d.ts",
|
"types": "index.d.ts",
|
||||||
|
|||||||
@ -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<T.ClusterPutComponentTemplateResponse>
|
||||||
async putComponentTemplate (this: That, params: T.ClusterPutComponentTemplateRequest | TB.ClusterPutComponentTemplateRequest, options?: TransportRequestOptions): Promise<any> {
|
async putComponentTemplate (this: That, params: T.ClusterPutComponentTemplateRequest | TB.ClusterPutComponentTemplateRequest, options?: TransportRequestOptions): Promise<any> {
|
||||||
const acceptedPath: string[] = ['name']
|
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> = {}
|
const querystring: Record<string, any> = {}
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
const userBody: any = params?.body
|
const userBody: any = params?.body
|
||||||
|
|||||||
@ -37,12 +37,12 @@ import * as T from '../types'
|
|||||||
import * as TB from '../typesWithBodyKey'
|
import * as TB from '../typesWithBodyKey'
|
||||||
interface That { transport: Transport }
|
interface That { transport: Transport }
|
||||||
|
|
||||||
export default async function FieldCapsApi (this: That, params: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FieldCapsResponse>
|
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FieldCapsResponse>
|
||||||
export default async function FieldCapsApi (this: That, params: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FieldCapsResponse, unknown>>
|
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FieldCapsResponse, unknown>>
|
||||||
export default async function FieldCapsApi (this: That, params: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptions): Promise<T.FieldCapsResponse>
|
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptions): Promise<T.FieldCapsResponse>
|
||||||
export default async function FieldCapsApi (this: That, params: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptions): Promise<any> {
|
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptions): Promise<any> {
|
||||||
const acceptedPath: string[] = ['index']
|
const acceptedPath: string[] = ['index']
|
||||||
const acceptedBody: string[] = ['index_filter', 'runtime_mappings']
|
const acceptedBody: string[] = ['fields', 'index_filter', 'runtime_mappings']
|
||||||
const querystring: Record<string, any> = {}
|
const querystring: Record<string, any> = {}
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
const userBody: any = params?.body
|
const userBody: any = params?.body
|
||||||
@ -53,6 +53,7 @@ export default async function FieldCapsApi (this: That, params: T.FieldCapsReque
|
|||||||
body = userBody != null ? { ...userBody } : undefined
|
body = userBody != null ? { ...userBody } : undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
params = params ?? {}
|
||||||
for (const key in params) {
|
for (const key in params) {
|
||||||
if (acceptedBody.includes(key)) {
|
if (acceptedBody.includes(key)) {
|
||||||
body = body ?? {}
|
body = 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)
|
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?: 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?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesDeleteDataStreamResponse, unknown>>
|
||||||
async deleteDataStream (this: That, params: T.IndicesDeleteDataStreamRequest | TB.IndicesDeleteDataStreamRequest, options?: TransportRequestOptions): Promise<T.IndicesDeleteDataStreamResponse>
|
async deleteDataStream (this: That, params: T.IndicesDeleteDataStreamRequest | TB.IndicesDeleteDataStreamRequest, options?: TransportRequestOptions): Promise<T.IndicesDeleteDataStreamResponse>
|
||||||
@ -540,6 +562,28 @@ export default class Indices {
|
|||||||
return await this.transport.request({ path, method, querystring, body }, options)
|
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?: 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?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesFieldUsageStatsResponse, unknown>>
|
||||||
async fieldUsageStats (this: That, params: T.IndicesFieldUsageStatsRequest | TB.IndicesFieldUsageStatsRequest, options?: TransportRequestOptions): Promise<T.IndicesFieldUsageStatsResponse>
|
async fieldUsageStats (this: That, params: T.IndicesFieldUsageStatsRequest | TB.IndicesFieldUsageStatsRequest, options?: TransportRequestOptions): Promise<T.IndicesFieldUsageStatsResponse>
|
||||||
@ -680,6 +724,28 @@ export default class Indices {
|
|||||||
return await this.transport.request({ path, method, querystring, body }, options)
|
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?: 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?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesGetDataStreamResponse, unknown>>
|
||||||
async getDataStream (this: That, params?: T.IndicesGetDataStreamRequest | TB.IndicesGetDataStreamRequest, options?: TransportRequestOptions): Promise<T.IndicesGetDataStreamResponse>
|
async getDataStream (this: That, params?: T.IndicesGetDataStreamRequest | TB.IndicesGetDataStreamRequest, options?: TransportRequestOptions): Promise<T.IndicesGetDataStreamResponse>
|
||||||
@ -1006,6 +1072,40 @@ export default class Indices {
|
|||||||
return await this.transport.request({ path, method, querystring, body }, options)
|
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?: 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?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesPutIndexTemplateResponse, unknown>>
|
||||||
async putIndexTemplate (this: That, params: T.IndicesPutIndexTemplateRequest | TB.IndicesPutIndexTemplateRequest, options?: TransportRequestOptions): Promise<T.IndicesPutIndexTemplateResponse>
|
async putIndexTemplate (this: That, params: T.IndicesPutIndexTemplateRequest | TB.IndicesPutIndexTemplateRequest, options?: TransportRequestOptions): Promise<T.IndicesPutIndexTemplateResponse>
|
||||||
|
|||||||
@ -135,10 +135,10 @@ export default class License {
|
|||||||
return await this.transport.request({ path, method, querystring, body }, options)
|
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?: 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?: 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<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?: TransportRequestOptions): Promise<any> {
|
||||||
const acceptedPath: string[] = []
|
const acceptedPath: string[] = []
|
||||||
const acceptedBody: string[] = ['license', 'licenses']
|
const acceptedBody: string[] = ['license', 'licenses']
|
||||||
const querystring: Record<string, any> = {}
|
const querystring: Record<string, any> = {}
|
||||||
@ -151,6 +151,7 @@ export default class License {
|
|||||||
body = userBody != null ? { ...userBody } : undefined
|
body = userBody != null ? { ...userBody } : undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
params = params ?? {}
|
||||||
for (const key in params) {
|
for (const key in params) {
|
||||||
if (acceptedBody.includes(key)) {
|
if (acceptedBody.includes(key)) {
|
||||||
body = body ?? {}
|
body = body ?? {}
|
||||||
|
|||||||
@ -82,8 +82,15 @@ export default class Logstash {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const method = 'GET'
|
let method = ''
|
||||||
const path = `/_logstash/pipeline/${encodeURIComponent(params.id.toString())}`
|
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)
|
return await this.transport.request({ path, method, querystring, body }, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -43,19 +43,19 @@ export default class Ml {
|
|||||||
this.transport = transport
|
this.transport = transport
|
||||||
}
|
}
|
||||||
|
|
||||||
async clearTrainedModelDeploymentCache (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
|
async clearTrainedModelDeploymentCache (this: That, params: T.MlClearTrainedModelDeploymentCacheRequest | TB.MlClearTrainedModelDeploymentCacheRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.MlClearTrainedModelDeploymentCacheResponse>
|
||||||
async clearTrainedModelDeploymentCache (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
|
async clearTrainedModelDeploymentCache (this: That, params: T.MlClearTrainedModelDeploymentCacheRequest | TB.MlClearTrainedModelDeploymentCacheRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.MlClearTrainedModelDeploymentCacheResponse, unknown>>
|
||||||
async clearTrainedModelDeploymentCache (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
|
async clearTrainedModelDeploymentCache (this: That, params: T.MlClearTrainedModelDeploymentCacheRequest | TB.MlClearTrainedModelDeploymentCacheRequest, options?: TransportRequestOptions): Promise<T.MlClearTrainedModelDeploymentCacheResponse>
|
||||||
async clearTrainedModelDeploymentCache (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
|
async clearTrainedModelDeploymentCache (this: That, params: T.MlClearTrainedModelDeploymentCacheRequest | TB.MlClearTrainedModelDeploymentCacheRequest, options?: TransportRequestOptions): Promise<any> {
|
||||||
const acceptedPath: string[] = ['model_id']
|
const acceptedPath: string[] = ['model_id']
|
||||||
const querystring: Record<string, any> = {}
|
const querystring: Record<string, any> = {}
|
||||||
const body = undefined
|
const body = undefined
|
||||||
|
|
||||||
params = params ?? {}
|
|
||||||
for (const key in params) {
|
for (const key in params) {
|
||||||
if (acceptedPath.includes(key)) {
|
if (acceptedPath.includes(key)) {
|
||||||
continue
|
continue
|
||||||
} else if (key !== 'body') {
|
} else if (key !== 'body') {
|
||||||
|
// @ts-expect-error
|
||||||
querystring[key] = params[key]
|
querystring[key] = params[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -710,7 +710,7 @@ export default class Ml {
|
|||||||
path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/results/categories/${encodeURIComponent(params.category_id.toString())}`
|
path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/results/categories/${encodeURIComponent(params.category_id.toString())}`
|
||||||
} else {
|
} else {
|
||||||
method = body != null ? 'POST' : 'GET'
|
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)
|
return await this.transport.request({ path, method, querystring, body }, options)
|
||||||
}
|
}
|
||||||
@ -2006,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<T.MlUpdateDatafeedResponse>
|
||||||
async updateDatafeed (this: That, params: T.MlUpdateDatafeedRequest | TB.MlUpdateDatafeedRequest, options?: TransportRequestOptions): Promise<any> {
|
async updateDatafeed (this: That, params: T.MlUpdateDatafeedRequest | TB.MlUpdateDatafeedRequest, options?: TransportRequestOptions): Promise<any> {
|
||||||
const acceptedPath: string[] = ['datafeed_id']
|
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> = {}
|
const querystring: Record<string, any> = {}
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
const userBody: any = params?.body
|
const userBody: any = params?.body
|
||||||
@ -2074,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<T.MlUpdateJobResponse>
|
||||||
async updateJob (this: That, params: T.MlUpdateJobRequest | TB.MlUpdateJobRequest, options?: TransportRequestOptions): Promise<any> {
|
async updateJob (this: That, params: T.MlUpdateJobRequest | TB.MlUpdateJobRequest, options?: TransportRequestOptions): Promise<any> {
|
||||||
const acceptedPath: string[] = ['job_id']
|
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> = {}
|
const querystring: Record<string, any> = {}
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
const userBody: any = params?.body
|
const userBody: any = params?.body
|
||||||
@ -2137,6 +2137,28 @@ export default class Ml {
|
|||||||
return await this.transport.request({ path, method, querystring, body }, options)
|
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?: 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?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.MlUpgradeJobSnapshotResponse, unknown>>
|
||||||
async upgradeJobSnapshot (this: That, params: T.MlUpgradeJobSnapshotRequest | TB.MlUpgradeJobSnapshotRequest, options?: TransportRequestOptions): Promise<T.MlUpgradeJobSnapshotResponse>
|
async upgradeJobSnapshot (this: That, params: T.MlUpgradeJobSnapshotRequest | TB.MlUpgradeJobSnapshotRequest, options?: TransportRequestOptions): Promise<T.MlUpgradeJobSnapshotResponse>
|
||||||
|
|||||||
@ -90,7 +90,7 @@ export default class Rollup {
|
|||||||
path = `/_rollup/job/${encodeURIComponent(params.id.toString())}`
|
path = `/_rollup/job/${encodeURIComponent(params.id.toString())}`
|
||||||
} else {
|
} else {
|
||||||
method = 'GET'
|
method = 'GET'
|
||||||
path = '/_rollup/job/'
|
path = '/_rollup/job'
|
||||||
}
|
}
|
||||||
return await this.transport.request({ path, method, querystring, body }, options)
|
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())}`
|
path = `/_rollup/data/${encodeURIComponent(params.id.toString())}`
|
||||||
} else {
|
} else {
|
||||||
method = 'GET'
|
method = 'GET'
|
||||||
path = '/_rollup/data/'
|
path = '/_rollup/data'
|
||||||
}
|
}
|
||||||
return await this.transport.request({ path, method, querystring, body }, options)
|
return await this.transport.request({ path, method, querystring, body }, options)
|
||||||
}
|
}
|
||||||
|
|||||||
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<T.SearchMvtResponse>
|
||||||
export default async function SearchMvtApi (this: That, params: T.SearchMvtRequest | TB.SearchMvtRequest, options?: TransportRequestOptions): Promise<any> {
|
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 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> = {}
|
const querystring: Record<string, any> = {}
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
const userBody: any = params?.body
|
const userBody: any = params?.body
|
||||||
|
|||||||
@ -1155,7 +1155,7 @@ export default class Security {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const method = 'PUT'
|
const method = 'PUT'
|
||||||
const path = '/_security/privilege/'
|
const path = '/_security/privilege'
|
||||||
return await this.transport.request({ path, method, querystring, body }, options)
|
return await this.transport.request({ path, method, querystring, body }, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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<T.SnapshotRestoreResponse>
|
||||||
async restore (this: That, params: T.SnapshotRestoreRequest | TB.SnapshotRestoreRequest, options?: TransportRequestOptions): Promise<any> {
|
async restore (this: That, params: T.SnapshotRestoreRequest | TB.SnapshotRestoreRequest, options?: TransportRequestOptions): Promise<any> {
|
||||||
const acceptedPath: string[] = ['repository', 'snapshot']
|
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> = {}
|
const querystring: Record<string, any> = {}
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
const userBody: any = params?.body
|
const userBody: any = params?.body
|
||||||
|
|||||||
@ -215,6 +215,28 @@ export default class Transform {
|
|||||||
return await this.transport.request({ path, method, querystring, body }, options)
|
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?: 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?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformStartTransformResponse, unknown>>
|
||||||
async startTransform (this: That, params: T.TransformStartTransformRequest | TB.TransformStartTransformRequest, options?: TransportRequestOptions): Promise<T.TransformStartTransformResponse>
|
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)
|
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?: 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?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.WatcherGetWatchResponse, unknown>>
|
||||||
async getWatch (this: That, params: T.WatcherGetWatchRequest | TB.WatcherGetWatchRequest, options?: TransportRequestOptions): Promise<T.WatcherGetWatchResponse>
|
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'
|
const path = '/_watcher/_stop'
|
||||||
return await this.transport.request({ path, method, querystring, body }, options)
|
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 getScriptLanguagesApi from './api/get_script_languages'
|
||||||
import getSourceApi from './api/get_source'
|
import getSourceApi from './api/get_source'
|
||||||
import GraphApi from './api/graph'
|
import GraphApi from './api/graph'
|
||||||
|
import healthReportApi from './api/health_report'
|
||||||
import IlmApi from './api/ilm'
|
import IlmApi from './api/ilm'
|
||||||
import indexApi from './api/index'
|
import indexApi from './api/index'
|
||||||
import IndicesApi from './api/indices'
|
import IndicesApi from './api/indices'
|
||||||
@ -82,6 +83,7 @@ import RollupApi from './api/rollup'
|
|||||||
import scriptsPainlessExecuteApi from './api/scripts_painless_execute'
|
import scriptsPainlessExecuteApi from './api/scripts_painless_execute'
|
||||||
import scrollApi from './api/scroll'
|
import scrollApi from './api/scroll'
|
||||||
import searchApi from './api/search'
|
import searchApi from './api/search'
|
||||||
|
import SearchApplicationApi from './api/search_application'
|
||||||
import searchMvtApi from './api/search_mvt'
|
import searchMvtApi from './api/search_mvt'
|
||||||
import searchShardsApi from './api/search_shards'
|
import searchShardsApi from './api/search_shards'
|
||||||
import searchTemplateApi from './api/search_template'
|
import searchTemplateApi from './api/search_template'
|
||||||
@ -134,6 +136,7 @@ export default interface API {
|
|||||||
getScriptLanguages: typeof getScriptLanguagesApi
|
getScriptLanguages: typeof getScriptLanguagesApi
|
||||||
getSource: typeof getSourceApi
|
getSource: typeof getSourceApi
|
||||||
graph: GraphApi
|
graph: GraphApi
|
||||||
|
healthReport: typeof healthReportApi
|
||||||
ilm: IlmApi
|
ilm: IlmApi
|
||||||
index: typeof indexApi
|
index: typeof indexApi
|
||||||
indices: IndicesApi
|
indices: IndicesApi
|
||||||
@ -161,6 +164,7 @@ export default interface API {
|
|||||||
scriptsPainlessExecute: typeof scriptsPainlessExecuteApi
|
scriptsPainlessExecute: typeof scriptsPainlessExecuteApi
|
||||||
scroll: typeof scrollApi
|
scroll: typeof scrollApi
|
||||||
search: typeof searchApi
|
search: typeof searchApi
|
||||||
|
searchApplication: SearchApplicationApi
|
||||||
searchMvt: typeof searchMvtApi
|
searchMvt: typeof searchMvtApi
|
||||||
searchShards: typeof searchShardsApi
|
searchShards: typeof searchShardsApi
|
||||||
searchTemplate: typeof searchTemplateApi
|
searchTemplate: typeof searchTemplateApi
|
||||||
@ -204,6 +208,7 @@ const kMl = Symbol('Ml')
|
|||||||
const kMonitoring = Symbol('Monitoring')
|
const kMonitoring = Symbol('Monitoring')
|
||||||
const kNodes = Symbol('Nodes')
|
const kNodes = Symbol('Nodes')
|
||||||
const kRollup = Symbol('Rollup')
|
const kRollup = Symbol('Rollup')
|
||||||
|
const kSearchApplication = Symbol('SearchApplication')
|
||||||
const kSearchableSnapshots = Symbol('SearchableSnapshots')
|
const kSearchableSnapshots = Symbol('SearchableSnapshots')
|
||||||
const kSecurity = Symbol('Security')
|
const kSecurity = Symbol('Security')
|
||||||
const kShutdown = Symbol('Shutdown')
|
const kShutdown = Symbol('Shutdown')
|
||||||
@ -239,6 +244,7 @@ export default class API {
|
|||||||
[kMonitoring]: symbol | null
|
[kMonitoring]: symbol | null
|
||||||
[kNodes]: symbol | null
|
[kNodes]: symbol | null
|
||||||
[kRollup]: symbol | null
|
[kRollup]: symbol | null
|
||||||
|
[kSearchApplication]: symbol | null
|
||||||
[kSearchableSnapshots]: symbol | null
|
[kSearchableSnapshots]: symbol | null
|
||||||
[kSecurity]: symbol | null
|
[kSecurity]: symbol | null
|
||||||
[kShutdown]: symbol | null
|
[kShutdown]: symbol | null
|
||||||
@ -273,6 +279,7 @@ export default class API {
|
|||||||
this[kMonitoring] = null
|
this[kMonitoring] = null
|
||||||
this[kNodes] = null
|
this[kNodes] = null
|
||||||
this[kRollup] = null
|
this[kRollup] = null
|
||||||
|
this[kSearchApplication] = null
|
||||||
this[kSearchableSnapshots] = null
|
this[kSearchableSnapshots] = null
|
||||||
this[kSecurity] = null
|
this[kSecurity] = null
|
||||||
this[kShutdown] = null
|
this[kShutdown] = null
|
||||||
@ -306,6 +313,7 @@ API.prototype.getScript = getScriptApi
|
|||||||
API.prototype.getScriptContext = getScriptContextApi
|
API.prototype.getScriptContext = getScriptContextApi
|
||||||
API.prototype.getScriptLanguages = getScriptLanguagesApi
|
API.prototype.getScriptLanguages = getScriptLanguagesApi
|
||||||
API.prototype.getSource = getSourceApi
|
API.prototype.getSource = getSourceApi
|
||||||
|
API.prototype.healthReport = healthReportApi
|
||||||
API.prototype.index = indexApi
|
API.prototype.index = indexApi
|
||||||
API.prototype.info = infoApi
|
API.prototype.info = infoApi
|
||||||
API.prototype.knnSearch = knnSearchApi
|
API.prototype.knnSearch = knnSearchApi
|
||||||
@ -396,6 +404,9 @@ Object.defineProperties(API.prototype, {
|
|||||||
rollup: {
|
rollup: {
|
||||||
get () { return this[kRollup] === null ? (this[kRollup] = new RollupApi(this.transport)) : this[kRollup] }
|
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: {
|
searchableSnapshots: {
|
||||||
get () { return this[kSearchableSnapshots] === null ? (this[kSearchableSnapshots] = new SearchableSnapshotsApi(this.transport)) : this[kSearchableSnapshots] }
|
get () { return this[kSearchableSnapshots] === null ? (this[kSearchableSnapshots] = new SearchableSnapshotsApi(this.transport)) : this[kSearchableSnapshots] }
|
||||||
},
|
},
|
||||||
|
|||||||
1026
src/api/types.ts
1026
src/api/types.ts
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -20,6 +20,7 @@
|
|||||||
import { ConnectionOptions as TlsConnectionOptions } from 'tls'
|
import { ConnectionOptions as TlsConnectionOptions } from 'tls'
|
||||||
import { URL } from 'url'
|
import { URL } from 'url'
|
||||||
import buffer from 'buffer'
|
import buffer from 'buffer'
|
||||||
|
import os from 'os'
|
||||||
import {
|
import {
|
||||||
Transport,
|
Transport,
|
||||||
UndiciConnection,
|
UndiciConnection,
|
||||||
@ -173,7 +174,9 @@ export default class Client extends API {
|
|||||||
tls: null,
|
tls: null,
|
||||||
caFingerprint: null,
|
caFingerprint: null,
|
||||||
agent: null,
|
agent: null,
|
||||||
headers: {},
|
headers: {
|
||||||
|
'user-agent': `elasticsearch-js/${clientVersion} Node.js ${nodeVersion}; Transport ${transportVersion}; (${os.platform()} ${os.release()} ${os.arch()})`
|
||||||
|
},
|
||||||
nodeFilter: null,
|
nodeFilter: null,
|
||||||
generateRequestId: null,
|
generateRequestId: null,
|
||||||
name: 'elasticsearch-js',
|
name: 'elasticsearch-js',
|
||||||
|
|||||||
@ -85,7 +85,11 @@ function build (opts = {}) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
// remove 'x_pack_rest_user', used in some xpack test
|
// 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({
|
const searchableSnapshotIndices = await client.cluster.state({
|
||||||
metric: 'metadata',
|
metric: 'metadata',
|
||||||
@ -137,7 +141,11 @@ function build (opts = {}) {
|
|||||||
const body = await client.cluster.getComponentTemplate()
|
const body = await client.cluster.getComponentTemplate()
|
||||||
const components = body.component_templates.filter(c => !isXPackTemplate(c.name)).map(c => c.name)
|
const components = body.component_templates.filter(c => !isXPackTemplate(c.name)).map(c => c.name)
|
||||||
if (components.length > 0) {
|
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
|
// Remove any cluster setting
|
||||||
@ -157,9 +165,25 @@ function build (opts = {}) {
|
|||||||
if (isXPack) {
|
if (isXPack) {
|
||||||
// delete ilm policies
|
// delete ilm policies
|
||||||
const preserveIlmPolicies = [
|
const preserveIlmPolicies = [
|
||||||
'ilm-history-ilm-policy', 'slm-history-ilm-policy',
|
"ilm-history-ilm-policy",
|
||||||
'watch-history-ilm-policy', 'ml-size-based-ilm-policy',
|
"slm-history-ilm-policy",
|
||||||
'logs', 'metrics'
|
"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()
|
const policies = await client.ilm.getLifecycle()
|
||||||
for (const policy in policies) {
|
for (const policy in policies) {
|
||||||
@ -257,7 +281,7 @@ function build (opts = {}) {
|
|||||||
* - cleanup
|
* - cleanup
|
||||||
* @param {object} setup (null if not needed)
|
* @param {object} setup (null if not needed)
|
||||||
* @param {object} test
|
* @param {object} test
|
||||||
* @oaram {object} teardown (null if not needed)
|
* @param {object} teardown (null if not needed)
|
||||||
* @returns {Promise}
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
async function run (setup, test, teardown, stats, junit) {
|
async function run (setup, test, teardown, stats, junit) {
|
||||||
|
|||||||
@ -432,3 +432,12 @@ test('caFingerprint can\'t be configured over http / 2', t => {
|
|||||||
)
|
)
|
||||||
t.end()
|
t.end()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('user agent is in the correct format', t => {
|
||||||
|
const client = new Client({ node: 'http://localhost:9200' })
|
||||||
|
const agentRaw = client.transport[symbols.kHeaders]['user-agent'] || ''
|
||||||
|
const agentSplit = agentRaw.split(/\s+/)
|
||||||
|
t.equal(agentSplit[0].split('/')[0], 'elasticsearch-js')
|
||||||
|
t.ok(/^\d+\.\d+\.\d+/.test(agentSplit[0].split('/')[1]))
|
||||||
|
t.end()
|
||||||
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user