Compare commits
36 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ccf75e3f28 | |||
| afa2161801 | |||
| fe6a73b5fb | |||
| 6001e5a328 | |||
| c470b1de77 | |||
| b78e61a0c5 | |||
| a3344aa11c | |||
| 8e638e1cfa | |||
| 906ba09662 | |||
| d3d940d178 | |||
| 1889691a43 | |||
| 146fde308a | |||
| a0786f2705 | |||
| 4ab53eee4b | |||
| 17b3d63428 | |||
| 8b946af6ce | |||
| d6dbaf1ab9 | |||
| 1db476f716 | |||
| 93231e621e | |||
| e198511327 | |||
| cba4affb82 | |||
| 3d2720d3c8 | |||
| b53466e41c | |||
| f138b077e3 | |||
| f7edb80df7 | |||
| 66693f30ab | |||
| e0e3267ca0 | |||
| 416b221b1e | |||
| 528b90d19a | |||
| 9fe088589c | |||
| 7d776c15f7 | |||
| 0e2ae5452d | |||
| 2ebe2d8b7f | |||
| b759e621db | |||
| 28370acf49 | |||
| ae3bb7031f |
@ -4,6 +4,10 @@ FROM node:${NODE_JS_VERSION}
|
||||
# Create app directory
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
RUN apt-get clean -y
|
||||
RUN apt-get update -y
|
||||
RUN apt-get install -y zip
|
||||
|
||||
# Install app dependencies
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
---
|
||||
STACK_VERSION:
|
||||
- 7.12.0-SNAPSHOT
|
||||
- 7.13.0-SNAPSHOT
|
||||
|
||||
NODE_JS_VERSION:
|
||||
- 16
|
||||
- 14
|
||||
- 12
|
||||
- 10
|
||||
|
||||
TEST_SUITE:
|
||||
- free
|
||||
|
||||
6
.github/workflows/nodejs.yml
vendored
6
.github/workflows/nodejs.yml
vendored
@ -9,7 +9,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [10.x, 12.x, 14.x, 15.x]
|
||||
node-version: [12.x, 14.x, 16.x]
|
||||
os: [ubuntu-latest, windows-latest, macOS-latest]
|
||||
|
||||
steps:
|
||||
@ -46,7 +46,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [10.x, 12.x, 14.x]
|
||||
node-version: [12.x, 14.x, 16.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
@ -61,7 +61,7 @@ jobs:
|
||||
- name: Runs Elasticsearch
|
||||
uses: elastic/elastic-github-actions/elasticsearch@master
|
||||
with:
|
||||
stack-version: 7.12.0-SNAPSHOT
|
||||
stack-version: 7.13.0-SNAPSHOT
|
||||
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
|
||||
218
api/api/cat.js
218
api/api/cat.js
@ -23,8 +23,8 @@
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
||||
const acceptedQuerystring = ['format', 'local', 'h', 'help', 's', 'v', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'bytes', 'master_timeout', 'fields', 'time', 'ts', 'health', 'pri', 'include_unloaded_segments', 'full_id', 'include_bootstrap', 'active_only', 'detailed', 'index', 'ignore_unavailable', 'nodes', 'actions', 'parent_task_id', 'size', 'allow_no_match', 'allow_no_datafeeds', 'allow_no_jobs', 'from']
|
||||
const snakeCase = { expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', masterTimeout: 'master_timeout', includeUnloadedSegments: 'include_unloaded_segments', fullId: 'full_id', includeBootstrap: 'include_bootstrap', activeOnly: 'active_only', ignoreUnavailable: 'ignore_unavailable', parentTaskId: 'parent_task_id', allowNoMatch: 'allow_no_match', allowNoDatafeeds: 'allow_no_datafeeds', allowNoJobs: 'allow_no_jobs' }
|
||||
const acceptedQuerystring = ['format', 'local', 'h', 'help', 's', 'v', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'bytes', 'master_timeout', 'fields', 'time', 'ts', 'health', 'pri', 'include_unloaded_segments', 'allow_no_match', 'allow_no_datafeeds', 'allow_no_jobs', 'from', 'size', 'full_id', 'include_bootstrap', 'active_only', 'detailed', 'index', 'ignore_unavailable', 'nodes', 'actions', 'parent_task_id']
|
||||
const snakeCase = { expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', masterTimeout: 'master_timeout', includeUnloadedSegments: 'include_unloaded_segments', allowNoMatch: 'allow_no_match', allowNoDatafeeds: 'allow_no_datafeeds', allowNoJobs: 'allow_no_jobs', fullId: 'full_id', includeBootstrap: 'include_bootstrap', activeOnly: 'active_only', ignoreUnavailable: 'ignore_unavailable', parentTaskId: 'parent_task_id' }
|
||||
|
||||
function CatApi (transport, ConfigurationError) {
|
||||
this.transport = transport
|
||||
@ -224,6 +224,110 @@ CatApi.prototype.master = function catMasterApi (params, options, callback) {
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
CatApi.prototype.mlDataFrameAnalytics = function catMlDataFrameAnalyticsApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
let { method, body, id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if ((id) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + encodeURIComponent(id)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'ml' + '/' + 'data_frame' + '/' + 'analytics'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
CatApi.prototype.mlDatafeeds = function catMlDatafeedsApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
let { method, body, datafeedId, datafeed_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if ((datafeed_id || datafeedId) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'ml' + '/' + 'datafeeds'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
CatApi.prototype.mlJobs = function catMlJobsApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
let { method, body, jobId, job_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if ((job_id || jobId) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'ml' + '/' + 'anomaly_detectors'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
CatApi.prototype.mlTrainedModels = function catMlTrainedModelsApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
let { method, body, modelId, model_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if ((model_id || modelId) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'ml' + '/' + 'trained_models' + '/' + encodeURIComponent(model_id || modelId)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'ml' + '/' + 'trained_models'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
CatApi.prototype.nodeattrs = function catNodeattrsApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -506,110 +610,6 @@ CatApi.prototype.threadPool = function catThreadPoolApi (params, options, callba
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
CatApi.prototype.mlDataFrameAnalytics = function catMlDataFrameAnalyticsApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
let { method, body, id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if ((id) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + encodeURIComponent(id)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'ml' + '/' + 'data_frame' + '/' + 'analytics'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
CatApi.prototype.mlDatafeeds = function catMlDatafeedsApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
let { method, body, datafeedId, datafeed_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if ((datafeed_id || datafeedId) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'ml' + '/' + 'datafeeds'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
CatApi.prototype.mlJobs = function catMlJobsApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
let { method, body, jobId, job_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if ((job_id || jobId) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'ml' + '/' + 'anomaly_detectors'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
CatApi.prototype.mlTrainedModels = function catMlTrainedModelsApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
let { method, body, modelId, model_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if ((model_id || modelId) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'ml' + '/' + 'trained_models' + '/' + encodeURIComponent(model_id || modelId)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_cat' + '/' + 'ml' + '/' + 'trained_models'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
CatApi.prototype.transforms = function catTransformsApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -637,12 +637,12 @@ CatApi.prototype.transforms = function catTransformsApi (params, options, callba
|
||||
}
|
||||
|
||||
Object.defineProperties(CatApi.prototype, {
|
||||
pending_tasks: { get () { return this.pendingTasks } },
|
||||
thread_pool: { get () { return this.threadPool } },
|
||||
ml_data_frame_analytics: { get () { return this.mlDataFrameAnalytics } },
|
||||
ml_datafeeds: { get () { return this.mlDatafeeds } },
|
||||
ml_jobs: { get () { return this.mlJobs } },
|
||||
ml_trained_models: { get () { return this.mlTrainedModels } }
|
||||
ml_trained_models: { get () { return this.mlTrainedModels } },
|
||||
pending_tasks: { get () { return this.pendingTasks } },
|
||||
thread_pool: { get () { return this.threadPool } }
|
||||
})
|
||||
|
||||
module.exports = CatApi
|
||||
|
||||
@ -52,8 +52,30 @@ FeaturesApi.prototype.getFeatures = function featuresGetFeaturesApi (params, opt
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
FeaturesApi.prototype.resetFeatures = function featuresResetFeaturesApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
let { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_features' + '/' + '_reset'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
Object.defineProperties(FeaturesApi.prototype, {
|
||||
get_features: { get () { return this.getFeatures } }
|
||||
get_features: { get () { return this.getFeatures } },
|
||||
reset_features: { get () { return this.resetFeatures } }
|
||||
})
|
||||
|
||||
module.exports = FeaturesApi
|
||||
|
||||
65
api/api/fleet.js
Normal file
65
api/api/fleet.js
Normal file
@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
||||
const acceptedQuerystring = ['wait_for_advance', 'wait_for_index', 'checkpoints', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
|
||||
const snakeCase = { waitForAdvance: 'wait_for_advance', waitForIndex: 'wait_for_index', errorTrace: 'error_trace', filterPath: 'filter_path' }
|
||||
|
||||
function FleetApi (transport, ConfigurationError) {
|
||||
this.transport = transport
|
||||
this[kConfigurationError] = ConfigurationError
|
||||
}
|
||||
|
||||
FleetApi.prototype.globalCheckpoints = function fleetGlobalCheckpointsApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.index == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_fleet' + '/' + 'global_checkpoints'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
Object.defineProperties(FleetApi.prototype, {
|
||||
global_checkpoints: { get () { return this.globalCheckpoints } }
|
||||
})
|
||||
|
||||
module.exports = FleetApi
|
||||
@ -211,6 +211,59 @@ IndicesApi.prototype.create = function indicesCreateApi (params, options, callba
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.createDataStream = function indicesCreateDataStreamApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.name == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: name')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'PUT'
|
||||
path = '/' + '_data_stream' + '/' + encodeURIComponent(name)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.dataStreamsStats = function indicesDataStreamsStatsApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
let { method, body, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if ((name) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_data_stream' + '/' + encodeURIComponent(name) + '/' + '_stats'
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_data_stream' + '/' + '_stats'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.delete = function indicesDeleteApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -280,6 +333,33 @@ IndicesApi.prototype.deleteAlias = function indicesDeleteAliasApi (params, optio
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.deleteDataStream = function indicesDeleteDataStreamApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.name == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: name')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'DELETE'
|
||||
path = '/' + '_data_stream' + '/' + encodeURIComponent(name)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.deleteIndexTemplate = function indicesDeleteIndexTemplateApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -557,6 +637,33 @@ IndicesApi.prototype.forcemerge = function indicesForcemergeApi (params, options
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.freeze = function indicesFreezeApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.index == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_freeze'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.get = function indicesGetApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -616,6 +723,32 @@ IndicesApi.prototype.getAlias = function indicesGetAliasApi (params, options, ca
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.getDataStream = function indicesGetDataStreamApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
let { method, body, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if ((name) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_data_stream' + '/' + encodeURIComponent(name)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_data_stream'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.getFieldMapping = function indicesGetFieldMappingApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -791,6 +924,33 @@ IndicesApi.prototype.getUpgrade = function indicesGetUpgradeApi (params, options
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.migrateToDataStream = function indicesMigrateToDataStreamApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.name == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: name')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_data_stream' + '/' + '_migrate' + '/' + encodeURIComponent(name)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.open = function indicesOpenApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -818,6 +978,33 @@ IndicesApi.prototype.open = function indicesOpenApi (params, options, callback)
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.promoteDataStream = function indicesPromoteDataStreamApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.name == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: name')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_data_stream' + '/' + '_promote' + '/' + encodeURIComponent(name)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.putAlias = function indicesPutAliasApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -1056,6 +1243,33 @@ IndicesApi.prototype.refresh = function indicesRefreshApi (params, options, call
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.reloadSearchAnalyzers = function indicesReloadSearchAnalyzersApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.index == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_reload_search_analyzers'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.resolveIndex = function indicesResolveIndexApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -1332,6 +1546,33 @@ IndicesApi.prototype.stats = function indicesStatsApi (params, options, callback
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.unfreeze = function indicesUnfreezeApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.index == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_unfreeze'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.updateAliases = function indicesUpdateAliasesApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -1415,251 +1656,13 @@ IndicesApi.prototype.validateQuery = function indicesValidateQueryApi (params, o
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.createDataStream = function indicesCreateDataStreamApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.name == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: name')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'PUT'
|
||||
path = '/' + '_data_stream' + '/' + encodeURIComponent(name)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.dataStreamsStats = function indicesDataStreamsStatsApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
let { method, body, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if ((name) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_data_stream' + '/' + encodeURIComponent(name) + '/' + '_stats'
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_data_stream' + '/' + '_stats'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.deleteDataStream = function indicesDeleteDataStreamApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.name == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: name')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'DELETE'
|
||||
path = '/' + '_data_stream' + '/' + encodeURIComponent(name)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.freeze = function indicesFreezeApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.index == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_freeze'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.getDataStream = function indicesGetDataStreamApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
let { method, body, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if ((name) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_data_stream' + '/' + encodeURIComponent(name)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_data_stream'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.migrateToDataStream = function indicesMigrateToDataStreamApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.name == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: name')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_data_stream' + '/' + '_migrate' + '/' + encodeURIComponent(name)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.promoteDataStream = function indicesPromoteDataStreamApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.name == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: name')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_data_stream' + '/' + '_promote' + '/' + encodeURIComponent(name)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.reloadSearchAnalyzers = function indicesReloadSearchAnalyzersApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.index == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_reload_search_analyzers'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IndicesApi.prototype.unfreeze = function indicesUnfreezeApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.index == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: index')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, index, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + encodeURIComponent(index) + '/' + '_unfreeze'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
Object.defineProperties(IndicesApi.prototype, {
|
||||
add_block: { get () { return this.addBlock } },
|
||||
clear_cache: { get () { return this.clearCache } },
|
||||
create_data_stream: { get () { return this.createDataStream } },
|
||||
data_streams_stats: { get () { return this.dataStreamsStats } },
|
||||
delete_alias: { get () { return this.deleteAlias } },
|
||||
delete_data_stream: { get () { return this.deleteDataStream } },
|
||||
delete_index_template: { get () { return this.deleteIndexTemplate } },
|
||||
delete_template: { get () { return this.deleteTemplate } },
|
||||
exists_alias: { get () { return this.existsAlias } },
|
||||
@ -1668,30 +1671,27 @@ Object.defineProperties(IndicesApi.prototype, {
|
||||
exists_type: { get () { return this.existsType } },
|
||||
flush_synced: { get () { return this.flushSynced } },
|
||||
get_alias: { get () { return this.getAlias } },
|
||||
get_data_stream: { get () { return this.getDataStream } },
|
||||
get_field_mapping: { get () { return this.getFieldMapping } },
|
||||
get_index_template: { get () { return this.getIndexTemplate } },
|
||||
get_mapping: { get () { return this.getMapping } },
|
||||
get_settings: { get () { return this.getSettings } },
|
||||
get_template: { get () { return this.getTemplate } },
|
||||
get_upgrade: { get () { return this.getUpgrade } },
|
||||
migrate_to_data_stream: { get () { return this.migrateToDataStream } },
|
||||
promote_data_stream: { get () { return this.promoteDataStream } },
|
||||
put_alias: { get () { return this.putAlias } },
|
||||
put_index_template: { get () { return this.putIndexTemplate } },
|
||||
put_mapping: { get () { return this.putMapping } },
|
||||
put_settings: { get () { return this.putSettings } },
|
||||
put_template: { get () { return this.putTemplate } },
|
||||
reload_search_analyzers: { get () { return this.reloadSearchAnalyzers } },
|
||||
resolve_index: { get () { return this.resolveIndex } },
|
||||
shard_stores: { get () { return this.shardStores } },
|
||||
simulate_index_template: { get () { return this.simulateIndexTemplate } },
|
||||
simulate_template: { get () { return this.simulateTemplate } },
|
||||
update_aliases: { get () { return this.updateAliases } },
|
||||
validate_query: { get () { return this.validateQuery } },
|
||||
create_data_stream: { get () { return this.createDataStream } },
|
||||
data_streams_stats: { get () { return this.dataStreamsStats } },
|
||||
delete_data_stream: { get () { return this.deleteDataStream } },
|
||||
get_data_stream: { get () { return this.getDataStream } },
|
||||
migrate_to_data_stream: { get () { return this.migrateToDataStream } },
|
||||
promote_data_stream: { get () { return this.promoteDataStream } },
|
||||
reload_search_analyzers: { get () { return this.reloadSearchAnalyzers } }
|
||||
validate_query: { get () { return this.validateQuery } }
|
||||
})
|
||||
|
||||
module.exports = IndicesApi
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
||||
const acceptedQuerystring = ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'verbose']
|
||||
const acceptedQuerystring = ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'summary', 'verbose']
|
||||
const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' }
|
||||
|
||||
function IngestApi (transport, ConfigurationError) {
|
||||
@ -58,6 +58,27 @@ IngestApi.prototype.deletePipeline = function ingestDeletePipelineApi (params, o
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IngestApi.prototype.geoIpStats = function ingestGeoIpStatsApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
let { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_ingest' + '/' + 'geoip' + '/' + 'stats'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
IngestApi.prototype.getPipeline = function ingestGetPipelineApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -170,6 +191,7 @@ IngestApi.prototype.simulate = function ingestSimulateApi (params, options, call
|
||||
|
||||
Object.defineProperties(IngestApi.prototype, {
|
||||
delete_pipeline: { get () { return this.deletePipeline } },
|
||||
geo_ip_stats: { get () { return this.geoIpStats } },
|
||||
get_pipeline: { get () { return this.getPipeline } },
|
||||
processor_grok: { get () { return this.processorGrok } },
|
||||
put_pipeline: { get () { return this.putPipeline } }
|
||||
|
||||
152
api/api/ml.js
152
api/api/ml.js
@ -23,8 +23,8 @@
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
||||
const acceptedQuerystring = ['allow_no_match', 'allow_no_jobs', 'force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'requests_per_second', 'allow_no_forecasts', 'wait_for_completion', 'calc_interim', 'start', 'end', 'advance_time', 'skip_time', 'duration', 'expires_in', 'max_model_memory', 'expand', 'exclude_interim', 'from', 'size', 'anomaly_score', 'sort', 'desc', 'job_id', 'partition_field_value', 'exclude_generated', 'verbose', 'allow_no_datafeeds', 'influencer_score', 'top_n', 'bucket_span', 'overall_score', 'record_score', 'include', 'include_model_definition', 'decompress_definition', 'tags', 'reset_start', 'reset_end', 'ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'delete_intervening_results', 'enabled']
|
||||
const snakeCase = { allowNoMatch: 'allow_no_match', allowNoJobs: 'allow_no_jobs', errorTrace: 'error_trace', filterPath: 'filter_path', requestsPerSecond: 'requests_per_second', allowNoForecasts: 'allow_no_forecasts', waitForCompletion: 'wait_for_completion', calcInterim: 'calc_interim', advanceTime: 'advance_time', skipTime: 'skip_time', expiresIn: 'expires_in', maxModelMemory: 'max_model_memory', excludeInterim: 'exclude_interim', anomalyScore: 'anomaly_score', jobId: 'job_id', partitionFieldValue: 'partition_field_value', excludeGenerated: 'exclude_generated', allowNoDatafeeds: 'allow_no_datafeeds', influencerScore: 'influencer_score', topN: 'top_n', bucketSpan: 'bucket_span', overallScore: 'overall_score', recordScore: 'record_score', includeModelDefinition: 'include_model_definition', decompressDefinition: 'decompress_definition', resetStart: 'reset_start', resetEnd: 'reset_end', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', ignoreThrottled: 'ignore_throttled', expandWildcards: 'expand_wildcards', deleteInterveningResults: 'delete_intervening_results' }
|
||||
const acceptedQuerystring = ['allow_no_match', 'allow_no_jobs', 'force', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'requests_per_second', 'allow_no_forecasts', 'wait_for_completion', 'lines_to_sample', 'line_merge_size_limit', 'charset', 'format', 'has_header_row', 'column_names', 'delimiter', 'quote', 'should_trim_fields', 'grok_pattern', 'timestamp_field', 'timestamp_format', 'explain', 'calc_interim', 'start', 'end', 'advance_time', 'skip_time', 'duration', 'expires_in', 'max_model_memory', 'expand', 'exclude_interim', 'from', 'size', 'anomaly_score', 'sort', 'desc', 'job_id', 'partition_field_value', 'exclude_generated', 'verbose', 'allow_no_datafeeds', 'influencer_score', 'top_n', 'bucket_span', 'overall_score', 'record_score', 'include', 'include_model_definition', 'decompress_definition', 'tags', 'reset_start', 'reset_end', 'ignore_unavailable', 'allow_no_indices', 'ignore_throttled', 'expand_wildcards', 'reassign', 'delete_intervening_results', 'enabled']
|
||||
const snakeCase = { allowNoMatch: 'allow_no_match', allowNoJobs: 'allow_no_jobs', errorTrace: 'error_trace', filterPath: 'filter_path', requestsPerSecond: 'requests_per_second', allowNoForecasts: 'allow_no_forecasts', waitForCompletion: 'wait_for_completion', linesToSample: 'lines_to_sample', lineMergeSizeLimit: 'line_merge_size_limit', hasHeaderRow: 'has_header_row', columnNames: 'column_names', shouldTrimFields: 'should_trim_fields', grokPattern: 'grok_pattern', timestampField: 'timestamp_field', timestampFormat: 'timestamp_format', calcInterim: 'calc_interim', advanceTime: 'advance_time', skipTime: 'skip_time', expiresIn: 'expires_in', maxModelMemory: 'max_model_memory', excludeInterim: 'exclude_interim', anomalyScore: 'anomaly_score', jobId: 'job_id', partitionFieldValue: 'partition_field_value', excludeGenerated: 'exclude_generated', allowNoDatafeeds: 'allow_no_datafeeds', influencerScore: 'influencer_score', topN: 'top_n', bucketSpan: 'bucket_span', overallScore: 'overall_score', recordScore: 'record_score', includeModelDefinition: 'include_model_definition', decompressDefinition: 'decompress_definition', resetStart: 'reset_start', resetEnd: 'reset_end', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', ignoreThrottled: 'ignore_throttled', expandWildcards: 'expand_wildcards', deleteInterveningResults: 'delete_intervening_results' }
|
||||
|
||||
function MlApi (transport, ConfigurationError) {
|
||||
this.transport = transport
|
||||
@ -395,6 +395,43 @@ MlApi.prototype.deleteTrainedModel = function mlDeleteTrainedModelApi (params, o
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
MlApi.prototype.deleteTrainedModelAlias = function mlDeleteTrainedModelAliasApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.model_alias == null && params.modelAlias == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: model_alias or modelAlias')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.model_id == null && params.modelId == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: model_id or modelId')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// check required url components
|
||||
if ((params.model_alias != null || params.modelAlias != null) && ((params.model_id == null && params.modelId == null))) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter of the url: model_id')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, modelAlias, model_alias, modelId, model_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'DELETE'
|
||||
path = '/' + '_ml' + '/' + 'trained_models' + '/' + encodeURIComponent(model_id || modelId) + '/' + 'model_aliases' + '/' + encodeURIComponent(model_alias || modelAlias)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
MlApi.prototype.estimateModelMemory = function mlEstimateModelMemoryApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -475,6 +512,33 @@ MlApi.prototype.explainDataFrameAnalytics = function mlExplainDataFrameAnalytics
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
MlApi.prototype.findFileStructure = function mlFindFileStructureApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.body == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_ml' + '/' + 'find_file_structure'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
bulkBody: body,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
MlApi.prototype.flushJob = function mlFlushJobApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -1110,6 +1174,32 @@ MlApi.prototype.postData = function mlPostDataApi (params, options, callback) {
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId) + '/' + '_data'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
bulkBody: body,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
MlApi.prototype.previewDataFrameAnalytics = function mlPreviewDataFrameAnalyticsApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
let { method, body, id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if ((id) != null) {
|
||||
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||
path = '/' + '_ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + encodeURIComponent(id) + '/' + '_preview'
|
||||
} else {
|
||||
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||
path = '/' + '_ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + '_preview'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
@ -1124,24 +1214,23 @@ MlApi.prototype.postData = function mlPostDataApi (params, options, callback) {
|
||||
MlApi.prototype.previewDatafeed = function mlPreviewDatafeedApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.datafeed_id == null && params.datafeedId == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: datafeed_id or datafeedId')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, datafeedId, datafeed_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) + '/' + '_preview'
|
||||
if ((datafeed_id || datafeedId) != null) {
|
||||
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||
path = '/' + '_ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId) + '/' + '_preview'
|
||||
} else {
|
||||
if (method == null) method = body == null ? 'GET' : 'POST'
|
||||
path = '/' + '_ml' + '/' + 'datafeeds' + '/' + '_preview'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
@ -1367,6 +1456,43 @@ MlApi.prototype.putTrainedModel = function mlPutTrainedModelApi (params, options
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
MlApi.prototype.putTrainedModelAlias = function mlPutTrainedModelAliasApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.model_alias == null && params.modelAlias == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: model_alias or modelAlias')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.model_id == null && params.modelId == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: model_id or modelId')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// check required url components
|
||||
if ((params.model_alias != null || params.modelAlias != null) && ((params.model_id == null && params.modelId == null))) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter of the url: model_id')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, modelAlias, model_alias, modelId, model_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'PUT'
|
||||
path = '/' + '_ml' + '/' + 'trained_models' + '/' + encodeURIComponent(model_id || modelId) + '/' + 'model_aliases' + '/' + encodeURIComponent(model_alias || modelAlias)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
MlApi.prototype.revertModelSnapshot = function mlRevertModelSnapshotApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -1802,9 +1928,11 @@ Object.defineProperties(MlApi.prototype, {
|
||||
delete_job: { get () { return this.deleteJob } },
|
||||
delete_model_snapshot: { get () { return this.deleteModelSnapshot } },
|
||||
delete_trained_model: { get () { return this.deleteTrainedModel } },
|
||||
delete_trained_model_alias: { get () { return this.deleteTrainedModelAlias } },
|
||||
estimate_model_memory: { get () { return this.estimateModelMemory } },
|
||||
evaluate_data_frame: { get () { return this.evaluateDataFrame } },
|
||||
explain_data_frame_analytics: { get () { return this.explainDataFrameAnalytics } },
|
||||
find_file_structure: { get () { return this.findFileStructure } },
|
||||
flush_job: { get () { return this.flushJob } },
|
||||
get_buckets: { get () { return this.getBuckets } },
|
||||
get_calendar_events: { get () { return this.getCalendarEvents } },
|
||||
@ -1826,6 +1954,7 @@ Object.defineProperties(MlApi.prototype, {
|
||||
open_job: { get () { return this.openJob } },
|
||||
post_calendar_events: { get () { return this.postCalendarEvents } },
|
||||
post_data: { get () { return this.postData } },
|
||||
preview_data_frame_analytics: { get () { return this.previewDataFrameAnalytics } },
|
||||
preview_datafeed: { get () { return this.previewDatafeed } },
|
||||
put_calendar: { get () { return this.putCalendar } },
|
||||
put_calendar_job: { get () { return this.putCalendarJob } },
|
||||
@ -1834,6 +1963,7 @@ Object.defineProperties(MlApi.prototype, {
|
||||
put_filter: { get () { return this.putFilter } },
|
||||
put_job: { get () { return this.putJob } },
|
||||
put_trained_model: { get () { return this.putTrainedModel } },
|
||||
put_trained_model_alias: { get () { return this.putTrainedModelAlias } },
|
||||
revert_model_snapshot: { get () { return this.revertModelSnapshot } },
|
||||
set_upgrade_mode: { get () { return this.setUpgradeMode } },
|
||||
start_data_frame_analytics: { get () { return this.startDataFrameAnalytics } },
|
||||
|
||||
@ -23,8 +23,8 @@
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
||||
const acceptedQuerystring = ['interval', 'snapshots', 'threads', 'ignore_idle_threads', 'type', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'flat_settings', 'completion_fields', 'fielddata_fields', 'fields', 'groups', 'level', 'types', 'include_segment_file_sizes']
|
||||
const snakeCase = { ignoreIdleThreads: 'ignore_idle_threads', errorTrace: 'error_trace', filterPath: 'filter_path', flatSettings: 'flat_settings', completionFields: 'completion_fields', fielddataFields: 'fielddata_fields', includeSegmentFileSizes: 'include_segment_file_sizes' }
|
||||
const acceptedQuerystring = ['interval', 'snapshots', 'threads', 'ignore_idle_threads', 'type', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'flat_settings', 'completion_fields', 'fielddata_fields', 'fields', 'groups', 'level', 'types', 'include_segment_file_sizes', 'include_unloaded_segments']
|
||||
const snakeCase = { ignoreIdleThreads: 'ignore_idle_threads', errorTrace: 'error_trace', filterPath: 'filter_path', flatSettings: 'flat_settings', completionFields: 'completion_fields', fielddataFields: 'fielddata_fields', includeSegmentFileSizes: 'include_segment_file_sizes', includeUnloadedSegments: 'include_unloaded_segments' }
|
||||
|
||||
function NodesApi (transport, ConfigurationError) {
|
||||
this.transport = transport
|
||||
|
||||
@ -23,14 +23,40 @@
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
||||
const acceptedQuerystring = ['ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'index', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'master_timeout', 'wait_for_completion', 'storage', 'level']
|
||||
const snakeCase = { ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', masterTimeout: 'master_timeout', waitForCompletion: 'wait_for_completion' }
|
||||
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'index', 'master_timeout', 'wait_for_completion', 'storage', 'level']
|
||||
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', masterTimeout: 'master_timeout', waitForCompletion: 'wait_for_completion' }
|
||||
|
||||
function SearchableSnapshotsApi (transport, ConfigurationError) {
|
||||
this.transport = transport
|
||||
this[kConfigurationError] = ConfigurationError
|
||||
}
|
||||
|
||||
SearchableSnapshotsApi.prototype.cacheStats = function searchableSnapshotsCacheStatsApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
let { method, body, nodeId, node_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if ((node_id || nodeId) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_searchable_snapshots' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'cache' + '/' + 'stats'
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_searchable_snapshots' + '/' + 'cache' + '/' + 'stats'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SearchableSnapshotsApi.prototype.clearCache = function searchableSnapshotsClearCacheApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -152,6 +178,7 @@ SearchableSnapshotsApi.prototype.stats = function searchableSnapshotsStatsApi (p
|
||||
}
|
||||
|
||||
Object.defineProperties(SearchableSnapshotsApi.prototype, {
|
||||
cache_stats: { get () { return this.cacheStats } },
|
||||
clear_cache: { get () { return this.clearCache } },
|
||||
repository_stats: { get () { return this.repositoryStats } }
|
||||
})
|
||||
|
||||
@ -192,6 +192,50 @@ SecurityApi.prototype.clearCachedRoles = function securityClearCachedRolesApi (p
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SecurityApi.prototype.clearCachedServiceTokens = function securityClearCachedServiceTokensApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.namespace == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: namespace')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.service == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: service')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.name == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: name')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// check required url components
|
||||
if (params.name != null && (params.service == null || params.namespace == null)) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter of the url: service, namespace')
|
||||
return handleError(err, callback)
|
||||
} else if (params.service != null && (params.namespace == null)) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter of the url: namespace')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, namespace, service, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_security' + '/' + 'service' + '/' + encodeURIComponent(namespace) + '/' + encodeURIComponent(service) + '/' + 'credential' + '/' + 'token' + '/' + encodeURIComponent(name) + '/' + '_clear_cache'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SecurityApi.prototype.createApiKey = function securityCreateApiKeyApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -219,6 +263,51 @@ SecurityApi.prototype.createApiKey = function securityCreateApiKeyApi (params, o
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SecurityApi.prototype.createServiceToken = function securityCreateServiceTokenApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.namespace == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: namespace')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.service == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: service')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// check required url components
|
||||
if (params.name != null && (params.service == null || params.namespace == null)) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter of the url: service, namespace')
|
||||
return handleError(err, callback)
|
||||
} else if (params.service != null && (params.namespace == null)) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter of the url: namespace')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, namespace, service, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if ((namespace) != null && (service) != null && (name) != null) {
|
||||
if (method == null) method = 'PUT'
|
||||
path = '/' + '_security' + '/' + 'service' + '/' + encodeURIComponent(namespace) + '/' + encodeURIComponent(service) + '/' + 'credential' + '/' + 'token' + '/' + encodeURIComponent(name)
|
||||
} else {
|
||||
if (method == null) method = 'POST'
|
||||
path = '/' + '_security' + '/' + 'service' + '/' + encodeURIComponent(namespace) + '/' + encodeURIComponent(service) + '/' + 'credential' + '/' + 'token'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SecurityApi.prototype.deletePrivileges = function securityDeletePrivilegesApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -310,6 +399,50 @@ SecurityApi.prototype.deleteRoleMapping = function securityDeleteRoleMappingApi
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SecurityApi.prototype.deleteServiceToken = function securityDeleteServiceTokenApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.namespace == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: namespace')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.service == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: service')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.name == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: name')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// check required url components
|
||||
if (params.name != null && (params.service == null || params.namespace == null)) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter of the url: service, namespace')
|
||||
return handleError(err, callback)
|
||||
} else if (params.service != null && (params.namespace == null)) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter of the url: namespace')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, namespace, service, name, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'DELETE'
|
||||
path = '/' + '_security' + '/' + 'service' + '/' + encodeURIComponent(namespace) + '/' + encodeURIComponent(service) + '/' + 'credential' + '/' + 'token' + '/' + encodeURIComponent(name)
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SecurityApi.prototype.deleteUser = function securityDeleteUserApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -520,6 +653,78 @@ SecurityApi.prototype.getRoleMapping = function securityGetRoleMappingApi (param
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SecurityApi.prototype.getServiceAccounts = function securityGetServiceAccountsApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required url components
|
||||
if (params.service != null && (params.namespace == null)) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter of the url: namespace')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, namespace, service, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if ((namespace) != null && (service) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_security' + '/' + 'service' + '/' + encodeURIComponent(namespace) + '/' + encodeURIComponent(service)
|
||||
} else if ((namespace) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_security' + '/' + 'service' + '/' + encodeURIComponent(namespace)
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_security' + '/' + 'service'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SecurityApi.prototype.getServiceCredentials = function securityGetServiceCredentialsApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.namespace == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: namespace')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.service == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: service')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
// check required url components
|
||||
if (params.service != null && (params.namespace == null)) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter of the url: namespace')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, namespace, service, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_security' + '/' + 'service' + '/' + encodeURIComponent(namespace) + '/' + encodeURIComponent(service) + '/' + 'credential'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
SecurityApi.prototype.getToken = function securityGetTokenApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
@ -833,10 +1038,13 @@ Object.defineProperties(SecurityApi.prototype, {
|
||||
clear_cached_privileges: { get () { return this.clearCachedPrivileges } },
|
||||
clear_cached_realms: { get () { return this.clearCachedRealms } },
|
||||
clear_cached_roles: { get () { return this.clearCachedRoles } },
|
||||
clear_cached_service_tokens: { get () { return this.clearCachedServiceTokens } },
|
||||
create_api_key: { get () { return this.createApiKey } },
|
||||
create_service_token: { get () { return this.createServiceToken } },
|
||||
delete_privileges: { get () { return this.deletePrivileges } },
|
||||
delete_role: { get () { return this.deleteRole } },
|
||||
delete_role_mapping: { get () { return this.deleteRoleMapping } },
|
||||
delete_service_token: { get () { return this.deleteServiceToken } },
|
||||
delete_user: { get () { return this.deleteUser } },
|
||||
disable_user: { get () { return this.disableUser } },
|
||||
enable_user: { get () { return this.enableUser } },
|
||||
@ -845,6 +1053,8 @@ Object.defineProperties(SecurityApi.prototype, {
|
||||
get_privileges: { get () { return this.getPrivileges } },
|
||||
get_role: { get () { return this.getRole } },
|
||||
get_role_mapping: { get () { return this.getRoleMapping } },
|
||||
get_service_accounts: { get () { return this.getServiceAccounts } },
|
||||
get_service_credentials: { get () { return this.getServiceCredentials } },
|
||||
get_token: { get () { return this.getToken } },
|
||||
get_user: { get () { return this.getUser } },
|
||||
get_user_privileges: { get () { return this.getUserPrivileges } },
|
||||
|
||||
124
api/api/shutdown.js
Normal file
124
api/api/shutdown.js
Normal file
@ -0,0 +1,124 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
||||
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']
|
||||
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
|
||||
|
||||
function ShutdownApi (transport, ConfigurationError) {
|
||||
this.transport = transport
|
||||
this[kConfigurationError] = ConfigurationError
|
||||
}
|
||||
|
||||
ShutdownApi.prototype.deleteNode = function shutdownDeleteNodeApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.node_id == null && params.nodeId == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: node_id or nodeId')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, nodeId, node_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'DELETE'
|
||||
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'shutdown'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
ShutdownApi.prototype.getNode = function shutdownGetNodeApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
let { method, body, nodeId, node_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if ((node_id || nodeId) != null) {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'shutdown'
|
||||
} else {
|
||||
if (method == null) method = 'GET'
|
||||
path = '/' + '_nodes' + '/' + 'shutdown'
|
||||
}
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: null,
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
ShutdownApi.prototype.putNode = function shutdownPutNodeApi (params, options, callback) {
|
||||
;[params, options, callback] = normalizeArguments(params, options, callback)
|
||||
|
||||
// check required parameters
|
||||
if (params.node_id == null && params.nodeId == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: node_id or nodeId')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
if (params.body == null) {
|
||||
const err = new this[kConfigurationError]('Missing required parameter: body')
|
||||
return handleError(err, callback)
|
||||
}
|
||||
|
||||
let { method, body, nodeId, node_id, ...querystring } = params
|
||||
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
|
||||
|
||||
let path = ''
|
||||
if (method == null) method = 'PUT'
|
||||
path = '/' + '_nodes' + '/' + encodeURIComponent(node_id || nodeId) + '/' + 'shutdown'
|
||||
|
||||
// build request object
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
querystring
|
||||
}
|
||||
|
||||
return this.transport.request(request, options, callback)
|
||||
}
|
||||
|
||||
Object.defineProperties(ShutdownApi.prototype, {
|
||||
delete_node: { get () { return this.deleteNode } },
|
||||
get_node: { get () { return this.getNode } },
|
||||
put_node: { get () { return this.putNode } }
|
||||
})
|
||||
|
||||
module.exports = ShutdownApi
|
||||
@ -23,8 +23,8 @@
|
||||
/* eslint no-unused-vars: 0 */
|
||||
|
||||
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
|
||||
const acceptedQuerystring = ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'wait_for_completion', 'verify', 'ignore_unavailable', 'verbose', 'local']
|
||||
const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path', waitForCompletion: 'wait_for_completion', ignoreUnavailable: 'ignore_unavailable' }
|
||||
const acceptedQuerystring = ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'wait_for_completion', 'verify', 'ignore_unavailable', 'index_details', 'verbose', 'local']
|
||||
const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path', waitForCompletion: 'wait_for_completion', ignoreUnavailable: 'ignore_unavailable', indexDetails: 'index_details' }
|
||||
|
||||
function SnapshotApi (transport, ConfigurationError) {
|
||||
this.transport = transport
|
||||
|
||||
@ -51,7 +51,7 @@ TextStructureApi.prototype.findStructure = function textStructureFindStructureAp
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
body: body || '',
|
||||
bulkBody: body,
|
||||
querystring
|
||||
}
|
||||
|
||||
|
||||
286
api/index.js
286
api/index.js
@ -19,9 +19,13 @@
|
||||
|
||||
'use strict'
|
||||
|
||||
const AsyncSearchApi = require('./api/async_search')
|
||||
const AutoscalingApi = require('./api/autoscaling')
|
||||
const bulkApi = require('./api/bulk')
|
||||
const CatApi = require('./api/cat')
|
||||
const CcrApi = require('./api/ccr')
|
||||
const clearScrollApi = require('./api/clear_scroll')
|
||||
const closePointInTimeApi = require('./api/close_point_in_time')
|
||||
const ClusterApi = require('./api/cluster')
|
||||
const countApi = require('./api/count')
|
||||
const createApi = require('./api/create')
|
||||
@ -30,95 +34,95 @@ const deleteApi = require('./api/delete')
|
||||
const deleteByQueryApi = require('./api/delete_by_query')
|
||||
const deleteByQueryRethrottleApi = require('./api/delete_by_query_rethrottle')
|
||||
const deleteScriptApi = require('./api/delete_script')
|
||||
const EnrichApi = require('./api/enrich')
|
||||
const EqlApi = require('./api/eql')
|
||||
const existsApi = require('./api/exists')
|
||||
const existsSourceApi = require('./api/exists_source')
|
||||
const explainApi = require('./api/explain')
|
||||
const FeaturesApi = require('./api/features')
|
||||
const fieldCapsApi = require('./api/field_caps')
|
||||
const FleetApi = require('./api/fleet')
|
||||
const getApi = require('./api/get')
|
||||
const getScriptApi = require('./api/get_script')
|
||||
const getScriptContextApi = require('./api/get_script_context')
|
||||
const getScriptLanguagesApi = require('./api/get_script_languages')
|
||||
const getSourceApi = require('./api/get_source')
|
||||
const GraphApi = require('./api/graph')
|
||||
const IlmApi = require('./api/ilm')
|
||||
const indexApi = require('./api/index')
|
||||
const IndicesApi = require('./api/indices')
|
||||
const infoApi = require('./api/info')
|
||||
const IngestApi = require('./api/ingest')
|
||||
const LicenseApi = require('./api/license')
|
||||
const LogstashApi = require('./api/logstash')
|
||||
const mgetApi = require('./api/mget')
|
||||
const MigrationApi = require('./api/migration')
|
||||
const MlApi = require('./api/ml')
|
||||
const MonitoringApi = require('./api/monitoring')
|
||||
const msearchApi = require('./api/msearch')
|
||||
const msearchTemplateApi = require('./api/msearch_template')
|
||||
const mtermvectorsApi = require('./api/mtermvectors')
|
||||
const NodesApi = require('./api/nodes')
|
||||
const openPointInTimeApi = require('./api/open_point_in_time')
|
||||
const pingApi = require('./api/ping')
|
||||
const putScriptApi = require('./api/put_script')
|
||||
const rankEvalApi = require('./api/rank_eval')
|
||||
const reindexApi = require('./api/reindex')
|
||||
const reindexRethrottleApi = require('./api/reindex_rethrottle')
|
||||
const renderSearchTemplateApi = require('./api/render_search_template')
|
||||
const RollupApi = require('./api/rollup')
|
||||
const scriptsPainlessExecuteApi = require('./api/scripts_painless_execute')
|
||||
const scrollApi = require('./api/scroll')
|
||||
const searchApi = require('./api/search')
|
||||
const searchShardsApi = require('./api/search_shards')
|
||||
const searchTemplateApi = require('./api/search_template')
|
||||
const SearchableSnapshotsApi = require('./api/searchable_snapshots')
|
||||
const SecurityApi = require('./api/security')
|
||||
const ShutdownApi = require('./api/shutdown')
|
||||
const SlmApi = require('./api/slm')
|
||||
const SnapshotApi = require('./api/snapshot')
|
||||
const SqlApi = require('./api/sql')
|
||||
const SslApi = require('./api/ssl')
|
||||
const TasksApi = require('./api/tasks')
|
||||
const termvectorsApi = require('./api/termvectors')
|
||||
const TextStructureApi = require('./api/text_structure')
|
||||
const TransformApi = require('./api/transform')
|
||||
const updateApi = require('./api/update')
|
||||
const updateByQueryApi = require('./api/update_by_query')
|
||||
const updateByQueryRethrottleApi = require('./api/update_by_query_rethrottle')
|
||||
const AsyncSearchApi = require('./api/async_search')
|
||||
const AutoscalingApi = require('./api/autoscaling')
|
||||
const CcrApi = require('./api/ccr')
|
||||
const closePointInTimeApi = require('./api/close_point_in_time')
|
||||
const EnrichApi = require('./api/enrich')
|
||||
const EqlApi = require('./api/eql')
|
||||
const GraphApi = require('./api/graph')
|
||||
const IlmApi = require('./api/ilm')
|
||||
const LicenseApi = require('./api/license')
|
||||
const LogstashApi = require('./api/logstash')
|
||||
const MigrationApi = require('./api/migration')
|
||||
const MlApi = require('./api/ml')
|
||||
const MonitoringApi = require('./api/monitoring')
|
||||
const openPointInTimeApi = require('./api/open_point_in_time')
|
||||
const RollupApi = require('./api/rollup')
|
||||
const SearchableSnapshotsApi = require('./api/searchable_snapshots')
|
||||
const SecurityApi = require('./api/security')
|
||||
const SlmApi = require('./api/slm')
|
||||
const SqlApi = require('./api/sql')
|
||||
const SslApi = require('./api/ssl')
|
||||
const TextStructureApi = require('./api/text_structure')
|
||||
const TransformApi = require('./api/transform')
|
||||
const WatcherApi = require('./api/watcher')
|
||||
const XpackApi = require('./api/xpack')
|
||||
|
||||
const { kConfigurationError } = require('./utils')
|
||||
const kCat = Symbol('Cat')
|
||||
const kCluster = Symbol('Cluster')
|
||||
const kDanglingIndices = Symbol('DanglingIndices')
|
||||
const kFeatures = Symbol('Features')
|
||||
const kIndices = Symbol('Indices')
|
||||
const kIngest = Symbol('Ingest')
|
||||
const kNodes = Symbol('Nodes')
|
||||
const kSnapshot = Symbol('Snapshot')
|
||||
const kTasks = Symbol('Tasks')
|
||||
const kAsyncSearch = Symbol('AsyncSearch')
|
||||
const kAutoscaling = Symbol('Autoscaling')
|
||||
const kCat = Symbol('Cat')
|
||||
const kCcr = Symbol('Ccr')
|
||||
const kCluster = Symbol('Cluster')
|
||||
const kDanglingIndices = Symbol('DanglingIndices')
|
||||
const kEnrich = Symbol('Enrich')
|
||||
const kEql = Symbol('Eql')
|
||||
const kFeatures = Symbol('Features')
|
||||
const kFleet = Symbol('Fleet')
|
||||
const kGraph = Symbol('Graph')
|
||||
const kIlm = Symbol('Ilm')
|
||||
const kIndices = Symbol('Indices')
|
||||
const kIngest = Symbol('Ingest')
|
||||
const kLicense = Symbol('License')
|
||||
const kLogstash = Symbol('Logstash')
|
||||
const kMigration = Symbol('Migration')
|
||||
const kMl = Symbol('Ml')
|
||||
const kMonitoring = Symbol('Monitoring')
|
||||
const kNodes = Symbol('Nodes')
|
||||
const kRollup = Symbol('Rollup')
|
||||
const kSearchableSnapshots = Symbol('SearchableSnapshots')
|
||||
const kSecurity = Symbol('Security')
|
||||
const kShutdown = Symbol('Shutdown')
|
||||
const kSlm = Symbol('Slm')
|
||||
const kSnapshot = Symbol('Snapshot')
|
||||
const kSql = Symbol('Sql')
|
||||
const kSsl = Symbol('Ssl')
|
||||
const kTasks = Symbol('Tasks')
|
||||
const kTextStructure = Symbol('TextStructure')
|
||||
const kTransform = Symbol('Transform')
|
||||
const kWatcher = Symbol('Watcher')
|
||||
@ -126,33 +130,35 @@ const kXpack = Symbol('Xpack')
|
||||
|
||||
function ESAPI (opts) {
|
||||
this[kConfigurationError] = opts.ConfigurationError
|
||||
this[kCat] = null
|
||||
this[kCluster] = null
|
||||
this[kDanglingIndices] = null
|
||||
this[kFeatures] = null
|
||||
this[kIndices] = null
|
||||
this[kIngest] = null
|
||||
this[kNodes] = null
|
||||
this[kSnapshot] = null
|
||||
this[kTasks] = null
|
||||
this[kAsyncSearch] = null
|
||||
this[kAutoscaling] = null
|
||||
this[kCat] = null
|
||||
this[kCcr] = null
|
||||
this[kCluster] = null
|
||||
this[kDanglingIndices] = null
|
||||
this[kEnrich] = null
|
||||
this[kEql] = null
|
||||
this[kFeatures] = null
|
||||
this[kFleet] = null
|
||||
this[kGraph] = null
|
||||
this[kIlm] = null
|
||||
this[kIndices] = null
|
||||
this[kIngest] = null
|
||||
this[kLicense] = null
|
||||
this[kLogstash] = null
|
||||
this[kMigration] = null
|
||||
this[kMl] = null
|
||||
this[kMonitoring] = null
|
||||
this[kNodes] = null
|
||||
this[kRollup] = null
|
||||
this[kSearchableSnapshots] = null
|
||||
this[kSecurity] = null
|
||||
this[kShutdown] = null
|
||||
this[kSlm] = null
|
||||
this[kSnapshot] = null
|
||||
this[kSql] = null
|
||||
this[kSsl] = null
|
||||
this[kTasks] = null
|
||||
this[kTextStructure] = null
|
||||
this[kTransform] = null
|
||||
this[kWatcher] = null
|
||||
@ -161,6 +167,7 @@ function ESAPI (opts) {
|
||||
|
||||
ESAPI.prototype.bulk = bulkApi
|
||||
ESAPI.prototype.clearScroll = clearScrollApi
|
||||
ESAPI.prototype.closePointInTime = closePointInTimeApi
|
||||
ESAPI.prototype.count = countApi
|
||||
ESAPI.prototype.create = createApi
|
||||
ESAPI.prototype.delete = deleteApi
|
||||
@ -182,6 +189,7 @@ ESAPI.prototype.mget = mgetApi
|
||||
ESAPI.prototype.msearch = msearchApi
|
||||
ESAPI.prototype.msearchTemplate = msearchTemplateApi
|
||||
ESAPI.prototype.mtermvectors = mtermvectorsApi
|
||||
ESAPI.prototype.openPointInTime = openPointInTimeApi
|
||||
ESAPI.prototype.ping = pingApi
|
||||
ESAPI.prototype.putScript = putScriptApi
|
||||
ESAPI.prototype.rankEval = rankEvalApi
|
||||
@ -197,10 +205,25 @@ ESAPI.prototype.termvectors = termvectorsApi
|
||||
ESAPI.prototype.update = updateApi
|
||||
ESAPI.prototype.updateByQuery = updateByQueryApi
|
||||
ESAPI.prototype.updateByQueryRethrottle = updateByQueryRethrottleApi
|
||||
ESAPI.prototype.closePointInTime = closePointInTimeApi
|
||||
ESAPI.prototype.openPointInTime = openPointInTimeApi
|
||||
|
||||
Object.defineProperties(ESAPI.prototype, {
|
||||
asyncSearch: {
|
||||
get () {
|
||||
if (this[kAsyncSearch] === null) {
|
||||
this[kAsyncSearch] = new AsyncSearchApi(this.transport, this[kConfigurationError])
|
||||
}
|
||||
return this[kAsyncSearch]
|
||||
}
|
||||
},
|
||||
async_search: { get () { return this.asyncSearch } },
|
||||
autoscaling: {
|
||||
get () {
|
||||
if (this[kAutoscaling] === null) {
|
||||
this[kAutoscaling] = new AutoscalingApi(this.transport, this[kConfigurationError])
|
||||
}
|
||||
return this[kAutoscaling]
|
||||
}
|
||||
},
|
||||
cat: {
|
||||
get () {
|
||||
if (this[kCat] === null) {
|
||||
@ -209,7 +232,16 @@ Object.defineProperties(ESAPI.prototype, {
|
||||
return this[kCat]
|
||||
}
|
||||
},
|
||||
ccr: {
|
||||
get () {
|
||||
if (this[kCcr] === null) {
|
||||
this[kCcr] = new CcrApi(this.transport, this[kConfigurationError])
|
||||
}
|
||||
return this[kCcr]
|
||||
}
|
||||
},
|
||||
clear_scroll: { get () { return this.clearScroll } },
|
||||
close_point_in_time: { get () { return this.closePointInTime } },
|
||||
cluster: {
|
||||
get () {
|
||||
if (this[kCluster] === null) {
|
||||
@ -230,96 +262,6 @@ Object.defineProperties(ESAPI.prototype, {
|
||||
delete_by_query: { get () { return this.deleteByQuery } },
|
||||
delete_by_query_rethrottle: { get () { return this.deleteByQueryRethrottle } },
|
||||
delete_script: { get () { return this.deleteScript } },
|
||||
exists_source: { get () { return this.existsSource } },
|
||||
features: {
|
||||
get () {
|
||||
if (this[kFeatures] === null) {
|
||||
this[kFeatures] = new FeaturesApi(this.transport, this[kConfigurationError])
|
||||
}
|
||||
return this[kFeatures]
|
||||
}
|
||||
},
|
||||
field_caps: { get () { return this.fieldCaps } },
|
||||
get_script: { get () { return this.getScript } },
|
||||
get_script_context: { get () { return this.getScriptContext } },
|
||||
get_script_languages: { get () { return this.getScriptLanguages } },
|
||||
get_source: { get () { return this.getSource } },
|
||||
indices: {
|
||||
get () {
|
||||
if (this[kIndices] === null) {
|
||||
this[kIndices] = new IndicesApi(this.transport, this[kConfigurationError])
|
||||
}
|
||||
return this[kIndices]
|
||||
}
|
||||
},
|
||||
ingest: {
|
||||
get () {
|
||||
if (this[kIngest] === null) {
|
||||
this[kIngest] = new IngestApi(this.transport, this[kConfigurationError])
|
||||
}
|
||||
return this[kIngest]
|
||||
}
|
||||
},
|
||||
msearch_template: { get () { return this.msearchTemplate } },
|
||||
nodes: {
|
||||
get () {
|
||||
if (this[kNodes] === null) {
|
||||
this[kNodes] = new NodesApi(this.transport, this[kConfigurationError])
|
||||
}
|
||||
return this[kNodes]
|
||||
}
|
||||
},
|
||||
put_script: { get () { return this.putScript } },
|
||||
rank_eval: { get () { return this.rankEval } },
|
||||
reindex_rethrottle: { get () { return this.reindexRethrottle } },
|
||||
render_search_template: { get () { return this.renderSearchTemplate } },
|
||||
scripts_painless_execute: { get () { return this.scriptsPainlessExecute } },
|
||||
search_shards: { get () { return this.searchShards } },
|
||||
search_template: { get () { return this.searchTemplate } },
|
||||
snapshot: {
|
||||
get () {
|
||||
if (this[kSnapshot] === null) {
|
||||
this[kSnapshot] = new SnapshotApi(this.transport, this[kConfigurationError])
|
||||
}
|
||||
return this[kSnapshot]
|
||||
}
|
||||
},
|
||||
tasks: {
|
||||
get () {
|
||||
if (this[kTasks] === null) {
|
||||
this[kTasks] = new TasksApi(this.transport, this[kConfigurationError])
|
||||
}
|
||||
return this[kTasks]
|
||||
}
|
||||
},
|
||||
update_by_query: { get () { return this.updateByQuery } },
|
||||
update_by_query_rethrottle: { get () { return this.updateByQueryRethrottle } },
|
||||
asyncSearch: {
|
||||
get () {
|
||||
if (this[kAsyncSearch] === null) {
|
||||
this[kAsyncSearch] = new AsyncSearchApi(this.transport, this[kConfigurationError])
|
||||
}
|
||||
return this[kAsyncSearch]
|
||||
}
|
||||
},
|
||||
async_search: { get () { return this.asyncSearch } },
|
||||
autoscaling: {
|
||||
get () {
|
||||
if (this[kAutoscaling] === null) {
|
||||
this[kAutoscaling] = new AutoscalingApi(this.transport, this[kConfigurationError])
|
||||
}
|
||||
return this[kAutoscaling]
|
||||
}
|
||||
},
|
||||
ccr: {
|
||||
get () {
|
||||
if (this[kCcr] === null) {
|
||||
this[kCcr] = new CcrApi(this.transport, this[kConfigurationError])
|
||||
}
|
||||
return this[kCcr]
|
||||
}
|
||||
},
|
||||
close_point_in_time: { get () { return this.closePointInTime } },
|
||||
enrich: {
|
||||
get () {
|
||||
if (this[kEnrich] === null) {
|
||||
@ -336,6 +278,28 @@ Object.defineProperties(ESAPI.prototype, {
|
||||
return this[kEql]
|
||||
}
|
||||
},
|
||||
exists_source: { get () { return this.existsSource } },
|
||||
features: {
|
||||
get () {
|
||||
if (this[kFeatures] === null) {
|
||||
this[kFeatures] = new FeaturesApi(this.transport, this[kConfigurationError])
|
||||
}
|
||||
return this[kFeatures]
|
||||
}
|
||||
},
|
||||
field_caps: { get () { return this.fieldCaps } },
|
||||
fleet: {
|
||||
get () {
|
||||
if (this[kFleet] === null) {
|
||||
this[kFleet] = new FleetApi(this.transport, this[kConfigurationError])
|
||||
}
|
||||
return this[kFleet]
|
||||
}
|
||||
},
|
||||
get_script: { get () { return this.getScript } },
|
||||
get_script_context: { get () { return this.getScriptContext } },
|
||||
get_script_languages: { get () { return this.getScriptLanguages } },
|
||||
get_source: { get () { return this.getSource } },
|
||||
graph: {
|
||||
get () {
|
||||
if (this[kGraph] === null) {
|
||||
@ -352,6 +316,22 @@ Object.defineProperties(ESAPI.prototype, {
|
||||
return this[kIlm]
|
||||
}
|
||||
},
|
||||
indices: {
|
||||
get () {
|
||||
if (this[kIndices] === null) {
|
||||
this[kIndices] = new IndicesApi(this.transport, this[kConfigurationError])
|
||||
}
|
||||
return this[kIndices]
|
||||
}
|
||||
},
|
||||
ingest: {
|
||||
get () {
|
||||
if (this[kIngest] === null) {
|
||||
this[kIngest] = new IngestApi(this.transport, this[kConfigurationError])
|
||||
}
|
||||
return this[kIngest]
|
||||
}
|
||||
},
|
||||
license: {
|
||||
get () {
|
||||
if (this[kLicense] === null) {
|
||||
@ -392,7 +372,20 @@ Object.defineProperties(ESAPI.prototype, {
|
||||
return this[kMonitoring]
|
||||
}
|
||||
},
|
||||
msearch_template: { get () { return this.msearchTemplate } },
|
||||
nodes: {
|
||||
get () {
|
||||
if (this[kNodes] === null) {
|
||||
this[kNodes] = new NodesApi(this.transport, this[kConfigurationError])
|
||||
}
|
||||
return this[kNodes]
|
||||
}
|
||||
},
|
||||
open_point_in_time: { get () { return this.openPointInTime } },
|
||||
put_script: { get () { return this.putScript } },
|
||||
rank_eval: { get () { return this.rankEval } },
|
||||
reindex_rethrottle: { get () { return this.reindexRethrottle } },
|
||||
render_search_template: { get () { return this.renderSearchTemplate } },
|
||||
rollup: {
|
||||
get () {
|
||||
if (this[kRollup] === null) {
|
||||
@ -401,6 +394,9 @@ Object.defineProperties(ESAPI.prototype, {
|
||||
return this[kRollup]
|
||||
}
|
||||
},
|
||||
scripts_painless_execute: { get () { return this.scriptsPainlessExecute } },
|
||||
search_shards: { get () { return this.searchShards } },
|
||||
search_template: { get () { return this.searchTemplate } },
|
||||
searchableSnapshots: {
|
||||
get () {
|
||||
if (this[kSearchableSnapshots] === null) {
|
||||
@ -418,6 +414,14 @@ Object.defineProperties(ESAPI.prototype, {
|
||||
return this[kSecurity]
|
||||
}
|
||||
},
|
||||
shutdown: {
|
||||
get () {
|
||||
if (this[kShutdown] === null) {
|
||||
this[kShutdown] = new ShutdownApi(this.transport, this[kConfigurationError])
|
||||
}
|
||||
return this[kShutdown]
|
||||
}
|
||||
},
|
||||
slm: {
|
||||
get () {
|
||||
if (this[kSlm] === null) {
|
||||
@ -426,6 +430,14 @@ Object.defineProperties(ESAPI.prototype, {
|
||||
return this[kSlm]
|
||||
}
|
||||
},
|
||||
snapshot: {
|
||||
get () {
|
||||
if (this[kSnapshot] === null) {
|
||||
this[kSnapshot] = new SnapshotApi(this.transport, this[kConfigurationError])
|
||||
}
|
||||
return this[kSnapshot]
|
||||
}
|
||||
},
|
||||
sql: {
|
||||
get () {
|
||||
if (this[kSql] === null) {
|
||||
@ -442,6 +454,14 @@ Object.defineProperties(ESAPI.prototype, {
|
||||
return this[kSsl]
|
||||
}
|
||||
},
|
||||
tasks: {
|
||||
get () {
|
||||
if (this[kTasks] === null) {
|
||||
this[kTasks] = new TasksApi(this.transport, this[kConfigurationError])
|
||||
}
|
||||
return this[kTasks]
|
||||
}
|
||||
},
|
||||
textStructure: {
|
||||
get () {
|
||||
if (this[kTextStructure] === null) {
|
||||
@ -459,6 +479,8 @@ Object.defineProperties(ESAPI.prototype, {
|
||||
return this[kTransform]
|
||||
}
|
||||
},
|
||||
update_by_query: { get () { return this.updateByQuery } },
|
||||
update_by_query_rethrottle: { get () { return this.updateByQueryRethrottle } },
|
||||
watcher: {
|
||||
get () {
|
||||
if (this[kWatcher] === null) {
|
||||
|
||||
745
api/kibana.d.ts
vendored
745
api/kibana.d.ts
vendored
@ -32,14 +32,18 @@ import {
|
||||
import Helpers from '../lib/Helpers'
|
||||
import {
|
||||
ApiResponse,
|
||||
RequestBody,
|
||||
RequestNDBody,
|
||||
TransportRequestParams,
|
||||
TransportRequestOptions,
|
||||
TransportRequestPromise,
|
||||
Context
|
||||
TransportRequestParams,
|
||||
TransportRequestOptions
|
||||
} from '../lib/Transport'
|
||||
import * as RequestParams from './requestParams'
|
||||
import * as T from './types'
|
||||
|
||||
/**
|
||||
* We are still working on this type, it will arrive soon.
|
||||
* If it's critical for you, please open an issue.
|
||||
* https://github.com/elastic/elasticsearch-js
|
||||
*/
|
||||
type TODO = Record<string, any>
|
||||
|
||||
// Extend API
|
||||
interface ClientExtendsCallbackOptions {
|
||||
@ -74,423 +78,442 @@ interface KibanaClient {
|
||||
once(event: 'sniff', listener: (err: ApiError, meta: RequestEvent) => void): this;
|
||||
once(event: 'resurrect', listener: (err: null, meta: ResurrectEvent) => void): this;
|
||||
off(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
/* GENERATED */
|
||||
asyncSearch: {
|
||||
delete<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.AsyncSearchDelete, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
get<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.AsyncSearchGet, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
status<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.AsyncSearchStatus, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
submit<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.AsyncSearchSubmit<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
delete<TContext = unknown>(params: T.AsyncSearchDeleteRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.AsyncSearchDeleteResponse, TContext>>
|
||||
get<TDocument = unknown, TContext = unknown>(params: T.AsyncSearchGetRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.AsyncSearchGetResponse<TDocument>, TContext>>
|
||||
status<TDocument = unknown, TContext = unknown>(params: T.AsyncSearchStatusRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.AsyncSearchStatusResponse<TDocument>, TContext>>
|
||||
submit<TDocument = unknown, TContext = unknown>(params?: T.AsyncSearchSubmitRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.AsyncSearchSubmitResponse<TDocument>, TContext>>
|
||||
}
|
||||
autoscaling: {
|
||||
deleteAutoscalingPolicy<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.AutoscalingDeleteAutoscalingPolicy, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getAutoscalingCapacity<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.AutoscalingGetAutoscalingCapacity, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getAutoscalingPolicy<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.AutoscalingGetAutoscalingPolicy, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putAutoscalingPolicy<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.AutoscalingPutAutoscalingPolicy<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteAutoscalingPolicy<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getAutoscalingCapacity<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getAutoscalingPolicy<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
putAutoscalingPolicy<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
}
|
||||
bulk<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params?: RequestParams.Bulk<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
bulk<TSource = unknown, TContext = unknown>(params: T.BulkRequest<TSource>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.BulkResponse, TContext>>
|
||||
cat: {
|
||||
aliases<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CatAliases, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
allocation<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CatAllocation, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
count<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CatCount, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
fielddata<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CatFielddata, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
health<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CatHealth, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
help<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CatHelp, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
indices<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CatIndices, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
master<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CatMaster, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
mlDataFrameAnalytics<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CatMlDataFrameAnalytics, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
mlDatafeeds<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CatMlDatafeeds, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
mlJobs<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CatMlJobs, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
mlTrainedModels<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CatMlTrainedModels, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
nodeattrs<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CatNodeattrs, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
nodes<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CatNodes, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
pendingTasks<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CatPendingTasks, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
plugins<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CatPlugins, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
recovery<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CatRecovery, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
repositories<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CatRepositories, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
segments<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CatSegments, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
shards<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CatShards, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
snapshots<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CatSnapshots, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
tasks<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CatTasks, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
templates<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CatTemplates, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
threadPool<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CatThreadPool, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
transforms<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CatTransforms, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
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>>
|
||||
count<TContext = unknown>(params?: T.CatCountRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatCountResponse, TContext>>
|
||||
fielddata<TContext = unknown>(params?: T.CatFielddataRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatFielddataResponse, TContext>>
|
||||
health<TContext = unknown>(params?: T.CatHealthRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatHealthResponse, TContext>>
|
||||
help<TContext = unknown>(params?: T.CatHelpRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatHelpResponse, TContext>>
|
||||
indices<TContext = unknown>(params?: T.CatIndicesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatIndicesResponse, TContext>>
|
||||
master<TContext = unknown>(params?: T.CatMasterRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatMasterResponse, TContext>>
|
||||
mlDataFrameAnalytics<TContext = unknown>(params?: T.CatDataFrameAnalyticsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatDataFrameAnalyticsResponse, TContext>>
|
||||
mlDatafeeds<TContext = unknown>(params?: T.CatDatafeedsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatDatafeedsResponse, TContext>>
|
||||
mlJobs<TContext = unknown>(params?: T.CatJobsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatJobsResponse, TContext>>
|
||||
mlTrainedModels<TContext = unknown>(params?: T.CatTrainedModelsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatTrainedModelsResponse, TContext>>
|
||||
nodeattrs<TContext = unknown>(params?: T.CatNodeAttributesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatNodeAttributesResponse, TContext>>
|
||||
nodes<TContext = unknown>(params?: T.CatNodesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatNodesResponse, TContext>>
|
||||
pendingTasks<TContext = unknown>(params?: T.CatPendingTasksRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatPendingTasksResponse, TContext>>
|
||||
plugins<TContext = unknown>(params?: T.CatPluginsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatPluginsResponse, TContext>>
|
||||
recovery<TContext = unknown>(params?: T.CatRecoveryRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatRecoveryResponse, TContext>>
|
||||
repositories<TContext = unknown>(params?: T.CatRepositoriesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatRepositoriesResponse, TContext>>
|
||||
segments<TContext = unknown>(params?: T.CatSegmentsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatSegmentsResponse, TContext>>
|
||||
shards<TContext = unknown>(params?: T.CatShardsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatShardsResponse, TContext>>
|
||||
snapshots<TContext = unknown>(params?: T.CatSnapshotsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatSnapshotsResponse, TContext>>
|
||||
tasks<TContext = unknown>(params?: T.CatTasksRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatTasksResponse, TContext>>
|
||||
templates<TContext = unknown>(params?: T.CatTemplatesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatTemplatesResponse, TContext>>
|
||||
threadPool<TContext = unknown>(params?: T.CatThreadPoolRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatThreadPoolResponse, TContext>>
|
||||
transforms<TContext = unknown>(params?: T.CatTransformsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CatTransformsResponse, TContext>>
|
||||
}
|
||||
ccr: {
|
||||
deleteAutoFollowPattern<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CcrDeleteAutoFollowPattern, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
follow<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.CcrFollow<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
followInfo<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CcrFollowInfo, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
followStats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CcrFollowStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
forgetFollower<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.CcrForgetFollower<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getAutoFollowPattern<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CcrGetAutoFollowPattern, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
pauseAutoFollowPattern<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CcrPauseAutoFollowPattern, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
pauseFollow<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CcrPauseFollow, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putAutoFollowPattern<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.CcrPutAutoFollowPattern<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
resumeAutoFollowPattern<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CcrResumeAutoFollowPattern, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
resumeFollow<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.CcrResumeFollow<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
stats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CcrStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
unfollow<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.CcrUnfollow, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteAutoFollowPattern<TContext = unknown>(params: T.DeleteAutoFollowPatternRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteAutoFollowPatternResponse, TContext>>
|
||||
follow<TContext = unknown>(params: T.CreateFollowIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CreateFollowIndexResponse, TContext>>
|
||||
followInfo<TContext = unknown>(params: T.FollowInfoRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.FollowInfoResponse, TContext>>
|
||||
followStats<TContext = unknown>(params: T.FollowIndexStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.FollowIndexStatsResponse, TContext>>
|
||||
forgetFollower<TContext = unknown>(params: T.ForgetFollowerIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ForgetFollowerIndexResponse, TContext>>
|
||||
getAutoFollowPattern<TContext = unknown>(params?: T.GetAutoFollowPatternRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetAutoFollowPatternResponse, TContext>>
|
||||
pauseAutoFollowPattern<TContext = unknown>(params: T.PauseAutoFollowPatternRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PauseAutoFollowPatternResponse, TContext>>
|
||||
pauseFollow<TContext = unknown>(params: T.PauseFollowIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PauseFollowIndexResponse, TContext>>
|
||||
putAutoFollowPattern<TContext = unknown>(params: T.PutAutoFollowPatternRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutAutoFollowPatternResponse, TContext>>
|
||||
resumeAutoFollowPattern<TContext = unknown>(params: T.ResumeAutoFollowPatternRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ResumeAutoFollowPatternResponse, TContext>>
|
||||
resumeFollow<TContext = unknown>(params: T.ResumeFollowIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ResumeFollowIndexResponse, TContext>>
|
||||
stats<TContext = unknown>(params?: T.CcrStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CcrStatsResponse, TContext>>
|
||||
unfollow<TContext = unknown>(params: T.UnfollowIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.UnfollowIndexResponse, TContext>>
|
||||
}
|
||||
clearScroll<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.ClearScroll<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
closePointInTime<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.ClosePointInTime<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
clearScroll<TContext = unknown>(params?: T.ClearScrollRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClearScrollResponse, TContext>>
|
||||
closePointInTime<TContext = unknown>(params?: T.ClosePointInTimeRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClosePointInTimeResponse, TContext>>
|
||||
cluster: {
|
||||
allocationExplain<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.ClusterAllocationExplain<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteComponentTemplate<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.ClusterDeleteComponentTemplate, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteVotingConfigExclusions<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.ClusterDeleteVotingConfigExclusions, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
existsComponentTemplate<TResponse = boolean, TContext = Context>(params?: RequestParams.ClusterExistsComponentTemplate, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getComponentTemplate<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.ClusterGetComponentTemplate, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getSettings<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.ClusterGetSettings, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
health<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.ClusterHealth, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
pendingTasks<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.ClusterPendingTasks, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
postVotingConfigExclusions<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.ClusterPostVotingConfigExclusions, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putComponentTemplate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.ClusterPutComponentTemplate<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putSettings<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.ClusterPutSettings<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
remoteInfo<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.ClusterRemoteInfo, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
reroute<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.ClusterReroute<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
state<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.ClusterState, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
stats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.ClusterStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
allocationExplain<TContext = unknown>(params?: T.ClusterAllocationExplainRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClusterAllocationExplainResponse, TContext>>
|
||||
deleteComponentTemplate<TContext = unknown>(params: T.ClusterDeleteComponentTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClusterDeleteComponentTemplateResponse, TContext>>
|
||||
deleteVotingConfigExclusions<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
existsComponentTemplate<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getComponentTemplate<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getSettings<TContext = unknown>(params?: T.ClusterGetSettingsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClusterGetSettingsResponse, TContext>>
|
||||
health<TContext = unknown>(params?: T.ClusterHealthRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClusterHealthResponse, TContext>>
|
||||
pendingTasks<TContext = unknown>(params?: T.ClusterPendingTasksRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClusterPendingTasksResponse, TContext>>
|
||||
postVotingConfigExclusions<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
putComponentTemplate<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
putSettings<TContext = unknown>(params?: T.ClusterPutSettingsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClusterPutSettingsResponse, TContext>>
|
||||
remoteInfo<TContext = unknown>(params?: T.RemoteInfoRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RemoteInfoResponse, TContext>>
|
||||
reroute<TContext = unknown>(params?: T.ClusterRerouteRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClusterRerouteResponse, TContext>>
|
||||
state<TContext = unknown>(params?: T.ClusterStateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClusterStateResponse, TContext>>
|
||||
stats<TContext = unknown>(params?: T.ClusterStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClusterStatsResponse, TContext>>
|
||||
}
|
||||
count<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.Count<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
create<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.Create<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
count<TContext = unknown>(params?: T.CountRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CountResponse, TContext>>
|
||||
create<TDocument = unknown, TContext = unknown>(params: T.CreateRequest<TDocument>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CreateResponse, TContext>>
|
||||
danglingIndices: {
|
||||
deleteDanglingIndex<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.DanglingIndicesDeleteDanglingIndex, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
importDanglingIndex<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.DanglingIndicesImportDanglingIndex, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
listDanglingIndices<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.DanglingIndicesListDanglingIndices, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteDanglingIndex<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
importDanglingIndex<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
listDanglingIndices<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
}
|
||||
delete<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.Delete, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteByQuery<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.DeleteByQuery<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteByQueryRethrottle<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.DeleteByQueryRethrottle, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteScript<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.DeleteScript, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
dataFrameTransformDeprecated: {
|
||||
deleteTransform<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getTransform<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getTransformStats<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
previewTransform<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
putTransform<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
startTransform<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
stopTransform<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
updateTransform<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
}
|
||||
delete<TContext = unknown>(params: T.DeleteRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteResponse, TContext>>
|
||||
deleteByQuery<TContext = unknown>(params: T.DeleteByQueryRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteByQueryResponse, TContext>>
|
||||
deleteByQueryRethrottle<TContext = unknown>(params: T.DeleteByQueryRethrottleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteByQueryRethrottleResponse, TContext>>
|
||||
deleteScript<TContext = unknown>(params: T.DeleteScriptRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteScriptResponse, TContext>>
|
||||
enrich: {
|
||||
deletePolicy<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.EnrichDeletePolicy, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
executePolicy<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.EnrichExecutePolicy, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getPolicy<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.EnrichGetPolicy, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putPolicy<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.EnrichPutPolicy<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
stats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.EnrichStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deletePolicy<TContext = unknown>(params: T.DeleteEnrichPolicyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteEnrichPolicyResponse, TContext>>
|
||||
executePolicy<TContext = unknown>(params: T.ExecuteEnrichPolicyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ExecuteEnrichPolicyResponse, TContext>>
|
||||
getPolicy<TContext = unknown>(params?: T.GetEnrichPolicyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetEnrichPolicyResponse, TContext>>
|
||||
putPolicy<TContext = unknown>(params: T.PutEnrichPolicyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutEnrichPolicyResponse, TContext>>
|
||||
stats<TContext = unknown>(params?: T.EnrichStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.EnrichStatsResponse, TContext>>
|
||||
}
|
||||
eql: {
|
||||
delete<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.EqlDelete, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
get<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.EqlGet, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getStatus<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.EqlGetStatus, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
search<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.EqlSearch<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
delete<TContext = unknown>(params: T.EqlDeleteRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.EqlDeleteResponse, TContext>>
|
||||
get<TEvent = unknown, TContext = unknown>(params: T.EqlGetRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.EqlGetResponse<TEvent>, TContext>>
|
||||
getStatus<TContext = unknown>(params: T.EqlGetStatusRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.EqlGetStatusResponse, TContext>>
|
||||
search<TEvent = unknown, TContext = unknown>(params: T.EqlSearchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.EqlSearchResponse<TEvent>, TContext>>
|
||||
}
|
||||
exists<TResponse = boolean, TContext = Context>(params?: RequestParams.Exists, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
existsSource<TResponse = boolean, TContext = Context>(params?: RequestParams.ExistsSource, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
explain<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.Explain<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
exists<TContext = unknown>(params: T.DocumentExistsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DocumentExistsResponse, TContext>>
|
||||
existsSource<TContext = unknown>(params: T.SourceExistsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SourceExistsResponse, TContext>>
|
||||
explain<TDocument = unknown, TContext = unknown>(params: T.ExplainRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ExplainResponse<TDocument>, TContext>>
|
||||
features: {
|
||||
getFeatures<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.FeaturesGetFeatures, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getFeatures<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
resetFeatures<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
}
|
||||
fieldCaps<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.FieldCaps<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
get<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.Get, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getScript<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.GetScript, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getScriptContext<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.GetScriptContext, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getScriptLanguages<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.GetScriptLanguages, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getSource<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.GetSource, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
fieldCaps<TContext = unknown>(params?: T.FieldCapabilitiesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.FieldCapabilitiesResponse, TContext>>
|
||||
get<TDocument = unknown, TContext = unknown>(params: T.GetRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetResponse<TDocument>, TContext>>
|
||||
getScript<TContext = unknown>(params: T.GetScriptRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetScriptResponse, TContext>>
|
||||
getScriptContext<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getScriptLanguages<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getSource<TDocument = unknown, TContext = unknown>(params: T.SourceRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SourceResponse<TDocument>, TContext>>
|
||||
graph: {
|
||||
explore<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.GraphExplore<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
explore<TContext = unknown>(params: T.GraphExploreRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GraphExploreResponse, TContext>>
|
||||
}
|
||||
ilm: {
|
||||
deleteLifecycle<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IlmDeleteLifecycle, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
explainLifecycle<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IlmExplainLifecycle, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getLifecycle<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IlmGetLifecycle, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getStatus<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IlmGetStatus, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
moveToStep<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IlmMoveToStep<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putLifecycle<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IlmPutLifecycle<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
removePolicy<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IlmRemovePolicy, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
retry<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IlmRetry, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
start<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IlmStart, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
stop<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IlmStop, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteLifecycle<TContext = unknown>(params: T.DeleteLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteLifecycleResponse, TContext>>
|
||||
explainLifecycle<TContext = unknown>(params: T.ExplainLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ExplainLifecycleResponse, TContext>>
|
||||
getLifecycle<TContext = unknown>(params?: T.GetLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetLifecycleResponse, TContext>>
|
||||
getStatus<TContext = unknown>(params?: T.GetIlmStatusRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetIlmStatusResponse, TContext>>
|
||||
moveToStep<TContext = unknown>(params: T.MoveToStepRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MoveToStepResponse, TContext>>
|
||||
putLifecycle<TContext = unknown>(params?: T.PutLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutLifecycleResponse, TContext>>
|
||||
removePolicy<TContext = unknown>(params: T.RemovePolicyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RemovePolicyResponse, TContext>>
|
||||
retry<TContext = unknown>(params: T.RetryIlmRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RetryIlmResponse, TContext>>
|
||||
start<TContext = unknown>(params?: T.StartIlmRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.StartIlmResponse, TContext>>
|
||||
stop<TContext = unknown>(params?: T.StopIlmRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.StopIlmResponse, TContext>>
|
||||
}
|
||||
index<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.Index<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
index<TDocument = unknown, TContext = unknown>(params: T.IndexRequest<TDocument>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndexResponse, TContext>>
|
||||
indices: {
|
||||
addBlock<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesAddBlock, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
analyze<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesAnalyze<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
clearCache<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesClearCache, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
clone<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesClone<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
close<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesClose, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
create<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesCreate<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
createDataStream<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesCreateDataStream, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
dataStreamsStats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesDataStreamsStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
delete<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesDelete, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteAlias<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesDeleteAlias, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteDataStream<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesDeleteDataStream, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteIndexTemplate<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesDeleteIndexTemplate, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteTemplate<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesDeleteTemplate, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
exists<TResponse = boolean, TContext = Context>(params?: RequestParams.IndicesExists, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
existsAlias<TResponse = boolean, TContext = Context>(params?: RequestParams.IndicesExistsAlias, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
existsIndexTemplate<TResponse = boolean, TContext = Context>(params?: RequestParams.IndicesExistsIndexTemplate, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
existsTemplate<TResponse = boolean, TContext = Context>(params?: RequestParams.IndicesExistsTemplate, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
existsType<TResponse = boolean, TContext = Context>(params?: RequestParams.IndicesExistsType, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
flush<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesFlush, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
flushSynced<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesFlushSynced, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
forcemerge<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesForcemerge, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
freeze<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesFreeze, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
get<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesGet, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getAlias<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesGetAlias, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getDataStream<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesGetDataStream, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getFieldMapping<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesGetFieldMapping, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getIndexTemplate<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesGetIndexTemplate, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getMapping<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesGetMapping, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getSettings<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesGetSettings, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getTemplate<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesGetTemplate, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getUpgrade<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesGetUpgrade, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
migrateToDataStream<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesMigrateToDataStream, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
open<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesOpen, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
promoteDataStream<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesPromoteDataStream, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putAlias<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesPutAlias<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putIndexTemplate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesPutIndexTemplate<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putMapping<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesPutMapping<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putSettings<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesPutSettings<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putTemplate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesPutTemplate<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
recovery<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesRecovery, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
refresh<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesRefresh, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
reloadSearchAnalyzers<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesReloadSearchAnalyzers, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
resolveIndex<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesResolveIndex, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
rollover<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesRollover<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
segments<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesSegments, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
shardStores<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesShardStores, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
shrink<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesShrink<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
simulateIndexTemplate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesSimulateIndexTemplate<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
simulateTemplate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesSimulateTemplate<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
split<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesSplit<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
stats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
unfreeze<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesUnfreeze, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
updateAliases<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesUpdateAliases<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
upgrade<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesUpgrade, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
validateQuery<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IndicesValidateQuery<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
addBlock<TContext = unknown>(params: T.IndexAddBlockRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndexAddBlockResponse, TContext>>
|
||||
analyze<TContext = unknown>(params?: T.AnalyzeRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.AnalyzeResponse, TContext>>
|
||||
clearCache<TContext = unknown>(params?: T.ClearCacheRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClearCacheResponse, TContext>>
|
||||
clone<TContext = unknown>(params: T.CloneIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CloneIndexResponse, TContext>>
|
||||
close<TContext = unknown>(params: T.CloseIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CloseIndexResponse, TContext>>
|
||||
create<TContext = unknown>(params: T.CreateIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CreateIndexResponse, TContext>>
|
||||
createDataStream<TContext = unknown>(params: T.IndicesCreateDataStreamRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesCreateDataStreamResponse, TContext>>
|
||||
dataStreamsStats<TContext = unknown>(params?: T.IndicesDataStreamsStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesDataStreamsStatsResponse, TContext>>
|
||||
delete<TContext = unknown>(params: T.DeleteIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteIndexResponse, TContext>>
|
||||
deleteAlias<TContext = unknown>(params: T.DeleteAliasRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteAliasResponse, TContext>>
|
||||
deleteDataStream<TContext = unknown>(params: T.IndicesDeleteDataStreamRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesDeleteDataStreamResponse, TContext>>
|
||||
deleteIndexTemplate<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
deleteTemplate<TContext = unknown>(params: T.DeleteIndexTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteIndexTemplateResponse, TContext>>
|
||||
exists<TContext = unknown>(params: T.IndexExistsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndexExistsResponse, TContext>>
|
||||
existsAlias<TContext = unknown>(params: T.AliasExistsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.AliasExistsResponse, TContext>>
|
||||
existsIndexTemplate<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
existsTemplate<TContext = unknown>(params: T.IndexTemplateExistsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndexTemplateExistsResponse, TContext>>
|
||||
existsType<TContext = unknown>(params: T.TypeExistsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.TypeExistsResponse, TContext>>
|
||||
flush<TContext = unknown>(params?: T.FlushRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.FlushResponse, TContext>>
|
||||
flushSynced<TContext = unknown>(params?: T.SyncedFlushRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SyncedFlushResponse, TContext>>
|
||||
forcemerge<TContext = unknown>(params?: T.ForceMergeRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ForceMergeResponse, TContext>>
|
||||
freeze<TContext = unknown>(params: T.FreezeIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.FreezeIndexResponse, TContext>>
|
||||
get<TContext = unknown>(params: T.GetIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetIndexResponse, TContext>>
|
||||
getAlias<TContext = unknown>(params?: T.GetAliasRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetAliasResponse, TContext>>
|
||||
getDataStream<TContext = unknown>(params?: T.IndicesGetDataStreamRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesGetDataStreamResponse, TContext>>
|
||||
getFieldMapping<TContext = unknown>(params: T.GetFieldMappingRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetFieldMappingResponse, TContext>>
|
||||
getIndexTemplate<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getMapping<TContext = unknown>(params?: T.GetMappingRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetMappingResponse, TContext>>
|
||||
getSettings<TContext = unknown>(params?: T.GetIndexSettingsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetIndexSettingsResponse, TContext>>
|
||||
getTemplate<TContext = unknown>(params?: T.GetIndexTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetIndexTemplateResponse, TContext>>
|
||||
getUpgrade<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
migrateToDataStream<TContext = unknown>(params: T.IndicesMigrateToDataStreamRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesMigrateToDataStreamResponse, TContext>>
|
||||
open<TContext = unknown>(params: T.OpenIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.OpenIndexResponse, TContext>>
|
||||
promoteDataStream<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
putAlias<TContext = unknown>(params: T.PutAliasRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutAliasResponse, TContext>>
|
||||
putIndexTemplate<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
putMapping<TContext = unknown>(params?: T.PutMappingRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutMappingResponse, TContext>>
|
||||
putSettings<TContext = unknown>(params?: T.UpdateIndexSettingsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.UpdateIndexSettingsResponse, TContext>>
|
||||
putTemplate<TContext = unknown>(params: T.PutIndexTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutIndexTemplateResponse, TContext>>
|
||||
recovery<TContext = unknown>(params?: T.RecoveryStatusRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RecoveryStatusResponse, TContext>>
|
||||
refresh<TContext = unknown>(params?: T.RefreshRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RefreshResponse, TContext>>
|
||||
reloadSearchAnalyzers<TContext = unknown>(params: T.ReloadSearchAnalyzersRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ReloadSearchAnalyzersResponse, TContext>>
|
||||
resolveIndex<TContext = unknown>(params: T.ResolveIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ResolveIndexResponse, TContext>>
|
||||
rollover<TContext = unknown>(params: T.RolloverIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RolloverIndexResponse, TContext>>
|
||||
segments<TContext = unknown>(params?: T.SegmentsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SegmentsResponse, TContext>>
|
||||
shardStores<TContext = unknown>(params?: T.IndicesShardStoresRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesShardStoresResponse, TContext>>
|
||||
shrink<TContext = unknown>(params: T.ShrinkIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ShrinkIndexResponse, TContext>>
|
||||
simulateIndexTemplate<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
simulateTemplate<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
split<TContext = unknown>(params: T.SplitIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SplitIndexResponse, TContext>>
|
||||
stats<TContext = unknown>(params?: T.IndicesStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.IndicesStatsResponse, TContext>>
|
||||
unfreeze<TContext = unknown>(params: T.UnfreezeIndexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.UnfreezeIndexResponse, TContext>>
|
||||
updateAliases<TContext = unknown>(params?: T.BulkAliasRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.BulkAliasResponse, TContext>>
|
||||
upgrade<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
validateQuery<TContext = unknown>(params?: T.ValidateQueryRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ValidateQueryResponse, TContext>>
|
||||
}
|
||||
info<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.Info, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
info<TContext = unknown>(params?: T.RootNodeInfoRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RootNodeInfoResponse, TContext>>
|
||||
ingest: {
|
||||
deletePipeline<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IngestDeletePipeline, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getPipeline<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IngestGetPipeline, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
processorGrok<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IngestProcessorGrok, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putPipeline<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IngestPutPipeline<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
simulate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.IngestSimulate<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deletePipeline<TContext = unknown>(params: T.DeletePipelineRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeletePipelineResponse, TContext>>
|
||||
geoIpStats<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getPipeline<TContext = unknown>(params?: T.GetPipelineRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetPipelineResponse, TContext>>
|
||||
processorGrok<TContext = unknown>(params?: T.GrokProcessorPatternsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GrokProcessorPatternsResponse, TContext>>
|
||||
putPipeline<TContext = unknown>(params: T.PutPipelineRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutPipelineResponse, TContext>>
|
||||
simulate<TContext = unknown>(params?: T.SimulatePipelineRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SimulatePipelineResponse, TContext>>
|
||||
}
|
||||
license: {
|
||||
delete<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LicenseDelete, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
get<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LicenseGet, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getBasicStatus<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LicenseGetBasicStatus, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getTrialStatus<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LicenseGetTrialStatus, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
post<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.LicensePost<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
postStartBasic<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LicensePostStartBasic, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
postStartTrial<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LicensePostStartTrial, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
delete<TContext = unknown>(params?: T.DeleteLicenseRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteLicenseResponse, TContext>>
|
||||
get<TContext = unknown>(params?: T.GetLicenseRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetLicenseResponse, TContext>>
|
||||
getBasicStatus<TContext = unknown>(params?: T.GetBasicLicenseStatusRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetBasicLicenseStatusResponse, TContext>>
|
||||
getTrialStatus<TContext = unknown>(params?: T.GetTrialLicenseStatusRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetTrialLicenseStatusResponse, TContext>>
|
||||
post<TContext = unknown>(params?: T.PostLicenseRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PostLicenseResponse, TContext>>
|
||||
postStartBasic<TContext = unknown>(params?: T.StartBasicLicenseRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.StartBasicLicenseResponse, TContext>>
|
||||
postStartTrial<TContext = unknown>(params?: T.StartTrialLicenseRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.StartTrialLicenseResponse, TContext>>
|
||||
}
|
||||
logstash: {
|
||||
deletePipeline<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashDeletePipeline, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getPipeline<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashGetPipeline, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putPipeline<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.LogstashPutPipeline<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deletePipeline<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getPipeline<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
putPipeline<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
}
|
||||
mget<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.Mget<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
mget<TDocument = unknown, TContext = unknown>(params?: T.MultiGetRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MultiGetResponse<TDocument>, TContext>>
|
||||
migration: {
|
||||
deprecations<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MigrationDeprecations, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deprecations<TContext = unknown>(params?: T.DeprecationInfoRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeprecationInfoResponse, TContext>>
|
||||
}
|
||||
ml: {
|
||||
closeJob<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlCloseJob<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteCalendar<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlDeleteCalendar, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteCalendarEvent<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlDeleteCalendarEvent, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteCalendarJob<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlDeleteCalendarJob, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteDataFrameAnalytics<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlDeleteDataFrameAnalytics, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteDatafeed<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlDeleteDatafeed, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteExpiredData<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlDeleteExpiredData<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteFilter<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlDeleteFilter, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteForecast<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlDeleteForecast, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteJob<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlDeleteJob, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteModelSnapshot<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlDeleteModelSnapshot, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteTrainedModel<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlDeleteTrainedModel, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
estimateModelMemory<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlEstimateModelMemory<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
evaluateDataFrame<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlEvaluateDataFrame<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
explainDataFrameAnalytics<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlExplainDataFrameAnalytics<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
flushJob<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlFlushJob<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
forecast<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlForecast, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getBuckets<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlGetBuckets<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getCalendarEvents<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlGetCalendarEvents, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getCalendars<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlGetCalendars<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getCategories<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlGetCategories<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getDataFrameAnalytics<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlGetDataFrameAnalytics, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getDataFrameAnalyticsStats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlGetDataFrameAnalyticsStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getDatafeedStats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlGetDatafeedStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getDatafeeds<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlGetDatafeeds, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getFilters<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlGetFilters, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getInfluencers<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlGetInfluencers<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getJobStats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlGetJobStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getJobs<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlGetJobs, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getModelSnapshots<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlGetModelSnapshots<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getOverallBuckets<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlGetOverallBuckets<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getRecords<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlGetRecords<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getTrainedModels<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlGetTrainedModels, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getTrainedModelsStats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlGetTrainedModelsStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
info<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlInfo, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
openJob<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlOpenJob, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
postCalendarEvents<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlPostCalendarEvents<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
postData<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlPostData<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
previewDatafeed<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlPreviewDatafeed, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putCalendar<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlPutCalendar<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putCalendarJob<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlPutCalendarJob, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putDataFrameAnalytics<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlPutDataFrameAnalytics<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putDatafeed<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlPutDatafeed<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putFilter<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlPutFilter<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putJob<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlPutJob<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putTrainedModel<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlPutTrainedModel<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
revertModelSnapshot<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlRevertModelSnapshot<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
setUpgradeMode<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlSetUpgradeMode, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
startDataFrameAnalytics<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlStartDataFrameAnalytics<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
startDatafeed<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlStartDatafeed<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
stopDataFrameAnalytics<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlStopDataFrameAnalytics<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
stopDatafeed<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlStopDatafeed<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
updateDataFrameAnalytics<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlUpdateDataFrameAnalytics<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
updateDatafeed<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlUpdateDatafeed<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
updateFilter<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlUpdateFilter<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
updateJob<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlUpdateJob<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
updateModelSnapshot<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlUpdateModelSnapshot<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
upgradeJobSnapshot<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlUpgradeJobSnapshot, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
validate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlValidate<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
validateDetector<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlValidateDetector<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
closeJob<TContext = unknown>(params: T.CloseJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CloseJobResponse, TContext>>
|
||||
deleteCalendar<TContext = unknown>(params: T.DeleteCalendarRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteCalendarResponse, TContext>>
|
||||
deleteCalendarEvent<TContext = unknown>(params: T.DeleteCalendarEventRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteCalendarEventResponse, TContext>>
|
||||
deleteCalendarJob<TContext = unknown>(params: T.DeleteCalendarJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteCalendarJobResponse, TContext>>
|
||||
deleteDataFrameAnalytics<TContext = unknown>(params: T.DeleteDataFrameAnalyticsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteDataFrameAnalyticsResponse, TContext>>
|
||||
deleteDatafeed<TContext = unknown>(params: T.DeleteDatafeedRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteDatafeedResponse, TContext>>
|
||||
deleteExpiredData<TContext = unknown>(params?: T.DeleteExpiredDataRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteExpiredDataResponse, TContext>>
|
||||
deleteFilter<TContext = unknown>(params: T.DeleteFilterRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteFilterResponse, TContext>>
|
||||
deleteForecast<TContext = unknown>(params: T.DeleteForecastRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteForecastResponse, TContext>>
|
||||
deleteJob<TContext = unknown>(params: T.DeleteJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteJobResponse, TContext>>
|
||||
deleteModelSnapshot<TContext = unknown>(params: T.DeleteModelSnapshotRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteModelSnapshotResponse, TContext>>
|
||||
deleteTrainedModel<TContext = unknown>(params: T.DeleteTrainedModelRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteTrainedModelResponse, TContext>>
|
||||
deleteTrainedModelAlias<TContext = unknown>(params: T.DeleteTrainedModelAliasRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteTrainedModelAliasResponse, TContext>>
|
||||
estimateModelMemory<TContext = unknown>(params?: T.EstimateModelMemoryRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.EstimateModelMemoryResponse, TContext>>
|
||||
evaluateDataFrame<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
explainDataFrameAnalytics<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
findFileStructure<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
flushJob<TContext = unknown>(params: T.FlushJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.FlushJobResponse, TContext>>
|
||||
forecast<TContext = unknown>(params: T.ForecastJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ForecastJobResponse, TContext>>
|
||||
getBuckets<TContext = unknown>(params: T.GetBucketsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetBucketsResponse, TContext>>
|
||||
getCalendarEvents<TContext = unknown>(params: T.GetCalendarEventsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetCalendarEventsResponse, TContext>>
|
||||
getCalendars<TContext = unknown>(params?: T.GetCalendarsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetCalendarsResponse, TContext>>
|
||||
getCategories<TContext = unknown>(params: T.GetCategoriesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetCategoriesResponse, TContext>>
|
||||
getDataFrameAnalytics<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getDataFrameAnalyticsStats<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getDatafeedStats<TContext = unknown>(params?: T.GetDatafeedStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetDatafeedStatsResponse, TContext>>
|
||||
getDatafeeds<TContext = unknown>(params?: T.GetDatafeedsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetDatafeedsResponse, TContext>>
|
||||
getFilters<TContext = unknown>(params?: T.GetFiltersRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetFiltersResponse, TContext>>
|
||||
getInfluencers<TContext = unknown>(params: T.GetInfluencersRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetInfluencersResponse, TContext>>
|
||||
getJobStats<TContext = unknown>(params?: T.GetJobStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetJobStatsResponse, TContext>>
|
||||
getJobs<TContext = unknown>(params?: T.GetJobsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetJobsResponse, TContext>>
|
||||
getModelSnapshots<TContext = unknown>(params: T.GetModelSnapshotsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetModelSnapshotsResponse, TContext>>
|
||||
getOverallBuckets<TContext = unknown>(params: T.GetOverallBucketsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetOverallBucketsResponse, TContext>>
|
||||
getRecords<TContext = unknown>(params: T.GetAnomalyRecordsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetAnomalyRecordsResponse, TContext>>
|
||||
getTrainedModels<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getTrainedModelsStats<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
info<TContext = unknown>(params?: T.MachineLearningInfoRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MachineLearningInfoResponse, TContext>>
|
||||
openJob<TContext = unknown>(params: T.OpenJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.OpenJobResponse, TContext>>
|
||||
postCalendarEvents<TContext = unknown>(params: T.PostCalendarEventsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PostCalendarEventsResponse, TContext>>
|
||||
postData<TContext = unknown>(params: T.PostJobDataRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PostJobDataResponse, TContext>>
|
||||
previewDataFrameAnalytics<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
previewDatafeed<TDocument = unknown, TContext = unknown>(params: T.PreviewDatafeedRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PreviewDatafeedResponse<TDocument>, TContext>>
|
||||
putCalendar<TContext = unknown>(params: T.PutCalendarRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutCalendarResponse, TContext>>
|
||||
putCalendarJob<TContext = unknown>(params: T.PutCalendarJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutCalendarJobResponse, TContext>>
|
||||
putDataFrameAnalytics<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
putDatafeed<TContext = unknown>(params: T.PutDatafeedRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutDatafeedResponse, TContext>>
|
||||
putFilter<TContext = unknown>(params: T.PutFilterRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutFilterResponse, TContext>>
|
||||
putJob<TContext = unknown>(params: T.PutJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutJobResponse, TContext>>
|
||||
putTrainedModel<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
putTrainedModelAlias<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
revertModelSnapshot<TContext = unknown>(params: T.RevertModelSnapshotRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RevertModelSnapshotResponse, TContext>>
|
||||
setUpgradeMode<TContext = unknown>(params?: T.SetUpgradeModeRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SetUpgradeModeResponse, TContext>>
|
||||
startDataFrameAnalytics<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
startDatafeed<TContext = unknown>(params: T.StartDatafeedRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.StartDatafeedResponse, TContext>>
|
||||
stopDataFrameAnalytics<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
stopDatafeed<TContext = unknown>(params: T.StopDatafeedRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.StopDatafeedResponse, TContext>>
|
||||
updateDataFrameAnalytics<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
updateDatafeed<TContext = unknown>(params: T.UpdateDatafeedRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.UpdateDatafeedResponse, TContext>>
|
||||
updateFilter<TContext = unknown>(params: T.UpdateFilterRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.UpdateFilterResponse, TContext>>
|
||||
updateJob<TContext = unknown>(params: T.UpdateJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.UpdateJobResponse, TContext>>
|
||||
updateModelSnapshot<TContext = unknown>(params: T.UpdateModelSnapshotRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.UpdateModelSnapshotResponse, TContext>>
|
||||
upgradeJobSnapshot<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
validate<TContext = unknown>(params?: T.ValidateJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ValidateJobResponse, TContext>>
|
||||
validateDetector<TContext = unknown>(params?: T.ValidateDetectorRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ValidateDetectorResponse, TContext>>
|
||||
}
|
||||
monitoring: {
|
||||
bulk<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params?: RequestParams.MonitoringBulk<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
bulk<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
}
|
||||
msearch<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params?: RequestParams.Msearch<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
msearchTemplate<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params?: RequestParams.MsearchTemplate<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
mtermvectors<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.Mtermvectors<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
msearch<TDocument = unknown, TContext = unknown>(params?: T.MultiSearchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MultiSearchResponse<TDocument>, TContext>>
|
||||
msearchTemplate<TContext = unknown>(params?: T.MultiSearchTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MultiSearchTemplateResponse, TContext>>
|
||||
mtermvectors<TContext = unknown>(params?: T.MultiTermVectorsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.MultiTermVectorsResponse, TContext>>
|
||||
nodes: {
|
||||
hotThreads<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.NodesHotThreads, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
info<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.NodesInfo, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
reloadSecureSettings<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.NodesReloadSecureSettings<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
stats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.NodesStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
usage<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.NodesUsage, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
hotThreads<TContext = unknown>(params?: T.NodesHotThreadsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.NodesHotThreadsResponse, TContext>>
|
||||
info<TContext = unknown>(params?: T.NodesInfoRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.NodesInfoResponse, TContext>>
|
||||
reloadSecureSettings<TContext = unknown>(params?: T.ReloadSecureSettingsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ReloadSecureSettingsResponse, TContext>>
|
||||
stats<TContext = unknown>(params?: T.NodesStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.NodesStatsResponse, TContext>>
|
||||
usage<TContext = unknown>(params?: T.NodesUsageRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.NodesUsageResponse, TContext>>
|
||||
}
|
||||
openPointInTime<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.OpenPointInTime, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
ping<TResponse = boolean, TContext = Context>(params?: RequestParams.Ping, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putScript<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.PutScript<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
rankEval<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.RankEval<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
reindex<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.Reindex<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
reindexRethrottle<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.ReindexRethrottle, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
renderSearchTemplate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.RenderSearchTemplate<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
openPointInTime<TContext = unknown>(params: T.OpenPointInTimeRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.OpenPointInTimeResponse, TContext>>
|
||||
ping<TContext = unknown>(params?: T.PingRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PingResponse, TContext>>
|
||||
putScript<TContext = unknown>(params: T.PutScriptRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutScriptResponse, TContext>>
|
||||
rankEval<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
reindex<TContext = unknown>(params?: T.ReindexRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ReindexResponse, TContext>>
|
||||
reindexRethrottle<TContext = unknown>(params: T.ReindexRethrottleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ReindexRethrottleResponse, TContext>>
|
||||
renderSearchTemplate<TContext = unknown>(params?: T.RenderSearchTemplateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RenderSearchTemplateResponse, TContext>>
|
||||
rollup: {
|
||||
deleteJob<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.RollupDeleteJob, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getJobs<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.RollupGetJobs, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getRollupCaps<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.RollupGetRollupCaps, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getRollupIndexCaps<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.RollupGetRollupIndexCaps, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putJob<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.RollupPutJob<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
rollup<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.RollupRollup<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
rollupSearch<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.RollupRollupSearch<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
startJob<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.RollupStartJob, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
stopJob<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.RollupStopJob, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteJob<TContext = unknown>(params: T.DeleteRollupJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteRollupJobResponse, TContext>>
|
||||
getJobs<TContext = unknown>(params?: T.GetRollupJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetRollupJobResponse, TContext>>
|
||||
getRollupCaps<TContext = unknown>(params?: T.GetRollupCapabilitiesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetRollupCapabilitiesResponse, TContext>>
|
||||
getRollupIndexCaps<TContext = unknown>(params: T.GetRollupIndexCapabilitiesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetRollupIndexCapabilitiesResponse, TContext>>
|
||||
putJob<TContext = unknown>(params: T.CreateRollupJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CreateRollupJobResponse, TContext>>
|
||||
rollup<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
rollupSearch<TDocument = unknown, TContext = unknown>(params: T.RollupSearchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RollupSearchResponse<TDocument>, TContext>>
|
||||
startJob<TContext = unknown>(params: T.StartRollupJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.StartRollupJobResponse, TContext>>
|
||||
stopJob<TContext = unknown>(params: T.StopRollupJobRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.StopRollupJobResponse, TContext>>
|
||||
}
|
||||
scriptsPainlessExecute<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.ScriptsPainlessExecute<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
scroll<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.Scroll<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
search<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.Search<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
searchShards<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SearchShards, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
searchTemplate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SearchTemplate<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
scriptsPainlessExecute<TResult = unknown, TContext = unknown>(params?: T.ExecutePainlessScriptRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ExecutePainlessScriptResponse<TResult>, TContext>>
|
||||
scroll<TDocument = unknown, TContext = unknown>(params?: T.ScrollRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ScrollResponse<TDocument>, TContext>>
|
||||
search<TDocument = unknown, TContext = unknown>(params?: T.SearchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SearchResponse<TDocument>, TContext>>
|
||||
searchShards<TContext = unknown>(params?: T.SearchShardsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SearchShardsResponse, TContext>>
|
||||
searchTemplate<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
searchableSnapshots: {
|
||||
clearCache<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SearchableSnapshotsClearCache, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
mount<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SearchableSnapshotsMount<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
repositoryStats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SearchableSnapshotsRepositoryStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
stats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SearchableSnapshotsStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
clearCache<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
mount<TContext = unknown>(params: T.SearchableSnapshotsMountRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SearchableSnapshotsMountResponse, TContext>>
|
||||
repositoryStats<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
stats<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
}
|
||||
security: {
|
||||
authenticate<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityAuthenticate, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
changePassword<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityChangePassword<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
clearApiKeyCache<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityClearApiKeyCache, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
clearCachedPrivileges<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityClearCachedPrivileges, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
clearCachedRealms<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityClearCachedRealms, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
clearCachedRoles<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityClearCachedRoles, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
createApiKey<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityCreateApiKey<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deletePrivileges<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityDeletePrivileges, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteRole<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityDeleteRole, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteRoleMapping<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityDeleteRoleMapping, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteUser<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityDeleteUser, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
disableUser<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityDisableUser, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
enableUser<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityEnableUser, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getApiKey<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityGetApiKey, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getBuiltinPrivileges<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityGetBuiltinPrivileges, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getPrivileges<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityGetPrivileges, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getRole<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityGetRole, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getRoleMapping<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityGetRoleMapping, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getToken<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityGetToken<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getUser<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityGetUser, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getUserPrivileges<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityGetUserPrivileges, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
grantApiKey<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityGrantApiKey<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
hasPrivileges<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityHasPrivileges<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
invalidateApiKey<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityInvalidateApiKey<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
invalidateToken<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityInvalidateToken<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putPrivileges<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityPutPrivileges<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putRole<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityPutRole<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putRoleMapping<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityPutRoleMapping<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putUser<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityPutUser<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
authenticate<TContext = unknown>(params?: T.AuthenticateRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.AuthenticateResponse, TContext>>
|
||||
changePassword<TContext = unknown>(params?: T.ChangePasswordRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ChangePasswordResponse, TContext>>
|
||||
clearApiKeyCache<TContext = unknown>(params?: T.ClearApiKeyCacheRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClearApiKeyCacheResponse, TContext>>
|
||||
clearCachedPrivileges<TContext = unknown>(params: T.ClearCachedPrivilegesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClearCachedPrivilegesResponse, TContext>>
|
||||
clearCachedRealms<TContext = unknown>(params: T.ClearCachedRealmsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClearCachedRealmsResponse, TContext>>
|
||||
clearCachedRoles<TContext = unknown>(params: T.ClearCachedRolesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClearCachedRolesResponse, TContext>>
|
||||
createApiKey<TContext = unknown>(params?: T.CreateApiKeyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CreateApiKeyResponse, TContext>>
|
||||
deletePrivileges<TContext = unknown>(params: T.DeletePrivilegesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeletePrivilegesResponse, TContext>>
|
||||
deleteRole<TContext = unknown>(params: T.DeleteRoleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteRoleResponse, TContext>>
|
||||
deleteRoleMapping<TContext = unknown>(params: T.DeleteRoleMappingRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteRoleMappingResponse, TContext>>
|
||||
deleteUser<TContext = unknown>(params: T.DeleteUserRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteUserResponse, TContext>>
|
||||
disableUser<TContext = unknown>(params: T.DisableUserRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DisableUserResponse, TContext>>
|
||||
enableUser<TContext = unknown>(params: T.EnableUserRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.EnableUserResponse, TContext>>
|
||||
getApiKey<TContext = unknown>(params?: T.GetApiKeyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetApiKeyResponse, TContext>>
|
||||
getBuiltinPrivileges<TContext = unknown>(params?: T.GetBuiltinPrivilegesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetBuiltinPrivilegesResponse, TContext>>
|
||||
getPrivileges<TContext = unknown>(params?: T.GetPrivilegesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetPrivilegesResponse, TContext>>
|
||||
getRole<TContext = unknown>(params?: T.GetRoleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetRoleResponse, TContext>>
|
||||
getRoleMapping<TContext = unknown>(params?: T.GetRoleMappingRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetRoleMappingResponse, TContext>>
|
||||
getToken<TContext = unknown>(params?: T.GetUserAccessTokenRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetUserAccessTokenResponse, TContext>>
|
||||
getUser<TContext = unknown>(params?: T.GetUserRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetUserResponse, TContext>>
|
||||
getUserPrivileges<TContext = unknown>(params?: T.GetUserPrivilegesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetUserPrivilegesResponse, TContext>>
|
||||
grantApiKey<TContext = unknown>(params?: T.GrantApiKeyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GrantApiKeyResponse, TContext>>
|
||||
hasPrivileges<TContext = unknown>(params?: T.HasPrivilegesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.HasPrivilegesResponse, TContext>>
|
||||
invalidateApiKey<TContext = unknown>(params?: T.InvalidateApiKeyRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.InvalidateApiKeyResponse, TContext>>
|
||||
invalidateToken<TContext = unknown>(params?: T.InvalidateUserAccessTokenRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.InvalidateUserAccessTokenResponse, TContext>>
|
||||
putPrivileges<TContext = unknown>(params?: T.PutPrivilegesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutPrivilegesResponse, TContext>>
|
||||
putRole<TContext = unknown>(params: T.PutRoleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutRoleResponse, TContext>>
|
||||
putRoleMapping<TContext = unknown>(params: T.PutRoleMappingRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutRoleMappingResponse, TContext>>
|
||||
putUser<TContext = unknown>(params: T.PutUserRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutUserResponse, TContext>>
|
||||
}
|
||||
shutdown: {
|
||||
deleteNode<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
getNode<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
putNode<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
}
|
||||
slm: {
|
||||
deleteLifecycle<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SlmDeleteLifecycle, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
executeLifecycle<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SlmExecuteLifecycle, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
executeRetention<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SlmExecuteRetention, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getLifecycle<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SlmGetLifecycle, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getStats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SlmGetStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getStatus<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SlmGetStatus, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putLifecycle<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SlmPutLifecycle<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
start<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SlmStart, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
stop<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SlmStop, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteLifecycle<TContext = unknown>(params: T.DeleteSnapshotLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteSnapshotLifecycleResponse, TContext>>
|
||||
executeLifecycle<TContext = unknown>(params: T.ExecuteSnapshotLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ExecuteSnapshotLifecycleResponse, TContext>>
|
||||
executeRetention<TContext = unknown>(params?: T.ExecuteRetentionRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ExecuteRetentionResponse, TContext>>
|
||||
getLifecycle<TContext = unknown>(params?: T.GetSnapshotLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetSnapshotLifecycleResponse, TContext>>
|
||||
getStats<TContext = unknown>(params?: T.GetSnapshotLifecycleStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetSnapshotLifecycleStatsResponse, TContext>>
|
||||
getStatus<TContext = unknown>(params?: T.GetSnapshotLifecycleManagementStatusRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetSnapshotLifecycleManagementStatusResponse, TContext>>
|
||||
putLifecycle<TContext = unknown>(params: T.PutSnapshotLifecycleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutSnapshotLifecycleResponse, TContext>>
|
||||
start<TContext = unknown>(params?: T.StartSnapshotLifecycleManagementRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.StartSnapshotLifecycleManagementResponse, TContext>>
|
||||
stop<TContext = unknown>(params?: T.StopSnapshotLifecycleManagementRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.StopSnapshotLifecycleManagementResponse, TContext>>
|
||||
}
|
||||
snapshot: {
|
||||
cleanupRepository<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotCleanupRepository, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
clone<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotClone<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
create<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotCreate<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
createRepository<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotCreateRepository<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
delete<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotDelete, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteRepository<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotDeleteRepository, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
get<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotGet, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getRepository<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotGetRepository, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
restore<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotRestore<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
status<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotStatus, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
verifyRepository<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SnapshotVerifyRepository, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
cleanupRepository<TContext = unknown>(params: T.CleanupRepositoryRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CleanupRepositoryResponse, TContext>>
|
||||
clone<TContext = unknown>(params: T.CloneSnapshotRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CloneSnapshotResponse, TContext>>
|
||||
create<TContext = unknown>(params: T.SnapshotRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SnapshotResponse, TContext>>
|
||||
createRepository<TContext = unknown>(params: T.CreateRepositoryRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CreateRepositoryResponse, TContext>>
|
||||
delete<TContext = unknown>(params: T.DeleteSnapshotRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteSnapshotResponse, TContext>>
|
||||
deleteRepository<TContext = unknown>(params: T.DeleteRepositoryRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteRepositoryResponse, TContext>>
|
||||
get<TContext = unknown>(params: T.GetSnapshotRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetSnapshotResponse, TContext>>
|
||||
getRepository<TContext = unknown>(params?: T.GetRepositoryRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetRepositoryResponse, TContext>>
|
||||
restore<TContext = unknown>(params: T.RestoreRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.RestoreResponse, TContext>>
|
||||
status<TContext = unknown>(params?: T.SnapshotStatusRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.SnapshotStatusResponse, TContext>>
|
||||
verifyRepository<TContext = unknown>(params: T.VerifyRepositoryRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.VerifyRepositoryResponse, TContext>>
|
||||
}
|
||||
sql: {
|
||||
clearCursor<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SqlClearCursor<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
query<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SqlQuery<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
translate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SqlTranslate<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
clearCursor<TContext = unknown>(params?: T.ClearSqlCursorRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ClearSqlCursorResponse, TContext>>
|
||||
query<TContext = unknown>(params?: T.QuerySqlRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.QuerySqlResponse, TContext>>
|
||||
translate<TContext = unknown>(params?: T.TranslateSqlRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.TranslateSqlResponse, TContext>>
|
||||
}
|
||||
ssl: {
|
||||
certificates<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SslCertificates, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
certificates<TContext = unknown>(params?: T.GetCertificatesRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetCertificatesResponse, TContext>>
|
||||
}
|
||||
tasks: {
|
||||
cancel<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.TasksCancel, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
get<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.TasksGet, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
list<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.TasksList, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
cancel<TContext = unknown>(params?: T.CancelTasksRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.CancelTasksResponse, TContext>>
|
||||
get<TContext = unknown>(params: T.GetTaskRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetTaskResponse, TContext>>
|
||||
list<TContext = unknown>(params?: T.ListTasksRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ListTasksResponse, TContext>>
|
||||
}
|
||||
termvectors<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.Termvectors<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
termvectors<TDocument = unknown, TContext = unknown>(params: T.TermVectorsRequest<TDocument>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.TermVectorsResponse, TContext>>
|
||||
textStructure: {
|
||||
findStructure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.TextStructureFindStructure<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
findStructure<TBody = unknown, TContext = unknown>(params: T.FindStructureRequest<TBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.FindStructureResponse, TContext>>
|
||||
}
|
||||
transform: {
|
||||
deleteTransform<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.TransformDeleteTransform, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getTransform<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.TransformGetTransform, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getTransformStats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.TransformGetTransformStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
previewTransform<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.TransformPreviewTransform<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putTransform<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.TransformPutTransform<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
startTransform<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.TransformStartTransform, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
stopTransform<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.TransformStopTransform, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
updateTransform<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.TransformUpdateTransform<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteTransform<TContext = unknown>(params: T.DeleteTransformRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteTransformResponse, TContext>>
|
||||
getTransform<TContext = unknown>(params?: T.GetTransformRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetTransformResponse, TContext>>
|
||||
getTransformStats<TContext = unknown>(params: T.GetTransformStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetTransformStatsResponse, TContext>>
|
||||
previewTransform<TTransform = unknown, TContext = unknown>(params?: T.PreviewTransformRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PreviewTransformResponse<TTransform>, TContext>>
|
||||
putTransform<TContext = unknown>(params: T.PutTransformRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutTransformResponse, TContext>>
|
||||
startTransform<TContext = unknown>(params: T.StartTransformRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.StartTransformResponse, TContext>>
|
||||
stopTransform<TContext = unknown>(params: T.StopTransformRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.StopTransformResponse, TContext>>
|
||||
updateTransform<TContext = unknown>(params: T.UpdateTransformRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.UpdateTransformResponse, TContext>>
|
||||
}
|
||||
update<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.Update<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
updateByQuery<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.UpdateByQuery<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
updateByQueryRethrottle<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.UpdateByQueryRethrottle, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
update<TDocumentR = unknown, TDocument = unknown, TPartialDocument = unknown, TContext = unknown>(params: T.UpdateRequest<TDocument, TPartialDocument>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.UpdateResponse<TDocumentR>, TContext>>
|
||||
updateByQuery<TContext = unknown>(params: T.UpdateByQueryRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.UpdateByQueryResponse, TContext>>
|
||||
updateByQueryRethrottle<TContext = unknown>(params: T.UpdateByQueryRethrottleRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.UpdateByQueryRethrottleResponse, TContext>>
|
||||
watcher: {
|
||||
ackWatch<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherAckWatch, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
activateWatch<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherActivateWatch, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deactivateWatch<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherDeactivateWatch, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteWatch<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherDeleteWatch, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
executeWatch<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherExecuteWatch<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getWatch<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherGetWatch, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putWatch<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherPutWatch<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
queryWatches<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherQueryWatches<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
start<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherStart, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
stats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
stop<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.WatcherStop, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
ackWatch<TContext = unknown>(params: T.AcknowledgeWatchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.AcknowledgeWatchResponse, TContext>>
|
||||
activateWatch<TContext = unknown>(params: T.ActivateWatchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ActivateWatchResponse, TContext>>
|
||||
deactivateWatch<TContext = unknown>(params: T.DeactivateWatchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeactivateWatchResponse, TContext>>
|
||||
deleteWatch<TContext = unknown>(params: T.DeleteWatchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.DeleteWatchResponse, TContext>>
|
||||
executeWatch<TContext = unknown>(params?: T.ExecuteWatchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.ExecuteWatchResponse, TContext>>
|
||||
getWatch<TContext = unknown>(params: T.GetWatchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.GetWatchResponse, TContext>>
|
||||
putWatch<TContext = unknown>(params: T.PutWatchRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.PutWatchResponse, TContext>>
|
||||
queryWatches<TContext = unknown>(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TODO, TContext>>
|
||||
start<TContext = unknown>(params?: T.StartWatcherRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.StartWatcherResponse, TContext>>
|
||||
stats<TContext = unknown>(params?: T.WatcherStatsRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.WatcherStatsResponse, TContext>>
|
||||
stop<TContext = unknown>(params?: T.StopWatcherRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.StopWatcherResponse, TContext>>
|
||||
}
|
||||
xpack: {
|
||||
info<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.XpackInfo, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
usage<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.XpackUsage, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
info<TContext = unknown>(params?: T.XPackInfoRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.XPackInfoResponse, TContext>>
|
||||
usage<TContext = unknown>(params?: T.XPackUsageRequest, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<T.XPackUsageResponse, TContext>>
|
||||
}
|
||||
/* /GENERATED */
|
||||
}
|
||||
|
||||
export { KibanaClient }
|
||||
|
||||
1498
api/new.d.ts
vendored
Normal file
1498
api/new.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
110
api/requestParams.d.ts
vendored
110
api/requestParams.d.ts
vendored
@ -280,6 +280,7 @@ export interface CatNodes extends Generic {
|
||||
s?: string | string[];
|
||||
time?: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos';
|
||||
v?: boolean;
|
||||
include_unloaded_segments?: boolean;
|
||||
}
|
||||
|
||||
export interface CatPendingTasks extends Generic {
|
||||
@ -566,8 +567,8 @@ export interface ClusterReroute<T = RequestBody> extends Generic {
|
||||
}
|
||||
|
||||
export interface ClusterState extends Generic {
|
||||
metric?: string | string[];
|
||||
index?: string | string[];
|
||||
metric?: string | string[];
|
||||
local?: boolean;
|
||||
master_timeout?: string;
|
||||
flat_settings?: boolean;
|
||||
@ -804,6 +805,9 @@ export interface FeaturesGetFeatures extends Generic {
|
||||
master_timeout?: string;
|
||||
}
|
||||
|
||||
export interface FeaturesResetFeatures extends Generic {
|
||||
}
|
||||
|
||||
export interface FieldCaps<T = RequestBody> extends Generic {
|
||||
index?: string | string[];
|
||||
fields?: string | string[];
|
||||
@ -814,6 +818,14 @@ export interface FieldCaps<T = RequestBody> extends Generic {
|
||||
body?: T;
|
||||
}
|
||||
|
||||
export interface FleetGlobalCheckpoints extends Generic {
|
||||
index: string;
|
||||
wait_for_advance?: boolean;
|
||||
wait_for_index?: boolean;
|
||||
checkpoints?: string | string[];
|
||||
timeout?: string;
|
||||
}
|
||||
|
||||
export interface Get extends Generic {
|
||||
id: string;
|
||||
index: string;
|
||||
@ -1406,8 +1418,12 @@ export interface IngestDeletePipeline extends Generic {
|
||||
timeout?: string;
|
||||
}
|
||||
|
||||
export interface IngestGeoIpStats extends Generic {
|
||||
}
|
||||
|
||||
export interface IngestGetPipeline extends Generic {
|
||||
id?: string;
|
||||
summary?: boolean;
|
||||
master_timeout?: string;
|
||||
}
|
||||
|
||||
@ -1555,6 +1571,11 @@ export interface MlDeleteTrainedModel extends Generic {
|
||||
model_id: string;
|
||||
}
|
||||
|
||||
export interface MlDeleteTrainedModelAlias extends Generic {
|
||||
model_alias: string;
|
||||
model_id: string;
|
||||
}
|
||||
|
||||
export interface MlEstimateModelMemory<T = RequestBody> extends Generic {
|
||||
body: T;
|
||||
}
|
||||
@ -1568,6 +1589,24 @@ export interface MlExplainDataFrameAnalytics<T = RequestBody> extends Generic {
|
||||
body?: T;
|
||||
}
|
||||
|
||||
export interface MlFindFileStructure<T = RequestNDBody> extends Generic {
|
||||
lines_to_sample?: number;
|
||||
line_merge_size_limit?: number;
|
||||
timeout?: string;
|
||||
charset?: string;
|
||||
format?: 'ndjson' | 'xml' | 'delimited' | 'semi_structured_text';
|
||||
has_header_row?: boolean;
|
||||
column_names?: string | string[];
|
||||
delimiter?: string;
|
||||
quote?: string;
|
||||
should_trim_fields?: boolean;
|
||||
grok_pattern?: string;
|
||||
timestamp_field?: string;
|
||||
timestamp_format?: string;
|
||||
explain?: boolean;
|
||||
body: T;
|
||||
}
|
||||
|
||||
export interface MlFlushJob<T = RequestBody> extends Generic {
|
||||
job_id: string;
|
||||
calc_interim?: boolean;
|
||||
@ -1755,15 +1794,21 @@ export interface MlPostCalendarEvents<T = RequestBody> extends Generic {
|
||||
body: T;
|
||||
}
|
||||
|
||||
export interface MlPostData<T = RequestBody> extends Generic {
|
||||
export interface MlPostData<T = RequestNDBody> extends Generic {
|
||||
job_id: string;
|
||||
reset_start?: string;
|
||||
reset_end?: string;
|
||||
body: T;
|
||||
}
|
||||
|
||||
export interface MlPreviewDatafeed extends Generic {
|
||||
datafeed_id: string;
|
||||
export interface MlPreviewDataFrameAnalytics<T = RequestBody> extends Generic {
|
||||
id?: string;
|
||||
body?: T;
|
||||
}
|
||||
|
||||
export interface MlPreviewDatafeed<T = RequestBody> extends Generic {
|
||||
datafeed_id?: string;
|
||||
body?: T;
|
||||
}
|
||||
|
||||
export interface MlPutCalendar<T = RequestBody> extends Generic {
|
||||
@ -1805,6 +1850,12 @@ export interface MlPutTrainedModel<T = RequestBody> extends Generic {
|
||||
body: T;
|
||||
}
|
||||
|
||||
export interface MlPutTrainedModelAlias extends Generic {
|
||||
model_alias: string;
|
||||
model_id: string;
|
||||
reassign?: boolean;
|
||||
}
|
||||
|
||||
export interface MlRevertModelSnapshot<T = RequestBody> extends Generic {
|
||||
job_id: string;
|
||||
snapshot_id: string;
|
||||
@ -1978,6 +2029,7 @@ export interface NodesStats extends Generic {
|
||||
types?: string | string[];
|
||||
timeout?: string;
|
||||
include_segment_file_sizes?: boolean;
|
||||
include_unloaded_segments?: boolean;
|
||||
}
|
||||
|
||||
export interface NodesUsage extends Generic {
|
||||
@ -2173,6 +2225,10 @@ export interface SearchTemplate<T = RequestBody> extends Generic {
|
||||
body: T;
|
||||
}
|
||||
|
||||
export interface SearchableSnapshotsCacheStats extends Generic {
|
||||
node_id?: string | string[];
|
||||
}
|
||||
|
||||
export interface SearchableSnapshotsClearCache extends Generic {
|
||||
index?: string | string[];
|
||||
ignore_unavailable?: boolean;
|
||||
@ -2224,11 +2280,24 @@ export interface SecurityClearCachedRoles extends Generic {
|
||||
name: string | string[];
|
||||
}
|
||||
|
||||
export interface SecurityClearCachedServiceTokens extends Generic {
|
||||
namespace: string;
|
||||
service: string;
|
||||
name: string | string[];
|
||||
}
|
||||
|
||||
export interface SecurityCreateApiKey<T = RequestBody> extends Generic {
|
||||
refresh?: 'wait_for' | boolean;
|
||||
body: T;
|
||||
}
|
||||
|
||||
export interface SecurityCreateServiceToken extends Generic {
|
||||
namespace: string;
|
||||
service: string;
|
||||
name?: string;
|
||||
refresh?: 'wait_for' | boolean;
|
||||
}
|
||||
|
||||
export interface SecurityDeletePrivileges extends Generic {
|
||||
application: string;
|
||||
name: string;
|
||||
@ -2245,6 +2314,13 @@ export interface SecurityDeleteRoleMapping extends Generic {
|
||||
refresh?: 'wait_for' | boolean;
|
||||
}
|
||||
|
||||
export interface SecurityDeleteServiceToken extends Generic {
|
||||
namespace: string;
|
||||
service: string;
|
||||
name: string;
|
||||
refresh?: 'wait_for' | boolean;
|
||||
}
|
||||
|
||||
export interface SecurityDeleteUser extends Generic {
|
||||
username: string;
|
||||
refresh?: 'wait_for' | boolean;
|
||||
@ -2284,6 +2360,16 @@ export interface SecurityGetRoleMapping extends Generic {
|
||||
name?: string | string[];
|
||||
}
|
||||
|
||||
export interface SecurityGetServiceAccounts extends Generic {
|
||||
namespace?: string;
|
||||
service?: string;
|
||||
}
|
||||
|
||||
export interface SecurityGetServiceCredentials extends Generic {
|
||||
namespace: string;
|
||||
service: string;
|
||||
}
|
||||
|
||||
export interface SecurityGetToken<T = RequestBody> extends Generic {
|
||||
body: T;
|
||||
}
|
||||
@ -2336,6 +2422,19 @@ export interface SecurityPutUser<T = RequestBody> extends Generic {
|
||||
body: T;
|
||||
}
|
||||
|
||||
export interface ShutdownDeleteNode extends Generic {
|
||||
node_id: string;
|
||||
}
|
||||
|
||||
export interface ShutdownGetNode extends Generic {
|
||||
node_id?: string;
|
||||
}
|
||||
|
||||
export interface ShutdownPutNode<T = RequestBody> extends Generic {
|
||||
node_id: string;
|
||||
body: T;
|
||||
}
|
||||
|
||||
export interface SlmDeleteLifecycle extends Generic {
|
||||
policy_id: string;
|
||||
}
|
||||
@ -2415,6 +2514,7 @@ export interface SnapshotGet extends Generic {
|
||||
snapshot: string | string[];
|
||||
master_timeout?: string;
|
||||
ignore_unavailable?: boolean;
|
||||
index_details?: boolean;
|
||||
verbose?: boolean;
|
||||
}
|
||||
|
||||
@ -2503,7 +2603,7 @@ export interface Termvectors<T = RequestBody> extends Generic {
|
||||
body?: T;
|
||||
}
|
||||
|
||||
export interface TextStructureFindStructure<T = RequestBody> extends Generic {
|
||||
export interface TextStructureFindStructure<T = RequestNDBody> extends Generic {
|
||||
lines_to_sample?: number;
|
||||
line_merge_size_limit?: number;
|
||||
timeout?: string;
|
||||
|
||||
13881
api/types.d.ts
vendored
Normal file
13881
api/types.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@ -4,45 +4,11 @@
|
||||
If you need to customize the client behavior heavily, you are in the right
|
||||
place! The client enables you to customize the following internals:
|
||||
|
||||
* `Transport` class
|
||||
* `ConnectionPool` class
|
||||
* `Connection` class
|
||||
* `Serializer` class
|
||||
|
||||
|
||||
[discrete]
|
||||
==== `Transport`
|
||||
|
||||
This class is responsible for performing the request to {es} and handling
|
||||
errors, it also handles the sniffing.
|
||||
|
||||
[source,js]
|
||||
----
|
||||
const { Client, Transport } = require('@elastic/elasticsearch')
|
||||
|
||||
class MyTransport extends Transport {
|
||||
request (params, options, callback) {
|
||||
// your code
|
||||
}
|
||||
}
|
||||
|
||||
const client = new Client({
|
||||
Transport: MyTransport
|
||||
})
|
||||
----
|
||||
|
||||
Sometimes you need to inject a small snippet of your code and then continue to
|
||||
use the usual client code. In such cases, call `super.method`:
|
||||
|
||||
[source,js]
|
||||
----
|
||||
class MyTransport extends Transport {
|
||||
request (params, options, callback) {
|
||||
// your code
|
||||
return super.request(params, options, callback)
|
||||
}
|
||||
}
|
||||
----
|
||||
NOTE: For information about the `Transport` class, refer to <<transport>>.
|
||||
|
||||
|
||||
[discrete]
|
||||
|
||||
@ -244,4 +244,8 @@ const client = new Client({
|
||||
})
|
||||
----
|
||||
|
||||
|`disablePrototypePoisoningProtection`
|
||||
|`boolean`, `'proto'`, `'constructor'` - By the default the client will protect you against prototype poisoning attacks. Read https://web.archive.org/web/20200319091159/https://hueniverse.com/square-brackets-are-the-enemy-ff5b9fd8a3e8?gi=184a27ee2a08[this article] to learn more. If needed you can disable prototype poisoning protection entirely or one of the two checks. Read the `secure-json-parse` https://github.com/fastify/secure-json-parse[documentation] to learn more. +
|
||||
_Default:_ `false`
|
||||
|
||||
|===
|
||||
@ -1,6 +1,39 @@
|
||||
[[changelog-client]]
|
||||
== Changelog
|
||||
|
||||
[discrete]
|
||||
=== 7.12.0
|
||||
|
||||
[discrete]
|
||||
==== Breaking changes
|
||||
|
||||
[discrete]
|
||||
===== Remove Node.js v8 support https://github.com/elastic/elasticsearch-js/pull/1402[#1402]
|
||||
|
||||
According to our https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/installation.html#nodejs-support[support matrix].
|
||||
|
||||
[discrete]
|
||||
==== Features
|
||||
|
||||
[discrete]
|
||||
===== Support for Elasticsearch `v7.12`.
|
||||
|
||||
You can find all the API changes https://www.elastic.co/guide/en/elasticsearch/reference/7.12/release-notes-7.12.0.html[here].
|
||||
|
||||
[discrete]
|
||||
===== Add support for transport options to all helpers https://github.com/elastic/elasticsearch-js/pull/1400[#1400]
|
||||
|
||||
You can now pass Transport specific options to the helpers as well.
|
||||
|
||||
[discrete]
|
||||
==== Fixes
|
||||
|
||||
[discrete]
|
||||
===== Add `.finally` method to the Promise API https://github.com/elastic/elasticsearch-js/pull/1415[#1415]
|
||||
|
||||
The client returns a thenable object when you are not configuring a callback.
|
||||
Now the thenable offers a `.finally` method as well.
|
||||
|
||||
[discrete]
|
||||
=== 7.11.0
|
||||
|
||||
|
||||
@ -9,3 +9,4 @@ section, you can see the possible options that you can use to configure it.
|
||||
* <<advanced-config>>
|
||||
* <<child>>
|
||||
* <<extend>>
|
||||
* <<client-testing>>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
[[as_stream_examples]]
|
||||
== asStream
|
||||
=== asStream
|
||||
|
||||
Instead of getting the parsed body back, you will get the raw Node.js stream of
|
||||
data.
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
[[bulk_examples]]
|
||||
== Bulk
|
||||
=== Bulk
|
||||
|
||||
The `bulk` API makes it possible to perform many index/delete operations in a
|
||||
single API call. This can greatly increase the indexing speed.
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
[[exists_examples]]
|
||||
== Exists
|
||||
=== Exists
|
||||
|
||||
Check that the document `/game-of-thrones/1` exists.
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
[[get_examples]]
|
||||
== Get
|
||||
=== Get
|
||||
|
||||
The get API allows to get a typed JSON document from the index based on its id.
|
||||
The following example gets a JSON document from an index called
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
[[ignore_examples]]
|
||||
== Ignore
|
||||
=== Ignore
|
||||
|
||||
HTTP status codes which should not be considered errors for this request.
|
||||
|
||||
[source,js]
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
[[examples]]
|
||||
= Examples
|
||||
== Examples
|
||||
|
||||
Following you can find some examples on how to use the client.
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
[[msearch_examples]]
|
||||
== MSearch
|
||||
=== MSearch
|
||||
|
||||
The multi search API allows to execute several search requests within the same
|
||||
API.
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
[[reindex_examples]]
|
||||
== Reindex
|
||||
=== Reindex
|
||||
|
||||
The `reindex` API extracts the document source from the source index and indexes the documents into the destination index. You can copy all documents to the destination index, reindex a subset of the documents or update the source before to reindex it.
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
[[scroll_examples]]
|
||||
== Scroll
|
||||
=== Scroll
|
||||
|
||||
While a search request returns a single “page” of results, the scroll API can be
|
||||
used to retrieve large numbers of results (or even all results) from a single
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
[[search_examples]]
|
||||
== Search
|
||||
=== Search
|
||||
|
||||
The `search` API allows you to execute a search query and get back search hits
|
||||
that match the query. The query can either be provided using a simple
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
[[sql_query_examples]]
|
||||
== SQL
|
||||
=== SQL
|
||||
|
||||
Elasticsearch SQL is an X-Pack component that allows SQL-like queries to be executed in real-time against Elasticsearch. Whether using the REST interface, command-line or JDBC, any client can use SQL to search and aggregate data natively inside Elasticsearch. One can think of Elasticsearch SQL as a translator, one that understands both SQL and Elasticsearch and makes it easy to read and process data in real-time, at scale by leveraging Elasticsearch capabilities.
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
[[suggest_examples]]
|
||||
== Suggest
|
||||
=== Suggest
|
||||
|
||||
The suggest feature suggests similar looking terms based on a provided text by
|
||||
using a suggester. _Parts of the suggest feature are still under development._
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
[[transport_request_examples]]
|
||||
== transport.request
|
||||
=== transport.request
|
||||
|
||||
It can happen that you need to communicate with {es} by using an API that is not
|
||||
supported by the client, to mitigate this issue you can directly call
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
[[typescript_examples]]
|
||||
== Typescript
|
||||
=== Typescript
|
||||
|
||||
The client offers a first-class support for TypeScript, since it ships the type
|
||||
definitions for every exposed API.
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
[[update_examples]]
|
||||
== Update
|
||||
=== Update
|
||||
|
||||
The update API allows updates of a specific document using the given script. +
|
||||
In the following example, we will index a document that also tracks how many times a character has said the given quote, and then we will update the `times` field.
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
[[update_by_query_examples]]
|
||||
== Update By Query
|
||||
=== Update By Query
|
||||
|
||||
The simplest usage of _update_by_query just performs an update on every document in the index without changing the source. This is useful to pick up a new property or some other online mapping change.
|
||||
|
||||
|
||||
@ -12,11 +12,13 @@ include::basic-config.asciidoc[]
|
||||
include::advanced-config.asciidoc[]
|
||||
include::child.asciidoc[]
|
||||
include::extend.asciidoc[]
|
||||
include::reference.asciidoc[]
|
||||
include::breaking-changes.asciidoc[]
|
||||
include::observability.asciidoc[]
|
||||
include::helpers.asciidoc[]
|
||||
include::typescript.asciidoc[]
|
||||
include::testing.asciidoc[]
|
||||
include::integrations.asciidoc[]
|
||||
include::observability.asciidoc[]
|
||||
include::transport.asciidoc[]
|
||||
include::typescript.asciidoc[]
|
||||
include::reference.asciidoc[]
|
||||
include::examples/index.asciidoc[]
|
||||
include::breaking-changes.asciidoc[]
|
||||
include::helpers.asciidoc[]
|
||||
include::redirects.asciidoc[]
|
||||
|
||||
8
docs/integrations.asciidoc
Normal file
8
docs/integrations.asciidoc
Normal file
@ -0,0 +1,8 @@
|
||||
[[integrations]]
|
||||
== Integrations
|
||||
|
||||
The Client offers the following integration options for you:
|
||||
|
||||
* <<observability>>
|
||||
* <<transport>>
|
||||
* <<typescript>>
|
||||
@ -1,19 +1,19 @@
|
||||
[[observability]]
|
||||
== Observability
|
||||
=== Observability
|
||||
|
||||
The client does not provide a default logger, but instead it offers an event
|
||||
emitter interfaces to hook into internal events, such as `request` and
|
||||
`response`.
|
||||
|
||||
Correlating those events can be quite hard, especially if your applications have
|
||||
a large codebase with many events happening at the same time.
|
||||
Correlating those events can be hard, especially if your applications have a
|
||||
large codebase with many events happening at the same time.
|
||||
|
||||
To help you with this, the client offers you a correlation id system and other
|
||||
features. Let's see them in action.
|
||||
|
||||
|
||||
[discrete]
|
||||
=== Events
|
||||
==== Events
|
||||
|
||||
The client is an event emitter, this means that you can listen for its event and
|
||||
add additional logic to your code, without need to change the client internals
|
||||
@ -105,7 +105,8 @@ client.on('resurrect', (err, result) => {
|
||||
|
||||
|===
|
||||
|
||||
The values of `result` in `serialization`, `request`, `deserialization`, `response` and `sniff` will be:
|
||||
The values of `result` in `serialization`, `request`, `deserialization`,
|
||||
`response` and `sniff` are:
|
||||
|
||||
[source,ts]
|
||||
----
|
||||
@ -132,7 +133,7 @@ meta: {
|
||||
----
|
||||
|
||||
|
||||
While the `result` value in `resurrect` will be:
|
||||
While the `result` value in `resurrect` is:
|
||||
|
||||
[source,ts]
|
||||
----
|
||||
@ -146,10 +147,13 @@ request: {
|
||||
----
|
||||
|
||||
[discrete]
|
||||
==== Events order
|
||||
===== Events order
|
||||
|
||||
The event order is described in the following graph, in some edge cases, the order is not guaranteed.
|
||||
You can find in https://github.com/elastic/elasticsearch-js/blob/master/test/acceptance/events-order.test.js[`test/acceptance/events-order.test.js`] how the order changes based on the situation.
|
||||
The event order is described in the following graph, in some edge cases, the
|
||||
order is not guaranteed.
|
||||
You can find in
|
||||
https://github.com/elastic/elasticsearch-js/blob/master/test/acceptance/events-order.test.js[`test/acceptance/events-order.test.js`]
|
||||
how the order changes based on the situation.
|
||||
|
||||
[source]
|
||||
----
|
||||
@ -170,11 +174,11 @@ serialization
|
||||
|
||||
|
||||
[discrete]
|
||||
=== Correlation id
|
||||
==== Correlation id
|
||||
|
||||
Correlating events can be quite hard, especially if there are many events at the
|
||||
same time. The client offers you an automatic (and configurable) system to help
|
||||
you handle this problem.
|
||||
Correlating events can be hard, especially if there are many events at the same
|
||||
time. The client offers you an automatic (and configurable) system to help you
|
||||
handle this problem.
|
||||
|
||||
[source,js]
|
||||
----
|
||||
@ -204,8 +208,8 @@ client.search({
|
||||
----
|
||||
|
||||
|
||||
By default the id is an incremental integer, but you can easily configure that
|
||||
with the `generateRequestId` option:
|
||||
By default the id is an incremental integer, but you can configure it with the
|
||||
`generateRequestId` option:
|
||||
|
||||
[source,js]
|
||||
----
|
||||
@ -238,7 +242,7 @@ client.search({
|
||||
|
||||
|
||||
[discrete]
|
||||
=== Context object
|
||||
==== Context object
|
||||
|
||||
Sometimes, you might need to make some custom data available in your events, you
|
||||
can do that via the `context` option of a request:
|
||||
@ -275,8 +279,8 @@ client.search({
|
||||
----
|
||||
|
||||
The context object can also be configured as a global option in the client
|
||||
configuration. If you provide both, the two context object will be shallow merged,
|
||||
and the API level object will take precedece.
|
||||
configuration. If you provide both, the two context objects will be shallow
|
||||
merged, and the API level object will take precedence.
|
||||
|
||||
[source,js]
|
||||
----
|
||||
@ -314,12 +318,12 @@ client.search({
|
||||
|
||||
|
||||
[discrete]
|
||||
=== Client name
|
||||
==== Client name
|
||||
|
||||
If you are using multiple instances of the client or if you are using multiple
|
||||
child clients _(which is the recommended way to have multiple instances of the
|
||||
client)_, you might need to recognize which client you are using. The `name`
|
||||
options will help you in this regard.
|
||||
options help you in this regard.
|
||||
|
||||
[source,js]
|
||||
----
|
||||
@ -368,13 +372,13 @@ child.search({
|
||||
|
||||
|
||||
[discrete]
|
||||
=== X-Opaque-Id support
|
||||
==== X-Opaque-Id support
|
||||
|
||||
To improve the overall 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 will allow you to discover this identifier in the
|
||||
To improve observability, the client offers an easy way to configure the
|
||||
`X-Opaque-Id` header. If you set the `X-Opaque-Id` in a specific request, this
|
||||
allows you to discover this identifier in the
|
||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/logging.html#deprecation-logging[deprecation logs],
|
||||
help you with https://www.elastic.co/guide/en/elasticsearch/reference/master/index-modules-slowlog.html#_identifying_search_slow_log_origin[identifying search slow log origin]
|
||||
helps you with https://www.elastic.co/guide/en/elasticsearch/reference/master/index-modules-slowlog.html#_identifying_search_slow_log_origin[identifying search slow log origin]
|
||||
as well as https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html#_identifying_running_tasks[identifying running tasks].
|
||||
|
||||
The `X-Opaque-Id` should be configured in each request, for doing that you can
|
||||
|
||||
@ -1098,7 +1098,8 @@ client.cat.nodes({
|
||||
help: boolean,
|
||||
s: string | string[],
|
||||
time: 'd' | 'h' | 'm' | 's' | 'ms' | 'micros' | 'nanos',
|
||||
v: boolean
|
||||
v: boolean,
|
||||
include_unloaded_segments: boolean
|
||||
})
|
||||
----
|
||||
link:{ref}/cat-nodes.html[Documentation] +
|
||||
@ -1136,6 +1137,9 @@ WARNING: This parameter has been deprecated.
|
||||
|`v`
|
||||
|`boolean` - Verbose mode. Display column headers
|
||||
|
||||
|`include_unloaded_segments` or `includeUnloadedSegments`
|
||||
|`boolean` - If set to true segment stats will include stats for segments that are not currently loaded into memory
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
@ -2074,7 +2078,7 @@ client.cluster.getSettings({
|
||||
include_defaults: boolean
|
||||
})
|
||||
----
|
||||
link:{ref}/cluster-update-settings.html[Documentation] +
|
||||
link:{ref}/cluster-get-settings.html[Documentation] +
|
||||
[cols=2*]
|
||||
|===
|
||||
|`flat_settings` or `flatSettings`
|
||||
@ -2320,8 +2324,8 @@ link:{ref}/cluster-reroute.html[Documentation] +
|
||||
[source,ts]
|
||||
----
|
||||
client.cluster.state({
|
||||
metric: string | string[],
|
||||
index: string | string[],
|
||||
metric: string | string[],
|
||||
local: boolean,
|
||||
master_timeout: string,
|
||||
flat_settings: boolean,
|
||||
@ -2335,12 +2339,12 @@ client.cluster.state({
|
||||
link:{ref}/cluster-state.html[Documentation] +
|
||||
[cols=2*]
|
||||
|===
|
||||
|`metric`
|
||||
|`string \| string[]` - Limit the information returned to the specified metrics
|
||||
|
||||
|`index`
|
||||
|`string \| string[]` - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
|
||||
|
||||
|`metric`
|
||||
|`string \| string[]` - Limit the information returned to the specified metrics
|
||||
|
||||
|`local`
|
||||
|`boolean` - Return local information, do not retrieve the state from master node (default: false)
|
||||
|
||||
@ -3273,7 +3277,7 @@ client.features.getFeatures({
|
||||
master_timeout: string
|
||||
})
|
||||
----
|
||||
link:{ref}/modules-snapshots.html[Documentation] +
|
||||
link:{ref}/get-features-api.html[Documentation] +
|
||||
[cols=2*]
|
||||
|===
|
||||
|`master_timeout` or `masterTimeout`
|
||||
@ -3281,6 +3285,16 @@ link:{ref}/modules-snapshots.html[Documentation] +
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
=== features.resetFeatures
|
||||
*Stability:* experimental
|
||||
[source,ts]
|
||||
----
|
||||
client.features.resetFeatures()
|
||||
----
|
||||
link:{ref}/modules-snapshots.html[Documentation] +
|
||||
|
||||
|
||||
[discrete]
|
||||
=== fieldCaps
|
||||
|
||||
@ -3323,6 +3337,41 @@ _Default:_ `open`
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
=== fleet.globalCheckpoints
|
||||
*Stability:* experimental
|
||||
[source,ts]
|
||||
----
|
||||
client.fleet.globalCheckpoints({
|
||||
index: string,
|
||||
wait_for_advance: boolean,
|
||||
wait_for_index: boolean,
|
||||
checkpoints: string | string[],
|
||||
timeout: string
|
||||
})
|
||||
----
|
||||
[cols=2*]
|
||||
|===
|
||||
|`index`
|
||||
|`string` - The name of the index.
|
||||
|
||||
|`wait_for_advance` or `waitForAdvance`
|
||||
|`boolean` - Whether to wait for the global checkpoint to advance past the specified current checkpoints +
|
||||
_Default:_ `false`
|
||||
|
||||
|`wait_for_index` or `waitForIndex`
|
||||
|`boolean` - Whether to wait for the target index to exist and all primary shards be active +
|
||||
_Default:_ `false`
|
||||
|
||||
|`checkpoints`
|
||||
|`string \| string[]` - Comma separated list of checkpoints
|
||||
|
||||
|`timeout`
|
||||
|`string` - Timeout to wait for global checkpoint to advance +
|
||||
_Default:_ `30s`
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
=== get
|
||||
|
||||
@ -5784,6 +5833,16 @@ link:{ref}/delete-pipeline-api.html[Documentation] +
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
=== ingest.geoIpStats
|
||||
|
||||
[source,ts]
|
||||
----
|
||||
client.ingest.geoIpStats()
|
||||
----
|
||||
link:{ref}/geoip-stats-api.html[Documentation] +
|
||||
|
||||
|
||||
[discrete]
|
||||
=== ingest.getPipeline
|
||||
|
||||
@ -5791,6 +5850,7 @@ link:{ref}/delete-pipeline-api.html[Documentation] +
|
||||
----
|
||||
client.ingest.getPipeline({
|
||||
id: string,
|
||||
summary: boolean,
|
||||
master_timeout: string
|
||||
})
|
||||
----
|
||||
@ -5800,6 +5860,9 @@ link:{ref}/get-pipeline-api.html[Documentation] +
|
||||
|`id`
|
||||
|`string` - Comma separated list of pipeline ids. Wildcards supported
|
||||
|
||||
|`summary`
|
||||
|`boolean` - Return pipelines without their definitions (default: false)
|
||||
|
||||
|`master_timeout` or `masterTimeout`
|
||||
|`string` - Explicit operation timeout for connection to master node
|
||||
|
||||
@ -6210,7 +6273,7 @@ link:{ref}/ml-delete-calendar-job.html[Documentation] +
|
||||
|
||||
[discrete]
|
||||
=== ml.deleteDataFrameAnalytics
|
||||
*Stability:* beta
|
||||
|
||||
[source,ts]
|
||||
----
|
||||
client.ml.deleteDataFrameAnalytics({
|
||||
@ -6378,7 +6441,7 @@ link:{ref}/ml-delete-snapshot.html[Documentation] +
|
||||
|
||||
[discrete]
|
||||
=== ml.deleteTrainedModel
|
||||
*Stability:* beta
|
||||
|
||||
[source,ts]
|
||||
----
|
||||
client.ml.deleteTrainedModel({
|
||||
@ -6393,6 +6456,27 @@ link:{ref}/delete-trained-models.html[Documentation] +
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
=== ml.deleteTrainedModelAlias
|
||||
|
||||
[source,ts]
|
||||
----
|
||||
client.ml.deleteTrainedModelAlias({
|
||||
model_alias: string,
|
||||
model_id: string
|
||||
})
|
||||
----
|
||||
link:{ref}/delete-trained-models-aliases.html[Documentation] +
|
||||
[cols=2*]
|
||||
|===
|
||||
|`model_alias` or `modelAlias`
|
||||
|`string` - The trained model alias to delete
|
||||
|
||||
|`model_id` or `modelId`
|
||||
|`string` - The trained model where the model alias is assigned
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
=== ml.estimateModelMemory
|
||||
|
||||
@ -6412,7 +6496,7 @@ link:{ref}/ml-apis.html[Documentation] +
|
||||
|
||||
[discrete]
|
||||
=== ml.evaluateDataFrame
|
||||
*Stability:* beta
|
||||
|
||||
[source,ts]
|
||||
----
|
||||
client.ml.evaluateDataFrame({
|
||||
@ -6429,7 +6513,7 @@ link:{ref}/evaluate-dfanalytics.html[Documentation] +
|
||||
|
||||
[discrete]
|
||||
=== ml.explainDataFrameAnalytics
|
||||
*Stability:* beta
|
||||
|
||||
[source,ts]
|
||||
----
|
||||
client.ml.explainDataFrameAnalytics({
|
||||
@ -6448,6 +6532,82 @@ link:{ref}/explain-dfanalytics.html[Documentation] +
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
=== ml.findFileStructure
|
||||
*Stability:* experimental
|
||||
[source,ts]
|
||||
----
|
||||
client.ml.findFileStructure({
|
||||
lines_to_sample: number,
|
||||
line_merge_size_limit: number,
|
||||
timeout: string,
|
||||
charset: string,
|
||||
format: 'ndjson' | 'xml' | 'delimited' | 'semi_structured_text',
|
||||
has_header_row: boolean,
|
||||
column_names: string | string[],
|
||||
delimiter: string,
|
||||
quote: string,
|
||||
should_trim_fields: boolean,
|
||||
grok_pattern: string,
|
||||
timestamp_field: string,
|
||||
timestamp_format: string,
|
||||
explain: boolean,
|
||||
body: object
|
||||
})
|
||||
----
|
||||
link:{ref}/find-structure.html[Documentation] +
|
||||
[cols=2*]
|
||||
|===
|
||||
|`lines_to_sample` or `linesToSample`
|
||||
|`number` - How many lines of the file should be included in the analysis +
|
||||
_Default:_ `1000`
|
||||
|
||||
|`line_merge_size_limit` or `lineMergeSizeLimit`
|
||||
|`number` - Maximum number of characters permitted in a single message when lines are merged to create messages. +
|
||||
_Default:_ `10000`
|
||||
|
||||
|`timeout`
|
||||
|`string` - Timeout after which the analysis will be aborted +
|
||||
_Default:_ `25s`
|
||||
|
||||
|`charset`
|
||||
|`string` - Optional parameter to specify the character set of the file
|
||||
|
||||
|`format`
|
||||
|`'ndjson' \| 'xml' \| 'delimited' \| 'semi_structured_text'` - Optional parameter to specify the high level file format
|
||||
|
||||
|`has_header_row` or `hasHeaderRow`
|
||||
|`boolean` - Optional parameter to specify whether a delimited file includes the column names in its first row
|
||||
|
||||
|`column_names` or `columnNames`
|
||||
|`string \| string[]` - Optional parameter containing a comma separated list of the column names for a delimited file
|
||||
|
||||
|`delimiter`
|
||||
|`string` - Optional parameter to specify the delimiter character for a delimited file - must be a single character
|
||||
|
||||
|`quote`
|
||||
|`string` - Optional parameter to specify the quote character for a delimited file - must be a single character
|
||||
|
||||
|`should_trim_fields` or `shouldTrimFields`
|
||||
|`boolean` - Optional parameter to specify whether the values between delimiters in a delimited file should have whitespace trimmed from them
|
||||
|
||||
|`grok_pattern` or `grokPattern`
|
||||
|`string` - Optional parameter to specify the Grok pattern that should be used to extract fields from messages in a semi-structured text file
|
||||
|
||||
|`timestamp_field` or `timestampField`
|
||||
|`string` - Optional parameter to specify the timestamp field in the file
|
||||
|
||||
|`timestamp_format` or `timestampFormat`
|
||||
|`string` - Optional parameter to specify the timestamp format in the file - may be either a Joda or Java time format
|
||||
|
||||
|`explain`
|
||||
|`boolean` - Whether to include a commentary on how the structure was derived
|
||||
|
||||
|`body`
|
||||
|`object` - The contents of the file to be analyzed
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
=== ml.flushJob
|
||||
|
||||
@ -6684,7 +6844,7 @@ link:{ref}/ml-get-category.html[Documentation] +
|
||||
|
||||
[discrete]
|
||||
=== ml.getDataFrameAnalytics
|
||||
*Stability:* beta
|
||||
|
||||
[source,ts]
|
||||
----
|
||||
client.ml.getDataFrameAnalytics({
|
||||
@ -6719,7 +6879,7 @@ _Default:_ `100`
|
||||
|
||||
[discrete]
|
||||
=== ml.getDataFrameAnalyticsStats
|
||||
*Stability:* beta
|
||||
|
||||
[source,ts]
|
||||
----
|
||||
client.ml.getDataFrameAnalyticsStats({
|
||||
@ -7105,7 +7265,7 @@ link:{ref}/ml-get-record.html[Documentation] +
|
||||
|
||||
[discrete]
|
||||
=== ml.getTrainedModels
|
||||
*Stability:* beta
|
||||
|
||||
[source,ts]
|
||||
----
|
||||
client.ml.getTrainedModels({
|
||||
@ -7159,7 +7319,7 @@ _Default:_ `100`
|
||||
|
||||
[discrete]
|
||||
=== ml.getTrainedModelsStats
|
||||
*Stability:* beta
|
||||
|
||||
[source,ts]
|
||||
----
|
||||
client.ml.getTrainedModelsStats({
|
||||
@ -7265,13 +7425,35 @@ link:{ref}/ml-post-data.html[Documentation] +
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
=== ml.previewDataFrameAnalytics
|
||||
|
||||
[source,ts]
|
||||
----
|
||||
client.ml.previewDataFrameAnalytics({
|
||||
id: string,
|
||||
body: object
|
||||
})
|
||||
----
|
||||
link:{ref}/preview-dfanalytics.html[Documentation] +
|
||||
[cols=2*]
|
||||
|===
|
||||
|`id`
|
||||
|`string` - The ID of the data frame analytics to preview
|
||||
|
||||
|`body`
|
||||
|`object` - The data frame analytics config to preview
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
=== ml.previewDatafeed
|
||||
|
||||
[source,ts]
|
||||
----
|
||||
client.ml.previewDatafeed({
|
||||
datafeed_id: string
|
||||
datafeed_id: string,
|
||||
body: object
|
||||
})
|
||||
----
|
||||
link:{ref}/ml-preview-datafeed.html[Documentation] +
|
||||
@ -7280,6 +7462,9 @@ link:{ref}/ml-preview-datafeed.html[Documentation] +
|
||||
|`datafeed_id` or `datafeedId`
|
||||
|`string` - The ID of the datafeed to preview
|
||||
|
||||
|`body`
|
||||
|`object` - The datafeed config and job config with which to execute the preview
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
@ -7326,7 +7511,7 @@ link:{ref}/ml-put-calendar-job.html[Documentation] +
|
||||
|
||||
[discrete]
|
||||
=== ml.putDataFrameAnalytics
|
||||
*Stability:* beta
|
||||
|
||||
[source,ts]
|
||||
----
|
||||
client.ml.putDataFrameAnalytics({
|
||||
@ -7426,7 +7611,7 @@ link:{ref}/ml-put-job.html[Documentation] +
|
||||
|
||||
[discrete]
|
||||
=== ml.putTrainedModel
|
||||
*Stability:* beta
|
||||
|
||||
[source,ts]
|
||||
----
|
||||
client.ml.putTrainedModel({
|
||||
@ -7445,6 +7630,31 @@ link:{ref}/put-trained-models.html[Documentation] +
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
=== ml.putTrainedModelAlias
|
||||
|
||||
[source,ts]
|
||||
----
|
||||
client.ml.putTrainedModelAlias({
|
||||
model_alias: string,
|
||||
model_id: string,
|
||||
reassign: boolean
|
||||
})
|
||||
----
|
||||
link:{ref}/put-trained-models-aliases.html[Documentation] +
|
||||
[cols=2*]
|
||||
|===
|
||||
|`model_alias` or `modelAlias`
|
||||
|`string` - The trained model alias to update
|
||||
|
||||
|`model_id` or `modelId`
|
||||
|`string` - The trained model where the model alias should be assigned
|
||||
|
||||
|`reassign`
|
||||
|`boolean` - If the model_alias already exists and points to a separate model_id, this parameter must be true. Defaults to false.
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
=== ml.revertModelSnapshot
|
||||
|
||||
@ -7497,7 +7707,7 @@ link:{ref}/ml-set-upgrade-mode.html[Documentation] +
|
||||
|
||||
[discrete]
|
||||
=== ml.startDataFrameAnalytics
|
||||
*Stability:* beta
|
||||
|
||||
[source,ts]
|
||||
----
|
||||
client.ml.startDataFrameAnalytics({
|
||||
@ -7555,7 +7765,7 @@ link:{ref}/ml-start-datafeed.html[Documentation] +
|
||||
|
||||
[discrete]
|
||||
=== ml.stopDataFrameAnalytics
|
||||
*Stability:* beta
|
||||
|
||||
[source,ts]
|
||||
----
|
||||
client.ml.stopDataFrameAnalytics({
|
||||
@ -7627,7 +7837,7 @@ WARNING: This parameter has been deprecated.
|
||||
|
||||
[discrete]
|
||||
=== ml.updateDataFrameAnalytics
|
||||
*Stability:* beta
|
||||
|
||||
[source,ts]
|
||||
----
|
||||
client.ml.updateDataFrameAnalytics({
|
||||
@ -8138,7 +8348,8 @@ client.nodes.stats({
|
||||
level: 'indices' | 'node' | 'shards',
|
||||
types: string | string[],
|
||||
timeout: string,
|
||||
include_segment_file_sizes: boolean
|
||||
include_segment_file_sizes: boolean,
|
||||
include_unloaded_segments: boolean
|
||||
})
|
||||
----
|
||||
link:{ref}/cluster-nodes-stats.html[Documentation] +
|
||||
@ -8178,6 +8389,9 @@ _Default:_ `node`
|
||||
|`include_segment_file_sizes` or `includeSegmentFileSizes`
|
||||
|`boolean` - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)
|
||||
|
||||
|`include_unloaded_segments` or `includeUnloadedSegments`
|
||||
|`boolean` - If set to true segment stats will include stats for segments that are not currently loaded into memory
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
@ -8986,6 +9200,23 @@ _Default:_ `true`
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
=== searchableSnapshots.cacheStats
|
||||
*Stability:* experimental
|
||||
[source,ts]
|
||||
----
|
||||
client.searchableSnapshots.cacheStats({
|
||||
node_id: string | string[]
|
||||
})
|
||||
----
|
||||
link:{ref}/searchable-snapshots-apis.html[Documentation] +
|
||||
[cols=2*]
|
||||
|===
|
||||
|`node_id` or `nodeId`
|
||||
|`string \| string[]` - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
=== searchableSnapshots.clearCache
|
||||
*Stability:* experimental
|
||||
@ -9199,6 +9430,31 @@ link:{ref}/security-api-clear-role-cache.html[Documentation] +
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
=== security.clearCachedServiceTokens
|
||||
*Stability:* beta
|
||||
[source,ts]
|
||||
----
|
||||
client.security.clearCachedServiceTokens({
|
||||
namespace: string,
|
||||
service: string,
|
||||
name: string | string[]
|
||||
})
|
||||
----
|
||||
link:{ref}/security-api-clear-service-token-caches.html[Documentation] +
|
||||
[cols=2*]
|
||||
|===
|
||||
|`namespace`
|
||||
|`string` - An identifier for the namespace
|
||||
|
||||
|`service`
|
||||
|`string` - An identifier for the service name
|
||||
|
||||
|`name`
|
||||
|`string \| string[]` - A comma-separated list of service token names
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
=== security.createApiKey
|
||||
|
||||
@ -9220,6 +9476,35 @@ link:{ref}/security-api-create-api-key.html[Documentation] +
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
=== security.createServiceToken
|
||||
*Stability:* beta
|
||||
[source,ts]
|
||||
----
|
||||
client.security.createServiceToken({
|
||||
namespace: string,
|
||||
service: string,
|
||||
name: string,
|
||||
refresh: 'true' | 'false' | 'wait_for'
|
||||
})
|
||||
----
|
||||
link:{ref}/security-api-create-service-token.html[Documentation] +
|
||||
[cols=2*]
|
||||
|===
|
||||
|`namespace`
|
||||
|`string` - An identifier for the namespace
|
||||
|
||||
|`service`
|
||||
|`string` - An identifier for the service name
|
||||
|
||||
|`name`
|
||||
|`string` - An identifier for the token name
|
||||
|
||||
|`refresh`
|
||||
|`'true' \| 'false' \| 'wait_for'` - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
=== security.deletePrivileges
|
||||
|
||||
@ -9287,6 +9572,35 @@ link:{ref}/security-api-delete-role-mapping.html[Documentation] +
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
=== security.deleteServiceToken
|
||||
*Stability:* beta
|
||||
[source,ts]
|
||||
----
|
||||
client.security.deleteServiceToken({
|
||||
namespace: string,
|
||||
service: string,
|
||||
name: string,
|
||||
refresh: 'true' | 'false' | 'wait_for'
|
||||
})
|
||||
----
|
||||
link:{ref}/security-api-delete-service-token.html[Documentation] +
|
||||
[cols=2*]
|
||||
|===
|
||||
|`namespace`
|
||||
|`string` - An identifier for the namespace
|
||||
|
||||
|`service`
|
||||
|`string` - An identifier for the service name
|
||||
|
||||
|`name`
|
||||
|`string` - An identifier for the token name
|
||||
|
||||
|`refresh`
|
||||
|`'true' \| 'false' \| 'wait_for'` - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
=== security.deleteUser
|
||||
|
||||
@ -9448,6 +9762,48 @@ link:{ref}/security-api-get-role-mapping.html[Documentation] +
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
=== security.getServiceAccounts
|
||||
*Stability:* beta
|
||||
[source,ts]
|
||||
----
|
||||
client.security.getServiceAccounts({
|
||||
namespace: string,
|
||||
service: string
|
||||
})
|
||||
----
|
||||
link:{ref}/security-api-get-service-accounts.html[Documentation] +
|
||||
[cols=2*]
|
||||
|===
|
||||
|`namespace`
|
||||
|`string` - An identifier for the namespace
|
||||
|
||||
|`service`
|
||||
|`string` - An identifier for the service name
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
=== security.getServiceCredentials
|
||||
*Stability:* beta
|
||||
[source,ts]
|
||||
----
|
||||
client.security.getServiceCredentials({
|
||||
namespace: string,
|
||||
service: string
|
||||
})
|
||||
----
|
||||
link:{ref}/security-api-get-service-credentials.html[Documentation] +
|
||||
[cols=2*]
|
||||
|===
|
||||
|`namespace`
|
||||
|`string` - An identifier for the namespace
|
||||
|
||||
|`service`
|
||||
|`string` - An identifier for the service name
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
=== security.getToken
|
||||
|
||||
@ -9664,6 +10020,61 @@ link:{ref}/security-api-put-user.html[Documentation] +
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
=== shutdown.deleteNode
|
||||
*Stability:* experimental
|
||||
[source,ts]
|
||||
----
|
||||
client.shutdown.deleteNode({
|
||||
node_id: string
|
||||
})
|
||||
----
|
||||
link:https://www.elastic.co/guide/en/elasticsearch/reference/current[Documentation] +
|
||||
[cols=2*]
|
||||
|===
|
||||
|`node_id` or `nodeId`
|
||||
|`string` - The node id of node to be removed from the shutdown state
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
=== shutdown.getNode
|
||||
*Stability:* experimental
|
||||
[source,ts]
|
||||
----
|
||||
client.shutdown.getNode({
|
||||
node_id: string
|
||||
})
|
||||
----
|
||||
link:https://www.elastic.co/guide/en/elasticsearch/reference/current[Documentation] +
|
||||
[cols=2*]
|
||||
|===
|
||||
|`node_id` or `nodeId`
|
||||
|`string` - Which node for which to retrieve the shutdown status
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
=== shutdown.putNode
|
||||
*Stability:* experimental
|
||||
[source,ts]
|
||||
----
|
||||
client.shutdown.putNode({
|
||||
node_id: string,
|
||||
body: object
|
||||
})
|
||||
----
|
||||
link:https://www.elastic.co/guide/en/elasticsearch/reference/current[Documentation] +
|
||||
[cols=2*]
|
||||
|===
|
||||
|`node_id` or `nodeId`
|
||||
|`string` - The node id of node to be shut down
|
||||
|
||||
|`body`
|
||||
|`object` - The shutdown type definition to register
|
||||
|
||||
|===
|
||||
|
||||
[discrete]
|
||||
=== slm.deleteLifecycle
|
||||
|
||||
@ -9970,6 +10381,7 @@ client.snapshot.get({
|
||||
snapshot: string | string[],
|
||||
master_timeout: string,
|
||||
ignore_unavailable: boolean,
|
||||
index_details: boolean,
|
||||
verbose: boolean
|
||||
})
|
||||
----
|
||||
@ -9988,6 +10400,9 @@ link:{ref}/modules-snapshots.html[Documentation] +
|
||||
|`ignore_unavailable` or `ignoreUnavailable`
|
||||
|`boolean` - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown
|
||||
|
||||
|`index_details` or `indexDetails`
|
||||
|`boolean` - Whether to include details of each index in the snapshot, if those details are available. Defaults to false.
|
||||
|
||||
|`verbose`
|
||||
|`boolean` - Whether to show verbose snapshot info or only show the basic info found in the repository index blob
|
||||
|
||||
@ -10350,7 +10765,7 @@ _Default:_ `true`
|
||||
|
||||
[discrete]
|
||||
=== textStructure.findStructure
|
||||
*Stability:* experimental
|
||||
|
||||
[source,ts]
|
||||
----
|
||||
client.textStructure.findStructure({
|
||||
|
||||
@ -1,56 +1,58 @@
|
||||
[[client-testing]]
|
||||
== Testing
|
||||
=== Testing
|
||||
|
||||
Testing is one of the most important parts of developing an application.
|
||||
The client is very flexible when it comes to testing and is compatible with
|
||||
most testing frameworks (such as https://www.npmjs.com/package/ava[`ava`],
|
||||
which is used in the examples below).
|
||||
|
||||
If you are using this client, you are very likely working with Elasticsearch,
|
||||
and one of the first issues you will face is how to test your application.
|
||||
A perfectly valid solution is to use the real Elasticsearch instance for
|
||||
testing your application, but you would be doing an integration test,
|
||||
while you want a unit test.
|
||||
There are many ways to solve this problem, you could create the database
|
||||
with docker, or use an in-memory compatible one, but if you are writing
|
||||
unit tests that can be easily parallelized this will become quite uncomfortable.
|
||||
A different way of improving your testing experience while doing unit tests
|
||||
is to use a mock.
|
||||
If you are using this client, you are most likely working with {es}, and one of
|
||||
the first issues you face is how to test your application. A perfectly valid
|
||||
solution is to use the real {es} instance for testing your application, but you
|
||||
would be doing an integration test, while you want a unit test. There are many
|
||||
ways to solve this problem, you could create the database with Docker, or use an
|
||||
in-memory compatible one, but if you are writing unit tests that can be easily
|
||||
parallelized this becomes quite uncomfortable. A different way of improving your
|
||||
testing experience while doing unit tests is to use a mock.
|
||||
|
||||
The client is designed to be easy to extend and adapt to your needs.
|
||||
Thanks to its internal architecture it allows you to change some specific
|
||||
components while keeping the rest of it working as usual.
|
||||
Each Elasticsearch official client is composed of the following components:
|
||||
The client is designed to be easy to extend and adapt to your needs. Thanks to
|
||||
its internal architecture it allows you to change some specific components while
|
||||
keeping the rest of it working as usual. Each {es} official client is composed
|
||||
of the following components:
|
||||
|
||||
* `API layer`: every Elasticsearch API that you can call
|
||||
* `Transport`: a component that takes care of preparing a request before sending it and handling all the retry and sniffing strategies
|
||||
* `ConnectionPool`: Elasticsearch is a cluster and might have multiple nodes, the * `ConnectionPool` takes care of them
|
||||
* `Serializer`: A class with all the serialization strategies, from the basic JSON to the new line delimited JSON.
|
||||
* `API layer`: every {es} API that you can call.
|
||||
* `Transport`: a component that takes care of preparing a request before sending
|
||||
it and handling all the retry and sniffing strategies.
|
||||
* `ConnectionPool`: {es} is a cluster and might have multiple nodes, the
|
||||
`ConnectionPool` takes care of them.
|
||||
* `Serializer`: A class with all the serialization strategies, from the basic
|
||||
JSON to the new line delimited JSON.
|
||||
* `Connection`: The actual HTTP library.
|
||||
|
||||
The best way to mock Elasticsearch with the official clients is to replace
|
||||
the `Connection` component since it has very few responsibilities and
|
||||
it does not interact with other internal components other than getting
|
||||
requests and returning responses.
|
||||
The best way to mock {es} with the official clients is to replace the
|
||||
`Connection` component since it has very few responsibilities and it does not
|
||||
interact with other internal components other than getting requests and
|
||||
returning responses.
|
||||
|
||||
|
||||
[discrete]
|
||||
=== `@elastic/elasticsearch-mock`
|
||||
==== `@elastic/elasticsearch-mock`
|
||||
|
||||
Writing each time a mock for your test can be annoying and error-prone,
|
||||
so we have built a simple yet powerful mocking library specifically designed
|
||||
for this client, and you can install it with the following command:
|
||||
Writing each time a mock for your test can be annoying and error-prone, so we
|
||||
have built a simple yet powerful mocking library specifically designed for this
|
||||
client, and you can install it with the following command:
|
||||
|
||||
[source,sh]
|
||||
----
|
||||
npm install @elastic/elasticsearch-mock --save-dev
|
||||
----
|
||||
|
||||
With this library you can easily create custom mocks for any request you can
|
||||
send to Elasticsearch. It offers a simple and intuitive API and it mocks only
|
||||
the HTTP layer, leaving the rest of the client working as usual.
|
||||
With this library you can create custom mocks for any request you can send to
|
||||
{es}. It offers a simple and intuitive API and it mocks only the HTTP layer,
|
||||
leaving the rest of the client working as usual.
|
||||
|
||||
Before showing all of its features, and what you can do with it, let’s see an example:
|
||||
Before showing all of its features, and what you can do with it, let’s see an
|
||||
example:
|
||||
|
||||
[source,js]
|
||||
----
|
||||
@ -73,16 +75,16 @@ mock.add({
|
||||
client.info(console.log)
|
||||
----
|
||||
|
||||
As you can see it works closely with the client itself, once you have created
|
||||
a new instance of the mock library you just need to call the mock.getConnection()
|
||||
method and pass its result to the Connection option of the client.
|
||||
From now on, every request will be handled by the mock library, and the HTTP
|
||||
layer will never be touched. As a result, your test will be significantly faster
|
||||
and you will be able to easily parallelize them!
|
||||
As you can see it works closely with the client itself, once you have created a
|
||||
new instance of the mock library you just need to call the mock.getConnection()
|
||||
method and pass its result to the Connection option of the client. From now on,
|
||||
every request is handled by the mock library, and the HTTP layer will never be
|
||||
touched. As a result, your test is significantly faster and you are able to
|
||||
easily parallelize them!
|
||||
|
||||
The library allows you to write both “strict” and “loose” mocks, which means
|
||||
that you can write a mock that will handle a very specific request or be looser
|
||||
and handle a group of request, let’s see this in action:
|
||||
The library allows you to write both “strict” and “loose” mocks, which means
|
||||
that you can write a mock that handles a very specific request or be looser and
|
||||
handle a group of request, let’s see this in action:
|
||||
|
||||
[source,js]
|
||||
----
|
||||
@ -112,9 +114,9 @@ mock.add({
|
||||
})
|
||||
----
|
||||
|
||||
In the example above every search request will get the first response,
|
||||
while every search request that uses the query described in the second mock,
|
||||
will get the second response.
|
||||
In the example above, every search request gets the first response, while every
|
||||
search request that uses the query described in the second mock gets the second
|
||||
response.
|
||||
|
||||
You can also specify dynamic paths:
|
||||
|
||||
@ -150,5 +152,6 @@ mock.add({
|
||||
})
|
||||
----
|
||||
|
||||
We have seen how simple is mocking Elasticsearch and testing your application,
|
||||
you can find many more features and examples in the https://github.com/elastic/elasticsearch-js-mock[module documentation].
|
||||
We have seen how simple is mocking {es} and testing your application, you can
|
||||
find many more features and examples in the
|
||||
https://github.com/elastic/elasticsearch-js-mock[module documentation].
|
||||
34
docs/transport.asciidoc
Normal file
34
docs/transport.asciidoc
Normal file
@ -0,0 +1,34 @@
|
||||
[[transport]]
|
||||
=== Transport
|
||||
|
||||
This class is responsible for performing the request to {es} and handling
|
||||
errors, it also handles sniffing.
|
||||
|
||||
[source,js]
|
||||
----
|
||||
const { Client, Transport } = require('@elastic/elasticsearch')
|
||||
|
||||
class MyTransport extends Transport {
|
||||
request (params, options, callback) {
|
||||
// your code
|
||||
}
|
||||
}
|
||||
|
||||
const client = new Client({
|
||||
Transport: MyTransport
|
||||
})
|
||||
----
|
||||
|
||||
Sometimes you need to inject a small snippet of your code and then continue to
|
||||
use the usual client code. In such cases, call `super.method`:
|
||||
|
||||
[source,js]
|
||||
----
|
||||
class MyTransport extends Transport {
|
||||
request (params, options, callback) {
|
||||
// your code
|
||||
return super.request(params, options, callback)
|
||||
}
|
||||
}
|
||||
----
|
||||
|
||||
@ -1,17 +1,145 @@
|
||||
[[typescript]]
|
||||
== TypeScript support
|
||||
=== TypeScript support
|
||||
|
||||
The client offers a first-class support for TypeScript, since it ships the type
|
||||
definitions for every exposed API.
|
||||
The client offers a first-class support for TypeScript, shipping a complete set
|
||||
of type definitions of Elasticsearch's API surface.
|
||||
|
||||
NOTE: If you are using TypeScript you will be required to use _snake_case_ style
|
||||
to define the API parameters instead of _camelCase_.
|
||||
|
||||
By default event API uses https://www.typescriptlang.org/docs/handbook/generics.html[generics] to specify the requets and response bodies and the `meta.context`. Currently we can't provide those definitions, but we are working to improve this situation.
|
||||
NOTE: If you are using TypeScript you need to use _snake_case_ style to define
|
||||
the API parameters instead of _camelCase_.
|
||||
|
||||
You can find a partial definition of the request types by importing `RequestParams`, which is used by default in the client and accepts a body (when needed) as a generic to provide a better specification.
|
||||
Currently the client exposes two type definitions, the legacy one, which is the default
|
||||
and the new one, which will be the default in the next major.
|
||||
We strongly recommend to migrate to the new one as soon as possible, as the new types
|
||||
are offering a vastly improved developer experience and guarantee you that your code
|
||||
will always be in sync with the latest Elasticsearch features.
|
||||
|
||||
The body defaults to `RequestBody` and `RequestNDBody`, which are defined as follows:
|
||||
[discrete]
|
||||
==== New type definitions
|
||||
|
||||
The new type definition is more advanced compared to the legacy one. In the legacy
|
||||
type definitions you were expected to configure via generics both request and response
|
||||
bodies. The new type definitions comes with a complete type definition for every
|
||||
Elasticsearch endpoint.
|
||||
|
||||
For example:
|
||||
|
||||
[source,ts]
|
||||
----
|
||||
// legacy definitions
|
||||
const response = await client.search<SearchResponse<Source>, SearchBody>({
|
||||
index: 'test',
|
||||
body: {
|
||||
query: {
|
||||
match: { foo: 'bar' }
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// new definitions
|
||||
const response = await client.search<Source>({
|
||||
index: 'test',
|
||||
body: {
|
||||
query: {
|
||||
match: { foo: 'bar' }
|
||||
}
|
||||
}
|
||||
})
|
||||
----
|
||||
|
||||
The types are not 100% complete yet. Some APIs are missing (the newest ones, e.g. EQL),
|
||||
and others may contain some errors, but we are continuously pushing fixes & improvements.
|
||||
|
||||
[discrete]
|
||||
==== Request & Response types
|
||||
|
||||
Once you migrate to the new types, those are automatically integrated into the Elasticsearch client, you will get them out of the box.
|
||||
If everything works, meaning that you won’t get compiler errors, you are good to go!
|
||||
The types are already correct, and there is nothing more to do.
|
||||
|
||||
If a type is incorrect, you should add a comment `// @ts-expect-error @elastic/elasticsearch`
|
||||
telling TypeScript that you are aware of the warning and you would like to temporarily suppress it.
|
||||
In this way, your code will compile until the type is fixed, and when it happens, you’ll only need to remove the
|
||||
`// @ts-expect-error @elastic/elasticsearch` comment (TypeScript will let you know when it is time).
|
||||
Finally, if the type you need is missing, you’ll see that the client method returns (or defines as a parameter)
|
||||
a `TODO` type, which accepts any object.
|
||||
|
||||
Open an issue in the client repository letting us know if you encounter any problem!
|
||||
|
||||
If needed you can import the request and response types.
|
||||
|
||||
[source,ts]
|
||||
----
|
||||
import { Client, estypes } from '@elastic/elasticsearch'
|
||||
import type { Client as NewTypes } from '@elastic/elasticsearch/api/new'
|
||||
|
||||
// @ts-expect-error @elastic/elasticsearch
|
||||
const client: NewTypes = new Client({
|
||||
node: 'http://localhost:9200'
|
||||
})
|
||||
|
||||
interface Source {
|
||||
foo: string
|
||||
}
|
||||
|
||||
const request: estypes.IndexRequest<Source> = {
|
||||
index: 'test',
|
||||
body: { foo: 'bar' }
|
||||
}
|
||||
|
||||
await client.index(request)
|
||||
----
|
||||
|
||||
[discrete]
|
||||
===== How to migrate to the new type definitions
|
||||
|
||||
Since the new type definitions can be considered a breaking change we couldn't add the directly to the client.
|
||||
Following you will find a snippet that shows you how to override the default types with the new ones.
|
||||
|
||||
[source,ts]
|
||||
----
|
||||
import { Client } from '@elastic/elasticsearch'
|
||||
import type { Client as NewTypes } from '@elastic/elasticsearch/api/new'
|
||||
|
||||
// @ts-expect-error @elastic/elasticsearch
|
||||
const client: NewTypes = new Client({
|
||||
node: 'http://localhost:9200'
|
||||
})
|
||||
|
||||
interface Source {
|
||||
foo: string
|
||||
}
|
||||
|
||||
// try the new code completion when building a query!
|
||||
const response = await client.search<Source>({
|
||||
index: 'test',
|
||||
body: {
|
||||
query: {
|
||||
match_all: {}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// try the new code completion when traversing a response!
|
||||
const results = response.body.hits.hits.map(hit => hit._source)
|
||||
// results type will be `Source[]`
|
||||
console.log(results)
|
||||
----
|
||||
|
||||
[discrete]
|
||||
==== Legacy type definitions
|
||||
|
||||
By default event API uses
|
||||
https://www.typescriptlang.org/docs/handbook/generics.html[generics] to specify
|
||||
the requests and response bodies and the `meta.context`. Currently, we can't
|
||||
provide those definitions, but we are working to improve this situation.
|
||||
|
||||
You can find a partial definition of the request types by importing
|
||||
`RequestParams`, which is used by default in the client and accepts a body (when
|
||||
needed) as a generic to provide a better specification.
|
||||
|
||||
The body defaults to `RequestBody` and `RequestNDBody`, which are defined as
|
||||
follows:
|
||||
|
||||
[source,ts]
|
||||
----
|
||||
@ -39,7 +167,7 @@ You don't have to specify all the generics, but the order must be respected.
|
||||
|
||||
|
||||
[discrete]
|
||||
=== A complete example
|
||||
===== A complete example
|
||||
|
||||
[source,ts]
|
||||
----
|
||||
|
||||
216
index.d.ts
vendored
216
index.d.ts
vendored
@ -47,8 +47,9 @@ import {
|
||||
} from './lib/pool';
|
||||
import Serializer from './lib/Serializer';
|
||||
import Helpers from './lib/Helpers';
|
||||
import * as RequestParams from './api/requestParams';
|
||||
import * as errors from './lib/errors';
|
||||
import * as estypes from './api/types'
|
||||
import * as RequestParams from './api/requestParams'
|
||||
|
||||
declare type callbackFn<TResponse, TContext> = (err: ApiError, result: ApiResponse<TResponse, TContext>) => void;
|
||||
|
||||
@ -114,11 +115,12 @@ interface ClientOptions {
|
||||
// TODO: remove username and password here in 8
|
||||
username?: string;
|
||||
password?: string;
|
||||
}
|
||||
};
|
||||
disablePrototypePoisoningProtection?: boolean | 'proto' | 'constructor';
|
||||
}
|
||||
|
||||
declare class Client {
|
||||
constructor(opts?: ClientOptions);
|
||||
constructor(opts: ClientOptions);
|
||||
connectionPool: ConnectionPool;
|
||||
transport: Transport;
|
||||
serializer: Serializer;
|
||||
@ -126,9 +128,8 @@ declare class Client {
|
||||
extend(method: string, opts: { force: boolean }, fn: extendsCallback): void;
|
||||
helpers: Helpers;
|
||||
child(opts?: ClientOptions): Client;
|
||||
close(): Promise<void>;
|
||||
close(callback: Function): void;
|
||||
close(callback?: Function): Promise<void> | void;
|
||||
close(): Promise<void>;
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
on(event: 'request', listener: (err: ApiError, meta: RequestEvent) => void): this;
|
||||
on(event: 'response', listener: (err: ApiError, meta: RequestEvent) => void): this;
|
||||
@ -729,6 +730,14 @@ declare class Client {
|
||||
getFeatures<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getFeatures<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.FeaturesGetFeatures, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getFeatures<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.FeaturesGetFeatures, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
reset_features<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.FeaturesResetFeatures, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
reset_features<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
reset_features<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.FeaturesResetFeatures, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
reset_features<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.FeaturesResetFeatures, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
resetFeatures<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.FeaturesResetFeatures, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
resetFeatures<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
resetFeatures<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.FeaturesResetFeatures, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
resetFeatures<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.FeaturesResetFeatures, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
}
|
||||
field_caps<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.FieldCaps<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
field_caps<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -738,6 +747,16 @@ declare class Client {
|
||||
fieldCaps<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
fieldCaps<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.FieldCaps<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
fieldCaps<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.FieldCaps<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
fleet: {
|
||||
global_checkpoints<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.FleetGlobalCheckpoints, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
global_checkpoints<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
global_checkpoints<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.FleetGlobalCheckpoints, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
global_checkpoints<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.FleetGlobalCheckpoints, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
globalCheckpoints<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.FleetGlobalCheckpoints, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
globalCheckpoints<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
globalCheckpoints<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.FleetGlobalCheckpoints, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
globalCheckpoints<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.FleetGlobalCheckpoints, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
}
|
||||
get<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.Get, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
get<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.Get, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -1229,6 +1248,14 @@ declare class Client {
|
||||
deletePipeline<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
deletePipeline<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IngestDeletePipeline, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
deletePipeline<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IngestDeletePipeline, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
geo_ip_stats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IngestGeoIpStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
geo_ip_stats<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
geo_ip_stats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IngestGeoIpStats, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
geo_ip_stats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IngestGeoIpStats, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
geoIpStats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IngestGeoIpStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
geoIpStats<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
geoIpStats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IngestGeoIpStats, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
geoIpStats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IngestGeoIpStats, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_pipeline<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.IngestGetPipeline, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
get_pipeline<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_pipeline<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.IngestGetPipeline, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -1437,6 +1464,14 @@ declare class Client {
|
||||
deleteTrainedModel<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
deleteTrainedModel<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlDeleteTrainedModel, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
deleteTrainedModel<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlDeleteTrainedModel, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
delete_trained_model_alias<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlDeleteTrainedModelAlias, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
delete_trained_model_alias<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
delete_trained_model_alias<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlDeleteTrainedModelAlias, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
delete_trained_model_alias<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlDeleteTrainedModelAlias, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
deleteTrainedModelAlias<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlDeleteTrainedModelAlias, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteTrainedModelAlias<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
deleteTrainedModelAlias<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlDeleteTrainedModelAlias, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
deleteTrainedModelAlias<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlDeleteTrainedModelAlias, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
estimate_model_memory<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlEstimateModelMemory<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
estimate_model_memory<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
estimate_model_memory<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlEstimateModelMemory<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -1461,6 +1496,14 @@ declare class Client {
|
||||
explainDataFrameAnalytics<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
explainDataFrameAnalytics<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlExplainDataFrameAnalytics<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
explainDataFrameAnalytics<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlExplainDataFrameAnalytics<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
find_file_structure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params?: RequestParams.MlFindFileStructure<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
find_file_structure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
find_file_structure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params: RequestParams.MlFindFileStructure<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
find_file_structure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params: RequestParams.MlFindFileStructure<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
findFileStructure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params?: RequestParams.MlFindFileStructure<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
findFileStructure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
findFileStructure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params: RequestParams.MlFindFileStructure<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
findFileStructure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params: RequestParams.MlFindFileStructure<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
flush_job<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlFlushJob<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
flush_job<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
flush_job<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlFlushJob<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -1629,22 +1672,30 @@ declare class Client {
|
||||
postCalendarEvents<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
postCalendarEvents<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlPostCalendarEvents<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
postCalendarEvents<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlPostCalendarEvents<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
post_data<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlPostData<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
post_data<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
post_data<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlPostData<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
post_data<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlPostData<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
postData<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlPostData<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
postData<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
postData<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlPostData<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
postData<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlPostData<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
preview_datafeed<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlPreviewDatafeed, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
preview_datafeed<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
preview_datafeed<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlPreviewDatafeed, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
preview_datafeed<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlPreviewDatafeed, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
previewDatafeed<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlPreviewDatafeed, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
previewDatafeed<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
previewDatafeed<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlPreviewDatafeed, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
previewDatafeed<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlPreviewDatafeed, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
post_data<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params?: RequestParams.MlPostData<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
post_data<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
post_data<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params: RequestParams.MlPostData<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
post_data<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params: RequestParams.MlPostData<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
postData<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params?: RequestParams.MlPostData<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
postData<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
postData<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params: RequestParams.MlPostData<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
postData<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params: RequestParams.MlPostData<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
preview_data_frame_analytics<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlPreviewDataFrameAnalytics<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
preview_data_frame_analytics<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
preview_data_frame_analytics<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlPreviewDataFrameAnalytics<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
preview_data_frame_analytics<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlPreviewDataFrameAnalytics<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
previewDataFrameAnalytics<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlPreviewDataFrameAnalytics<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
previewDataFrameAnalytics<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
previewDataFrameAnalytics<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlPreviewDataFrameAnalytics<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
previewDataFrameAnalytics<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlPreviewDataFrameAnalytics<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
preview_datafeed<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlPreviewDatafeed<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
preview_datafeed<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
preview_datafeed<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlPreviewDatafeed<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
preview_datafeed<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlPreviewDatafeed<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
previewDatafeed<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlPreviewDatafeed<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
previewDatafeed<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
previewDatafeed<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlPreviewDatafeed<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
previewDatafeed<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlPreviewDatafeed<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
put_calendar<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlPutCalendar<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
put_calendar<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
put_calendar<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlPutCalendar<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -1701,6 +1752,14 @@ declare class Client {
|
||||
putTrainedModel<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
putTrainedModel<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlPutTrainedModel<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
putTrainedModel<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlPutTrainedModel<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
put_trained_model_alias<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlPutTrainedModelAlias, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
put_trained_model_alias<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
put_trained_model_alias<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlPutTrainedModelAlias, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
put_trained_model_alias<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlPutTrainedModelAlias, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
putTrainedModelAlias<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.MlPutTrainedModelAlias, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putTrainedModelAlias<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
putTrainedModelAlias<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlPutTrainedModelAlias, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
putTrainedModelAlias<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.MlPutTrainedModelAlias, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
revert_model_snapshot<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.MlRevertModelSnapshot<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
revert_model_snapshot<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
revert_model_snapshot<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.MlRevertModelSnapshot<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -2013,6 +2072,14 @@ declare class Client {
|
||||
searchTemplate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SearchTemplate<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
searchTemplate<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SearchTemplate<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
searchable_snapshots: {
|
||||
cache_stats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SearchableSnapshotsCacheStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
cache_stats<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
cache_stats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SearchableSnapshotsCacheStats, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
cache_stats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SearchableSnapshotsCacheStats, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
cacheStats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SearchableSnapshotsCacheStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
cacheStats<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
cacheStats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SearchableSnapshotsCacheStats, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
cacheStats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SearchableSnapshotsCacheStats, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clear_cache<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SearchableSnapshotsClearCache, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
clear_cache<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clear_cache<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SearchableSnapshotsClearCache, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -2039,6 +2106,14 @@ declare class Client {
|
||||
stats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SearchableSnapshotsStats, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
}
|
||||
searchableSnapshots: {
|
||||
cache_stats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SearchableSnapshotsCacheStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
cache_stats<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
cache_stats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SearchableSnapshotsCacheStats, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
cache_stats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SearchableSnapshotsCacheStats, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
cacheStats<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SearchableSnapshotsCacheStats, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
cacheStats<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
cacheStats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SearchableSnapshotsCacheStats, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
cacheStats<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SearchableSnapshotsCacheStats, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clear_cache<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SearchableSnapshotsClearCache, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
clear_cache<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clear_cache<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SearchableSnapshotsClearCache, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -2109,6 +2184,14 @@ declare class Client {
|
||||
clearCachedRoles<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clearCachedRoles<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityClearCachedRoles, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clearCachedRoles<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityClearCachedRoles, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clear_cached_service_tokens<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityClearCachedServiceTokens, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
clear_cached_service_tokens<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clear_cached_service_tokens<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityClearCachedServiceTokens, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clear_cached_service_tokens<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityClearCachedServiceTokens, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clearCachedServiceTokens<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityClearCachedServiceTokens, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
clearCachedServiceTokens<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clearCachedServiceTokens<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityClearCachedServiceTokens, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
clearCachedServiceTokens<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityClearCachedServiceTokens, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
create_api_key<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityCreateApiKey<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
create_api_key<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
create_api_key<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecurityCreateApiKey<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -2117,6 +2200,14 @@ declare class Client {
|
||||
createApiKey<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
createApiKey<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecurityCreateApiKey<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
createApiKey<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecurityCreateApiKey<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
create_service_token<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityCreateServiceToken, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
create_service_token<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
create_service_token<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityCreateServiceToken, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
create_service_token<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityCreateServiceToken, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
createServiceToken<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityCreateServiceToken, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
createServiceToken<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
createServiceToken<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityCreateServiceToken, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
createServiceToken<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityCreateServiceToken, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
delete_privileges<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityDeletePrivileges, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
delete_privileges<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
delete_privileges<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityDeletePrivileges, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -2141,6 +2232,14 @@ declare class Client {
|
||||
deleteRoleMapping<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
deleteRoleMapping<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityDeleteRoleMapping, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
deleteRoleMapping<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityDeleteRoleMapping, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
delete_service_token<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityDeleteServiceToken, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
delete_service_token<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
delete_service_token<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityDeleteServiceToken, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
delete_service_token<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityDeleteServiceToken, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
deleteServiceToken<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityDeleteServiceToken, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteServiceToken<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
deleteServiceToken<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityDeleteServiceToken, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
deleteServiceToken<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityDeleteServiceToken, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
delete_user<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityDeleteUser, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
delete_user<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
delete_user<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityDeleteUser, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -2205,6 +2304,22 @@ declare class Client {
|
||||
getRoleMapping<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getRoleMapping<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityGetRoleMapping, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getRoleMapping<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityGetRoleMapping, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_service_accounts<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityGetServiceAccounts, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
get_service_accounts<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_service_accounts<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityGetServiceAccounts, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_service_accounts<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityGetServiceAccounts, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getServiceAccounts<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityGetServiceAccounts, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getServiceAccounts<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getServiceAccounts<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityGetServiceAccounts, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getServiceAccounts<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityGetServiceAccounts, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_service_credentials<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityGetServiceCredentials, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
get_service_credentials<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_service_credentials<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityGetServiceCredentials, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_service_credentials<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityGetServiceCredentials, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getServiceCredentials<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityGetServiceCredentials, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getServiceCredentials<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getServiceCredentials<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityGetServiceCredentials, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getServiceCredentials<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.SecurityGetServiceCredentials, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_token<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.SecurityGetToken<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
get_token<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_token<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecurityGetToken<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -2294,6 +2409,32 @@ declare class Client {
|
||||
putUser<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecurityPutUser<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
putUser<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.SecurityPutUser<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
}
|
||||
shutdown: {
|
||||
delete_node<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.ShutdownDeleteNode, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
delete_node<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
delete_node<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.ShutdownDeleteNode, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
delete_node<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.ShutdownDeleteNode, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
deleteNode<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.ShutdownDeleteNode, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
deleteNode<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
deleteNode<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.ShutdownDeleteNode, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
deleteNode<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.ShutdownDeleteNode, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_node<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.ShutdownGetNode, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
get_node<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_node<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.ShutdownGetNode, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
get_node<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.ShutdownGetNode, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getNode<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.ShutdownGetNode, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
getNode<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getNode<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.ShutdownGetNode, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
getNode<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.ShutdownGetNode, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
put_node<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.ShutdownPutNode<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
put_node<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
put_node<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.ShutdownPutNode<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
put_node<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.ShutdownPutNode<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
putNode<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.ShutdownPutNode<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
putNode<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
putNode<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.ShutdownPutNode<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
putNode<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.ShutdownPutNode<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
}
|
||||
slm: {
|
||||
delete_lifecycle<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.SlmDeleteLifecycle, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
delete_lifecycle<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
@ -2469,24 +2610,24 @@ declare class Client {
|
||||
termvectors<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.Termvectors<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
termvectors<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.Termvectors<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
text_structure: {
|
||||
find_structure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.TextStructureFindStructure<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
find_structure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
find_structure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.TextStructureFindStructure<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
find_structure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.TextStructureFindStructure<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
findStructure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.TextStructureFindStructure<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
findStructure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
findStructure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.TextStructureFindStructure<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
findStructure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.TextStructureFindStructure<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
find_structure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params?: RequestParams.TextStructureFindStructure<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
find_structure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
find_structure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params: RequestParams.TextStructureFindStructure<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
find_structure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params: RequestParams.TextStructureFindStructure<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
findStructure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params?: RequestParams.TextStructureFindStructure<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
findStructure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
findStructure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params: RequestParams.TextStructureFindStructure<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
findStructure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params: RequestParams.TextStructureFindStructure<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
}
|
||||
textStructure: {
|
||||
find_structure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.TextStructureFindStructure<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
find_structure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
find_structure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.TextStructureFindStructure<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
find_structure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.TextStructureFindStructure<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
findStructure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params?: RequestParams.TextStructureFindStructure<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
findStructure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
findStructure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.TextStructureFindStructure<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
findStructure<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.TextStructureFindStructure<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
find_structure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params?: RequestParams.TextStructureFindStructure<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
find_structure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
find_structure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params: RequestParams.TextStructureFindStructure<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
find_structure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params: RequestParams.TextStructureFindStructure<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
findStructure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params?: RequestParams.TextStructureFindStructure<TRequestBody>, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
findStructure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
findStructure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params: RequestParams.TextStructureFindStructure<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
findStructure<TResponse = Record<string, any>, TRequestBody extends RequestNDBody = Record<string, any>[], TContext = Context>(params: RequestParams.TextStructureFindStructure<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
|
||||
}
|
||||
transform: {
|
||||
delete_transform<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.TransformDeleteTransform, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
|
||||
@ -2688,6 +2829,7 @@ export {
|
||||
ApiResponse,
|
||||
RequestEvent,
|
||||
ResurrectEvent,
|
||||
estypes,
|
||||
RequestParams,
|
||||
ClientOptions,
|
||||
NodeOptions,
|
||||
|
||||
18
index.js
18
index.js
@ -19,8 +19,6 @@
|
||||
|
||||
'use strict'
|
||||
|
||||
const nodeMajor = Number(process.versions.node.split('.')[0])
|
||||
|
||||
const { EventEmitter } = require('events')
|
||||
const { URL } = require('url')
|
||||
const debug = require('debug')('elasticsearch')
|
||||
@ -47,15 +45,6 @@ const kEventEmitter = Symbol('elasticsearchjs-event-emitter')
|
||||
|
||||
const ESAPI = require('./api')
|
||||
|
||||
/* istanbul ignore next */
|
||||
if (nodeMajor >= 10 && nodeMajor < 12) {
|
||||
process.emitWarning('You are using a version of Node.js that will reach EOL in April 2021. ' +
|
||||
'The support for this version will be dropped in 7.13. ' +
|
||||
'Please refer to https://ela.st/nodejs-support for additional information.',
|
||||
'DeprecationWarning'
|
||||
)
|
||||
}
|
||||
|
||||
class Client extends ESAPI {
|
||||
constructor (opts = {}) {
|
||||
super({ ConfigurationError })
|
||||
@ -123,7 +112,8 @@ class Client extends ESAPI {
|
||||
opaqueIdPrefix: null,
|
||||
context: null,
|
||||
proxy: null,
|
||||
enableMetaHeader: true
|
||||
enableMetaHeader: true,
|
||||
disablePrototypePoisoningProtection: false
|
||||
}, opts)
|
||||
|
||||
this[kInitialOptions] = options
|
||||
@ -140,7 +130,9 @@ class Client extends ESAPI {
|
||||
this[kEventEmitter] = options[kChild].eventEmitter
|
||||
} else {
|
||||
this[kEventEmitter] = new EventEmitter()
|
||||
this.serializer = new options.Serializer()
|
||||
this.serializer = new options.Serializer({
|
||||
disablePrototypePoisoningProtection: options.disablePrototypePoisoningProtection
|
||||
})
|
||||
this.connectionPool = new options.ConnectionPool({
|
||||
pingTimeout: options.pingTimeout,
|
||||
resurrectStrategy: options.resurrectStrategy,
|
||||
|
||||
@ -25,7 +25,7 @@ const hpagent = require('hpagent')
|
||||
const http = require('http')
|
||||
const https = require('https')
|
||||
const debug = require('debug')('elasticsearch')
|
||||
const pump = require('pump')
|
||||
const { pipeline } = require('stream')
|
||||
const INVALID_PATH_REGEX = /[^\u0021-\u00ff]/
|
||||
const {
|
||||
ConnectionError,
|
||||
@ -133,7 +133,7 @@ class Connection {
|
||||
|
||||
// starts the request
|
||||
if (isStream(params.body) === true) {
|
||||
pump(params.body, request, err => {
|
||||
pipeline(params.body, request, err => {
|
||||
/* istanbul ignore if */
|
||||
if (err != null && cleanedListeners === false) {
|
||||
cleanListeners()
|
||||
|
||||
@ -421,7 +421,7 @@ class Helpers {
|
||||
*/
|
||||
bulk (options, reqOptions = {}) {
|
||||
const client = this[kClient]
|
||||
const { serialize, deserialize } = client.serializer
|
||||
const { serializer } = client
|
||||
if (this[kMetaHeader] !== null) {
|
||||
reqOptions.headers = reqOptions.headers || {}
|
||||
reqOptions.headers['x-elastic-client-meta'] = this[kMetaHeader] + ',h=bp'
|
||||
@ -505,19 +505,19 @@ class Helpers {
|
||||
? Object.keys(action[0])[0]
|
||||
: Object.keys(action)[0]
|
||||
if (operation === 'index' || operation === 'create') {
|
||||
actionBody = serialize(action)
|
||||
payloadBody = typeof chunk === 'string' ? chunk : serialize(chunk)
|
||||
actionBody = serializer.serialize(action)
|
||||
payloadBody = typeof chunk === 'string' ? chunk : serializer.serialize(chunk)
|
||||
chunkBytes += Buffer.byteLength(actionBody) + Buffer.byteLength(payloadBody)
|
||||
bulkBody.push(actionBody, payloadBody)
|
||||
} else if (operation === 'update') {
|
||||
actionBody = serialize(action[0])
|
||||
actionBody = serializer.serialize(action[0])
|
||||
payloadBody = typeof chunk === 'string'
|
||||
? `{"doc":${chunk}}`
|
||||
: serialize({ doc: chunk, ...action[1] })
|
||||
: serializer.serialize({ doc: chunk, ...action[1] })
|
||||
chunkBytes += Buffer.byteLength(actionBody) + Buffer.byteLength(payloadBody)
|
||||
bulkBody.push(actionBody, payloadBody)
|
||||
} else if (operation === 'delete') {
|
||||
actionBody = serialize(action)
|
||||
actionBody = serializer.serialize(action)
|
||||
chunkBytes += Buffer.byteLength(actionBody)
|
||||
bulkBody.push(actionBody)
|
||||
} else {
|
||||
@ -669,13 +669,13 @@ class Helpers {
|
||||
return
|
||||
}
|
||||
for (let i = 0, len = bulkBody.length; i < len; i = i + 2) {
|
||||
const operation = Object.keys(deserialize(bulkBody[i]))[0]
|
||||
const operation = Object.keys(serializer.deserialize(bulkBody[i]))[0]
|
||||
onDrop({
|
||||
status: 429,
|
||||
error: null,
|
||||
operation: deserialize(bulkBody[i]),
|
||||
operation: serializer.deserialize(bulkBody[i]),
|
||||
document: operation !== 'delete'
|
||||
? deserialize(bulkBody[i + 1])
|
||||
? serializer.deserialize(bulkBody[i + 1])
|
||||
/* istanbul ignore next */
|
||||
: null,
|
||||
retried: isRetrying
|
||||
@ -716,9 +716,9 @@ class Helpers {
|
||||
onDrop({
|
||||
status: status,
|
||||
error: action[operation].error,
|
||||
operation: deserialize(bulkBody[indexSlice]),
|
||||
operation: serializer.deserialize(bulkBody[indexSlice]),
|
||||
document: operation !== 'delete'
|
||||
? deserialize(bulkBody[indexSlice + 1])
|
||||
? serializer.deserialize(bulkBody[indexSlice + 1])
|
||||
: null,
|
||||
retried: isRetrying
|
||||
})
|
||||
|
||||
5
lib/Serializer.d.ts
vendored
5
lib/Serializer.d.ts
vendored
@ -17,7 +17,12 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
export interface SerializerOptions {
|
||||
disablePrototypePoisoningProtection: boolean | 'proto' | 'constructor'
|
||||
}
|
||||
|
||||
export default class Serializer {
|
||||
constructor (opts?: SerializerOptions)
|
||||
serialize(object: any): string;
|
||||
deserialize(json: string): any;
|
||||
ndserialize(array: any[]): string;
|
||||
|
||||
@ -23,8 +23,17 @@ const { stringify } = require('querystring')
|
||||
const debug = require('debug')('elasticsearch')
|
||||
const sjson = require('secure-json-parse')
|
||||
const { SerializationError, DeserializationError } = require('./errors')
|
||||
const kJsonOptions = Symbol('secure json parse options')
|
||||
|
||||
class Serializer {
|
||||
constructor (opts = {}) {
|
||||
const disable = opts.disablePrototypePoisoningProtection
|
||||
this[kJsonOptions] = {
|
||||
protoAction: disable === true || disable === 'proto' ? 'ignore' : 'error',
|
||||
constructorAction: disable === true || disable === 'constructor' ? 'ignore' : 'error'
|
||||
}
|
||||
}
|
||||
|
||||
serialize (object) {
|
||||
debug('Serializing', object)
|
||||
let json
|
||||
@ -40,7 +49,7 @@ class Serializer {
|
||||
debug('Deserializing', json)
|
||||
let object
|
||||
try {
|
||||
object = sjson.parse(json)
|
||||
object = sjson.parse(json, this[kJsonOptions])
|
||||
} catch (err) {
|
||||
throw new DeserializationError(err.message, json)
|
||||
}
|
||||
|
||||
2
lib/Transport.d.ts
vendored
2
lib/Transport.d.ts
vendored
@ -28,7 +28,7 @@ export type ApiError = errors.ConfigurationError | errors.ConnectionError |
|
||||
errors.NoLivingConnectionsError | errors.ResponseError |
|
||||
errors.TimeoutError | errors.RequestAbortedError
|
||||
|
||||
export type Context = Record<string, unknown> | null
|
||||
export type Context = unknown
|
||||
|
||||
export interface nodeSelectorFn {
|
||||
(connections: Connection[]): Connection;
|
||||
|
||||
@ -306,8 +306,8 @@ class Transport {
|
||||
return callback(err, result)
|
||||
}
|
||||
} else {
|
||||
// cast to boolean if the request method was HEAD
|
||||
result.body = isHead === true ? true : payload
|
||||
// cast to boolean if the request method was HEAD and there was no error
|
||||
result.body = isHead === true && result.statusCode < 400 ? true : payload
|
||||
}
|
||||
|
||||
// we should ignore the statusCode if the user has configured the `ignore` field with
|
||||
|
||||
@ -90,7 +90,16 @@ class ResponseError extends ElasticsearchClientError {
|
||||
super('Response Error')
|
||||
Error.captureStackTrace(this, ResponseError)
|
||||
this.name = 'ResponseError'
|
||||
this.message = (meta.body && meta.body.error && meta.body.error.type) || 'Response Error'
|
||||
if (meta.body && meta.body.error && meta.body.error.type) {
|
||||
if (Array.isArray(meta.body.error.root_cause)) {
|
||||
this.message = meta.body.error.type + ': '
|
||||
this.message += meta.body.error.root_cause.map(entry => `[${entry.type}] Reason: ${entry.reason}`).join('; ')
|
||||
} else {
|
||||
this.message = meta.body.error.type
|
||||
}
|
||||
} else {
|
||||
this.message = 'Response Error'
|
||||
}
|
||||
this.meta = meta
|
||||
}
|
||||
|
||||
@ -108,6 +117,10 @@ class ResponseError extends ElasticsearchClientError {
|
||||
get headers () {
|
||||
return this.meta.headers
|
||||
}
|
||||
|
||||
toString () {
|
||||
return JSON.stringify(this.meta.body)
|
||||
}
|
||||
}
|
||||
|
||||
class RequestAbortedError extends ElasticsearchClientError {
|
||||
|
||||
32
package.json
32
package.json
@ -11,8 +11,8 @@
|
||||
"./": "./"
|
||||
},
|
||||
"homepage": "http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html",
|
||||
"version": "7.12.0",
|
||||
"versionCanary": "7.12.0-canary.3",
|
||||
"version": "7.13.0",
|
||||
"versionCanary": "7.13.0-canary.5",
|
||||
"keywords": [
|
||||
"elasticsearch",
|
||||
"elastic",
|
||||
@ -48,37 +48,38 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sinonjs/fake-timers": "github:sinonjs/fake-timers#0bfffc1",
|
||||
"@types/node": "^14.14.28",
|
||||
"convert-hrtime": "^3.0.0",
|
||||
"@types/node": "^15.3.1",
|
||||
"convert-hrtime": "^5.0.0",
|
||||
"cross-zip": "^4.0.0",
|
||||
"dedent": "^0.7.0",
|
||||
"deepmerge": "^4.2.2",
|
||||
"dezalgo": "^1.0.3",
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"into-stream": "^6.0.0",
|
||||
"js-yaml": "^4.0.0",
|
||||
"js-yaml": "^4.1.0",
|
||||
"license-checker": "^25.0.1",
|
||||
"minimist": "^1.2.5",
|
||||
"ora": "^5.3.0",
|
||||
"node-fetch": "^2.6.1",
|
||||
"ora": "^5.4.0",
|
||||
"pretty-hrtime": "^1.0.3",
|
||||
"proxy": "^1.0.2",
|
||||
"rimraf": "^3.0.2",
|
||||
"semver": "^7.3.4",
|
||||
"simple-git": "^2.35.0",
|
||||
"simple-statistics": "^7.4.1",
|
||||
"semver": "^7.3.5",
|
||||
"simple-git": "^2.39.0",
|
||||
"simple-statistics": "^7.7.0",
|
||||
"split2": "^3.2.2",
|
||||
"standard": "^16.0.3",
|
||||
"stoppable": "^1.1.0",
|
||||
"tap": "^14.11.0",
|
||||
"tsd": "^0.14.0",
|
||||
"tap": "^15.0.9",
|
||||
"tsd": "^0.15.1",
|
||||
"workq": "^3.0.0",
|
||||
"xmlbuilder2": "^2.4.0"
|
||||
"xmlbuilder2": "^2.4.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": "^4.3.1",
|
||||
"hpagent": "^0.1.1",
|
||||
"ms": "^2.1.3",
|
||||
"pump": "^3.0.0",
|
||||
"secure-json-parse": "^2.3.1"
|
||||
"secure-json-parse": "^2.4.0"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
@ -89,13 +90,12 @@
|
||||
"url": "https://github.com/elastic/elasticsearch-js/issues"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
"node": ">=12"
|
||||
},
|
||||
"tsd": {
|
||||
"directory": "test/types"
|
||||
},
|
||||
"tap": {
|
||||
"esm": false,
|
||||
"ts": false,
|
||||
"jsx": false,
|
||||
"flow": false,
|
||||
|
||||
178
scripts/download-artifacts.js
Normal file
178
scripts/download-artifacts.js
Normal file
@ -0,0 +1,178 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
const { join } = require('path')
|
||||
const minimist = require('minimist')
|
||||
const stream = require('stream')
|
||||
const { promisify } = require('util')
|
||||
const { createWriteStream, promises } = require('fs')
|
||||
const rimraf = require('rimraf')
|
||||
const fetch = require('node-fetch')
|
||||
const crossZip = require('cross-zip')
|
||||
const ora = require('ora')
|
||||
|
||||
const { mkdir, writeFile } = promises
|
||||
const pipeline = promisify(stream.pipeline)
|
||||
const unzip = promisify(crossZip.unzip)
|
||||
const rm = promisify(rimraf)
|
||||
|
||||
const esFolder = join(__dirname, '..', 'elasticsearch')
|
||||
const zipFolder = join(esFolder, 'artifacts.zip')
|
||||
const specFolder = join(esFolder, 'rest-api-spec', 'api')
|
||||
const freeTestFolder = join(esFolder, 'rest-api-spec', 'test', 'free')
|
||||
const xPackTestFolder = join(esFolder, 'rest-api-spec', 'test', 'platinum')
|
||||
const artifactInfo = join(esFolder, 'info.json')
|
||||
|
||||
async function downloadArtifacts (opts) {
|
||||
if (typeof opts.version !== 'string') {
|
||||
throw new Error('Missing version')
|
||||
}
|
||||
|
||||
const log = ora('Checking out spec and test').start()
|
||||
|
||||
log.text = 'Resolving versions'
|
||||
let resolved
|
||||
try {
|
||||
resolved = await resolve(opts.version, opts.hash)
|
||||
} catch (err) {
|
||||
log.fail(err.message)
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
opts.id = opts.id || resolved.id
|
||||
opts.hash = opts.hash || resolved.hash
|
||||
opts.version = resolved.version
|
||||
|
||||
const info = loadInfo()
|
||||
|
||||
if (info && info.version === opts.version) {
|
||||
if (info.hash === opts.hash && info.id === opts.id) {
|
||||
log.succeed('The artifact copy present locally is already up to date')
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
log.text = 'Cleanup checkouts/elasticsearch'
|
||||
await rm(esFolder)
|
||||
await mkdir(esFolder, { recursive: true })
|
||||
|
||||
log.text = 'Downloading artifacts'
|
||||
const response = await fetch(resolved.url)
|
||||
if (!response.ok) {
|
||||
log.fail(`unexpected response ${response.statusText}`)
|
||||
process.exit(1)
|
||||
}
|
||||
await pipeline(response.body, createWriteStream(zipFolder))
|
||||
|
||||
log.text = 'Unzipping'
|
||||
await unzip(zipFolder, esFolder)
|
||||
|
||||
log.text = 'Cleanup'
|
||||
await rm(zipFolder)
|
||||
|
||||
log.text = 'Update info'
|
||||
await writeFile(artifactInfo, JSON.stringify(opts), 'utf8')
|
||||
|
||||
log.succeed('Done')
|
||||
}
|
||||
|
||||
function loadInfo () {
|
||||
try {
|
||||
return require(artifactInfo)
|
||||
} catch (err) {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
async function resolve (version, hash) {
|
||||
const response = await fetch(`https://artifacts-api.elastic.co/v1/versions/${version}`)
|
||||
if (!response.ok) {
|
||||
throw new Error(`unexpected response ${response.statusText}`)
|
||||
}
|
||||
|
||||
const data = await response.json()
|
||||
const esBuilds = data.version.builds
|
||||
.filter(build => build.projects.elasticsearch != null)
|
||||
.map(build => {
|
||||
return {
|
||||
projects: build.projects.elasticsearch,
|
||||
buildId: build.build_id,
|
||||
date: build.start_time,
|
||||
version: build.version
|
||||
}
|
||||
})
|
||||
.sort((a, b) => {
|
||||
const dA = new Date(a.date)
|
||||
const dB = new Date(b.date)
|
||||
if (dA > dB) return -1
|
||||
if (dA < dB) return 1
|
||||
return 0
|
||||
})
|
||||
|
||||
if (hash != null) {
|
||||
const build = esBuilds.find(build => build.projects.commit_hash === hash)
|
||||
if (!build) {
|
||||
throw new Error(`Can't find any build with hash '${hash}'`)
|
||||
}
|
||||
const zipKey = Object.keys(build.projects.packages).find(key => key.startsWith('rest-resources-zip-') && key.endsWith('.zip'))
|
||||
return {
|
||||
url: build.projects.packages[zipKey].url,
|
||||
id: build.buildId,
|
||||
hash: build.projects.commit_hash,
|
||||
version: build.version
|
||||
}
|
||||
}
|
||||
|
||||
const lastBuild = esBuilds[0]
|
||||
const zipKey = Object.keys(lastBuild.projects.packages).find(key => key.startsWith('rest-resources-zip-') && key.endsWith('.zip'))
|
||||
return {
|
||||
url: lastBuild.projects.packages[zipKey].url,
|
||||
id: lastBuild.buildId,
|
||||
hash: lastBuild.projects.commit_hash,
|
||||
version: lastBuild.version
|
||||
}
|
||||
}
|
||||
|
||||
async function main (options) {
|
||||
delete options._
|
||||
await downloadArtifacts(options)
|
||||
}
|
||||
if (require.main === module) {
|
||||
process.on('unhandledRejection', function (err) {
|
||||
console.error(err)
|
||||
process.exit(1)
|
||||
})
|
||||
|
||||
const options = minimist(process.argv.slice(2), {
|
||||
string: ['id', 'version', 'hash']
|
||||
})
|
||||
main(options).catch(t => {
|
||||
console.log(t)
|
||||
process.exit(2)
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = downloadArtifacts
|
||||
module.exports.locations = {
|
||||
specFolder,
|
||||
freeTestFolder,
|
||||
xPackTestFolder
|
||||
}
|
||||
@ -20,115 +20,98 @@
|
||||
'use strict'
|
||||
|
||||
const { join } = require('path')
|
||||
const { readdirSync, readFileSync, writeFileSync } = require('fs')
|
||||
const { readdirSync, writeFileSync, readFileSync } = require('fs')
|
||||
const minimist = require('minimist')
|
||||
const semver = require('semver')
|
||||
const ora = require('ora')
|
||||
const rimraf = require('rimraf')
|
||||
const standard = require('standard')
|
||||
const downloadArtifacts = require('./download-artifacts')
|
||||
const {
|
||||
generate,
|
||||
cloneAndCheckout,
|
||||
genFactory,
|
||||
generateRequestTypes,
|
||||
generateDocs
|
||||
generateDocs,
|
||||
generateRequestTypes
|
||||
} = require('./utils')
|
||||
|
||||
start(minimist(process.argv.slice(2), {
|
||||
string: ['tag', 'branch']
|
||||
string: ['version', 'hash']
|
||||
}))
|
||||
|
||||
function start (opts) {
|
||||
const log = ora('Loading Elasticsearch Repository').start()
|
||||
if (opts.branch == null && semver.valid(opts.tag) === null) {
|
||||
log.fail(`Missing or invalid tag: ${opts.tag}`)
|
||||
return
|
||||
if (opts.version == null) {
|
||||
console.error('Missing version parameter')
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
const packageFolder = join(__dirname, '..', 'api')
|
||||
const apiOutputFolder = join(packageFolder, 'api')
|
||||
const mainOutputFile = join(packageFolder, 'index.js')
|
||||
const typeDefFile = join(__dirname, '..', 'index.d.ts')
|
||||
const kibanaTypeDefFile = join(packageFolder, 'kibana.d.ts')
|
||||
const docOutputFile = join(__dirname, '..', 'docs', 'reference.asciidoc')
|
||||
const typeDefFile = join(__dirname, '..', 'index.d.ts')
|
||||
const requestParamsOutputFile = join(packageFolder, 'requestParams.d.ts')
|
||||
|
||||
log.text = 'Cleaning API folder...'
|
||||
rimraf.sync(join(apiOutputFolder, '*.js'))
|
||||
let log
|
||||
downloadArtifacts({ version: opts.version, hash: opts.hash })
|
||||
.then(onArtifactsDownloaded)
|
||||
.catch(err => {
|
||||
console.log(err)
|
||||
process.exit(1)
|
||||
})
|
||||
|
||||
cloneAndCheckout({ log, tag: opts.tag, branch: opts.branch }, (err, { apiFolder, xPackFolder }) => {
|
||||
if (err) {
|
||||
log.fail(err.message)
|
||||
return
|
||||
}
|
||||
function onArtifactsDownloaded () {
|
||||
log = ora('Generating APIs').start()
|
||||
|
||||
const apiFolderContents = readdirSync(apiFolder)
|
||||
const xPackFolderContents = readdirSync(xPackFolder)
|
||||
.filter(file => !file.startsWith('data_frame_transform_deprecated'))
|
||||
log.text = 'Cleaning API folder...'
|
||||
rimraf.sync(join(apiOutputFolder, '*.js'))
|
||||
|
||||
const allSpec = apiFolderContents.concat(xPackFolderContents)
|
||||
const allSpec = readdirSync(downloadArtifacts.locations.specFolder)
|
||||
.filter(file => file !== '_common.json')
|
||||
.filter(file => !file.includes('deprecated'))
|
||||
.sort()
|
||||
.map(file => {
|
||||
try {
|
||||
return JSON.parse(readFileSync(join(apiFolder, file), 'utf8'))
|
||||
} catch (err) {
|
||||
return JSON.parse(readFileSync(join(xPackFolder, file), 'utf8'))
|
||||
}
|
||||
})
|
||||
.map(file => require(join(downloadArtifacts.locations.specFolder, file)))
|
||||
|
||||
const namespaces = namespacify(apiFolderContents.concat(xPackFolderContents))
|
||||
const namespaces = namespacify(readdirSync(downloadArtifacts.locations.specFolder))
|
||||
for (const namespace in namespaces) {
|
||||
if (namespace === '_common') continue
|
||||
const code = generate(namespace, namespaces[namespace], { apiFolder, xPackFolder }, opts.branch || opts.tag)
|
||||
const code = generate(namespace, namespaces[namespace], downloadArtifacts.locations.specFolder, opts.version)
|
||||
const filePath = join(apiOutputFolder, `${namespace}.js`)
|
||||
writeFileSync(filePath, code, { encoding: 'utf8' })
|
||||
}
|
||||
|
||||
writeFileSync(
|
||||
requestParamsOutputFile,
|
||||
generateRequestTypes(opts.branch || opts.tag, allSpec),
|
||||
generateRequestTypes(opts.version, allSpec),
|
||||
{ encoding: 'utf8' }
|
||||
)
|
||||
|
||||
const { fn: factory, types, kibanaTypes } = genFactory(apiOutputFolder, [apiFolder, xPackFolder], namespaces)
|
||||
const { fn: factory, types } = genFactory(apiOutputFolder, downloadArtifacts.locations.specFolder, namespaces)
|
||||
writeFileSync(
|
||||
mainOutputFile,
|
||||
factory,
|
||||
{ encoding: 'utf8' }
|
||||
)
|
||||
|
||||
let oldTypeDefString = readFileSync(typeDefFile, 'utf8')
|
||||
let start = oldTypeDefString.indexOf('/* GENERATED */')
|
||||
let end = oldTypeDefString.indexOf('/* /GENERATED */')
|
||||
let newTypeDefString = oldTypeDefString.slice(0, start + 15) + '\n' + types + '\n ' + oldTypeDefString.slice(end)
|
||||
const oldTypeDefString = readFileSync(typeDefFile, 'utf8')
|
||||
const start = oldTypeDefString.indexOf('/* GENERATED */')
|
||||
const end = oldTypeDefString.indexOf('/* /GENERATED */')
|
||||
const newTypeDefString = oldTypeDefString.slice(0, start + 15) + '\n' + types + '\n ' + oldTypeDefString.slice(end)
|
||||
writeFileSync(
|
||||
typeDefFile,
|
||||
newTypeDefString,
|
||||
{ encoding: 'utf8' }
|
||||
)
|
||||
|
||||
oldTypeDefString = readFileSync(kibanaTypeDefFile, 'utf8')
|
||||
start = oldTypeDefString.indexOf('/* GENERATED */')
|
||||
end = oldTypeDefString.indexOf('/* /GENERATED */')
|
||||
newTypeDefString = oldTypeDefString.slice(0, start + 15) + '\n' + kibanaTypes + '\n ' + oldTypeDefString.slice(end)
|
||||
writeFileSync(
|
||||
kibanaTypeDefFile,
|
||||
newTypeDefString,
|
||||
{ encoding: 'utf8' }
|
||||
)
|
||||
|
||||
lintFiles(log, () => {
|
||||
log.text = 'Generating documentation'
|
||||
writeFileSync(
|
||||
docOutputFile,
|
||||
generateDocs(require(join(apiFolder, '_common.json')), allSpec),
|
||||
generateDocs(require(join(downloadArtifacts.locations.specFolder, '_common.json')), allSpec),
|
||||
{ encoding: 'utf8' }
|
||||
)
|
||||
|
||||
log.succeed('Done!')
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function lintFiles (log, cb) {
|
||||
log.text = 'Linting...'
|
||||
|
||||
@ -30,6 +30,7 @@ async function release (opts) {
|
||||
const originalName = packageJson.name
|
||||
const originalVersion = packageJson.version
|
||||
const currentCanaryVersion = packageJson.versionCanary
|
||||
const originalTypes = packageJson.types
|
||||
const originalNpmIgnore = await readFile(join(__dirname, '..', '.npmignore'), 'utf8')
|
||||
|
||||
const newCanaryInteger = opts.reset ? 1 : (Number(currentCanaryVersion.split('-')[1].split('.')[1]) + 1)
|
||||
@ -39,12 +40,13 @@ async function release (opts) {
|
||||
packageJson.name = '@elastic/elasticsearch-canary'
|
||||
packageJson.version = newCanaryVersion
|
||||
packageJson.versionCanary = newCanaryVersion
|
||||
packageJson.types = './api/new.d.ts'
|
||||
packageJson.commitHash = execSync('git log -1 --pretty=format:%h').toString()
|
||||
|
||||
// update the package.json
|
||||
await writeFile(
|
||||
join(__dirname, '..', 'package.json'),
|
||||
JSON.stringify(packageJson, null, 2),
|
||||
JSON.stringify(packageJson, null, 2) + '\n',
|
||||
'utf8'
|
||||
)
|
||||
|
||||
@ -72,11 +74,12 @@ async function release (opts) {
|
||||
// restore the package.json to the original values
|
||||
packageJson.name = originalName
|
||||
packageJson.version = originalVersion
|
||||
packageJson.types = originalTypes
|
||||
delete packageJson.commitHash
|
||||
|
||||
await writeFile(
|
||||
join(__dirname, '..', 'package.json'),
|
||||
JSON.stringify(packageJson, null, 2),
|
||||
JSON.stringify(packageJson, null, 2) + '\n',
|
||||
'utf8'
|
||||
)
|
||||
|
||||
|
||||
@ -25,7 +25,6 @@
|
||||
|
||||
const { join } = require('path')
|
||||
const dedent = require('dedent')
|
||||
const semver = require('semver')
|
||||
const allowedMethods = {
|
||||
noBody: ['GET', 'HEAD', 'DELETE'],
|
||||
body: ['POST', 'PUT', 'DELETE']
|
||||
@ -60,19 +59,8 @@ const noPathValidation = [
|
||||
'update'
|
||||
]
|
||||
|
||||
// apis that uses bulkBody property
|
||||
const ndjsonApi = [
|
||||
'bulk',
|
||||
'msearch',
|
||||
'msearch_template',
|
||||
'ml.find_file_structure',
|
||||
'monitoring.bulk',
|
||||
'xpack.ml.find_file_structure',
|
||||
'xpack.monitoring.bulk'
|
||||
]
|
||||
|
||||
function generateNamespace (namespace, nested, folders, version) {
|
||||
const common = require(join(folders.apiFolder, '_common.json'))
|
||||
function generateNamespace (namespace, nested, specFolder, version) {
|
||||
const common = require(join(specFolder, '_common.json'))
|
||||
let code = dedent`
|
||||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
@ -110,7 +98,7 @@ function generateNamespace (namespace, nested, folders, version) {
|
||||
getters += `${n}: { get () { return this.${nameSnaked} } },\n`
|
||||
}
|
||||
}
|
||||
const api = generateMultiApi(version, namespace, nested, common, folders)
|
||||
const api = generateMultiApi(version, namespace, nested, common, specFolder)
|
||||
if (getters.length > 0) {
|
||||
getters = `Object.defineProperties(${api.namespace}Api.prototype, {\n${getters}})`
|
||||
}
|
||||
@ -131,12 +119,7 @@ function generateNamespace (namespace, nested, folders, version) {
|
||||
module.exports = ${api.namespace}Api
|
||||
`
|
||||
} else {
|
||||
let spec = null
|
||||
try {
|
||||
spec = require(join(folders.apiFolder, `${namespace}.json`))
|
||||
} catch (err) {
|
||||
spec = require(join(folders.xPackFolder, `${namespace}.json`))
|
||||
}
|
||||
const spec = require(join(specFolder, `${namespace}.json`))
|
||||
const api = generateSingleApi(version, spec, common)
|
||||
code += `
|
||||
const acceptedQuerystring = ${JSON.stringify(api.acceptedQuerystring)}
|
||||
@ -150,7 +133,7 @@ function generateNamespace (namespace, nested, folders, version) {
|
||||
return code
|
||||
}
|
||||
|
||||
function generateMultiApi (version, namespace, nested, common, folders) {
|
||||
function generateMultiApi (version, namespace, nested, common, specFolder) {
|
||||
const namespaceSnaked = namespace
|
||||
.replace(/\.([a-z])/g, k => k[1].toUpperCase())
|
||||
.replace(/_([a-z])/g, k => k[1].toUpperCase())
|
||||
@ -158,15 +141,10 @@ function generateMultiApi (version, namespace, nested, common, folders) {
|
||||
const snakeCase = {}
|
||||
const acceptedQuerystring = []
|
||||
for (const n of nested) {
|
||||
let spec = null
|
||||
const nameSnaked = n
|
||||
.replace(/\.([a-z])/g, k => k[1].toUpperCase())
|
||||
.replace(/_([a-z])/g, k => k[1].toUpperCase())
|
||||
try {
|
||||
spec = require(join(folders.apiFolder, `${namespace}.${n}.json`))
|
||||
} catch (err) {
|
||||
spec = require(join(folders.xPackFolder, `${namespace}.${n}.json`))
|
||||
}
|
||||
const spec = require(join(specFolder, `${namespace}.${n}.json`))
|
||||
const api = generateSingleApi(version, spec, common)
|
||||
code += `${Uppercase(namespaceSnaked)}Api.prototype.${nameSnaked} = ${api.code}\n\n`
|
||||
Object.assign(snakeCase, api.snakeCase)
|
||||
@ -180,7 +158,7 @@ function generateMultiApi (version, namespace, nested, common, folders) {
|
||||
}
|
||||
|
||||
function generateSingleApi (version, spec, common) {
|
||||
const release = semver.valid(version) ? semver.major(version) : version
|
||||
const release = version.charAt(0)
|
||||
const api = Object.keys(spec)[0]
|
||||
const name = api
|
||||
.replace(/\.([a-z])/g, k => k[1].toUpperCase())
|
||||
@ -262,7 +240,7 @@ function generateSingleApi (version, spec, common) {
|
||||
const request = {
|
||||
method,
|
||||
path,
|
||||
${genBody(api, methods, spec[api].body)}
|
||||
${genBody(api, methods, spec[api].body, spec)}
|
||||
querystring
|
||||
}
|
||||
|
||||
@ -389,7 +367,7 @@ function generateSingleApi (version, spec, common) {
|
||||
}
|
||||
|
||||
let hasStaticPath = false
|
||||
const sortedPaths = paths
|
||||
let sortedPaths = paths
|
||||
// some legacy API have mutliple statis paths
|
||||
// this filter removes them
|
||||
.filter(p => {
|
||||
@ -403,6 +381,9 @@ function generateSingleApi (version, spec, common) {
|
||||
// sort by number of parameters (desc)
|
||||
.sort((a, b) => Object.keys(b.parts || {}).length - Object.keys(a.parts || {}).length)
|
||||
|
||||
const allDeprecated = paths.filter(path => path.deprecated != null)
|
||||
if (allDeprecated.length === paths.length) sortedPaths = [paths[0]]
|
||||
|
||||
let code = ''
|
||||
for (let i = 0; i < sortedPaths.length; i++) {
|
||||
const { path, methods } = sortedPaths[i]
|
||||
@ -450,9 +431,10 @@ function generatePickMethod (methods) {
|
||||
}
|
||||
}
|
||||
|
||||
function genBody (api, methods, body) {
|
||||
function genBody (api, methods, body, spec) {
|
||||
const bodyMethod = getBodyMethod(methods)
|
||||
if (ndjsonApi.indexOf(api) > -1) {
|
||||
const { content_type } = spec[api].headers
|
||||
if (content_type && content_type.includes('application/x-ndjson')) {
|
||||
return 'bulkBody: body,'
|
||||
}
|
||||
if (body === null && bodyMethod) {
|
||||
@ -571,4 +553,3 @@ function Uppercase (str) {
|
||||
}
|
||||
|
||||
module.exports = generateNamespace
|
||||
module.exports.ndjsonApi = ndjsonApi
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
*/
|
||||
|
||||
/* eslint-disable no-template-curly-in-string */
|
||||
/* eslint camelcase: 0 */
|
||||
|
||||
'use strict'
|
||||
|
||||
@ -25,21 +26,11 @@ const { readdirSync } = require('fs')
|
||||
const { join } = require('path')
|
||||
const dedent = require('dedent')
|
||||
const deepmerge = require('deepmerge')
|
||||
const { ndjsonApi } = require('./generateApis')
|
||||
|
||||
const ndjsonApiKey = ndjsonApi
|
||||
.map(api => {
|
||||
return api
|
||||
.replace(/\.([a-z])/g, k => k[1].toUpperCase())
|
||||
.replace(/_([a-z])/g, k => k[1].toUpperCase())
|
||||
})
|
||||
.map(toPascalCase)
|
||||
|
||||
function genFactory (folder, paths, namespaces) {
|
||||
function genFactory (folder, specFolder, namespaces) {
|
||||
// get all the API files
|
||||
// const apiFiles = readdirSync(folder)
|
||||
const apiFiles = readdirSync(paths[0])
|
||||
.concat(readdirSync(paths[1]))
|
||||
const apiFiles = readdirSync(specFolder)
|
||||
.filter(file => file !== '_common.json')
|
||||
.filter(file => !file.includes('deprecated'))
|
||||
.sort()
|
||||
@ -55,10 +46,10 @@ function genFactory (folder, paths, namespaces) {
|
||||
.split('.')
|
||||
.reverse()
|
||||
.reduce((acc, val) => {
|
||||
const spec = readSpec(paths, file.slice(0, -5))
|
||||
const spec = readSpec(specFolder, file.slice(0, -5))
|
||||
const isHead = isHeadMethod(spec, file.slice(0, -5))
|
||||
const body = hasBody(spec, file.slice(0, -5))
|
||||
const methods = acc === null ? buildMethodDefinition({ kibana: false }, val, name, body, isHead) : null
|
||||
const methods = acc === null ? buildMethodDefinition({ kibana: false }, val, name, body, isHead, spec) : null
|
||||
const obj = {}
|
||||
if (methods) {
|
||||
for (const m of methods) {
|
||||
@ -87,10 +78,10 @@ function genFactory (folder, paths, namespaces) {
|
||||
.split('.')
|
||||
.reverse()
|
||||
.reduce((acc, val) => {
|
||||
const spec = readSpec(paths, file.slice(0, -5))
|
||||
const spec = readSpec(specFolder, file.slice(0, -5))
|
||||
const isHead = isHeadMethod(spec, file.slice(0, -5))
|
||||
const body = hasBody(spec, file.slice(0, -5))
|
||||
const methods = acc === null ? buildMethodDefinition({ kibana: true }, val, name, body, isHead) : null
|
||||
const methods = acc === null ? buildMethodDefinition({ kibana: true }, val, name, body, isHead, spec) : null
|
||||
const obj = {}
|
||||
if (methods) {
|
||||
for (const m of methods) {
|
||||
@ -226,11 +217,12 @@ function toPascalCase (str) {
|
||||
return str[0].toUpperCase() + str.slice(1)
|
||||
}
|
||||
|
||||
function buildMethodDefinition (opts, api, name, hasBody, isHead) {
|
||||
function buildMethodDefinition (opts, api, name, hasBody, isHead, spec) {
|
||||
const Name = toPascalCase(name)
|
||||
const bodyType = ndjsonApiKey.includes(Name) ? 'RequestNDBody' : 'RequestBody'
|
||||
const { content_type } = spec[Object.keys(spec)[0]].headers
|
||||
const bodyType = content_type && content_type.includes('application/x-ndjson') ? 'RequestNDBody' : 'RequestBody'
|
||||
const responseType = isHead ? 'boolean' : 'Record<string, any>'
|
||||
const defaultBodyType = ndjsonApiKey.includes(Name) ? 'Record<string, any>[]' : 'Record<string, any>'
|
||||
const defaultBodyType = content_type && content_type.includes('application/x-ndjson') ? 'Record<string, any>[]' : 'Record<string, any>'
|
||||
|
||||
if (opts.kibana) {
|
||||
if (hasBody) {
|
||||
@ -296,16 +288,12 @@ function isHeadMethod (spec, api) {
|
||||
return methods.length === 1 && methods[0] === 'HEAD'
|
||||
}
|
||||
|
||||
function readSpec (paths, file) {
|
||||
function readSpec (specFolder, file) {
|
||||
try {
|
||||
return require(join(paths[0], file))
|
||||
} catch (err) {}
|
||||
|
||||
try {
|
||||
return require(join(paths[1], file))
|
||||
} catch (err) {}
|
||||
|
||||
throw new Error(`Cannot read spec file ${file}`)
|
||||
return require(join(specFolder, file))
|
||||
} catch (err) {
|
||||
throw new Error(`Cannot read spec file ${file}`)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = genFactory
|
||||
|
||||
@ -17,22 +17,14 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
/* eslint camelcase: 0 */
|
||||
|
||||
'use strict'
|
||||
|
||||
const semver = require('semver')
|
||||
const deprecatedParameters = require('./patch.json')
|
||||
const { ndjsonApi } = require('./generateApis')
|
||||
|
||||
const ndjsonApiKey = ndjsonApi
|
||||
.map(api => {
|
||||
return api
|
||||
.replace(/\.([a-z])/g, k => k[1].toUpperCase())
|
||||
.replace(/_([a-z])/g, k => k[1].toUpperCase())
|
||||
})
|
||||
.map(toPascalCase)
|
||||
|
||||
function generate (version, api) {
|
||||
const release = semver.valid(version) ? semver.major(version) : version
|
||||
const release = version.charAt(0)
|
||||
let types = `/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
@ -123,7 +115,8 @@ export interface Generic {
|
||||
return `${e.key}${optional}: ${getType(e.value.type, e.value.options)};`
|
||||
}
|
||||
|
||||
const bodyGeneric = ndjsonApiKey.includes(toPascalCase(name)) ? 'RequestNDBody' : 'RequestBody'
|
||||
const { content_type } = spec[api].headers
|
||||
const bodyGeneric = content_type && content_type.includes('application/x-ndjson') ? 'RequestNDBody' : 'RequestBody'
|
||||
|
||||
const code = `
|
||||
export interface ${toPascalCase(name)}${body ? `<T = ${bodyGeneric}>` : ''} extends Generic {
|
||||
|
||||
@ -20,15 +20,15 @@
|
||||
'use strict'
|
||||
|
||||
const generate = require('./generateApis')
|
||||
const generateRequestTypes = require('./generateRequestTypes')
|
||||
const cloneAndCheckout = require('./clone-es')
|
||||
const genFactory = require('./generateMain')
|
||||
const generateDocs = require('./generateDocs')
|
||||
const generateRequestTypes = require('./generateRequestTypes')
|
||||
|
||||
module.exports = {
|
||||
generate,
|
||||
cloneAndCheckout,
|
||||
genFactory,
|
||||
generateRequestTypes,
|
||||
generateDocs
|
||||
generateDocs,
|
||||
generateRequestTypes
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
"_source_includes": "_source_include",
|
||||
"_source_excludes": "_source_exclude"
|
||||
},
|
||||
"master": {
|
||||
"8": {
|
||||
"_source_includes": "_source_include",
|
||||
"_source_excludes": "_source_exclude"
|
||||
}
|
||||
|
||||
@ -57,27 +57,27 @@ test('No errors', t => {
|
||||
|
||||
client.on(events.SERIALIZATION, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.SERIALIZATION)
|
||||
t.equal(order.shift(), events.SERIALIZATION)
|
||||
})
|
||||
|
||||
client.on(events.REQUEST, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.REQUEST)
|
||||
t.equal(order.shift(), events.REQUEST)
|
||||
})
|
||||
|
||||
client.on(events.DESERIALIZATION, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.DESERIALIZATION)
|
||||
t.equal(order.shift(), events.DESERIALIZATION)
|
||||
})
|
||||
|
||||
client.on(events.RESPONSE, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.RESPONSE)
|
||||
t.equal(order.shift(), events.RESPONSE)
|
||||
})
|
||||
|
||||
client.info((err, result) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.length, 0)
|
||||
t.equal(order.length, 0)
|
||||
})
|
||||
})
|
||||
|
||||
@ -99,12 +99,12 @@ test('Connection error', t => {
|
||||
|
||||
client.on(events.SERIALIZATION, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.SERIALIZATION)
|
||||
t.equal(order.shift(), events.SERIALIZATION)
|
||||
})
|
||||
|
||||
client.on(events.REQUEST, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.REQUEST)
|
||||
t.equal(order.shift(), events.REQUEST)
|
||||
})
|
||||
|
||||
client.on(events.DESERIALIZATION, (_err, request) => {
|
||||
@ -113,12 +113,12 @@ test('Connection error', t => {
|
||||
|
||||
client.on(events.RESPONSE, (err, request) => {
|
||||
t.ok(err instanceof ConnectionError)
|
||||
t.strictEqual(order.shift(), events.RESPONSE)
|
||||
t.equal(order.shift(), events.RESPONSE)
|
||||
})
|
||||
|
||||
client.info((err, result) => {
|
||||
t.ok(err instanceof ConnectionError)
|
||||
t.strictEqual(order.length, 0)
|
||||
t.equal(order.length, 0)
|
||||
})
|
||||
})
|
||||
|
||||
@ -140,12 +140,12 @@ test('TimeoutError error', t => {
|
||||
|
||||
client.on(events.SERIALIZATION, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.SERIALIZATION)
|
||||
t.equal(order.shift(), events.SERIALIZATION)
|
||||
})
|
||||
|
||||
client.on(events.REQUEST, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.REQUEST)
|
||||
t.equal(order.shift(), events.REQUEST)
|
||||
})
|
||||
|
||||
client.on(events.DESERIALIZATION, (_err, request) => {
|
||||
@ -154,12 +154,12 @@ test('TimeoutError error', t => {
|
||||
|
||||
client.on(events.RESPONSE, (err, request) => {
|
||||
t.ok(err instanceof TimeoutError)
|
||||
t.strictEqual(order.shift(), events.RESPONSE)
|
||||
t.equal(order.shift(), events.RESPONSE)
|
||||
})
|
||||
|
||||
client.info((err, result) => {
|
||||
t.ok(err instanceof TimeoutError)
|
||||
t.strictEqual(order.length, 0)
|
||||
t.equal(order.length, 0)
|
||||
})
|
||||
})
|
||||
|
||||
@ -180,12 +180,12 @@ test('RequestAbortedError error', t => {
|
||||
|
||||
client.on(events.SERIALIZATION, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.SERIALIZATION)
|
||||
t.equal(order.shift(), events.SERIALIZATION)
|
||||
})
|
||||
|
||||
client.on(events.REQUEST, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.REQUEST)
|
||||
t.equal(order.shift(), events.REQUEST)
|
||||
})
|
||||
|
||||
client.on(events.DESERIALIZATION, (_err, request) => {
|
||||
@ -194,12 +194,12 @@ test('RequestAbortedError error', t => {
|
||||
|
||||
client.on(events.RESPONSE, (err, request) => {
|
||||
t.ok(err instanceof RequestAbortedError)
|
||||
t.strictEqual(order.shift(), events.RESPONSE)
|
||||
t.equal(order.shift(), events.RESPONSE)
|
||||
})
|
||||
|
||||
const request = client.info((err, result) => {
|
||||
t.ok(err instanceof RequestAbortedError)
|
||||
t.strictEqual(order.length, 0)
|
||||
t.equal(order.length, 0)
|
||||
})
|
||||
|
||||
request.abort()
|
||||
@ -232,27 +232,27 @@ test('ResponseError error (no retry)', t => {
|
||||
|
||||
client.on(events.SERIALIZATION, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.SERIALIZATION)
|
||||
t.equal(order.shift(), events.SERIALIZATION)
|
||||
})
|
||||
|
||||
client.on(events.REQUEST, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.REQUEST)
|
||||
t.equal(order.shift(), events.REQUEST)
|
||||
})
|
||||
|
||||
client.on(events.DESERIALIZATION, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.DESERIALIZATION)
|
||||
t.equal(order.shift(), events.DESERIALIZATION)
|
||||
})
|
||||
|
||||
client.on(events.RESPONSE, (err, request) => {
|
||||
t.ok(err instanceof ResponseError)
|
||||
t.strictEqual(order.shift(), events.RESPONSE)
|
||||
t.equal(order.shift(), events.RESPONSE)
|
||||
})
|
||||
|
||||
client.info((err, result) => {
|
||||
t.ok(err instanceof ResponseError)
|
||||
t.strictEqual(order.length, 0)
|
||||
t.equal(order.length, 0)
|
||||
})
|
||||
})
|
||||
|
||||
@ -285,27 +285,27 @@ test('ResponseError error (with retry)', t => {
|
||||
|
||||
client.on(events.SERIALIZATION, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.SERIALIZATION)
|
||||
t.equal(order.shift(), events.SERIALIZATION)
|
||||
})
|
||||
|
||||
client.on(events.REQUEST, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.REQUEST)
|
||||
t.equal(order.shift(), events.REQUEST)
|
||||
})
|
||||
|
||||
client.on(events.DESERIALIZATION, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.DESERIALIZATION)
|
||||
t.equal(order.shift(), events.DESERIALIZATION)
|
||||
})
|
||||
|
||||
client.on(events.RESPONSE, (err, request) => {
|
||||
t.ok(err instanceof ResponseError)
|
||||
t.strictEqual(order.shift(), events.RESPONSE)
|
||||
t.equal(order.shift(), events.RESPONSE)
|
||||
})
|
||||
|
||||
client.info((err, result) => {
|
||||
t.ok(err instanceof ResponseError)
|
||||
t.strictEqual(order.length, 0)
|
||||
t.equal(order.length, 0)
|
||||
})
|
||||
})
|
||||
|
||||
@ -325,12 +325,12 @@ test('Serialization Error', t => {
|
||||
|
||||
client.on(events.SERIALIZATION, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.SERIALIZATION)
|
||||
t.equal(order.shift(), events.SERIALIZATION)
|
||||
})
|
||||
|
||||
client.on(events.REQUEST, (err, request) => {
|
||||
t.ok(err instanceof SerializationError)
|
||||
t.strictEqual(order.shift(), events.REQUEST)
|
||||
t.equal(order.shift(), events.REQUEST)
|
||||
})
|
||||
|
||||
client.on(events.DESERIALIZATION, (_err, request) => {
|
||||
@ -345,7 +345,7 @@ test('Serialization Error', t => {
|
||||
body.o = body
|
||||
client.index({ index: 'test', body }, (err, result) => {
|
||||
t.ok(err instanceof SerializationError)
|
||||
t.strictEqual(order.length, 0)
|
||||
t.equal(order.length, 0)
|
||||
})
|
||||
})
|
||||
|
||||
@ -384,27 +384,27 @@ test('Deserialization Error', t => {
|
||||
|
||||
client.on(events.SERIALIZATION, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.SERIALIZATION)
|
||||
t.equal(order.shift(), events.SERIALIZATION)
|
||||
})
|
||||
|
||||
client.on(events.REQUEST, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.REQUEST)
|
||||
t.equal(order.shift(), events.REQUEST)
|
||||
})
|
||||
|
||||
client.on(events.DESERIALIZATION, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.DESERIALIZATION)
|
||||
t.equal(order.shift(), events.DESERIALIZATION)
|
||||
})
|
||||
|
||||
client.on(events.RESPONSE, (err, request) => {
|
||||
t.ok(err instanceof DeserializationError)
|
||||
t.strictEqual(order.shift(), events.RESPONSE)
|
||||
t.equal(order.shift(), events.RESPONSE)
|
||||
})
|
||||
|
||||
client.info((err, result) => {
|
||||
t.ok(err instanceof DeserializationError)
|
||||
t.strictEqual(order.length, 0)
|
||||
t.equal(order.length, 0)
|
||||
})
|
||||
})
|
||||
|
||||
@ -435,27 +435,27 @@ test('Socket destroyed while reading the body', t => {
|
||||
|
||||
client.on(events.SERIALIZATION, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.SERIALIZATION)
|
||||
t.equal(order.shift(), events.SERIALIZATION)
|
||||
})
|
||||
|
||||
client.on(events.REQUEST, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.REQUEST)
|
||||
t.equal(order.shift(), events.REQUEST)
|
||||
})
|
||||
|
||||
client.on(events.DESERIALIZATION, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(order.shift(), events.DESERIALIZATION)
|
||||
t.equal(order.shift(), events.DESERIALIZATION)
|
||||
})
|
||||
|
||||
client.on(events.RESPONSE, (err, request) => {
|
||||
t.ok(err instanceof ConnectionError)
|
||||
t.strictEqual(order.shift(), events.RESPONSE)
|
||||
t.equal(order.shift(), events.RESPONSE)
|
||||
})
|
||||
|
||||
client.info((err, result) => {
|
||||
t.ok(err instanceof ConnectionError)
|
||||
t.strictEqual(order.length, 0)
|
||||
t.equal(order.length, 0)
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
|
||||
@ -17,7 +17,7 @@ test('Request id', t => {
|
||||
t.type(genReqId, 'function')
|
||||
|
||||
for (let i = 1; i <= 10; i++) {
|
||||
t.strictEqual(genReqId(), i)
|
||||
t.equal(genReqId(), i)
|
||||
}
|
||||
|
||||
t.end()
|
||||
@ -40,12 +40,12 @@ test('Request id', t => {
|
||||
|
||||
client.on('request', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.request.id, 'custom-id')
|
||||
t.equal(meta.request.id, 'custom-id')
|
||||
})
|
||||
|
||||
client.on('response', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.request.id, 'custom-id')
|
||||
t.equal(meta.request.id, 'custom-id')
|
||||
})
|
||||
|
||||
client.info({}, options, t.error)
|
||||
@ -61,12 +61,12 @@ test('Request id', t => {
|
||||
|
||||
client.on('request', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.request.id, 'custom-id')
|
||||
t.equal(meta.request.id, 'custom-id')
|
||||
})
|
||||
|
||||
client.on('response', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.request.id, 'custom-id')
|
||||
t.equal(meta.request.id, 'custom-id')
|
||||
})
|
||||
|
||||
client.info({}, { id: 'custom-id' }, t.error)
|
||||
@ -84,7 +84,7 @@ test('Request id', t => {
|
||||
|
||||
client.on('sniff', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.request.id, 1)
|
||||
t.equal(meta.request.id, 1)
|
||||
})
|
||||
})
|
||||
|
||||
@ -99,15 +99,15 @@ test('Request id', t => {
|
||||
})
|
||||
|
||||
client.on('request', (e, { meta }) => {
|
||||
t.strictEqual(meta.request.id, 'custom')
|
||||
t.equal(meta.request.id, 'custom')
|
||||
})
|
||||
|
||||
client.on('response', (e, { meta }) => {
|
||||
t.strictEqual(meta.request.id, 'custom')
|
||||
t.equal(meta.request.id, 'custom')
|
||||
})
|
||||
|
||||
client.on('sniff', (e, { meta }) => {
|
||||
t.strictEqual(meta.request.id, 'custom')
|
||||
t.equal(meta.request.id, 'custom')
|
||||
})
|
||||
|
||||
client.transport.request({
|
||||
@ -139,7 +139,7 @@ test('Request id', t => {
|
||||
|
||||
client.on('resurrect', (err, meta) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.request.id, 'custom')
|
||||
t.equal(meta.request.id, 'custom')
|
||||
clock.uninstall()
|
||||
})
|
||||
|
||||
@ -160,12 +160,12 @@ test('Request context', t => {
|
||||
|
||||
client.on('request', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.context, null)
|
||||
t.equal(meta.context, null)
|
||||
})
|
||||
|
||||
client.on('response', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.context, null)
|
||||
t.equal(meta.context, null)
|
||||
})
|
||||
|
||||
client.info(t.error)
|
||||
@ -181,12 +181,12 @@ test('Request context', t => {
|
||||
|
||||
client.on('request', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(meta.context, { winter: 'is coming' })
|
||||
t.same(meta.context, { winter: 'is coming' })
|
||||
})
|
||||
|
||||
client.on('response', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(meta.context, { winter: 'is coming' })
|
||||
t.same(meta.context, { winter: 'is coming' })
|
||||
})
|
||||
|
||||
client.info({}, { context: { winter: 'is coming' } }, t.error)
|
||||
@ -203,12 +203,12 @@ test('Request context', t => {
|
||||
|
||||
client.on('request', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(meta.context, { winter: 'is coming' })
|
||||
t.same(meta.context, { winter: 'is coming' })
|
||||
})
|
||||
|
||||
client.on('response', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(meta.context, { winter: 'is coming' })
|
||||
t.same(meta.context, { winter: 'is coming' })
|
||||
})
|
||||
|
||||
client.info(t.error)
|
||||
@ -225,12 +225,12 @@ test('Request context', t => {
|
||||
|
||||
client.on('request', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(meta.context, { winter: 'has come' })
|
||||
t.same(meta.context, { winter: 'has come' })
|
||||
})
|
||||
|
||||
client.on('response', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(meta.context, { winter: 'has come' })
|
||||
t.same(meta.context, { winter: 'has come' })
|
||||
})
|
||||
|
||||
client.info({}, { context: { winter: 'has come' } }, t.error)
|
||||
@ -245,7 +245,7 @@ test('Client name', t => {
|
||||
node: 'http://localhost:9200',
|
||||
name: 'cluster'
|
||||
})
|
||||
t.strictEqual(client.name, 'cluster')
|
||||
t.equal(client.name, 'cluster')
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -259,17 +259,17 @@ test('Client name', t => {
|
||||
|
||||
client.on('request', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.name, 'cluster')
|
||||
t.equal(meta.name, 'cluster')
|
||||
})
|
||||
|
||||
client.on('response', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.name, 'cluster')
|
||||
t.equal(meta.name, 'cluster')
|
||||
})
|
||||
|
||||
client.info((err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.name, 'cluster')
|
||||
t.equal(meta.name, 'cluster')
|
||||
})
|
||||
})
|
||||
|
||||
@ -284,17 +284,17 @@ test('Client name', t => {
|
||||
|
||||
client.on('request', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.name, symbol)
|
||||
t.equal(meta.name, symbol)
|
||||
})
|
||||
|
||||
client.on('response', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.name, symbol)
|
||||
t.equal(meta.name, symbol)
|
||||
})
|
||||
|
||||
client.info((err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.name, symbol)
|
||||
t.equal(meta.name, symbol)
|
||||
})
|
||||
})
|
||||
|
||||
@ -310,7 +310,7 @@ test('Client name', t => {
|
||||
|
||||
client.on('sniff', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.name, 'elasticsearch-js')
|
||||
t.equal(meta.name, 'elasticsearch-js')
|
||||
})
|
||||
})
|
||||
|
||||
@ -325,15 +325,15 @@ test('Client name', t => {
|
||||
})
|
||||
|
||||
client.on('request', (e, { meta }) => {
|
||||
t.strictEqual(meta.name, 'elasticsearch-js')
|
||||
t.equal(meta.name, 'elasticsearch-js')
|
||||
})
|
||||
|
||||
client.on('response', (e, { meta }) => {
|
||||
t.strictEqual(meta.name, 'elasticsearch-js')
|
||||
t.equal(meta.name, 'elasticsearch-js')
|
||||
})
|
||||
|
||||
client.on('sniff', (e, { meta }) => {
|
||||
t.strictEqual(meta.name, 'elasticsearch-js')
|
||||
t.equal(meta.name, 'elasticsearch-js')
|
||||
})
|
||||
|
||||
client.transport.request({
|
||||
@ -364,7 +364,7 @@ test('Client name', t => {
|
||||
|
||||
client.on('resurrect', (err, meta) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.name, 'elasticsearch-js')
|
||||
t.equal(meta.name, 'elasticsearch-js')
|
||||
clock.uninstall()
|
||||
})
|
||||
|
||||
@ -392,7 +392,7 @@ test('Client name', t => {
|
||||
|
||||
client.on('resurrect', (err, meta) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.name, 'child-client')
|
||||
t.equal(meta.name, 'child-client')
|
||||
clock.uninstall()
|
||||
})
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ test('http-http proxy support', async t => {
|
||||
const server = await createServer()
|
||||
const proxy = await createProxy()
|
||||
server.on('request', (req, res) => {
|
||||
t.strictEqual(req.url, '/_cluster/health')
|
||||
t.equal(req.url, '/_cluster/health')
|
||||
res.setHeader('content-type', 'application/json')
|
||||
res.end(JSON.stringify({ hello: 'world' }))
|
||||
})
|
||||
@ -29,7 +29,7 @@ test('http-http proxy support', async t => {
|
||||
})
|
||||
|
||||
const response = await client.cluster.health()
|
||||
t.deepEqual(response.body, { hello: 'world' })
|
||||
t.same(response.body, { hello: 'world' })
|
||||
|
||||
server.close()
|
||||
proxy.close()
|
||||
@ -39,7 +39,7 @@ test('http-https proxy support', async t => {
|
||||
const server = await createSecureServer()
|
||||
const proxy = await createProxy()
|
||||
server.on('request', (req, res) => {
|
||||
t.strictEqual(req.url, '/_cluster/health')
|
||||
t.equal(req.url, '/_cluster/health')
|
||||
res.setHeader('content-type', 'application/json')
|
||||
res.end(JSON.stringify({ hello: 'world' }))
|
||||
})
|
||||
@ -50,7 +50,7 @@ test('http-https proxy support', async t => {
|
||||
})
|
||||
|
||||
const response = await client.cluster.health()
|
||||
t.deepEqual(response.body, { hello: 'world' })
|
||||
t.same(response.body, { hello: 'world' })
|
||||
|
||||
server.close()
|
||||
proxy.close()
|
||||
@ -60,7 +60,7 @@ test('https-http proxy support', async t => {
|
||||
const server = await createServer()
|
||||
const proxy = await createSecureProxy()
|
||||
server.on('request', (req, res) => {
|
||||
t.strictEqual(req.url, '/_cluster/health')
|
||||
t.equal(req.url, '/_cluster/health')
|
||||
res.setHeader('content-type', 'application/json')
|
||||
res.end(JSON.stringify({ hello: 'world' }))
|
||||
})
|
||||
@ -71,7 +71,7 @@ test('https-http proxy support', async t => {
|
||||
})
|
||||
|
||||
const response = await client.cluster.health()
|
||||
t.deepEqual(response.body, { hello: 'world' })
|
||||
t.same(response.body, { hello: 'world' })
|
||||
|
||||
server.close()
|
||||
proxy.close()
|
||||
@ -81,7 +81,7 @@ test('https-https proxy support', async t => {
|
||||
const server = await createSecureServer()
|
||||
const proxy = await createSecureProxy()
|
||||
server.on('request', (req, res) => {
|
||||
t.strictEqual(req.url, '/_cluster/health')
|
||||
t.equal(req.url, '/_cluster/health')
|
||||
res.setHeader('content-type', 'application/json')
|
||||
res.end(JSON.stringify({ hello: 'world' }))
|
||||
})
|
||||
@ -92,7 +92,7 @@ test('https-https proxy support', async t => {
|
||||
})
|
||||
|
||||
const response = await client.cluster.health()
|
||||
t.deepEqual(response.body, { hello: 'world' })
|
||||
t.same(response.body, { hello: 'world' })
|
||||
|
||||
server.close()
|
||||
proxy.close()
|
||||
@ -102,7 +102,7 @@ test('http basic authentication', async t => {
|
||||
const server = await createServer()
|
||||
const proxy = await createProxy()
|
||||
server.on('request', (req, res) => {
|
||||
t.strictEqual(req.url, '/_cluster/health')
|
||||
t.equal(req.url, '/_cluster/health')
|
||||
res.setHeader('content-type', 'application/json')
|
||||
res.end(JSON.stringify({ hello: 'world' }))
|
||||
})
|
||||
@ -117,7 +117,7 @@ test('http basic authentication', async t => {
|
||||
})
|
||||
|
||||
const response = await client.cluster.health()
|
||||
t.deepEqual(response.body, { hello: 'world' })
|
||||
t.same(response.body, { hello: 'world' })
|
||||
|
||||
server.close()
|
||||
proxy.close()
|
||||
@ -127,7 +127,7 @@ test('https basic authentication', async t => {
|
||||
const server = await createSecureServer()
|
||||
const proxy = await createProxy()
|
||||
server.on('request', (req, res) => {
|
||||
t.strictEqual(req.url, '/_cluster/health')
|
||||
t.equal(req.url, '/_cluster/health')
|
||||
res.setHeader('content-type', 'application/json')
|
||||
res.end(JSON.stringify({ hello: 'world' }))
|
||||
})
|
||||
@ -142,7 +142,7 @@ test('https basic authentication', async t => {
|
||||
})
|
||||
|
||||
const response = await client.cluster.health()
|
||||
t.deepEqual(response.body, { hello: 'world' })
|
||||
t.same(response.body, { hello: 'world' })
|
||||
|
||||
server.close()
|
||||
proxy.close()
|
||||
|
||||
@ -56,11 +56,11 @@ test('Should execute the recurrect API with the ping strategy', t => {
|
||||
|
||||
client.on(events.RESURRECT, (err, meta) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.strategy, 'ping')
|
||||
t.false(meta.isAlive)
|
||||
t.strictEqual(meta.connection.id, 'node0')
|
||||
t.strictEqual(meta.name, 'elasticsearch-js')
|
||||
t.deepEqual(meta.request, { id: 2 })
|
||||
t.equal(meta.strategy, 'ping')
|
||||
t.notOk(meta.isAlive)
|
||||
t.equal(meta.connection.id, 'node0')
|
||||
t.equal(meta.name, 'elasticsearch-js')
|
||||
t.same(meta.request, { id: 2 })
|
||||
})
|
||||
|
||||
q.add((q, done) => {
|
||||
@ -117,14 +117,14 @@ test('Resurrect a node and handle 502/3/4 status code', t => {
|
||||
let idCount = 2
|
||||
client.on(events.RESURRECT, (err, meta) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.strategy, 'ping')
|
||||
t.strictEqual(meta.connection.id, 'node0')
|
||||
t.strictEqual(meta.name, 'elasticsearch-js')
|
||||
t.deepEqual(meta.request, { id: idCount++ })
|
||||
t.equal(meta.strategy, 'ping')
|
||||
t.equal(meta.connection.id, 'node0')
|
||||
t.equal(meta.name, 'elasticsearch-js')
|
||||
t.same(meta.request, { id: idCount++ })
|
||||
if (count < 4) {
|
||||
t.false(meta.isAlive)
|
||||
t.notOk(meta.isAlive)
|
||||
} else {
|
||||
t.true(meta.isAlive)
|
||||
t.ok(meta.isAlive)
|
||||
}
|
||||
})
|
||||
|
||||
@ -179,11 +179,11 @@ test('Should execute the recurrect API with the optimistic strategy', t => {
|
||||
|
||||
client.on(events.RESURRECT, (err, meta) => {
|
||||
t.error(err)
|
||||
t.strictEqual(meta.strategy, 'optimistic')
|
||||
t.true(meta.isAlive)
|
||||
t.strictEqual(meta.connection.id, 'node0')
|
||||
t.strictEqual(meta.name, 'elasticsearch-js')
|
||||
t.deepEqual(meta.request, { id: 2 })
|
||||
t.equal(meta.strategy, 'optimistic')
|
||||
t.ok(meta.isAlive)
|
||||
t.equal(meta.connection.id, 'node0')
|
||||
t.equal(meta.name, 'elasticsearch-js')
|
||||
t.same(meta.request, { id: 2 })
|
||||
})
|
||||
|
||||
q.add((q, done) => {
|
||||
|
||||
@ -43,11 +43,11 @@ test('Should update the connection pool', t => {
|
||||
const client = new Client({
|
||||
node: nodes[Object.keys(nodes)[0]].url
|
||||
})
|
||||
t.strictEqual(client.connectionPool.size, 1)
|
||||
t.equal(client.connectionPool.size, 1)
|
||||
|
||||
client.on(events.SNIFF, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
request.meta.sniff.reason,
|
||||
Transport.sniffReasons.DEFAULT
|
||||
)
|
||||
@ -56,14 +56,14 @@ test('Should update the connection pool', t => {
|
||||
// run the sniffer
|
||||
client.transport.sniff((err, hosts) => {
|
||||
t.error(err)
|
||||
t.strictEqual(hosts.length, 4)
|
||||
t.equal(hosts.length, 4)
|
||||
|
||||
const ids = Object.keys(nodes)
|
||||
for (let i = 0; i < hosts.length; i++) {
|
||||
const id = ids[i]
|
||||
// the first node will be an update of the existing one
|
||||
if (id === 'node0') {
|
||||
t.deepEqual(hosts[i], {
|
||||
t.same(hosts[i], {
|
||||
url: new URL(nodes[id].url),
|
||||
id: id,
|
||||
roles: {
|
||||
@ -74,7 +74,7 @@ test('Should update the connection pool', t => {
|
||||
}
|
||||
})
|
||||
} else {
|
||||
t.deepEqual(hosts[i], {
|
||||
t.same(hosts[i], {
|
||||
url: new URL(nodes[id].url),
|
||||
id: id,
|
||||
roles: {
|
||||
@ -90,7 +90,7 @@ test('Should update the connection pool', t => {
|
||||
}
|
||||
}
|
||||
|
||||
t.strictEqual(client.connectionPool.size, 4)
|
||||
t.equal(client.connectionPool.size, 4)
|
||||
})
|
||||
t.teardown(shutdown)
|
||||
})
|
||||
@ -103,11 +103,11 @@ test('Should handle hostnames in publish_address', t => {
|
||||
const client = new Client({
|
||||
node: nodes[Object.keys(nodes)[0]].url
|
||||
})
|
||||
t.strictEqual(client.connectionPool.size, 1)
|
||||
t.equal(client.connectionPool.size, 1)
|
||||
|
||||
client.on(events.SNIFF, (err, request) => {
|
||||
t.error(err)
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
request.meta.sniff.reason,
|
||||
Transport.sniffReasons.DEFAULT
|
||||
)
|
||||
@ -116,14 +116,14 @@ test('Should handle hostnames in publish_address', t => {
|
||||
// run the sniffer
|
||||
client.transport.sniff((err, hosts) => {
|
||||
t.error(err)
|
||||
t.strictEqual(hosts.length, 4)
|
||||
t.equal(hosts.length, 4)
|
||||
|
||||
for (let i = 0; i < hosts.length; i++) {
|
||||
// the first node will be an update of the existing one
|
||||
t.strictEqual(hosts[i].url.hostname, 'localhost')
|
||||
t.equal(hosts[i].url.hostname, 'localhost')
|
||||
}
|
||||
|
||||
t.strictEqual(client.connectionPool.size, 4)
|
||||
t.equal(client.connectionPool.size, 4)
|
||||
})
|
||||
t.teardown(shutdown)
|
||||
})
|
||||
@ -144,21 +144,21 @@ test('Sniff interval', t => {
|
||||
client.on(events.SNIFF, (err, request) => {
|
||||
t.error(err)
|
||||
const { hosts, reason } = request.meta.sniff
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
client.connectionPool.size,
|
||||
hosts.length
|
||||
)
|
||||
t.strictEqual(reason, Transport.sniffReasons.SNIFF_INTERVAL)
|
||||
t.equal(reason, Transport.sniffReasons.SNIFF_INTERVAL)
|
||||
})
|
||||
|
||||
t.strictEqual(client.connectionPool.size, 1)
|
||||
t.equal(client.connectionPool.size, 1)
|
||||
|
||||
q.add((q, done) => {
|
||||
clock.tick(51)
|
||||
client.info(err => {
|
||||
t.error(err)
|
||||
waitSniffEnd(() => {
|
||||
t.strictEqual(client.connectionPool.size, 4)
|
||||
t.equal(client.connectionPool.size, 4)
|
||||
done()
|
||||
})
|
||||
})
|
||||
@ -173,7 +173,7 @@ test('Sniff interval', t => {
|
||||
client.info(err => {
|
||||
t.error(err)
|
||||
waitSniffEnd(() => {
|
||||
t.strictEqual(client.connectionPool.size, 3)
|
||||
t.equal(client.connectionPool.size, 3)
|
||||
done()
|
||||
})
|
||||
})
|
||||
@ -208,14 +208,14 @@ test('Sniff on start', t => {
|
||||
client.on(events.SNIFF, (err, request) => {
|
||||
t.error(err)
|
||||
const { hosts, reason } = request.meta.sniff
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
client.connectionPool.size,
|
||||
hosts.length
|
||||
)
|
||||
t.strictEqual(reason, Transport.sniffReasons.SNIFF_ON_START)
|
||||
t.equal(reason, Transport.sniffReasons.SNIFF_ON_START)
|
||||
})
|
||||
|
||||
t.strictEqual(client.connectionPool.size, 1)
|
||||
t.equal(client.connectionPool.size, 1)
|
||||
t.teardown(shutdown)
|
||||
})
|
||||
})
|
||||
@ -238,10 +238,10 @@ test('Should not close living connections', t => {
|
||||
Connection: MyConnection
|
||||
})
|
||||
|
||||
t.strictEqual(client.connectionPool.size, 1)
|
||||
t.equal(client.connectionPool.size, 1)
|
||||
client.transport.sniff((err, hosts) => {
|
||||
t.error(err)
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
client.connectionPool.size,
|
||||
hosts.length
|
||||
)
|
||||
@ -276,16 +276,16 @@ test('Sniff on connection fault', t => {
|
||||
Connection: MyConnection
|
||||
})
|
||||
|
||||
t.strictEqual(client.connectionPool.size, 2)
|
||||
t.equal(client.connectionPool.size, 2)
|
||||
// this event will be triggered by the connection fault
|
||||
client.on(events.SNIFF, (err, request) => {
|
||||
t.error(err)
|
||||
const { hosts, reason } = request.meta.sniff
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
client.connectionPool.size,
|
||||
hosts.length
|
||||
)
|
||||
t.strictEqual(reason, Transport.sniffReasons.SNIFF_ON_CONNECTION_FAULT)
|
||||
t.equal(reason, Transport.sniffReasons.SNIFF_ON_CONNECTION_FAULT)
|
||||
})
|
||||
|
||||
client.info((err, result) => {
|
||||
|
||||
@ -102,9 +102,9 @@ test('bulk index with custom id', async t => {
|
||||
id: '19273860' // id of document n° 4242
|
||||
})
|
||||
|
||||
t.strictEqual(body._index, INDEX)
|
||||
t.strictEqual(body._id, '19273860')
|
||||
t.strictEqual(body._source.id, '19273860')
|
||||
t.equal(body._index, INDEX)
|
||||
t.equal(body._id, '19273860')
|
||||
t.equal(body._source.id, '19273860')
|
||||
})
|
||||
|
||||
test('abort the operation on document drop', async t => {
|
||||
@ -113,9 +113,9 @@ test('abort the operation on document drop', async t => {
|
||||
datasource: stream.pipe(split(JSON.parse)),
|
||||
concurrency: 1,
|
||||
onDrop (doc) {
|
||||
t.strictEqual(doc.status, 400)
|
||||
t.strictEqual(doc.error.type, 'mapper_parsing_exception')
|
||||
t.strictEqual(doc.document.id, '45924372')
|
||||
t.equal(doc.status, 400)
|
||||
t.equal(doc.error.type, 'mapper_parsing_exception')
|
||||
t.equal(doc.document.id, '45924372')
|
||||
b.abort()
|
||||
},
|
||||
onDocument (doc) {
|
||||
@ -135,7 +135,7 @@ test('abort the operation on document drop', async t => {
|
||||
const result = await b
|
||||
t.type(result.time, 'number')
|
||||
t.type(result.bytes, 'number')
|
||||
t.strictEqual(result.total - 1, result.successful)
|
||||
t.equal(result.total - 1, result.successful)
|
||||
t.match(result, {
|
||||
retry: 0,
|
||||
failed: 1,
|
||||
|
||||
@ -62,7 +62,7 @@ test('Basic', t => {
|
||||
{ query: { match: { title: 'javascript' } } },
|
||||
(err, result) => {
|
||||
t.error(err)
|
||||
t.strictEqual(result.body.hits.total.value, 106)
|
||||
t.equal(result.body.hits.total.value, 106)
|
||||
}
|
||||
)
|
||||
|
||||
@ -71,7 +71,7 @@ test('Basic', t => {
|
||||
{ query: { match: { title: 'ruby' } } },
|
||||
(err, result) => {
|
||||
t.error(err)
|
||||
t.strictEqual(result.body.hits.total.value, 29)
|
||||
t.equal(result.body.hits.total.value, 29)
|
||||
}
|
||||
)
|
||||
|
||||
@ -87,7 +87,7 @@ test('Bad request', t => {
|
||||
{ query: { match: { title: 'javascript' } } },
|
||||
(err, result) => {
|
||||
t.error(err)
|
||||
t.strictEqual(result.body.hits.total.value, 106)
|
||||
t.equal(result.body.hits.total.value, 106)
|
||||
}
|
||||
)
|
||||
|
||||
@ -95,7 +95,7 @@ test('Bad request', t => {
|
||||
{ index: INDEX },
|
||||
{ query: { foo: { title: 'ruby' } } },
|
||||
(err, result) => {
|
||||
t.true(err instanceof errors.ResponseError)
|
||||
t.ok(err instanceof errors.ResponseError)
|
||||
}
|
||||
)
|
||||
|
||||
@ -112,7 +112,7 @@ test('Send multiple request concurrently over the concurrency limit', t => {
|
||||
{ query: { match: { title: 'javascript' } } },
|
||||
(err, result) => {
|
||||
t.error(err)
|
||||
t.strictEqual(result.body.hits.total.value, 106)
|
||||
t.equal(result.body.hits.total.value, 106)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@ -69,10 +69,10 @@ test('search helper', async t => {
|
||||
for await (const search of scrollSearch) {
|
||||
count += 1
|
||||
for (const doc of search.documents) {
|
||||
t.true(doc.title.toLowerCase().includes('javascript'))
|
||||
t.ok(doc.title.toLowerCase().includes('javascript'))
|
||||
}
|
||||
}
|
||||
t.strictEqual(count, 11)
|
||||
t.equal(count, 11)
|
||||
})
|
||||
|
||||
test('clear a scroll search', async t => {
|
||||
@ -94,7 +94,7 @@ test('clear a scroll search', async t => {
|
||||
search.clear()
|
||||
}
|
||||
}
|
||||
t.strictEqual(count, 2)
|
||||
t.equal(count, 2)
|
||||
})
|
||||
|
||||
test('scroll documents', async t => {
|
||||
@ -112,7 +112,7 @@ test('scroll documents', async t => {
|
||||
let count = 0
|
||||
for await (const doc of scrollSearch) {
|
||||
count += 1
|
||||
t.true(doc.title.toLowerCase().includes('javascript'))
|
||||
t.ok(doc.title.toLowerCase().includes('javascript'))
|
||||
}
|
||||
t.strictEqual(count, 106)
|
||||
t.equal(count, 106)
|
||||
})
|
||||
|
||||
@ -64,8 +64,8 @@ test('search helper', async t => {
|
||||
}
|
||||
}
|
||||
})
|
||||
t.strictEqual(results.length, 10)
|
||||
t.equal(results.length, 10)
|
||||
for (const result of results) {
|
||||
t.true(result.title.toLowerCase().includes('javascript'))
|
||||
t.ok(result.title.toLowerCase().includes('javascript'))
|
||||
}
|
||||
})
|
||||
|
||||
@ -24,20 +24,18 @@ process.on('unhandledRejection', function (err) {
|
||||
process.exit(1)
|
||||
})
|
||||
|
||||
const { writeFileSync, readFileSync, accessSync, mkdirSync, readdirSync, statSync } = require('fs')
|
||||
const { writeFileSync, readFileSync, readdirSync, statSync } = require('fs')
|
||||
const { join, sep } = require('path')
|
||||
const yaml = require('js-yaml')
|
||||
const Git = require('simple-git')
|
||||
const ms = require('ms')
|
||||
const { Client } = require('../../index')
|
||||
const build = require('./test-runner')
|
||||
const { sleep } = require('./helper')
|
||||
const createJunitReporter = require('./reporter')
|
||||
const downloadArtifacts = require('../../scripts/download-artifacts')
|
||||
|
||||
const esRepo = 'https://github.com/elastic/elasticsearch.git'
|
||||
const esFolder = join(__dirname, '..', '..', 'elasticsearch')
|
||||
const yamlFolder = join(esFolder, 'rest-api-spec', 'src', 'main', 'resources', 'rest-api-spec', 'test')
|
||||
const xPackYamlFolder = join(esFolder, 'x-pack', 'plugin', 'src', 'test', 'resources', 'rest-api-spec', 'test')
|
||||
const yamlFolder = downloadArtifacts.locations.freeTestFolder
|
||||
const xPackYamlFolder = downloadArtifacts.locations.xPackTestFolder
|
||||
|
||||
const MAX_API_TIME = 1000 * 90
|
||||
const MAX_FILE_TIME = 1000 * 30
|
||||
@ -83,6 +81,8 @@ const platinumBlackList = {
|
||||
],
|
||||
// The cleanup fails with a index not found when retrieving the jobs
|
||||
'ml/get_datafeed_stats.yml': ['Test get datafeed stats when total_search_time_ms mapping is missing'],
|
||||
'ml/bucket_correlation_agg.yml': ['Test correlation bucket agg simple'],
|
||||
'ml/preview_datafeed.yml': ['*'],
|
||||
// Investigate why is failing
|
||||
'ml/inference_crud.yml': ['*'],
|
||||
// investigate why this is failing
|
||||
@ -94,6 +94,7 @@ const platinumBlackList = {
|
||||
// the body is correct, but the regex is failing
|
||||
'sql/sql.yml': ['Getting textual representation'],
|
||||
'searchable_snapshots/10_usage.yml': ['*'],
|
||||
'service_accounts/10_basic.yml': ['*'],
|
||||
// we are setting two certificates in the docker config
|
||||
'ssl/10_basic.yml': ['*'],
|
||||
// very likely, the index template has not been loaded yet.
|
||||
@ -168,10 +169,10 @@ async function start ({ client, isXPack }) {
|
||||
await waitCluster(client)
|
||||
|
||||
const { body } = await client.info()
|
||||
const { number: version, build_hash: sha } = body.version
|
||||
const { number: version, build_hash: hash } = body.version
|
||||
|
||||
log(`Checking out sha ${sha}...`)
|
||||
await withSHA(sha)
|
||||
log(`Downloading artifacts for hash ${hash}...`)
|
||||
await downloadArtifacts({ hash, version })
|
||||
|
||||
log(`Testing ${isXPack ? 'Platinum' : 'Free'} api...`)
|
||||
const junit = createJunitReporter()
|
||||
@ -216,7 +217,7 @@ async function start ({ client, isXPack }) {
|
||||
const testRunner = build({
|
||||
client,
|
||||
version,
|
||||
isXPack: file.includes('x-pack')
|
||||
isXPack: file.includes('platinum')
|
||||
})
|
||||
const fileTime = now()
|
||||
const data = readFileSync(file, 'utf8')
|
||||
@ -324,102 +325,6 @@ function parse (data) {
|
||||
return doc
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the elasticsearch repository to the given sha.
|
||||
* If the repository is not present in `esFolder` it will
|
||||
* clone the repository and the checkout the sha.
|
||||
* If the repository is already present but it cannot checkout to
|
||||
* the given sha, it will perform a pull and then try again.
|
||||
* @param {string} sha
|
||||
* @param {function} callback
|
||||
*/
|
||||
function withSHA (sha) {
|
||||
return new Promise((resolve, reject) => {
|
||||
_withSHA(err => err ? reject(err) : resolve())
|
||||
})
|
||||
|
||||
function _withSHA (callback) {
|
||||
let fresh = false
|
||||
let retry = 0
|
||||
|
||||
if (!pathExist(esFolder)) {
|
||||
if (!createFolder(esFolder)) {
|
||||
return callback(new Error('Failed folder creation'))
|
||||
}
|
||||
fresh = true
|
||||
}
|
||||
|
||||
const git = Git(esFolder)
|
||||
|
||||
if (fresh) {
|
||||
clone(checkout)
|
||||
} else {
|
||||
checkout()
|
||||
}
|
||||
|
||||
function checkout () {
|
||||
log(`Checking out sha '${sha}'`)
|
||||
git.checkout(sha, err => {
|
||||
if (err) {
|
||||
if (retry++ > 0) {
|
||||
return callback(err)
|
||||
}
|
||||
return pull(checkout)
|
||||
}
|
||||
callback()
|
||||
})
|
||||
}
|
||||
|
||||
function pull (cb) {
|
||||
log('Pulling elasticsearch repository...')
|
||||
git.pull(err => {
|
||||
if (err) {
|
||||
return callback(err)
|
||||
}
|
||||
cb()
|
||||
})
|
||||
}
|
||||
|
||||
function clone (cb) {
|
||||
log('Cloning elasticsearch repository...')
|
||||
git.clone(esRepo, esFolder, err => {
|
||||
if (err) {
|
||||
return callback(err)
|
||||
}
|
||||
cb()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given path exists
|
||||
* @param {string} path
|
||||
* @returns {boolean} true if exists, false if not
|
||||
*/
|
||||
function pathExist (path) {
|
||||
try {
|
||||
accessSync(path)
|
||||
return true
|
||||
} catch (err) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the given folder
|
||||
* @param {string} name
|
||||
* @returns {boolean} true on success, false on failure
|
||||
*/
|
||||
function createFolder (name) {
|
||||
try {
|
||||
mkdirSync(name)
|
||||
return true
|
||||
} catch (err) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
function generateJunitXmlReport (junit, suite) {
|
||||
writeFileSync(
|
||||
join(__dirname, '..', '..', `${suite}-report-junit.xml`),
|
||||
|
||||
@ -25,6 +25,8 @@ const assert = require('assert')
|
||||
const semver = require('semver')
|
||||
const helper = require('./helper')
|
||||
const deepEqual = require('fast-deep-equal')
|
||||
const { join } = require('path')
|
||||
const { locations } = require('../../scripts/download-artifacts')
|
||||
const { ConfigurationError } = require('../../lib/errors')
|
||||
|
||||
const { delve, to, isXPackTemplate, sleep } = helper
|
||||
@ -362,6 +364,11 @@ function build (opts = {}) {
|
||||
if (!Array.isArray(options.ignore)) options.ignore = [options.ignore]
|
||||
if (cmd.params.ignore) delete cmd.params.ignore
|
||||
|
||||
// ndjson apis should always send the body as an array
|
||||
if (isNDJson(cmd.api) && !Array.isArray(cmd.params.body)) {
|
||||
cmd.params.body = [cmd.params.body]
|
||||
}
|
||||
|
||||
const [err, result] = await to(api(cmd.params, options))
|
||||
let warnings = result ? result.warnings : null
|
||||
const body = result ? result.body : null
|
||||
@ -587,7 +594,7 @@ function match (val1, val2, action) {
|
||||
// tap.match(val1, new RegExp(regStr, 'm'), `should match pattern provided: ${val2}, action: ${JSON.stringify(action)}`)
|
||||
// everything else
|
||||
} else {
|
||||
assert.strictEqual(val1, val2, `should be equal: ${val1} - ${val2}, action: ${JSON.stringify(action)}`)
|
||||
assert.equal(val1, val2, `should be equal: ${val1} - ${val2}, action: ${JSON.stringify(action)}`)
|
||||
}
|
||||
}
|
||||
|
||||
@ -647,9 +654,9 @@ function gte (val1, val2) {
|
||||
*/
|
||||
function length (val, len) {
|
||||
if (typeof val === 'string' || Array.isArray(val)) {
|
||||
assert.strictEqual(val.length, len)
|
||||
assert.equal(val.length, len)
|
||||
} else if (typeof val === 'object' && val !== null) {
|
||||
assert.strictEqual(Object.keys(val).length, len)
|
||||
assert.equal(Object.keys(val).length, len)
|
||||
} else {
|
||||
assert.fail(`length: the given value is invalid: ${val}`)
|
||||
}
|
||||
@ -696,6 +703,7 @@ function parseDo (action) {
|
||||
// converts underscore to camelCase
|
||||
// eg: put_mapping => putMapping
|
||||
acc.method = val.replace(/_([a-z])/g, g => g[1].toUpperCase())
|
||||
acc.api = val
|
||||
acc.params = camelify(action[val])
|
||||
}
|
||||
return acc
|
||||
@ -848,6 +856,12 @@ function shouldSkip (esVersion, action) {
|
||||
return false
|
||||
}
|
||||
|
||||
function isNDJson (api) {
|
||||
const spec = require(join(locations.specFolder, `${api}.json`))
|
||||
const { content_type } = spec[Object.keys(spec)[0]].headers
|
||||
return Boolean(content_type && content_type.includes('application/x-ndjson'))
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the array syntax of keys and values
|
||||
* eg: 'hits.hits.1.stuff' to 'hits.hits[1].stuff'
|
||||
|
||||
@ -557,22 +557,6 @@ expectError<errors.ConfigurationError>(
|
||||
)
|
||||
}
|
||||
|
||||
{
|
||||
class CustomSerializer {
|
||||
deserialize (str: string) {
|
||||
return JSON.parse(str)
|
||||
}
|
||||
}
|
||||
|
||||
expectError<errors.ConfigurationError>(
|
||||
// @ts-expect-error
|
||||
new Client({
|
||||
node: 'http://localhost:9200',
|
||||
Serializer: CustomSerializer
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* `Connection` option
|
||||
*/
|
||||
@ -685,14 +669,6 @@ expectType<Client>(
|
||||
})
|
||||
)
|
||||
|
||||
expectError<errors.ConfigurationError>(
|
||||
// @ts-expect-error
|
||||
new Client({
|
||||
node: 'http://localhost:9200',
|
||||
context: 'hello world'
|
||||
})
|
||||
)
|
||||
|
||||
/**
|
||||
* `proxy` option
|
||||
*/
|
||||
|
||||
@ -101,4 +101,4 @@ const response = {
|
||||
expectType<string>(err.name)
|
||||
expectType<string>(err.message)
|
||||
expectType<ApiResponse>(err.meta)
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,10 +18,11 @@
|
||||
*/
|
||||
|
||||
import { expectType, expectNotType, expectError } from 'tsd'
|
||||
import { Client, RequestEvent, ResurrectEvent, ApiError, ApiResponse } from '../../'
|
||||
import { Client, RequestEvent, ResurrectEvent, ApiError, ApiResponse, estypes } from '../../'
|
||||
import { KibanaClient } from '../../api/kibana'
|
||||
import { TransportRequestPromise, Context } from '../../lib/Transport'
|
||||
|
||||
// @ts-expect-error
|
||||
const client: KibanaClient = new Client({
|
||||
node: 'http://localhost:9200'
|
||||
})
|
||||
@ -50,50 +51,42 @@ client.on('resurrect', (err, meta) => {
|
||||
{
|
||||
const response = await client.cat.count({ index: 'test' })
|
||||
|
||||
expectType<Record<string, any>>(response.body)
|
||||
expectType<estypes.CatCountResponse>(response.body)
|
||||
expectType<Context>(response.meta.context)
|
||||
}
|
||||
|
||||
// Define only the response body
|
||||
// Define only the context
|
||||
{
|
||||
const response = await client.cat.count<string>({ index: 'test' })
|
||||
|
||||
expectType<string>(response.body)
|
||||
expectType<Context>(response.meta.context)
|
||||
}
|
||||
|
||||
// Define response body and the context
|
||||
{
|
||||
const response = await client.cat.count<string, string>({ index: 'test' })
|
||||
|
||||
expectType<string>(response.body)
|
||||
expectType<estypes.CatCountResponse>(response.body)
|
||||
expectType<string>(response.meta.context)
|
||||
}
|
||||
|
||||
// Check API returned type and optional parameters
|
||||
{
|
||||
const promise = client.info()
|
||||
expectType<TransportRequestPromise<ApiResponse>>(promise)
|
||||
expectType<TransportRequestPromise<ApiResponse<estypes.InfoResponse, Context>>>(promise)
|
||||
promise
|
||||
.then(result => expectType<ApiResponse>(result))
|
||||
.then(result => expectType<ApiResponse<estypes.InfoResponse, Context>>(result))
|
||||
.catch((err: ApiError) => expectType<ApiError>(err))
|
||||
expectType<void>(promise.abort())
|
||||
}
|
||||
|
||||
{
|
||||
const promise = client.info({ pretty: true })
|
||||
expectType<TransportRequestPromise<ApiResponse>>(promise)
|
||||
expectType<TransportRequestPromise<ApiResponse<estypes.InfoResponse, Context>>>(promise)
|
||||
promise
|
||||
.then(result => expectType<ApiResponse>(result))
|
||||
.then(result => expectType<ApiResponse<estypes.InfoResponse, Context>>(result))
|
||||
.catch((err: ApiError) => expectType<ApiError>(err))
|
||||
expectType<void>(promise.abort())
|
||||
}
|
||||
|
||||
{
|
||||
const promise = client.info({ pretty: true }, { ignore: [404] })
|
||||
expectType<TransportRequestPromise<ApiResponse>>(promise)
|
||||
expectType<TransportRequestPromise<ApiResponse<estypes.InfoResponse, Context>>>(promise)
|
||||
promise
|
||||
.then(result => expectType<ApiResponse>(result))
|
||||
.then(result => expectType<ApiResponse<estypes.InfoResponse, Context>>(result))
|
||||
.catch((err: ApiError) => expectType<ApiError>(err))
|
||||
expectType<void>(promise.abort())
|
||||
}
|
||||
@ -120,4 +113,4 @@ expectError(client.close(() => {}))
|
||||
// the child api should return a KibanaClient instance
|
||||
const child = client.child()
|
||||
expectType<KibanaClient>(child)
|
||||
expectNotType<Client>(child)
|
||||
expectNotType<Client>(child)
|
||||
108
test/types/new-types.test-d.ts
Normal file
108
test/types/new-types.test-d.ts
Normal file
@ -0,0 +1,108 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
import { expectType, expectNotType, expectError } from 'tsd'
|
||||
import { Client, RequestEvent, ResurrectEvent, ApiError, ApiResponse, estypes } from '../../'
|
||||
import type { Client as NewTypes } from '../../api/new'
|
||||
import { TransportRequestPromise, Context } from '../../lib/Transport'
|
||||
|
||||
// @ts-expect-error
|
||||
const client: NewTypes = new Client({
|
||||
node: 'http://localhost:9200'
|
||||
})
|
||||
|
||||
client.on('request', (err, meta) => {
|
||||
expectType<ApiError>(err)
|
||||
expectType<RequestEvent>(meta)
|
||||
})
|
||||
|
||||
client.on('response', (err, meta) => {
|
||||
expectType<ApiError>(err)
|
||||
expectType<RequestEvent>(meta)
|
||||
})
|
||||
|
||||
client.on('sniff', (err, meta) => {
|
||||
expectType<ApiError>(err)
|
||||
expectType<RequestEvent>(meta)
|
||||
})
|
||||
|
||||
client.on('resurrect', (err, meta) => {
|
||||
expectType<null>(err)
|
||||
expectType<ResurrectEvent>(meta)
|
||||
})
|
||||
|
||||
// No generics
|
||||
{
|
||||
const response = await client.cat.count({ index: 'test' })
|
||||
|
||||
expectType<estypes.CatCountResponse>(response.body)
|
||||
expectType<Context>(response.meta.context)
|
||||
}
|
||||
|
||||
// Define only the context
|
||||
{
|
||||
const response = await client.cat.count<string>({ index: 'test' })
|
||||
|
||||
expectType<estypes.CatCountResponse>(response.body)
|
||||
expectType<string>(response.meta.context)
|
||||
}
|
||||
|
||||
// Check API returned type and optional parameters
|
||||
{
|
||||
const promise = client.info()
|
||||
expectType<TransportRequestPromise<ApiResponse<estypes.InfoResponse, Context>>>(promise)
|
||||
promise
|
||||
.then(result => expectType<ApiResponse<estypes.InfoResponse, Context>>(result))
|
||||
.catch((err: ApiError) => expectType<ApiError>(err))
|
||||
expectType<void>(promise.abort())
|
||||
}
|
||||
|
||||
{
|
||||
const promise = client.info({ pretty: true })
|
||||
expectType<TransportRequestPromise<ApiResponse<estypes.InfoResponse, Context>>>(promise)
|
||||
promise
|
||||
.then(result => expectType<ApiResponse<estypes.InfoResponse, Context>>(result))
|
||||
.catch((err: ApiError) => expectType<ApiError>(err))
|
||||
expectType<void>(promise.abort())
|
||||
}
|
||||
|
||||
{
|
||||
const promise = client.info({ pretty: true }, { ignore: [404] })
|
||||
expectType<TransportRequestPromise<ApiResponse<estypes.InfoResponse, Context>>>(promise)
|
||||
promise
|
||||
.then(result => expectType<ApiResponse<estypes.InfoResponse, Context>>(result))
|
||||
.catch((err: ApiError) => expectType<ApiError>(err))
|
||||
expectType<void>(promise.abort())
|
||||
}
|
||||
|
||||
// body that does not respect the RequestBody constraint
|
||||
expectError(
|
||||
client.search({
|
||||
index: 'hello',
|
||||
body: 42
|
||||
}).then(console.log)
|
||||
)
|
||||
|
||||
// @ts-expect-error
|
||||
client.async_search.get()
|
||||
|
||||
// the child api should return a KibanaClient instance
|
||||
const child = client.child()
|
||||
expectType<NewTypes>(child)
|
||||
expectNotType<Client>(child)
|
||||
@ -42,7 +42,7 @@ function runAsyncTest (test) {
|
||||
type: 'doc',
|
||||
q: 'foo:bar'
|
||||
})
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
} catch (err) {
|
||||
t.fail(err)
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ test('Basic (callback)', t => {
|
||||
q: 'foo:bar'
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -66,7 +66,7 @@ test('Basic (promises)', t => {
|
||||
q: 'foo:bar'
|
||||
})
|
||||
.then(({ body }) => {
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
.catch(t.fail)
|
||||
@ -169,7 +169,7 @@ test('Abort method (callback)', t => {
|
||||
q: 'foo:bar'
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
|
||||
@ -197,7 +197,7 @@ test('Abort method (promises)', t => {
|
||||
|
||||
request
|
||||
.then(({ body }) => {
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
.catch(t.fail)
|
||||
@ -226,7 +226,7 @@ test('Basic (options and callback)', t => {
|
||||
requestTimeout: 10000
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -253,7 +253,7 @@ test('Basic (options and promises)', t => {
|
||||
requestTimeout: 10000
|
||||
})
|
||||
.then(({ body }) => {
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
.catch(t.fail)
|
||||
@ -264,7 +264,7 @@ test('If the API uses the same key for both url and query parameter, the url sho
|
||||
t.plan(2)
|
||||
|
||||
function handler (req, res) {
|
||||
t.strictEqual(req.url, '/index/_bulk')
|
||||
t.equal(req.url, '/index/_bulk')
|
||||
res.setHeader('Content-Type', 'application/json;utf=8')
|
||||
res.end(JSON.stringify({ hello: 'world' }))
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ test('API', t => {
|
||||
const href = 'http://localhost:9200/'
|
||||
pool.addConnection(href)
|
||||
t.ok(pool.connections.find(c => c.id === href) instanceof Connection)
|
||||
t.strictEqual(pool.connections.find(c => c.id === href).status, Connection.statuses.ALIVE)
|
||||
t.equal(pool.connections.find(c => c.id === href).status, Connection.statuses.ALIVE)
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -42,7 +42,7 @@ test('API', t => {
|
||||
pool.addConnection(href)
|
||||
t.fail('Should throw')
|
||||
} catch (err) {
|
||||
t.is(err.message, `Connection with id '${href}' is already present`)
|
||||
t.equal(err.message, `Connection with id '${href}' is already present`)
|
||||
}
|
||||
t.end()
|
||||
})
|
||||
@ -52,8 +52,8 @@ test('API', t => {
|
||||
const href = 'http://us"er:p@assword@localhost:9200/'
|
||||
pool.addConnection(href)
|
||||
const conn = pool.connections[0]
|
||||
t.strictEqual(conn.url.username, 'us%22er')
|
||||
t.strictEqual(conn.url.password, 'p%40assword')
|
||||
t.equal(conn.url.username, 'us%22er')
|
||||
t.equal(conn.url.password, 'p%40assword')
|
||||
t.match(conn.headers, {
|
||||
authorization: 'Basic ' + Buffer.from('us"er:p@assword').toString('base64')
|
||||
})
|
||||
@ -66,7 +66,7 @@ test('API', t => {
|
||||
let connection = pool.addConnection(href)
|
||||
t.same(pool.markDead(connection), pool)
|
||||
connection = pool.connections.find(c => c.id === href)
|
||||
t.strictEqual(connection.status, Connection.statuses.ALIVE)
|
||||
t.equal(connection.status, Connection.statuses.ALIVE)
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -76,7 +76,7 @@ test('API', t => {
|
||||
let connection = pool.addConnection(href)
|
||||
t.same(pool.markAlive(connection), pool)
|
||||
connection = pool.connections.find(c => c.id === href)
|
||||
t.strictEqual(connection.status, Connection.statuses.ALIVE)
|
||||
t.equal(connection.status, Connection.statuses.ALIVE)
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -88,7 +88,7 @@ test('API', t => {
|
||||
pool.getConnection()
|
||||
t.fail('Should fail')
|
||||
} catch (err) {
|
||||
t.is(err.message, 'getConnection must be implemented')
|
||||
t.equal(err.message, 'getConnection must be implemented')
|
||||
}
|
||||
t.end()
|
||||
})
|
||||
@ -98,7 +98,7 @@ test('API', t => {
|
||||
const href = 'http://localhost:9200/'
|
||||
const connection = pool.addConnection(href)
|
||||
pool.removeConnection(connection)
|
||||
t.strictEqual(pool.size, 0)
|
||||
t.equal(pool.size, 0)
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -107,7 +107,7 @@ test('API', t => {
|
||||
pool.addConnection('http://localhost:9200/')
|
||||
pool.addConnection('http://localhost:9201/')
|
||||
pool.empty(() => {
|
||||
t.strictEqual(pool.size, 0)
|
||||
t.equal(pool.size, 0)
|
||||
t.end()
|
||||
})
|
||||
})
|
||||
@ -115,7 +115,7 @@ test('API', t => {
|
||||
t.test('urlToHost', t => {
|
||||
const pool = new BaseConnectionPool({ Connection })
|
||||
const url = 'http://localhost:9200'
|
||||
t.deepEqual(
|
||||
t.same(
|
||||
pool.urlToHost(url),
|
||||
{ url: new URL(url) }
|
||||
)
|
||||
@ -140,7 +140,7 @@ test('API', t => {
|
||||
}
|
||||
}
|
||||
|
||||
t.deepEqual(pool.nodesToHost(nodes, 'http:'), [{
|
||||
t.same(pool.nodesToHost(nodes, 'http:'), [{
|
||||
url: new URL('http://127.0.0.1:9200'),
|
||||
id: 'a1',
|
||||
roles: {
|
||||
@ -160,8 +160,8 @@ test('API', t => {
|
||||
}
|
||||
}])
|
||||
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[0].url.host, '127.0.0.1:9200')
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.host, '127.0.0.1:9201')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[0].url.host, '127.0.0.1:9200')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[1].url.host, '127.0.0.1:9201')
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -182,7 +182,7 @@ test('API', t => {
|
||||
}
|
||||
}
|
||||
|
||||
t.deepEqual(pool.nodesToHost(nodes, 'http:'), [{
|
||||
t.same(pool.nodesToHost(nodes, 'http:'), [{
|
||||
url: new URL('http://[::1]:9200'),
|
||||
id: 'a1',
|
||||
roles: {
|
||||
@ -202,8 +202,8 @@ test('API', t => {
|
||||
}
|
||||
}])
|
||||
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[0].url.host, '[::1]:9200')
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.host, '[::1]:9201')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[0].url.host, '[::1]:9200')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[1].url.host, '[::1]:9201')
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -224,7 +224,7 @@ test('API', t => {
|
||||
}
|
||||
}
|
||||
|
||||
t.deepEqual(pool.nodesToHost(nodes, 'http:'), [{
|
||||
t.same(pool.nodesToHost(nodes, 'http:'), [{
|
||||
url: new URL('http://example.com:9200'),
|
||||
id: 'a1',
|
||||
roles: {
|
||||
@ -244,8 +244,8 @@ test('API', t => {
|
||||
}
|
||||
}])
|
||||
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[0].url.host, 'example.com:9200')
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.host, 'example.com:9201')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[0].url.host, 'example.com:9200')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[1].url.host, 'example.com:9201')
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -266,7 +266,7 @@ test('API', t => {
|
||||
}
|
||||
}
|
||||
|
||||
t.deepEqual(pool.nodesToHost(nodes, 'http:'), [{
|
||||
t.same(pool.nodesToHost(nodes, 'http:'), [{
|
||||
url: new URL('http://example.com:9200'),
|
||||
id: 'a1',
|
||||
roles: {
|
||||
@ -286,8 +286,8 @@ test('API', t => {
|
||||
}
|
||||
}])
|
||||
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[0].url.host, 'example.com:9200')
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.host, 'example.com:9201')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[0].url.host, 'example.com:9200')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[1].url.host, 'example.com:9201')
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -308,8 +308,8 @@ test('API', t => {
|
||||
}
|
||||
}
|
||||
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'https:')[0].url.protocol, 'https:')
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.protocol, 'http:')
|
||||
t.equal(pool.nodesToHost(nodes, 'https:')[0].url.protocol, 'https:')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[1].url.protocol, 'http:')
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -425,13 +425,13 @@ test('API', t => {
|
||||
|
||||
// roles will never be updated, we only use it to do
|
||||
// a dummy check to see if the connection has been updated
|
||||
t.deepEqual(pool.connections.find(c => c.id === 'a1').roles, {
|
||||
t.same(pool.connections.find(c => c.id === 'a1').roles, {
|
||||
master: true,
|
||||
data: true,
|
||||
ingest: true,
|
||||
ml: false
|
||||
})
|
||||
t.strictEqual(pool.connections.find(c => c.id === 'http://127.0.0.1:9200/'), undefined)
|
||||
t.equal(pool.connections.find(c => c.id === 'http://127.0.0.1:9200/'), undefined)
|
||||
})
|
||||
|
||||
t.test('Add a new connection', t => {
|
||||
@ -480,9 +480,9 @@ test('API', t => {
|
||||
roles: null
|
||||
}])
|
||||
|
||||
t.false(pool.connections.find(c => c.id === 'a1'))
|
||||
t.true(pool.connections.find(c => c.id === 'a2'))
|
||||
t.true(pool.connections.find(c => c.id === 'a3'))
|
||||
t.notOk(pool.connections.find(c => c.id === 'a1'))
|
||||
t.ok(pool.connections.find(c => c.id === 'a2'))
|
||||
t.ok(pool.connections.find(c => c.id === 'a3'))
|
||||
})
|
||||
|
||||
t.end()
|
||||
@ -497,7 +497,7 @@ test('API', t => {
|
||||
pool.createConnection('http://localhost:9200')
|
||||
t.fail('Should throw')
|
||||
} catch (err) {
|
||||
t.is(err.message, 'Connection with id \'http://localhost:9200/\' is already present')
|
||||
t.equal(err.message, 'Connection with id \'http://localhost:9200/\' is already present')
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@ -76,7 +76,7 @@ test('Should create a child client (timeout check)', t => {
|
||||
client.info((err, res) => {
|
||||
t.error(err)
|
||||
child.info((err, res) => {
|
||||
t.true(err instanceof errors.TimeoutError)
|
||||
t.ok(err instanceof errors.TimeoutError)
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -238,7 +238,7 @@ test('Should create a child client (generateRequestId check)', t => {
|
||||
let count = 0
|
||||
client.on('request', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
meta.request.id,
|
||||
count++ === 0 ? 'trace-1-0' : 'trace-2-0'
|
||||
)
|
||||
@ -263,13 +263,13 @@ test('Should create a child client (name check)', t => {
|
||||
name: 'child'
|
||||
})
|
||||
|
||||
t.strictEqual(client.name, 'parent')
|
||||
t.strictEqual(child.name, 'child')
|
||||
t.equal(client.name, 'parent')
|
||||
t.equal(child.name, 'child')
|
||||
|
||||
let count = 0
|
||||
client.on('request', (err, { meta }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
meta.name,
|
||||
count++ === 0 ? 'parent' : 'child'
|
||||
)
|
||||
|
||||
@ -111,7 +111,7 @@ test('Configure host', t => {
|
||||
resurrectTimeout: 0
|
||||
})
|
||||
|
||||
t.deepEqual(pool.connections.find(c => c.id === 'node').roles, {
|
||||
t.same(pool.connections.find(c => c.id === 'node').roles, {
|
||||
master: true,
|
||||
data: false,
|
||||
ingest: false,
|
||||
@ -152,7 +152,7 @@ test('Configure host', t => {
|
||||
resurrectTimeout: 0
|
||||
})
|
||||
|
||||
t.deepEqual(pool.connections.find(c => c.id === 'node1').roles, {
|
||||
t.same(pool.connections.find(c => c.id === 'node1').roles, {
|
||||
master: true,
|
||||
data: false,
|
||||
ingest: false,
|
||||
@ -167,7 +167,7 @@ test('Configure host', t => {
|
||||
resurrectTimeout: 0
|
||||
})
|
||||
|
||||
t.deepEqual(pool.connections.find(c => c.id === 'node2').roles, {
|
||||
t.same(pool.connections.find(c => c.id === 'node2').roles, {
|
||||
master: false,
|
||||
data: true,
|
||||
ingest: false,
|
||||
@ -226,7 +226,7 @@ test('Authentication', t => {
|
||||
|
||||
client.info((err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -250,7 +250,7 @@ test('Authentication', t => {
|
||||
|
||||
client.info((err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -278,7 +278,7 @@ test('Authentication', t => {
|
||||
|
||||
client.info((err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -307,12 +307,12 @@ test('Authentication', t => {
|
||||
}
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
first = false
|
||||
|
||||
client.info((err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -346,12 +346,12 @@ test('Authentication', t => {
|
||||
}
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
first = false
|
||||
|
||||
client.info((err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -383,7 +383,7 @@ test('Authentication', t => {
|
||||
|
||||
client.info((err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -410,7 +410,7 @@ test('Authentication', t => {
|
||||
|
||||
client.info((err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -439,12 +439,12 @@ test('Authentication', t => {
|
||||
}
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
first = false
|
||||
|
||||
client.info((err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -477,12 +477,12 @@ test('Authentication', t => {
|
||||
}
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
first = false
|
||||
|
||||
client.info((err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -510,7 +510,7 @@ test('Authentication', t => {
|
||||
|
||||
client.info((err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -539,7 +539,7 @@ test('Authentication', t => {
|
||||
|
||||
client.info((err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -575,7 +575,7 @@ test('Custom headers per request', t => {
|
||||
}
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -625,8 +625,8 @@ test('Extend client APIs', t => {
|
||||
const client = new Client({ node: 'http://localhost:9200' })
|
||||
client.extend('method', ({ makeRequest, result, ConfigurationError }) => {
|
||||
t.type(makeRequest, 'function')
|
||||
t.true(new ConfigurationError() instanceof Error)
|
||||
t.deepEqual(result, {
|
||||
t.ok(new ConfigurationError() instanceof Error)
|
||||
t.same(result, {
|
||||
body: null,
|
||||
statusCode: null,
|
||||
headers: null,
|
||||
@ -634,8 +634,8 @@ test('Extend client APIs', t => {
|
||||
})
|
||||
|
||||
return (params, options) => {
|
||||
t.deepEqual(params, { you_know: 'for search' })
|
||||
t.deepEqual(options, { winter: 'is coming' })
|
||||
t.same(params, { you_know: 'for search' })
|
||||
t.same(options, { winter: 'is coming' })
|
||||
}
|
||||
})
|
||||
|
||||
@ -651,8 +651,8 @@ test('Extend client APIs', t => {
|
||||
const client = new Client({ node: 'http://localhost:9200' })
|
||||
client.extend('namespace.method', ({ makeRequest, result, ConfigurationError }) => {
|
||||
t.type(makeRequest, 'function')
|
||||
t.true(new ConfigurationError() instanceof Error)
|
||||
t.deepEqual(result, {
|
||||
t.ok(new ConfigurationError() instanceof Error)
|
||||
t.same(result, {
|
||||
body: null,
|
||||
statusCode: null,
|
||||
headers: null,
|
||||
@ -660,8 +660,8 @@ test('Extend client APIs', t => {
|
||||
})
|
||||
|
||||
return (params, options) => {
|
||||
t.deepEqual(params, { you_know: 'for search' })
|
||||
t.deepEqual(options, { winter: 'is coming' })
|
||||
t.same(params, { you_know: 'for search' })
|
||||
t.same(options, { winter: 'is coming' })
|
||||
}
|
||||
})
|
||||
|
||||
@ -677,8 +677,8 @@ test('Extend client APIs', t => {
|
||||
const client = new Client({ node: 'http://localhost:9200' })
|
||||
client.extend('namespace.method1', ({ makeRequest, result, ConfigurationError }) => {
|
||||
t.type(makeRequest, 'function')
|
||||
t.true(new ConfigurationError() instanceof Error)
|
||||
t.deepEqual(result, {
|
||||
t.ok(new ConfigurationError() instanceof Error)
|
||||
t.same(result, {
|
||||
body: null,
|
||||
statusCode: null,
|
||||
headers: null,
|
||||
@ -686,15 +686,15 @@ test('Extend client APIs', t => {
|
||||
})
|
||||
|
||||
return (params, options) => {
|
||||
t.deepEqual(params, { you_know: 'for search' })
|
||||
t.deepEqual(options, { winter: 'is coming' })
|
||||
t.same(params, { you_know: 'for search' })
|
||||
t.same(options, { winter: 'is coming' })
|
||||
}
|
||||
})
|
||||
|
||||
client.extend('namespace.method2', ({ makeRequest, result, ConfigurationError }) => {
|
||||
t.type(makeRequest, 'function')
|
||||
t.true(new ConfigurationError() instanceof Error)
|
||||
t.deepEqual(result, {
|
||||
t.ok(new ConfigurationError() instanceof Error)
|
||||
t.same(result, {
|
||||
body: null,
|
||||
statusCode: null,
|
||||
headers: null,
|
||||
@ -702,8 +702,8 @@ test('Extend client APIs', t => {
|
||||
})
|
||||
|
||||
return (params, options) => {
|
||||
t.deepEqual(params, { you_know: 'for search' })
|
||||
t.deepEqual(options, { winter: 'is coming' })
|
||||
t.same(params, { you_know: 'for search' })
|
||||
t.same(options, { winter: 'is coming' })
|
||||
}
|
||||
})
|
||||
|
||||
@ -726,7 +726,7 @@ test('Extend client APIs', t => {
|
||||
client.extend('index', () => {})
|
||||
t.fail('Should throw')
|
||||
} catch (err) {
|
||||
t.is(err.message, 'The method "index" already exists')
|
||||
t.equal(err.message, 'The method "index" already exists')
|
||||
}
|
||||
})
|
||||
|
||||
@ -738,7 +738,7 @@ test('Extend client APIs', t => {
|
||||
client.extend('indices.delete', () => {})
|
||||
t.fail('Should throw')
|
||||
} catch (err) {
|
||||
t.is(err.message, 'The method "delete" already exists on namespace "indices"')
|
||||
t.equal(err.message, 'The method "delete" already exists on namespace "indices"')
|
||||
}
|
||||
})
|
||||
|
||||
@ -769,8 +769,8 @@ test('Extend client APIs', t => {
|
||||
|
||||
class MyTransport extends Transport {
|
||||
request (params, options) {
|
||||
t.deepEqual(params, { you_know: 'for search' })
|
||||
t.deepEqual(options, { winter: 'is coming' })
|
||||
t.same(params, { you_know: 'for search' })
|
||||
t.same(options, { winter: 'is coming' })
|
||||
}
|
||||
}
|
||||
|
||||
@ -803,7 +803,7 @@ test('Extend client APIs', t => {
|
||||
{ winter: 'is coming' },
|
||||
(err, res) => {
|
||||
t.error(err)
|
||||
t.deepEqual(res, { hello: 'world' })
|
||||
t.same(res, { hello: 'world' })
|
||||
}
|
||||
)
|
||||
})
|
||||
@ -825,7 +825,7 @@ test('Extend client APIs', t => {
|
||||
{ you_know: 'for search' },
|
||||
{ winter: 'is coming' }
|
||||
)
|
||||
.then(res => t.deepEqual(res, { hello: 'world' }))
|
||||
.then(res => t.same(res, { hello: 'world' }))
|
||||
.catch(err => t.fail(err))
|
||||
})
|
||||
|
||||
@ -863,9 +863,9 @@ test('Elastic cloud config', t => {
|
||||
}
|
||||
})
|
||||
|
||||
t.strictEqual(client.transport.compression, 'gzip')
|
||||
t.strictEqual(client.transport.suggestCompression, true)
|
||||
t.deepEqual(pool._ssl, { secureProtocol: 'TLSv1_2_method' })
|
||||
t.equal(client.transport.compression, 'gzip')
|
||||
t.equal(client.transport.suggestCompression, true)
|
||||
t.same(pool._ssl, { secureProtocol: 'TLSv1_2_method' })
|
||||
})
|
||||
|
||||
t.test('Without kibana component', t => {
|
||||
@ -898,9 +898,9 @@ test('Elastic cloud config', t => {
|
||||
}
|
||||
})
|
||||
|
||||
t.strictEqual(client.transport.compression, 'gzip')
|
||||
t.strictEqual(client.transport.suggestCompression, true)
|
||||
t.deepEqual(pool._ssl, { secureProtocol: 'TLSv1_2_method' })
|
||||
t.equal(client.transport.compression, 'gzip')
|
||||
t.equal(client.transport.suggestCompression, true)
|
||||
t.same(pool._ssl, { secureProtocol: 'TLSv1_2_method' })
|
||||
})
|
||||
|
||||
t.test('Auth as separate option', t => {
|
||||
@ -935,9 +935,9 @@ test('Elastic cloud config', t => {
|
||||
}
|
||||
})
|
||||
|
||||
t.strictEqual(client.transport.compression, 'gzip')
|
||||
t.strictEqual(client.transport.suggestCompression, true)
|
||||
t.deepEqual(pool._ssl, { secureProtocol: 'TLSv1_2_method' })
|
||||
t.equal(client.transport.compression, 'gzip')
|
||||
t.equal(client.transport.suggestCompression, true)
|
||||
t.same(pool._ssl, { secureProtocol: 'TLSv1_2_method' })
|
||||
})
|
||||
|
||||
t.test('ApiKey should take precedence over basic auth', t => {
|
||||
@ -973,9 +973,9 @@ test('Elastic cloud config', t => {
|
||||
}
|
||||
})
|
||||
|
||||
t.strictEqual(client.transport.compression, 'gzip')
|
||||
t.strictEqual(client.transport.suggestCompression, true)
|
||||
t.deepEqual(pool._ssl, { secureProtocol: 'TLSv1_2_method' })
|
||||
t.equal(client.transport.compression, 'gzip')
|
||||
t.equal(client.transport.suggestCompression, true)
|
||||
t.same(pool._ssl, { secureProtocol: 'TLSv1_2_method' })
|
||||
})
|
||||
|
||||
t.test('Override default options', t => {
|
||||
@ -995,9 +995,9 @@ test('Elastic cloud config', t => {
|
||||
})
|
||||
|
||||
t.ok(client.connectionPool instanceof CloudConnectionPool)
|
||||
t.strictEqual(client.transport.compression, false)
|
||||
t.strictEqual(client.transport.suggestCompression, false)
|
||||
t.deepEqual(client.connectionPool._ssl, { secureProtocol: 'TLSv1_1_method' })
|
||||
t.equal(client.transport.compression, false)
|
||||
t.equal(client.transport.suggestCompression, false)
|
||||
t.same(client.connectionPool._ssl, { secureProtocol: 'TLSv1_1_method' })
|
||||
})
|
||||
|
||||
t.end()
|
||||
@ -1008,7 +1008,7 @@ test('Opaque Id support', t => {
|
||||
t.plan(3)
|
||||
|
||||
function handler (req, res) {
|
||||
t.strictEqual(req.headers['x-opaque-id'], undefined)
|
||||
t.equal(req.headers['x-opaque-id'], undefined)
|
||||
res.setHeader('Content-Type', 'application/json;utf=8')
|
||||
res.end(JSON.stringify({ hello: 'world' }))
|
||||
}
|
||||
@ -1023,7 +1023,7 @@ test('Opaque Id support', t => {
|
||||
q: 'foo:bar'
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -1033,7 +1033,7 @@ test('Opaque Id support', t => {
|
||||
t.plan(3)
|
||||
|
||||
function handler (req, res) {
|
||||
t.strictEqual(req.headers['x-opaque-id'], 'bar')
|
||||
t.equal(req.headers['x-opaque-id'], 'bar')
|
||||
res.setHeader('Content-Type', 'application/json;utf=8')
|
||||
res.end(JSON.stringify({ hello: 'world' }))
|
||||
}
|
||||
@ -1050,7 +1050,7 @@ test('Opaque Id support', t => {
|
||||
opaqueId: 'bar'
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -1060,7 +1060,7 @@ test('Opaque Id support', t => {
|
||||
t.plan(3)
|
||||
|
||||
function handler (req, res) {
|
||||
t.strictEqual(req.headers['x-opaque-id'], 'foo-bar')
|
||||
t.equal(req.headers['x-opaque-id'], 'foo-bar')
|
||||
res.setHeader('Content-Type', 'application/json;utf=8')
|
||||
res.end(JSON.stringify({ hello: 'world' }))
|
||||
}
|
||||
@ -1078,7 +1078,7 @@ test('Opaque Id support', t => {
|
||||
opaqueId: 'bar'
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -1091,8 +1091,8 @@ test('Correctly handles the same header cased differently', t => {
|
||||
t.plan(4)
|
||||
|
||||
function handler (req, res) {
|
||||
t.strictEqual(req.headers.authorization, 'Basic foobar')
|
||||
t.strictEqual(req.headers.foo, 'baz')
|
||||
t.equal(req.headers.authorization, 'Basic foobar')
|
||||
t.equal(req.headers.foo, 'baz')
|
||||
res.setHeader('Content-Type', 'application/json;utf=8')
|
||||
res.end(JSON.stringify({ hello: 'world' }))
|
||||
}
|
||||
@ -1119,7 +1119,7 @@ test('Correctly handles the same header cased differently', t => {
|
||||
}
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -1144,7 +1144,7 @@ test('Random selector', t => {
|
||||
q: 'foo:bar'
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -1154,7 +1154,7 @@ test('Disable keep alive agent', t => {
|
||||
t.plan(3)
|
||||
|
||||
function handler (req, res) {
|
||||
t.strictEqual(req.headers.connection, 'close')
|
||||
t.equal(req.headers.connection, 'close')
|
||||
res.setHeader('Content-Type', 'application/json;utf=8')
|
||||
res.end(JSON.stringify({ hello: 'world' }))
|
||||
}
|
||||
@ -1170,7 +1170,7 @@ test('Disable keep alive agent', t => {
|
||||
q: 'foo:bar'
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -1184,7 +1184,7 @@ test('name property as string', t => {
|
||||
name: 'client-name'
|
||||
})
|
||||
|
||||
t.strictEqual(client.name, 'client-name')
|
||||
t.equal(client.name, 'client-name')
|
||||
})
|
||||
|
||||
test('name property as symbol', t => {
|
||||
@ -1196,7 +1196,7 @@ test('name property as symbol', t => {
|
||||
name: symbol
|
||||
})
|
||||
|
||||
t.strictEqual(client.name, symbol)
|
||||
t.equal(client.name, symbol)
|
||||
})
|
||||
|
||||
// The nodejs http agent will try to wait for the whole
|
||||
@ -1218,8 +1218,8 @@ test('Bad content length', t => {
|
||||
const client = new Client({ node: `http://localhost:${port}`, maxRetries: 1 })
|
||||
client.info((err, { body }) => {
|
||||
t.ok(err instanceof errors.ConnectionError)
|
||||
t.is(err.message, 'Response aborted while reading the body')
|
||||
t.strictEqual(count, 2)
|
||||
t.equal(err.message, 'Response aborted while reading the body')
|
||||
t.equal(count, 2)
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -1244,8 +1244,8 @@ test('Socket destryed while reading the body', t => {
|
||||
const client = new Client({ node: `http://localhost:${port}`, maxRetries: 1 })
|
||||
client.info((err, { body }) => {
|
||||
t.ok(err instanceof errors.ConnectionError)
|
||||
t.is(err.message, 'Response aborted while reading the body')
|
||||
t.strictEqual(count, 2)
|
||||
t.equal(err.message, 'Response aborted while reading the body')
|
||||
t.equal(count, 2)
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -1274,8 +1274,8 @@ test('Content length too big (buffer)', t => {
|
||||
const client = new Client({ node: 'http://localhost:9200', Connection: MockConnection })
|
||||
client.info((err, result) => {
|
||||
t.ok(err instanceof errors.RequestAbortedError)
|
||||
t.is(err.message, `The content length (${buffer.constants.MAX_LENGTH + 10}) is bigger than the maximum allowed buffer (${buffer.constants.MAX_LENGTH})`)
|
||||
t.strictEqual(result.meta.attempts, 0)
|
||||
t.equal(err.message, `The content length (${buffer.constants.MAX_LENGTH + 10}) is bigger than the maximum allowed buffer (${buffer.constants.MAX_LENGTH})`)
|
||||
t.equal(result.meta.attempts, 0)
|
||||
})
|
||||
})
|
||||
|
||||
@ -1301,8 +1301,8 @@ test('Content length too big (string)', t => {
|
||||
const client = new Client({ node: 'http://localhost:9200', Connection: MockConnection })
|
||||
client.info((err, result) => {
|
||||
t.ok(err instanceof errors.RequestAbortedError)
|
||||
t.is(err.message, `The content length (${buffer.constants.MAX_STRING_LENGTH + 10}) is bigger than the maximum allowed string (${buffer.constants.MAX_STRING_LENGTH})`)
|
||||
t.strictEqual(result.meta.attempts, 0)
|
||||
t.equal(err.message, `The content length (${buffer.constants.MAX_STRING_LENGTH + 10}) is bigger than the maximum allowed string (${buffer.constants.MAX_STRING_LENGTH})`)
|
||||
t.equal(result.meta.attempts, 0)
|
||||
})
|
||||
})
|
||||
|
||||
@ -1364,3 +1364,60 @@ test('Meta header disabled', t => {
|
||||
t.error(err)
|
||||
})
|
||||
})
|
||||
|
||||
test('Prototype poisoning protection enabled by default', t => {
|
||||
t.plan(1)
|
||||
|
||||
class MockConnection extends Connection {
|
||||
request (params, callback) {
|
||||
const stream = intoStream('{"__proto__":{"foo":"bar"}}')
|
||||
stream.statusCode = 200
|
||||
stream.headers = {
|
||||
'content-type': 'application/json;utf=8',
|
||||
'content-length': '27',
|
||||
connection: 'keep-alive',
|
||||
date: new Date().toISOString()
|
||||
}
|
||||
process.nextTick(callback, null, stream)
|
||||
return { abort () {} }
|
||||
}
|
||||
}
|
||||
|
||||
const client = new Client({
|
||||
node: 'http://localhost:9200',
|
||||
Connection: MockConnection
|
||||
})
|
||||
|
||||
client.info((err, result) => {
|
||||
t.ok(err instanceof errors.DeserializationError)
|
||||
})
|
||||
})
|
||||
|
||||
test('Disable prototype poisoning protection', t => {
|
||||
t.plan(1)
|
||||
|
||||
class MockConnection extends Connection {
|
||||
request (params, callback) {
|
||||
const stream = intoStream('{"__proto__":{"foo":"bar"}}')
|
||||
stream.statusCode = 200
|
||||
stream.headers = {
|
||||
'content-type': 'application/json;utf=8',
|
||||
'content-length': '27',
|
||||
connection: 'keep-alive',
|
||||
date: new Date().toISOString()
|
||||
}
|
||||
process.nextTick(callback, null, stream)
|
||||
return { abort () {} }
|
||||
}
|
||||
}
|
||||
|
||||
const client = new Client({
|
||||
node: 'http://localhost:9200',
|
||||
Connection: MockConnection,
|
||||
disablePrototypePoisoningProtection: true
|
||||
})
|
||||
|
||||
client.info((err, result) => {
|
||||
t.error(err)
|
||||
})
|
||||
})
|
||||
|
||||
@ -33,7 +33,7 @@ test('Should expose a cloudConnection property', t => {
|
||||
test('Get connection should always return cloudConnection', t => {
|
||||
const pool = new CloudConnectionPool({ Connection })
|
||||
const conn = pool.addConnection('http://localhost:9200/')
|
||||
t.deepEqual(pool.getConnection(), conn)
|
||||
t.same(pool.getConnection(), conn)
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -42,7 +42,7 @@ test('pool.empty should reset cloudConnection', t => {
|
||||
pool.addConnection('http://localhost:9200/')
|
||||
t.ok(pool.cloudConnection instanceof Connection)
|
||||
pool.empty(() => {
|
||||
t.strictEqual(pool.cloudConnection, null)
|
||||
t.equal(pool.cloudConnection, null)
|
||||
t.end()
|
||||
})
|
||||
})
|
||||
|
||||
@ -32,8 +32,8 @@ test('API', t => {
|
||||
const href = 'http://localhost:9200/'
|
||||
pool.addConnection(href)
|
||||
t.ok(pool.connections.find(c => c.id === href) instanceof Connection)
|
||||
t.strictEqual(pool.connections.find(c => c.id === href).status, Connection.statuses.ALIVE)
|
||||
t.deepEqual(pool.dead, [])
|
||||
t.equal(pool.connections.find(c => c.id === href).status, Connection.statuses.ALIVE)
|
||||
t.same(pool.dead, [])
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -45,7 +45,7 @@ test('API', t => {
|
||||
pool.addConnection(href)
|
||||
t.fail('Should throw')
|
||||
} catch (err) {
|
||||
t.is(err.message, `Connection with id '${href}' is already present`)
|
||||
t.equal(err.message, `Connection with id '${href}' is already present`)
|
||||
}
|
||||
t.end()
|
||||
})
|
||||
@ -55,8 +55,8 @@ test('API', t => {
|
||||
const href = 'http://us"er:p@assword@localhost:9200/'
|
||||
pool.addConnection(href)
|
||||
const conn = pool.getConnection()
|
||||
t.strictEqual(conn.url.username, 'us%22er')
|
||||
t.strictEqual(conn.url.password, 'p%40assword')
|
||||
t.equal(conn.url.username, 'us%22er')
|
||||
t.equal(conn.url.password, 'p%40assword')
|
||||
t.match(conn.headers, {
|
||||
authorization: 'Basic ' + Buffer.from('us"er:p@assword').toString('base64')
|
||||
})
|
||||
@ -69,9 +69,9 @@ test('API', t => {
|
||||
let connection = pool.addConnection(href)
|
||||
pool.markDead(connection)
|
||||
connection = pool.connections.find(c => c.id === href)
|
||||
t.strictEqual(connection.deadCount, 1)
|
||||
t.true(connection.resurrectTimeout > 0)
|
||||
t.deepEqual(pool.dead, [href])
|
||||
t.equal(connection.deadCount, 1)
|
||||
t.ok(connection.resurrectTimeout > 0)
|
||||
t.same(pool.dead, [href])
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -84,7 +84,7 @@ test('API', t => {
|
||||
pool.markDead(conn2)
|
||||
setTimeout(() => {
|
||||
pool.markDead(conn1)
|
||||
t.deepEqual(pool.dead, [href2, href1])
|
||||
t.same(pool.dead, [href2, href1])
|
||||
t.end()
|
||||
}, 10)
|
||||
})
|
||||
@ -93,7 +93,7 @@ test('API', t => {
|
||||
const pool = new ConnectionPool({ Connection, sniffEnabled: true })
|
||||
pool.addConnection('http://localhost:9200/')
|
||||
pool.markDead({ id: 'foo-bar' })
|
||||
t.deepEqual(pool.dead, [])
|
||||
t.same(pool.dead, [])
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -104,10 +104,10 @@ test('API', t => {
|
||||
pool.markDead(connection)
|
||||
pool.markAlive(connection)
|
||||
connection = pool.connections.find(c => c.id === href)
|
||||
t.strictEqual(connection.deadCount, 0)
|
||||
t.strictEqual(connection.resurrectTimeout, 0)
|
||||
t.strictEqual(connection.status, Connection.statuses.ALIVE)
|
||||
t.deepEqual(pool.dead, [])
|
||||
t.equal(connection.deadCount, 0)
|
||||
t.equal(connection.resurrectTimeout, 0)
|
||||
t.equal(connection.status, Connection.statuses.ALIVE)
|
||||
t.same(pool.dead, [])
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -129,12 +129,12 @@ test('API', t => {
|
||||
name: 'elasticsearch-js'
|
||||
}
|
||||
pool.resurrect(opts, (isAlive, connection) => {
|
||||
t.true(isAlive)
|
||||
t.ok(isAlive)
|
||||
connection = pool.connections.find(c => c.id === connection.id)
|
||||
t.strictEqual(connection.deadCount, 0)
|
||||
t.strictEqual(connection.resurrectTimeout, 0)
|
||||
t.strictEqual(connection.status, Connection.statuses.ALIVE)
|
||||
t.deepEqual(pool.dead, [])
|
||||
t.equal(connection.deadCount, 0)
|
||||
t.equal(connection.resurrectTimeout, 0)
|
||||
t.equal(connection.status, Connection.statuses.ALIVE)
|
||||
t.same(pool.dead, [])
|
||||
t.end()
|
||||
})
|
||||
})
|
||||
@ -155,12 +155,12 @@ test('API', t => {
|
||||
name: 'elasticsearch-js'
|
||||
}
|
||||
pool.resurrect(opts, (isAlive, connection) => {
|
||||
t.false(isAlive)
|
||||
t.notOk(isAlive)
|
||||
connection = pool.connections.find(c => c.id === connection.id)
|
||||
t.strictEqual(connection.deadCount, 2)
|
||||
t.true(connection.resurrectTimeout > 0)
|
||||
t.strictEqual(connection.status, Connection.statuses.DEAD)
|
||||
t.deepEqual(pool.dead, [href])
|
||||
t.equal(connection.deadCount, 2)
|
||||
t.ok(connection.resurrectTimeout > 0)
|
||||
t.equal(connection.status, Connection.statuses.DEAD)
|
||||
t.same(pool.dead, [href])
|
||||
t.end()
|
||||
})
|
||||
})
|
||||
@ -183,12 +183,12 @@ test('API', t => {
|
||||
name: 'elasticsearch-js'
|
||||
}
|
||||
pool.resurrect(opts, (isAlive, connection) => {
|
||||
t.true(isAlive)
|
||||
t.ok(isAlive)
|
||||
connection = pool.connections.find(c => c.id === connection.id)
|
||||
t.strictEqual(connection.deadCount, 1)
|
||||
t.true(connection.resurrectTimeout > 0)
|
||||
t.strictEqual(connection.status, Connection.statuses.ALIVE)
|
||||
t.deepEqual(pool.dead, [])
|
||||
t.equal(connection.deadCount, 1)
|
||||
t.ok(connection.resurrectTimeout > 0)
|
||||
t.equal(connection.status, Connection.statuses.ALIVE)
|
||||
t.same(pool.dead, [])
|
||||
t.end()
|
||||
})
|
||||
})
|
||||
@ -211,10 +211,10 @@ test('API', t => {
|
||||
t.ok(isAlive === null)
|
||||
t.ok(connection === null)
|
||||
connection = pool.connections.find(c => c.id === href)
|
||||
t.strictEqual(connection.deadCount, 1)
|
||||
t.true(connection.resurrectTimeout > 0)
|
||||
t.strictEqual(connection.status, Connection.statuses.DEAD)
|
||||
t.deepEqual(pool.dead, [href])
|
||||
t.equal(connection.deadCount, 1)
|
||||
t.ok(connection.resurrectTimeout > 0)
|
||||
t.equal(connection.status, Connection.statuses.DEAD)
|
||||
t.same(pool.dead, [href])
|
||||
t.end()
|
||||
})
|
||||
})
|
||||
@ -238,7 +238,7 @@ test('API', t => {
|
||||
pool.addConnection([href1, href2])
|
||||
|
||||
const filter = node => node.id === href1
|
||||
t.strictEqual(pool.getConnection({ filter }).id, href1)
|
||||
t.equal(pool.getConnection({ filter }).id, href1)
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -266,7 +266,7 @@ test('API', t => {
|
||||
pool.markDead(conn)
|
||||
|
||||
const filter = node => {
|
||||
t.strictEqual(node.status, Connection.statuses.ALIVE)
|
||||
t.equal(node.status, Connection.statuses.ALIVE)
|
||||
return true
|
||||
}
|
||||
pool.getConnection({ filter })
|
||||
@ -282,7 +282,7 @@ test('API', t => {
|
||||
pool.markDead(conn2)
|
||||
const conn = pool.getConnection()
|
||||
t.ok(conn instanceof Connection)
|
||||
t.is(conn.status, 'dead')
|
||||
t.equal(conn.status, 'dead')
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -295,7 +295,7 @@ test('API', t => {
|
||||
const connection = pool.addConnection(href)
|
||||
t.ok(pool.getConnection() instanceof Connection)
|
||||
pool.removeConnection(connection)
|
||||
t.strictEqual(pool.getConnection(), null)
|
||||
t.equal(pool.getConnection(), null)
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -304,8 +304,8 @@ test('API', t => {
|
||||
pool.addConnection('http://localhost:9200/')
|
||||
pool.addConnection('http://localhost:9201/')
|
||||
pool.empty(() => {
|
||||
t.strictEqual(pool.size, 0)
|
||||
t.deepEqual(pool.dead, [])
|
||||
t.equal(pool.size, 0)
|
||||
t.same(pool.dead, [])
|
||||
t.end()
|
||||
})
|
||||
})
|
||||
@ -313,7 +313,7 @@ test('API', t => {
|
||||
t.test('urlToHost', t => {
|
||||
const pool = new ConnectionPool({ Connection })
|
||||
const url = 'http://localhost:9200'
|
||||
t.deepEqual(
|
||||
t.same(
|
||||
pool.urlToHost(url),
|
||||
{ url: new URL(url) }
|
||||
)
|
||||
@ -338,7 +338,7 @@ test('API', t => {
|
||||
}
|
||||
}
|
||||
|
||||
t.deepEqual(pool.nodesToHost(nodes, 'http:'), [{
|
||||
t.same(pool.nodesToHost(nodes, 'http:'), [{
|
||||
url: new URL('http://127.0.0.1:9200'),
|
||||
id: 'a1',
|
||||
roles: {
|
||||
@ -358,8 +358,8 @@ test('API', t => {
|
||||
}
|
||||
}])
|
||||
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[0].url.host, '127.0.0.1:9200')
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.host, '127.0.0.1:9201')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[0].url.host, '127.0.0.1:9200')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[1].url.host, '127.0.0.1:9201')
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -380,7 +380,7 @@ test('API', t => {
|
||||
}
|
||||
}
|
||||
|
||||
t.deepEqual(pool.nodesToHost(nodes, 'http:'), [{
|
||||
t.same(pool.nodesToHost(nodes, 'http:'), [{
|
||||
url: new URL('http://[::1]:9200'),
|
||||
id: 'a1',
|
||||
roles: {
|
||||
@ -400,8 +400,8 @@ test('API', t => {
|
||||
}
|
||||
}])
|
||||
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[0].url.host, '[::1]:9200')
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.host, '[::1]:9201')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[0].url.host, '[::1]:9200')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[1].url.host, '[::1]:9201')
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -422,7 +422,7 @@ test('API', t => {
|
||||
}
|
||||
}
|
||||
|
||||
t.deepEqual(pool.nodesToHost(nodes, 'http:'), [{
|
||||
t.same(pool.nodesToHost(nodes, 'http:'), [{
|
||||
url: new URL('http://example.com:9200'),
|
||||
id: 'a1',
|
||||
roles: {
|
||||
@ -442,8 +442,8 @@ test('API', t => {
|
||||
}
|
||||
}])
|
||||
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[0].url.host, 'example.com:9200')
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.host, 'example.com:9201')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[0].url.host, 'example.com:9200')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[1].url.host, 'example.com:9201')
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -464,7 +464,7 @@ test('API', t => {
|
||||
}
|
||||
}
|
||||
|
||||
t.deepEqual(pool.nodesToHost(nodes, 'http:'), [{
|
||||
t.same(pool.nodesToHost(nodes, 'http:'), [{
|
||||
url: new URL('http://example.com:9200'),
|
||||
id: 'a1',
|
||||
roles: {
|
||||
@ -484,8 +484,8 @@ test('API', t => {
|
||||
}
|
||||
}])
|
||||
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[0].url.host, 'example.com:9200')
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.host, 'example.com:9201')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[0].url.host, 'example.com:9200')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[1].url.host, 'example.com:9201')
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -506,8 +506,8 @@ test('API', t => {
|
||||
}
|
||||
}
|
||||
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'https:')[0].url.protocol, 'https:')
|
||||
t.strictEqual(pool.nodesToHost(nodes, 'http:')[1].url.protocol, 'http:')
|
||||
t.equal(pool.nodesToHost(nodes, 'https:')[0].url.protocol, 'https:')
|
||||
t.equal(pool.nodesToHost(nodes, 'http:')[1].url.protocol, 'http:')
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -662,13 +662,13 @@ test('API', t => {
|
||||
|
||||
// roles will never be updated, we only use it to do
|
||||
// a dummy check to see if the connection has been updated
|
||||
t.deepEqual(pool.connections.find(c => c.id === 'a1').roles, {
|
||||
t.same(pool.connections.find(c => c.id === 'a1').roles, {
|
||||
master: true,
|
||||
data: true,
|
||||
ingest: true,
|
||||
ml: false
|
||||
})
|
||||
t.strictEqual(pool.connections.find(c => c.id === 'http://127.0.0.1:9200/'), undefined)
|
||||
t.equal(pool.connections.find(c => c.id === 'http://127.0.0.1:9200/'), undefined)
|
||||
})
|
||||
|
||||
t.test('Add a new connection', t => {
|
||||
@ -717,9 +717,9 @@ test('API', t => {
|
||||
roles: null
|
||||
}])
|
||||
|
||||
t.false(pool.connections.find(c => c.id === 'a1'))
|
||||
t.true(pool.connections.find(c => c.id === 'a2'))
|
||||
t.true(pool.connections.find(c => c.id === 'a3'))
|
||||
t.notOk(pool.connections.find(c => c.id === 'a1'))
|
||||
t.ok(pool.connections.find(c => c.id === 'a2'))
|
||||
t.ok(pool.connections.find(c => c.id === 'a3'))
|
||||
})
|
||||
|
||||
t.test('Remove old connections (markDead)', t => {
|
||||
@ -732,7 +732,7 @@ test('API', t => {
|
||||
})
|
||||
|
||||
pool.markDead(conn)
|
||||
t.deepEqual(pool.dead, ['a1'])
|
||||
t.same(pool.dead, ['a1'])
|
||||
|
||||
pool.update([{
|
||||
url: new URL('http://127.0.0.1:9200'),
|
||||
@ -744,10 +744,10 @@ test('API', t => {
|
||||
roles: null
|
||||
}])
|
||||
|
||||
t.deepEqual(pool.dead, [])
|
||||
t.false(pool.connections.find(c => c.id === 'a1'))
|
||||
t.true(pool.connections.find(c => c.id === 'a2'))
|
||||
t.true(pool.connections.find(c => c.id === 'a3'))
|
||||
t.same(pool.dead, [])
|
||||
t.notOk(pool.connections.find(c => c.id === 'a1'))
|
||||
t.ok(pool.connections.find(c => c.id === 'a2'))
|
||||
t.ok(pool.connections.find(c => c.id === 'a3'))
|
||||
})
|
||||
|
||||
t.end()
|
||||
@ -761,14 +761,14 @@ test('Node selector', t => {
|
||||
t.plan(1)
|
||||
const pool = new ConnectionPool({ Connection })
|
||||
pool.addConnection('http://localhost:9200/')
|
||||
t.true(pool.getConnection({ selector: roundRobinSelector() }) instanceof Connection)
|
||||
t.ok(pool.getConnection({ selector: roundRobinSelector() }) instanceof Connection)
|
||||
})
|
||||
|
||||
t.test('random', t => {
|
||||
t.plan(1)
|
||||
const pool = new ConnectionPool({ Connection })
|
||||
pool.addConnection('http://localhost:9200/')
|
||||
t.true(pool.getConnection({ selector: roundRobinSelector() }) instanceof Connection)
|
||||
t.ok(pool.getConnection({ selector: roundRobinSelector() }) instanceof Connection)
|
||||
})
|
||||
|
||||
t.end()
|
||||
@ -779,7 +779,7 @@ test('Node filter', t => {
|
||||
t.plan(1)
|
||||
const pool = new ConnectionPool({ Connection })
|
||||
pool.addConnection({ url: new URL('http://localhost:9200/') })
|
||||
t.true(pool.getConnection({ filter: defaultNodeFilter }) instanceof Connection)
|
||||
t.ok(pool.getConnection({ filter: defaultNodeFilter }) instanceof Connection)
|
||||
})
|
||||
|
||||
t.test('Should filter master only nodes', t => {
|
||||
@ -794,7 +794,7 @@ test('Node filter', t => {
|
||||
ml: false
|
||||
}
|
||||
})
|
||||
t.strictEqual(pool.getConnection({ filter: defaultNodeFilter }), null)
|
||||
t.equal(pool.getConnection({ filter: defaultNodeFilter }), null)
|
||||
})
|
||||
|
||||
t.end()
|
||||
|
||||
@ -63,7 +63,7 @@ test('Basic (http)', t => {
|
||||
res.on('data', chunk => { payload += chunk })
|
||||
res.on('error', err => t.fail(err))
|
||||
res.on('end', () => {
|
||||
t.strictEqual(payload, 'ok')
|
||||
t.equal(payload, 'ok')
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -103,7 +103,7 @@ test('Basic (https)', t => {
|
||||
res.on('data', chunk => { payload += chunk })
|
||||
res.on('error', err => t.fail(err))
|
||||
res.on('end', () => {
|
||||
t.strictEqual(payload, 'ok')
|
||||
t.equal(payload, 'ok')
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -144,7 +144,7 @@ test('Basic (https with ssl agent)', t => {
|
||||
res.on('data', chunk => { payload += chunk })
|
||||
res.on('error', err => t.fail(err))
|
||||
res.on('end', () => {
|
||||
t.strictEqual(payload, 'ok')
|
||||
t.equal(payload, 'ok')
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -179,7 +179,7 @@ test('Custom http agent', t => {
|
||||
return agent
|
||||
}
|
||||
})
|
||||
t.true(connection.agent.custom)
|
||||
t.ok(connection.agent.custom)
|
||||
connection.request({
|
||||
path: '/hello',
|
||||
method: 'GET',
|
||||
@ -198,7 +198,7 @@ test('Custom http agent', t => {
|
||||
res.on('data', chunk => { payload += chunk })
|
||||
res.on('error', err => t.fail(err))
|
||||
res.on('end', () => {
|
||||
t.strictEqual(payload, 'ok')
|
||||
t.equal(payload, 'ok')
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -268,7 +268,7 @@ test('querystring', t => {
|
||||
t.plan(2)
|
||||
|
||||
function handler (req, res) {
|
||||
t.strictEqual(req.url, '/hello?hello=world&you_know=for%20search')
|
||||
t.equal(req.url, '/hello?hello=world&you_know=for%20search')
|
||||
res.end('ok')
|
||||
}
|
||||
|
||||
@ -291,7 +291,7 @@ test('querystring', t => {
|
||||
t.plan(2)
|
||||
|
||||
function handler (req, res) {
|
||||
t.strictEqual(req.url, '/hello')
|
||||
t.equal(req.url, '/hello')
|
||||
res.end('ok')
|
||||
}
|
||||
|
||||
@ -322,7 +322,7 @@ test('Body request', t => {
|
||||
req.on('data', chunk => { payload += chunk })
|
||||
req.on('error', err => t.fail(err))
|
||||
req.on('end', () => {
|
||||
t.strictEqual(payload, 'hello')
|
||||
t.equal(payload, 'hello')
|
||||
res.end('ok')
|
||||
})
|
||||
}
|
||||
@ -351,7 +351,7 @@ test('Send body as buffer', t => {
|
||||
req.on('data', chunk => { payload += chunk })
|
||||
req.on('error', err => t.fail(err))
|
||||
req.on('end', () => {
|
||||
t.strictEqual(payload, 'hello')
|
||||
t.equal(payload, 'hello')
|
||||
res.end('ok')
|
||||
})
|
||||
}
|
||||
@ -380,7 +380,7 @@ test('Send body as stream', t => {
|
||||
req.on('data', chunk => { payload += chunk })
|
||||
req.on('error', err => t.fail(err))
|
||||
req.on('end', () => {
|
||||
t.strictEqual(payload, 'hello')
|
||||
t.equal(payload, 'hello')
|
||||
res.end('ok')
|
||||
})
|
||||
}
|
||||
@ -413,7 +413,7 @@ test('Should not close a connection if there are open requests', t => {
|
||||
})
|
||||
|
||||
setTimeout(() => {
|
||||
t.strictEqual(connection._openRequests, 1)
|
||||
t.equal(connection._openRequests, 1)
|
||||
connection.close()
|
||||
}, 500)
|
||||
|
||||
@ -422,14 +422,14 @@ test('Should not close a connection if there are open requests', t => {
|
||||
method: 'GET'
|
||||
}, (err, res) => {
|
||||
t.error(err)
|
||||
t.strictEqual(connection._openRequests, 0)
|
||||
t.equal(connection._openRequests, 0)
|
||||
|
||||
let payload = ''
|
||||
res.setEncoding('utf8')
|
||||
res.on('data', chunk => { payload += chunk })
|
||||
res.on('error', err => t.fail(err))
|
||||
res.on('end', () => {
|
||||
t.strictEqual(payload, 'ok')
|
||||
t.equal(payload, 'ok')
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -450,7 +450,7 @@ test('Should not close a connection if there are open requests (with agent disab
|
||||
})
|
||||
|
||||
setTimeout(() => {
|
||||
t.strictEqual(connection._openRequests, 1)
|
||||
t.equal(connection._openRequests, 1)
|
||||
connection.close()
|
||||
}, 500)
|
||||
|
||||
@ -459,14 +459,14 @@ test('Should not close a connection if there are open requests (with agent disab
|
||||
method: 'GET'
|
||||
}, (err, res) => {
|
||||
t.error(err)
|
||||
t.strictEqual(connection._openRequests, 0)
|
||||
t.equal(connection._openRequests, 0)
|
||||
|
||||
let payload = ''
|
||||
res.setEncoding('utf8')
|
||||
res.on('data', chunk => { payload += chunk })
|
||||
res.on('error', err => t.fail(err))
|
||||
res.on('end', () => {
|
||||
t.strictEqual(payload, 'ok')
|
||||
t.equal(payload, 'ok')
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -502,7 +502,7 @@ test('Url with querystring', t => {
|
||||
t.plan(2)
|
||||
|
||||
function handler (req, res) {
|
||||
t.strictEqual(req.url, '/hello?foo=bar&baz=faz')
|
||||
t.equal(req.url, '/hello?foo=bar&baz=faz')
|
||||
res.end('ok')
|
||||
}
|
||||
|
||||
@ -546,7 +546,7 @@ test('Custom headers for connection', t => {
|
||||
}, (err, res) => {
|
||||
t.error(err)
|
||||
// should not update the default
|
||||
t.deepEqual(connection.headers, { 'x-foo': 'bar' })
|
||||
t.same(connection.headers, { 'x-foo': 'bar' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -576,7 +576,7 @@ test('asStream set to true', t => {
|
||||
res.on('data', chunk => { payload += chunk })
|
||||
res.on('error', err => t.fail(err))
|
||||
res.on('end', () => {
|
||||
t.strictEqual(payload, 'ok')
|
||||
t.equal(payload, 'ok')
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -587,7 +587,7 @@ test('Connection id should not contain credentials', t => {
|
||||
const connection = new Connection({
|
||||
url: new URL('http://user:password@localhost:9200')
|
||||
})
|
||||
t.strictEqual(connection.id, 'http://localhost:9200/')
|
||||
t.equal(connection.id, 'http://localhost:9200/')
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -595,7 +595,7 @@ test('Ipv6 support', t => {
|
||||
const connection = new Connection({
|
||||
url: new URL('http://[::1]:9200')
|
||||
})
|
||||
t.strictEqual(connection.buildRequestObject({}).hostname, '::1')
|
||||
t.equal(connection.buildRequestObject({}).hostname, '::1')
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -607,7 +607,7 @@ test('Should throw if the protocol is not http or https', t => {
|
||||
t.fail('Should throw')
|
||||
} catch (err) {
|
||||
t.ok(err instanceof ConfigurationError)
|
||||
t.is(err.message, 'Invalid protocol: \'nope:\'')
|
||||
t.equal(err.message, 'Invalid protocol: \'nope:\'')
|
||||
}
|
||||
t.end()
|
||||
})
|
||||
@ -623,7 +623,7 @@ test('Should disallow two-byte characters in URL path', t => {
|
||||
path: '/thisisinvalid\uffe2',
|
||||
method: 'GET'
|
||||
}, (err, res) => {
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
err.message,
|
||||
'ERR_UNESCAPED_CHARACTERS: /thisisinvalid\uffe2'
|
||||
)
|
||||
@ -638,7 +638,7 @@ test('setRole', t => {
|
||||
url: new URL('http://localhost:9200')
|
||||
})
|
||||
|
||||
t.deepEqual(connection.roles, {
|
||||
t.same(connection.roles, {
|
||||
master: true,
|
||||
data: true,
|
||||
ingest: true,
|
||||
@ -647,7 +647,7 @@ test('setRole', t => {
|
||||
|
||||
connection.setRole('master', false)
|
||||
|
||||
t.deepEqual(connection.roles, {
|
||||
t.same(connection.roles, {
|
||||
master: false,
|
||||
data: true,
|
||||
ingest: true,
|
||||
@ -666,8 +666,8 @@ test('setRole', t => {
|
||||
connection.setRole('car', true)
|
||||
t.fail('Shoud throw')
|
||||
} catch (err) {
|
||||
t.true(err instanceof ConfigurationError)
|
||||
t.is(err.message, 'Unsupported role: \'car\'')
|
||||
t.ok(err instanceof ConfigurationError)
|
||||
t.equal(err.message, 'Unsupported role: \'car\'')
|
||||
}
|
||||
})
|
||||
|
||||
@ -682,8 +682,8 @@ test('setRole', t => {
|
||||
connection.setRole('master', 1)
|
||||
t.fail('Shoud throw')
|
||||
} catch (err) {
|
||||
t.true(err instanceof ConfigurationError)
|
||||
t.is(err.message, 'enabled should be a boolean')
|
||||
t.ok(err instanceof ConfigurationError)
|
||||
t.equal(err.message, 'enabled should be a boolean')
|
||||
}
|
||||
})
|
||||
|
||||
@ -708,7 +708,7 @@ test('Util.inspect Connection class should hide agent, ssl and auth', t => {
|
||||
.replace(/(\r\n|\n|\r)/gm, '')
|
||||
}
|
||||
|
||||
t.strictEqual(cleanStr(inspect(connection)), cleanStr(`{ url: 'http://localhost:9200/',
|
||||
t.equal(cleanStr(inspect(connection)), cleanStr(`{ url: 'http://localhost:9200/',
|
||||
id: 'node-id',
|
||||
headers: { foo: 'bar' },
|
||||
deadCount: 0,
|
||||
@ -728,7 +728,7 @@ test('connection.toJSON should hide agent, ssl and auth', t => {
|
||||
headers: { foo: 'bar' }
|
||||
})
|
||||
|
||||
t.deepEqual(connection.toJSON(), {
|
||||
t.same(connection.toJSON(), {
|
||||
url: 'http://localhost:9200/',
|
||||
id: 'node-id',
|
||||
headers: {
|
||||
@ -754,7 +754,7 @@ test('Port handling', t => {
|
||||
url: new URL('http://localhost:80')
|
||||
})
|
||||
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
connection.buildRequestObject({}).port,
|
||||
undefined
|
||||
)
|
||||
@ -767,7 +767,7 @@ test('Port handling', t => {
|
||||
url: new URL('https://localhost:443')
|
||||
})
|
||||
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
connection.buildRequestObject({}).port,
|
||||
undefined
|
||||
)
|
||||
@ -784,7 +784,7 @@ test('Authorization header', t => {
|
||||
url: new URL('http://localhost:9200')
|
||||
})
|
||||
|
||||
t.deepEqual(connection.headers, {})
|
||||
t.same(connection.headers, {})
|
||||
|
||||
t.end()
|
||||
})
|
||||
@ -795,7 +795,7 @@ test('Authorization header', t => {
|
||||
auth: { username: 'foo', password: 'bar' }
|
||||
})
|
||||
|
||||
t.deepEqual(connection.headers, { authorization: 'Basic Zm9vOmJhcg==' })
|
||||
t.same(connection.headers, { authorization: 'Basic Zm9vOmJhcg==' })
|
||||
|
||||
t.end()
|
||||
})
|
||||
@ -806,7 +806,7 @@ test('Authorization header', t => {
|
||||
auth: { apiKey: 'Zm9vOmJhcg==' }
|
||||
})
|
||||
|
||||
t.deepEqual(connection.headers, { authorization: 'ApiKey Zm9vOmJhcg==' })
|
||||
t.same(connection.headers, { authorization: 'ApiKey Zm9vOmJhcg==' })
|
||||
|
||||
t.end()
|
||||
})
|
||||
@ -817,7 +817,7 @@ test('Authorization header', t => {
|
||||
auth: { apiKey: { id: 'foo', api_key: 'bar' } }
|
||||
})
|
||||
|
||||
t.deepEqual(connection.headers, { authorization: 'ApiKey Zm9vOmJhcg==' })
|
||||
t.same(connection.headers, { authorization: 'ApiKey Zm9vOmJhcg==' })
|
||||
|
||||
t.end()
|
||||
})
|
||||
@ -830,7 +830,7 @@ test('Should not add agent and ssl to the serialized connection', t => {
|
||||
url: new URL('http://localhost:9200')
|
||||
})
|
||||
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
JSON.stringify(connection),
|
||||
'{"url":"http://localhost:9200/","id":"http://localhost:9200/","headers":{},"deadCount":0,"resurrectTimeout":0,"_openRequests":0,"status":"alive","roles":{"master":true,"data":true,"ingest":true,"ml":false}}'
|
||||
)
|
||||
@ -890,7 +890,7 @@ test('Should correctly resolve request pathname', t => {
|
||||
url: new URL('http://localhost:80/test')
|
||||
})
|
||||
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
connection.buildRequestObject({
|
||||
path: 'hello'
|
||||
}).pathname,
|
||||
@ -906,7 +906,7 @@ test('Proxy agent (http)', t => {
|
||||
proxy: 'http://localhost:8080'
|
||||
})
|
||||
|
||||
t.true(connection.agent instanceof hpagent.HttpProxyAgent)
|
||||
t.ok(connection.agent instanceof hpagent.HttpProxyAgent)
|
||||
})
|
||||
|
||||
test('Proxy agent (https)', t => {
|
||||
@ -917,7 +917,7 @@ test('Proxy agent (https)', t => {
|
||||
proxy: 'http://localhost:8080'
|
||||
})
|
||||
|
||||
t.true(connection.agent instanceof hpagent.HttpsProxyAgent)
|
||||
t.ok(connection.agent instanceof hpagent.HttpsProxyAgent)
|
||||
})
|
||||
|
||||
test('Abort with a slow body', t => {
|
||||
|
||||
@ -26,57 +26,57 @@ const { errors } = require('../../index')
|
||||
|
||||
test('ElasticsearchClientError', t => {
|
||||
const err = new errors.ElasticsearchClientError()
|
||||
t.true(err instanceof Error)
|
||||
t.ok(err instanceof Error)
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('TimeoutError', t => {
|
||||
const err = new errors.TimeoutError()
|
||||
t.true(err instanceof Error)
|
||||
t.true(err instanceof errors.ElasticsearchClientError)
|
||||
t.true(err.hasOwnProperty('meta'))
|
||||
t.ok(err instanceof Error)
|
||||
t.ok(err instanceof errors.ElasticsearchClientError)
|
||||
t.ok(err.hasOwnProperty('meta'))
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('ConnectionError', t => {
|
||||
const err = new errors.ConnectionError()
|
||||
t.true(err instanceof Error)
|
||||
t.true(err instanceof errors.ElasticsearchClientError)
|
||||
t.true(err.hasOwnProperty('meta'))
|
||||
t.ok(err instanceof Error)
|
||||
t.ok(err instanceof errors.ElasticsearchClientError)
|
||||
t.ok(err.hasOwnProperty('meta'))
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('NoLivingConnectionsError', t => {
|
||||
const err = new errors.NoLivingConnectionsError()
|
||||
t.true(err instanceof Error)
|
||||
t.true(err instanceof errors.ElasticsearchClientError)
|
||||
t.true(err.hasOwnProperty('meta'))
|
||||
t.ok(err instanceof Error)
|
||||
t.ok(err instanceof errors.ElasticsearchClientError)
|
||||
t.ok(err.hasOwnProperty('meta'))
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('SerializationError', t => {
|
||||
const err = new errors.SerializationError()
|
||||
t.true(err instanceof Error)
|
||||
t.true(err instanceof errors.ElasticsearchClientError)
|
||||
t.false(err.hasOwnProperty('meta'))
|
||||
t.true(err.hasOwnProperty('data'))
|
||||
t.ok(err instanceof Error)
|
||||
t.ok(err instanceof errors.ElasticsearchClientError)
|
||||
t.notOk(err.hasOwnProperty('meta'))
|
||||
t.ok(err.hasOwnProperty('data'))
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('DeserializationError', t => {
|
||||
const err = new errors.DeserializationError()
|
||||
t.true(err instanceof Error)
|
||||
t.true(err instanceof errors.ElasticsearchClientError)
|
||||
t.false(err.hasOwnProperty('meta'))
|
||||
t.true(err.hasOwnProperty('data'))
|
||||
t.ok(err instanceof Error)
|
||||
t.ok(err instanceof errors.ElasticsearchClientError)
|
||||
t.notOk(err.hasOwnProperty('meta'))
|
||||
t.ok(err.hasOwnProperty('data'))
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('ConfigurationError', t => {
|
||||
const err = new errors.ConfigurationError()
|
||||
t.true(err instanceof Error)
|
||||
t.true(err instanceof errors.ElasticsearchClientError)
|
||||
t.false(err.hasOwnProperty('meta'))
|
||||
t.ok(err instanceof Error)
|
||||
t.ok(err instanceof errors.ElasticsearchClientError)
|
||||
t.notOk(err.hasOwnProperty('meta'))
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -87,9 +87,9 @@ test('ResponseError', t => {
|
||||
headers: 1
|
||||
}
|
||||
const err = new errors.ResponseError(meta)
|
||||
t.true(err instanceof Error)
|
||||
t.true(err instanceof errors.ElasticsearchClientError)
|
||||
t.true(err.hasOwnProperty('meta'))
|
||||
t.ok(err instanceof Error)
|
||||
t.ok(err instanceof errors.ElasticsearchClientError)
|
||||
t.ok(err.hasOwnProperty('meta'))
|
||||
t.ok(err.body)
|
||||
t.ok(err.statusCode)
|
||||
t.ok(err.headers)
|
||||
@ -98,8 +98,102 @@ test('ResponseError', t => {
|
||||
|
||||
test('RequestAbortedError', t => {
|
||||
const err = new errors.RequestAbortedError()
|
||||
t.true(err instanceof Error)
|
||||
t.true(err instanceof errors.ElasticsearchClientError)
|
||||
t.true(err.hasOwnProperty('meta'))
|
||||
t.ok(err instanceof Error)
|
||||
t.ok(err instanceof errors.ElasticsearchClientError)
|
||||
t.ok(err.hasOwnProperty('meta'))
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('ResponseError with meaningful message / 1', t => {
|
||||
const meta = {
|
||||
body: {
|
||||
error: {
|
||||
root_cause: [
|
||||
{
|
||||
type: 'index_not_found_exception',
|
||||
reason: 'no such index [foo]',
|
||||
'resource.type': 'index_expression',
|
||||
'resource.id': 'foo',
|
||||
index_uuid: '_na_',
|
||||
index: 'foo'
|
||||
}
|
||||
],
|
||||
type: 'index_not_found_exception',
|
||||
reason: 'no such index [foo]',
|
||||
'resource.type': 'index_expression',
|
||||
'resource.id': 'foo',
|
||||
index_uuid: '_na_',
|
||||
index: 'foo'
|
||||
},
|
||||
status: 404
|
||||
},
|
||||
statusCode: 404,
|
||||
headers: {}
|
||||
}
|
||||
const err = new errors.ResponseError(meta)
|
||||
t.equal(err.message, 'index_not_found_exception: [index_not_found_exception] Reason: no such index [foo]')
|
||||
t.equal(err.toString(), JSON.stringify(meta.body))
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('ResponseError with meaningful message / 2', t => {
|
||||
const meta = {
|
||||
body: {
|
||||
error: {
|
||||
root_cause: [
|
||||
{
|
||||
type: 'index_not_found_exception',
|
||||
reason: 'no such index [foo]',
|
||||
'resource.type': 'index_expression',
|
||||
'resource.id': 'foo',
|
||||
index_uuid: '_na_',
|
||||
index: 'foo'
|
||||
},
|
||||
{
|
||||
type: 'nested_cause',
|
||||
reason: 'this is a nested cause',
|
||||
'resource.type': 'index_expression',
|
||||
'resource.id': 'foo',
|
||||
index_uuid: '_na_',
|
||||
index: 'foo'
|
||||
}
|
||||
],
|
||||
type: 'index_not_found_exception',
|
||||
reason: 'no such index [foo]',
|
||||
'resource.type': 'index_expression',
|
||||
'resource.id': 'foo',
|
||||
index_uuid: '_na_',
|
||||
index: 'foo'
|
||||
},
|
||||
status: 404
|
||||
},
|
||||
statusCode: 404,
|
||||
headers: {}
|
||||
}
|
||||
const err = new errors.ResponseError(meta)
|
||||
t.equal(err.message, 'index_not_found_exception: [index_not_found_exception] Reason: no such index [foo]; [nested_cause] Reason: this is a nested cause')
|
||||
t.equal(err.toString(), JSON.stringify(meta.body))
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('ResponseError with meaningful message / 3', t => {
|
||||
const meta = {
|
||||
body: {
|
||||
error: {
|
||||
type: 'index_not_found_exception',
|
||||
reason: 'no such index [foo]',
|
||||
'resource.type': 'index_expression',
|
||||
'resource.id': 'foo',
|
||||
index_uuid: '_na_',
|
||||
index: 'foo'
|
||||
},
|
||||
status: 404
|
||||
},
|
||||
statusCode: 404,
|
||||
headers: {}
|
||||
}
|
||||
const err = new errors.ResponseError(meta)
|
||||
t.equal(err.message, 'index_not_found_exception')
|
||||
t.equal(err.toString(), JSON.stringify(meta.body))
|
||||
t.end()
|
||||
})
|
||||
|
||||
@ -4,5 +4,5 @@ import { Client } from '../../../index.mjs'
|
||||
t.test('esm support', t => {
|
||||
t.plan(1)
|
||||
const client = new Client({ node: 'http://localhost:9200' })
|
||||
t.strictEqual(client.name, 'elasticsearch-js')
|
||||
t.equal(client.name, 'elasticsearch-js')
|
||||
})
|
||||
|
||||
@ -289,7 +289,7 @@ test('Emit event', t => {
|
||||
|
||||
client.on(events.REQUEST, (err, request) => {
|
||||
t.error(err)
|
||||
t.deepEqual(request, { hello: 'world' })
|
||||
t.same(request, { hello: 'world' })
|
||||
})
|
||||
|
||||
client.emit(events.REQUEST, null, { hello: 'world' })
|
||||
|
||||
@ -44,14 +44,14 @@ test('bulk index', t => {
|
||||
let count = 0
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.equal(params.path, '/_bulk')
|
||||
t.match(params.headers, {
|
||||
'content-type': 'application/x-ndjson',
|
||||
'x-elastic-client-meta': `es=${clientVersion},js=${nodeVersion},t=${clientVersion},hc=${nodeVersion},h=bp`
|
||||
})
|
||||
const [action, payload] = params.body.split('\n')
|
||||
t.deepEqual(JSON.parse(action), { index: { _index: 'test' } })
|
||||
t.deepEqual(JSON.parse(payload), dataset[count++])
|
||||
t.same(JSON.parse(action), { index: { _index: 'test' } })
|
||||
t.same(JSON.parse(payload), dataset[count++])
|
||||
return { body: { errors: false, items: [{}] } }
|
||||
}
|
||||
})
|
||||
@ -89,14 +89,14 @@ test('bulk index', t => {
|
||||
let count = 0
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.equal(params.path, '/_bulk')
|
||||
t.match(params.headers, { 'content-type': 'application/x-ndjson' })
|
||||
t.notMatch(params.headers, {
|
||||
'x-elastic-client-meta': `es=${clientVersion},js=${nodeVersion},t=${clientVersion},hc=${nodeVersion},h=bp`
|
||||
})
|
||||
const [action, payload] = params.body.split('\n')
|
||||
t.deepEqual(JSON.parse(action), { index: { _index: 'test' } })
|
||||
t.deepEqual(JSON.parse(payload), dataset[count++])
|
||||
t.same(JSON.parse(action), { index: { _index: 'test' } })
|
||||
t.same(JSON.parse(payload), dataset[count++])
|
||||
return { body: { errors: false, items: [{}] } }
|
||||
}
|
||||
})
|
||||
@ -134,9 +134,9 @@ test('bulk index', t => {
|
||||
t.test('Should perform a bulk request (high flush size)', async t => {
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.equal(params.path, '/_bulk')
|
||||
t.match(params.headers, { 'content-type': 'application/x-ndjson' })
|
||||
t.strictEqual(params.body.split('\n').filter(Boolean).length, 6)
|
||||
t.equal(params.body.split('\n').filter(Boolean).length, 6)
|
||||
return { body: { errors: false, items: new Array(3).fill({}) } }
|
||||
}
|
||||
})
|
||||
@ -175,14 +175,14 @@ test('bulk index', t => {
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
if (params.method === 'GET') {
|
||||
t.strictEqual(params.path, '/_all/_refresh')
|
||||
t.equal(params.path, '/_all/_refresh')
|
||||
return { body: { acknowledged: true } }
|
||||
} else {
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.equal(params.path, '/_bulk')
|
||||
t.match(params.headers, { 'content-type': 'application/x-ndjson' })
|
||||
const [action, payload] = params.body.split('\n')
|
||||
t.deepEqual(JSON.parse(action), { index: { _index: 'test' } })
|
||||
t.deepEqual(JSON.parse(payload), dataset[count++])
|
||||
t.same(JSON.parse(action), { index: { _index: 'test' } })
|
||||
t.same(JSON.parse(payload), dataset[count++])
|
||||
return { body: { errors: false, items: [{}] } }
|
||||
}
|
||||
}
|
||||
@ -220,14 +220,14 @@ test('bulk index', t => {
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
if (params.method === 'GET') {
|
||||
t.strictEqual(params.path, '/test/_refresh')
|
||||
t.equal(params.path, '/test/_refresh')
|
||||
return { body: { acknowledged: true } }
|
||||
} else {
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.equal(params.path, '/_bulk')
|
||||
t.match(params.headers, { 'content-type': 'application/x-ndjson' })
|
||||
const [action, payload] = params.body.split('\n')
|
||||
t.deepEqual(JSON.parse(action), { index: { _index: 'test' } })
|
||||
t.deepEqual(JSON.parse(payload), dataset[count++])
|
||||
t.same(JSON.parse(action), { index: { _index: 'test' } })
|
||||
t.same(JSON.parse(payload), dataset[count++])
|
||||
return { body: { errors: false, items: [{}] } }
|
||||
}
|
||||
}
|
||||
@ -264,11 +264,11 @@ test('bulk index', t => {
|
||||
let count = 0
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.equal(params.path, '/_bulk')
|
||||
t.match(params.headers, { 'content-type': 'application/x-ndjson' })
|
||||
const [action, payload] = params.body.split('\n')
|
||||
t.deepEqual(JSON.parse(action), { index: { _index: 'test', _id: count } })
|
||||
t.deepEqual(JSON.parse(payload), dataset[count++])
|
||||
t.same(JSON.parse(action), { index: { _index: 'test', _id: count } })
|
||||
t.same(JSON.parse(payload), dataset[count++])
|
||||
return { body: { errors: false, items: [{}] } }
|
||||
}
|
||||
})
|
||||
@ -308,7 +308,7 @@ test('bulk index', t => {
|
||||
|
||||
t.test('Should perform a bulk request (retry)', async t => {
|
||||
async function handler (req, res) {
|
||||
t.strictEqual(req.url, '/_bulk')
|
||||
t.equal(req.url, '/_bulk')
|
||||
t.match(req.headers, { 'content-type': 'application/x-ndjson' })
|
||||
|
||||
let body = ''
|
||||
@ -353,7 +353,7 @@ test('bulk index', t => {
|
||||
}
|
||||
},
|
||||
onDrop (doc) {
|
||||
t.deepEqual(doc, {
|
||||
t.same(doc, {
|
||||
status: 429,
|
||||
error: null,
|
||||
operation: { index: { _index: 'test' } },
|
||||
@ -402,7 +402,7 @@ test('bulk index', t => {
|
||||
}
|
||||
},
|
||||
onDrop (doc) {
|
||||
t.deepEqual(doc, {
|
||||
t.same(doc, {
|
||||
status: 429,
|
||||
error: null,
|
||||
operation: { index: { _index: 'test' } },
|
||||
@ -426,7 +426,7 @@ test('bulk index', t => {
|
||||
|
||||
t.test('Should perform a bulk request (failure)', async t => {
|
||||
async function handler (req, res) {
|
||||
t.strictEqual(req.url, '/_bulk')
|
||||
t.equal(req.url, '/_bulk')
|
||||
t.match(req.headers, { 'content-type': 'application/x-ndjson' })
|
||||
|
||||
let body = ''
|
||||
@ -471,7 +471,7 @@ test('bulk index', t => {
|
||||
}
|
||||
},
|
||||
onDrop (doc) {
|
||||
t.deepEqual(doc, {
|
||||
t.same(doc, {
|
||||
status: 400,
|
||||
error: { something: 'went wrong' },
|
||||
operation: { index: { _index: 'test' } },
|
||||
@ -525,7 +525,7 @@ test('bulk index', t => {
|
||||
await b
|
||||
t.fail('Should throw')
|
||||
} catch (err) {
|
||||
t.true(err instanceof errors.ResponseError)
|
||||
t.ok(err instanceof errors.ResponseError)
|
||||
}
|
||||
})
|
||||
|
||||
@ -561,13 +561,13 @@ test('bulk index', t => {
|
||||
await b
|
||||
t.fail('Should throw')
|
||||
} catch (err) {
|
||||
t.true(err instanceof errors.ResponseError)
|
||||
t.ok(err instanceof errors.ResponseError)
|
||||
}
|
||||
})
|
||||
|
||||
t.test('Should abort a bulk request', async t => {
|
||||
async function handler (req, res) {
|
||||
t.strictEqual(req.url, '/_bulk')
|
||||
t.equal(req.url, '/_bulk')
|
||||
t.match(req.headers, { 'content-type': 'application/x-ndjson' })
|
||||
|
||||
let body = ''
|
||||
@ -653,8 +653,8 @@ test('bulk index', t => {
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
t.true(err instanceof errors.ConfigurationError)
|
||||
t.is(err.message, 'Bulk helper invalid action: \'foo\'')
|
||||
t.ok(err instanceof errors.ConfigurationError)
|
||||
t.equal(err.message, 'Bulk helper invalid action: \'foo\'')
|
||||
})
|
||||
})
|
||||
|
||||
@ -666,11 +666,11 @@ test('bulk index', t => {
|
||||
let count = 0
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.equal(params.path, '/_bulk')
|
||||
t.match(params.headers, { 'content-type': 'application/x-ndjson' })
|
||||
const [action, payload] = params.body.split('\n')
|
||||
t.deepEqual(JSON.parse(action), { index: { _index: 'test', _id: count } })
|
||||
t.deepEqual(JSON.parse(payload), dataset[count++])
|
||||
t.same(JSON.parse(action), { index: { _index: 'test', _id: count } })
|
||||
t.same(JSON.parse(payload), dataset[count++])
|
||||
return { body: { errors: false, items: [{}] } }
|
||||
}
|
||||
})
|
||||
@ -718,11 +718,11 @@ test('bulk index', t => {
|
||||
let count = 0
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.equal(params.path, '/_bulk')
|
||||
t.match(params.headers, { 'content-type': 'application/x-ndjson' })
|
||||
const [action, payload] = params.body.split('\n')
|
||||
t.deepEqual(JSON.parse(action), { index: { _index: 'test' } })
|
||||
t.deepEqual(JSON.parse(payload), dataset[count++])
|
||||
t.same(JSON.parse(action), { index: { _index: 'test' } })
|
||||
t.same(JSON.parse(payload), dataset[count++])
|
||||
return { body: { errors: false, items: [{}] } }
|
||||
}
|
||||
})
|
||||
@ -774,11 +774,11 @@ test('bulk create', t => {
|
||||
let count = 0
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.equal(params.path, '/_bulk')
|
||||
t.match(params.headers, { 'content-type': 'application/x-ndjson' })
|
||||
const [action, payload] = params.body.split('\n')
|
||||
t.deepEqual(JSON.parse(action), { create: { _index: 'test', _id: count } })
|
||||
t.deepEqual(JSON.parse(payload), dataset[count++])
|
||||
t.same(JSON.parse(action), { create: { _index: 'test', _id: count } })
|
||||
t.same(JSON.parse(payload), dataset[count++])
|
||||
return { body: { errors: false, items: [{}] } }
|
||||
}
|
||||
})
|
||||
@ -823,11 +823,11 @@ test('bulk update', t => {
|
||||
let count = 0
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.equal(params.path, '/_bulk')
|
||||
t.match(params.headers, { 'content-type': 'application/x-ndjson' })
|
||||
const [action, payload] = params.body.split('\n')
|
||||
t.deepEqual(JSON.parse(action), { update: { _index: 'test', _id: count } })
|
||||
t.deepEqual(JSON.parse(payload), { doc: dataset[count++], doc_as_upsert: true })
|
||||
t.same(JSON.parse(action), { update: { _index: 'test', _id: count } })
|
||||
t.same(JSON.parse(payload), { doc: dataset[count++], doc_as_upsert: true })
|
||||
return { body: { errors: false, items: [{}] } }
|
||||
}
|
||||
})
|
||||
@ -871,11 +871,11 @@ test('bulk update', t => {
|
||||
let count = 0
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.equal(params.path, '/_bulk')
|
||||
t.match(params.headers, { 'content-type': 'application/x-ndjson' })
|
||||
const [action, payload] = params.body.split('\n')
|
||||
t.deepEqual(JSON.parse(action), { update: { _index: 'test', _id: count } })
|
||||
t.deepEqual(JSON.parse(payload), { doc: dataset[count++] })
|
||||
t.same(JSON.parse(action), { update: { _index: 'test', _id: count } })
|
||||
t.same(JSON.parse(payload), { doc: dataset[count++] })
|
||||
return { body: { errors: false, items: [{}] } }
|
||||
}
|
||||
})
|
||||
@ -921,9 +921,9 @@ test('bulk delete', t => {
|
||||
let count = 0
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.equal(params.path, '/_bulk')
|
||||
t.match(params.headers, { 'content-type': 'application/x-ndjson' })
|
||||
t.deepEqual(JSON.parse(params.body), { delete: { _index: 'test', _id: count++ } })
|
||||
t.same(JSON.parse(params.body), { delete: { _index: 'test', _id: count++ } })
|
||||
return { body: { errors: false, items: [{}] } }
|
||||
}
|
||||
})
|
||||
@ -963,7 +963,7 @@ test('bulk delete', t => {
|
||||
|
||||
t.test('Should perform a bulk request (failure)', async t => {
|
||||
async function handler (req, res) {
|
||||
t.strictEqual(req.url, '/_bulk')
|
||||
t.equal(req.url, '/_bulk')
|
||||
t.match(req.headers, { 'content-type': 'application/x-ndjson' })
|
||||
|
||||
let body = ''
|
||||
@ -1011,7 +1011,7 @@ test('bulk delete', t => {
|
||||
}
|
||||
},
|
||||
onDrop (doc) {
|
||||
t.deepEqual(doc, {
|
||||
t.same(doc, {
|
||||
status: 400,
|
||||
error: { something: 'went wrong' },
|
||||
operation: { delete: { _index: 'test', _id: 1 } },
|
||||
@ -1051,7 +1051,7 @@ test('transport options', t => {
|
||||
return { body: { errors: false, items: [{}] } }
|
||||
}
|
||||
|
||||
t.strictEqual(params.path, '/_all/_refresh')
|
||||
t.equal(params.path, '/_all/_refresh')
|
||||
t.match(params.headers, {
|
||||
foo: 'bar'
|
||||
})
|
||||
@ -1081,7 +1081,7 @@ test('transport options', t => {
|
||||
}
|
||||
})
|
||||
|
||||
t.strictEqual(count, 4) // three bulk requests, one refresh
|
||||
t.equal(count, 4) // three bulk requests, one refresh
|
||||
t.type(result.time, 'number')
|
||||
t.type(result.bytes, 'number')
|
||||
t.match(result, {
|
||||
@ -1111,8 +1111,8 @@ test('errors', t => {
|
||||
}
|
||||
})
|
||||
} catch (err) {
|
||||
t.true(err instanceof errors.ConfigurationError)
|
||||
t.is(err.message, 'bulk helper: the datasource must be an array or a buffer or a readable stream or an async generator')
|
||||
t.ok(err instanceof errors.ConfigurationError)
|
||||
t.equal(err.message, 'bulk helper: the datasource must be an array or a buffer or a readable stream or an async generator')
|
||||
}
|
||||
})
|
||||
|
||||
@ -1129,8 +1129,8 @@ test('errors', t => {
|
||||
}
|
||||
})
|
||||
} catch (err) {
|
||||
t.true(err instanceof errors.ConfigurationError)
|
||||
t.is(err.message, 'bulk helper: the datasource is required')
|
||||
t.ok(err instanceof errors.ConfigurationError)
|
||||
t.equal(err.message, 'bulk helper: the datasource is required')
|
||||
}
|
||||
})
|
||||
|
||||
@ -1143,8 +1143,8 @@ test('errors', t => {
|
||||
datasource: dataset.slice()
|
||||
})
|
||||
} catch (err) {
|
||||
t.true(err instanceof errors.ConfigurationError)
|
||||
t.is(err.message, 'bulk helper: the onDocument callback is required')
|
||||
t.ok(err instanceof errors.ConfigurationError)
|
||||
t.equal(err.message, 'bulk helper: the onDocument callback is required')
|
||||
}
|
||||
})
|
||||
|
||||
@ -1159,11 +1159,11 @@ test('Flush interval', t => {
|
||||
let count = 0
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.equal(params.path, '/_bulk')
|
||||
t.match(params.headers, { 'content-type': 'application/x-ndjson' })
|
||||
const [action, payload] = params.body.split('\n')
|
||||
t.deepEqual(JSON.parse(action), { index: { _index: 'test' } })
|
||||
t.deepEqual(JSON.parse(payload), dataset[count++])
|
||||
t.same(JSON.parse(action), { index: { _index: 'test' } })
|
||||
t.same(JSON.parse(payload), dataset[count++])
|
||||
return { body: { errors: false, items: [{}] } }
|
||||
}
|
||||
})
|
||||
@ -1210,12 +1210,12 @@ test('Flush interval', t => {
|
||||
let count = 0
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.true(count < 2)
|
||||
t.strictEqual(params.path, '/_bulk')
|
||||
t.ok(count < 2)
|
||||
t.equal(params.path, '/_bulk')
|
||||
t.match(params.headers, { 'content-type': 'application/x-ndjson' })
|
||||
const [action, payload] = params.body.split('\n')
|
||||
t.deepEqual(JSON.parse(action), { index: { _index: 'test' } })
|
||||
t.deepEqual(JSON.parse(payload), dataset[count++])
|
||||
t.same(JSON.parse(action), { index: { _index: 'test' } })
|
||||
t.same(JSON.parse(payload), dataset[count++])
|
||||
return { body: { errors: false, items: [{}] } }
|
||||
}
|
||||
})
|
||||
|
||||
@ -56,7 +56,7 @@ test('Basic', async t => {
|
||||
{ query: { match: { foo: 'bar' } } }
|
||||
)
|
||||
|
||||
t.deepEqual(result.body, {
|
||||
t.same(result.body, {
|
||||
status: 200,
|
||||
hits: {
|
||||
hits: [
|
||||
@ -67,7 +67,7 @@ test('Basic', async t => {
|
||||
}
|
||||
})
|
||||
|
||||
t.deepEqual(result.documents, [
|
||||
t.same(result.documents, [
|
||||
{ one: 'one' },
|
||||
{ two: 'two' },
|
||||
{ three: 'three' }
|
||||
@ -116,7 +116,7 @@ test('Multiple searches (inside async iterator)', t => {
|
||||
|
||||
m.search({ index: 'test' }, { query: { match: { foo: 'bar' } } }, (err, result) => {
|
||||
t.error(err)
|
||||
t.deepEqual(result.body, {
|
||||
t.same(result.body, {
|
||||
status: 200,
|
||||
hits: {
|
||||
hits: [
|
||||
@ -127,7 +127,7 @@ test('Multiple searches (inside async iterator)', t => {
|
||||
}
|
||||
})
|
||||
|
||||
t.deepEqual(result.documents, [
|
||||
t.same(result.documents, [
|
||||
{ one: 'one' },
|
||||
{ two: 'two' },
|
||||
{ three: 'three' }
|
||||
@ -136,7 +136,7 @@ test('Multiple searches (inside async iterator)', t => {
|
||||
|
||||
m.search({ index: 'test' }, { query: { match: { foo: 'bar' } } }, (err, result) => {
|
||||
t.error(err)
|
||||
t.deepEqual(result.body, {
|
||||
t.same(result.body, {
|
||||
status: 200,
|
||||
hits: {
|
||||
hits: [
|
||||
@ -147,7 +147,7 @@ test('Multiple searches (inside async iterator)', t => {
|
||||
}
|
||||
})
|
||||
|
||||
t.deepEqual(result.documents, [
|
||||
t.same(result.documents, [
|
||||
{ four: 'four' },
|
||||
{ five: 'five' },
|
||||
{ six: 'six' }
|
||||
@ -197,7 +197,7 @@ test('Multiple searches (async iterator exits)', t => {
|
||||
|
||||
m.search({ index: 'test' }, { query: {} }, (err, result) => {
|
||||
t.error(err)
|
||||
t.deepEqual(result.body, {
|
||||
t.same(result.body, {
|
||||
status: 200,
|
||||
hits: {
|
||||
hits: [
|
||||
@ -208,7 +208,7 @@ test('Multiple searches (async iterator exits)', t => {
|
||||
}
|
||||
})
|
||||
|
||||
t.deepEqual(result.documents, [
|
||||
t.same(result.documents, [
|
||||
{ one: 'one' },
|
||||
{ two: 'two' },
|
||||
{ three: 'three' }
|
||||
@ -217,7 +217,7 @@ test('Multiple searches (async iterator exits)', t => {
|
||||
|
||||
m.search({ index: 'test' }, { query: { match: { foo: 'bar' } } }, (err, result) => {
|
||||
t.error(err)
|
||||
t.deepEqual(result.body, {
|
||||
t.same(result.body, {
|
||||
status: 200,
|
||||
hits: {
|
||||
hits: [
|
||||
@ -228,7 +228,7 @@ test('Multiple searches (async iterator exits)', t => {
|
||||
}
|
||||
})
|
||||
|
||||
t.deepEqual(result.documents, [
|
||||
t.same(result.documents, [
|
||||
{ four: 'four' },
|
||||
{ five: 'five' },
|
||||
{ six: 'six' }
|
||||
@ -260,7 +260,7 @@ test('Stop a msearch processor (promises)', async t => {
|
||||
{ query: { match: { foo: 'bar' } } }
|
||||
)
|
||||
} catch (err) {
|
||||
t.strictEqual(err.message, 'The msearch processor has been stopped')
|
||||
t.equal(err.message, 'The msearch processor has been stopped')
|
||||
}
|
||||
|
||||
t.teardown(() => m.stop())
|
||||
@ -285,7 +285,7 @@ test('Stop a msearch processor (callbacks)', t => {
|
||||
m.stop()
|
||||
|
||||
m.search({ index: 'test' }, { query: { match: { foo: 'bar' } } }, (err, result) => {
|
||||
t.strictEqual(err.message, 'The msearch processor has been stopped')
|
||||
t.equal(err.message, 'The msearch processor has been stopped')
|
||||
})
|
||||
})
|
||||
|
||||
@ -306,12 +306,12 @@ test('Bad header', t => {
|
||||
const m = client.helpers.msearch()
|
||||
|
||||
m.search(null, { query: { match: { foo: 'bar' } } }, (err, result) => {
|
||||
t.strictEqual(err.message, 'The header should be an object')
|
||||
t.equal(err.message, 'The header should be an object')
|
||||
})
|
||||
|
||||
m.search(null, { query: { match: { foo: 'bar' } } })
|
||||
.catch(err => {
|
||||
t.strictEqual(err.message, 'The header should be an object')
|
||||
t.equal(err.message, 'The header should be an object')
|
||||
})
|
||||
|
||||
t.teardown(() => m.stop())
|
||||
@ -334,12 +334,12 @@ test('Bad body', t => {
|
||||
const m = client.helpers.msearch()
|
||||
|
||||
m.search({ index: 'test' }, null, (err, result) => {
|
||||
t.strictEqual(err.message, 'The body should be an object')
|
||||
t.equal(err.message, 'The body should be an object')
|
||||
})
|
||||
|
||||
m.search({ index: 'test' }, null)
|
||||
.catch(err => {
|
||||
t.strictEqual(err.message, 'The body should be an object')
|
||||
t.equal(err.message, 'The body should be an object')
|
||||
})
|
||||
|
||||
t.teardown(() => m.stop())
|
||||
@ -389,7 +389,7 @@ test('Retry on 429', async t => {
|
||||
{ query: { match: { foo: 'bar' } } }
|
||||
)
|
||||
|
||||
t.deepEqual(result.body, {
|
||||
t.same(result.body, {
|
||||
status: 200,
|
||||
hits: {
|
||||
hits: [
|
||||
@ -400,7 +400,7 @@ test('Retry on 429', async t => {
|
||||
}
|
||||
})
|
||||
|
||||
t.deepEqual(result.documents, [
|
||||
t.same(result.documents, [
|
||||
{ one: 'one' },
|
||||
{ two: 'two' },
|
||||
{ three: 'three' }
|
||||
@ -436,7 +436,7 @@ test('Single search errors', async t => {
|
||||
{ query: { match: { foo: 'bar' } } }
|
||||
)
|
||||
} catch (err) {
|
||||
t.true(err instanceof errors.ResponseError)
|
||||
t.ok(err instanceof errors.ResponseError)
|
||||
}
|
||||
|
||||
t.teardown(() => m.stop())
|
||||
@ -465,13 +465,13 @@ test('Entire msearch fails', t => {
|
||||
const m = client.helpers.msearch({ operations: 1 })
|
||||
|
||||
m.search({ index: 'test' }, { query: {} }, (err, result) => {
|
||||
t.true(err instanceof errors.ResponseError)
|
||||
t.deepEqual(result.documents, [])
|
||||
t.ok(err instanceof errors.ResponseError)
|
||||
t.same(result.documents, [])
|
||||
})
|
||||
|
||||
m.search({ index: 'test' }, { query: {} }, (err, result) => {
|
||||
t.true(err instanceof errors.ResponseError)
|
||||
t.deepEqual(result.documents, [])
|
||||
t.ok(err instanceof errors.ResponseError)
|
||||
t.same(result.documents, [])
|
||||
})
|
||||
|
||||
t.teardown(() => m.stop())
|
||||
@ -523,13 +523,13 @@ test('Stop the msearch helper with an error', t => {
|
||||
|
||||
m.then(
|
||||
() => t.fail('Should fail'),
|
||||
err => t.is(err.message, 'kaboom')
|
||||
err => t.equal(err.message, 'kaboom')
|
||||
)
|
||||
|
||||
m.catch(err => t.is(err.message, 'kaboom'))
|
||||
m.catch(err => t.equal(err.message, 'kaboom'))
|
||||
|
||||
m.search({ index: 'test' }, { query: {} }, (err, result) => {
|
||||
t.is(err.message, 'kaboom')
|
||||
t.equal(err.message, 'kaboom')
|
||||
})
|
||||
})
|
||||
|
||||
@ -564,7 +564,7 @@ test('Multiple searches (concurrency = 1)', t => {
|
||||
|
||||
m.search({ index: 'test' }, { query: {} }, (err, result) => {
|
||||
t.error(err)
|
||||
t.deepEqual(result.body, {
|
||||
t.same(result.body, {
|
||||
status: 200,
|
||||
hits: {
|
||||
hits: [
|
||||
@ -575,7 +575,7 @@ test('Multiple searches (concurrency = 1)', t => {
|
||||
}
|
||||
})
|
||||
|
||||
t.deepEqual(result.documents, [
|
||||
t.same(result.documents, [
|
||||
{ one: 'one' },
|
||||
{ two: 'two' },
|
||||
{ three: 'three' }
|
||||
@ -584,7 +584,7 @@ test('Multiple searches (concurrency = 1)', t => {
|
||||
|
||||
m.search({ index: 'test' }, { query: {} }, (err, result) => {
|
||||
t.error(err)
|
||||
t.deepEqual(result.body, {
|
||||
t.same(result.body, {
|
||||
status: 200,
|
||||
hits: {
|
||||
hits: [
|
||||
@ -595,7 +595,7 @@ test('Multiple searches (concurrency = 1)', t => {
|
||||
}
|
||||
})
|
||||
|
||||
t.deepEqual(result.documents, [
|
||||
t.same(result.documents, [
|
||||
{ one: 'one' },
|
||||
{ two: 'two' },
|
||||
{ three: 'three' }
|
||||
@ -647,12 +647,12 @@ test('Flush interval', t => {
|
||||
|
||||
m.search({ index: 'test' }, { query: { match: { foo: 'bar' } } }, (err, result) => {
|
||||
t.error(err)
|
||||
t.is(result.documents.length, 3)
|
||||
t.equal(result.documents.length, 3)
|
||||
})
|
||||
|
||||
m.search({ index: 'test' }, { query: { match: { foo: 'bar' } } }, (err, result) => {
|
||||
t.error(err)
|
||||
t.is(result.documents.length, 3)
|
||||
t.equal(result.documents.length, 3)
|
||||
})
|
||||
|
||||
setImmediate(clock.next)
|
||||
@ -691,7 +691,7 @@ test('Flush interval - early stop', t => {
|
||||
|
||||
m.search({ index: 'test' }, { query: { match: { foo: 'bar' } } }, (err, result) => {
|
||||
t.error(err)
|
||||
t.is(result.documents.length, 3)
|
||||
t.equal(result.documents.length, 3)
|
||||
})
|
||||
|
||||
setImmediate(() => {
|
||||
@ -750,11 +750,11 @@ test('Stop should resolve the helper (error)', t => {
|
||||
setImmediate(m.stop, new Error('kaboom'))
|
||||
|
||||
m.then(() => t.fail('Should not fail'))
|
||||
.catch(err => t.is(err.message, 'kaboom'))
|
||||
.catch(err => t.equal(err.message, 'kaboom'))
|
||||
|
||||
m.catch(err => t.is(err.message, 'kaboom'))
|
||||
m.catch(err => t.equal(err.message, 'kaboom'))
|
||||
|
||||
m.then(() => t.fail('Should not fail'), err => t.is(err.message, 'kaboom'))
|
||||
m.then(() => t.fail('Should not fail'), err => t.equal(err.message, 'kaboom'))
|
||||
})
|
||||
|
||||
test('Should use req options', async t => {
|
||||
|
||||
@ -38,11 +38,11 @@ test('Scroll search', async t => {
|
||||
|
||||
count += 1
|
||||
if (params.method === 'POST') {
|
||||
t.strictEqual(params.querystring, 'scroll=1m')
|
||||
t.equal(params.querystring, 'scroll=1m')
|
||||
}
|
||||
if (count === 4) {
|
||||
// final automated clear
|
||||
t.strictEqual(params.method, 'DELETE')
|
||||
t.equal(params.method, 'DELETE')
|
||||
}
|
||||
return {
|
||||
body: {
|
||||
@ -73,8 +73,8 @@ test('Scroll search', async t => {
|
||||
})
|
||||
|
||||
for await (const result of scrollSearch) {
|
||||
t.strictEqual(result.body.count, count)
|
||||
t.strictEqual(result.body._scroll_id, 'id')
|
||||
t.equal(result.body.count, count)
|
||||
t.equal(result.body._scroll_id, 'id')
|
||||
}
|
||||
})
|
||||
|
||||
@ -87,7 +87,7 @@ test('Clear a scroll search', async t => {
|
||||
})
|
||||
if (params.method === 'DELETE') {
|
||||
const body = JSON.parse(params.body)
|
||||
t.strictEqual(body.scroll_id, 'id')
|
||||
t.equal(body.scroll_id, 'id')
|
||||
}
|
||||
return {
|
||||
body: {
|
||||
@ -120,7 +120,7 @@ test('Clear a scroll search', async t => {
|
||||
if (count === 2) {
|
||||
t.fail('The scroll search should be cleared')
|
||||
}
|
||||
t.strictEqual(result.body.count, count)
|
||||
t.equal(result.body.count, count)
|
||||
if (count === 1) {
|
||||
await result.clear()
|
||||
}
|
||||
@ -138,7 +138,7 @@ test('Scroll search (retry)', async t => {
|
||||
}
|
||||
if (count === 5) {
|
||||
// final automated clear
|
||||
t.strictEqual(params.method, 'DELETE')
|
||||
t.equal(params.method, 'DELETE')
|
||||
}
|
||||
return {
|
||||
statusCode: 200,
|
||||
@ -172,9 +172,9 @@ test('Scroll search (retry)', async t => {
|
||||
})
|
||||
|
||||
for await (const result of scrollSearch) {
|
||||
t.strictEqual(result.body.count, count)
|
||||
t.notStrictEqual(result.body.count, 1)
|
||||
t.strictEqual(result.body._scroll_id, 'id')
|
||||
t.equal(result.body.count, count)
|
||||
t.not(result.body.count, 1)
|
||||
t.equal(result.body._scroll_id, 'id')
|
||||
}
|
||||
})
|
||||
|
||||
@ -208,9 +208,9 @@ test('Scroll search (retry throws and maxRetries)', async t => {
|
||||
t.fail('we should not be here')
|
||||
}
|
||||
} catch (err) {
|
||||
t.true(err instanceof errors.ResponseError)
|
||||
t.strictEqual(err.statusCode, 429)
|
||||
t.strictEqual(count, expectedAttempts)
|
||||
t.ok(err instanceof errors.ResponseError)
|
||||
t.equal(err.statusCode, 429)
|
||||
t.equal(count, expectedAttempts)
|
||||
}
|
||||
})
|
||||
|
||||
@ -222,7 +222,7 @@ test('Scroll search (retry throws later)', async t => {
|
||||
onRequest (params) {
|
||||
count += 1
|
||||
// filter_path should not be added if is not already present
|
||||
t.strictEqual(params.querystring, 'scroll=1m')
|
||||
t.equal(params.querystring, 'scroll=1m')
|
||||
if (count > 1) {
|
||||
return { body: {}, statusCode: 429 }
|
||||
}
|
||||
@ -258,12 +258,12 @@ test('Scroll search (retry throws later)', async t => {
|
||||
|
||||
try {
|
||||
for await (const result of scrollSearch) { // eslint-disable-line
|
||||
t.strictEqual(result.body.count, count)
|
||||
t.equal(result.body.count, count)
|
||||
}
|
||||
} catch (err) {
|
||||
t.true(err instanceof errors.ResponseError)
|
||||
t.strictEqual(err.statusCode, 429)
|
||||
t.strictEqual(count, expectedAttempts)
|
||||
t.ok(err instanceof errors.ResponseError)
|
||||
t.equal(err.statusCode, 429)
|
||||
t.equal(count, expectedAttempts)
|
||||
}
|
||||
})
|
||||
|
||||
@ -272,11 +272,11 @@ test('Scroll search documents', async t => {
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
if (count === 0) {
|
||||
t.strictEqual(params.querystring, 'filter_path=hits.hits._source%2C_scroll_id&scroll=1m')
|
||||
t.equal(params.querystring, 'filter_path=hits.hits._source%2C_scroll_id&scroll=1m')
|
||||
} else {
|
||||
if (params.method !== 'DELETE') {
|
||||
t.strictEqual(params.querystring, 'scroll=1m')
|
||||
t.strictEqual(params.body, '{"scroll_id":"id"}')
|
||||
t.equal(params.querystring, 'scroll=1m')
|
||||
t.equal(params.body, '{"scroll_id":"id"}')
|
||||
}
|
||||
}
|
||||
return {
|
||||
@ -309,7 +309,7 @@ test('Scroll search documents', async t => {
|
||||
|
||||
let n = 1
|
||||
for await (const hit of scrollSearch) {
|
||||
t.deepEqual(hit, { val: n * count })
|
||||
t.same(hit, { val: n * count })
|
||||
n += 1
|
||||
if (n === 4) {
|
||||
count += 1
|
||||
@ -348,9 +348,9 @@ test('Should not retry if maxRetries = 0', async t => {
|
||||
t.fail('we should not be here')
|
||||
}
|
||||
} catch (err) {
|
||||
t.true(err instanceof errors.ResponseError)
|
||||
t.strictEqual(err.statusCode, 429)
|
||||
t.strictEqual(count, expectedAttempts)
|
||||
t.ok(err instanceof errors.ResponseError)
|
||||
t.equal(err.statusCode, 429)
|
||||
t.equal(count, expectedAttempts)
|
||||
}
|
||||
})
|
||||
|
||||
@ -359,10 +359,10 @@ test('Fix querystring for scroll search', async t => {
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
if (count === 0) {
|
||||
t.strictEqual(params.querystring, 'size=1&scroll=1m')
|
||||
t.equal(params.querystring, 'size=1&scroll=1m')
|
||||
} else {
|
||||
if (params.method !== 'DELETE') {
|
||||
t.strictEqual(params.querystring, 'scroll=1m')
|
||||
t.equal(params.querystring, 'scroll=1m')
|
||||
}
|
||||
}
|
||||
return {
|
||||
@ -392,7 +392,7 @@ test('Fix querystring for scroll search', async t => {
|
||||
})
|
||||
|
||||
for await (const response of scrollSearch) {
|
||||
t.strictEqual(response.body.hits.hits.length, 1)
|
||||
t.equal(response.body.hits.hits.length, 1)
|
||||
count += 1
|
||||
}
|
||||
})
|
||||
|
||||
@ -26,7 +26,7 @@ const { connection } = require('../../utils')
|
||||
test('Search should have an additional documents property', async t => {
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.querystring, 'filter_path=hits.hits._source')
|
||||
t.equal(params.querystring, 'filter_path=hits.hits._source')
|
||||
return {
|
||||
body: {
|
||||
hits: {
|
||||
@ -50,7 +50,7 @@ test('Search should have an additional documents property', async t => {
|
||||
index: 'test',
|
||||
body: { foo: 'bar' }
|
||||
})
|
||||
t.deepEqual(result, [
|
||||
t.same(result, [
|
||||
{ one: 'one' },
|
||||
{ two: 'two' },
|
||||
{ three: 'three' }
|
||||
@ -60,7 +60,7 @@ test('Search should have an additional documents property', async t => {
|
||||
test('kGetHits fallback', async t => {
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.querystring, 'filter_path=hits.hits._source')
|
||||
t.equal(params.querystring, 'filter_path=hits.hits._source')
|
||||
return { body: {} }
|
||||
}
|
||||
})
|
||||
@ -74,13 +74,13 @@ test('kGetHits fallback', async t => {
|
||||
index: 'test',
|
||||
body: { foo: 'bar' }
|
||||
})
|
||||
t.deepEqual(result, [])
|
||||
t.same(result, [])
|
||||
})
|
||||
|
||||
test('Merge filter paths (snake_case)', async t => {
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.querystring, 'filter_path=foo%2Chits.hits._source')
|
||||
t.equal(params.querystring, 'filter_path=foo%2Chits.hits._source')
|
||||
return {
|
||||
body: {
|
||||
hits: {
|
||||
@ -105,7 +105,7 @@ test('Merge filter paths (snake_case)', async t => {
|
||||
filter_path: 'foo',
|
||||
body: { foo: 'bar' }
|
||||
})
|
||||
t.deepEqual(result, [
|
||||
t.same(result, [
|
||||
{ one: 'one' },
|
||||
{ two: 'two' },
|
||||
{ three: 'three' }
|
||||
@ -115,7 +115,7 @@ test('Merge filter paths (snake_case)', async t => {
|
||||
test('Merge filter paths (camelCase)', async t => {
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
t.strictEqual(params.querystring, 'filter_path=foo%2Chits.hits._source')
|
||||
t.equal(params.querystring, 'filter_path=foo%2Chits.hits._source')
|
||||
return {
|
||||
body: {
|
||||
hits: {
|
||||
@ -140,7 +140,7 @@ test('Merge filter paths (camelCase)', async t => {
|
||||
filterPath: 'foo',
|
||||
body: { foo: 'bar' }
|
||||
})
|
||||
t.deepEqual(result, [
|
||||
t.same(result, [
|
||||
{ one: 'one' },
|
||||
{ two: 'two' },
|
||||
{ three: 'three' }
|
||||
|
||||
@ -28,7 +28,7 @@ test('RoundRobinSelector', t => {
|
||||
|
||||
t.plan(arr.length + 1)
|
||||
for (let i = 0; i <= arr.length; i++) {
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
selector(arr),
|
||||
i === arr.length ? arr[0] : arr[i]
|
||||
)
|
||||
|
||||
@ -29,8 +29,8 @@ test('Basic', t => {
|
||||
const s = new Serializer()
|
||||
const obj = { hello: 'world' }
|
||||
const json = JSON.stringify(obj)
|
||||
t.strictEqual(s.serialize(obj), json)
|
||||
t.deepEqual(s.deserialize(json), obj)
|
||||
t.equal(s.serialize(obj), json)
|
||||
t.same(s.deserialize(json), obj)
|
||||
})
|
||||
|
||||
test('ndserialize', t => {
|
||||
@ -41,7 +41,7 @@ test('ndserialize', t => {
|
||||
{ winter: 'is coming' },
|
||||
{ you_know: 'for search' }
|
||||
]
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
s.ndserialize(obj),
|
||||
JSON.stringify(obj[0]) + '\n' +
|
||||
JSON.stringify(obj[1]) + '\n' +
|
||||
@ -57,7 +57,7 @@ test('ndserialize (strings)', t => {
|
||||
JSON.stringify({ winter: 'is coming' }),
|
||||
JSON.stringify({ you_know: 'for search' })
|
||||
]
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
s.ndserialize(obj),
|
||||
obj[0] + '\n' +
|
||||
obj[1] + '\n' +
|
||||
@ -73,7 +73,7 @@ test('qserialize', t => {
|
||||
you_know: 'for search'
|
||||
}
|
||||
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
s.qserialize(obj),
|
||||
stringify(obj)
|
||||
)
|
||||
@ -87,7 +87,7 @@ test('qserialize (array)', t => {
|
||||
arr: ['foo', 'bar']
|
||||
}
|
||||
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
s.qserialize(obj),
|
||||
'hello=world&arr=foo%2Cbar'
|
||||
)
|
||||
@ -101,7 +101,7 @@ test('qserialize (string)', t => {
|
||||
you_know: 'for search'
|
||||
}
|
||||
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
s.qserialize(stringify(obj)),
|
||||
stringify(obj)
|
||||
)
|
||||
@ -116,7 +116,7 @@ test('qserialize (key with undefined value)', t => {
|
||||
foo: 'bar'
|
||||
}
|
||||
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
s.qserialize(obj),
|
||||
'hello=world&foo=bar'
|
||||
)
|
||||
@ -157,3 +157,75 @@ test('DeserializationError', t => {
|
||||
t.ok(err instanceof DeserializationError)
|
||||
}
|
||||
})
|
||||
|
||||
test('prototype poisoning protection', t => {
|
||||
t.plan(2)
|
||||
const s = new Serializer()
|
||||
try {
|
||||
s.deserialize('{"__proto__":{"foo":"bar"}}')
|
||||
t.fail('Should fail')
|
||||
} catch (err) {
|
||||
t.ok(err instanceof DeserializationError)
|
||||
}
|
||||
|
||||
try {
|
||||
s.deserialize('{"constructor":{"prototype":{"foo":"bar"}}}')
|
||||
t.fail('Should fail')
|
||||
} catch (err) {
|
||||
t.ok(err instanceof DeserializationError)
|
||||
}
|
||||
})
|
||||
|
||||
test('disable prototype poisoning protection', t => {
|
||||
t.plan(2)
|
||||
const s = new Serializer({ disablePrototypePoisoningProtection: true })
|
||||
try {
|
||||
s.deserialize('{"__proto__":{"foo":"bar"}}')
|
||||
t.pass('Should not fail')
|
||||
} catch (err) {
|
||||
t.fail(err)
|
||||
}
|
||||
|
||||
try {
|
||||
s.deserialize('{"constructor":{"prototype":{"foo":"bar"}}}')
|
||||
t.pass('Should not fail')
|
||||
} catch (err) {
|
||||
t.fail(err)
|
||||
}
|
||||
})
|
||||
|
||||
test('disable prototype poisoning protection only for proto', t => {
|
||||
t.plan(2)
|
||||
const s = new Serializer({ disablePrototypePoisoningProtection: 'proto' })
|
||||
try {
|
||||
s.deserialize('{"__proto__":{"foo":"bar"}}')
|
||||
t.pass('Should not fail')
|
||||
} catch (err) {
|
||||
t.fail(err)
|
||||
}
|
||||
|
||||
try {
|
||||
s.deserialize('{"constructor":{"prototype":{"foo":"bar"}}}')
|
||||
t.fail('Should fail')
|
||||
} catch (err) {
|
||||
t.ok(err instanceof DeserializationError)
|
||||
}
|
||||
})
|
||||
|
||||
test('disable prototype poisoning protection only for constructor', t => {
|
||||
t.plan(2)
|
||||
const s = new Serializer({ disablePrototypePoisoningProtection: 'constructor' })
|
||||
try {
|
||||
s.deserialize('{"__proto__":{"foo":"bar"}}')
|
||||
t.fail('Should fail')
|
||||
} catch (err) {
|
||||
t.ok(err instanceof DeserializationError)
|
||||
}
|
||||
|
||||
try {
|
||||
s.deserialize('{"constructor":{"prototype":{"foo":"bar"}}}')
|
||||
t.pass('Should not fail')
|
||||
} catch (err) {
|
||||
t.fail(err)
|
||||
}
|
||||
})
|
||||
|
||||
@ -71,7 +71,7 @@ test('Basic', t => {
|
||||
path: '/hello'
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -99,7 +99,7 @@ test('Basic (promises support)', t => {
|
||||
path: '/hello'
|
||||
})
|
||||
.then(({ body }) => {
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
})
|
||||
.catch(t.fail)
|
||||
})
|
||||
@ -154,7 +154,7 @@ test('Basic (options + promises support)', t => {
|
||||
requestTimeout: 1000
|
||||
})
|
||||
.then(({ body }) => {
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
})
|
||||
.catch(t.fail)
|
||||
})
|
||||
@ -171,7 +171,7 @@ test('Send POST', t => {
|
||||
req.on('data', chunk => { json += chunk })
|
||||
req.on('error', err => t.fail(err))
|
||||
req.on('end', () => {
|
||||
t.deepEqual(JSON.parse(json), { hello: 'world' })
|
||||
t.same(JSON.parse(json), { hello: 'world' })
|
||||
res.setHeader('Content-Type', 'application/json;utf=8')
|
||||
res.end(JSON.stringify({ hello: 'world' }))
|
||||
})
|
||||
@ -197,7 +197,7 @@ test('Send POST', t => {
|
||||
body: { hello: 'world' }
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -222,7 +222,7 @@ test('Send POST (ndjson)', t => {
|
||||
req.on('data', chunk => { json += chunk })
|
||||
req.on('error', err => t.fail(err))
|
||||
req.on('end', () => {
|
||||
t.strictEqual(
|
||||
t.equal(
|
||||
json,
|
||||
JSON.stringify(bulkBody[0]) + '\n' +
|
||||
JSON.stringify(bulkBody[1]) + '\n' +
|
||||
@ -253,7 +253,7 @@ test('Send POST (ndjson)', t => {
|
||||
bulkBody
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -270,7 +270,7 @@ test('Send stream', t => {
|
||||
req.on('data', chunk => { json += chunk })
|
||||
req.on('error', err => t.fail(err))
|
||||
req.on('end', () => {
|
||||
t.deepEqual(JSON.parse(json), { hello: 'world' })
|
||||
t.same(JSON.parse(json), { hello: 'world' })
|
||||
res.setHeader('Content-Type', 'application/json;utf=8')
|
||||
res.end(JSON.stringify({ hello: 'world' }))
|
||||
})
|
||||
@ -296,7 +296,7 @@ test('Send stream', t => {
|
||||
body: intoStream(JSON.stringify({ hello: 'world' }))
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -313,7 +313,7 @@ test('Send stream (bulkBody)', t => {
|
||||
req.on('data', chunk => { json += chunk })
|
||||
req.on('error', err => t.fail(err))
|
||||
req.on('end', () => {
|
||||
t.deepEqual(JSON.parse(json), { hello: 'world' })
|
||||
t.same(JSON.parse(json), { hello: 'world' })
|
||||
res.setHeader('Content-Type', 'application/json;utf=8')
|
||||
res.end(JSON.stringify({ hello: 'world' }))
|
||||
})
|
||||
@ -339,7 +339,7 @@ test('Send stream (bulkBody)', t => {
|
||||
bulkBody: intoStream(JSON.stringify({ hello: 'world' }))
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -371,7 +371,7 @@ test('Not JSON payload from server', t => {
|
||||
path: '/hello'
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(body, 'hello!')
|
||||
t.equal(body, 'hello!')
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -391,8 +391,8 @@ test('NoLivingConnectionsError (null connection)', t => {
|
||||
sniffInterval: false,
|
||||
sniffOnStart: false,
|
||||
nodeSelector (connections) {
|
||||
t.is(connections.length, 1)
|
||||
t.true(connections[0] instanceof Connection)
|
||||
t.equal(connections.length, 1)
|
||||
t.ok(connections[0] instanceof Connection)
|
||||
return null
|
||||
}
|
||||
})
|
||||
@ -419,8 +419,8 @@ test('NoLivingConnectionsError (undefined connection)', t => {
|
||||
sniffInterval: false,
|
||||
sniffOnStart: false,
|
||||
nodeSelector (connections) {
|
||||
t.is(connections.length, 1)
|
||||
t.true(connections[0] instanceof Connection)
|
||||
t.equal(connections.length, 1)
|
||||
t.ok(connections[0] instanceof Connection)
|
||||
return undefined
|
||||
}
|
||||
})
|
||||
@ -521,7 +521,7 @@ test('TimeoutError (should call markDead on the failing connection)', t => {
|
||||
|
||||
class CustomConnectionPool extends ConnectionPool {
|
||||
markDead (connection) {
|
||||
t.strictEqual(connection.id, 'node1')
|
||||
t.equal(connection.id, 'node1')
|
||||
super.markDead(connection)
|
||||
}
|
||||
}
|
||||
@ -555,7 +555,7 @@ test('ConnectionError (should call markDead on the failing connection)', t => {
|
||||
|
||||
class CustomConnectionPool extends ConnectionPool {
|
||||
markDead (connection) {
|
||||
t.strictEqual(connection.id, 'node1')
|
||||
t.equal(connection.id, 'node1')
|
||||
super.markDead(connection)
|
||||
}
|
||||
}
|
||||
@ -626,7 +626,7 @@ test('Retry mechanism', t => {
|
||||
path: '/hello'
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -671,7 +671,7 @@ test('Should not retry if the body is a stream', t => {
|
||||
body: intoStream(JSON.stringify({ hello: 'world' }))
|
||||
}, (err, { body }) => {
|
||||
t.ok(err instanceof ResponseError)
|
||||
t.strictEqual(count, 1)
|
||||
t.equal(count, 1)
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -716,7 +716,7 @@ test('Should not retry if the bulkBody is a stream', t => {
|
||||
bulkBody: intoStream(JSON.stringify([{ hello: 'world' }]))
|
||||
}, (err, { body }) => {
|
||||
t.ok(err instanceof ResponseError)
|
||||
t.strictEqual(count, 1)
|
||||
t.equal(count, 1)
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -763,7 +763,7 @@ test('No retry', t => {
|
||||
maxRetries: 0
|
||||
}, (err, { body }) => {
|
||||
t.ok(err instanceof ResponseError)
|
||||
t.strictEqual(count, 1)
|
||||
t.equal(count, 1)
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -813,7 +813,7 @@ test('Custom retry mechanism', t => {
|
||||
maxRetries: 1
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -824,7 +824,7 @@ test('Should not retry on 429', t => {
|
||||
|
||||
let count = 0
|
||||
function handler (req, res) {
|
||||
t.strictEqual(count++, 0)
|
||||
t.equal(count++, 0)
|
||||
res.statusCode = 429
|
||||
res.setHeader('Content-Type', 'application/json;utf=8')
|
||||
res.end(JSON.stringify({ hello: 'world' }))
|
||||
@ -858,7 +858,7 @@ test('Should not retry on 429', t => {
|
||||
path: '/hello'
|
||||
}, (err, result) => {
|
||||
t.ok(err)
|
||||
t.strictEqual(err.statusCode, 429)
|
||||
t.equal(err.statusCode, 429)
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -869,7 +869,7 @@ test('Should call markAlive with a successful response', t => {
|
||||
|
||||
class CustomConnectionPool extends ConnectionPool {
|
||||
markAlive (connection) {
|
||||
t.strictEqual(connection.id, 'node1')
|
||||
t.equal(connection.id, 'node1')
|
||||
super.markAlive(connection)
|
||||
}
|
||||
}
|
||||
@ -895,7 +895,7 @@ test('Should call markAlive with a successful response', t => {
|
||||
path: '/hello'
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
})
|
||||
})
|
||||
|
||||
@ -932,7 +932,7 @@ test('Should call resurrect on every request', t => {
|
||||
path: '/hello'
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
})
|
||||
})
|
||||
|
||||
@ -1076,8 +1076,8 @@ test('ResponseError', t => {
|
||||
path: '/hello'
|
||||
}, (err, { body }) => {
|
||||
t.ok(err instanceof ResponseError)
|
||||
t.deepEqual(err.body, { status: 500 })
|
||||
t.strictEqual(err.statusCode, 500)
|
||||
t.same(err.body, { status: 500 })
|
||||
t.equal(err.statusCode, 500)
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -1113,7 +1113,7 @@ test('Override requestTimeout', t => {
|
||||
requestTimeout: 2000
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -1125,7 +1125,7 @@ test('sniff', t => {
|
||||
|
||||
class MyTransport extends Transport {
|
||||
sniff (opts) {
|
||||
t.strictEqual(opts.reason, Transport.sniffReasons.SNIFF_ON_START)
|
||||
t.equal(opts.reason, Transport.sniffReasons.SNIFF_ON_START)
|
||||
}
|
||||
}
|
||||
|
||||
@ -1150,7 +1150,7 @@ test('sniff', t => {
|
||||
|
||||
class MyTransport extends Transport {
|
||||
sniff (opts) {
|
||||
t.strictEqual(opts.reason, Transport.sniffReasons.SNIFF_ON_CONNECTION_FAULT)
|
||||
t.equal(opts.reason, Transport.sniffReasons.SNIFF_ON_CONNECTION_FAULT)
|
||||
}
|
||||
}
|
||||
|
||||
@ -1184,7 +1184,7 @@ test('sniff', t => {
|
||||
|
||||
class MyTransport extends Transport {
|
||||
sniff (opts) {
|
||||
t.strictEqual(opts.reason, Transport.sniffReasons.SNIFF_INTERVAL)
|
||||
t.equal(opts.reason, Transport.sniffReasons.SNIFF_INTERVAL)
|
||||
}
|
||||
}
|
||||
|
||||
@ -1329,7 +1329,7 @@ test('Should retry the request if the statusCode is 502/3/4', t => {
|
||||
path: '/hello'
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -1362,7 +1362,7 @@ test('Ignore status code', t => {
|
||||
ignore: [404]
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
})
|
||||
|
||||
transport.request({
|
||||
@ -1386,7 +1386,7 @@ test('Should serialize the querystring', t => {
|
||||
t.plan(2)
|
||||
|
||||
function handler (req, res) {
|
||||
t.strictEqual(req.url, '/hello?hello=world&you_know=for%20search')
|
||||
t.equal(req.url, '/hello?hello=world&you_know=for%20search')
|
||||
res.end('ok')
|
||||
}
|
||||
|
||||
@ -1582,8 +1582,8 @@ test('Should cast to boolean HEAD request', t => {
|
||||
path: '/200'
|
||||
}, (err, { body, statusCode }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(statusCode, 200)
|
||||
t.strictEqual(body, true)
|
||||
t.equal(statusCode, 200)
|
||||
t.equal(body, true)
|
||||
})
|
||||
})
|
||||
|
||||
@ -1607,13 +1607,13 @@ test('Should cast to boolean HEAD request', t => {
|
||||
path: '/404'
|
||||
}, (err, { body, statusCode }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(statusCode, 404)
|
||||
t.strictEqual(body, false)
|
||||
t.equal(statusCode, 404)
|
||||
t.equal(body, false)
|
||||
})
|
||||
})
|
||||
|
||||
t.test('4xx response', t => {
|
||||
t.plan(2)
|
||||
t.plan(3)
|
||||
|
||||
const pool = new ConnectionPool({ Connection: MockConnection })
|
||||
pool.addConnection('http://localhost:9200')
|
||||
@ -1633,12 +1633,13 @@ test('Should cast to boolean HEAD request', t => {
|
||||
path: '/400'
|
||||
}, (err, { body, statusCode }) => {
|
||||
t.ok(err instanceof ResponseError)
|
||||
t.strictEqual(statusCode, 400)
|
||||
t.notOk(typeof err.body === 'boolean')
|
||||
t.equal(statusCode, 400)
|
||||
})
|
||||
})
|
||||
|
||||
t.test('5xx response', t => {
|
||||
t.plan(2)
|
||||
t.plan(3)
|
||||
const pool = new ConnectionPool({ Connection: MockConnection })
|
||||
pool.addConnection('http://localhost:9200')
|
||||
|
||||
@ -1657,7 +1658,8 @@ test('Should cast to boolean HEAD request', t => {
|
||||
path: '/500'
|
||||
}, (err, { body, statusCode }) => {
|
||||
t.ok(err instanceof ResponseError)
|
||||
t.strictEqual(statusCode, 500)
|
||||
t.notOk(typeof err.body === 'boolean')
|
||||
t.equal(statusCode, 500)
|
||||
})
|
||||
})
|
||||
|
||||
@ -1698,7 +1700,7 @@ test('Suggest compression', t => {
|
||||
path: '/hello'
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -1773,7 +1775,7 @@ test('Warning header', t => {
|
||||
path: '/hello'
|
||||
}, (err, { warnings }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(warnings, [warn])
|
||||
t.same(warnings, [warn])
|
||||
warnings.forEach(w => t.type(w, 'string'))
|
||||
server.stop()
|
||||
})
|
||||
@ -1810,7 +1812,7 @@ test('Warning header', t => {
|
||||
path: '/hello'
|
||||
}, (err, { warnings }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(warnings, [warn1, warn2])
|
||||
t.same(warnings, [warn1, warn2])
|
||||
warnings.forEach(w => t.type(w, 'string'))
|
||||
server.stop()
|
||||
})
|
||||
@ -1844,7 +1846,7 @@ test('Warning header', t => {
|
||||
path: '/hello'
|
||||
}, (err, { warnings }) => {
|
||||
t.error(err)
|
||||
t.strictEqual(warnings, null)
|
||||
t.equal(warnings, null)
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -1891,7 +1893,7 @@ test('asStream set to true', t => {
|
||||
body.on('data', chunk => { payload += chunk })
|
||||
body.on('error', err => t.fail(err))
|
||||
body.on('end', () => {
|
||||
t.deepEqual(JSON.parse(payload), { hello: 'world' })
|
||||
t.same(JSON.parse(payload), { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -1912,7 +1914,7 @@ test('Compress request', t => {
|
||||
.on('data', chunk => { json += chunk })
|
||||
.on('error', err => t.fail(err))
|
||||
.on('end', () => {
|
||||
t.deepEqual(JSON.parse(json), { you_know: 'for search' })
|
||||
t.same(JSON.parse(json), { you_know: 'for search' })
|
||||
res.setHeader('Content-Type', 'application/json;utf=8')
|
||||
res.end(JSON.stringify({ you_know: 'for search' }))
|
||||
})
|
||||
@ -1940,7 +1942,7 @@ test('Compress request', t => {
|
||||
compression: 'gzip'
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { you_know: 'for search' })
|
||||
t.same(body, { you_know: 'for search' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -1959,7 +1961,7 @@ test('Compress request', t => {
|
||||
.on('data', chunk => { json += chunk })
|
||||
.on('error', err => t.fail(err))
|
||||
.on('end', () => {
|
||||
t.deepEqual(JSON.parse(json), { you_know: 'for search' })
|
||||
t.same(JSON.parse(json), { you_know: 'for search' })
|
||||
res.setHeader('Content-Type', 'application/json;utf=8')
|
||||
res.end(JSON.stringify({ you_know: 'for search' }))
|
||||
})
|
||||
@ -1986,7 +1988,7 @@ test('Compress request', t => {
|
||||
body: { you_know: 'for search' }
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { you_know: 'for search' })
|
||||
t.same(body, { you_know: 'for search' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -2005,7 +2007,7 @@ test('Compress request', t => {
|
||||
.on('data', chunk => { json += chunk })
|
||||
.on('error', err => t.fail(err))
|
||||
.on('end', () => {
|
||||
t.deepEqual(JSON.parse(json), { you_know: 'for search' })
|
||||
t.same(JSON.parse(json), { you_know: 'for search' })
|
||||
res.setHeader('Content-Type', 'application/json;utf=8')
|
||||
res.end(JSON.stringify({ you_know: 'for search' }))
|
||||
})
|
||||
@ -2033,7 +2035,7 @@ test('Compress request', t => {
|
||||
compression: 'gzip'
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { you_know: 'for search' })
|
||||
t.same(body, { you_know: 'for search' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -2055,8 +2057,8 @@ test('Compress request', t => {
|
||||
})
|
||||
t.fail('Should throw')
|
||||
} catch (err) {
|
||||
t.true(err instanceof ConfigurationError)
|
||||
t.is(err.message, 'Invalid compression: \'deflate\'')
|
||||
t.ok(err instanceof ConfigurationError)
|
||||
t.equal(err.message, 'Invalid compression: \'deflate\'')
|
||||
}
|
||||
})
|
||||
|
||||
@ -2064,8 +2066,8 @@ test('Compress request', t => {
|
||||
t.plan(9)
|
||||
|
||||
function handler (req, res) {
|
||||
t.strictEqual(req.headers['content-encoding'], undefined)
|
||||
t.strictEqual(req.headers['content-type'], undefined)
|
||||
t.equal(req.headers['content-encoding'], undefined)
|
||||
t.equal(req.headers['content-type'], undefined)
|
||||
res.end()
|
||||
}
|
||||
|
||||
@ -2124,7 +2126,7 @@ test('Compress request', t => {
|
||||
.on('data', chunk => { json += chunk })
|
||||
.on('error', err => t.fail(err))
|
||||
.on('end', () => {
|
||||
t.deepEqual(JSON.parse(json), { you_know: 'for search' })
|
||||
t.same(JSON.parse(json), { you_know: 'for search' })
|
||||
res.setHeader('Content-Type', 'application/json;utf=8')
|
||||
if (count++ > 0) {
|
||||
res.end(JSON.stringify({ you_know: 'for search' }))
|
||||
@ -2158,8 +2160,8 @@ test('Compress request', t => {
|
||||
compression: 'gzip'
|
||||
}, (err, { body, meta }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { you_know: 'for search' })
|
||||
t.strictEqual(count, 2)
|
||||
t.same(body, { you_know: 'for search' })
|
||||
t.equal(count, 2)
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -2199,7 +2201,7 @@ test('Headers configuration', t => {
|
||||
path: '/hello'
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -2240,7 +2242,7 @@ test('Headers configuration', t => {
|
||||
headers: { 'x-baz': 'faz' }
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -2278,7 +2280,7 @@ test('Headers configuration', t => {
|
||||
headers: { 'x-foo': 'faz' }
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -2316,7 +2318,7 @@ test('nodeFilter and nodeSelector', t => {
|
||||
path: '/hello'
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
})
|
||||
})
|
||||
|
||||
@ -2325,7 +2327,7 @@ test('Should accept custom querystring in the optons object', t => {
|
||||
t.plan(3)
|
||||
|
||||
function handler (req, res) {
|
||||
t.strictEqual(req.url, '/hello?foo=bar')
|
||||
t.equal(req.url, '/hello?foo=bar')
|
||||
res.setHeader('Content-Type', 'application/json;utf=8')
|
||||
res.end(JSON.stringify({ hello: 'world' }))
|
||||
}
|
||||
@ -2351,7 +2353,7 @@ test('Should accept custom querystring in the optons object', t => {
|
||||
querystring: { foo: 'bar' }
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -2361,7 +2363,7 @@ test('Should accept custom querystring in the optons object', t => {
|
||||
t.plan(3)
|
||||
|
||||
function handler (req, res) {
|
||||
t.strictEqual(req.url, '/hello?baz=faz&foo=bar')
|
||||
t.equal(req.url, '/hello?baz=faz&foo=bar')
|
||||
res.setHeader('Content-Type', 'application/json;utf=8')
|
||||
res.end(JSON.stringify({ hello: 'world' }))
|
||||
}
|
||||
@ -2388,7 +2390,7 @@ test('Should accept custom querystring in the optons object', t => {
|
||||
querystring: { foo: 'bar' }
|
||||
}, (err, { body }) => {
|
||||
t.error(err)
|
||||
t.deepEqual(body, { hello: 'world' })
|
||||
t.same(body, { hello: 'world' })
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -2452,8 +2454,8 @@ test('Should pass request params and options to generateRequestId', t => {
|
||||
sniffInterval: false,
|
||||
sniffOnStart: false,
|
||||
generateRequestId: function (requestParams, requestOptions) {
|
||||
t.deepEqual(requestParams, params)
|
||||
t.deepEqual(requestOptions, options)
|
||||
t.same(requestParams, params)
|
||||
t.same(requestOptions, options)
|
||||
return 'id'
|
||||
}
|
||||
})
|
||||
@ -2487,8 +2489,8 @@ test('Secure json parsing', t => {
|
||||
method: 'GET',
|
||||
path: '/hello'
|
||||
}, (err, { body }) => {
|
||||
t.true(err instanceof DeserializationError)
|
||||
t.is(err.message, 'Object contains forbidden prototype property')
|
||||
t.ok(err instanceof DeserializationError)
|
||||
t.equal(err.message, 'Object contains forbidden prototype property')
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -2519,8 +2521,8 @@ test('Secure json parsing', t => {
|
||||
method: 'GET',
|
||||
path: '/hello'
|
||||
}, (err, { body }) => {
|
||||
t.true(err instanceof DeserializationError)
|
||||
t.is(err.message, 'Object contains forbidden prototype property')
|
||||
t.ok(err instanceof DeserializationError)
|
||||
t.equal(err.message, 'Object contains forbidden prototype property')
|
||||
server.stop()
|
||||
})
|
||||
})
|
||||
@ -2533,7 +2535,7 @@ test('Lowercase headers utilty', t => {
|
||||
t.plan(4)
|
||||
const { lowerCaseHeaders } = Transport.internals
|
||||
|
||||
t.deepEqual(lowerCaseHeaders({
|
||||
t.same(lowerCaseHeaders({
|
||||
Foo: 'bar',
|
||||
Faz: 'baz',
|
||||
'X-Hello': 'world'
|
||||
@ -2543,7 +2545,7 @@ test('Lowercase headers utilty', t => {
|
||||
'x-hello': 'world'
|
||||
})
|
||||
|
||||
t.deepEqual(lowerCaseHeaders({
|
||||
t.same(lowerCaseHeaders({
|
||||
Foo: 'bar',
|
||||
faz: 'baz',
|
||||
'X-hello': 'world'
|
||||
@ -2553,9 +2555,9 @@ test('Lowercase headers utilty', t => {
|
||||
'x-hello': 'world'
|
||||
})
|
||||
|
||||
t.strictEqual(lowerCaseHeaders(null), null)
|
||||
t.equal(lowerCaseHeaders(null), null)
|
||||
|
||||
t.strictEqual(lowerCaseHeaders(undefined), undefined)
|
||||
t.equal(lowerCaseHeaders(undefined), undefined)
|
||||
})
|
||||
|
||||
test('The callback with a sync error should be called in the next tick - json', t => {
|
||||
|
||||
Reference in New Issue
Block a user