Compare commits

..

3 Commits

31 changed files with 1205 additions and 2690 deletions

View File

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

View File

@ -1,107 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/* global $ argv */
'use strict'
import 'zx/globals'
import { readFile, writeFile } from 'fs/promises'
import assert from 'assert'
import { join } from 'desm'
import semver from 'semver'
assert(typeof argv.task === 'string', 'Missing task parameter')
switch (argv.task) {
case 'release':
release(argv._).catch(onError)
break
case 'bump':
bump(argv._).catch(onError)
break
case 'codegen':
codegen(argv._).catch(onError)
break
default:
console.log(`Unknown task: ${argv.task}`)
process.exit(1)
}
async function release (args) {
assert(args.length === 2, 'Release task expects two parameters')
let [version, outputFolder] = args
if (process.env.WORKFLOW === 'snapshot' && !version.endsWith('SNAPSHOT')) {
version = `${version}-SNAPSHOT`
}
await bump([version])
const packageJson = JSON.parse(await readFile(
join(import.meta.url, '..', 'package.json'),
'utf8'
))
await $`npm pack`
await $`zip elasticsearch-js-${version}.zip elastic-elasticsearch-${packageJson.version}.tgz`
await $`rm elastic-elasticsearch-${packageJson.version}.tgz`
await $`mv ${join(import.meta.url, '..', `elasticsearch-js-${version}.zip`)} ${join(import.meta.url, '..', outputFolder, `elasticsearch-js-${version}.zip`)}`
}
async function bump (args) {
assert(args.length === 1, 'Bump task expects one parameter')
const [version] = args
const packageJson = JSON.parse(await readFile(
join(import.meta.url, '..', 'package.json'),
'utf8'
))
const cleanVersion = semver.clean(version.includes('SNAPSHOT') ? version.split('-')[0] : version)
assert(semver.valid(cleanVersion))
packageJson.version = cleanVersion
packageJson.versionCanary = `${cleanVersion}-canary.0`
await writeFile(
join(import.meta.url, '..', 'package.json'),
JSON.stringify(packageJson, null, 2),
'utf8'
)
const testMatrix = await readFile(join(import.meta.url, 'test-matrix.yml'), 'utf8')
await writeFile(
join(import.meta.url, 'test-matrix.yml'),
testMatrix.replace(/STACK_VERSION:\s+\- "[0-9]+[0-9\.]*[0-9](?:\-SNAPSHOT)?"/, `STACK_VERSION:\n - "${cleanVersion}-SNAPSHOT"`), // eslint-disable-line
'utf8'
)
}
// this command can only be executed locally for now
async function codegen (args) {
assert(args.length === 1, 'Bump task expects one parameter')
const [version] = args
await $`node scripts/generate --version ${version}`
}
function onError (err) {
console.log(err)
process.exit(1)
}

View File

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

View File

@ -1,6 +1,6 @@
---
STACK_VERSION:
- "7.17.12-SNAPSHOT"
- 7.16-SNAPSHOT
NODE_JS_VERSION:
- 16

View File

@ -9,36 +9,36 @@ jobs:
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
node-version: [12.x, 14.x, 16.x]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: |
npm install
- name: Install
run: |
npm install
- name: Lint
run: |
npm run lint
- name: Lint
run: |
npm run lint
- name: Unit test
run: |
npm run test:unit
- name: Unit test
run: |
npm run test:unit
- name: Acceptance test
run: |
npm run test:acceptance
- name: Acceptance test
run: |
npm run test:acceptance
- name: Type Definitions
run: |
npm run test:types
- name: Type Definitions
run: |
npm run test:types
helpers-integration-test:
name: Helpers integration test
@ -46,99 +46,133 @@ jobs:
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
node-version: [12.x, 14.x, 16.x]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v2
- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: 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: 7.17-SNAPSHOT
- name: Runs Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: 7.16-SNAPSHOT
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: |
npm install
- name: Install
run: |
npm install
- name: Integration test
run: |
npm run test:integration:helpers
- name: Integration test
run: |
npm run test:integration:helpers
bundler-support:
name: Bundler support
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v2
- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: 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: 7.17-SNAPSHOT
- name: Runs Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: 7.16-SNAPSHOT
- name: Use Node.js 16.x
uses: actions/setup-node@v4
with:
node-version: 16.x
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Install
run: |
npm install
npm install --prefix test/bundlers/parcel-test
npm install --prefix test/bundlers/rollup-test
npm install --prefix test/bundlers/webpack-test
- name: 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: 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
- 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@v4
- uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v4
with:
node-version: 14.x
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Install
run: |
npm install
npm install --prefix test/mock
- name: Install
run: |
npm install
npm install --prefix test/mock
- name: Run test
run: |
npm test --prefix test/mock
- name: Run test
run: |
npm test --prefix test/mock
code-coverage:
name: Code coverage
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: |
npm install
- name: Code coverage report
run: |
npm run test:coverage-report
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.lcov
fail_ci_if_error: true
- name: Code coverage 100%
run: |
npm run test:coverage-100
license:
name: License check
@ -149,17 +183,17 @@ jobs:
node-version: [14.x]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: |
npm install
- name: Install
run: |
npm install
- name: License checker
run: |
npm run license-checker
- name: License checker
run: |
npm run license-checker

View File

