Compare commits
15 Commits
no-roles
...
v9.0.0-alp
| Author | SHA1 | Date | |
|---|---|---|---|
| dea4db1736 | |||
| d5bd34fc23 | |||
| b2a490718d | |||
| e8dc747c61 | |||
| c5f9625463 | |||
| a9a5aca736 | |||
| 64ef5359e7 | |||
| 1abb4e3c9f | |||
| d9e9906c4e | |||
| 1519963dd9 | |||
| 867ceda5a3 | |||
| 88270bf354 | |||
| 0f09faefbd | |||
| b775456296 | |||
| 9de4dc5009 |
@ -12,5 +12,3 @@ WORKDIR /usr/src/app
|
||||
|
||||
COPY package.json .
|
||||
RUN npm install
|
||||
|
||||
COPY . .
|
||||
|
||||
@ -25,6 +25,3 @@ USER ${BUILDER_UID}:${BUILDER_GID}
|
||||
# install dependencies
|
||||
COPY package.json .
|
||||
RUN npm install
|
||||
|
||||
# copy project files
|
||||
COPY . .
|
||||
|
||||
4
.github/workflows/nodejs.yml
vendored
4
.github/workflows/nodejs.yml
vendored
@ -41,7 +41,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
|
||||
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
@ -71,7 +71,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
|
||||
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
|
||||
with:
|
||||
node-version: 22.x
|
||||
|
||||
|
||||
2
.github/workflows/npm-publish.yml
vendored
2
.github/workflows/npm-publish.yml
vendored
@ -16,7 +16,7 @@ jobs:
|
||||
with:
|
||||
persist-credentials: false
|
||||
ref: ${{ github.event.inputs.branch }}
|
||||
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
|
||||
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
|
||||
with:
|
||||
node-version: "22.x"
|
||||
registry-url: "https://registry.npmjs.org"
|
||||
|
||||
@ -3,17 +3,11 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "POST",
|
||||
path: "/_query/async",
|
||||
querystring: {
|
||||
format: "json",
|
||||
},
|
||||
body: {
|
||||
query:
|
||||
"\n FROM my-index-000001,cluster_one:my-index-000001,cluster_two:my-index*\n | STATS COUNT(http.response.status_code) BY user.id\n | LIMIT 2\n ",
|
||||
include_ccs_metadata: true,
|
||||
},
|
||||
const response = await client.esql.asyncQuery({
|
||||
format: "json",
|
||||
query:
|
||||
"\n FROM my-index-000001,cluster_one:my-index-000001,cluster_two:my-index*\n | STATS COUNT(http.response.status_code) BY user.id\n | LIMIT 2\n ",
|
||||
include_ccs_metadata: true,
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
@ -3,23 +3,20 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "POST",
|
||||
path: "/_application/search_application/my-app/_render_query",
|
||||
body: {
|
||||
params: {
|
||||
query_string: "my first query",
|
||||
text_fields: [
|
||||
{
|
||||
name: "title",
|
||||
boost: 5,
|
||||
},
|
||||
{
|
||||
name: "description",
|
||||
boost: 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
const response = await client.searchApplication.renderQuery({
|
||||
name: "my-app",
|
||||
params: {
|
||||
query_string: "my first query",
|
||||
text_fields: [
|
||||
{
|
||||
name: "title",
|
||||
boost: 5,
|
||||
},
|
||||
{
|
||||
name: "description",
|
||||
boost: 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
|
||||
@ -3,18 +3,16 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "POST",
|
||||
path: "/_inference/chat_completion/openai-completion/_stream",
|
||||
body: {
|
||||
model: "gpt-4o",
|
||||
messages: [
|
||||
{
|
||||
role: "user",
|
||||
content: "What is Elastic?",
|
||||
},
|
||||
],
|
||||
},
|
||||
const response = await client.inference.streamInference({
|
||||
task_type: "chat_completion",
|
||||
inference_id: "openai-completion",
|
||||
model: "gpt-4o",
|
||||
messages: [
|
||||
{
|
||||
role: "user",
|
||||
content: "What is Elastic?",
|
||||
},
|
||||
],
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
25
docs/doc_examples/13d91782399ba1f291e103c18b5338cc.asciidoc
Normal file
25
docs/doc_examples/13d91782399ba1f291e103c18b5338cc.asciidoc
Normal file
@ -0,0 +1,25 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.createFrom({
|
||||
source: "my-index",
|
||||
dest: "my-new-index",
|
||||
create_from: {
|
||||
settings_override: {
|
||||
index: {
|
||||
number_of_shards: 5,
|
||||
},
|
||||
},
|
||||
mappings_override: {
|
||||
properties: {
|
||||
field2: {
|
||||
type: "boolean",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
10
docs/doc_examples/15ac33d641b376d9494075eb1f0d4066.asciidoc
Normal file
10
docs/doc_examples/15ac33d641b376d9494075eb1f0d4066.asciidoc
Normal file
@ -0,0 +1,10 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.cancelMigrateReindex({
|
||||
index: "my-data-stream",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
12
docs/doc_examples/174b93c323aa8e9cc8ee2a3df5736810.asciidoc
Normal file
12
docs/doc_examples/174b93c323aa8e9cc8ee2a3df5736810.asciidoc
Normal file
@ -0,0 +1,12 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.security.delegatePki({
|
||||
x509_certificate_chain: [
|
||||
"MIIDeDCCAmCgAwIBAgIUBzj/nGGKxP2iXawsSquHmQjCJmMwDQYJKoZIhvcNAQELBQAwUzErMCkGA1UEAxMiRWxhc3RpY3NlYXJjaCBUZXN0IEludGVybWVkaWF0ZSBDQTEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMB4XDTIzMDcxODE5MjkwNloXDTQzMDcxMzE5MjkwNlowSjEiMCAGA1UEAxMZRWxhc3RpY3NlYXJjaCBUZXN0IENsaWVudDEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAllHL4pQkkfwAm/oLkxYYO+r950DEy1bjH+4viCHzNADLCTWO+lOZJVlNx7QEzJE3QGMdif9CCBBxQFMapA7oUFCLq84fPSQQu5AnvvbltVD9nwVtCs+9ZGDjMKsz98RhSLMFIkxdxi6HkQ3Lfa4ZSI4lvba4oo+T/GveazBDS+NgmKyq00EOXt3tWi1G9vEVItommzXWfv0agJWzVnLMldwkPqsw0W7zrpyT7FZS4iLbQADGceOW8fiauOGMkscu9zAnDR/SbWl/chYioQOdw6ndFLn1YIFPd37xL0WsdsldTpn0vH3YfzgLMffT/3P6YlwBegWzsx6FnM/93Ecb4wIDAQABo00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBQKNRwjW+Ad/FN1Rpoqme/5+jrFWzAfBgNVHSMEGDAWgBRcya0c0x/PaI7MbmJVIylWgLqXNjANBgkqhkiG9w0BAQsFAAOCAQEACZ3PF7Uqu47lplXHP6YlzYL2jL0D28hpj5lGtdha4Muw1m/BjDb0Pu8l0NQ1z3AP6AVcvjNDkQq6Y5jeSz0bwQlealQpYfo7EMXjOidrft1GbqOMFmTBLpLA9SvwYGobSTXWTkJzonqVaTcf80HpMgM2uEhodwTcvz6v1WEfeT/HMjmdIsq4ImrOL9RNrcZG6nWfw0HR3JNOgrbfyEztEI471jHznZ336OEcyX7gQuvHE8tOv5+oD1d7s3Xg1yuFp+Ynh+FfOi3hPCuaHA+7F6fLmzMDLVUBAllugst1C3U+L/paD7tqIa4ka+KNPCbSfwazmJrt4XNiivPR4hwH5g==",
|
||||
],
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -3,27 +3,23 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "POST",
|
||||
path: "/_ingest/_simulate",
|
||||
body: {
|
||||
docs: [
|
||||
{
|
||||
_index: "my-index",
|
||||
_id: "123",
|
||||
_source: {
|
||||
foo: "bar",
|
||||
},
|
||||
const response = await client.simulate.ingest({
|
||||
docs: [
|
||||
{
|
||||
_index: "my-index",
|
||||
_id: "123",
|
||||
_source: {
|
||||
foo: "bar",
|
||||
},
|
||||
{
|
||||
_index: "my-index",
|
||||
_id: "456",
|
||||
_source: {
|
||||
foo: "rab",
|
||||
},
|
||||
},
|
||||
{
|
||||
_index: "my-index",
|
||||
_id: "456",
|
||||
_source: {
|
||||
foo: "rab",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
15
docs/doc_examples/29aeabacb1fdf5b083d5f091b6d1bd44.asciidoc
Normal file
15
docs/doc_examples/29aeabacb1fdf5b083d5f091b6d1bd44.asciidoc
Normal file
@ -0,0 +1,15 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.migrateReindex({
|
||||
reindex: {
|
||||
source: {
|
||||
index: "my-data-stream",
|
||||
},
|
||||
mode: "upgrade",
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -3,14 +3,10 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "POST",
|
||||
path: "/_security/oidc/logout",
|
||||
body: {
|
||||
token:
|
||||
"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==",
|
||||
refresh_token: "vLBPvmAB6KvwvJZr27cS",
|
||||
},
|
||||
const response = await client.security.oidcLogout({
|
||||
token:
|
||||
"dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==",
|
||||
refresh_token: "vLBPvmAB6KvwvJZr27cS",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
@ -3,12 +3,9 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "GET",
|
||||
path: "/_query/async/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=",
|
||||
querystring: {
|
||||
wait_for_completion_timeout: "30s",
|
||||
},
|
||||
const response = await client.esql.asyncQueryGet({
|
||||
id: "FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=",
|
||||
wait_for_completion_timeout: "30s",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
22
docs/doc_examples/2f9ee29fe49f7d206a41212aa5945296.asciidoc
Normal file
22
docs/doc_examples/2f9ee29fe49f7d206a41212aa5945296.asciidoc
Normal file
@ -0,0 +1,22 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.createFrom({
|
||||
source: "my-index",
|
||||
dest: "my-new-index",
|
||||
create_from: {
|
||||
settings_override: {
|
||||
index: {
|
||||
"blocks.write": null,
|
||||
"blocks.read": null,
|
||||
"blocks.read_only": null,
|
||||
"blocks.read_only_allow_delete": null,
|
||||
"blocks.metadata": null,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
21
docs/doc_examples/3649194a97d265a3bc758f8b38f7561e.asciidoc
Normal file
21
docs/doc_examples/3649194a97d265a3bc758f8b38f7561e.asciidoc
Normal file
@ -0,0 +1,21 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: "semantic-embeddings",
|
||||
mappings: {
|
||||
properties: {
|
||||
semantic_text: {
|
||||
type: "semantic_text",
|
||||
},
|
||||
content: {
|
||||
type: "text",
|
||||
copy_to: "semantic_text",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -3,14 +3,10 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "POST",
|
||||
path: "/_query/async",
|
||||
body: {
|
||||
query:
|
||||
"\n FROM library\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\n | STATS MAX(page_count) BY year\n | SORT year\n | LIMIT 5\n ",
|
||||
wait_for_completion_timeout: "2s",
|
||||
},
|
||||
const response = await client.esql.asyncQuery({
|
||||
query:
|
||||
"\n FROM library\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\n | STATS MAX(page_count) BY year\n | SORT year\n | LIMIT 5\n ",
|
||||
wait_for_completion_timeout: "2s",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
@ -3,9 +3,8 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "GET",
|
||||
path: "/_query/async/FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=",
|
||||
const response = await client.esql.asyncQueryGet({
|
||||
id: "FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
@ -3,43 +3,41 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "POST",
|
||||
path: "/_inference/chat_completion/openai-completion/_stream",
|
||||
body: {
|
||||
messages: [
|
||||
{
|
||||
role: "user",
|
||||
content: [
|
||||
{
|
||||
type: "text",
|
||||
text: "What's the price of a scarf?",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
tools: [
|
||||
{
|
||||
type: "function",
|
||||
function: {
|
||||
name: "get_current_price",
|
||||
description: "Get the current price of a item",
|
||||
parameters: {
|
||||
type: "object",
|
||||
properties: {
|
||||
item: {
|
||||
id: "123",
|
||||
},
|
||||
const response = await client.inference.streamInference({
|
||||
task_type: "chat_completion",
|
||||
inference_id: "openai-completion",
|
||||
messages: [
|
||||
{
|
||||
role: "user",
|
||||
content: [
|
||||
{
|
||||
type: "text",
|
||||
text: "What's the price of a scarf?",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
tools: [
|
||||
{
|
||||
type: "function",
|
||||
function: {
|
||||
name: "get_current_price",
|
||||
description: "Get the current price of a item",
|
||||
parameters: {
|
||||
type: "object",
|
||||
properties: {
|
||||
item: {
|
||||
id: "123",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
tool_choice: {
|
||||
type: "function",
|
||||
function: {
|
||||
name: "get_current_price",
|
||||
},
|
||||
},
|
||||
],
|
||||
tool_choice: {
|
||||
type: "function",
|
||||
function: {
|
||||
name: "get_current_price",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
10
docs/doc_examples/46b771a9932c3fa6057a7b2679c72ef0.asciidoc
Normal file
10
docs/doc_examples/46b771a9932c3fa6057a7b2679c72ef0.asciidoc
Normal file
@ -0,0 +1,10 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.getMigrateReindexStatus({
|
||||
index: "my-data-stream",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -6,6 +6,11 @@
|
||||
const response = await client.ml.startTrainedModelDeployment({
|
||||
model_id: "my_model",
|
||||
deployment_id: "my_model_for_search",
|
||||
adaptive_allocations: {
|
||||
enabled: true,
|
||||
min_number_of_allocations: 3,
|
||||
max_number_of_allocations: 10,
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
@ -3,12 +3,10 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "POST",
|
||||
path: "/_inference/completion/openai-completion/_stream",
|
||||
body: {
|
||||
input: "What is Elastic?",
|
||||
},
|
||||
const response = await client.inference.streamInference({
|
||||
task_type: "completion",
|
||||
inference_id: "openai-completion",
|
||||
input: "What is Elastic?",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
@ -3,14 +3,10 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "POST",
|
||||
path: "/_security/oidc/prepare",
|
||||
body: {
|
||||
realm: "oidc1",
|
||||
state: "lGYK0EcSLjqH6pkT5EVZjC6eIW5YCGgywj2sxROO",
|
||||
nonce: "zOBXLJGUooRrbLbQk5YCcyC8AXw3iloynvluYhZ5",
|
||||
},
|
||||
const response = await client.security.oidcPrepareAuthentication({
|
||||
realm: "oidc1",
|
||||
state: "lGYK0EcSLjqH6pkT5EVZjC6eIW5YCGgywj2sxROO",
|
||||
nonce: "zOBXLJGUooRrbLbQk5YCcyC8AXw3iloynvluYhZ5",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
@ -3,17 +3,11 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "POST",
|
||||
path: "/_query/async",
|
||||
querystring: {
|
||||
format: "json",
|
||||
},
|
||||
body: {
|
||||
query:
|
||||
"\n FROM cluster_one:my-index*,cluster_two:logs*\n | STATS COUNT(http.response.status_code) BY user.id\n | LIMIT 2\n ",
|
||||
include_ccs_metadata: true,
|
||||
},
|
||||
const response = await client.esql.asyncQuery({
|
||||
format: "json",
|
||||
query:
|
||||
"\n FROM cluster_one:my-index*,cluster_two:logs*\n | STATS COUNT(http.response.status_code) BY user.id\n | LIMIT 2\n ",
|
||||
include_ccs_metadata: true,
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
11
docs/doc_examples/615dc36f0978c676624fb7d1144b4899.asciidoc
Normal file
11
docs/doc_examples/615dc36f0978c676624fb7d1144b4899.asciidoc
Normal file
@ -0,0 +1,11 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.getDataLifecycleStats({
|
||||
human: "true",
|
||||
pretty: "true",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
12
docs/doc_examples/66915e95b723ee2f6e5164a94b8f98c1.asciidoc
Normal file
12
docs/doc_examples/66915e95b723ee2f6e5164a94b8f98c1.asciidoc
Normal file
@ -0,0 +1,12 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.createFrom({
|
||||
source: "my-index",
|
||||
dest: "my-new-index",
|
||||
create_from: null,
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
10
docs/doc_examples/67b71a95b6fe6c83faae51ea038a1bf1.asciidoc
Normal file
10
docs/doc_examples/67b71a95b6fe6c83faae51ea038a1bf1.asciidoc
Normal file
@ -0,0 +1,10 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.esql.asyncQueryDelete({
|
||||
id: "FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -3,12 +3,8 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "POST",
|
||||
path: "/_security/api_key/_bulk_update",
|
||||
body: {
|
||||
ids: ["VuaCfGcBCdbkQm-e5aOx", "H3_AhoIBA9hmeQJdg7ij"],
|
||||
},
|
||||
const response = await client.security.bulkUpdateApiKeys({
|
||||
ids: ["VuaCfGcBCdbkQm-e5aOx", "H3_AhoIBA9hmeQJdg7ij"],
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
@ -3,35 +3,31 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "POST",
|
||||
path: "/_text_structure/find_message_structure",
|
||||
body: {
|
||||
messages: [
|
||||
"[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128",
|
||||
"[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]",
|
||||
"[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]",
|
||||
"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]",
|
||||
"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]",
|
||||
"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]",
|
||||
"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-monitoring]",
|
||||
"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]",
|
||||
"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]",
|
||||
"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-ent-search]",
|
||||
"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]",
|
||||
"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]",
|
||||
"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-expression]",
|
||||
"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-eql]",
|
||||
"[2024-03-05T10:52:43,291][INFO ][o.e.e.NodeEnvironment ] [laptop] heap size [16gb], compressed ordinary object pointers [true]",
|
||||
"[2024-03-05T10:52:46,098][INFO ][o.e.x.s.Security ] [laptop] Security is enabled",
|
||||
"[2024-03-05T10:52:47,227][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] Profiling is enabled",
|
||||
"[2024-03-05T10:52:47,259][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] profiling index templates will not be installed or reinstalled",
|
||||
"[2024-03-05T10:52:47,755][INFO ][o.e.i.r.RecoverySettings ] [laptop] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]",
|
||||
"[2024-03-05T10:52:47,787][INFO ][o.e.d.DiscoveryModule ] [laptop] using discovery type [multi-node] and seed hosts providers [settings]",
|
||||
"[2024-03-05T10:52:49,188][INFO ][o.e.n.Node ] [laptop] initialized",
|
||||
"[2024-03-05T10:52:49,199][INFO ][o.e.n.Node ] [laptop] starting ...",
|
||||
],
|
||||
},
|
||||
const response = await client.textStructure.findMessageStructure({
|
||||
messages: [
|
||||
"[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128",
|
||||
"[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]",
|
||||
"[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]",
|
||||
"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]",
|
||||
"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]",
|
||||
"[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]",
|
||||
"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-monitoring]",
|
||||
"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]",
|
||||
"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]",
|
||||
"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-ent-search]",
|
||||
"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]",
|
||||
"[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]",
|
||||
"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-expression]",
|
||||
"[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-eql]",
|
||||
"[2024-03-05T10:52:43,291][INFO ][o.e.e.NodeEnvironment ] [laptop] heap size [16gb], compressed ordinary object pointers [true]",
|
||||
"[2024-03-05T10:52:46,098][INFO ][o.e.x.s.Security ] [laptop] Security is enabled",
|
||||
"[2024-03-05T10:52:47,227][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] Profiling is enabled",
|
||||
"[2024-03-05T10:52:47,259][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] profiling index templates will not be installed or reinstalled",
|
||||
"[2024-03-05T10:52:47,755][INFO ][o.e.i.r.RecoverySettings ] [laptop] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]",
|
||||
"[2024-03-05T10:52:47,787][INFO ][o.e.d.DiscoveryModule ] [laptop] using discovery type [multi-node] and seed hosts providers [settings]",
|
||||
"[2024-03-05T10:52:49,188][INFO ][o.e.n.Node ] [laptop] initialized",
|
||||
"[2024-03-05T10:52:49,199][INFO ][o.e.n.Node ] [laptop] starting ...",
|
||||
],
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
@ -3,9 +3,8 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "DELETE",
|
||||
path: "/_ingest/ip_location/database/my-database-id",
|
||||
const response = await client.ingest.deleteIpLocationDatabase({
|
||||
id: "my-database-id",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
@ -3,30 +3,26 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "POST",
|
||||
path: "/_security/api_key/_bulk_update",
|
||||
body: {
|
||||
ids: ["VuaCfGcBCdbkQm-e5aOx", "H3_AhoIBA9hmeQJdg7ij"],
|
||||
role_descriptors: {
|
||||
"role-a": {
|
||||
indices: [
|
||||
{
|
||||
names: ["*"],
|
||||
privileges: ["write"],
|
||||
},
|
||||
],
|
||||
},
|
||||
const response = await client.security.bulkUpdateApiKeys({
|
||||
ids: ["VuaCfGcBCdbkQm-e5aOx", "H3_AhoIBA9hmeQJdg7ij"],
|
||||
role_descriptors: {
|
||||
"role-a": {
|
||||
indices: [
|
||||
{
|
||||
names: ["*"],
|
||||
privileges: ["write"],
|
||||
},
|
||||
],
|
||||
},
|
||||
metadata: {
|
||||
environment: {
|
||||
level: 2,
|
||||
trusted: true,
|
||||
tags: ["production"],
|
||||
},
|
||||
},
|
||||
expiration: "30d",
|
||||
},
|
||||
metadata: {
|
||||
environment: {
|
||||
level: 2,
|
||||
trusted: true,
|
||||
tags: ["production"],
|
||||
},
|
||||
},
|
||||
expiration: "30d",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
@ -3,32 +3,30 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "POST",
|
||||
path: "/_inference/chat_completion/openai-completion/_stream",
|
||||
body: {
|
||||
messages: [
|
||||
{
|
||||
role: "assistant",
|
||||
content: "Let's find out what the weather is",
|
||||
tool_calls: [
|
||||
{
|
||||
id: "call_KcAjWtAww20AihPHphUh46Gd",
|
||||
type: "function",
|
||||
function: {
|
||||
name: "get_current_weather",
|
||||
arguments: '{"location":"Boston, MA"}',
|
||||
},
|
||||
const response = await client.inference.streamInference({
|
||||
task_type: "chat_completion",
|
||||
inference_id: "openai-completion",
|
||||
messages: [
|
||||
{
|
||||
role: "assistant",
|
||||
content: "Let's find out what the weather is",
|
||||
tool_calls: [
|
||||
{
|
||||
id: "call_KcAjWtAww20AihPHphUh46Gd",
|
||||
type: "function",
|
||||
function: {
|
||||
name: "get_current_weather",
|
||||
arguments: '{"location":"Boston, MA"}',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
role: "tool",
|
||||
content: "The weather is cold",
|
||||
tool_call_id: "call_KcAjWtAww20AihPHphUh46Gd",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
role: "tool",
|
||||
content: "The weather is cold",
|
||||
tool_call_id: "call_KcAjWtAww20AihPHphUh46Gd",
|
||||
},
|
||||
],
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
@ -3,10 +3,9 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "PUT",
|
||||
path: "/_ingest/ip_location/database/my-database-1",
|
||||
body: {
|
||||
const response = await client.ingest.putIpLocationDatabase({
|
||||
id: "my-database-1",
|
||||
configuration: {
|
||||
name: "GeoIP2-Domain",
|
||||
maxmind: {
|
||||
account_id: "1234567",
|
||||
|
||||
@ -0,0 +1,8 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.resolveCluster();
|
||||
console.log(response);
|
||||
----
|
||||
@ -3,9 +3,8 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "DELETE",
|
||||
path: "/_ingest/ip_location/database/example-database-id",
|
||||
const response = await client.ingest.deleteIpLocationDatabase({
|
||||
id: "example-database-id",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
@ -3,10 +3,10 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "POST",
|
||||
path: "/_application/analytics/my_analytics_collection/event/search_click",
|
||||
body: {
|
||||
const response = await client.searchApplication.postBehavioralAnalyticsEvent({
|
||||
collection_name: "my_analytics_collection",
|
||||
event_type: "search_click",
|
||||
payload: {
|
||||
session: {
|
||||
id: "1797ca95-91c9-4e2e-b1bd-9c38e6f386a9",
|
||||
},
|
||||
|
||||
@ -3,16 +3,12 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "POST",
|
||||
path: "/_security/oidc/authenticate",
|
||||
body: {
|
||||
redirect_uri:
|
||||
"https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I",
|
||||
state: "4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I",
|
||||
nonce: "WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM",
|
||||
realm: "oidc1",
|
||||
},
|
||||
const response = await client.security.oidcAuthenticate({
|
||||
redirect_uri:
|
||||
"https://oidc-kibana.elastic.co:5603/api/security/oidc/callback?code=jtI3Ntt8v3_XvcLzCFGq&state=4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I",
|
||||
state: "4dbrihtIAt3wBTwo6DxK-vdk-sSyDBV8Yf0AjdkdT5I",
|
||||
nonce: "WaBPH0KqPVdG5HHdSxPRjfoZbXMCicm5v1OiAj0DUFM",
|
||||
realm: "oidc1",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
@ -3,13 +3,10 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "POST",
|
||||
path: "/_application/search_application/my_search_application/_render_query",
|
||||
body: {
|
||||
params: {
|
||||
query_string: "rock climbing",
|
||||
},
|
||||
const response = await client.searchApplication.renderQuery({
|
||||
name: "my_search_application",
|
||||
params: {
|
||||
query_string: "rock climbing",
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
|
||||
10
docs/doc_examples/a60aaed30d7d26eaacbb2c0ed4ddc66d.asciidoc
Normal file
10
docs/doc_examples/a60aaed30d7d26eaacbb2c0ed4ddc66d.asciidoc
Normal file
@ -0,0 +1,10 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.cancelMigrateReindex({
|
||||
index: "my-data-stream",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
10
docs/doc_examples/adced6e22ef03c2ae3b14aa5bdd24fd9.asciidoc
Normal file
10
docs/doc_examples/adced6e22ef03c2ae3b14aa5bdd24fd9.asciidoc
Normal file
@ -0,0 +1,10 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.getMigrateReindexStatus({
|
||||
index: "my-data-stream",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -3,9 +3,8 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "POST",
|
||||
path: "/_application/search_application/my_search_application/_render_query",
|
||||
const response = await client.searchApplication.renderQuery({
|
||||
name: "my_search_application",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
10
docs/doc_examples/b1e81b70b874a1f0cf75a0ec6e430ddc.asciidoc
Normal file
10
docs/doc_examples/b1e81b70b874a1f0cf75a0ec6e430ddc.asciidoc
Normal file
@ -0,0 +1,10 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.esql.asyncQueryStop({
|
||||
id: "FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -208,13 +208,9 @@ const response = await client.bulk({
|
||||
});
|
||||
console.log(response);
|
||||
|
||||
const response1 = await client.transport.request({
|
||||
method: "GET",
|
||||
path: "/_text_structure/find_field_structure",
|
||||
querystring: {
|
||||
index: "test-logs",
|
||||
field: "message",
|
||||
},
|
||||
const response1 = await client.textStructure.findFieldStructure({
|
||||
index: "test-logs",
|
||||
field: "message",
|
||||
});
|
||||
console.log(response1);
|
||||
----
|
||||
|
||||
@ -3,36 +3,32 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "POST",
|
||||
path: "/_ingest/_simulate",
|
||||
body: {
|
||||
docs: [
|
||||
{
|
||||
_index: "my-index",
|
||||
_id: "123",
|
||||
_source: {
|
||||
foo: "bar",
|
||||
},
|
||||
const response = await client.simulate.ingest({
|
||||
docs: [
|
||||
{
|
||||
_index: "my-index",
|
||||
_id: "123",
|
||||
_source: {
|
||||
foo: "bar",
|
||||
},
|
||||
{
|
||||
_index: "my-index",
|
||||
_id: "456",
|
||||
_source: {
|
||||
foo: "rab",
|
||||
},
|
||||
},
|
||||
{
|
||||
_index: "my-index",
|
||||
_id: "456",
|
||||
_source: {
|
||||
foo: "rab",
|
||||
},
|
||||
],
|
||||
pipeline_substitutions: {
|
||||
"my-pipeline": {
|
||||
processors: [
|
||||
{
|
||||
uppercase: {
|
||||
field: "foo",
|
||||
},
|
||||
},
|
||||
],
|
||||
pipeline_substitutions: {
|
||||
"my-pipeline": {
|
||||
processors: [
|
||||
{
|
||||
uppercase: {
|
||||
field: "foo",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@ -3,13 +3,9 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "POST",
|
||||
path: "/_security/api_key/_bulk_update",
|
||||
body: {
|
||||
ids: ["VuaCfGcBCdbkQm-e5aOx", "H3_AhoIBA9hmeQJdg7ij"],
|
||||
role_descriptors: {},
|
||||
},
|
||||
const response = await client.security.bulkUpdateApiKeys({
|
||||
ids: ["VuaCfGcBCdbkQm-e5aOx", "H3_AhoIBA9hmeQJdg7ij"],
|
||||
role_descriptors: {},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
@ -3,69 +3,65 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "POST",
|
||||
path: "/_ingest/_simulate",
|
||||
body: {
|
||||
docs: [
|
||||
{
|
||||
_index: "my-index",
|
||||
_id: "id",
|
||||
_source: {
|
||||
foo: "bar",
|
||||
},
|
||||
},
|
||||
{
|
||||
_index: "my-index",
|
||||
_id: "id",
|
||||
_source: {
|
||||
foo: "rab",
|
||||
},
|
||||
},
|
||||
],
|
||||
pipeline_substitutions: {
|
||||
"my-pipeline": {
|
||||
processors: [
|
||||
{
|
||||
set: {
|
||||
field: "field3",
|
||||
value: "value3",
|
||||
},
|
||||
},
|
||||
],
|
||||
const response = await client.simulate.ingest({
|
||||
docs: [
|
||||
{
|
||||
_index: "my-index",
|
||||
_id: "id",
|
||||
_source: {
|
||||
foo: "bar",
|
||||
},
|
||||
},
|
||||
component_template_substitutions: {
|
||||
"my-component-template": {
|
||||
template: {
|
||||
mappings: {
|
||||
dynamic: "true",
|
||||
properties: {
|
||||
field3: {
|
||||
type: "keyword",
|
||||
},
|
||||
{
|
||||
_index: "my-index",
|
||||
_id: "id",
|
||||
_source: {
|
||||
foo: "rab",
|
||||
},
|
||||
},
|
||||
],
|
||||
pipeline_substitutions: {
|
||||
"my-pipeline": {
|
||||
processors: [
|
||||
{
|
||||
set: {
|
||||
field: "field3",
|
||||
value: "value3",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
component_template_substitutions: {
|
||||
"my-component-template": {
|
||||
template: {
|
||||
mappings: {
|
||||
dynamic: "true",
|
||||
properties: {
|
||||
field3: {
|
||||
type: "keyword",
|
||||
},
|
||||
},
|
||||
settings: {
|
||||
index: {
|
||||
default_pipeline: "my-pipeline",
|
||||
},
|
||||
},
|
||||
settings: {
|
||||
index: {
|
||||
default_pipeline: "my-pipeline",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
index_template_substitutions: {
|
||||
"my-index-template": {
|
||||
index_patterns: ["my-index-*"],
|
||||
composed_of: ["component_template_1", "component_template_2"],
|
||||
},
|
||||
},
|
||||
index_template_substitutions: {
|
||||
"my-index-template": {
|
||||
index_patterns: ["my-index-*"],
|
||||
composed_of: ["component_template_1", "component_template_2"],
|
||||
},
|
||||
mapping_addition: {
|
||||
dynamic: "strict",
|
||||
properties: {
|
||||
foo: {
|
||||
type: "keyword",
|
||||
},
|
||||
},
|
||||
mapping_addition: {
|
||||
dynamic: "strict",
|
||||
properties: {
|
||||
foo: {
|
||||
type: "keyword",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@ -3,13 +3,9 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "POST",
|
||||
path: "/_security/oidc/prepare",
|
||||
body: {
|
||||
iss: "http://127.0.0.1:8080",
|
||||
login_hint: "this_is_an_opaque_string",
|
||||
},
|
||||
const response = await client.security.oidcPrepareAuthentication({
|
||||
iss: "http://127.0.0.1:8080",
|
||||
login_hint: "this_is_an_opaque_string",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
@ -3,10 +3,9 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "PUT",
|
||||
path: "/_ingest/ip_location/database/my-database-2",
|
||||
body: {
|
||||
const response = await client.ingest.putIpLocationDatabase({
|
||||
id: "my-database-2",
|
||||
configuration: {
|
||||
name: "standard_location",
|
||||
ipinfo: {},
|
||||
},
|
||||
|
||||
@ -3,9 +3,8 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "GET",
|
||||
path: "/_ingest/ip_location/database/my-database-id",
|
||||
const response = await client.ingest.getIpLocationDatabase({
|
||||
id: "my-database-id",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
@ -3,9 +3,6 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "GET",
|
||||
path: "/_security/settings",
|
||||
});
|
||||
const response = await client.security.getSettings();
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
14
docs/doc_examples/dde92fdf3469349ffe2c81764333543a.asciidoc
Normal file
14
docs/doc_examples/dde92fdf3469349ffe2c81764333543a.asciidoc
Normal file
@ -0,0 +1,14 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.createFrom({
|
||||
source: "my-index",
|
||||
dest: "my-new-index",
|
||||
create_from: {
|
||||
remove_index_blocks: false,
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -3,12 +3,8 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "POST",
|
||||
path: "/_security/oidc/prepare",
|
||||
body: {
|
||||
realm: "oidc1",
|
||||
},
|
||||
const response = await client.security.oidcPrepareAuthentication({
|
||||
realm: "oidc1",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
@ -3,38 +3,34 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.transport.request({
|
||||
method: "POST",
|
||||
path: "/_ingest/_simulate",
|
||||
body: {
|
||||
docs: [
|
||||
{
|
||||
_index: "my-index",
|
||||
_id: "123",
|
||||
_source: {
|
||||
foo: "foo",
|
||||
},
|
||||
const response = await client.simulate.ingest({
|
||||
docs: [
|
||||
{
|
||||
_index: "my-index",
|
||||
_id: "123",
|
||||
_source: {
|
||||
foo: "foo",
|
||||
},
|
||||
{
|
||||
_index: "my-index",
|
||||
_id: "456",
|
||||
_source: {
|
||||
bar: "rab",
|
||||
},
|
||||
},
|
||||
{
|
||||
_index: "my-index",
|
||||
_id: "456",
|
||||
_source: {
|
||||
bar: "rab",
|
||||
},
|
||||
],
|
||||
component_template_substitutions: {
|
||||
"my-mappings_template": {
|
||||
template: {
|
||||
mappings: {
|
||||
dynamic: "strict",
|
||||
properties: {
|
||||
foo: {
|
||||
type: "keyword",
|
||||
},
|
||||
bar: {
|
||||
type: "keyword",
|
||||
},
|
||||
},
|
||||
],
|
||||
component_template_substitutions: {
|
||||
"my-mappings_template": {
|
||||
template: {
|
||||
mappings: {
|
||||
dynamic: "strict",
|
||||
properties: {
|
||||
foo: {
|
||||
type: "keyword",
|
||||
},
|
||||
bar: {
|
||||
type: "keyword",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
12
docs/doc_examples/ec135f0cc0d3f526df68000b2a95c65b.asciidoc
Normal file
12
docs/doc_examples/ec135f0cc0d3f526df68000b2a95c65b.asciidoc
Normal file
@ -0,0 +1,12 @@
|
||||
// This file is autogenerated, DO NOT EDIT
|
||||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.createFrom({
|
||||
source: ".ml-anomalies-custom-example",
|
||||
dest: ".reindexed-v9-ml-anomalies-custom-example",
|
||||
create_from: null,
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
477
docs/docset.yml
477
docs/docset.yml
@ -8,482 +8,5 @@ toc:
|
||||
- toc: reference
|
||||
- toc: release-notes
|
||||
subs:
|
||||
ref: "https://www.elastic.co/guide/en/elasticsearch/reference/current"
|
||||
ref-bare: "https://www.elastic.co/guide/en/elasticsearch/reference"
|
||||
ref-8x: "https://www.elastic.co/guide/en/elasticsearch/reference/8.1"
|
||||
ref-80: "https://www.elastic.co/guide/en/elasticsearch/reference/8.0"
|
||||
ref-7x: "https://www.elastic.co/guide/en/elasticsearch/reference/7.17"
|
||||
ref-70: "https://www.elastic.co/guide/en/elasticsearch/reference/7.0"
|
||||
ref-60: "https://www.elastic.co/guide/en/elasticsearch/reference/6.0"
|
||||
ref-64: "https://www.elastic.co/guide/en/elasticsearch/reference/6.4"
|
||||
xpack-ref: "https://www.elastic.co/guide/en/x-pack/6.2"
|
||||
logstash-ref: "https://www.elastic.co/guide/en/logstash/current"
|
||||
kibana-ref: "https://www.elastic.co/guide/en/kibana/current"
|
||||
kibana-ref-all: "https://www.elastic.co/guide/en/kibana"
|
||||
beats-ref-root: "https://www.elastic.co/guide/en/beats"
|
||||
beats-ref: "https://www.elastic.co/guide/en/beats/libbeat/current"
|
||||
beats-ref-60: "https://www.elastic.co/guide/en/beats/libbeat/6.0"
|
||||
beats-ref-63: "https://www.elastic.co/guide/en/beats/libbeat/6.3"
|
||||
beats-devguide: "https://www.elastic.co/guide/en/beats/devguide/current"
|
||||
auditbeat-ref: "https://www.elastic.co/guide/en/beats/auditbeat/current"
|
||||
packetbeat-ref: "https://www.elastic.co/guide/en/beats/packetbeat/current"
|
||||
metricbeat-ref: "https://www.elastic.co/guide/en/beats/metricbeat/current"
|
||||
filebeat-ref: "https://www.elastic.co/guide/en/beats/filebeat/current"
|
||||
functionbeat-ref: "https://www.elastic.co/guide/en/beats/functionbeat/current"
|
||||
winlogbeat-ref: "https://www.elastic.co/guide/en/beats/winlogbeat/current"
|
||||
heartbeat-ref: "https://www.elastic.co/guide/en/beats/heartbeat/current"
|
||||
journalbeat-ref: "https://www.elastic.co/guide/en/beats/journalbeat/current"
|
||||
ingest-guide: "https://www.elastic.co/guide/en/ingest/current"
|
||||
fleet-guide: "https://www.elastic.co/guide/en/fleet/current"
|
||||
apm-guide-ref: "https://www.elastic.co/guide/en/apm/guide/current"
|
||||
apm-guide-7x: "https://www.elastic.co/guide/en/apm/guide/7.17"
|
||||
apm-app-ref: "https://www.elastic.co/guide/en/kibana/current"
|
||||
apm-agents-ref: "https://www.elastic.co/guide/en/apm/agent"
|
||||
apm-android-ref: "https://www.elastic.co/guide/en/apm/agent/android/current"
|
||||
apm-py-ref: "https://www.elastic.co/guide/en/apm/agent/python/current"
|
||||
apm-py-ref-3x: "https://www.elastic.co/guide/en/apm/agent/python/3.x"
|
||||
apm-node-ref-index: "https://www.elastic.co/guide/en/apm/agent/nodejs"
|
||||
apm-node-ref: "https://www.elastic.co/guide/en/apm/agent/nodejs/current"
|
||||
apm-node-ref-1x: "https://www.elastic.co/guide/en/apm/agent/nodejs/1.x"
|
||||
apm-rum-ref: "https://www.elastic.co/guide/en/apm/agent/rum-js/current"
|
||||
apm-ruby-ref: "https://www.elastic.co/guide/en/apm/agent/ruby/current"
|
||||
apm-java-ref: "https://www.elastic.co/guide/en/apm/agent/java/current"
|
||||
apm-go-ref: "https://www.elastic.co/guide/en/apm/agent/go/current"
|
||||
apm-dotnet-ref: "https://www.elastic.co/guide/en/apm/agent/dotnet/current"
|
||||
apm-php-ref: "https://www.elastic.co/guide/en/apm/agent/php/current"
|
||||
apm-ios-ref: "https://www.elastic.co/guide/en/apm/agent/swift/current"
|
||||
apm-lambda-ref: "https://www.elastic.co/guide/en/apm/lambda/current"
|
||||
apm-attacher-ref: "https://www.elastic.co/guide/en/apm/attacher/current"
|
||||
docker-logging-ref: "https://www.elastic.co/guide/en/beats/loggingplugin/current"
|
||||
esf-ref: "https://www.elastic.co/guide/en/esf/current"
|
||||
kinesis-firehose-ref: "https://www.elastic.co/guide/en/kinesis/{{kinesis_version}}"
|
||||
estc-welcome-current: "https://www.elastic.co/guide/en/starting-with-the-elasticsearch-platform-and-its-solutions/current"
|
||||
estc-welcome: "https://www.elastic.co/guide/en/starting-with-the-elasticsearch-platform-and-its-solutions/current"
|
||||
estc-welcome-all: "https://www.elastic.co/guide/en/starting-with-the-elasticsearch-platform-and-its-solutions"
|
||||
hadoop-ref: "https://www.elastic.co/guide/en/elasticsearch/hadoop/current"
|
||||
stack-ref: "https://www.elastic.co/guide/en/elastic-stack/current"
|
||||
stack-ref-67: "https://www.elastic.co/guide/en/elastic-stack/6.7"
|
||||
stack-ref-68: "https://www.elastic.co/guide/en/elastic-stack/6.8"
|
||||
stack-ref-70: "https://www.elastic.co/guide/en/elastic-stack/7.0"
|
||||
stack-ref-80: "https://www.elastic.co/guide/en/elastic-stack/8.0"
|
||||
stack-ov: "https://www.elastic.co/guide/en/elastic-stack-overview/current"
|
||||
stack-gs: "https://www.elastic.co/guide/en/elastic-stack-get-started/current"
|
||||
stack-gs-current: "https://www.elastic.co/guide/en/elastic-stack-get-started/current"
|
||||
javaclient: "https://www.elastic.co/guide/en/elasticsearch/client/java-api/current"
|
||||
java-api-client: "https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current"
|
||||
java-rest: "https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current"
|
||||
jsclient: "https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current"
|
||||
jsclient-current: "https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current"
|
||||
es-ruby-client: "https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current"
|
||||
es-dotnet-client: "https://www.elastic.co/guide/en/elasticsearch/client/net-api/current"
|
||||
es-php-client: "https://www.elastic.co/guide/en/elasticsearch/client/php-api/current"
|
||||
es-python-client: "https://www.elastic.co/guide/en/elasticsearch/client/python-api/current"
|
||||
defguide: "https://www.elastic.co/guide/en/elasticsearch/guide/2.x"
|
||||
painless: "https://www.elastic.co/guide/en/elasticsearch/painless/current"
|
||||
plugins: "https://www.elastic.co/guide/en/elasticsearch/plugins/current"
|
||||
plugins-8x: "https://www.elastic.co/guide/en/elasticsearch/plugins/8.1"
|
||||
plugins-7x: "https://www.elastic.co/guide/en/elasticsearch/plugins/7.17"
|
||||
plugins-6x: "https://www.elastic.co/guide/en/elasticsearch/plugins/6.8"
|
||||
glossary: "https://www.elastic.co/guide/en/elastic-stack-glossary/current"
|
||||
upgrade_guide: "https://www.elastic.co/products/upgrade_guide"
|
||||
blog-ref: "https://www.elastic.co/blog/"
|
||||
curator-ref: "https://www.elastic.co/guide/en/elasticsearch/client/curator/current"
|
||||
curator-ref-current: "https://www.elastic.co/guide/en/elasticsearch/client/curator/current"
|
||||
metrics-ref: "https://www.elastic.co/guide/en/metrics/current"
|
||||
metrics-guide: "https://www.elastic.co/guide/en/metrics/guide/current"
|
||||
logs-ref: "https://www.elastic.co/guide/en/logs/current"
|
||||
logs-guide: "https://www.elastic.co/guide/en/logs/guide/current"
|
||||
uptime-guide: "https://www.elastic.co/guide/en/uptime/current"
|
||||
observability-guide: "https://www.elastic.co/guide/en/observability/current"
|
||||
observability-guide-all: "https://www.elastic.co/guide/en/observability"
|
||||
siem-guide: "https://www.elastic.co/guide/en/siem/guide/current"
|
||||
security-guide: "https://www.elastic.co/guide/en/security/current"
|
||||
security-guide-all: "https://www.elastic.co/guide/en/security"
|
||||
endpoint-guide: "https://www.elastic.co/guide/en/endpoint/current"
|
||||
sql-odbc: "https://www.elastic.co/guide/en/elasticsearch/sql-odbc/current"
|
||||
ecs-ref: "https://www.elastic.co/guide/en/ecs/current"
|
||||
ecs-logging-ref: "https://www.elastic.co/guide/en/ecs-logging/overview/current"
|
||||
ecs-logging-go-logrus-ref: "https://www.elastic.co/guide/en/ecs-logging/go-logrus/current"
|
||||
ecs-logging-go-zap-ref: "https://www.elastic.co/guide/en/ecs-logging/go-zap/current"
|
||||
ecs-logging-go-zerolog-ref: "https://www.elastic.co/guide/en/ecs-logging/go-zap/current"
|
||||
ecs-logging-java-ref: "https://www.elastic.co/guide/en/ecs-logging/java/current"
|
||||
ecs-logging-dotnet-ref: "https://www.elastic.co/guide/en/ecs-logging/dotnet/current"
|
||||
ecs-logging-nodejs-ref: "https://www.elastic.co/guide/en/ecs-logging/nodejs/current"
|
||||
ecs-logging-php-ref: "https://www.elastic.co/guide/en/ecs-logging/php/current"
|
||||
ecs-logging-python-ref: "https://www.elastic.co/guide/en/ecs-logging/python/current"
|
||||
ecs-logging-ruby-ref: "https://www.elastic.co/guide/en/ecs-logging/ruby/current"
|
||||
ml-docs: "https://www.elastic.co/guide/en/machine-learning/current"
|
||||
eland-docs: "https://www.elastic.co/guide/en/elasticsearch/client/eland/current"
|
||||
eql-ref: "https://eql.readthedocs.io/en/latest/query-guide"
|
||||
extendtrial: "https://www.elastic.co/trialextension"
|
||||
wikipedia: "https://en.wikipedia.org/wiki"
|
||||
forum: "https://discuss.elastic.co/"
|
||||
xpack-forum: "https://discuss.elastic.co/c/50-x-pack"
|
||||
security-forum: "https://discuss.elastic.co/c/x-pack/shield"
|
||||
watcher-forum: "https://discuss.elastic.co/c/x-pack/watcher"
|
||||
monitoring-forum: "https://discuss.elastic.co/c/x-pack/marvel"
|
||||
graph-forum: "https://discuss.elastic.co/c/x-pack/graph"
|
||||
apm-forum: "https://discuss.elastic.co/c/apm"
|
||||
enterprise-search-ref: "https://www.elastic.co/guide/en/enterprise-search/current"
|
||||
app-search-ref: "https://www.elastic.co/guide/en/app-search/current"
|
||||
workplace-search-ref: "https://www.elastic.co/guide/en/workplace-search/current"
|
||||
enterprise-search-node-ref: "https://www.elastic.co/guide/en/enterprise-search-clients/enterprise-search-node/current"
|
||||
enterprise-search-php-ref: "https://www.elastic.co/guide/en/enterprise-search-clients/php/current"
|
||||
enterprise-search-python-ref: "https://www.elastic.co/guide/en/enterprise-search-clients/python/current"
|
||||
enterprise-search-ruby-ref: "https://www.elastic.co/guide/en/enterprise-search-clients/ruby/current"
|
||||
elastic-maps-service: "https://maps.elastic.co"
|
||||
integrations-docs: "https://docs.elastic.co/en/integrations"
|
||||
integrations-devguide: "https://www.elastic.co/guide/en/integrations-developer/current"
|
||||
time-units: "https://www.elastic.co/guide/en/elasticsearch/reference/current/api-conventions.html#time-units"
|
||||
byte-units: "https://www.elastic.co/guide/en/elasticsearch/reference/current/api-conventions.html#byte-units"
|
||||
apm-py-ref-v: "https://www.elastic.co/guide/en/apm/agent/python/current"
|
||||
apm-node-ref-v: "https://www.elastic.co/guide/en/apm/agent/nodejs/current"
|
||||
apm-rum-ref-v: "https://www.elastic.co/guide/en/apm/agent/rum-js/current"
|
||||
apm-ruby-ref-v: "https://www.elastic.co/guide/en/apm/agent/ruby/current"
|
||||
apm-java-ref-v: "https://www.elastic.co/guide/en/apm/agent/java/current"
|
||||
apm-go-ref-v: "https://www.elastic.co/guide/en/apm/agent/go/current"
|
||||
apm-ios-ref-v: "https://www.elastic.co/guide/en/apm/agent/swift/current"
|
||||
apm-dotnet-ref-v: "https://www.elastic.co/guide/en/apm/agent/dotnet/current"
|
||||
apm-php-ref-v: "https://www.elastic.co/guide/en/apm/agent/php/current"
|
||||
ecloud: "Elastic Cloud"
|
||||
esf: "Elastic Serverless Forwarder"
|
||||
ess: "Elasticsearch Service"
|
||||
ece: "Elastic Cloud Enterprise"
|
||||
eck: "Elastic Cloud on Kubernetes"
|
||||
serverless-full: "Elastic Cloud Serverless"
|
||||
serverless-short: "Serverless"
|
||||
es-serverless: "Elasticsearch Serverless"
|
||||
es3: "Elasticsearch Serverless"
|
||||
obs-serverless: "Elastic Observability Serverless"
|
||||
sec-serverless: "Elastic Security Serverless"
|
||||
serverless-docs: "https://docs.elastic.co/serverless"
|
||||
cloud: "https://www.elastic.co/guide/en/cloud/current"
|
||||
ess-utm-params: "?page=docs&placement=docs-body"
|
||||
ess-baymax: "?page=docs&placement=docs-body"
|
||||
ess-trial: "https://cloud.elastic.co/registration?page=docs&placement=docs-body"
|
||||
ess-product: "https://www.elastic.co/cloud/elasticsearch-service?page=docs&placement=docs-body"
|
||||
ess-console: "https://cloud.elastic.co?page=docs&placement=docs-body"
|
||||
ess-console-name: "Elasticsearch Service Console"
|
||||
ess-deployments: "https://cloud.elastic.co/deployments?page=docs&placement=docs-body"
|
||||
ece-ref: "https://www.elastic.co/guide/en/cloud-enterprise/current"
|
||||
eck-ref: "https://www.elastic.co/guide/en/cloud-on-k8s/current"
|
||||
ess-leadin: "You can run Elasticsearch on your own hardware or use our hosted Elasticsearch Service that is available on AWS, GCP, and Azure. https://cloud.elastic.co/registration{ess-utm-params}[Try the Elasticsearch Service for free]."
|
||||
ess-leadin-short: "Our hosted Elasticsearch Service is available on AWS, GCP, and Azure, and you can https://cloud.elastic.co/registration{ess-utm-params}[try it for free]."
|
||||
ess-icon: "image:https://doc-icons.s3.us-east-2.amazonaws.com/logo_cloud.svg[link=\"https://cloud.elastic.co/registration{ess-utm-params}\", title=\"Supported on Elasticsearch Service\"]"
|
||||
ece-icon: "image:https://doc-icons.s3.us-east-2.amazonaws.com/logo_cloud_ece.svg[link=\"https://cloud.elastic.co/registration{ess-utm-params}\", title=\"Supported on Elastic Cloud Enterprise\"]"
|
||||
cloud-only: "This feature is designed for indirect use by https://cloud.elastic.co/registration{ess-utm-params}[Elasticsearch Service], https://www.elastic.co/guide/en/cloud-enterprise/{ece-version-link}[Elastic Cloud Enterprise], and https://www.elastic.co/guide/en/cloud-on-k8s/current[Elastic Cloud on Kubernetes]. Direct use is not supported."
|
||||
ess-setting-change: "image:https://doc-icons.s3.us-east-2.amazonaws.com/logo_cloud.svg[link=\"{ess-trial}\", title=\"Supported on {ess}\"] indicates a change to a supported https://www.elastic.co/guide/en/cloud/current/ec-add-user-settings.html[user setting] for Elasticsearch Service."
|
||||
ess-skip-section: "If you use Elasticsearch Service, skip this section. Elasticsearch Service handles these changes for you."
|
||||
api-cloud: "https://www.elastic.co/docs/api/doc/cloud"
|
||||
api-ece: "https://www.elastic.co/docs/api/doc/cloud-enterprise"
|
||||
api-kibana-serverless: "https://www.elastic.co/docs/api/doc/serverless"
|
||||
es-feature-flag: "This feature is in development and not yet available for use. This documentation is provided for informational purposes only."
|
||||
es-ref-dir: "'{{elasticsearch-root}}/docs/reference'"
|
||||
apm-app: "APM app"
|
||||
uptime-app: "Uptime app"
|
||||
synthetics-app: "Synthetics app"
|
||||
logs-app: "Logs app"
|
||||
metrics-app: "Metrics app"
|
||||
infrastructure-app: "Infrastructure app"
|
||||
siem-app: "SIEM app"
|
||||
security-app: "Elastic Security app"
|
||||
ml-app: "Machine Learning"
|
||||
dev-tools-app: "Dev Tools"
|
||||
ingest-manager-app: "Ingest Manager"
|
||||
stack-manage-app: "Stack Management"
|
||||
stack-monitor-app: "Stack Monitoring"
|
||||
alerts-ui: "Alerts and Actions"
|
||||
rules-ui: "Rules"
|
||||
rac-ui: "Rules and Connectors"
|
||||
connectors-ui: "Connectors"
|
||||
connectors-feature: "Actions and Connectors"
|
||||
stack-rules-feature: "Stack Rules"
|
||||
user-experience: "User Experience"
|
||||
ems: "Elastic Maps Service"
|
||||
ems-init: "EMS"
|
||||
hosted-ems: "Elastic Maps Server"
|
||||
ipm-app: "Index Pattern Management"
|
||||
ingest-pipelines: "ingest pipelines"
|
||||
ingest-pipelines-app: "Ingest Pipelines"
|
||||
ingest-pipelines-cap: "Ingest pipelines"
|
||||
ls-pipelines: "Logstash pipelines"
|
||||
ls-pipelines-app: "Logstash Pipelines"
|
||||
maint-windows: "maintenance windows"
|
||||
maint-windows-app: "Maintenance Windows"
|
||||
maint-windows-cap: "Maintenance windows"
|
||||
custom-roles-app: "Custom Roles"
|
||||
data-source: "data view"
|
||||
data-sources: "data views"
|
||||
data-source-caps: "Data View"
|
||||
data-sources-caps: "Data Views"
|
||||
data-source-cap: "Data view"
|
||||
data-sources-cap: "Data views"
|
||||
project-settings: "Project settings"
|
||||
manage-app: "Management"
|
||||
index-manage-app: "Index Management"
|
||||
data-views-app: "Data Views"
|
||||
rules-app: "Rules"
|
||||
saved-objects-app: "Saved Objects"
|
||||
tags-app: "Tags"
|
||||
api-keys-app: "API keys"
|
||||
transforms-app: "Transforms"
|
||||
connectors-app: "Connectors"
|
||||
files-app: "Files"
|
||||
reports-app: "Reports"
|
||||
maps-app: "Maps"
|
||||
alerts-app: "Alerts"
|
||||
crawler: "Enterprise Search web crawler"
|
||||
ents: "Enterprise Search"
|
||||
app-search-crawler: "App Search web crawler"
|
||||
agent: "Elastic Agent"
|
||||
agents: "Elastic Agents"
|
||||
fleet: "Fleet"
|
||||
fleet-server: "Fleet Server"
|
||||
integrations-server: "Integrations Server"
|
||||
ingest-manager: "Ingest Manager"
|
||||
ingest-management: "ingest management"
|
||||
package-manager: "Elastic Package Manager"
|
||||
integrations: "Integrations"
|
||||
package-registry: "Elastic Package Registry"
|
||||
artifact-registry: "Elastic Artifact Registry"
|
||||
aws: "AWS"
|
||||
stack: "Elastic Stack"
|
||||
xpack: "X-Pack"
|
||||
es: "Elasticsearch"
|
||||
kib: "Kibana"
|
||||
esms: "Elastic Stack Monitoring Service"
|
||||
esms-init: "ESMS"
|
||||
ls: "Logstash"
|
||||
beats: "Beats"
|
||||
auditbeat: "Auditbeat"
|
||||
filebeat: "Filebeat"
|
||||
heartbeat: "Heartbeat"
|
||||
metricbeat: "Metricbeat"
|
||||
packetbeat: "Packetbeat"
|
||||
winlogbeat: "Winlogbeat"
|
||||
functionbeat: "Functionbeat"
|
||||
journalbeat: "Journalbeat"
|
||||
es-sql: "Elasticsearch SQL"
|
||||
esql: "ES|QL"
|
||||
elastic-agent: "Elastic Agent"
|
||||
k8s: "Kubernetes"
|
||||
log-driver-long: "Elastic Logging Plugin for Docker"
|
||||
security: "X-Pack security"
|
||||
security-features: "security features"
|
||||
operator-feature: "operator privileges feature"
|
||||
es-security-features: "Elasticsearch security features"
|
||||
stack-security-features: "Elastic Stack security features"
|
||||
endpoint-sec: "Endpoint Security"
|
||||
endpoint-cloud-sec: "Endpoint and Cloud Security"
|
||||
elastic-defend: "Elastic Defend"
|
||||
elastic-sec: "Elastic Security"
|
||||
elastic-endpoint: "Elastic Endpoint"
|
||||
swimlane: "Swimlane"
|
||||
sn: "ServiceNow"
|
||||
sn-itsm: "ServiceNow ITSM"
|
||||
sn-itom: "ServiceNow ITOM"
|
||||
sn-sir: "ServiceNow SecOps"
|
||||
jira: "Jira"
|
||||
ibm-r: "IBM Resilient"
|
||||
webhook: "Webhook"
|
||||
webhook-cm: "Webhook - Case Management"
|
||||
opsgenie: "Opsgenie"
|
||||
bedrock: "Amazon Bedrock"
|
||||
gemini: "Google Gemini"
|
||||
hive: "TheHive"
|
||||
monitoring: "X-Pack monitoring"
|
||||
monitor-features: "monitoring features"
|
||||
stack-monitor-features: "Elastic Stack monitoring features"
|
||||
watcher: "Watcher"
|
||||
alert-features: "alerting features"
|
||||
reporting: "X-Pack reporting"
|
||||
report-features: "reporting features"
|
||||
graph: "X-Pack graph"
|
||||
graph-features: "graph analytics features"
|
||||
searchprofiler: "Search Profiler"
|
||||
xpackml: "X-Pack machine learning"
|
||||
ml: "machine learning"
|
||||
ml-cap: "Machine learning"
|
||||
ml-init: "ML"
|
||||
ml-features: "machine learning features"
|
||||
stack-ml-features: "Elastic Stack machine learning features"
|
||||
ccr: "cross-cluster replication"
|
||||
ccr-cap: "Cross-cluster replication"
|
||||
ccr-init: "CCR"
|
||||
ccs: "cross-cluster search"
|
||||
ccs-cap: "Cross-cluster search"
|
||||
ccs-init: "CCS"
|
||||
ilm: "index lifecycle management"
|
||||
ilm-cap: "Index lifecycle management"
|
||||
ilm-init: "ILM"
|
||||
dlm: "data lifecycle management"
|
||||
dlm-cap: "Data lifecycle management"
|
||||
dlm-init: "DLM"
|
||||
search-snap: "searchable snapshot"
|
||||
search-snaps: "searchable snapshots"
|
||||
search-snaps-cap: "Searchable snapshots"
|
||||
slm: "snapshot lifecycle management"
|
||||
slm-cap: "Snapshot lifecycle management"
|
||||
slm-init: "SLM"
|
||||
rollup-features: "data rollup features"
|
||||
ipm: "index pattern management"
|
||||
ipm-cap: "Index pattern"
|
||||
rollup: "rollup"
|
||||
rollup-cap: "Rollup"
|
||||
rollups: "rollups"
|
||||
rollups-cap: "Rollups"
|
||||
rollup-job: "rollup job"
|
||||
rollup-jobs: "rollup jobs"
|
||||
rollup-jobs-cap: "Rollup jobs"
|
||||
dfeed: "datafeed"
|
||||
dfeeds: "datafeeds"
|
||||
dfeed-cap: "Datafeed"
|
||||
dfeeds-cap: "Datafeeds"
|
||||
ml-jobs: "machine learning jobs"
|
||||
ml-jobs-cap: "Machine learning jobs"
|
||||
anomaly-detect: "anomaly detection"
|
||||
anomaly-detect-cap: "Anomaly detection"
|
||||
anomaly-job: "anomaly detection job"
|
||||
anomaly-jobs: "anomaly detection jobs"
|
||||
anomaly-jobs-cap: "Anomaly detection jobs"
|
||||
dataframe: "data frame"
|
||||
dataframes: "data frames"
|
||||
dataframe-cap: "Data frame"
|
||||
dataframes-cap: "Data frames"
|
||||
watcher-transform: "payload transform"
|
||||
watcher-transforms: "payload transforms"
|
||||
watcher-transform-cap: "Payload transform"
|
||||
watcher-transforms-cap: "Payload transforms"
|
||||
transform: "transform"
|
||||
transforms: "transforms"
|
||||
transform-cap: "Transform"
|
||||
transforms-cap: "Transforms"
|
||||
dataframe-transform: "transform"
|
||||
dataframe-transform-cap: "Transform"
|
||||
dataframe-transforms: "transforms"
|
||||
dataframe-transforms-cap: "Transforms"
|
||||
dfanalytics-cap: "Data frame analytics"
|
||||
dfanalytics: "data frame analytics"
|
||||
dataframe-analytics-config: "'{dataframe} analytics config'"
|
||||
dfanalytics-job: "'{dataframe} analytics job'"
|
||||
dfanalytics-jobs: "'{dataframe} analytics jobs'"
|
||||
dfanalytics-jobs-cap: "'{dataframe-cap} analytics jobs'"
|
||||
cdataframe: "continuous data frame"
|
||||
cdataframes: "continuous data frames"
|
||||
cdataframe-cap: "Continuous data frame"
|
||||
cdataframes-cap: "Continuous data frames"
|
||||
cdataframe-transform: "continuous transform"
|
||||
cdataframe-transforms: "continuous transforms"
|
||||
cdataframe-transforms-cap: "Continuous transforms"
|
||||
ctransform: "continuous transform"
|
||||
ctransform-cap: "Continuous transform"
|
||||
ctransforms: "continuous transforms"
|
||||
ctransforms-cap: "Continuous transforms"
|
||||
oldetection: "outlier detection"
|
||||
oldetection-cap: "Outlier detection"
|
||||
olscore: "outlier score"
|
||||
olscores: "outlier scores"
|
||||
fiscore: "feature influence score"
|
||||
evaluatedf-api: "evaluate {dataframe} analytics API"
|
||||
evaluatedf-api-cap: "Evaluate {dataframe} analytics API"
|
||||
binarysc: "binary soft classification"
|
||||
binarysc-cap: "Binary soft classification"
|
||||
regression: "regression"
|
||||
regression-cap: "Regression"
|
||||
reganalysis: "regression analysis"
|
||||
reganalysis-cap: "Regression analysis"
|
||||
depvar: "dependent variable"
|
||||
feature-var: "feature variable"
|
||||
feature-vars: "feature variables"
|
||||
feature-vars-cap: "Feature variables"
|
||||
classification: "classification"
|
||||
classification-cap: "Classification"
|
||||
classanalysis: "classification analysis"
|
||||
classanalysis-cap: "Classification analysis"
|
||||
infer-cap: "Inference"
|
||||
infer: "inference"
|
||||
lang-ident-cap: "Language identification"
|
||||
lang-ident: "language identification"
|
||||
data-viz: "Data Visualizer"
|
||||
file-data-viz: "File Data Visualizer"
|
||||
feat-imp: "feature importance"
|
||||
feat-imp-cap: "Feature importance"
|
||||
nlp: "natural language processing"
|
||||
nlp-cap: "Natural language processing"
|
||||
apm-agent: "APM agent"
|
||||
apm-go-agent: "Elastic APM Go agent"
|
||||
apm-go-agents: "Elastic APM Go agents"
|
||||
apm-ios-agent: "Elastic APM iOS agent"
|
||||
apm-ios-agents: "Elastic APM iOS agents"
|
||||
apm-java-agent: "Elastic APM Java agent"
|
||||
apm-java-agents: "Elastic APM Java agents"
|
||||
apm-dotnet-agent: "Elastic APM .NET agent"
|
||||
apm-dotnet-agents: "Elastic APM .NET agents"
|
||||
apm-node-agent: "Elastic APM Node.js agent"
|
||||
apm-node-agents: "Elastic APM Node.js agents"
|
||||
apm-php-agent: "Elastic APM PHP agent"
|
||||
apm-php-agents: "Elastic APM PHP agents"
|
||||
apm-py-agent: "Elastic APM Python agent"
|
||||
apm-py-agents: "Elastic APM Python agents"
|
||||
apm-ruby-agent: "Elastic APM Ruby agent"
|
||||
apm-ruby-agents: "Elastic APM Ruby agents"
|
||||
apm-rum-agent: "Elastic APM Real User Monitoring (RUM) JavaScript agent"
|
||||
apm-rum-agents: "Elastic APM RUM JavaScript agents"
|
||||
apm-lambda-ext: "Elastic APM AWS Lambda extension"
|
||||
project-monitors: "project monitors"
|
||||
project-monitors-cap: "Project monitors"
|
||||
private-location: "Private Location"
|
||||
private-locations: "Private Locations"
|
||||
pwd: "YOUR_PASSWORD"
|
||||
esh: "ES-Hadoop"
|
||||
default-dist: "default distribution"
|
||||
oss-dist: "OSS-only distribution"
|
||||
observability: "Observability"
|
||||
api-request-title: "Request"
|
||||
api-prereq-title: "Prerequisites"
|
||||
api-description-title: "Description"
|
||||
api-path-parms-title: "Path parameters"
|
||||
api-query-parms-title: "Query parameters"
|
||||
api-request-body-title: "Request body"
|
||||
api-response-codes-title: "Response codes"
|
||||
api-response-body-title: "Response body"
|
||||
api-example-title: "Example"
|
||||
api-examples-title: "Examples"
|
||||
api-definitions-title: "Properties"
|
||||
multi-arg: "†footnoteref:[multi-arg,This parameter accepts multiple arguments.]"
|
||||
multi-arg-ref: "†footnoteref:[multi-arg]"
|
||||
yes-icon: "image:https://doc-icons.s3.us-east-2.amazonaws.com/icon-yes.png[Yes,20,15]"
|
||||
no-icon: "image:https://doc-icons.s3.us-east-2.amazonaws.com/icon-no.png[No,20,15]"
|
||||
es-repo: "https://github.com/elastic/elasticsearch/"
|
||||
es-issue: "https://github.com/elastic/elasticsearch/issues/"
|
||||
es-pull: "https://github.com/elastic/elasticsearch/pull/"
|
||||
es-commit: "https://github.com/elastic/elasticsearch/commit/"
|
||||
kib-repo: "https://github.com/elastic/kibana/"
|
||||
kib-issue: "https://github.com/elastic/kibana/issues/"
|
||||
kibana-issue: "'{kib-repo}issues/'"
|
||||
kib-pull: "https://github.com/elastic/kibana/pull/"
|
||||
kibana-pull: "'{kib-repo}pull/'"
|
||||
kib-commit: "https://github.com/elastic/kibana/commit/"
|
||||
ml-repo: "https://github.com/elastic/ml-cpp/"
|
||||
ml-issue: "https://github.com/elastic/ml-cpp/issues/"
|
||||
ml-pull: "https://github.com/elastic/ml-cpp/pull/"
|
||||
ml-commit: "https://github.com/elastic/ml-cpp/commit/"
|
||||
apm-repo: "https://github.com/elastic/apm-server/"
|
||||
apm-issue: "https://github.com/elastic/apm-server/issues/"
|
||||
apm-pull: "https://github.com/elastic/apm-server/pull/"
|
||||
kibana-blob: "https://github.com/elastic/kibana/blob/current/"
|
||||
apm-get-started-ref: "https://www.elastic.co/guide/en/apm/get-started/current"
|
||||
apm-server-ref: "https://www.elastic.co/guide/en/apm/server/current"
|
||||
apm-server-ref-v: "https://www.elastic.co/guide/en/apm/server/current"
|
||||
apm-server-ref-m: "https://www.elastic.co/guide/en/apm/server/master"
|
||||
apm-server-ref-62: "https://www.elastic.co/guide/en/apm/server/6.2"
|
||||
apm-server-ref-64: "https://www.elastic.co/guide/en/apm/server/6.4"
|
||||
apm-server-ref-70: "https://www.elastic.co/guide/en/apm/server/7.0"
|
||||
apm-overview-ref-v: "https://www.elastic.co/guide/en/apm/get-started/current"
|
||||
apm-overview-ref-70: "https://www.elastic.co/guide/en/apm/get-started/7.0"
|
||||
apm-overview-ref-m: "https://www.elastic.co/guide/en/apm/get-started/master"
|
||||
infra-guide: "https://www.elastic.co/guide/en/infrastructure/guide/current"
|
||||
a-data-source: "a data view"
|
||||
icon-bug: "pass:[<span class=\"eui-icon icon-bug\"></span>]"
|
||||
icon-checkInCircleFilled: "pass:[<span class=\"eui-icon icon-checkInCircleFilled\"></span>]"
|
||||
icon-warningFilled: "pass:[<span class=\"eui-icon icon-warningFilled\"></span>]"
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -5,7 +5,7 @@ mapped_pages:
|
||||
|
||||
# Basic configuration [basic-config]
|
||||
|
||||
This page shows you the possible basic configuration options that the clients offers.
|
||||
This page explains the basic configuration options for the JavaScript client.
|
||||
|
||||
```js
|
||||
const { Client } = require('@elastic/elasticsearch')
|
||||
@ -18,34 +18,404 @@ const client = new Client({
|
||||
})
|
||||
```
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
| `node` or `nodes` | The Elasticsearch endpoint to use.<br> It can be a single string or an array of strings:<br><br>```js<br>node: 'http://localhost:9200'<br>```<br><br>Or it can be an object (or an array of objects) that represents the node:<br><br>```js<br>node: {<br> url: new URL('http://localhost:9200'),<br> tls: 'tls options',<br> agent: 'http agent options',<br> id: 'custom node id',<br> headers: { 'custom': 'headers' }<br> roles: {<br> master: true,<br> data: true,<br> ingest: true,<br> ml: false<br> }<br>}<br>```<br> |
|
||||
| `auth` | Your authentication data. You can use both basic authentication and [ApiKey](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-api-key).<br> See [Authentication](/reference/connecting.md#authentication) for more details.<br> *Default:* `null`<br><br>Basic authentication:<br><br>```js<br>auth: {<br> username: 'elastic',<br> password: 'changeme'<br>}<br>```<br><br>[ApiKey](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-api-key) authentication:<br><br>```js<br>auth: {<br> apiKey: 'base64EncodedKey'<br>}<br>```<br><br>Bearer authentication, useful for [service account tokens](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-service-token). Be aware that it does not handle automatic token refresh:<br><br>```js<br>auth: {<br> bearer: 'token'<br>}<br>```<br> |
|
||||
| `maxRetries` | `number` - Max number of retries for each request.<br>*Default:* `3` |
|
||||
| `requestTimeout` | `number` - Max request timeout in milliseconds for each request.<br>*Default:* No value |
|
||||
| `pingTimeout` | `number` - Max ping request timeout in milliseconds for each request.<br>*Default:* `3000` |
|
||||
| `sniffInterval` | `number, boolean` - Perform a sniff operation every `n` milliseconds. Sniffing might not be the best solution for you, take a look [here](https://www.elastic.co/blog/elasticsearch-sniffing-best-practices-what-when-why-how) to know more.<br>*Default:* `false` |
|
||||
| `sniffOnStart` | `boolean` - Perform a sniff once the client is started. Sniffing might not be the best solution for you, take a look [here](https://www.elastic.co/blog/elasticsearch-sniffing-best-practices-what-when-why-how) to know more.<br>*Default:* `false` |
|
||||
| `sniffEndpoint` | `string` - Endpoint to ping during a sniff.<br>*Default:* `'_nodes/_all/http'` |
|
||||
| `sniffOnConnectionFault` | `boolean` - Perform a sniff on connection fault. Sniffing might not be the best solution for you, take a look [here](https://www.elastic.co/blog/elasticsearch-sniffing-best-practices-what-when-why-how) to know more.<br>*Default:* `false` |
|
||||
| `resurrectStrategy` | `string` - Configure the node resurrection strategy.<br>*Options:* `'ping'`, `'optimistic'`, `'none'`<br>*Default:* `'ping'` |
|
||||
| `suggestCompression` | `boolean` - Adds `accept-encoding` header to every request.<br>*Default:* `false` |
|
||||
| `compression` | `string, boolean` - Enables gzip request body compression.<br>*Options:* `'gzip'`, `false`<br>*Default:* `false` |
|
||||
| `tls` | `http.SecureContextOptions` - tls [configuraton](https://nodejs.org/api/tls.md).<br>*Default:* `null` |
|
||||
| `proxy` | `string, URL` - If you are using an http(s) proxy, you can put its url here. The client will automatically handle the connection to it.<br> *Default:* `null`<br><br>```js<br>const client = new Client({<br> node: 'http://localhost:9200',<br> proxy: 'http://localhost:8080'<br>})<br><br>const client = new Client({<br> node: 'http://localhost:9200',<br> proxy: 'http://user:pwd@localhost:8080'<br>})<br>```<br> |
|
||||
| `agent` | `http.AgentOptions, function` - http agent [options](https://nodejs.org/api/http.md#http_new_agent_options), or a function that returns an actual http agent instance. If you want to disable the http agent use entirely (and disable the `keep-alive` feature), set the agent to `false`.<br> *Default:* `null`<br><br>```js<br>const client = new Client({<br> node: 'http://localhost:9200',<br> agent: { agent: 'options' }<br>})<br><br>const client = new Client({<br> node: 'http://localhost:9200',<br> // the function takes as parameter the option<br> // object passed to the Connection constructor<br> agent: (opts) => new CustomAgent()<br>})<br><br>const client = new Client({<br> node: 'http://localhost:9200',<br> // Disable agent and keep-alive<br> agent: false<br>})<br>```<br> |
|
||||
| `nodeFilter` | `function` - Filters which node not to use for a request.<br> *Default:*<br><br>```js<br>function defaultNodeFilter (node) {<br> // avoid master only nodes<br> if (node.roles.master === true &&<br> node.roles.data === false &&<br> node.roles.ingest === false) {<br> return false<br> }<br> return true<br>}<br>```<br> |
|
||||
| `nodeSelector` | `function` - custom selection strategy.<br> *Options:* `'round-robin'`, `'random'`, custom function<br> *Default:* `'round-robin'`<br> *Custom function example:*<br><br>```js<br>function nodeSelector (connections) {<br> const index = calculateIndex()<br> return connections[index]<br>}<br>```<br> |
|
||||
| `generateRequestId` | `function` - function to generate the request id for every request, it takes two parameters, the request parameters and options.<br> By default it generates an incremental integer for every request.<br> *Custom function example:*<br><br>```js<br>function generateRequestId (params, options) {<br> // your id generation logic<br> // must be syncronous<br> return 'id'<br>}<br>```<br> |
|
||||
| `name` | `string, symbol` - The name to identify the client instance in the events.<br>*Default:* `elasticsearch-js` |
|
||||
| `opaqueIdPrefix` | `string` - A string that will be use to prefix any `X-Opaque-Id` header.<br>See [`X-Opaque-Id` support](/reference/observability.md#_x_opaque_id_support) for more details.<br>_Default:* `null` |
|
||||
| `headers` | `object` - A set of custom headers to send in every request.<br>*Default:* `{}` |
|
||||
| `context` | `object` - A custom object that you can use for observability in your events.It will be merged with the API level context option.<br>*Default:* `null` |
|
||||
| `enableMetaHeader` | `boolean` - If true, adds an header named `'x-elastic-client-meta'`, containing some minimal telemetry data,such as the client and platform version.<br>*Default:* `true` |
|
||||
| `cloud` | `object` - Custom configuration for connecting to [Elastic Cloud](https://cloud.elastic.co). See [Authentication](/reference/connecting.md) for more details.<br> *Default:* `null`<br> *Cloud configuration example:*<br><br>```js<br>const client = new Client({<br> cloud: {<br> id: '<cloud-id>'<br> },<br> auth: {<br> username: 'elastic',<br> password: 'changeme'<br> }<br>})<br>```<br> |
|
||||
| `disablePrototypePoisoningProtection` | `boolean`, `'proto'`, `'constructor'` - The client can protect you against prototype poisoning attacks. Read [this article](https://web.archive.org/web/20200319091159/https://hueniverse.com/square-brackets-are-the-enemy-ff5b9fd8a3e8?gi=184a27ee2a08) to learn more about this security concern. If needed, you can enable prototype poisoning protection entirely (`false`) or one of the two checks (`'proto'` or `'constructor'`). For performance reasons, it is disabled by default. Read the `secure-json-parse` [documentation](https://github.com/fastify/secure-json-parse) to learn more.<br>*Default:* `true` |
|
||||
| `caFingerprint` | `string` - If configured, verify that the fingerprint of the CA certificate that has signed the certificate of the server matches the supplied fingerprint. Only accepts SHA256 digest fingerprints.<br>*Default:* `null` |
|
||||
| `maxResponseSize` | `number` - When configured, it verifies that the uncompressed response size is lower than the configured number, if it’s higher it will abort the request. It cannot be higher than buffer.constants.MAX_STRING_LENGTH<br>*Default:* `null` |
|
||||
| `maxCompressedResponseSize` | `number` - When configured, it verifies that the compressed response size is lower than the configured number, if it’s higher it will abort the request. It cannot be higher than buffer.constants.MAX_LENGTH<br>*Default:* `null` |
|
||||
### `node` or `nodes`
|
||||
|
||||
The {{es}} endpoint to use. It can be a single string or an array of strings:
|
||||
|
||||
```js
|
||||
node: 'http://localhost:9200'
|
||||
```
|
||||
|
||||
```js
|
||||
nodes: ['http://localhost:9200', 'http://localhost:9201']
|
||||
```
|
||||
|
||||
Or it can be an object (or an array of objects) that represents the node:
|
||||
|
||||
```js
|
||||
node: {
|
||||
url: new URL('http://localhost:9200'),
|
||||
tls: 'tls options',
|
||||
agent: 'http agent options',
|
||||
id: 'custom node id',
|
||||
headers: { 'custom': 'headers' },
|
||||
roles: {
|
||||
master: true,
|
||||
data: true,
|
||||
ingest: true,
|
||||
ml: false
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `auth`
|
||||
|
||||
Default: `null`
|
||||
|
||||
Your authentication data. You can use both basic authentication and [ApiKey](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-api-key).
|
||||
See [Authentication](/reference/connecting.md#authentication) for more details.
|
||||
|
||||
Basic authentication:
|
||||
|
||||
```js
|
||||
auth: {
|
||||
username: 'elastic',
|
||||
password: 'changeme'
|
||||
}
|
||||
```
|
||||
|
||||
[ApiKey](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-api-key) authentication:
|
||||
|
||||
```js
|
||||
auth: {
|
||||
apiKey: 'base64EncodedKey'
|
||||
}
|
||||
```
|
||||
|
||||
Bearer authentication, useful for [service account tokens](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-service-token). Be aware that it does not handle automatic token refresh:
|
||||
|
||||
```js
|
||||
auth: {
|
||||
bearer: 'token'
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `maxRetries`
|
||||
|
||||
Type: `number`<br>
|
||||
Default: `3`
|
||||
|
||||
Max number of retries for each request.
|
||||
|
||||
---
|
||||
|
||||
### `requestTimeout`
|
||||
|
||||
Type: `number`<br>
|
||||
Default: `No value`
|
||||
|
||||
Max request timeout in milliseconds for each request.
|
||||
|
||||
---
|
||||
|
||||
### `pingTimeout`
|
||||
|
||||
Type: `number`<br>
|
||||
Default: `3000`
|
||||
|
||||
Max ping request timeout in milliseconds for each request.
|
||||
|
||||
---
|
||||
|
||||
### `sniffInterval`
|
||||
|
||||
Type: `number, boolean`<br>
|
||||
Default: `false`
|
||||
|
||||
Perform a sniff operation every `n` milliseconds.
|
||||
|
||||
:::{tip}
|
||||
Sniffing might not be the best solution. Before using the various `sniff` options, review this [blog post](https://www.elastic.co/blog/elasticsearch-sniffing-best-practices-what-when-why-how).
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
### `sniffOnStart`
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `false`
|
||||
|
||||
Perform a sniff once the client is started. Be sure to review the sniffing best practices [blog post](https://www.elastic.co/blog/elasticsearch-sniffing-best-practices-what-when-why-how).
|
||||
|
||||
---
|
||||
|
||||
### `sniffEndpoint`
|
||||
|
||||
Type: `string`<br>
|
||||
Default: `'_nodes/_all/http'`
|
||||
|
||||
Endpoint to ping during a sniff. Be sure to review the sniffing best practices [blog post](https://www.elastic.co/blog/elasticsearch-sniffing-best-practices-what-when-why-how).
|
||||
|
||||
---
|
||||
|
||||
### `sniffOnConnectionFault`
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `false`
|
||||
|
||||
Perform a sniff on connection fault. Be sure to review the sniffing best practices [blog post](https://www.elastic.co/blog/elasticsearch-sniffing-best-practices-what-when-why-how).
|
||||
|
||||
---
|
||||
|
||||
### `resurrectStrategy`
|
||||
|
||||
Type: `string`<br>
|
||||
Default: `'ping'`
|
||||
|
||||
Configure the node resurrection strategy.<br>
|
||||
Options: `'ping'`, `'optimistic'`, `'none'`
|
||||
|
||||
---
|
||||
|
||||
### `suggestCompression`
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `false`
|
||||
|
||||
Adds an `accept-encoding` header to every request.
|
||||
|
||||
---
|
||||
|
||||
### `compression`
|
||||
|
||||
Type: `string, boolean`<br>
|
||||
Default: `false`
|
||||
|
||||
Enables gzip request body compression.<br>
|
||||
Options: `'gzip'`, `false`
|
||||
|
||||
---
|
||||
|
||||
### `tls`
|
||||
|
||||
Type: `http.SecureContextOptions`<br>
|
||||
Default: `null`
|
||||
|
||||
The [tls configuraton](https://nodejs.org/api/tls.html).
|
||||
|
||||
---
|
||||
|
||||
### `proxy`
|
||||
|
||||
Type: `string, URL`<br>
|
||||
Default: `null`
|
||||
|
||||
If you are using an http(s) proxy, you can put its url here. The client will automatically handle the connection to it.
|
||||
|
||||
```js
|
||||
const client = new Client({
|
||||
node: 'http://localhost:9200',
|
||||
proxy: 'http://localhost:8080'
|
||||
})
|
||||
|
||||
const client = new Client({
|
||||
node: 'http://localhost:9200',
|
||||
proxy: 'http://user:pwd@localhost:8080'
|
||||
})
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `agent`
|
||||
|
||||
Type: `http.AgentOptions, function`<br>
|
||||
Default: `null`
|
||||
|
||||
http agent [options](https://nodejs.org/api/http.html#http_new_agent_options), or a function that returns an actual http agent instance. If you want to disable the http agent use entirely (and disable the `keep-alive` feature), set the agent to `false`.
|
||||
|
||||
```js
|
||||
const client = new Client({
|
||||
node: 'http://localhost:9200',
|
||||
agent: { agent: 'options' }
|
||||
})
|
||||
|
||||
const client = new Client({
|
||||
node: 'http://localhost:9200',
|
||||
// the function takes as parameter the option
|
||||
// object passed to the Connection constructor
|
||||
agent: (opts) => new CustomAgent()
|
||||
})
|
||||
|
||||
const client = new Client({
|
||||
node: 'http://localhost:9200',
|
||||
// Disable agent and keep-alive
|
||||
agent: false
|
||||
})
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `nodeFilter`
|
||||
|
||||
Type: `function`
|
||||
|
||||
Filter that indicates whether a node should be used for a request. Default function definition:
|
||||
|
||||
```js
|
||||
function defaultNodeFilter (node) {
|
||||
// avoid master only nodes
|
||||
if (node.roles.master === true &&
|
||||
node.roles.data === false &&
|
||||
node.roles.ingest === false) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `nodeSelector`
|
||||
|
||||
Type: `function`<br>
|
||||
Default: `'round-robin'`
|
||||
|
||||
Custom selection strategy.<br>
|
||||
Options: `'round-robin'`, `'random'`, custom function
|
||||
|
||||
Custom function example:
|
||||
|
||||
```js
|
||||
function nodeSelector (connections) {
|
||||
const index = calculateIndex()
|
||||
return connections[index]
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `generateRequestId`
|
||||
|
||||
Type: `function`<br>
|
||||
|
||||
function to generate the request id for every request, it takes two parameters, the request parameters and options. By default, it generates an incremental integer for every request.
|
||||
|
||||
Custom function example:
|
||||
|
||||
```js
|
||||
function generateRequestId (params, options) {
|
||||
// your id generation logic
|
||||
// must be syncronous
|
||||
return 'id'
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `name`
|
||||
|
||||
Type: `string, symbol`<br>
|
||||
Default: `elasticsearch-js`
|
||||
|
||||
The name to identify the client instance in the events.
|
||||
|
||||
---
|
||||
|
||||
### `opaqueIdPrefix`
|
||||
|
||||
Type: `string`<br>
|
||||
Default: `null`
|
||||
|
||||
A string that will be use to prefix any `X-Opaque-Id` header.
|
||||
See [`X-Opaque-Id` support](/reference/observability.md#_x_opaque_id_support) for more details.
|
||||
|
||||
---
|
||||
|
||||
### `headers`
|
||||
|
||||
Type: `object`<br>
|
||||
Default: `{}`
|
||||
|
||||
A set of custom headers to send in every request.
|
||||
|
||||
---
|
||||
|
||||
### `context`
|
||||
|
||||
Type: `object`<br>
|
||||
Default: `null`
|
||||
|
||||
A custom object that you can use for observability in your events. It will be merged with the API level context option.
|
||||
|
||||
---
|
||||
|
||||
### `enableMetaHeader`
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `true`
|
||||
|
||||
If true, adds an header named `'x-elastic-client-meta'`, containing some minimal telemetry data, such as the client and platform version.
|
||||
|
||||
---
|
||||
|
||||
### `cloud`
|
||||
|
||||
Type: `object`<br>
|
||||
Default: `null`
|
||||
|
||||
Custom configuration for connecting to [Elastic Cloud](https://cloud.elastic.co). See [Authentication](/reference/connecting.md) for more details.
|
||||
|
||||
Cloud configuration example:
|
||||
|
||||
```js
|
||||
const client = new Client({
|
||||
cloud: {
|
||||
id: '<cloud-id>'
|
||||
},
|
||||
auth: {
|
||||
username: 'elastic',
|
||||
password: 'changeme'
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `disablePrototypePoisoningProtection`
|
||||
|
||||
Default: `true`
|
||||
|
||||
`boolean`, `'proto'`, `'constructor'` - The client can protect you against prototype poisoning attacks. For more information, refer to [Square Brackets are the Enemy](https://web.archive.org/web/20200319091159/https://hueniverse.com/square-brackets-are-the-enemy-ff5b9fd8a3e8?gi=184a27ee2a08). If needed, you can enable prototype poisoning protection entirely (`false`) or one of the two checks (`'proto'` or `'constructor'`). For performance reasons, it is disabled by default. To learn more, refer to the [`secure-json-parse` documentation](https://github.com/fastify/secure-json-parse).
|
||||
|
||||
---
|
||||
|
||||
### `caFingerprint`
|
||||
|
||||
Type: `string`<br>
|
||||
Default: `null`
|
||||
|
||||
If configured, verify that the fingerprint of the CA certificate that has signed the certificate of the server matches the supplied fingerprint. Only accepts SHA256 digest fingerprints.
|
||||
|
||||
---
|
||||
|
||||
### `maxResponseSize`
|
||||
|
||||
Type: `number`<br>
|
||||
Default: `null`
|
||||
|
||||
When configured, `maxResponseSize` verifies that the uncompressed response size is lower than the configured number. If it’s higher, the request will be canceled. The `maxResponseSize` cannot be higher than the value of `buffer.constants.MAX_STRING_LENGTH`.
|
||||
|
||||
---
|
||||
|
||||
### `maxCompressedResponseSize`
|
||||
|
||||
Type: `number`<br>
|
||||
Default: `null`
|
||||
|
||||
When configured, `maxCompressedResponseSize` verifies that the compressed response size is lower than the configured number. If it’s higher, the request will be canceled. The `maxCompressedResponseSize` cannot be higher than the value of `buffer.constants.MAX_STRING_LENGTH`.
|
||||
|
||||
---
|
||||
|
||||
### `redaction`
|
||||
|
||||
Type: `object`<br>
|
||||
Default: A configuration that will replace known sources of sensitive data in `Error` metadata
|
||||
|
||||
Options for how to redact potentially sensitive data from metadata attached to `Error` objects
|
||||
|
||||
::::{note}
|
||||
[Read about redaction](/reference/advanced-config.md#redaction) for more details
|
||||
::::
|
||||
|
||||
---
|
||||
|
||||
### `serverMode`
|
||||
|
||||
Type: `string`<br>
|
||||
Default: `"stack"`
|
||||
|
||||
Setting to `"stack"` sets defaults assuming a traditional (non-serverless) {{es}} instance. Setting to `"serverless"` sets defaults to work more seamlessly with [Elastic Cloud Serverless](https://www.elastic.co/guide/en/serverless/current/intro.html), like enabling compression and disabling features that assume the possibility of multiple {{es}} nodes.
|
||||
|
||||
@ -11,15 +11,12 @@ The client comes with an handy collection of helpers to give you a more comforta
|
||||
The client helpers are experimental, and the API may change in the next minor releases. The helpers will not work in any Node.js version lower than 10.
|
||||
::::
|
||||
|
||||
|
||||
|
||||
## Bulk helper [bulk-helper]
|
||||
|
||||
Added in `v7.7.0`
|
||||
|
||||
Running bulk requests can be complex due to the shape of the API, this helper aims to provide a nicer developer experience around the Bulk API.
|
||||
|
||||
|
||||
### Usage [_usage_3]
|
||||
|
||||
```js
|
||||
@ -67,10 +64,8 @@ To create a new instance of the Bulk helper, access it as shown in the example a
|
||||
| `wait` | How much time to wait before retries in milliseconds.<br> *Default:* 5000.<br><br>```js<br>const b = client.helpers.bulk({<br> wait: 3000<br>})<br>```<br> |
|
||||
| `refreshOnCompletion` | If `true`, at the end of the bulk operation it runs a refresh on all indices or on the specified indices.<br> *Default:* false.<br><br>```js<br>const b = client.helpers.bulk({<br> refreshOnCompletion: true<br> // or<br> refreshOnCompletion: 'index-name'<br>})<br>```<br> |
|
||||
|
||||
|
||||
### Supported operations [_supported_operations]
|
||||
|
||||
|
||||
#### Index [_index_2]
|
||||
|
||||
```js
|
||||
@ -84,7 +79,6 @@ client.helpers.bulk({
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
#### Create [_create_4]
|
||||
|
||||
```js
|
||||
@ -98,7 +92,6 @@ client.helpers.bulk({
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
#### Update [_update_3]
|
||||
|
||||
```js
|
||||
@ -116,7 +109,6 @@ client.helpers.bulk({
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
#### Delete [_delete_10]
|
||||
|
||||
```js
|
||||
@ -130,7 +122,6 @@ client.helpers.bulk({
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
### Abort a bulk operation [_abort_a_bulk_operation]
|
||||
|
||||
If needed, you can abort a bulk operation at any time. The bulk helper returns a [thenable](https://promisesaplus.com/), which has an `abort` method.
|
||||
@ -139,7 +130,6 @@ If needed, you can abort a bulk operation at any time. The bulk helper returns a
|
||||
The abort method stops the execution of the bulk operation, but if you are using a concurrency higher than one, the operations that are already running will not be stopped.
|
||||
::::
|
||||
|
||||
|
||||
```js
|
||||
const { createReadStream } = require('fs')
|
||||
const split = require('split2')
|
||||
@ -164,7 +154,6 @@ const b = client.helpers.bulk({
|
||||
console.log(await b)
|
||||
```
|
||||
|
||||
|
||||
### Passing custom options to the Bulk API [_passing_custom_options_to_the_bulk_api]
|
||||
|
||||
You can pass any option supported by the link: [Bulk API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-bulk) to the helper, and the helper uses those options in conjunction with the Bulk API call.
|
||||
@ -181,7 +170,6 @@ const result = await client.helpers.bulk({
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
### Usage with an async generator [_usage_with_an_async_generator]
|
||||
|
||||
```js
|
||||
@ -214,7 +202,6 @@ const result = await client.helpers.bulk({
|
||||
console.log(result)
|
||||
```
|
||||
|
||||
|
||||
### Modifying a document before operation [_modifying_a_document_before_operation]
|
||||
|
||||
Added in `v8.8.2`
|
||||
@ -241,14 +228,12 @@ const result = await client.helpers.bulk({
|
||||
console.log(result)
|
||||
```
|
||||
|
||||
|
||||
## Multi search helper [multi-search-helper]
|
||||
|
||||
Added in `v7.8.0`
|
||||
|
||||
If you send search request at a high rate, this helper might be useful for you. It uses the multi search API under the hood to batch the requests and improve the overall performances of your application. The `result` exposes a `documents` property as well, which allows you to access directly the hits sources.
|
||||
|
||||
|
||||
### Usage [_usage_4]
|
||||
|
||||
```js
|
||||
@ -278,7 +263,6 @@ To create a new instance of the multi search (msearch) helper, you should access
|
||||
| `retries` | How many times an operation is retried before to resolve the request. An operation is retried only in case of a 429 error.<br> *Default:* Client max retries.<br><br>```js<br>const m = client.helpers.msearch({<br> retries: 3<br>})<br>```<br> |
|
||||
| `wait` | How much time to wait before retries in milliseconds.<br> *Default:* 5000.<br><br>```js<br>const m = client.helpers.msearch({<br> wait: 3000<br>})<br>```<br> |
|
||||
|
||||
|
||||
### Stopping the msearch helper [_stopping_the_msearch_helper]
|
||||
|
||||
If needed, you can stop an msearch processor at any time. The msearch helper returns a [thenable](https://promisesaplus.com/), which has an `stop` method.
|
||||
@ -291,7 +275,6 @@ The `stop` method accepts an optional error, that will be dispatched every subse
|
||||
The stop method stops the execution of the msearch processor, but if you are using a concurrency higher than one, the operations that are already running will not be stopped.
|
||||
::::
|
||||
|
||||
|
||||
```js
|
||||
const { Client } = require('@elastic/elasticsearch')
|
||||
|
||||
@ -318,7 +301,6 @@ m.search(
|
||||
setImmediate(() => m.stop())
|
||||
```
|
||||
|
||||
|
||||
## Search helper [search-helper]
|
||||
|
||||
Added in `v7.7.0`
|
||||
@ -340,7 +322,6 @@ for (const doc of documents) {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Scroll search helper [scroll-search-helper]
|
||||
|
||||
Added in `v7.7.0`
|
||||
@ -362,7 +343,6 @@ for await (const result of scrollSearch) {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Clear a scroll search [_clear_a_scroll_search]
|
||||
|
||||
If needed, you can clear a scroll search by calling `result.clear()`:
|
||||
@ -375,7 +355,6 @@ for await (const result of scrollSearch) {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Quickly getting the documents [_quickly_getting_the_documents]
|
||||
|
||||
If you only need the documents from the result of a scroll search, you can access them via `result.documents`:
|
||||
@ -386,7 +365,6 @@ for await (const result of scrollSearch) {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Scroll documents helper [scroll-documents-helper]
|
||||
|
||||
Added in `v7.7.0`
|
||||
@ -408,15 +386,12 @@ for await (const doc of scrollSearch) {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## ES|QL helper [esql-helper]
|
||||
|
||||
ES|QL queries can return their results in [several formats](docs-content://explore-analyze/query-filter/languages/esql-rest.md#esql-rest-format). The default JSON format returned by ES|QL queries contains arrays of values for each row, with column names and types returned separately:
|
||||
|
||||
|
||||
### Usage [_usage_5]
|
||||
|
||||
|
||||
#### `toRecords` [_torecords]
|
||||
|
||||
Added in `v8.14.0`
|
||||
@ -494,7 +469,6 @@ const result = await client.helpers
|
||||
.toRecords<EventLog>()
|
||||
```
|
||||
|
||||
|
||||
#### `toArrowReader` [_toarrowreader]
|
||||
|
||||
Added in `v8.16.0`
|
||||
@ -516,7 +490,6 @@ for (const recordBatch of reader) {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
#### `toArrowTable` [_toarrowtable]
|
||||
|
||||
Added in `v8.16.0`
|
||||
|
||||
@ -7,13 +7,8 @@ mapped_pages:
|
||||
|
||||
The client is designed to be easily configured for your needs. In the following section, you can see the possible options that you can use to configure it.
|
||||
|
||||
* [Basic configuration](/reference/basic-config.md)
|
||||
* [Advanced configuration](/reference/advanced-config.md)
|
||||
* [Timeout best practices](docs-content://troubleshoot/elasticsearch/elasticsearch-client-javascript-api/nodejs.md)
|
||||
* [Creating a child client](/reference/child.md)
|
||||
* [Testing](/reference/client-testing.md)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- [Basic configuration](/reference/basic-config.md)
|
||||
- [Advanced configuration](/reference/advanced-config.md)
|
||||
- [Timeout best practices](docs-content://troubleshoot/elasticsearch/elasticsearch-client-javascript-api/nodejs.md)
|
||||
- [Creating a child client](/reference/child.md)
|
||||
- [Testing](/reference/client-testing.md)
|
||||
|
||||
@ -11,7 +11,6 @@ This page contains the information you need to connect and use the Client with {
|
||||
|
||||
This document contains code snippets to show you how to connect to various {{es}} providers.
|
||||
|
||||
|
||||
### Elastic Cloud [auth-ec]
|
||||
|
||||
If you are using [Elastic Cloud](https://www.elastic.co/cloud), the client offers an easy way to connect to it via the `cloud` option. You must pass the Cloud ID that you can find in the cloud console, then your username and password inside the `auth` option.
|
||||
@ -20,12 +19,10 @@ If you are using [Elastic Cloud](https://www.elastic.co/cloud), the client offer
|
||||
When connecting to Elastic Cloud, the client will automatically enable both request and response compression by default, since it yields significant throughput improvements. Moreover, the client will also set the tls option `secureProtocol` to `TLSv1_2_method` unless specified otherwise. You can still override this option by configuring them.
|
||||
::::
|
||||
|
||||
|
||||
::::{important}
|
||||
Do not enable sniffing when using Elastic Cloud, since the nodes are behind a load balancer, Elastic Cloud will take care of everything for you. Take a look [here](https://www.elastic.co/blog/elasticsearch-sniffing-best-practices-what-when-why-how) to know more.
|
||||
::::
|
||||
|
||||
|
||||
```js
|
||||
const { Client } = require('@elastic/elasticsearch')
|
||||
const client = new Client({
|
||||
@ -39,6 +36,24 @@ const client = new Client({
|
||||
})
|
||||
```
|
||||
|
||||
## Connecting to an Elastic Cloud Serverless instance [connect-serverless]
|
||||
|
||||
The Node.js client is built to support connecting to [Elastic Cloud Serverless](https://www.elastic.co/guide/en/serverless/current/intro.html). By setting the `serverMode` option to `"serverless"`, several default options will be modified to better suit the serverless environment.
|
||||
|
||||
```js
|
||||
const { Client } = require('@elastic/elasticsearch')
|
||||
const client = new Client({
|
||||
cloud: {
|
||||
id: '<cloud-id>'
|
||||
},
|
||||
auth: {
|
||||
username: 'elastic',
|
||||
password: 'changeme'
|
||||
},
|
||||
serverMode: 'serverless'
|
||||
})
|
||||
|
||||
```
|
||||
|
||||
## Connecting to a self-managed cluster [connect-self-managed-new]
|
||||
|
||||
@ -62,7 +77,6 @@ When you start {{es}} for the first time you’ll see a distinct block like the
|
||||
|
||||
Depending on the circumstances there are two options for verifying the HTTPS connection, either verifying with the CA certificate itself or via the HTTP CA certificate fingerprint.
|
||||
|
||||
|
||||
### TLS configuration [auth-tls]
|
||||
|
||||
The generated root CA certificate can be found in the `certs` directory in your {{es}} config location (`$ES_CONF_PATH/certs/http_ca.crt`). If you’re running {{es}} in Docker there is [additional documentation for retrieving the CA certificate](docs-content://deploy-manage/deploy/self-managed/install-elasticsearch-with-docker.md).
|
||||
@ -84,7 +98,6 @@ const client = new Client({
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
### CA fingerprint [auth-ca-fingerprint]
|
||||
|
||||
You can configure the client to only trust certificates that are signed by a specific CA certificate (CA certificate pinning) by providing a `caFingerprint` option. This will verify that the fingerprint of the CA certificate that has signed the certificate of the server matches the supplied value. You must configure a SHA256 digest.
|
||||
@ -125,14 +138,12 @@ The output of `openssl x509` will look something like this:
|
||||
SHA256 Fingerprint=A5:2D:D9:35:11:E8:C6:04:5E:21:F1:66:54:B7:7C:9E:E0:F3:4A:EA:26:D9:F4:03:20:B5:31:C4:74:67:62:28
|
||||
```
|
||||
|
||||
|
||||
## Connecting without security enabled [connect-no-security]
|
||||
|
||||
::::{warning}
|
||||
Running {{es}} without security enabled is not recommended.
|
||||
::::
|
||||
|
||||
|
||||
If your cluster is configured with [security explicitly disabled](elasticsearch://reference/elasticsearch/configuration-reference/security-settings.md) then you can connect via HTTP:
|
||||
|
||||
```js
|
||||
@ -142,12 +153,10 @@ const client = new Client({
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
## Authentication strategies [auth-strategies]
|
||||
|
||||
Following you can find all the supported authentication strategies.
|
||||
|
||||
|
||||
### ApiKey authentication [auth-apikey]
|
||||
|
||||
You can use the [ApiKey](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-api-key) authentication by passing the `apiKey` parameter via the `auth` option. The `apiKey` parameter can be either a base64 encoded string or an object with the values that you can obtain from the [create api key endpoint](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-api-key).
|
||||
@ -156,7 +165,6 @@ You can use the [ApiKey](https://www.elastic.co/docs/api/doc/elasticsearch/opera
|
||||
If you provide both basic authentication credentials and the ApiKey configuration, the ApiKey takes precedence.
|
||||
::::
|
||||
|
||||
|
||||
```js
|
||||
const { Client } = require('@elastic/elasticsearch')
|
||||
const client = new Client({
|
||||
@ -180,7 +188,6 @@ const client = new Client({
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
### Bearer authentication [auth-bearer]
|
||||
|
||||
You can provide your credentials by passing the `bearer` token parameter via the `auth` option. Useful for [service account tokens](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-service-token). Be aware that it does not handle automatic token refresh.
|
||||
@ -195,7 +202,6 @@ const client = new Client({
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
### Basic authentication [auth-basic]
|
||||
|
||||
You can provide your credentials by passing the `username` and `password` parameters via the `auth` option.
|
||||
@ -204,7 +210,6 @@ You can provide your credentials by passing the `username` and `password` parame
|
||||
If you provide both basic authentication credentials and the Api Key configuration, the Api Key will take precedence.
|
||||
::::
|
||||
|
||||
|
||||
```js
|
||||
const { Client } = require('@elastic/elasticsearch')
|
||||
const client = new Client({
|
||||
@ -225,7 +230,6 @@ const client = new Client({
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
## Usage [client-usage]
|
||||
|
||||
Using the client is straightforward, it supports all the public APIs of {{es}}, and every method exposes the same signature.
|
||||
@ -278,8 +282,6 @@ In this case, the result will be:
|
||||
The body is a boolean value when you use `HEAD` APIs.
|
||||
::::
|
||||
|
||||
|
||||
|
||||
### Aborting a request [_aborting_a_request]
|
||||
|
||||
If needed, you can abort a running request by using the `AbortController` standard.
|
||||
@ -288,7 +290,6 @@ If needed, you can abort a running request by using the `AbortController` standa
|
||||
If you abort a request, the request will fail with a `RequestAbortedError`.
|
||||
::::
|
||||
|
||||
|
||||
```js
|
||||
const AbortController = require('node-abort-controller')
|
||||
const { Client } = require('@elastic/elasticsearch')
|
||||
@ -308,7 +309,6 @@ const result = await client.search({
|
||||
}, { signal: abortController.signal })
|
||||
```
|
||||
|
||||
|
||||
### Request specific options [_request_specific_options]
|
||||
|
||||
If needed you can pass request specific options in a second object:
|
||||
@ -352,7 +352,6 @@ The supported request specific options are:
|
||||
|
||||
This section illustrates the best practices for leveraging the {{es}} client in a Function-as-a-Service (FaaS) environment. The most influential optimization is to initialize the client outside of the function, the global scope. This practice does not only improve performance but also enables background functionality as – for example – [sniffing](https://www.elastic.co/blog/elasticsearch-sniffing-best-practices-what-when-why-how). The following examples provide a skeleton for the best practices.
|
||||
|
||||
|
||||
### GCP Cloud Functions [_gcp_cloud_functions]
|
||||
|
||||
```js
|
||||
@ -369,7 +368,6 @@ exports.testFunction = async function (req, res) {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### AWS Lambda [_aws_lambda]
|
||||
|
||||
```js
|
||||
@ -386,7 +384,6 @@ exports.handler = async function (event, context) {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Azure Functions [_azure_functions]
|
||||
|
||||
```js
|
||||
@ -410,7 +407,6 @@ Resources used to assess these recommendations:
|
||||
* [Azure Functions Python developer guide](https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-python?tabs=azurecli-linux%2Capplication-level#global-variables)
|
||||
* [AWS Lambda: Comparing the effect of global scope](https://docs.aws.amazon.com/lambda/latest/operatorguide/global-scope.html)
|
||||
|
||||
|
||||
## Connecting through a proxy [client-connect-proxy]
|
||||
|
||||
Added in `v7.10.0`
|
||||
@ -421,7 +417,6 @@ If you need to pass through an http(s) proxy for connecting to {{es}}, the clien
|
||||
In versions 8.0+ of the client, the default `Connection` type is set to `UndiciConnection`, which does not support proxy configurations. To use a proxy, you will need to use the `HttpConnection` class from `@elastic/transport` instead.
|
||||
::::
|
||||
|
||||
|
||||
```js
|
||||
import { HttpConnection } from '@elastic/transport'
|
||||
|
||||
@ -455,7 +450,6 @@ const client = new Client({
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
## Error handling [client-error-handling]
|
||||
|
||||
The client exposes a variety of error objects that you can use to enhance your error handling. You can find all the error objects inside the `errors` key in the client.
|
||||
@ -506,7 +500,6 @@ const client = new Client({
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
## Closing a client’s connections [close-connections]
|
||||
|
||||
If you would like to close all open connections being managed by an instance of the client, use the `close()` function:
|
||||
@ -518,7 +511,6 @@ const client = new Client({
|
||||
client.close();
|
||||
```
|
||||
|
||||
|
||||
## Automatic product check [product-check]
|
||||
|
||||
Since v7.14.0, the client performs a required product check before the first call. This pre-flight product check allows the client to establish the version of Elasticsearch that it is communicating with. The product check requires one additional HTTP request to be sent to the server as part of the request pipeline before the main API call is sent. In most cases, this will succeed during the very first API call that the client sends. Once the product check completes, no further product check HTTP requests are sent for subsequent API calls.
|
||||
|
||||
@ -45,13 +45,13 @@ const client = new Client({
|
||||
|
||||
Your Elasticsearch endpoint can be found on the **My deployment** page of your deployment:
|
||||
|
||||
:::{image} ../images/es-endpoint.jpg
|
||||
:::{image} images/es-endpoint.jpg
|
||||
:alt: Finding Elasticsearch endpoint
|
||||
:::
|
||||
|
||||
You can generate an API key on the **Management** page under Security.
|
||||
|
||||
:::{image} ../images/create-api-key.png
|
||||
:::{image} images/create-api-key.png
|
||||
:alt: Create API key
|
||||
:::
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 361 KiB After Width: | Height: | Size: 361 KiB |
@ -1,14 +1,11 @@
|
||||
---
|
||||
navigation_title: "Elasticsearch JavaScript Client"
|
||||
navigation_title: "Breaking changes"
|
||||
---
|
||||
|
||||
# Elasticsearch JavaScript Client breaking changes [elasticsearch-javascript-client-breaking-changes]
|
||||
Before you upgrade, carefully review the Elasticsearch JavaScript Client breaking changes and take the necessary steps to mitigate any issues.
|
||||
|
||||
To learn how to upgrade, check out <upgrade docs>.
|
||||
Breaking changes can impact your Elastic applications, potentially disrupting normal operations. Before you upgrade, carefully review the Elasticsearch JavaScript Client breaking changes and take the necessary steps to mitigate any issues. To learn how to upgrade, check [Upgrade](docs-content://deploy-manage/upgrade.md).
|
||||
|
||||
% ## Next version [elasticsearch-javascript-client-versionnext-breaking-changes]
|
||||
% **Release date:** Month day, year
|
||||
|
||||
% ::::{dropdown} Title of breaking change
|
||||
% Description of the breaking change.
|
||||
@ -18,7 +15,6 @@ To learn how to upgrade, check out <upgrade docs>.
|
||||
% ::::
|
||||
|
||||
% ## 9.0.0 [elasticsearch-javascript-client-900-breaking-changes]
|
||||
% **Release date:** March 25, 2025
|
||||
|
||||
% ::::{dropdown} Title of breaking change
|
||||
% Description of the breaking change.
|
||||
|
||||
@ -1,14 +1,13 @@
|
||||
---
|
||||
navigation_title: "Elasticsearch JavaScript Client"
|
||||
navigation_title: "Deprecations"
|
||||
---
|
||||
|
||||
# Elasticsearch JavaScript Client deprecations [elasticsearch-javascript-client-deprecations]
|
||||
Review the deprecated functionality for your Elasticsearch JavaScript Client version. While deprecations have no immediate impact, we strongly encourage you update your implementation after you upgrade.
|
||||
Over time, certain Elastic functionality becomes outdated and is replaced or removed. To help with the transition, Elastic deprecates functionality for a period before removal, giving you time to update your applications.
|
||||
|
||||
To learn how to upgrade, check out <uprade docs>.
|
||||
Review the deprecated functionality for Elasticsearch JavaScript Client. While deprecations have no immediate impact, we strongly encourage you update your implementation after you upgrade. To learn how to upgrade, check out [Upgrade](docs-content://deploy-manage/upgrade.md).
|
||||
|
||||
% ## Next version
|
||||
% **Release date:** Month day, year
|
||||
|
||||
% ::::{dropdown} Deprecation title
|
||||
% Description of the deprecation.
|
||||
@ -18,7 +17,6 @@ To learn how to upgrade, check out <uprade docs>.
|
||||
% ::::
|
||||
|
||||
% ## 9.0.0 [elasticsearch-javascript-client-900-deprecations]
|
||||
% **Release date:** March 25, 2025
|
||||
|
||||
% ::::{dropdown} Deprecation title
|
||||
% Description of the deprecation.
|
||||
|
||||
@ -1,26 +1,26 @@
|
||||
---
|
||||
navigation_title: "Elasticsearch JavaScript Client"
|
||||
mapped_pages:
|
||||
- https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/changelog-client.html
|
||||
---
|
||||
|
||||
# Elasticsearch JavaScript Client release notes [elasticsearch-javascript-client-release-notes]
|
||||
|
||||
Review the changes, fixes, and more in each version of Elasticsearch JavaScript Client.
|
||||
Review the changes, fixes, and more in each version of Elasticsearch JavaScript Client.
|
||||
|
||||
To check for security updates, go to [Security announcements for the Elastic stack](https://discuss.elastic.co/c/announcements/security-announcements/31).
|
||||
|
||||
% Release notes include only features, enhancements, and fixes. Add breaking changes, deprecations, and known issues to the applicable release notes sections.
|
||||
% Release notes include only features, enhancements, and fixes. Add breaking changes, deprecations, and known issues to the applicable release notes sections.
|
||||
|
||||
% ## version.next [elasticsearch-javascript-client-next-release-notes]
|
||||
% **Release date:** Month day, year
|
||||
|
||||
% ### Features and enhancements [elasticsearch-javascript-client-next-features-enhancements]
|
||||
% *
|
||||
% *
|
||||
|
||||
% ### Fixes [elasticsearch-javascript-client-next-fixes]
|
||||
% *
|
||||
% *
|
||||
|
||||
## 9.0.0 [elasticsearch-javascript-client-900-release-notes]
|
||||
**Release date:** March 25, 2025
|
||||
|
||||
### Features and enhancements [elasticsearch-javascript-client-900-features-enhancements]
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
---
|
||||
navigation_title: "Elasticsearch JavaScript Client"
|
||||
navigation_title: "Known issues"
|
||||
|
||||
---
|
||||
|
||||
|
||||
10
package.json
10
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@elastic/elasticsearch",
|
||||
"version": "9.0.0-alpha.4",
|
||||
"version": "9.0.0-alpha.5",
|
||||
"versionCanary": "9.0.0-canary.0",
|
||||
"description": "The official Elasticsearch client for Node.js",
|
||||
"main": "./index.js",
|
||||
@ -57,11 +57,11 @@
|
||||
"node": ">=18"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@elastic/request-converter": "8.18.0",
|
||||
"@elastic/request-converter": "9.0.0",
|
||||
"@sinonjs/fake-timers": "14.0.0",
|
||||
"@types/debug": "4.1.12",
|
||||
"@types/ms": "0.7.34",
|
||||
"@types/node": "22.13.10",
|
||||
"@types/node": "22.13.14",
|
||||
"@types/sinonjs__fake-timers": "8.1.5",
|
||||
"@types/split2": "4.2.3",
|
||||
"@types/stoppable": "1.1.3",
|
||||
@ -81,10 +81,10 @@
|
||||
"semver": "7.7.1",
|
||||
"split2": "4.2.0",
|
||||
"stoppable": "1.1.0",
|
||||
"tap": "21.0.2",
|
||||
"tap": "21.1.0",
|
||||
"ts-node": "10.9.2",
|
||||
"ts-standard": "12.0.2",
|
||||
"typescript": "5.7.3",
|
||||
"typescript": "5.8.2",
|
||||
"workq": "3.0.0",
|
||||
"xmlbuilder2": "3.1.1",
|
||||
"zx": "7.2.3"
|
||||
|
||||
@ -1,20 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright Elasticsearch B.V. and contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
@ -35,12 +21,133 @@ import {
|
||||
TransportResult
|
||||
} from '@elastic/transport'
|
||||
import * as T from '../types'
|
||||
interface That { transport: Transport }
|
||||
|
||||
interface That {
|
||||
transport: Transport
|
||||
acceptedParams: Record<string, { path: string[], body: string[], query: string[] }>
|
||||
}
|
||||
|
||||
const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty']
|
||||
|
||||
export default class AsyncSearch {
|
||||
transport: Transport
|
||||
acceptedParams: Record<string, { path: string[], body: string[], query: string[] }>
|
||||
constructor (transport: Transport) {
|
||||
this.transport = transport
|
||||
this.acceptedParams = {
|
||||
'async_search.delete': {
|
||||
path: [
|
||||
'id'
|
||||
],
|
||||
body: [],
|
||||
query: []
|
||||
},
|
||||
'async_search.get': {
|
||||
path: [
|
||||
'id'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'keep_alive',
|
||||
'typed_keys',
|
||||
'wait_for_completion_timeout'
|
||||
]
|
||||
},
|
||||
'async_search.status': {
|
||||
path: [
|
||||
'id'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'keep_alive'
|
||||
]
|
||||
},
|
||||
'async_search.submit': {
|
||||
path: [
|
||||
'index'
|
||||
],
|
||||
body: [
|
||||
'aggregations',
|
||||
'aggs',
|
||||
'collapse',
|
||||
'explain',
|
||||
'ext',
|
||||
'from',
|
||||
'highlight',
|
||||
'track_total_hits',
|
||||
'indices_boost',
|
||||
'docvalue_fields',
|
||||
'knn',
|
||||
'min_score',
|
||||
'post_filter',
|
||||
'profile',
|
||||
'query',
|
||||
'rescore',
|
||||
'script_fields',
|
||||
'search_after',
|
||||
'size',
|
||||
'slice',
|
||||
'sort',
|
||||
'_source',
|
||||
'fields',
|
||||
'suggest',
|
||||
'terminate_after',
|
||||
'timeout',
|
||||
'track_scores',
|
||||
'version',
|
||||
'seq_no_primary_term',
|
||||
'stored_fields',
|
||||
'pit',
|
||||
'runtime_mappings',
|
||||
'stats'
|
||||
],
|
||||
query: [
|
||||
'wait_for_completion_timeout',
|
||||
'keep_alive',
|
||||
'keep_on_completion',
|
||||
'allow_no_indices',
|
||||
'allow_partial_search_results',
|
||||
'analyzer',
|
||||
'analyze_wildcard',
|
||||
'batched_reduce_size',
|
||||
'ccs_minimize_roundtrips',
|
||||
'default_operator',
|
||||
'df',
|
||||
'docvalue_fields',
|
||||
'expand_wildcards',
|
||||
'explain',
|
||||
'ignore_throttled',
|
||||
'ignore_unavailable',
|
||||
'lenient',
|
||||
'max_concurrent_shard_requests',
|
||||
'preference',
|
||||
'request_cache',
|
||||
'routing',
|
||||
'search_type',
|
||||
'stats',
|
||||
'stored_fields',
|
||||
'suggest_field',
|
||||
'suggest_mode',
|
||||
'suggest_size',
|
||||
'suggest_text',
|
||||
'terminate_after',
|
||||
'timeout',
|
||||
'track_total_hits',
|
||||
'track_scores',
|
||||
'typed_keys',
|
||||
'rest_total_hits_as_int',
|
||||
'version',
|
||||
'_source',
|
||||
'_source_excludes',
|
||||
'_source_includes',
|
||||
'seq_no_primary_term',
|
||||
'q',
|
||||
'size',
|
||||
'from',
|
||||
'sort'
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -51,7 +158,10 @@ export default class AsyncSearch {
|
||||
async delete (this: That, params: T.AsyncSearchDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.AsyncSearchDeleteResponse, unknown>>
|
||||
async delete (this: That, params: T.AsyncSearchDeleteRequest, options?: TransportRequestOptions): Promise<T.AsyncSearchDeleteResponse>
|
||||
async delete (this: That, params: T.AsyncSearchDeleteRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['id']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['async_search.delete']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -93,7 +203,10 @@ export default class AsyncSearch {
|
||||
async get<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.AsyncSearchGetRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.AsyncSearchGetResponse<TDocument, TAggregations>, unknown>>
|
||||
async get<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.AsyncSearchGetRequest, options?: TransportRequestOptions): Promise<T.AsyncSearchGetResponse<TDocument, TAggregations>>
|
||||
async get<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.AsyncSearchGetRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['id']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['async_search.get']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -135,7 +248,10 @@ export default class AsyncSearch {
|
||||
async status (this: That, params: T.AsyncSearchStatusRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.AsyncSearchStatusResponse, unknown>>
|
||||
async status (this: That, params: T.AsyncSearchStatusRequest, options?: TransportRequestOptions): Promise<T.AsyncSearchStatusResponse>
|
||||
async status (this: That, params: T.AsyncSearchStatusRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['id']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['async_search.status']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -177,8 +293,12 @@ export default class AsyncSearch {
|
||||
async submit<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params?: T.AsyncSearchSubmitRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.AsyncSearchSubmitResponse<TDocument, TAggregations>, unknown>>
|
||||
async submit<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params?: T.AsyncSearchSubmitRequest, options?: TransportRequestOptions): Promise<T.AsyncSearchSubmitResponse<TDocument, TAggregations>>
|
||||
async submit<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params?: T.AsyncSearchSubmitRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['index']
|
||||
const acceptedBody: string[] = ['aggregations', 'aggs', 'collapse', 'explain', 'ext', 'from', 'highlight', 'track_total_hits', 'indices_boost', 'docvalue_fields', 'knn', 'min_score', 'post_filter', 'profile', 'query', 'rescore', 'script_fields', 'search_after', 'size', 'slice', 'sort', '_source', 'fields', 'suggest', 'terminate_after', 'timeout', 'track_scores', 'version', 'seq_no_primary_term', 'stored_fields', 'pit', 'runtime_mappings', 'stats']
|
||||
const {
|
||||
path: acceptedPath,
|
||||
body: acceptedBody,
|
||||
query: acceptedQuery
|
||||
} = this.acceptedParams['async_search.submit']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -205,8 +325,14 @@ export default class AsyncSearch {
|
||||
} else if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body' && key !== 'querystring') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
} else {
|
||||
body = body ?? {}
|
||||
// @ts-expect-error
|
||||
body[key] = params[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,20 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright Elasticsearch B.V. and contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
@ -35,12 +21,59 @@ import {
|
||||
TransportResult
|
||||
} from '@elastic/transport'
|
||||
import * as T from '../types'
|
||||
interface That { transport: Transport }
|
||||
|
||||
interface That {
|
||||
transport: Transport
|
||||
acceptedParams: Record<string, { path: string[], body: string[], query: string[] }>
|
||||
}
|
||||
|
||||
const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty']
|
||||
|
||||
export default class Autoscaling {
|
||||
transport: Transport
|
||||
acceptedParams: Record<string, { path: string[], body: string[], query: string[] }>
|
||||
constructor (transport: Transport) {
|
||||
this.transport = transport
|
||||
this.acceptedParams = {
|
||||
'autoscaling.delete_autoscaling_policy': {
|
||||
path: [
|
||||
'name'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'master_timeout',
|
||||
'timeout'
|
||||
]
|
||||
},
|
||||
'autoscaling.get_autoscaling_capacity': {
|
||||
path: [],
|
||||
body: [],
|
||||
query: [
|
||||
'master_timeout'
|
||||
]
|
||||
},
|
||||
'autoscaling.get_autoscaling_policy': {
|
||||
path: [
|
||||
'name'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'master_timeout'
|
||||
]
|
||||
},
|
||||
'autoscaling.put_autoscaling_policy': {
|
||||
path: [
|
||||
'name'
|
||||
],
|
||||
body: [
|
||||
'policy'
|
||||
],
|
||||
query: [
|
||||
'master_timeout',
|
||||
'timeout'
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -51,7 +84,10 @@ export default class Autoscaling {
|
||||
async deleteAutoscalingPolicy (this: That, params: T.AutoscalingDeleteAutoscalingPolicyRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.AutoscalingDeleteAutoscalingPolicyResponse, unknown>>
|
||||
async deleteAutoscalingPolicy (this: That, params: T.AutoscalingDeleteAutoscalingPolicyRequest, options?: TransportRequestOptions): Promise<T.AutoscalingDeleteAutoscalingPolicyResponse>
|
||||
async deleteAutoscalingPolicy (this: That, params: T.AutoscalingDeleteAutoscalingPolicyRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['autoscaling.delete_autoscaling_policy']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -93,7 +129,10 @@ export default class Autoscaling {
|
||||
async getAutoscalingCapacity (this: That, params?: T.AutoscalingGetAutoscalingCapacityRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.AutoscalingGetAutoscalingCapacityResponse, unknown>>
|
||||
async getAutoscalingCapacity (this: That, params?: T.AutoscalingGetAutoscalingCapacityRequest, options?: TransportRequestOptions): Promise<T.AutoscalingGetAutoscalingCapacityResponse>
|
||||
async getAutoscalingCapacity (this: That, params?: T.AutoscalingGetAutoscalingCapacityRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['autoscaling.get_autoscaling_capacity']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -133,7 +172,10 @@ export default class Autoscaling {
|
||||
async getAutoscalingPolicy (this: That, params: T.AutoscalingGetAutoscalingPolicyRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.AutoscalingGetAutoscalingPolicyResponse, unknown>>
|
||||
async getAutoscalingPolicy (this: That, params: T.AutoscalingGetAutoscalingPolicyRequest, options?: TransportRequestOptions): Promise<T.AutoscalingGetAutoscalingPolicyResponse>
|
||||
async getAutoscalingPolicy (this: That, params: T.AutoscalingGetAutoscalingPolicyRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['autoscaling.get_autoscaling_policy']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -175,8 +217,12 @@ export default class Autoscaling {
|
||||
async putAutoscalingPolicy (this: That, params: T.AutoscalingPutAutoscalingPolicyRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.AutoscalingPutAutoscalingPolicyResponse, unknown>>
|
||||
async putAutoscalingPolicy (this: That, params: T.AutoscalingPutAutoscalingPolicyRequest, options?: TransportRequestOptions): Promise<T.AutoscalingPutAutoscalingPolicyResponse>
|
||||
async putAutoscalingPolicy (this: That, params: T.AutoscalingPutAutoscalingPolicyRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
const acceptedBody: string[] = ['policy']
|
||||
const {
|
||||
path: acceptedPath,
|
||||
body: acceptedBody,
|
||||
query: acceptedQuery
|
||||
} = this.acceptedParams['autoscaling.put_autoscaling_policy']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -188,8 +234,14 @@ export default class Autoscaling {
|
||||
} else if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body' && key !== 'querystring') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
} else {
|
||||
body = body ?? {}
|
||||
// @ts-expect-error
|
||||
body[key] = params[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -1,20 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright Elasticsearch B.V. and contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
@ -35,7 +21,18 @@ import {
|
||||
TransportResult
|
||||
} from '@elastic/transport'
|
||||
import * as T from '../types'
|
||||
interface That { transport: Transport }
|
||||
|
||||
interface That {
|
||||
transport: Transport
|
||||
}
|
||||
|
||||
const acceptedParams: Record<string, { path: string[], body: string[], query: string[] }> = {
|
||||
capabilities: {
|
||||
path: [],
|
||||
body: [],
|
||||
query: []
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the specified combination of method, API, parameters, and arbitrary capabilities are supported
|
||||
@ -45,7 +42,10 @@ export default async function CapabilitiesApi (this: That, params?: T.TODO, opti
|
||||
export default async function CapabilitiesApi (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
|
||||
export default async function CapabilitiesApi (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<T.TODO>
|
||||
export default async function CapabilitiesApi (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = acceptedParams.capabilities
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
|
||||
@ -1,20 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright Elasticsearch B.V. and contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
@ -35,12 +21,336 @@ import {
|
||||
TransportResult
|
||||
} from '@elastic/transport'
|
||||
import * as T from '../types'
|
||||
interface That { transport: Transport }
|
||||
|
||||
interface That {
|
||||
transport: Transport
|
||||
acceptedParams: Record<string, { path: string[], body: string[], query: string[] }>
|
||||
}
|
||||
|
||||
export default class Cat {
|
||||
transport: Transport
|
||||
acceptedParams: Record<string, { path: string[], body: string[], query: string[] }>
|
||||
constructor (transport: Transport) {
|
||||
this.transport = transport
|
||||
this.acceptedParams = {
|
||||
'cat.aliases': {
|
||||
path: [
|
||||
'name'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'h',
|
||||
's',
|
||||
'expand_wildcards',
|
||||
'master_timeout'
|
||||
]
|
||||
},
|
||||
'cat.allocation': {
|
||||
path: [
|
||||
'node_id'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'bytes',
|
||||
'h',
|
||||
's',
|
||||
'local',
|
||||
'master_timeout'
|
||||
]
|
||||
},
|
||||
'cat.component_templates': {
|
||||
path: [
|
||||
'name'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'h',
|
||||
's',
|
||||
'local',
|
||||
'master_timeout'
|
||||
]
|
||||
},
|
||||
'cat.count': {
|
||||
path: [
|
||||
'index'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'h',
|
||||
's'
|
||||
]
|
||||
},
|
||||
'cat.fielddata': {
|
||||
path: [
|
||||
'fields'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'bytes',
|
||||
'fields',
|
||||
'h',
|
||||
's'
|
||||
]
|
||||
},
|
||||
'cat.health': {
|
||||
path: [],
|
||||
body: [],
|
||||
query: [
|
||||
'time',
|
||||
'ts',
|
||||
'h',
|
||||
's'
|
||||
]
|
||||
},
|
||||
'cat.help': {
|
||||
path: [],
|
||||
body: [],
|
||||
query: []
|
||||
},
|
||||
'cat.indices': {
|
||||
path: [
|
||||
'index'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'bytes',
|
||||
'expand_wildcards',
|
||||
'health',
|
||||
'include_unloaded_segments',
|
||||
'pri',
|
||||
'time',
|
||||
'master_timeout',
|
||||
'h',
|
||||
's'
|
||||
]
|
||||
},
|
||||
'cat.master': {
|
||||
path: [],
|
||||
body: [],
|
||||
query: [
|
||||
'h',
|
||||
's',
|
||||
'local',
|
||||
'master_timeout'
|
||||
]
|
||||
},
|
||||
'cat.ml_data_frame_analytics': {
|
||||
path: [
|
||||
'id'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'allow_no_match',
|
||||
'bytes',
|
||||
'h',
|
||||
's',
|
||||
'time'
|
||||
]
|
||||
},
|
||||
'cat.ml_datafeeds': {
|
||||
path: [
|
||||
'datafeed_id'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'allow_no_match',
|
||||
'h',
|
||||
's',
|
||||
'time'
|
||||
]
|
||||
},
|
||||
'cat.ml_jobs': {
|
||||
path: [
|
||||
'job_id'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'allow_no_match',
|
||||
'bytes',
|
||||
'h',
|
||||
's',
|
||||
'time'
|
||||
]
|
||||
},
|
||||
'cat.ml_trained_models': {
|
||||
path: [
|
||||
'model_id'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'allow_no_match',
|
||||
'bytes',
|
||||
'h',
|
||||
's',
|
||||
'from',
|
||||
'size',
|
||||
'time'
|
||||
]
|
||||
},
|
||||
'cat.nodeattrs': {
|
||||
path: [],
|
||||
body: [],
|
||||
query: [
|
||||
'h',
|
||||
's',
|
||||
'local',
|
||||
'master_timeout'
|
||||
]
|
||||
},
|
||||
'cat.nodes': {
|
||||
path: [],
|
||||
body: [],
|
||||
query: [
|
||||
'bytes',
|
||||
'full_id',
|
||||
'include_unloaded_segments',
|
||||
'h',
|
||||
's',
|
||||
'master_timeout',
|
||||
'time'
|
||||
]
|
||||
},
|
||||
'cat.pending_tasks': {
|
||||
path: [],
|
||||
body: [],
|
||||
query: [
|
||||
'h',
|
||||
's',
|
||||
'local',
|
||||
'master_timeout',
|
||||
'time'
|
||||
]
|
||||
},
|
||||
'cat.plugins': {
|
||||
path: [],
|
||||
body: [],
|
||||
query: [
|
||||
'h',
|
||||
's',
|
||||
'include_bootstrap',
|
||||
'local',
|
||||
'master_timeout'
|
||||
]
|
||||
},
|
||||
'cat.recovery': {
|
||||
path: [
|
||||
'index'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'active_only',
|
||||
'bytes',
|
||||
'detailed',
|
||||
'index',
|
||||
'h',
|
||||
's',
|
||||
'time'
|
||||
]
|
||||
},
|
||||
'cat.repositories': {
|
||||
path: [],
|
||||
body: [],
|
||||
query: [
|
||||
'h',
|
||||
's',
|
||||
'local',
|
||||
'master_timeout'
|
||||
]
|
||||
},
|
||||
'cat.segments': {
|
||||
path: [
|
||||
'index'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'bytes',
|
||||
'h',
|
||||
's',
|
||||
'local',
|
||||
'master_timeout'
|
||||
]
|
||||
},
|
||||
'cat.shards': {
|
||||
path: [
|
||||
'index'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'bytes',
|
||||
'h',
|
||||
's',
|
||||
'master_timeout',
|
||||
'time'
|
||||
]
|
||||
},
|
||||
'cat.snapshots': {
|
||||
path: [
|
||||
'repository'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'ignore_unavailable',
|
||||
'h',
|
||||
's',
|
||||
'master_timeout',
|
||||
'time'
|
||||
]
|
||||
},
|
||||
'cat.tasks': {
|
||||
path: [],
|
||||
body: [],
|
||||
query: [
|
||||
'actions',
|
||||
'detailed',
|
||||
'nodes',
|
||||
'parent_task_id',
|
||||
'h',
|
||||
's',
|
||||
'time',
|
||||
'timeout',
|
||||
'wait_for_completion'
|
||||
]
|
||||
},
|
||||
'cat.templates': {
|
||||
path: [
|
||||
'name'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'h',
|
||||
's',
|
||||
'local',
|
||||
'master_timeout'
|
||||
]
|
||||
},
|
||||
'cat.thread_pool': {
|
||||
path: [
|
||||
'thread_pool_patterns'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'h',
|
||||
's',
|
||||
'time',
|
||||
'local',
|
||||
'master_timeout'
|
||||
]
|
||||
},
|
||||
'cat.transforms': {
|
||||
path: [
|
||||
'transform_id'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'allow_no_match',
|
||||
'from',
|
||||
'h',
|
||||
's',
|
||||
'time',
|
||||
'size'
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -51,7 +361,10 @@ export default class Cat {
|
||||
async aliases (this: That, params?: T.CatAliasesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatAliasesResponse, unknown>>
|
||||
async aliases (this: That, params?: T.CatAliasesRequest, options?: TransportRequestOptions): Promise<T.CatAliasesResponse>
|
||||
async aliases (this: That, params?: T.CatAliasesRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cat.aliases']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -101,7 +414,10 @@ export default class Cat {
|
||||
async allocation (this: That, params?: T.CatAllocationRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatAllocationResponse, unknown>>
|
||||
async allocation (this: That, params?: T.CatAllocationRequest, options?: TransportRequestOptions): Promise<T.CatAllocationResponse>
|
||||
async allocation (this: That, params?: T.CatAllocationRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['node_id']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cat.allocation']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -151,7 +467,10 @@ export default class Cat {
|
||||
async componentTemplates (this: That, params?: T.CatComponentTemplatesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatComponentTemplatesResponse, unknown>>
|
||||
async componentTemplates (this: That, params?: T.CatComponentTemplatesRequest, options?: TransportRequestOptions): Promise<T.CatComponentTemplatesResponse>
|
||||
async componentTemplates (this: That, params?: T.CatComponentTemplatesRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cat.component_templates']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -201,7 +520,10 @@ export default class Cat {
|
||||
async count (this: That, params?: T.CatCountRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatCountResponse, unknown>>
|
||||
async count (this: That, params?: T.CatCountRequest, options?: TransportRequestOptions): Promise<T.CatCountResponse>
|
||||
async count (this: That, params?: T.CatCountRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['index']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cat.count']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -251,7 +573,10 @@ export default class Cat {
|
||||
async fielddata (this: That, params?: T.CatFielddataRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatFielddataResponse, unknown>>
|
||||
async fielddata (this: That, params?: T.CatFielddataRequest, options?: TransportRequestOptions): Promise<T.CatFielddataResponse>
|
||||
async fielddata (this: That, params?: T.CatFielddataRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['fields']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cat.fielddata']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -301,7 +626,10 @@ export default class Cat {
|
||||
async health (this: That, params?: T.CatHealthRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatHealthResponse, unknown>>
|
||||
async health (this: That, params?: T.CatHealthRequest, options?: TransportRequestOptions): Promise<T.CatHealthResponse>
|
||||
async health (this: That, params?: T.CatHealthRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cat.health']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -341,7 +669,10 @@ export default class Cat {
|
||||
async help (this: That, params?: T.CatHelpRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatHelpResponse, unknown>>
|
||||
async help (this: That, params?: T.CatHelpRequest, options?: TransportRequestOptions): Promise<T.CatHelpResponse>
|
||||
async help (this: That, params?: T.CatHelpRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cat.help']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -381,7 +712,10 @@ export default class Cat {
|
||||
async indices (this: That, params?: T.CatIndicesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatIndicesResponse, unknown>>
|
||||
async indices (this: That, params?: T.CatIndicesRequest, options?: TransportRequestOptions): Promise<T.CatIndicesResponse>
|
||||
async indices (this: That, params?: T.CatIndicesRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['index']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cat.indices']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -431,7 +765,10 @@ export default class Cat {
|
||||
async master (this: That, params?: T.CatMasterRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatMasterResponse, unknown>>
|
||||
async master (this: That, params?: T.CatMasterRequest, options?: TransportRequestOptions): Promise<T.CatMasterResponse>
|
||||
async master (this: That, params?: T.CatMasterRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cat.master']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -471,7 +808,10 @@ export default class Cat {
|
||||
async mlDataFrameAnalytics (this: That, params?: T.CatMlDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatMlDataFrameAnalyticsResponse, unknown>>
|
||||
async mlDataFrameAnalytics (this: That, params?: T.CatMlDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise<T.CatMlDataFrameAnalyticsResponse>
|
||||
async mlDataFrameAnalytics (this: That, params?: T.CatMlDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['id']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cat.ml_data_frame_analytics']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -521,7 +861,10 @@ export default class Cat {
|
||||
async mlDatafeeds (this: That, params?: T.CatMlDatafeedsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatMlDatafeedsResponse, unknown>>
|
||||
async mlDatafeeds (this: That, params?: T.CatMlDatafeedsRequest, options?: TransportRequestOptions): Promise<T.CatMlDatafeedsResponse>
|
||||
async mlDatafeeds (this: That, params?: T.CatMlDatafeedsRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['datafeed_id']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cat.ml_datafeeds']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -571,7 +914,10 @@ export default class Cat {
|
||||
async mlJobs (this: That, params?: T.CatMlJobsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatMlJobsResponse, unknown>>
|
||||
async mlJobs (this: That, params?: T.CatMlJobsRequest, options?: TransportRequestOptions): Promise<T.CatMlJobsResponse>
|
||||
async mlJobs (this: That, params?: T.CatMlJobsRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['job_id']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cat.ml_jobs']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -621,7 +967,10 @@ export default class Cat {
|
||||
async mlTrainedModels (this: That, params?: T.CatMlTrainedModelsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatMlTrainedModelsResponse, unknown>>
|
||||
async mlTrainedModels (this: That, params?: T.CatMlTrainedModelsRequest, options?: TransportRequestOptions): Promise<T.CatMlTrainedModelsResponse>
|
||||
async mlTrainedModels (this: That, params?: T.CatMlTrainedModelsRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['model_id']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cat.ml_trained_models']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -671,7 +1020,10 @@ export default class Cat {
|
||||
async nodeattrs (this: That, params?: T.CatNodeattrsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatNodeattrsResponse, unknown>>
|
||||
async nodeattrs (this: That, params?: T.CatNodeattrsRequest, options?: TransportRequestOptions): Promise<T.CatNodeattrsResponse>
|
||||
async nodeattrs (this: That, params?: T.CatNodeattrsRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cat.nodeattrs']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -711,7 +1063,10 @@ export default class Cat {
|
||||
async nodes (this: That, params?: T.CatNodesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatNodesResponse, unknown>>
|
||||
async nodes (this: That, params?: T.CatNodesRequest, options?: TransportRequestOptions): Promise<T.CatNodesResponse>
|
||||
async nodes (this: That, params?: T.CatNodesRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cat.nodes']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -751,7 +1106,10 @@ export default class Cat {
|
||||
async pendingTasks (this: That, params?: T.CatPendingTasksRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatPendingTasksResponse, unknown>>
|
||||
async pendingTasks (this: That, params?: T.CatPendingTasksRequest, options?: TransportRequestOptions): Promise<T.CatPendingTasksResponse>
|
||||
async pendingTasks (this: That, params?: T.CatPendingTasksRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cat.pending_tasks']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -791,7 +1149,10 @@ export default class Cat {
|
||||
async plugins (this: That, params?: T.CatPluginsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatPluginsResponse, unknown>>
|
||||
async plugins (this: That, params?: T.CatPluginsRequest, options?: TransportRequestOptions): Promise<T.CatPluginsResponse>
|
||||
async plugins (this: That, params?: T.CatPluginsRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cat.plugins']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -831,7 +1192,10 @@ export default class Cat {
|
||||
async recovery (this: That, params?: T.CatRecoveryRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatRecoveryResponse, unknown>>
|
||||
async recovery (this: That, params?: T.CatRecoveryRequest, options?: TransportRequestOptions): Promise<T.CatRecoveryResponse>
|
||||
async recovery (this: That, params?: T.CatRecoveryRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['index']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cat.recovery']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -881,7 +1245,10 @@ export default class Cat {
|
||||
async repositories (this: That, params?: T.CatRepositoriesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatRepositoriesResponse, unknown>>
|
||||
async repositories (this: That, params?: T.CatRepositoriesRequest, options?: TransportRequestOptions): Promise<T.CatRepositoriesResponse>
|
||||
async repositories (this: That, params?: T.CatRepositoriesRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cat.repositories']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -921,7 +1288,10 @@ export default class Cat {
|
||||
async segments (this: That, params?: T.CatSegmentsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatSegmentsResponse, unknown>>
|
||||
async segments (this: That, params?: T.CatSegmentsRequest, options?: TransportRequestOptions): Promise<T.CatSegmentsResponse>
|
||||
async segments (this: That, params?: T.CatSegmentsRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['index']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cat.segments']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -971,7 +1341,10 @@ export default class Cat {
|
||||
async shards (this: That, params?: T.CatShardsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatShardsResponse, unknown>>
|
||||
async shards (this: That, params?: T.CatShardsRequest, options?: TransportRequestOptions): Promise<T.CatShardsResponse>
|
||||
async shards (this: That, params?: T.CatShardsRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['index']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cat.shards']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -1021,7 +1394,10 @@ export default class Cat {
|
||||
async snapshots (this: That, params?: T.CatSnapshotsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatSnapshotsResponse, unknown>>
|
||||
async snapshots (this: That, params?: T.CatSnapshotsRequest, options?: TransportRequestOptions): Promise<T.CatSnapshotsResponse>
|
||||
async snapshots (this: That, params?: T.CatSnapshotsRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['repository']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cat.snapshots']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -1071,7 +1447,10 @@ export default class Cat {
|
||||
async tasks (this: That, params?: T.CatTasksRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatTasksResponse, unknown>>
|
||||
async tasks (this: That, params?: T.CatTasksRequest, options?: TransportRequestOptions): Promise<T.CatTasksResponse>
|
||||
async tasks (this: That, params?: T.CatTasksRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cat.tasks']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -1111,7 +1490,10 @@ export default class Cat {
|
||||
async templates (this: That, params?: T.CatTemplatesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatTemplatesResponse, unknown>>
|
||||
async templates (this: That, params?: T.CatTemplatesRequest, options?: TransportRequestOptions): Promise<T.CatTemplatesResponse>
|
||||
async templates (this: That, params?: T.CatTemplatesRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cat.templates']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -1161,7 +1543,10 @@ export default class Cat {
|
||||
async threadPool (this: That, params?: T.CatThreadPoolRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatThreadPoolResponse, unknown>>
|
||||
async threadPool (this: That, params?: T.CatThreadPoolRequest, options?: TransportRequestOptions): Promise<T.CatThreadPoolResponse>
|
||||
async threadPool (this: That, params?: T.CatThreadPoolRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['thread_pool_patterns']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cat.thread_pool']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -1211,7 +1596,10 @@ export default class Cat {
|
||||
async transforms (this: That, params?: T.CatTransformsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CatTransformsResponse, unknown>>
|
||||
async transforms (this: That, params?: T.CatTransformsRequest, options?: TransportRequestOptions): Promise<T.CatTransformsResponse>
|
||||
async transforms (this: That, params?: T.CatTransformsRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['transform_id']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cat.transforms']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
|
||||
@ -1,20 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright Elasticsearch B.V. and contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
@ -35,12 +21,185 @@ import {
|
||||
TransportResult
|
||||
} from '@elastic/transport'
|
||||
import * as T from '../types'
|
||||
interface That { transport: Transport }
|
||||
|
||||
interface That {
|
||||
transport: Transport
|
||||
acceptedParams: Record<string, { path: string[], body: string[], query: string[] }>
|
||||
}
|
||||
|
||||
const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty']
|
||||
|
||||
export default class Ccr {
|
||||
transport: Transport
|
||||
acceptedParams: Record<string, { path: string[], body: string[], query: string[] }>
|
||||
constructor (transport: Transport) {
|
||||
this.transport = transport
|
||||
this.acceptedParams = {
|
||||
'ccr.delete_auto_follow_pattern': {
|
||||
path: [
|
||||
'name'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'master_timeout'
|
||||
]
|
||||
},
|
||||
'ccr.follow': {
|
||||
path: [
|
||||
'index'
|
||||
],
|
||||
body: [
|
||||
'data_stream_name',
|
||||
'leader_index',
|
||||
'max_outstanding_read_requests',
|
||||
'max_outstanding_write_requests',
|
||||
'max_read_request_operation_count',
|
||||
'max_read_request_size',
|
||||
'max_retry_delay',
|
||||
'max_write_buffer_count',
|
||||
'max_write_buffer_size',
|
||||
'max_write_request_operation_count',
|
||||
'max_write_request_size',
|
||||
'read_poll_timeout',
|
||||
'remote_cluster',
|
||||
'settings'
|
||||
],
|
||||
query: [
|
||||
'master_timeout',
|
||||
'wait_for_active_shards'
|
||||
]
|
||||
},
|
||||
'ccr.follow_info': {
|
||||
path: [
|
||||
'index'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'master_timeout'
|
||||
]
|
||||
},
|
||||
'ccr.follow_stats': {
|
||||
path: [
|
||||
'index'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'timeout'
|
||||
]
|
||||
},
|
||||
'ccr.forget_follower': {
|
||||
path: [
|
||||
'index'
|
||||
],
|
||||
body: [
|
||||
'follower_cluster',
|
||||
'follower_index',
|
||||
'follower_index_uuid',
|
||||
'leader_remote_cluster'
|
||||
],
|
||||
query: [
|
||||
'timeout'
|
||||
]
|
||||
},
|
||||
'ccr.get_auto_follow_pattern': {
|
||||
path: [
|
||||
'name'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'master_timeout'
|
||||
]
|
||||
},
|
||||
'ccr.pause_auto_follow_pattern': {
|
||||
path: [
|
||||
'name'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'master_timeout'
|
||||
]
|
||||
},
|
||||
'ccr.pause_follow': {
|
||||
path: [
|
||||
'index'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'master_timeout'
|
||||
]
|
||||
},
|
||||
'ccr.put_auto_follow_pattern': {
|
||||
path: [
|
||||
'name'
|
||||
],
|
||||
body: [
|
||||
'remote_cluster',
|
||||
'follow_index_pattern',
|
||||
'leader_index_patterns',
|
||||
'leader_index_exclusion_patterns',
|
||||
'max_outstanding_read_requests',
|
||||
'settings',
|
||||
'max_outstanding_write_requests',
|
||||
'read_poll_timeout',
|
||||
'max_read_request_operation_count',
|
||||
'max_read_request_size',
|
||||
'max_retry_delay',
|
||||
'max_write_buffer_count',
|
||||
'max_write_buffer_size',
|
||||
'max_write_request_operation_count',
|
||||
'max_write_request_size'
|
||||
],
|
||||
query: [
|
||||
'master_timeout'
|
||||
]
|
||||
},
|
||||
'ccr.resume_auto_follow_pattern': {
|
||||
path: [
|
||||
'name'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'master_timeout'
|
||||
]
|
||||
},
|
||||
'ccr.resume_follow': {
|
||||
path: [
|
||||
'index'
|
||||
],
|
||||
body: [
|
||||
'max_outstanding_read_requests',
|
||||
'max_outstanding_write_requests',
|
||||
'max_read_request_operation_count',
|
||||
'max_read_request_size',
|
||||
'max_retry_delay',
|
||||
'max_write_buffer_count',
|
||||
'max_write_buffer_size',
|
||||
'max_write_request_operation_count',
|
||||
'max_write_request_size',
|
||||
'read_poll_timeout'
|
||||
],
|
||||
query: [
|
||||
'master_timeout'
|
||||
]
|
||||
},
|
||||
'ccr.stats': {
|
||||
path: [],
|
||||
body: [],
|
||||
query: [
|
||||
'master_timeout',
|
||||
'timeout'
|
||||
]
|
||||
},
|
||||
'ccr.unfollow': {
|
||||
path: [
|
||||
'index'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'master_timeout'
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -51,7 +210,10 @@ export default class Ccr {
|
||||
async deleteAutoFollowPattern (this: That, params: T.CcrDeleteAutoFollowPatternRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CcrDeleteAutoFollowPatternResponse, unknown>>
|
||||
async deleteAutoFollowPattern (this: That, params: T.CcrDeleteAutoFollowPatternRequest, options?: TransportRequestOptions): Promise<T.CcrDeleteAutoFollowPatternResponse>
|
||||
async deleteAutoFollowPattern (this: That, params: T.CcrDeleteAutoFollowPatternRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['ccr.delete_auto_follow_pattern']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -93,8 +255,12 @@ export default class Ccr {
|
||||
async follow (this: That, params: T.CcrFollowRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CcrFollowResponse, unknown>>
|
||||
async follow (this: That, params: T.CcrFollowRequest, options?: TransportRequestOptions): Promise<T.CcrFollowResponse>
|
||||
async follow (this: That, params: T.CcrFollowRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['index']
|
||||
const acceptedBody: string[] = ['data_stream_name', 'leader_index', 'max_outstanding_read_requests', 'max_outstanding_write_requests', 'max_read_request_operation_count', 'max_read_request_size', 'max_retry_delay', 'max_write_buffer_count', 'max_write_buffer_size', 'max_write_request_operation_count', 'max_write_request_size', 'read_poll_timeout', 'remote_cluster', 'settings']
|
||||
const {
|
||||
path: acceptedPath,
|
||||
body: acceptedBody,
|
||||
query: acceptedQuery
|
||||
} = this.acceptedParams['ccr.follow']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -116,8 +282,14 @@ export default class Ccr {
|
||||
} else if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body' && key !== 'querystring') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
} else {
|
||||
body = body ?? {}
|
||||
// @ts-expect-error
|
||||
body[key] = params[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -140,7 +312,10 @@ export default class Ccr {
|
||||
async followInfo (this: That, params: T.CcrFollowInfoRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CcrFollowInfoResponse, unknown>>
|
||||
async followInfo (this: That, params: T.CcrFollowInfoRequest, options?: TransportRequestOptions): Promise<T.CcrFollowInfoResponse>
|
||||
async followInfo (this: That, params: T.CcrFollowInfoRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['index']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['ccr.follow_info']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -182,7 +357,10 @@ export default class Ccr {
|
||||
async followStats (this: That, params: T.CcrFollowStatsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CcrFollowStatsResponse, unknown>>
|
||||
async followStats (this: That, params: T.CcrFollowStatsRequest, options?: TransportRequestOptions): Promise<T.CcrFollowStatsResponse>
|
||||
async followStats (this: That, params: T.CcrFollowStatsRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['index']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['ccr.follow_stats']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -224,8 +402,12 @@ export default class Ccr {
|
||||
async forgetFollower (this: That, params: T.CcrForgetFollowerRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CcrForgetFollowerResponse, unknown>>
|
||||
async forgetFollower (this: That, params: T.CcrForgetFollowerRequest, options?: TransportRequestOptions): Promise<T.CcrForgetFollowerResponse>
|
||||
async forgetFollower (this: That, params: T.CcrForgetFollowerRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['index']
|
||||
const acceptedBody: string[] = ['follower_cluster', 'follower_index', 'follower_index_uuid', 'leader_remote_cluster']
|
||||
const {
|
||||
path: acceptedPath,
|
||||
body: acceptedBody,
|
||||
query: acceptedQuery
|
||||
} = this.acceptedParams['ccr.forget_follower']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -247,8 +429,14 @@ export default class Ccr {
|
||||
} else if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body' && key !== 'querystring') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
} else {
|
||||
body = body ?? {}
|
||||
// @ts-expect-error
|
||||
body[key] = params[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -271,7 +459,10 @@ export default class Ccr {
|
||||
async getAutoFollowPattern (this: That, params?: T.CcrGetAutoFollowPatternRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CcrGetAutoFollowPatternResponse, unknown>>
|
||||
async getAutoFollowPattern (this: That, params?: T.CcrGetAutoFollowPatternRequest, options?: TransportRequestOptions): Promise<T.CcrGetAutoFollowPatternResponse>
|
||||
async getAutoFollowPattern (this: That, params?: T.CcrGetAutoFollowPatternRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['ccr.get_auto_follow_pattern']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -321,7 +512,10 @@ export default class Ccr {
|
||||
async pauseAutoFollowPattern (this: That, params: T.CcrPauseAutoFollowPatternRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CcrPauseAutoFollowPatternResponse, unknown>>
|
||||
async pauseAutoFollowPattern (this: That, params: T.CcrPauseAutoFollowPatternRequest, options?: TransportRequestOptions): Promise<T.CcrPauseAutoFollowPatternResponse>
|
||||
async pauseAutoFollowPattern (this: That, params: T.CcrPauseAutoFollowPatternRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['ccr.pause_auto_follow_pattern']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -363,7 +557,10 @@ export default class Ccr {
|
||||
async pauseFollow (this: That, params: T.CcrPauseFollowRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CcrPauseFollowResponse, unknown>>
|
||||
async pauseFollow (this: That, params: T.CcrPauseFollowRequest, options?: TransportRequestOptions): Promise<T.CcrPauseFollowResponse>
|
||||
async pauseFollow (this: That, params: T.CcrPauseFollowRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['index']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['ccr.pause_follow']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -405,8 +602,12 @@ export default class Ccr {
|
||||
async putAutoFollowPattern (this: That, params: T.CcrPutAutoFollowPatternRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CcrPutAutoFollowPatternResponse, unknown>>
|
||||
async putAutoFollowPattern (this: That, params: T.CcrPutAutoFollowPatternRequest, options?: TransportRequestOptions): Promise<T.CcrPutAutoFollowPatternResponse>
|
||||
async putAutoFollowPattern (this: That, params: T.CcrPutAutoFollowPatternRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
const acceptedBody: string[] = ['remote_cluster', 'follow_index_pattern', 'leader_index_patterns', 'leader_index_exclusion_patterns', 'max_outstanding_read_requests', 'settings', 'max_outstanding_write_requests', 'read_poll_timeout', 'max_read_request_operation_count', 'max_read_request_size', 'max_retry_delay', 'max_write_buffer_count', 'max_write_buffer_size', 'max_write_request_operation_count', 'max_write_request_size']
|
||||
const {
|
||||
path: acceptedPath,
|
||||
body: acceptedBody,
|
||||
query: acceptedQuery
|
||||
} = this.acceptedParams['ccr.put_auto_follow_pattern']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -428,8 +629,14 @@ export default class Ccr {
|
||||
} else if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body' && key !== 'querystring') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
} else {
|
||||
body = body ?? {}
|
||||
// @ts-expect-error
|
||||
body[key] = params[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -452,7 +659,10 @@ export default class Ccr {
|
||||
async resumeAutoFollowPattern (this: That, params: T.CcrResumeAutoFollowPatternRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CcrResumeAutoFollowPatternResponse, unknown>>
|
||||
async resumeAutoFollowPattern (this: That, params: T.CcrResumeAutoFollowPatternRequest, options?: TransportRequestOptions): Promise<T.CcrResumeAutoFollowPatternResponse>
|
||||
async resumeAutoFollowPattern (this: That, params: T.CcrResumeAutoFollowPatternRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['ccr.resume_auto_follow_pattern']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -494,8 +704,12 @@ export default class Ccr {
|
||||
async resumeFollow (this: That, params: T.CcrResumeFollowRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CcrResumeFollowResponse, unknown>>
|
||||
async resumeFollow (this: That, params: T.CcrResumeFollowRequest, options?: TransportRequestOptions): Promise<T.CcrResumeFollowResponse>
|
||||
async resumeFollow (this: That, params: T.CcrResumeFollowRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['index']
|
||||
const acceptedBody: string[] = ['max_outstanding_read_requests', 'max_outstanding_write_requests', 'max_read_request_operation_count', 'max_read_request_size', 'max_retry_delay', 'max_write_buffer_count', 'max_write_buffer_size', 'max_write_request_operation_count', 'max_write_request_size', 'read_poll_timeout']
|
||||
const {
|
||||
path: acceptedPath,
|
||||
body: acceptedBody,
|
||||
query: acceptedQuery
|
||||
} = this.acceptedParams['ccr.resume_follow']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -517,8 +731,14 @@ export default class Ccr {
|
||||
} else if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body' && key !== 'querystring') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
} else {
|
||||
body = body ?? {}
|
||||
// @ts-expect-error
|
||||
body[key] = params[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -541,7 +761,10 @@ export default class Ccr {
|
||||
async stats (this: That, params?: T.CcrStatsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CcrStatsResponse, unknown>>
|
||||
async stats (this: That, params?: T.CcrStatsRequest, options?: TransportRequestOptions): Promise<T.CcrStatsResponse>
|
||||
async stats (this: That, params?: T.CcrStatsRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['ccr.stats']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -581,7 +804,10 @@ export default class Ccr {
|
||||
async unfollow (this: That, params: T.CcrUnfollowRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CcrUnfollowResponse, unknown>>
|
||||
async unfollow (this: That, params: T.CcrUnfollowRequest, options?: TransportRequestOptions): Promise<T.CcrUnfollowResponse>
|
||||
async unfollow (this: That, params: T.CcrUnfollowRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['index']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['ccr.unfollow']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
|
||||
@ -1,20 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright Elasticsearch B.V. and contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
@ -35,7 +21,22 @@ import {
|
||||
TransportResult
|
||||
} from '@elastic/transport'
|
||||
import * as T from '../types'
|
||||
interface That { transport: Transport }
|
||||
|
||||
interface That {
|
||||
transport: Transport
|
||||
}
|
||||
|
||||
const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty']
|
||||
|
||||
const acceptedParams: Record<string, { path: string[], body: string[], query: string[] }> = {
|
||||
clear_scroll: {
|
||||
path: [],
|
||||
body: [
|
||||
'scroll_id'
|
||||
],
|
||||
query: []
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear a scrolling search. Clear the search context and results for a scrolling search.
|
||||
@ -45,8 +46,12 @@ export default async function ClearScrollApi (this: That, params?: T.ClearScroll
|
||||
export default async function ClearScrollApi (this: That, params?: T.ClearScrollRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClearScrollResponse, unknown>>
|
||||
export default async function ClearScrollApi (this: That, params?: T.ClearScrollRequest, options?: TransportRequestOptions): Promise<T.ClearScrollResponse>
|
||||
export default async function ClearScrollApi (this: That, params?: T.ClearScrollRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const acceptedBody: string[] = ['scroll_id']
|
||||
const {
|
||||
path: acceptedPath,
|
||||
body: acceptedBody,
|
||||
query: acceptedQuery
|
||||
} = acceptedParams.clear_scroll
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -69,8 +74,14 @@ export default async function ClearScrollApi (this: That, params?: T.ClearScroll
|
||||
} else if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body' && key !== 'querystring') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
} else {
|
||||
body = body ?? {}
|
||||
// @ts-expect-error
|
||||
body[key] = params[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,20 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright Elasticsearch B.V. and contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
@ -35,7 +21,22 @@ import {
|
||||
TransportResult
|
||||
} from '@elastic/transport'
|
||||
import * as T from '../types'
|
||||
interface That { transport: Transport }
|
||||
|
||||
interface That {
|
||||
transport: Transport
|
||||
}
|
||||
|
||||
const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty']
|
||||
|
||||
const acceptedParams: Record<string, { path: string[], body: string[], query: string[] }> = {
|
||||
close_point_in_time: {
|
||||
path: [],
|
||||
body: [
|
||||
'id'
|
||||
],
|
||||
query: []
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Close a point in time. A point in time must be opened explicitly before being used in search requests. The `keep_alive` parameter tells Elasticsearch how long it should persist. A point in time is automatically closed when the `keep_alive` period has elapsed. However, keeping points in time has a cost; close them as soon as they are no longer required for search requests.
|
||||
@ -45,8 +46,12 @@ export default async function ClosePointInTimeApi (this: That, params: T.ClosePo
|
||||
export default async function ClosePointInTimeApi (this: That, params: T.ClosePointInTimeRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClosePointInTimeResponse, unknown>>
|
||||
export default async function ClosePointInTimeApi (this: That, params: T.ClosePointInTimeRequest, options?: TransportRequestOptions): Promise<T.ClosePointInTimeResponse>
|
||||
export default async function ClosePointInTimeApi (this: That, params: T.ClosePointInTimeRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const acceptedBody: string[] = ['id']
|
||||
const {
|
||||
path: acceptedPath,
|
||||
body: acceptedBody,
|
||||
query: acceptedQuery
|
||||
} = acceptedParams.close_point_in_time
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -68,8 +73,14 @@ export default async function ClosePointInTimeApi (this: That, params: T.ClosePo
|
||||
} else if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body' && key !== 'querystring') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
} else {
|
||||
body = body ?? {}
|
||||
// @ts-expect-error
|
||||
body[key] = params[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,20 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright Elasticsearch B.V. and contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
@ -35,12 +21,202 @@ import {
|
||||
TransportResult
|
||||
} from '@elastic/transport'
|
||||
import * as T from '../types'
|
||||
interface That { transport: Transport }
|
||||
|
||||
interface That {
|
||||
transport: Transport
|
||||
acceptedParams: Record<string, { path: string[], body: string[], query: string[] }>
|
||||
}
|
||||
|
||||
const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty']
|
||||
|
||||
export default class Cluster {
|
||||
transport: Transport
|
||||
acceptedParams: Record<string, { path: string[], body: string[], query: string[] }>
|
||||
constructor (transport: Transport) {
|
||||
this.transport = transport
|
||||
this.acceptedParams = {
|
||||
'cluster.allocation_explain': {
|
||||
path: [],
|
||||
body: [
|
||||
'current_node',
|
||||
'index',
|
||||
'primary',
|
||||
'shard'
|
||||
],
|
||||
query: [
|
||||
'include_disk_info',
|
||||
'include_yes_decisions',
|
||||
'master_timeout'
|
||||
]
|
||||
},
|
||||
'cluster.delete_component_template': {
|
||||
path: [
|
||||
'name'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'master_timeout',
|
||||
'timeout'
|
||||
]
|
||||
},
|
||||
'cluster.delete_voting_config_exclusions': {
|
||||
path: [],
|
||||
body: [],
|
||||
query: [
|
||||
'master_timeout',
|
||||
'wait_for_removal'
|
||||
]
|
||||
},
|
||||
'cluster.exists_component_template': {
|
||||
path: [
|
||||
'name'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'master_timeout',
|
||||
'local'
|
||||
]
|
||||
},
|
||||
'cluster.get_component_template': {
|
||||
path: [
|
||||
'name'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'flat_settings',
|
||||
'include_defaults',
|
||||
'local',
|
||||
'master_timeout'
|
||||
]
|
||||
},
|
||||
'cluster.get_settings': {
|
||||
path: [],
|
||||
body: [],
|
||||
query: [
|
||||
'flat_settings',
|
||||
'include_defaults',
|
||||
'master_timeout',
|
||||
'timeout'
|
||||
]
|
||||
},
|
||||
'cluster.health': {
|
||||
path: [
|
||||
'index'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'expand_wildcards',
|
||||
'level',
|
||||
'local',
|
||||
'master_timeout',
|
||||
'timeout',
|
||||
'wait_for_active_shards',
|
||||
'wait_for_events',
|
||||
'wait_for_nodes',
|
||||
'wait_for_no_initializing_shards',
|
||||
'wait_for_no_relocating_shards',
|
||||
'wait_for_status'
|
||||
]
|
||||
},
|
||||
'cluster.info': {
|
||||
path: [
|
||||
'target'
|
||||
],
|
||||
body: [],
|
||||
query: []
|
||||
},
|
||||
'cluster.pending_tasks': {
|
||||
path: [],
|
||||
body: [],
|
||||
query: [
|
||||
'local',
|
||||
'master_timeout'
|
||||
]
|
||||
},
|
||||
'cluster.post_voting_config_exclusions': {
|
||||
path: [],
|
||||
body: [],
|
||||
query: [
|
||||
'node_names',
|
||||
'node_ids',
|
||||
'master_timeout',
|
||||
'timeout'
|
||||
]
|
||||
},
|
||||
'cluster.put_component_template': {
|
||||
path: [
|
||||
'name'
|
||||
],
|
||||
body: [
|
||||
'template',
|
||||
'version',
|
||||
'_meta',
|
||||
'deprecated'
|
||||
],
|
||||
query: [
|
||||
'create',
|
||||
'master_timeout'
|
||||
]
|
||||
},
|
||||
'cluster.put_settings': {
|
||||
path: [],
|
||||
body: [
|
||||
'persistent',
|
||||
'transient'
|
||||
],
|
||||
query: [
|
||||
'flat_settings',
|
||||
'master_timeout',
|
||||
'timeout'
|
||||
]
|
||||
},
|
||||
'cluster.remote_info': {
|
||||
path: [],
|
||||
body: [],
|
||||
query: []
|
||||
},
|
||||
'cluster.reroute': {
|
||||
path: [],
|
||||
body: [
|
||||
'commands'
|
||||
],
|
||||
query: [
|
||||
'dry_run',
|
||||
'explain',
|
||||
'metric',
|
||||
'retry_failed',
|
||||
'master_timeout',
|
||||
'timeout'
|
||||
]
|
||||
},
|
||||
'cluster.state': {
|
||||
path: [
|
||||
'metric',
|
||||
'index'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'allow_no_indices',
|
||||
'expand_wildcards',
|
||||
'flat_settings',
|
||||
'ignore_unavailable',
|
||||
'local',
|
||||
'master_timeout',
|
||||
'wait_for_metadata_version',
|
||||
'wait_for_timeout'
|
||||
]
|
||||
},
|
||||
'cluster.stats': {
|
||||
path: [
|
||||
'node_id'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'include_remotes',
|
||||
'timeout'
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -51,8 +227,12 @@ export default class Cluster {
|
||||
async allocationExplain (this: That, params?: T.ClusterAllocationExplainRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterAllocationExplainResponse, unknown>>
|
||||
async allocationExplain (this: That, params?: T.ClusterAllocationExplainRequest, options?: TransportRequestOptions): Promise<T.ClusterAllocationExplainResponse>
|
||||
async allocationExplain (this: That, params?: T.ClusterAllocationExplainRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const acceptedBody: string[] = ['current_node', 'index', 'primary', 'shard']
|
||||
const {
|
||||
path: acceptedPath,
|
||||
body: acceptedBody,
|
||||
query: acceptedQuery
|
||||
} = this.acceptedParams['cluster.allocation_explain']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -75,8 +255,14 @@ export default class Cluster {
|
||||
} else if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body' && key !== 'querystring') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
} else {
|
||||
body = body ?? {}
|
||||
// @ts-expect-error
|
||||
body[key] = params[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,7 +282,10 @@ export default class Cluster {
|
||||
async deleteComponentTemplate (this: That, params: T.ClusterDeleteComponentTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterDeleteComponentTemplateResponse, unknown>>
|
||||
async deleteComponentTemplate (this: That, params: T.ClusterDeleteComponentTemplateRequest, options?: TransportRequestOptions): Promise<T.ClusterDeleteComponentTemplateResponse>
|
||||
async deleteComponentTemplate (this: That, params: T.ClusterDeleteComponentTemplateRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cluster.delete_component_template']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -138,7 +327,10 @@ export default class Cluster {
|
||||
async deleteVotingConfigExclusions (this: That, params?: T.ClusterDeleteVotingConfigExclusionsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterDeleteVotingConfigExclusionsResponse, unknown>>
|
||||
async deleteVotingConfigExclusions (this: That, params?: T.ClusterDeleteVotingConfigExclusionsRequest, options?: TransportRequestOptions): Promise<T.ClusterDeleteVotingConfigExclusionsResponse>
|
||||
async deleteVotingConfigExclusions (this: That, params?: T.ClusterDeleteVotingConfigExclusionsRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cluster.delete_voting_config_exclusions']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -178,7 +370,10 @@ export default class Cluster {
|
||||
async existsComponentTemplate (this: That, params: T.ClusterExistsComponentTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterExistsComponentTemplateResponse, unknown>>
|
||||
async existsComponentTemplate (this: That, params: T.ClusterExistsComponentTemplateRequest, options?: TransportRequestOptions): Promise<T.ClusterExistsComponentTemplateResponse>
|
||||
async existsComponentTemplate (this: That, params: T.ClusterExistsComponentTemplateRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cluster.exists_component_template']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -220,7 +415,10 @@ export default class Cluster {
|
||||
async getComponentTemplate (this: That, params?: T.ClusterGetComponentTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterGetComponentTemplateResponse, unknown>>
|
||||
async getComponentTemplate (this: That, params?: T.ClusterGetComponentTemplateRequest, options?: TransportRequestOptions): Promise<T.ClusterGetComponentTemplateResponse>
|
||||
async getComponentTemplate (this: That, params?: T.ClusterGetComponentTemplateRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cluster.get_component_template']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -270,7 +468,10 @@ export default class Cluster {
|
||||
async getSettings (this: That, params?: T.ClusterGetSettingsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterGetSettingsResponse, unknown>>
|
||||
async getSettings (this: That, params?: T.ClusterGetSettingsRequest, options?: TransportRequestOptions): Promise<T.ClusterGetSettingsResponse>
|
||||
async getSettings (this: That, params?: T.ClusterGetSettingsRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cluster.get_settings']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -310,7 +511,10 @@ export default class Cluster {
|
||||
async health (this: That, params?: T.ClusterHealthRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterHealthResponse, unknown>>
|
||||
async health (this: That, params?: T.ClusterHealthRequest, options?: TransportRequestOptions): Promise<T.ClusterHealthResponse>
|
||||
async health (this: That, params?: T.ClusterHealthRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['index']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cluster.health']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -360,7 +564,10 @@ export default class Cluster {
|
||||
async info (this: That, params: T.ClusterInfoRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterInfoResponse, unknown>>
|
||||
async info (this: That, params: T.ClusterInfoRequest, options?: TransportRequestOptions): Promise<T.ClusterInfoResponse>
|
||||
async info (this: That, params: T.ClusterInfoRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['target']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cluster.info']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -402,7 +609,10 @@ export default class Cluster {
|
||||
async pendingTasks (this: That, params?: T.ClusterPendingTasksRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterPendingTasksResponse, unknown>>
|
||||
async pendingTasks (this: That, params?: T.ClusterPendingTasksRequest, options?: TransportRequestOptions): Promise<T.ClusterPendingTasksResponse>
|
||||
async pendingTasks (this: That, params?: T.ClusterPendingTasksRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cluster.pending_tasks']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -442,7 +652,10 @@ export default class Cluster {
|
||||
async postVotingConfigExclusions (this: That, params?: T.ClusterPostVotingConfigExclusionsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterPostVotingConfigExclusionsResponse, unknown>>
|
||||
async postVotingConfigExclusions (this: That, params?: T.ClusterPostVotingConfigExclusionsRequest, options?: TransportRequestOptions): Promise<T.ClusterPostVotingConfigExclusionsResponse>
|
||||
async postVotingConfigExclusions (this: That, params?: T.ClusterPostVotingConfigExclusionsRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cluster.post_voting_config_exclusions']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -482,8 +695,12 @@ export default class Cluster {
|
||||
async putComponentTemplate (this: That, params: T.ClusterPutComponentTemplateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterPutComponentTemplateResponse, unknown>>
|
||||
async putComponentTemplate (this: That, params: T.ClusterPutComponentTemplateRequest, options?: TransportRequestOptions): Promise<T.ClusterPutComponentTemplateResponse>
|
||||
async putComponentTemplate (this: That, params: T.ClusterPutComponentTemplateRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
const acceptedBody: string[] = ['template', 'version', '_meta', 'deprecated']
|
||||
const {
|
||||
path: acceptedPath,
|
||||
body: acceptedBody,
|
||||
query: acceptedQuery
|
||||
} = this.acceptedParams['cluster.put_component_template']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -505,8 +722,14 @@ export default class Cluster {
|
||||
} else if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body' && key !== 'querystring') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
} else {
|
||||
body = body ?? {}
|
||||
// @ts-expect-error
|
||||
body[key] = params[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -529,8 +752,12 @@ export default class Cluster {
|
||||
async putSettings (this: That, params?: T.ClusterPutSettingsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterPutSettingsResponse, unknown>>
|
||||
async putSettings (this: That, params?: T.ClusterPutSettingsRequest, options?: TransportRequestOptions): Promise<T.ClusterPutSettingsResponse>
|
||||
async putSettings (this: That, params?: T.ClusterPutSettingsRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const acceptedBody: string[] = ['persistent', 'transient']
|
||||
const {
|
||||
path: acceptedPath,
|
||||
body: acceptedBody,
|
||||
query: acceptedQuery
|
||||
} = this.acceptedParams['cluster.put_settings']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -553,8 +780,14 @@ export default class Cluster {
|
||||
} else if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body' && key !== 'querystring') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
} else {
|
||||
body = body ?? {}
|
||||
// @ts-expect-error
|
||||
body[key] = params[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -574,7 +807,10 @@ export default class Cluster {
|
||||
async remoteInfo (this: That, params?: T.ClusterRemoteInfoRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterRemoteInfoResponse, unknown>>
|
||||
async remoteInfo (this: That, params?: T.ClusterRemoteInfoRequest, options?: TransportRequestOptions): Promise<T.ClusterRemoteInfoResponse>
|
||||
async remoteInfo (this: That, params?: T.ClusterRemoteInfoRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cluster.remote_info']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -614,8 +850,12 @@ export default class Cluster {
|
||||
async reroute (this: That, params?: T.ClusterRerouteRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterRerouteResponse, unknown>>
|
||||
async reroute (this: That, params?: T.ClusterRerouteRequest, options?: TransportRequestOptions): Promise<T.ClusterRerouteResponse>
|
||||
async reroute (this: That, params?: T.ClusterRerouteRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const acceptedBody: string[] = ['commands']
|
||||
const {
|
||||
path: acceptedPath,
|
||||
body: acceptedBody,
|
||||
query: acceptedQuery
|
||||
} = this.acceptedParams['cluster.reroute']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -638,8 +878,14 @@ export default class Cluster {
|
||||
} else if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body' && key !== 'querystring') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
} else {
|
||||
body = body ?? {}
|
||||
// @ts-expect-error
|
||||
body[key] = params[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -659,7 +905,10 @@ export default class Cluster {
|
||||
async state (this: That, params?: T.ClusterStateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterStateResponse, unknown>>
|
||||
async state (this: That, params?: T.ClusterStateRequest, options?: TransportRequestOptions): Promise<T.ClusterStateResponse>
|
||||
async state (this: That, params?: T.ClusterStateRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['metric', 'index']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cluster.state']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -713,7 +962,10 @@ export default class Cluster {
|
||||
async stats (this: That, params?: T.ClusterStatsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ClusterStatsResponse, unknown>>
|
||||
async stats (this: That, params?: T.ClusterStatsRequest, options?: TransportRequestOptions): Promise<T.ClusterStatsResponse>
|
||||
async stats (this: That, params?: T.ClusterStatsRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['node_id']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['cluster.stats']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,20 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright Elasticsearch B.V. and contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
@ -35,7 +21,39 @@ import {
|
||||
TransportResult
|
||||
} from '@elastic/transport'
|
||||
import * as T from '../types'
|
||||
interface That { transport: Transport }
|
||||
|
||||
interface That {
|
||||
transport: Transport
|
||||
}
|
||||
|
||||
const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty']
|
||||
|
||||
const acceptedParams: Record<string, { path: string[], body: string[], query: string[] }> = {
|
||||
count: {
|
||||
path: [
|
||||
'index'
|
||||
],
|
||||
body: [
|
||||
'query'
|
||||
],
|
||||
query: [
|
||||
'allow_no_indices',
|
||||
'analyzer',
|
||||
'analyze_wildcard',
|
||||
'default_operator',
|
||||
'df',
|
||||
'expand_wildcards',
|
||||
'ignore_throttled',
|
||||
'ignore_unavailable',
|
||||
'lenient',
|
||||
'min_score',
|
||||
'preference',
|
||||
'routing',
|
||||
'terminate_after',
|
||||
'q'
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Count search results. Get the number of documents matching a query. The query can be provided either by using a simple query string as a parameter, or by defining Query DSL within the request body. The query is optional. When no query is provided, the API uses `match_all` to count all the documents. The count API supports multi-target syntax. You can run a single count API search across multiple data streams and indices. The operation is broadcast across all shards. For each shard ID group, a replica is chosen and the search is run against it. This means that replicas increase the scalability of the count.
|
||||
@ -45,8 +63,12 @@ export default async function CountApi (this: That, params?: T.CountRequest, opt
|
||||
export default async function CountApi (this: That, params?: T.CountRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.CountResponse, unknown>>
|
||||
export default async function CountApi (this: That, params?: T.CountRequest, options?: TransportRequestOptions): Promise<T.CountResponse>
|
||||
export default async function CountApi (this: That, params?: T.CountRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['index']
|
||||
const acceptedBody: string[] = ['query']
|
||||
const {
|
||||
path: acceptedPath,
|
||||
body: acceptedBody,
|
||||
query: acceptedQuery
|
||||
} = acceptedParams.count
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -69,8 +91,14 @@ export default async function CountApi (this: That, params?: T.CountRequest, opt
|
||||
} else if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body' && key !== 'querystring') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
} else {
|
||||
body = body ?? {}
|
||||
// @ts-expect-error
|
||||
body[key] = params[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -1,20 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright Elasticsearch B.V. and contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
@ -35,12 +21,46 @@ import {
|
||||
TransportResult
|
||||
} from '@elastic/transport'
|
||||
import * as T from '../types'
|
||||
interface That { transport: Transport }
|
||||
|
||||
interface That {
|
||||
transport: Transport
|
||||
acceptedParams: Record<string, { path: string[], body: string[], query: string[] }>
|
||||
}
|
||||
|
||||
export default class DanglingIndices {
|
||||
transport: Transport
|
||||
acceptedParams: Record<string, { path: string[], body: string[], query: string[] }>
|
||||
constructor (transport: Transport) {
|
||||
this.transport = transport
|
||||
this.acceptedParams = {
|
||||
'dangling_indices.delete_dangling_index': {
|
||||
path: [
|
||||
'index_uuid'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'accept_data_loss',
|
||||
'master_timeout',
|
||||
'timeout'
|
||||
]
|
||||
},
|
||||
'dangling_indices.import_dangling_index': {
|
||||
path: [
|
||||
'index_uuid'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'accept_data_loss',
|
||||
'master_timeout',
|
||||
'timeout'
|
||||
]
|
||||
},
|
||||
'dangling_indices.list_dangling_indices': {
|
||||
path: [],
|
||||
body: [],
|
||||
query: []
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -51,7 +71,10 @@ export default class DanglingIndices {
|
||||
async deleteDanglingIndex (this: That, params: T.DanglingIndicesDeleteDanglingIndexRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.DanglingIndicesDeleteDanglingIndexResponse, unknown>>
|
||||
async deleteDanglingIndex (this: That, params: T.DanglingIndicesDeleteDanglingIndexRequest, options?: TransportRequestOptions): Promise<T.DanglingIndicesDeleteDanglingIndexResponse>
|
||||
async deleteDanglingIndex (this: That, params: T.DanglingIndicesDeleteDanglingIndexRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['index_uuid']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['dangling_indices.delete_dangling_index']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -93,7 +116,10 @@ export default class DanglingIndices {
|
||||
async importDanglingIndex (this: That, params: T.DanglingIndicesImportDanglingIndexRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.DanglingIndicesImportDanglingIndexResponse, unknown>>
|
||||
async importDanglingIndex (this: That, params: T.DanglingIndicesImportDanglingIndexRequest, options?: TransportRequestOptions): Promise<T.DanglingIndicesImportDanglingIndexResponse>
|
||||
async importDanglingIndex (this: That, params: T.DanglingIndicesImportDanglingIndexRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['index_uuid']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['dangling_indices.import_dangling_index']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -135,7 +161,10 @@ export default class DanglingIndices {
|
||||
async listDanglingIndices (this: That, params?: T.DanglingIndicesListDanglingIndicesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.DanglingIndicesListDanglingIndicesResponse, unknown>>
|
||||
async listDanglingIndices (this: That, params?: T.DanglingIndicesListDanglingIndicesRequest, options?: TransportRequestOptions): Promise<T.DanglingIndicesListDanglingIndicesResponse>
|
||||
async listDanglingIndices (this: That, params?: T.DanglingIndicesListDanglingIndicesRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['dangling_indices.list_dangling_indices']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
|
||||
@ -1,20 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright Elasticsearch B.V. and contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
@ -35,7 +21,30 @@ import {
|
||||
TransportResult
|
||||
} from '@elastic/transport'
|
||||
import * as T from '../types'
|
||||
interface That { transport: Transport }
|
||||
|
||||
interface That {
|
||||
transport: Transport
|
||||
}
|
||||
|
||||
const acceptedParams: Record<string, { path: string[], body: string[], query: string[] }> = {
|
||||
delete: {
|
||||
path: [
|
||||
'id',
|
||||
'index'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'if_primary_term',
|
||||
'if_seq_no',
|
||||
'refresh',
|
||||
'routing',
|
||||
'timeout',
|
||||
'version',
|
||||
'version_type',
|
||||
'wait_for_active_shards'
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a document. Remove a JSON document from the specified index. NOTE: You cannot send deletion requests directly to a data stream. To delete a document in a data stream, you must target the backing index containing the document. **Optimistic concurrency control** Delete operations can be made conditional and only be performed if the last modification to the document was assigned the sequence number and primary term specified by the `if_seq_no` and `if_primary_term` parameters. If a mismatch is detected, the operation will result in a `VersionConflictException` and a status code of `409`. **Versioning** Each document indexed is versioned. When deleting a document, the version can be specified to make sure the relevant document you are trying to delete is actually being deleted and it has not changed in the meantime. Every write operation run on a document, deletes included, causes its version to be incremented. The version number of a deleted document remains available for a short time after deletion to allow for control of concurrent operations. The length of time for which a deleted document's version remains available is determined by the `index.gc_deletes` index setting. **Routing** If routing is used during indexing, the routing value also needs to be specified to delete a document. If the `_routing` mapping is set to `required` and no routing value is specified, the delete API throws a `RoutingMissingException` and rejects the request. For example: ``` DELETE /my-index-000001/_doc/1?routing=shard-1 ``` This request deletes the document with ID 1, but it is routed based on the user. The document is not deleted if the correct routing is not specified. **Distributed** The delete operation gets hashed into a specific shard ID. It then gets redirected into the primary shard within that ID group and replicated (if needed) to shard replicas within that ID group.
|
||||
@ -45,7 +54,10 @@ export default async function DeleteApi (this: That, params: T.DeleteRequest, op
|
||||
export default async function DeleteApi (this: That, params: T.DeleteRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.DeleteResponse, unknown>>
|
||||
export default async function DeleteApi (this: That, params: T.DeleteRequest, options?: TransportRequestOptions): Promise<T.DeleteResponse>
|
||||
export default async function DeleteApi (this: That, params: T.DeleteRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['id', 'index']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = acceptedParams.delete
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -1,20 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright Elasticsearch B.V. and contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
@ -35,7 +21,22 @@ import {
|
||||
TransportResult
|
||||
} from '@elastic/transport'
|
||||
import * as T from '../types'
|
||||
interface That { transport: Transport }
|
||||
|
||||
interface That {
|
||||
transport: Transport
|
||||
}
|
||||
|
||||
const acceptedParams: Record<string, { path: string[], body: string[], query: string[] }> = {
|
||||
delete_by_query_rethrottle: {
|
||||
path: [
|
||||
'task_id'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'requests_per_second'
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Throttle a delete by query operation. Change the number of requests per second for a particular delete by query operation. Rethrottling that speeds up the query takes effect immediately but rethrotting that slows down the query takes effect after completing the current batch to prevent scroll timeouts.
|
||||
@ -45,7 +46,10 @@ export default async function DeleteByQueryRethrottleApi (this: That, params: T.
|
||||
export default async function DeleteByQueryRethrottleApi (this: That, params: T.DeleteByQueryRethrottleRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.DeleteByQueryRethrottleResponse, unknown>>
|
||||
export default async function DeleteByQueryRethrottleApi (this: That, params: T.DeleteByQueryRethrottleRequest, options?: TransportRequestOptions): Promise<T.DeleteByQueryRethrottleResponse>
|
||||
export default async function DeleteByQueryRethrottleApi (this: That, params: T.DeleteByQueryRethrottleRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['task_id']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = acceptedParams.delete_by_query_rethrottle
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
|
||||
@ -1,20 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright Elasticsearch B.V. and contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
@ -35,7 +21,23 @@ import {
|
||||
TransportResult
|
||||
} from '@elastic/transport'
|
||||
import * as T from '../types'
|
||||
interface That { transport: Transport }
|
||||
|
||||
interface That {
|
||||
transport: Transport
|
||||
}
|
||||
|
||||
const acceptedParams: Record<string, { path: string[], body: string[], query: string[] }> = {
|
||||
delete_script: {
|
||||
path: [
|
||||
'id'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'master_timeout',
|
||||
'timeout'
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a script or search template. Deletes a stored script or search template.
|
||||
@ -45,7 +47,10 @@ export default async function DeleteScriptApi (this: That, params: T.DeleteScrip
|
||||
export default async function DeleteScriptApi (this: That, params: T.DeleteScriptRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.DeleteScriptResponse, unknown>>
|
||||
export default async function DeleteScriptApi (this: That, params: T.DeleteScriptRequest, options?: TransportRequestOptions): Promise<T.DeleteScriptResponse>
|
||||
export default async function DeleteScriptApi (this: That, params: T.DeleteScriptRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['id']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = acceptedParams.delete_script
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
|
||||
@ -1,20 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright Elasticsearch B.V. and contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
@ -35,12 +21,69 @@ import {
|
||||
TransportResult
|
||||
} from '@elastic/transport'
|
||||
import * as T from '../types'
|
||||
interface That { transport: Transport }
|
||||
|
||||
interface That {
|
||||
transport: Transport
|
||||
acceptedParams: Record<string, { path: string[], body: string[], query: string[] }>
|
||||
}
|
||||
|
||||
const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty']
|
||||
|
||||
export default class Enrich {
|
||||
transport: Transport
|
||||
acceptedParams: Record<string, { path: string[], body: string[], query: string[] }>
|
||||
constructor (transport: Transport) {
|
||||
this.transport = transport
|
||||
this.acceptedParams = {
|
||||
'enrich.delete_policy': {
|
||||
path: [
|
||||
'name'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'master_timeout'
|
||||
]
|
||||
},
|
||||
'enrich.execute_policy': {
|
||||
path: [
|
||||
'name'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'master_timeout',
|
||||
'wait_for_completion'
|
||||
]
|
||||
},
|
||||
'enrich.get_policy': {
|
||||
path: [
|
||||
'name'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'master_timeout'
|
||||
]
|
||||
},
|
||||
'enrich.put_policy': {
|
||||
path: [
|
||||
'name'
|
||||
],
|
||||
body: [
|
||||
'geo_match',
|
||||
'match',
|
||||
'range'
|
||||
],
|
||||
query: [
|
||||
'master_timeout'
|
||||
]
|
||||
},
|
||||
'enrich.stats': {
|
||||
path: [],
|
||||
body: [],
|
||||
query: [
|
||||
'master_timeout'
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -51,7 +94,10 @@ export default class Enrich {
|
||||
async deletePolicy (this: That, params: T.EnrichDeletePolicyRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EnrichDeletePolicyResponse, unknown>>
|
||||
async deletePolicy (this: That, params: T.EnrichDeletePolicyRequest, options?: TransportRequestOptions): Promise<T.EnrichDeletePolicyResponse>
|
||||
async deletePolicy (this: That, params: T.EnrichDeletePolicyRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['enrich.delete_policy']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -93,7 +139,10 @@ export default class Enrich {
|
||||
async executePolicy (this: That, params: T.EnrichExecutePolicyRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EnrichExecutePolicyResponse, unknown>>
|
||||
async executePolicy (this: That, params: T.EnrichExecutePolicyRequest, options?: TransportRequestOptions): Promise<T.EnrichExecutePolicyResponse>
|
||||
async executePolicy (this: That, params: T.EnrichExecutePolicyRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['enrich.execute_policy']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -135,7 +184,10 @@ export default class Enrich {
|
||||
async getPolicy (this: That, params?: T.EnrichGetPolicyRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EnrichGetPolicyResponse, unknown>>
|
||||
async getPolicy (this: That, params?: T.EnrichGetPolicyRequest, options?: TransportRequestOptions): Promise<T.EnrichGetPolicyResponse>
|
||||
async getPolicy (this: That, params?: T.EnrichGetPolicyRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['enrich.get_policy']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -185,8 +237,12 @@ export default class Enrich {
|
||||
async putPolicy (this: That, params: T.EnrichPutPolicyRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EnrichPutPolicyResponse, unknown>>
|
||||
async putPolicy (this: That, params: T.EnrichPutPolicyRequest, options?: TransportRequestOptions): Promise<T.EnrichPutPolicyResponse>
|
||||
async putPolicy (this: That, params: T.EnrichPutPolicyRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['name']
|
||||
const acceptedBody: string[] = ['geo_match', 'match', 'range']
|
||||
const {
|
||||
path: acceptedPath,
|
||||
body: acceptedBody,
|
||||
query: acceptedQuery
|
||||
} = this.acceptedParams['enrich.put_policy']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -208,8 +264,14 @@ export default class Enrich {
|
||||
} else if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body' && key !== 'querystring') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
} else {
|
||||
body = body ?? {}
|
||||
// @ts-expect-error
|
||||
body[key] = params[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -232,7 +294,10 @@ export default class Enrich {
|
||||
async stats (this: That, params?: T.EnrichStatsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EnrichStatsResponse, unknown>>
|
||||
async stats (this: That, params?: T.EnrichStatsRequest, options?: TransportRequestOptions): Promise<T.EnrichStatsResponse>
|
||||
async stats (this: That, params?: T.EnrichStatsRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['enrich.stats']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
|
||||
@ -1,20 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright Elasticsearch B.V. and contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
@ -35,12 +21,79 @@ import {
|
||||
TransportResult
|
||||
} from '@elastic/transport'
|
||||
import * as T from '../types'
|
||||
interface That { transport: Transport }
|
||||
|
||||
interface That {
|
||||
transport: Transport
|
||||
acceptedParams: Record<string, { path: string[], body: string[], query: string[] }>
|
||||
}
|
||||
|
||||
const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty']
|
||||
|
||||
export default class Eql {
|
||||
transport: Transport
|
||||
acceptedParams: Record<string, { path: string[], body: string[], query: string[] }>
|
||||
constructor (transport: Transport) {
|
||||
this.transport = transport
|
||||
this.acceptedParams = {
|
||||
'eql.delete': {
|
||||
path: [
|
||||
'id'
|
||||
],
|
||||
body: [],
|
||||
query: []
|
||||
},
|
||||
'eql.get': {
|
||||
path: [
|
||||
'id'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'keep_alive',
|
||||
'wait_for_completion_timeout'
|
||||
]
|
||||
},
|
||||
'eql.get_status': {
|
||||
path: [
|
||||
'id'
|
||||
],
|
||||
body: [],
|
||||
query: []
|
||||
},
|
||||
'eql.search': {
|
||||
path: [
|
||||
'index'
|
||||
],
|
||||
body: [
|
||||
'query',
|
||||
'case_sensitive',
|
||||
'event_category_field',
|
||||
'tiebreaker_field',
|
||||
'timestamp_field',
|
||||
'fetch_size',
|
||||
'filter',
|
||||
'keep_alive',
|
||||
'keep_on_completion',
|
||||
'wait_for_completion_timeout',
|
||||
'allow_partial_search_results',
|
||||
'allow_partial_sequence_results',
|
||||
'size',
|
||||
'fields',
|
||||
'result_position',
|
||||
'runtime_mappings',
|
||||
'max_samples_per_key'
|
||||
],
|
||||
query: [
|
||||
'allow_no_indices',
|
||||
'allow_partial_search_results',
|
||||
'allow_partial_sequence_results',
|
||||
'expand_wildcards',
|
||||
'ignore_unavailable',
|
||||
'keep_alive',
|
||||
'keep_on_completion',
|
||||
'wait_for_completion_timeout'
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -51,7 +104,10 @@ export default class Eql {
|
||||
async delete (this: That, params: T.EqlDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EqlDeleteResponse, unknown>>
|
||||
async delete (this: That, params: T.EqlDeleteRequest, options?: TransportRequestOptions): Promise<T.EqlDeleteResponse>
|
||||
async delete (this: That, params: T.EqlDeleteRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['id']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['eql.delete']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -93,7 +149,10 @@ export default class Eql {
|
||||
async get<TEvent = unknown> (this: That, params: T.EqlGetRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EqlGetResponse<TEvent>, unknown>>
|
||||
async get<TEvent = unknown> (this: That, params: T.EqlGetRequest, options?: TransportRequestOptions): Promise<T.EqlGetResponse<TEvent>>
|
||||
async get<TEvent = unknown> (this: That, params: T.EqlGetRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['id']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['eql.get']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -135,7 +194,10 @@ export default class Eql {
|
||||
async getStatus (this: That, params: T.EqlGetStatusRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EqlGetStatusResponse, unknown>>
|
||||
async getStatus (this: That, params: T.EqlGetStatusRequest, options?: TransportRequestOptions): Promise<T.EqlGetStatusResponse>
|
||||
async getStatus (this: That, params: T.EqlGetStatusRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['id']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['eql.get_status']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -177,8 +239,12 @@ export default class Eql {
|
||||
async search<TEvent = unknown> (this: That, params: T.EqlSearchRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EqlSearchResponse<TEvent>, unknown>>
|
||||
async search<TEvent = unknown> (this: That, params: T.EqlSearchRequest, options?: TransportRequestOptions): Promise<T.EqlSearchResponse<TEvent>>
|
||||
async search<TEvent = unknown> (this: That, params: T.EqlSearchRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['index']
|
||||
const acceptedBody: string[] = ['query', 'case_sensitive', 'event_category_field', 'tiebreaker_field', 'timestamp_field', 'fetch_size', 'filter', 'keep_alive', 'keep_on_completion', 'wait_for_completion_timeout', 'allow_partial_search_results', 'allow_partial_sequence_results', 'size', 'fields', 'result_position', 'runtime_mappings', 'max_samples_per_key']
|
||||
const {
|
||||
path: acceptedPath,
|
||||
body: acceptedBody,
|
||||
query: acceptedQuery
|
||||
} = this.acceptedParams['eql.search']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -200,8 +266,14 @@ export default class Eql {
|
||||
} else if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body' && key !== 'querystring') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
} else {
|
||||
body = body ?? {}
|
||||
// @ts-expect-error
|
||||
body[key] = params[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,20 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright Elasticsearch B.V. and contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
@ -35,12 +21,90 @@ import {
|
||||
TransportResult
|
||||
} from '@elastic/transport'
|
||||
import * as T from '../types'
|
||||
interface That { transport: Transport }
|
||||
|
||||
interface That {
|
||||
transport: Transport
|
||||
acceptedParams: Record<string, { path: string[], body: string[], query: string[] }>
|
||||
}
|
||||
|
||||
const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty']
|
||||
|
||||
export default class Esql {
|
||||
transport: Transport
|
||||
acceptedParams: Record<string, { path: string[], body: string[], query: string[] }>
|
||||
constructor (transport: Transport) {
|
||||
this.transport = transport
|
||||
this.acceptedParams = {
|
||||
'esql.async_query': {
|
||||
path: [],
|
||||
body: [
|
||||
'columnar',
|
||||
'filter',
|
||||
'locale',
|
||||
'params',
|
||||
'profile',
|
||||
'query',
|
||||
'tables',
|
||||
'include_ccs_metadata',
|
||||
'wait_for_completion_timeout'
|
||||
],
|
||||
query: [
|
||||
'allow_partial_results',
|
||||
'delimiter',
|
||||
'drop_null_columns',
|
||||
'format',
|
||||
'keep_alive',
|
||||
'keep_on_completion',
|
||||
'wait_for_completion_timeout'
|
||||
]
|
||||
},
|
||||
'esql.async_query_delete': {
|
||||
path: [
|
||||
'id'
|
||||
],
|
||||
body: [],
|
||||
query: []
|
||||
},
|
||||
'esql.async_query_get': {
|
||||
path: [
|
||||
'id'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'drop_null_columns',
|
||||
'keep_alive',
|
||||
'wait_for_completion_timeout'
|
||||
]
|
||||
},
|
||||
'esql.async_query_stop': {
|
||||
path: [
|
||||
'id'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'drop_null_columns'
|
||||
]
|
||||
},
|
||||
'esql.query': {
|
||||
path: [],
|
||||
body: [
|
||||
'columnar',
|
||||
'filter',
|
||||
'locale',
|
||||
'params',
|
||||
'profile',
|
||||
'query',
|
||||
'tables',
|
||||
'include_ccs_metadata'
|
||||
],
|
||||
query: [
|
||||
'format',
|
||||
'delimiter',
|
||||
'drop_null_columns',
|
||||
'allow_partial_results'
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -51,8 +115,12 @@ export default class Esql {
|
||||
async asyncQuery (this: That, params: T.EsqlAsyncQueryRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EsqlAsyncQueryResponse, unknown>>
|
||||
async asyncQuery (this: That, params: T.EsqlAsyncQueryRequest, options?: TransportRequestOptions): Promise<T.EsqlAsyncQueryResponse>
|
||||
async asyncQuery (this: That, params: T.EsqlAsyncQueryRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const acceptedBody: string[] = ['columnar', 'filter', 'locale', 'params', 'profile', 'query', 'tables', 'include_ccs_metadata']
|
||||
const {
|
||||
path: acceptedPath,
|
||||
body: acceptedBody,
|
||||
query: acceptedQuery
|
||||
} = this.acceptedParams['esql.async_query']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -74,8 +142,14 @@ export default class Esql {
|
||||
} else if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body' && key !== 'querystring') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
} else {
|
||||
body = body ?? {}
|
||||
// @ts-expect-error
|
||||
body[key] = params[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,7 +169,10 @@ export default class Esql {
|
||||
async asyncQueryDelete (this: That, params: T.EsqlAsyncQueryDeleteRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EsqlAsyncQueryDeleteResponse, unknown>>
|
||||
async asyncQueryDelete (this: That, params: T.EsqlAsyncQueryDeleteRequest, options?: TransportRequestOptions): Promise<T.EsqlAsyncQueryDeleteResponse>
|
||||
async asyncQueryDelete (this: That, params: T.EsqlAsyncQueryDeleteRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['id']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['esql.async_query_delete']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -137,7 +214,10 @@ export default class Esql {
|
||||
async asyncQueryGet (this: That, params: T.EsqlAsyncQueryGetRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EsqlAsyncQueryGetResponse, unknown>>
|
||||
async asyncQueryGet (this: That, params: T.EsqlAsyncQueryGetRequest, options?: TransportRequestOptions): Promise<T.EsqlAsyncQueryGetResponse>
|
||||
async asyncQueryGet (this: That, params: T.EsqlAsyncQueryGetRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['id']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['esql.async_query_get']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -179,7 +259,10 @@ export default class Esql {
|
||||
async asyncQueryStop (this: That, params: T.EsqlAsyncQueryStopRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EsqlAsyncQueryStopResponse, unknown>>
|
||||
async asyncQueryStop (this: That, params: T.EsqlAsyncQueryStopRequest, options?: TransportRequestOptions): Promise<T.EsqlAsyncQueryStopResponse>
|
||||
async asyncQueryStop (this: That, params: T.EsqlAsyncQueryStopRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['id']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['esql.async_query_stop']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -221,8 +304,12 @@ export default class Esql {
|
||||
async query (this: That, params: T.EsqlQueryRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.EsqlQueryResponse, unknown>>
|
||||
async query (this: That, params: T.EsqlQueryRequest, options?: TransportRequestOptions): Promise<T.EsqlQueryResponse>
|
||||
async query (this: That, params: T.EsqlQueryRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const acceptedBody: string[] = ['columnar', 'filter', 'locale', 'params', 'profile', 'query', 'tables', 'include_ccs_metadata']
|
||||
const {
|
||||
path: acceptedPath,
|
||||
body: acceptedBody,
|
||||
query: acceptedQuery
|
||||
} = this.acceptedParams['esql.query']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -244,8 +331,14 @@ export default class Esql {
|
||||
} else if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body' && key !== 'querystring') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
} else {
|
||||
body = body ?? {}
|
||||
// @ts-expect-error
|
||||
body[key] = params[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,20 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright Elasticsearch B.V. and contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
@ -35,7 +21,32 @@ import {
|
||||
TransportResult
|
||||
} from '@elastic/transport'
|
||||
import * as T from '../types'
|
||||
interface That { transport: Transport }
|
||||
|
||||
interface That {
|
||||
transport: Transport
|
||||
}
|
||||
|
||||
const acceptedParams: Record<string, { path: string[], body: string[], query: string[] }> = {
|
||||
exists: {
|
||||
path: [
|
||||
'id',
|
||||
'index'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'preference',
|
||||
'realtime',
|
||||
'refresh',
|
||||
'routing',
|
||||
'_source',
|
||||
'_source_excludes',
|
||||
'_source_includes',
|
||||
'stored_fields',
|
||||
'version',
|
||||
'version_type'
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check a document. Verify that a document exists. For example, check to see if a document with the `_id` 0 exists: ``` HEAD my-index-000001/_doc/0 ``` If the document exists, the API returns a status code of `200 - OK`. If the document doesn’t exist, the API returns `404 - Not Found`. **Versioning support** You can use the `version` parameter to check the document only if its current version is equal to the specified one. Internally, Elasticsearch has marked the old document as deleted and added an entirely new document. The old version of the document doesn't disappear immediately, although you won't be able to access it. Elasticsearch cleans up deleted documents in the background as you continue to index more data.
|
||||
@ -45,7 +56,10 @@ export default async function ExistsApi (this: That, params: T.ExistsRequest, op
|
||||
export default async function ExistsApi (this: That, params: T.ExistsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ExistsResponse, unknown>>
|
||||
export default async function ExistsApi (this: That, params: T.ExistsRequest, options?: TransportRequestOptions): Promise<T.ExistsResponse>
|
||||
export default async function ExistsApi (this: That, params: T.ExistsRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['id', 'index']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = acceptedParams.exists
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
|
||||
@ -1,20 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright Elasticsearch B.V. and contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
@ -35,7 +21,31 @@ import {
|
||||
TransportResult
|
||||
} from '@elastic/transport'
|
||||
import * as T from '../types'
|
||||
interface That { transport: Transport }
|
||||
|
||||
interface That {
|
||||
transport: Transport
|
||||
}
|
||||
|
||||
const acceptedParams: Record<string, { path: string[], body: string[], query: string[] }> = {
|
||||
exists_source: {
|
||||
path: [
|
||||
'id',
|
||||
'index'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'preference',
|
||||
'realtime',
|
||||
'refresh',
|
||||
'routing',
|
||||
'_source',
|
||||
'_source_excludes',
|
||||
'_source_includes',
|
||||
'version',
|
||||
'version_type'
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for a document source. Check whether a document source exists in an index. For example: ``` HEAD my-index-000001/_source/1 ``` A document's source is not available if it is disabled in the mapping.
|
||||
@ -45,7 +55,10 @@ export default async function ExistsSourceApi (this: That, params: T.ExistsSourc
|
||||
export default async function ExistsSourceApi (this: That, params: T.ExistsSourceRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ExistsSourceResponse, unknown>>
|
||||
export default async function ExistsSourceApi (this: That, params: T.ExistsSourceRequest, options?: TransportRequestOptions): Promise<T.ExistsSourceResponse>
|
||||
export default async function ExistsSourceApi (this: That, params: T.ExistsSourceRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['id', 'index']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = acceptedParams.exists_source
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
|
||||
@ -1,20 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright Elasticsearch B.V. and contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
@ -35,7 +21,38 @@ import {
|
||||
TransportResult
|
||||
} from '@elastic/transport'
|
||||
import * as T from '../types'
|
||||
interface That { transport: Transport }
|
||||
|
||||
interface That {
|
||||
transport: Transport
|
||||
}
|
||||
|
||||
const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty']
|
||||
|
||||
const acceptedParams: Record<string, { path: string[], body: string[], query: string[] }> = {
|
||||
explain: {
|
||||
path: [
|
||||
'id',
|
||||
'index'
|
||||
],
|
||||
body: [
|
||||
'query'
|
||||
],
|
||||
query: [
|
||||
'analyzer',
|
||||
'analyze_wildcard',
|
||||
'default_operator',
|
||||
'df',
|
||||
'lenient',
|
||||
'preference',
|
||||
'routing',
|
||||
'_source',
|
||||
'_source_excludes',
|
||||
'_source_includes',
|
||||
'stored_fields',
|
||||
'q'
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Explain a document match result. Get information about why a specific document matches, or doesn't match, a query. It computes a score explanation for a query and a specific document.
|
||||
@ -45,8 +62,12 @@ export default async function ExplainApi<TDocument = unknown> (this: That, param
|
||||
export default async function ExplainApi<TDocument = unknown> (this: That, params: T.ExplainRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.ExplainResponse<TDocument>, unknown>>
|
||||
export default async function ExplainApi<TDocument = unknown> (this: That, params: T.ExplainRequest, options?: TransportRequestOptions): Promise<T.ExplainResponse<TDocument>>
|
||||
export default async function ExplainApi<TDocument = unknown> (this: That, params: T.ExplainRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['id', 'index']
|
||||
const acceptedBody: string[] = ['query']
|
||||
const {
|
||||
path: acceptedPath,
|
||||
body: acceptedBody,
|
||||
query: acceptedQuery
|
||||
} = acceptedParams.explain
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -68,8 +89,14 @@ export default async function ExplainApi<TDocument = unknown> (this: That, param
|
||||
} else if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body' && key !== 'querystring') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
} else {
|
||||
body = body ?? {}
|
||||
// @ts-expect-error
|
||||
body[key] = params[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,20 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright Elasticsearch B.V. and contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
@ -35,12 +21,33 @@ import {
|
||||
TransportResult
|
||||
} from '@elastic/transport'
|
||||
import * as T from '../types'
|
||||
interface That { transport: Transport }
|
||||
|
||||
interface That {
|
||||
transport: Transport
|
||||
acceptedParams: Record<string, { path: string[], body: string[], query: string[] }>
|
||||
}
|
||||
|
||||
export default class Features {
|
||||
transport: Transport
|
||||
acceptedParams: Record<string, { path: string[], body: string[], query: string[] }>
|
||||
constructor (transport: Transport) {
|
||||
this.transport = transport
|
||||
this.acceptedParams = {
|
||||
'features.get_features': {
|
||||
path: [],
|
||||
body: [],
|
||||
query: [
|
||||
'master_timeout'
|
||||
]
|
||||
},
|
||||
'features.reset_features': {
|
||||
path: [],
|
||||
body: [],
|
||||
query: [
|
||||
'master_timeout'
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -51,7 +58,10 @@ export default class Features {
|
||||
async getFeatures (this: That, params?: T.FeaturesGetFeaturesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FeaturesGetFeaturesResponse, unknown>>
|
||||
async getFeatures (this: That, params?: T.FeaturesGetFeaturesRequest, options?: TransportRequestOptions): Promise<T.FeaturesGetFeaturesResponse>
|
||||
async getFeatures (this: That, params?: T.FeaturesGetFeaturesRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['features.get_features']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -91,7 +101,10 @@ export default class Features {
|
||||
async resetFeatures (this: That, params?: T.FeaturesResetFeaturesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FeaturesResetFeaturesResponse, unknown>>
|
||||
async resetFeatures (this: That, params?: T.FeaturesResetFeaturesRequest, options?: TransportRequestOptions): Promise<T.FeaturesResetFeaturesResponse>
|
||||
async resetFeatures (this: That, params?: T.FeaturesResetFeaturesRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['features.reset_features']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
|
||||
@ -1,20 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright Elasticsearch B.V. and contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
@ -35,7 +21,35 @@ import {
|
||||
TransportResult
|
||||
} from '@elastic/transport'
|
||||
import * as T from '../types'
|
||||
interface That { transport: Transport }
|
||||
|
||||
interface That {
|
||||
transport: Transport
|
||||
}
|
||||
|
||||
const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty']
|
||||
|
||||
const acceptedParams: Record<string, { path: string[], body: string[], query: string[] }> = {
|
||||
field_caps: {
|
||||
path: [
|
||||
'index'
|
||||
],
|
||||
body: [
|
||||
'fields',
|
||||
'index_filter',
|
||||
'runtime_mappings'
|
||||
],
|
||||
query: [
|
||||
'allow_no_indices',
|
||||
'expand_wildcards',
|
||||
'fields',
|
||||
'ignore_unavailable',
|
||||
'include_unmapped',
|
||||
'filters',
|
||||
'types',
|
||||
'include_empty_fields'
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the field capabilities. Get information about the capabilities of fields among multiple indices. For data streams, the API returns field capabilities among the stream’s backing indices. It returns runtime fields like any other field. For example, a runtime field with a type of keyword is returned the same as any other field that belongs to the `keyword` family.
|
||||
@ -45,8 +59,12 @@ export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequ
|
||||
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FieldCapsResponse, unknown>>
|
||||
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest, options?: TransportRequestOptions): Promise<T.FieldCapsResponse>
|
||||
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['index']
|
||||
const acceptedBody: string[] = ['fields', 'index_filter', 'runtime_mappings']
|
||||
const {
|
||||
path: acceptedPath,
|
||||
body: acceptedBody,
|
||||
query: acceptedQuery
|
||||
} = acceptedParams.field_caps
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -69,8 +87,14 @@ export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequ
|
||||
} else if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body' && key !== 'querystring') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
} else {
|
||||
body = body ?? {}
|
||||
// @ts-expect-error
|
||||
body[key] = params[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,20 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright Elasticsearch B.V. and contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
@ -35,12 +21,159 @@ import {
|
||||
TransportResult
|
||||
} from '@elastic/transport'
|
||||
import * as T from '../types'
|
||||
interface That { transport: Transport }
|
||||
|
||||
interface That {
|
||||
transport: Transport
|
||||
acceptedParams: Record<string, { path: string[], body: string[], query: string[] }>
|
||||
}
|
||||
|
||||
const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty']
|
||||
|
||||
export default class Fleet {
|
||||
transport: Transport
|
||||
acceptedParams: Record<string, { path: string[], body: string[], query: string[] }>
|
||||
constructor (transport: Transport) {
|
||||
this.transport = transport
|
||||
this.acceptedParams = {
|
||||
'fleet.delete_secret': {
|
||||
path: [
|
||||
'id'
|
||||
],
|
||||
body: [],
|
||||
query: []
|
||||
},
|
||||
'fleet.get_secret': {
|
||||
path: [
|
||||
'id'
|
||||
],
|
||||
body: [],
|
||||
query: []
|
||||
},
|
||||
'fleet.global_checkpoints': {
|
||||
path: [
|
||||
'index'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'wait_for_advance',
|
||||
'wait_for_index',
|
||||
'checkpoints',
|
||||
'timeout'
|
||||
]
|
||||
},
|
||||
'fleet.msearch': {
|
||||
path: [
|
||||
'index'
|
||||
],
|
||||
body: [
|
||||
'searches'
|
||||
],
|
||||
query: [
|
||||
'allow_no_indices',
|
||||
'ccs_minimize_roundtrips',
|
||||
'expand_wildcards',
|
||||
'ignore_throttled',
|
||||
'ignore_unavailable',
|
||||
'max_concurrent_searches',
|
||||
'max_concurrent_shard_requests',
|
||||
'pre_filter_shard_size',
|
||||
'search_type',
|
||||
'rest_total_hits_as_int',
|
||||
'typed_keys',
|
||||
'wait_for_checkpoints',
|
||||
'allow_partial_search_results'
|
||||
]
|
||||
},
|
||||
'fleet.post_secret': {
|
||||
path: [],
|
||||
body: [],
|
||||
query: []
|
||||
},
|
||||
'fleet.search': {
|
||||
path: [
|
||||
'index'
|
||||
],
|
||||
body: [
|
||||
'aggregations',
|
||||
'aggs',
|
||||
'collapse',
|
||||
'explain',
|
||||
'ext',
|
||||
'from',
|
||||
'highlight',
|
||||
'track_total_hits',
|
||||
'indices_boost',
|
||||
'docvalue_fields',
|
||||
'min_score',
|
||||
'post_filter',
|
||||
'profile',
|
||||
'query',
|
||||
'rescore',
|
||||
'script_fields',
|
||||
'search_after',
|
||||
'size',
|
||||
'slice',
|
||||
'sort',
|
||||
'_source',
|
||||
'fields',
|
||||
'suggest',
|
||||
'terminate_after',
|
||||
'timeout',
|
||||
'track_scores',
|
||||
'version',
|
||||
'seq_no_primary_term',
|
||||
'stored_fields',
|
||||
'pit',
|
||||
'runtime_mappings',
|
||||
'stats'
|
||||
],
|
||||
query: [
|
||||
'allow_no_indices',
|
||||
'analyzer',
|
||||
'analyze_wildcard',
|
||||
'batched_reduce_size',
|
||||
'ccs_minimize_roundtrips',
|
||||
'default_operator',
|
||||
'df',
|
||||
'docvalue_fields',
|
||||
'expand_wildcards',
|
||||
'explain',
|
||||
'ignore_throttled',
|
||||
'ignore_unavailable',
|
||||
'lenient',
|
||||
'max_concurrent_shard_requests',
|
||||
'preference',
|
||||
'pre_filter_shard_size',
|
||||
'request_cache',
|
||||
'routing',
|
||||
'scroll',
|
||||
'search_type',
|
||||
'stats',
|
||||
'stored_fields',
|
||||
'suggest_field',
|
||||
'suggest_mode',
|
||||
'suggest_size',
|
||||
'suggest_text',
|
||||
'terminate_after',
|
||||
'timeout',
|
||||
'track_total_hits',
|
||||
'track_scores',
|
||||
'typed_keys',
|
||||
'rest_total_hits_as_int',
|
||||
'version',
|
||||
'_source',
|
||||
'_source_excludes',
|
||||
'_source_includes',
|
||||
'seq_no_primary_term',
|
||||
'q',
|
||||
'size',
|
||||
'from',
|
||||
'sort',
|
||||
'wait_for_checkpoints',
|
||||
'allow_partial_search_results'
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -50,7 +183,10 @@ export default class Fleet {
|
||||
async deleteSecret (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
|
||||
async deleteSecret (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<T.TODO>
|
||||
async deleteSecret (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['id']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['fleet.delete_secret']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -91,7 +227,10 @@ export default class Fleet {
|
||||
async getSecret (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
|
||||
async getSecret (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<T.TODO>
|
||||
async getSecret (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['id']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['fleet.get_secret']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -133,7 +272,10 @@ export default class Fleet {
|
||||
async globalCheckpoints (this: That, params: T.FleetGlobalCheckpointsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FleetGlobalCheckpointsResponse, unknown>>
|
||||
async globalCheckpoints (this: That, params: T.FleetGlobalCheckpointsRequest, options?: TransportRequestOptions): Promise<T.FleetGlobalCheckpointsResponse>
|
||||
async globalCheckpoints (this: That, params: T.FleetGlobalCheckpointsRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['index']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['fleet.global_checkpoints']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -175,8 +317,12 @@ export default class Fleet {
|
||||
async msearch<TDocument = unknown> (this: That, params: T.FleetMsearchRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FleetMsearchResponse<TDocument>, unknown>>
|
||||
async msearch<TDocument = unknown> (this: That, params: T.FleetMsearchRequest, options?: TransportRequestOptions): Promise<T.FleetMsearchResponse<TDocument>>
|
||||
async msearch<TDocument = unknown> (this: That, params: T.FleetMsearchRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['index']
|
||||
const acceptedBody: string[] = ['searches']
|
||||
const {
|
||||
path: acceptedPath,
|
||||
body: acceptedBody,
|
||||
query: acceptedQuery
|
||||
} = this.acceptedParams['fleet.msearch']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -188,8 +334,14 @@ export default class Fleet {
|
||||
} else if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body' && key !== 'querystring') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
} else {
|
||||
body = body ?? {}
|
||||
// @ts-expect-error
|
||||
body[key] = params[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -218,7 +370,10 @@ export default class Fleet {
|
||||
async postSecret (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
|
||||
async postSecret (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<T.TODO>
|
||||
async postSecret (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = this.acceptedParams['fleet.post_secret']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -257,8 +412,12 @@ export default class Fleet {
|
||||
async search<TDocument = unknown> (this: That, params: T.FleetSearchRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FleetSearchResponse<TDocument>, unknown>>
|
||||
async search<TDocument = unknown> (this: That, params: T.FleetSearchRequest, options?: TransportRequestOptions): Promise<T.FleetSearchResponse<TDocument>>
|
||||
async search<TDocument = unknown> (this: That, params: T.FleetSearchRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['index']
|
||||
const acceptedBody: string[] = ['aggregations', 'aggs', 'collapse', 'explain', 'ext', 'from', 'highlight', 'track_total_hits', 'indices_boost', 'docvalue_fields', 'min_score', 'post_filter', 'profile', 'query', 'rescore', 'script_fields', 'search_after', 'size', 'slice', 'sort', '_source', 'fields', 'suggest', 'terminate_after', 'timeout', 'track_scores', 'version', 'seq_no_primary_term', 'stored_fields', 'pit', 'runtime_mappings', 'stats']
|
||||
const {
|
||||
path: acceptedPath,
|
||||
body: acceptedBody,
|
||||
query: acceptedQuery
|
||||
} = this.acceptedParams['fleet.search']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -280,8 +439,14 @@ export default class Fleet {
|
||||
} else if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body' && key !== 'querystring') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
} else {
|
||||
body = body ?? {}
|
||||
// @ts-expect-error
|
||||
body[key] = params[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,20 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright Elasticsearch B.V. and contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
@ -35,7 +21,33 @@ import {
|
||||
TransportResult
|
||||
} from '@elastic/transport'
|
||||
import * as T from '../types'
|
||||
interface That { transport: Transport }
|
||||
|
||||
interface That {
|
||||
transport: Transport
|
||||
}
|
||||
|
||||
const acceptedParams: Record<string, { path: string[], body: string[], query: string[] }> = {
|
||||
get: {
|
||||
path: [
|
||||
'id',
|
||||
'index'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'force_synthetic_source',
|
||||
'preference',
|
||||
'realtime',
|
||||
'refresh',
|
||||
'routing',
|
||||
'_source',
|
||||
'_source_excludes',
|
||||
'_source_includes',
|
||||
'stored_fields',
|
||||
'version',
|
||||
'version_type'
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a document by its ID. Get a document and its source or stored fields from an index. By default, this API is realtime and is not affected by the refresh rate of the index (when data will become visible for search). In the case where stored fields are requested with the `stored_fields` parameter and the document has been updated but is not yet refreshed, the API will have to parse and analyze the source to extract the stored fields. To turn off realtime behavior, set the `realtime` parameter to false. **Source filtering** By default, the API returns the contents of the `_source` field unless you have used the `stored_fields` parameter or the `_source` field is turned off. You can turn off `_source` retrieval by using the `_source` parameter: ``` GET my-index-000001/_doc/0?_source=false ``` If you only need one or two fields from the `_source`, use the `_source_includes` or `_source_excludes` parameters to include or filter out particular fields. This can be helpful with large documents where partial retrieval can save on network overhead Both parameters take a comma separated list of fields or wildcard expressions. For example: ``` GET my-index-000001/_doc/0?_source_includes=*.id&_source_excludes=entities ``` If you only want to specify includes, you can use a shorter notation: ``` GET my-index-000001/_doc/0?_source=*.id ``` **Routing** If routing is used during indexing, the routing value also needs to be specified to retrieve a document. For example: ``` GET my-index-000001/_doc/2?routing=user1 ``` This request gets the document with ID 2, but it is routed based on the user. The document is not fetched if the correct routing is not specified. **Distributed** The GET operation is hashed into a specific shard ID. It is then redirected to one of the replicas within that shard ID and returns the result. The replicas are the primary shard and its replicas within that shard ID group. This means that the more replicas you have, the better your GET scaling will be. **Versioning support** You can use the `version` parameter to retrieve the document only if its current version is equal to the specified one. Internally, Elasticsearch has marked the old document as deleted and added an entirely new document. The old version of the document doesn't disappear immediately, although you won't be able to access it. Elasticsearch cleans up deleted documents in the background as you continue to index more data.
|
||||
@ -45,7 +57,10 @@ export default async function GetApi<TDocument = unknown> (this: That, params: T
|
||||
export default async function GetApi<TDocument = unknown> (this: That, params: T.GetRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.GetResponse<TDocument>, unknown>>
|
||||
export default async function GetApi<TDocument = unknown> (this: That, params: T.GetRequest, options?: TransportRequestOptions): Promise<T.GetResponse<TDocument>>
|
||||
export default async function GetApi<TDocument = unknown> (this: That, params: T.GetRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['id', 'index']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = acceptedParams.get
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
|
||||
@ -1,20 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright Elasticsearch B.V. and contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
@ -35,7 +21,22 @@ import {
|
||||
TransportResult
|
||||
} from '@elastic/transport'
|
||||
import * as T from '../types'
|
||||
interface That { transport: Transport }
|
||||
|
||||
interface That {
|
||||
transport: Transport
|
||||
}
|
||||
|
||||
const acceptedParams: Record<string, { path: string[], body: string[], query: string[] }> = {
|
||||
get_script: {
|
||||
path: [
|
||||
'id'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'master_timeout'
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a script or search template. Retrieves a stored script or search template.
|
||||
@ -45,7 +46,10 @@ export default async function GetScriptApi (this: That, params: T.GetScriptReque
|
||||
export default async function GetScriptApi (this: That, params: T.GetScriptRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.GetScriptResponse, unknown>>
|
||||
export default async function GetScriptApi (this: That, params: T.GetScriptRequest, options?: TransportRequestOptions): Promise<T.GetScriptResponse>
|
||||
export default async function GetScriptApi (this: That, params: T.GetScriptRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['id']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = acceptedParams.get_script
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
|
||||
@ -1,20 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright Elasticsearch B.V. and contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
@ -35,7 +21,18 @@ import {
|
||||
TransportResult
|
||||
} from '@elastic/transport'
|
||||
import * as T from '../types'
|
||||
interface That { transport: Transport }
|
||||
|
||||
interface That {
|
||||
transport: Transport
|
||||
}
|
||||
|
||||
const acceptedParams: Record<string, { path: string[], body: string[], query: string[] }> = {
|
||||
get_script_context: {
|
||||
path: [],
|
||||
body: [],
|
||||
query: []
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get script contexts. Get a list of supported script contexts and their methods.
|
||||
@ -45,7 +42,10 @@ export default async function GetScriptContextApi (this: That, params?: T.GetScr
|
||||
export default async function GetScriptContextApi (this: That, params?: T.GetScriptContextRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.GetScriptContextResponse, unknown>>
|
||||
export default async function GetScriptContextApi (this: That, params?: T.GetScriptContextRequest, options?: TransportRequestOptions): Promise<T.GetScriptContextResponse>
|
||||
export default async function GetScriptContextApi (this: That, params?: T.GetScriptContextRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = acceptedParams.get_script_context
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
|
||||
@ -1,20 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright Elasticsearch B.V. and contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
@ -35,7 +21,18 @@ import {
|
||||
TransportResult
|
||||
} from '@elastic/transport'
|
||||
import * as T from '../types'
|
||||
interface That { transport: Transport }
|
||||
|
||||
interface That {
|
||||
transport: Transport
|
||||
}
|
||||
|
||||
const acceptedParams: Record<string, { path: string[], body: string[], query: string[] }> = {
|
||||
get_script_languages: {
|
||||
path: [],
|
||||
body: [],
|
||||
query: []
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get script languages. Get a list of available script types, languages, and contexts.
|
||||
@ -45,7 +42,10 @@ export default async function GetScriptLanguagesApi (this: That, params?: T.GetS
|
||||
export default async function GetScriptLanguagesApi (this: That, params?: T.GetScriptLanguagesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.GetScriptLanguagesResponse, unknown>>
|
||||
export default async function GetScriptLanguagesApi (this: That, params?: T.GetScriptLanguagesRequest, options?: TransportRequestOptions): Promise<T.GetScriptLanguagesResponse>
|
||||
export default async function GetScriptLanguagesApi (this: That, params?: T.GetScriptLanguagesRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = []
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = acceptedParams.get_script_languages
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
|
||||
@ -1,20 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright Elasticsearch B.V. and contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
@ -35,7 +21,32 @@ import {
|
||||
TransportResult
|
||||
} from '@elastic/transport'
|
||||
import * as T from '../types'
|
||||
interface That { transport: Transport }
|
||||
|
||||
interface That {
|
||||
transport: Transport
|
||||
}
|
||||
|
||||
const acceptedParams: Record<string, { path: string[], body: string[], query: string[] }> = {
|
||||
get_source: {
|
||||
path: [
|
||||
'id',
|
||||
'index'
|
||||
],
|
||||
body: [],
|
||||
query: [
|
||||
'preference',
|
||||
'realtime',
|
||||
'refresh',
|
||||
'routing',
|
||||
'_source',
|
||||
'_source_excludes',
|
||||
'_source_includes',
|
||||
'stored_fields',
|
||||
'version',
|
||||
'version_type'
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a document's source. Get the source of a document. For example: ``` GET my-index-000001/_source/1 ``` You can use the source filtering parameters to control which parts of the `_source` are returned: ``` GET my-index-000001/_source/1/?_source_includes=*.id&_source_excludes=entities ```
|
||||
@ -45,7 +56,10 @@ export default async function GetSourceApi<TDocument = unknown> (this: That, par
|
||||
export default async function GetSourceApi<TDocument = unknown> (this: That, params: T.GetSourceRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.GetSourceResponse<TDocument>, unknown>>
|
||||
export default async function GetSourceApi<TDocument = unknown> (this: That, params: T.GetSourceRequest, options?: TransportRequestOptions): Promise<T.GetSourceResponse<TDocument>>
|
||||
export default async function GetSourceApi<TDocument = unknown> (this: That, params: T.GetSourceRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['id', 'index']
|
||||
const {
|
||||
path: acceptedPath
|
||||
} = acceptedParams.get_source
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
|
||||
@ -1,20 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
* Copyright Elasticsearch B.V. and contributors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable import/export */
|
||||
@ -35,12 +21,36 @@ import {
|
||||
TransportResult
|
||||
} from '@elastic/transport'
|
||||
import * as T from '../types'
|
||||
interface That { transport: Transport }
|
||||
|
||||
interface That {
|
||||
transport: Transport
|
||||
acceptedParams: Record<string, { path: string[], body: string[], query: string[] }>
|
||||
}
|
||||
|
||||
const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty']
|
||||
|
||||
export default class Graph {
|
||||
transport: Transport
|
||||
acceptedParams: Record<string, { path: string[], body: string[], query: string[] }>
|
||||
constructor (transport: Transport) {
|
||||
this.transport = transport
|
||||
this.acceptedParams = {
|
||||
'graph.explore': {
|
||||
path: [
|
||||
'index'
|
||||
],
|
||||
body: [
|
||||
'connections',
|
||||
'controls',
|
||||
'query',
|
||||
'vertices'
|
||||
],
|
||||
query: [
|
||||
'routing',
|
||||
'timeout'
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -51,8 +61,12 @@ export default class Graph {
|
||||
async explore (this: That, params: T.GraphExploreRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.GraphExploreResponse, unknown>>
|
||||
async explore (this: That, params: T.GraphExploreRequest, options?: TransportRequestOptions): Promise<T.GraphExploreResponse>
|
||||
async explore (this: That, params: T.GraphExploreRequest, options?: TransportRequestOptions): Promise<any> {
|
||||
const acceptedPath: string[] = ['index']
|
||||
const acceptedBody: string[] = ['connections', 'controls', 'query', 'vertices']
|
||||
const {
|
||||
path: acceptedPath,
|
||||
body: acceptedBody,
|
||||
query: acceptedQuery
|
||||
} = this.acceptedParams['graph.explore']
|
||||
|
||||
const userQuery = params?.querystring
|
||||
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
|
||||
|
||||
@ -74,8 +88,14 @@ export default class Graph {
|
||||
} else if (acceptedPath.includes(key)) {
|
||||
continue
|
||||
} else if (key !== 'body' && key !== 'querystring') {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
|
||||
// @ts-expect-error
|
||||
querystring[key] = params[key]
|
||||
} else {
|
||||
body = body ?? {}
|
||||
// @ts-expect-error
|
||||
body[key] = params[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user