@ -931,43 +931,6 @@ MlApi.prototype.getJobs = function mlGetJobsApi (params, options, callback) {
return this.transport.request(request, options, callback)
}
MlApi.prototype.getModelSnapshotUpgradeStats = function mlGetModelSnapshotUpgradeStatsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.job_id == null && params.jobId == null) {
const err = new this[kConfigurationError]('Missing required parameter: job_id or jobId')
return handleError(err, callback)
}
if (params.snapshot_id == null && params.snapshotId == null) {
const err = new this[kConfigurationError]('Missing required parameter: snapshot_id or snapshotId')
return handleError(err, callback)
}
// check required url components
if ((params.snapshot_id != null || params.snapshotId != null) && ((params.job_id == null && params.jobId == null))) {
const err = new this[kConfigurationError]('Missing required parameter of the url: job_id')
return handleError(err, callback)
}
let { method, body, jobId, job_id, snapshotId, snapshot_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + 'model_snapshots' + '/' + encodeURIComponent(snapshot_id || snapshotId) + '/' + '_upgrade' + '/' + '_stats'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
MlApi.prototype.getModelSnapshots = function mlGetModelSnapshotsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
@ -2010,7 +1973,6 @@ Object.defineProperties(MlApi.prototype, {
get_influencers: { get () { return this.getInfluencers } },
get_job_stats: { get () { return this.getJobStats } },
get_jobs: { get () { return this.getJobs } },
get_model_snapshot_upgrade_stats: { get () { return this.getModelSnapshotUpgradeStats } },
get_model_snapshots: { get () { return this.getModelSnapshots } },
get_overall_buckets: { get () { return this.getOverallBuckets } },
get_records: { get () { return this.getRecords } },

View File

@ -23,8 +23,8 @@
/* eslint no-unused-vars: 0 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'wait_for_completion', 'verify', 'ignore_unavailable', 'index_details', 'include_repository', 'sort', 'size', 'order', 'from_sort_value', 'after', 'offset', 'slm_policy_filter', 'verbose', 'local', 'blob_count', 'concurrency', 'read_node_count', 'early_read_node_count', 'seed', 'rare_action_probability', 'max_blob_size', 'max_total_data_size', 'detailed', 'rarely_abort_writes']
const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path', waitForCompletion: 'wait_for_completion', ignoreUnavailable: 'ignore_unavailable', indexDetails: 'index_details', includeRepository: 'include_repository', fromSortValue: 'from_sort_value', slmPolicyFilter: 'slm_policy_filter', blobCount: 'blob_count', readNodeCount: 'read_node_count', earlyReadNodeCount: 'early_read_node_count', rareActionProbability: 'rare_action_probability', maxBlobSize: 'max_blob_size', maxTotalDataSize: 'max_total_data_size', rarelyAbortWrites: 'rarely_abort_writes' }
const acceptedQuerystring = ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'wait_for_completion', 'verify', 'ignore_unavailable', 'index_details', 'include_repository', 'verbose', 'local', 'blob_count', 'concurrency', 'read_node_count', 'early_read_node_count', 'seed', 'rare_action_probability', 'max_blob_size', 'max_total_data_size', 'detailed', 'rarely_abort_writes']
const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path', waitForCompletion: 'wait_for_completion', ignoreUnavailable: 'ignore_unavailable', indexDetails: 'index_details', includeRepository: 'include_repository', blobCount: 'blob_count', readNodeCount: 'read_node_count', earlyReadNodeCount: 'early_read_node_count', rareActionProbability: 'rare_action_probability', maxBlobSize: 'max_blob_size', maxTotalDataSize: 'max_total_data_size', rarelyAbortWrites: 'rarely_abort_writes' }
function SnapshotApi (transport, ConfigurationError) {
this.transport = transport

15
api/kibana.d.ts vendored
View File

@ -90,7 +90,7 @@ interface KibanaClient {
getAutoscalingPolicy<TContext = unknown>(params: T.AutoscalingGetAutoscalingPolicyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.AutoscalingGetAutoscalingPolicyResponse, TContext>>
putAutoscalingPolicy<TContext = unknown>(params: T.AutoscalingPutAutoscalingPolicyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.AutoscalingPutAutoscalingPolicyResponse, TContext>>
}
bulk<TDocument = unknown, TPartialDocument = unknown, TContext = unknown>(params: T.BulkRequest<TDocument, TPartialDocument>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.BulkResponse, TContext>>
bulk<TSource = unknown, TContext = unknown>(params: T.BulkRequest<TSource>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.BulkResponse, TContext>>
cat: {
aliases<TContext = unknown>(params?: T.CatAliasesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatAliasesResponse, TContext>>
allocation<TContext = unknown>(params?: T.CatAllocationRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatAllocationResponse, TContext>>
@ -195,7 +195,7 @@ interface KibanaClient {
}
fieldCaps<TContext = unknown>(params?: T.FieldCapsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.FieldCapsResponse, TContext>>
fleet: {
globalCheckpoints<TContext = unknown>(params: T.FleetGlobalCheckpointsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.FleetGlobalCheckpointsResponse, TContext>>
globalCheckpoints<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
msearch<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
search<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
}
@ -212,7 +212,7 @@ interface KibanaClient {
explainLifecycle<TContext = unknown>(params: T.IlmExplainLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IlmExplainLifecycleResponse, TContext>>
getLifecycle<TContext = unknown>(params?: T.IlmGetLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IlmGetLifecycleResponse, TContext>>
getStatus<TContext = unknown>(params?: T.IlmGetStatusRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IlmGetStatusResponse, TContext>>
migrateToDataTiers<TContext = unknown>(params?: T.IlmMigrateToDataTiersRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IlmMigrateToDataTiersResponse, TContext>>
migrateToDataTiers<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
moveToStep<TContext = unknown>(params: T.IlmMoveToStepRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IlmMoveToStepResponse, TContext>>
putLifecycle<TContext = unknown>(params: T.IlmPutLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IlmPutLifecycleResponse, TContext>>
removePolicy<TContext = unknown>(params: T.IlmRemovePolicyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IlmRemovePolicyResponse, TContext>>
@ -342,7 +342,6 @@ interface KibanaClient {
getInfluencers<TContext = unknown>(params: T.MlGetInfluencersRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlGetInfluencersResponse, TContext>>
getJobStats<TContext = unknown>(params?: T.MlGetJobStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlGetJobStatsResponse, TContext>>
getJobs<TContext = unknown>(params?: T.MlGetJobsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlGetJobsResponse, TContext>>
getModelSnapshotUpgradeStats<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
getModelSnapshots<TContext = unknown>(params: T.MlGetModelSnapshotsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlGetModelSnapshotsResponse, TContext>>
getOverallBuckets<TContext = unknown>(params: T.MlGetOverallBucketsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlGetOverallBucketsResponse, TContext>>
getRecords<TContext = unknown>(params: T.MlGetRecordsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlGetRecordsResponse, TContext>>
@ -370,7 +369,7 @@ interface KibanaClient {
stopDataFrameAnalytics<TContext = unknown>(params: T.MlStopDataFrameAnalyticsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlStopDataFrameAnalyticsResponse, TContext>>
stopDatafeed<TContext = unknown>(params: T.MlStopDatafeedRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlStopDatafeedResponse, TContext>>
updateDataFrameAnalytics<TContext = unknown>(params: T.MlUpdateDataFrameAnalyticsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlUpdateDataFrameAnalyticsResponse, TContext>>
updateDatafeed<TContext = unknown>(params: T.MlUpdateDatafeedRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlUpdateDatafeedResponse, TContext>>
updateDatafeed<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
updateFilter<TContext = unknown>(params: T.MlUpdateFilterRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlUpdateFilterResponse, TContext>>
updateJob<TContext = unknown>(params: T.MlUpdateJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlUpdateJobResponse, TContext>>
updateModelSnapshot<TContext = unknown>(params: T.MlUpdateModelSnapshotRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlUpdateModelSnapshotResponse, TContext>>
@ -379,7 +378,7 @@ interface KibanaClient {
validateDetector<TContext = unknown>(params?: T.MlValidateDetectorRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlValidateDetectorResponse, TContext>>
}
monitoring: {
bulk<TDocument = unknown, TPartialDocument = unknown, TContext = unknown>(params: T.MonitoringBulkRequest<TDocument, TPartialDocument>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MonitoringBulkResponse, TContext>>
bulk<TSource = unknown, TContext = unknown>(params: T.MonitoringBulkRequest<TSource>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MonitoringBulkResponse, TContext>>
}
msearch<TDocument = unknown, TContext = unknown>(params?: T.MsearchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MsearchResponse<TDocument>, TContext>>
msearchTemplate<TDocument = unknown, TContext = unknown>(params?: T.MsearchTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MsearchTemplateResponse<TDocument>, TContext>>
@ -418,7 +417,7 @@ interface KibanaClient {
searchShards<TContext = unknown>(params?: T.SearchShardsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SearchShardsResponse, TContext>>
searchTemplate<TDocument = unknown, TContext = unknown>(params?: T.SearchTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SearchTemplateResponse<TDocument>, TContext>>
searchableSnapshots: {
cacheStats<TContext = unknown>(params?: T.SearchableSnapshotsCacheStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SearchableSnapshotsCacheStatsResponse, TContext>>
cacheStats<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
clearCache<TContext = unknown>(params?: T.SearchableSnapshotsClearCacheRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SearchableSnapshotsClearCacheResponse, TContext>>
mount<TContext = unknown>(params: T.SearchableSnapshotsMountRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SearchableSnapshotsMountResponse, TContext>>
repositoryStats<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
@ -527,7 +526,7 @@ interface KibanaClient {
startTransform<TContext = unknown>(params: T.TransformStartTransformRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.TransformStartTransformResponse, TContext>>
stopTransform<TContext = unknown>(params: T.TransformStopTransformRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.TransformStopTransformResponse, TContext>>
updateTransform<TContext = unknown>(params: T.TransformUpdateTransformRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.TransformUpdateTransformResponse, TContext>>
upgradeTransforms<TContext = unknown>(params?: T.TransformUpgradeTransformsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.TransformUpgradeTransformsResponse, TContext>>
upgradeTransforms<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
}
update<TDocumentR = unknown, TDocument = unknown, TPartialDocument = unknown, TContext = unknown>(params: T.UpdateRequest<TDocument, TPartialDocument>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.UpdateResponse<TDocumentR>, TContext>>
updateByQuery<TContext = unknown>(params: T.UpdateByQueryRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.UpdateByQueryResponse, TContext>>

54
api/new.d.ts vendored
View File

@ -117,9 +117,9 @@ declare class Client {
putAutoscalingPolicy<TContext = unknown>(params: T.AutoscalingPutAutoscalingPolicyRequest, callback: callbackFn<T.AutoscalingPutAutoscalingPolicyResponse, TContext>): TransportRequestCallback
putAutoscalingPolicy<TContext = unknown>(params: T.AutoscalingPutAutoscalingPolicyRequest, options: TransportRequestOptions, callback: callbackFn<T.AutoscalingPutAutoscalingPolicyResponse, TContext>): TransportRequestCallback
}
bulk<TDocument = unknown, TPartialDocument = unknown, TContext = unknown>(params: T.BulkRequest<TDocument, TPartialDocument>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.BulkResponse, TContext>>
bulk<TDocument = unknown, TPartialDocument = unknown, TContext = unknown>(params: T.BulkRequest<TDocument, TPartialDocument>, callback: callbackFn<T.BulkResponse, TContext>): TransportRequestCallback
bulk<TDocument = unknown, TPartialDocument = unknown, TContext = unknown>(params: T.BulkRequest<TDocument, TPartialDocument>, options: TransportRequestOptions, callback: callbackFn<T.BulkResponse, TContext>): TransportRequestCallback
bulk<TSource = unknown, TContext = unknown>(params: T.BulkRequest<TSource>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.BulkResponse, TContext>>
bulk<TSource = unknown, TContext = unknown>(params: T.BulkRequest<TSource>, callback: callbackFn<T.BulkResponse, TContext>): TransportRequestCallback
bulk<TSource = unknown, TContext = unknown>(params: T.BulkRequest<TSource>, options: TransportRequestOptions, callback: callbackFn<T.BulkResponse, TContext>): TransportRequestCallback
cat: {
aliases<TContext = unknown>(params?: T.CatAliasesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatAliasesResponse, TContext>>
aliases<TContext = unknown>(callback: callbackFn<T.CatAliasesResponse, TContext>): TransportRequestCallback
@ -454,9 +454,10 @@ declare class Client {
fieldCaps<TContext = unknown>(params: T.FieldCapsRequest, callback: callbackFn<T.FieldCapsResponse, TContext>): TransportRequestCallback
fieldCaps<TContext = unknown>(params: T.FieldCapsRequest, options: TransportRequestOptions, callback: callbackFn<T.FieldCapsResponse, TContext>): TransportRequestCallback
fleet: {
globalCheckpoints<TContext = unknown>(params: T.FleetGlobalCheckpointsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.FleetGlobalCheckpointsResponse, TContext>>
globalCheckpoints<TContext = unknown>(params: T.FleetGlobalCheckpointsRequest, callback: callbackFn<T.FleetGlobalCheckpointsResponse, TContext>): TransportRequestCallback
globalCheckpoints<TContext = unknown>(params: T.FleetGlobalCheckpointsRequest, options: TransportRequestOptions, callback: callbackFn<T.FleetGlobalCheckpointsResponse, TContext>): TransportRequestCallback
globalCheckpoints<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
globalCheckpoints<TContext = unknown>(callback: callbackFn<TODO, TContext>): TransportRequestCallback
globalCheckpoints<TContext = unknown>(params: TODO, callback: callbackFn<TODO, TContext>): TransportRequestCallback
globalCheckpoints<TContext = unknown>(params: TODO, options: TransportRequestOptions, callback: callbackFn<TODO, TContext>): TransportRequestCallback
msearch<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
msearch<TContext = unknown>(callback: callbackFn<TODO, TContext>): TransportRequestCallback
msearch<TContext = unknown>(params: TODO, callback: callbackFn<TODO, TContext>): TransportRequestCallback
@ -503,10 +504,10 @@ declare class Client {
getStatus<TContext = unknown>(callback: callbackFn<T.IlmGetStatusResponse, TContext>): TransportRequestCallback
getStatus<TContext = unknown>(params: T.IlmGetStatusRequest, callback: callbackFn<T.IlmGetStatusResponse, TContext>): TransportRequestCallback
getStatus<TContext = unknown>(params: T.IlmGetStatusRequest, options: TransportRequestOptions, callback: callbackFn<T.IlmGetStatusResponse, TContext>): TransportRequestCallback
migrateToDataTiers<TContext = unknown>(params?: T.IlmMigrateToDataTiersRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IlmMigrateToDataTiersResponse, TContext>>
migrateToDataTiers<TContext = unknown>(callback: callbackFn<T.IlmMigrateToDataTiersResponse, TContext>): TransportRequestCallback
migrateToDataTiers<TContext = unknown>(params: T.IlmMigrateToDataTiersRequest, callback: callbackFn<T.IlmMigrateToDataTiersResponse, TContext>): TransportRequestCallback
migrateToDataTiers<TContext = unknown>(params: T.IlmMigrateToDataTiersRequest, options: TransportRequestOptions, callback: callbackFn<T.IlmMigrateToDataTiersResponse, TContext>): TransportRequestCallback
migrateToDataTiers<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
migrateToDataTiers<TContext = unknown>(callback: callbackFn<TODO, TContext>): TransportRequestCallback
migrateToDataTiers<TContext = unknown>(params: TODO, callback: callbackFn<TODO, TContext>): TransportRequestCallback
migrateToDataTiers<TContext = unknown>(params: TODO, options: TransportRequestOptions, callback: callbackFn<TODO, TContext>): TransportRequestCallback
moveToStep<TContext = unknown>(params: T.IlmMoveToStepRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IlmMoveToStepResponse, TContext>>
moveToStep<TContext = unknown>(params: T.IlmMoveToStepRequest, callback: callbackFn<T.IlmMoveToStepResponse, TContext>): TransportRequestCallback
moveToStep<TContext = unknown>(params: T.IlmMoveToStepRequest, options: TransportRequestOptions, callback: callbackFn<T.IlmMoveToStepResponse, TContext>): TransportRequestCallback
@ -926,10 +927,6 @@ declare class Client {
getJobs<TContext = unknown>(callback: callbackFn<T.MlGetJobsResponse, TContext>): TransportRequestCallback
getJobs<TContext = unknown>(params: T.MlGetJobsRequest, callback: callbackFn<T.MlGetJobsResponse, TContext>): TransportRequestCallback
getJobs<TContext = unknown>(params: T.MlGetJobsRequest, options: TransportRequestOptions, callback: callbackFn<T.MlGetJobsResponse, TContext>): TransportRequestCallback
getModelSnapshotUpgradeStats<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
getModelSnapshotUpgradeStats<TContext = unknown>(callback: callbackFn<TODO, TContext>): TransportRequestCallback
getModelSnapshotUpgradeStats<TContext = unknown>(params: TODO, callback: callbackFn<TODO, TContext>): TransportRequestCallback
getModelSnapshotUpgradeStats<TContext = unknown>(params: TODO, options: TransportRequestOptions, callback: callbackFn<TODO, TContext>): TransportRequestCallback
getModelSnapshots<TContext = unknown>(params: T.MlGetModelSnapshotsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlGetModelSnapshotsResponse, TContext>>
getModelSnapshots<TContext = unknown>(params: T.MlGetModelSnapshotsRequest, callback: callbackFn<T.MlGetModelSnapshotsResponse, TContext>): TransportRequestCallback
getModelSnapshots<TContext = unknown>(params: T.MlGetModelSnapshotsRequest, options: TransportRequestOptions, callback: callbackFn<T.MlGetModelSnapshotsResponse, TContext>): TransportRequestCallback
@ -1017,9 +1014,10 @@ declare class Client {
updateDataFrameAnalytics<TContext = unknown>(params: T.MlUpdateDataFrameAnalyticsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlUpdateDataFrameAnalyticsResponse, TContext>>
updateDataFrameAnalytics<TContext = unknown>(params: T.MlUpdateDataFrameAnalyticsRequest, callback: callbackFn<T.MlUpdateDataFrameAnalyticsResponse, TContext>): TransportRequestCallback
updateDataFrameAnalytics<TContext = unknown>(params: T.MlUpdateDataFrameAnalyticsRequest, options: TransportRequestOptions, callback: callbackFn<T.MlUpdateDataFrameAnalyticsResponse, TContext>): TransportRequestCallback
updateDatafeed<TContext = unknown>(params: T.MlUpdateDatafeedRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlUpdateDatafeedResponse, TContext>>
updateDatafeed<TContext = unknown>(params: T.MlUpdateDatafeedRequest, callback: callbackFn<T.MlUpdateDatafeedResponse, TContext>): TransportRequestCallback
updateDatafeed<TContext = unknown>(params: T.MlUpdateDatafeedRequest, options: TransportRequestOptions, callback: callbackFn<T.MlUpdateDatafeedResponse, TContext>): TransportRequestCallback
updateDatafeed<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
updateDatafeed<TContext = unknown>(callback: callbackFn<TODO, TContext>): TransportRequestCallback
updateDatafeed<TContext = unknown>(params: TODO, callback: callbackFn<TODO, TContext>): TransportRequestCallback
updateDatafeed<TContext = unknown>(params: TODO, options: TransportRequestOptions, callback: callbackFn<TODO, TContext>): TransportRequestCallback
updateFilter<TContext = unknown>(params: T.MlUpdateFilterRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MlUpdateFilterResponse, TContext>>
updateFilter<TContext = unknown>(params: T.MlUpdateFilterRequest, callback: callbackFn<T.MlUpdateFilterResponse, TContext>): TransportRequestCallback
updateFilter<TContext = unknown>(params: T.MlUpdateFilterRequest, options: TransportRequestOptions, callback: callbackFn<T.MlUpdateFilterResponse, TContext>): TransportRequestCallback
@ -1042,9 +1040,9 @@ declare class Client {
validateDetector<TContext = unknown>(params: T.MlValidateDetectorRequest, options: TransportRequestOptions, callback: callbackFn<T.MlValidateDetectorResponse, TContext>): TransportRequestCallback
}
monitoring: {
bulk<TDocument = unknown, TPartialDocument = unknown, TContext = unknown>(params: T.MonitoringBulkRequest<TDocument, TPartialDocument>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MonitoringBulkResponse, TContext>>
bulk<TDocument = unknown, TPartialDocument = unknown, TContext = unknown>(params: T.MonitoringBulkRequest<TDocument, TPartialDocument>, callback: callbackFn<T.MonitoringBulkResponse, TContext>): TransportRequestCallback
bulk<TDocument = unknown, TPartialDocument = unknown, TContext = unknown>(params: T.MonitoringBulkRequest<TDocument, TPartialDocument>, options: TransportRequestOptions, callback: callbackFn<T.MonitoringBulkResponse, TContext>): TransportRequestCallback
bulk<TSource = unknown, TContext = unknown>(params: T.MonitoringBulkRequest<TSource>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MonitoringBulkResponse, TContext>>
bulk<TSource = unknown, TContext = unknown>(params: T.MonitoringBulkRequest<TSource>, callback: callbackFn<T.MonitoringBulkResponse, TContext>): TransportRequestCallback
bulk<TSource = unknown, TContext = unknown>(params: T.MonitoringBulkRequest<TSource>, options: TransportRequestOptions, callback: callbackFn<T.MonitoringBulkResponse, TContext>): TransportRequestCallback
}
msearch<TDocument = unknown, TContext = unknown>(params?: T.MsearchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MsearchResponse<TDocument>, TContext>>
msearch<TDocument = unknown, TContext = unknown>(callback: callbackFn<T.MsearchResponse<TDocument>, TContext>): TransportRequestCallback
@ -1167,10 +1165,10 @@ declare class Client {
searchTemplate<TDocument = unknown, TContext = unknown>(params: T.SearchTemplateRequest, callback: callbackFn<T.SearchTemplateResponse<TDocument>, TContext>): TransportRequestCallback
searchTemplate<TDocument = unknown, TContext = unknown>(params: T.SearchTemplateRequest, options: TransportRequestOptions, callback: callbackFn<T.SearchTemplateResponse<TDocument>, TContext>): TransportRequestCallback
searchableSnapshots: {
cacheStats<TContext = unknown>(params?: T.SearchableSnapshotsCacheStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SearchableSnapshotsCacheStatsResponse, TContext>>
cacheStats<TContext = unknown>(callback: callbackFn<T.SearchableSnapshotsCacheStatsResponse, TContext>): TransportRequestCallback
cacheStats<TContext = unknown>(params: T.SearchableSnapshotsCacheStatsRequest, callback: callbackFn<T.SearchableSnapshotsCacheStatsResponse, TContext>): TransportRequestCallback
cacheStats<TContext = unknown>(params: T.SearchableSnapshotsCacheStatsRequest, options: TransportRequestOptions, callback: callbackFn<T.SearchableSnapshotsCacheStatsResponse, TContext>): TransportRequestCallback
cacheStats<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
cacheStats<TContext = unknown>(callback: callbackFn<TODO, TContext>): TransportRequestCallback
cacheStats<TContext = unknown>(params: TODO, callback: callbackFn<TODO, TContext>): TransportRequestCallback
cacheStats<TContext = unknown>(params: TODO, options: TransportRequestOptions, callback: callbackFn<TODO, TContext>): TransportRequestCallback
clearCache<TContext = unknown>(params?: T.SearchableSnapshotsClearCacheRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SearchableSnapshotsClearCacheResponse, TContext>>
clearCache<TContext = unknown>(callback: callbackFn<T.SearchableSnapshotsClearCacheResponse, TContext>): TransportRequestCallback
clearCache<TContext = unknown>(params: T.SearchableSnapshotsClearCacheRequest, callback: callbackFn<T.SearchableSnapshotsClearCacheResponse, TContext>): TransportRequestCallback
@ -1507,10 +1505,10 @@ declare class Client {
updateTransform<TContext = unknown>(params: T.TransformUpdateTransformRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.TransformUpdateTransformResponse, TContext>>
updateTransform<TContext = unknown>(params: T.TransformUpdateTransformRequest, callback: callbackFn<T.TransformUpdateTransformResponse, TContext>): TransportRequestCallback
updateTransform<TContext = unknown>(params: T.TransformUpdateTransformRequest, options: TransportRequestOptions, callback: callbackFn<T.TransformUpdateTransformResponse, TContext>): TransportRequestCallback
upgradeTransforms<TContext = unknown>(params?: T.TransformUpgradeTransformsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.TransformUpgradeTransformsResponse, TContext>>
upgradeTransforms<TContext = unknown>(callback: callbackFn<T.TransformUpgradeTransformsResponse, TContext>): TransportRequestCallback
upgradeTransforms<TContext = unknown>(params: T.TransformUpgradeTransformsRequest, callback: callbackFn<T.TransformUpgradeTransformsResponse, TContext>): TransportRequestCallback
upgradeTransforms<TContext = unknown>(params: T.TransformUpgradeTransformsRequest, options: TransportRequestOptions, callback: callbackFn<T.TransformUpgradeTransformsResponse, TContext>): TransportRequestCallback
upgradeTransforms<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
upgradeTransforms<TContext = unknown>(callback: callbackFn<TODO, TContext>): TransportRequestCallback
upgradeTransforms<TContext = unknown>(params: TODO, callback: callbackFn<TODO, TContext>): TransportRequestCallback
upgradeTransforms<TContext = unknown>(params: TODO, options: TransportRequestOptions, callback: callbackFn<TODO, TContext>): TransportRequestCallback
}
update<TDocumentR = unknown, TDocument = unknown, TPartialDocument = unknown, TContext = unknown>(params: T.UpdateRequest<TDocument, TPartialDocument>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.UpdateResponse<TDocumentR>, TContext>>
update<TDocumentR = unknown, TDocument = unknown, TPartialDocument = unknown, TContext = unknown>(params: T.UpdateRequest<TDocument, TPartialDocument>, callback: callbackFn<T.UpdateResponse<TDocumentR>, TContext>): TransportRequestCallback

View File

@ -1767,12 +1767,6 @@ export interface MlGetJobs extends Generic {
exclude_generated?: boolean;
}
export interface MlGetModelSnapshotUpgradeStats extends Generic {
job_id: string;
snapshot_id: string;
allow_no_match?: boolean;
}
export interface MlGetModelSnapshots<T = RequestBody> extends Generic {
job_id: string;
snapshot_id?: string;
@ -2628,13 +2622,6 @@ export interface SnapshotGet extends Generic {
ignore_unavailable?: boolean;
index_details?: boolean;
include_repository?: boolean;
sort?: 'start_time' | 'duration' | 'name' | 'repository' | 'index_count' | 'shard_count' | 'failed_shard_count';
size?: number;
order?: 'asc' | 'desc';
from_sort_value?: string;
after?: string;
offset?: number;
slm_policy_filter?: string;
verbose?: boolean;
}

2937
api/types.d.ts vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,77 +1,6 @@
[[changelog-client]]
== Release notes
[discrete]
=== 7.17.14
[discrete]
==== Fixes
Stops retrying timed-out requests by default.
Re-enabling the old behavior can be done by providing a `retryOnTimeout` option when instantiating the client.
https://github.com/elastic/elasticsearch-js/pull/2293[#2293]
[discrete]
=== 7.17.13
[discrete]
==== Fixes
Fixes a bug where newly-added nodes that don't have HTTP information yet should be skipped during sniffing, to prevent an unexpected `TypeError`. https://github.com/elastic/elasticsearch-js/issues/1230[#1230]
[discrete]
=== 7.17.12
[discrete]
==== Notes
This is the first 7.x release where patch versions of the client will no longer (intentionally) align with patch versions of Elasticsearch. The latest patch release of the client will always be compatible with the corresponding minor release of Elasticsearch.
[discrete]
==== Fixes
[discrete]
===== TypeScript build failure
Fixes a type declaration bug that caused TypeScript builds to fail. https://github.com/elastic/elasticsearch-js/pull/1927[#1927]
[discrete]
===== Add TypeScript type declarations to exports
Adds TypeScript type declarations file to package.json `exports` https://github.com/elastic/elasticsearch-js/pull/1930[#1930]
[discrete]
=== 7.17.11
[discrete]
==== Features
[discrete]
===== Support for Elasticsearch `v7.17.11`
You can find all the API changes
https://www.elastic.co/guide/en/elasticsearch/reference/7.17/release-notes-7.17.11.html[here].
[discrete]
==== Fixes
[discrete]
===== Fix index drift bug in bulk helper https://github.com/elastic/elasticsearch-js/pull/1759[#1759]
Fixes a bug in the bulk helper that would cause `onDrop` to send back the wrong JSON document or error on a nonexistent document when an error occurred on a bulk HTTP request that contained a `delete` action.
[discrete]
=== 7.17.0
[discrete]
==== Features
[discrete]
===== Support for Elasticsearch `v7.17`
You can find all the API changes
https://www.elastic.co/guide/en/elasticsearch/reference/7.17/release-notes-7.17.0.html[here].
[discrete]
=== 7.16.0
@ -93,6 +22,7 @@ https://www.elastic.co/guide/en/elasticsearch/reference/7.16/release-notes-7.16.
[discrete]
===== Fixed export field deprecation log https://github.com/elastic/elasticsearch-js/pull/1593#[#1593]
[discrete]
=== 7.15.0
@ -108,7 +38,7 @@ https://www.elastic.co/guide/en/elasticsearch/reference/7.15/release-notes-7.15.
[discrete]
===== Support mapbox content type https://github.com/elastic/elasticsearch-js/pull/1500[#1500]
If you call an API that returns a mapbox content type, the response body will be a buffer.
If you call an API that returns a mapbox conten type, the response body will be a buffer.
[discrete]
===== Support CA fingerprint validation https://github.com/elastic/elasticsearch-js/pull/1499[#1499]

View File

@ -96,7 +96,7 @@ const b = client.helpers.bulk({
----
|`flushBytes`
a|The size of the bulk body in bytes to reach before to send it. Default of 5MB. +
a|The size of the bulk body in bytes to reach before sending it. Default of 5MB. +
_Default:_ `5000000`
[source,js]
----
@ -576,4 +576,4 @@ const scrollSearch = client.helpers.scrollDocuments({
for await (const doc of scrollSearch) {
console.log(doc)
}
----
----

View File

@ -377,9 +377,9 @@ child.search({
To improve observability, the client offers an easy way to configure the
`X-Opaque-Id` header. If you set the `X-Opaque-Id` in a specific request, this
allows you to discover this identifier in the
https://www.elastic.co/guide/en/elasticsearch/reference/7.17/logging.html#deprecation-logging[deprecation logs],
helps you with https://www.elastic.co/guide/en/elasticsearch/reference/7.17/index-modules-slowlog.html#_identifying_search_slow_log_origin[identifying search slow log origin]
as well as https://www.elastic.co/guide/en/elasticsearch/reference/7.17/tasks.html#_identifying_running_tasks[identifying running tasks].
https://www.elastic.co/guide/en/elasticsearch/reference/7.16/logging.html#deprecation-logging[deprecation logs],
helps you with https://www.elastic.co/guide/en/elasticsearch/reference/7.16/index-modules-slowlog.html#_identifying_search_slow_log_origin[identifying search slow log origin]
as well as https://www.elastic.co/guide/en/elasticsearch/reference/7.16/tasks.html#_identifying_running_tasks[identifying running tasks].
The `X-Opaque-Id` should be configured in each request, for doing that you can
use the `opaqueId` option, as you can see in the following example. The

View File

@ -3510,7 +3510,7 @@ link:{ref}/modules-scripting.html[Documentation] +
----
client.getScriptContext()
----
link:{painless}/painless-contexts.html[Documentation] +
link:https://www.elastic.co/guide/en/elasticsearch/painless/7.16/painless-contexts.html[Documentation] +
[discrete]
@ -7286,31 +7286,6 @@ WARNING: This parameter has been deprecated.
|===
[discrete]
=== ml.getModelSnapshotUpgradeStats
[source,ts]
----
client.ml.getModelSnapshotUpgradeStats({
job_id: string,
snapshot_id: string,
allow_no_match: boolean
})
----
link:{ref}/ml-get-job-model-snapshot-upgrade-stats.html[Documentation] +
[cols=2*]
|===
|`job_id` or `jobId`
|`string` - The ID of the job. May be a wildcard, comma separated list or `_all`.
|`snapshot_id` or `snapshotId`
|`string` - The ID of the snapshot. May be a wildcard, comma separated list or `_all`.
|`allow_no_match` or `allowNoMatch`
|`boolean` - Whether to ignore if a wildcard expression matches no jobs or no snapshots. (This includes the `_all` string.)
|===
[discrete]
=== ml.getModelSnapshots
@ -9127,7 +9102,7 @@ client.scriptsPainlessExecute({
body: object
})
----
link:{painless}/painless-execute-api.html[Documentation] +
link:https://www.elastic.co/guide/en/elasticsearch/painless/7.16/painless-execute-api.html[Documentation] +
[cols=2*]
|===
|`body`
@ -10860,13 +10835,6 @@ client.snapshot.get({
ignore_unavailable: boolean,
index_details: boolean,
include_repository: boolean,
sort: 'start_time' | 'duration' | 'name' | 'repository' | 'index_count' | 'shard_count' | 'failed_shard_count',
size: integer,
order: 'asc' | 'desc',
from_sort_value: string,
after: string,
offset: integer,
slm_policy_filter: string,
verbose: boolean
})
----
@ -10891,29 +10859,6 @@ link:{ref}/modules-snapshots.html[Documentation] +
|`include_repository` or `includeRepository`
|`boolean` - Whether to include the repository name in the snapshot info. Defaults to true.
|`sort`
|`'start_time' \| 'duration' \| 'name' \| 'repository' \| 'index_count' \| 'shard_count' \| 'failed_shard_count'` - Allows setting a sort order for the result. Defaults to start_time +
_Default:_ `start_time`
|`size`
|`integer` - Maximum number of snapshots to return. Defaults to 0 which means return all that match without limit.
|`order`
|`'asc' \| 'desc'` - Sort order +
_Default:_ `asc`
|`from_sort_value` or `fromSortValue`
|`string` - Value of the current sort column at which to start retrieval.
|`after`
|`string` - Offset identifier to start pagination from as returned by the 'next' field in the response body.
|`offset`
|`integer` - Numeric offset to start pagination based on the snapshots matching the request. Defaults to 0
|`slm_policy_filter` or `slmPolicyFilter`
|`string` - Filter snapshots by a comma-separated list of SLM policy names that snapshots belong to. Accepts wildcards. Use the special pattern '_none' to match snapshots without an SLM policy
|`verbose`
|`boolean` - Whether to show verbose snapshot info or only show the basic info found in the repository index blob

8
index.d.ts vendored
View File

@ -1672,14 +1672,6 @@ declare class Client {
getJobs<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
getJobs<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlGetJobs, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
getJobs<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlGetJobs, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get_model_snapshot_upgrade_stats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlGetModelSnapshotUpgradeStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
get_model_snapshot_upgrade_stats<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get_model_snapshot_upgrade_stats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlGetModelSnapshotUpgradeStats, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get_model_snapshot_upgrade_stats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlGetModelSnapshotUpgradeStats, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
getModelSnapshotUpgradeStats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlGetModelSnapshotUpgradeStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
getModelSnapshotUpgradeStats<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
getModelSnapshotUpgradeStats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlGetModelSnapshotUpgradeStats, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
getModelSnapshotUpgradeStats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlGetModelSnapshotUpgradeStats, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get_model_snapshots<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlGetModelSnapshots<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
get_model_snapshots<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get_model_snapshots<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlGetModelSnapshots<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback

View File

@ -120,15 +120,15 @@ class Client extends ESAPI {
maxCompressedResponseSize: null
}, opts)
if (options.maxResponseSize != null && options.maxResponseSize > buffer.constants.MAX_STRING_LENGTH) {
if (options.maxResponseSize !== null && options.maxResponseSize > buffer.constants.MAX_STRING_LENGTH) {
throw new ConfigurationError(`The maxResponseSize cannot be bigger than ${buffer.constants.MAX_STRING_LENGTH}`)
}
if (options.maxCompressedResponseSize != null && options.maxCompressedResponseSize > buffer.constants.MAX_LENGTH) {
if (options.maxCompressedResponseSize !== null && options.maxCompressedResponseSize > buffer.constants.MAX_LENGTH) {
throw new ConfigurationError(`The maxCompressedResponseSize cannot be bigger than ${buffer.constants.MAX_LENGTH}`)
}
if (options.caFingerprint != null && isHttpConnection(opts.node || opts.nodes)) {
if (options.caFingerprint !== null && isHttpConnection(opts.node || opts.nodes)) {
throw new ConfigurationError('You can\'t configure the caFingerprint with a http connection')
}

View File

@ -705,11 +705,11 @@ class Helpers {
}
const retry = []
const { items } = body
let indexSlice = 0
for (let i = 0, len = items.length; i < len; i++) {
const action = items[i]
const operation = Object.keys(action)[0]
const { status } = action[operation]
const indexSlice = operation !== 'delete' ? i * 2 : i
if (status >= 400) {
// 429 is the only staus code where we might want to retry
@ -736,7 +736,6 @@ class Helpers {
} else {
stats.successful += 1
}
operation === 'delete' ? indexSlice += 1 : indexSlice += 2
}
callback(null, retry)
})

1
lib/Transport.d.ts vendored
View File

@ -49,7 +49,6 @@ interface TransportOptions {
serializer: Serializer;
maxRetries: number;
requestTimeout: number | string;
retryOnTimeout?: boolean;
suggestCompression?: boolean;
compression?: 'gzip';
sniffInterval?: number;

View File

@ -57,7 +57,6 @@ class Transport {
this.serializer = opts.serializer
this.maxRetries = opts.maxRetries
this.requestTimeout = toMs(opts.requestTimeout)
this.retryOnTimeout = opts.retryOnTimeout != null ? opts.retryOnTimeout : false
this.suggestCompression = opts.suggestCompression === true
this.compression = opts.compression || false
this.context = opts.context || null
@ -221,13 +220,6 @@ class Transport {
})
}
// do not retry timeout errors by default
if (err.name === 'TimeoutError' && this.retryOnTimeout !== true) {
err.meta = result
this.emit('response', err, result)
return callback(err, result)
}
// retry logic
if (meta.attempts < maxRetries) {
meta.attempts++

View File

@ -206,10 +206,6 @@ class BaseConnectionPool {
for (let i = 0, len = ids.length; i < len; i++) {
const node = nodes[ids[i]]
// newly-added nodes do not have http assigned yet, so skip
if (node.http === undefined) continue
// If there is no protocol in
// the `publish_address` new URL will throw
// the publish_address can have two forms:

View File

@ -6,14 +6,13 @@
"exports": {
".": {
"require": "./index.js",
"import": "./index.mjs",
"types": "./index.d.ts"
"import": "./index.mjs"
},
"./*": "./*.js"
},
"homepage": "http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html",
"version": "7.17.14",
"versionCanary": "7.17.14-canary.0",
"version": "7.16.0",
"versionCanary": "7.16.0-canary.7",
"keywords": [
"elasticsearch",
"elastic",
@ -54,7 +53,6 @@
"cross-zip": "^4.0.0",
"dedent": "^0.7.0",
"deepmerge": "^4.2.2",
"desm": "^1.2.0",
"dezalgo": "^1.0.3",
"fast-deep-equal": "^3.1.3",
"into-stream": "^6.0.0",
@ -75,8 +73,7 @@
"tap": "^15.0.9",
"tsd": "^0.15.1",
"workq": "^3.0.0",
"xmlbuilder2": "^2.4.1",
"zx": "^6.1.0"
"xmlbuilder2": "^2.4.1"
},
"dependencies": {
"debug": "^4.3.1",

View File

@ -282,7 +282,6 @@ function fixLink (name, str) {
str = str.replace(/frozen\.html/, 'freeze-index-api.html')
str = str.replace(/ml-file-structure\.html/, 'ml-find-file-structure.html')
str = str.replace(/security-api-get-user-privileges\.html/, 'security-api-get-privileges.html')
str = str.replace(/^.+guide\/en\/elasticsearch\/painless\/[^/]+\/([^./]*\.html(?:#.+)?)$/, '{painless}/$1')
return str
}

View File

@ -169,7 +169,6 @@ export interface ${toPascalCase(name)}${body ? `<T = ${bodyGeneric}>` : ''} exte
case 'int':
case 'double':
case 'long':
case 'integer':
return 'number'
case 'boolean|long':
return 'boolean | number'

View File

@ -88,8 +88,7 @@ test('Connection error', t => {
const client = new Client({
node: 'http://localhost:9200',
Connection: MockConnectionError,
maxRetries: 1,
retryOnTimeout: true
maxRetries: 1
})
const order = [
@ -125,18 +124,18 @@ test('Connection error', t => {
})
test('TimeoutError error', t => {
t.plan(8)
t.plan(10)
const client = new Client({
node: 'http://localhost:9200',
Connection: MockConnectionTimeout,
maxRetries: 1,
retryOnTimeout: true
maxRetries: 1
})
const order = [
events.SERIALIZATION,
events.REQUEST,
events.REQUEST,
events.RESPONSE
]
@ -171,8 +170,7 @@ test('RequestAbortedError error', t => {
const client = new Client({
node: 'http://localhost:9200',
Connection: MockConnectionTimeout,
maxRetries: 1,
retryOnTimeout: true
maxRetries: 1
})
const order = [
@ -223,8 +221,7 @@ test('ResponseError error (no retry)', t => {
const client = new Client({
node: 'http://localhost:9200',
Connection: MockConnection,
maxRetries: 1,
retryOnTimeout: true
maxRetries: 1
})
const order = [
@ -376,8 +373,7 @@ test('Deserialization Error', t => {
const client = new Client({
node: 'http://localhost:9200',
Connection: MockConnection,
maxRetries: 1,
retryOnTimeout: true
maxRetries: 1
})
const order = [
@ -427,11 +423,7 @@ test('Socket destroyed while reading the body', t => {
}
buildServer(handler, ({ port }, server) => {
const client = new Client({
node: `http://localhost:${port}`,
maxRetries: 1,
retryOnTimeout: true
})
const client = new Client({ node: `http://localhost:${port}`, maxRetries: 1 })
const order = [
events.SERIALIZATION,

View File

@ -680,8 +680,7 @@ test('TimeoutError', t => {
const client = new Client({
node: 'http://localhost:9200',
Connection: MockConnectionTimeout,
maxRetries: 0,
retryOnTimeout: true
maxRetries: 0
})
client.on('request', (err, event) => {

View File

@ -313,36 +313,6 @@ test('API', t => {
t.end()
})
t.test('Should skip nodes that do not have an http property yet', t => {
const pool = new BaseConnectionPool({ Connection })
const nodes = {
a1: {
http: {
publish_address: '127.0.0.1:9200'
},
roles: ['master', 'data', 'ingest']
},
a2: {
roles: ['master', 'data', 'ingest']
}
}
t.same(pool.nodesToHost(nodes, 'http:'), [{
url: new URL('http://127.0.0.1:9200'),
id: 'a1',
roles: {
master: true,
data: true,
ingest: true,
ml: false
}
}])
t.equal(pool.nodesToHost(nodes, 'http:').length, 1)
t.equal(pool.nodesToHost(nodes, 'http:')[0].url.host, '127.0.0.1:9200')
t.end()
})
t.end()
})

View File

@ -232,7 +232,7 @@ test('Authentication', t => {
server.stop()
})
})
}, { skip: true })
})
t.test('Node with basic auth data in the url (array of nodes)', t => {
t.plan(3)
@ -1176,7 +1176,7 @@ test('Disable keep alive agent', t => {
server.stop()
})
})
}, { skip: true })
})
test('name property as string', t => {
t.plan(1)

View File

@ -237,7 +237,7 @@ test('Disable keep alive', t => {
server.stop()
})
})
}, { skip: true })
})
test('Timeout support', t => {
t.plan(1)
@ -1101,7 +1101,7 @@ test('Should show local/remote socket address in case of ECONNRESET', t => {
method: 'GET'
}, (err, res) => {
t.ok(err instanceof ConnectionError)
t.match(err.message, /socket\shang\sup\s-\sLocal:\s(127.0.0.1|::1):\d+,\sRemote:\s(127.0.0.1|::1):\d+/)
t.match(err.message, /socket\shang\sup\s-\sLocal:\s127.0.0.1:\d+,\sRemote:\s127.0.0.1:\d+/)
server.stop()
})
})

View File

@ -1082,70 +1082,6 @@ test('bulk delete', t => {
server.stop()
})
t.test('Should call onDrop on the correct document when doing a mix of operations that includes deletes', async t => {
// checks to ensure onDrop doesn't provide the wrong document when some operations are deletes
// see https://github.com/elastic/elasticsearch-js/issues/1751
async function handler (req, res) {
res.setHeader('content-type', 'application/json')
res.end(JSON.stringify({
took: 0,
errors: true,
items: [
{ delete: { status: 200 } },
{ index: { status: 429 } },
{ index: { status: 200 } }
]
}))
}
const [{ port }, server] = await buildServer(handler)
const client = new Client({ node: `http://localhost:${port}` })
let counter = 0
const result = await client.helpers.bulk({
datasource: dataset.slice(),
concurrency: 1,
wait: 10,
retries: 0,
onDocument (doc) {
counter++
if (counter === 1) {
return {
delete: {
_index: 'test',
_id: String(counter)
}
}
} else {
return {
index: {
_index: 'test'
}
}
}
},
onDrop (doc) {
t.same(doc, {
status: 429,
error: null,
operation: { index: { _index: 'test' } },
document: { user: 'arya', age: 18 },
retried: false
})
}
})
t.type(result.time, 'number')
t.type(result.bytes, 'number')
t.match(result, {
total: 3,
successful: 2,
retry: 0,
failed: 1,
aborted: false
})
server.stop()
})
t.end()
})

View File

@ -1025,7 +1025,6 @@ test('Retry mechanism and abort', t => {
serializer: new Serializer(),
maxRetries: 2,
requestTimeout: 100,
retryOnTimeout: true,
sniffInterval: false,
sniffOnStart: false
})
@ -2204,7 +2203,6 @@ test('Compress request', t => {
serializer: new Serializer(),
maxRetries: 3,
requestTimeout: 250,
retryOnTimeout: true,
sniffInterval: false,
sniffOnStart: false
})