Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8a57dc0402 | |||
| cac4203919 | |||
| 9c79ab320c | |||
| 397422d108 | |||
| 4a08881ec3 | |||
| 4c281e0f78 | |||
| 68f9476f11 | |||
| 92028f8208 | |||
| 4d190bc19a |
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
STACK_VERSION:
|
STACK_VERSION:
|
||||||
- "8.3.0-SNAPSHOT"
|
- "8.3.3-SNAPSHOT"
|
||||||
|
|
||||||
NODE_JS_VERSION:
|
NODE_JS_VERSION:
|
||||||
- 18
|
- 18
|
||||||
|
|||||||
@ -1,6 +1,35 @@
|
|||||||
[[changelog-client]]
|
[[changelog-client]]
|
||||||
== Release notes
|
== Release notes
|
||||||
|
|
||||||
|
[discrete]
|
||||||
|
=== 8.2.1
|
||||||
|
|
||||||
|
[discrete]
|
||||||
|
==== Fixes
|
||||||
|
|
||||||
|
[discrete]
|
||||||
|
===== Support for Elasticsearch `v8.2.1`
|
||||||
|
|
||||||
|
You can find all the API changes
|
||||||
|
https://www.elastic.co/guide/en/elasticsearch/reference/8.2/release-notes-8.2.1.html[here].
|
||||||
|
|
||||||
|
[discrete]
|
||||||
|
===== Fix ndjson APIs https://github.com/elastic/elasticsearch-js/pull/1688[#1688]
|
||||||
|
|
||||||
|
The previous release contained a bug that broken ndjson APIs.
|
||||||
|
We have released `v8.2.0-patch.1` to address this.
|
||||||
|
This fix is the same as the one we have released and we strongly recommend upgrading to this version.
|
||||||
|
|
||||||
|
[discrete]
|
||||||
|
===== Fix node shutdown apis https://github.com/elastic/elasticsearch-js/pull/1697[#1697]
|
||||||
|
|
||||||
|
The shutdown APIs wheren't complete, this fix completes them.
|
||||||
|
|
||||||
|
[discrete]
|
||||||
|
==== Types: move query keys to body https://github.com/elastic/elasticsearch-js/pull/1693[#1693]
|
||||||
|
|
||||||
|
The types definitions where wrongly representing the types of fields present in both query and body.
|
||||||
|
|
||||||
[discrete]
|
[discrete]
|
||||||
=== 8.2.0
|
=== 8.2.0
|
||||||
|
|
||||||
|
|||||||
@ -77,8 +77,8 @@ async function run () {
|
|||||||
// fix the document before to try it again.
|
// fix the document before to try it again.
|
||||||
status: action[operation].status,
|
status: action[operation].status,
|
||||||
error: action[operation].error,
|
error: action[operation].error,
|
||||||
operation: body[i * 2],
|
operation: operations[i * 2],
|
||||||
document: body[i * 2 + 1]
|
document: operations[i * 2 + 1]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
= Elasticsearch JavaScript Client
|
= Elasticsearch JavaScript Client
|
||||||
|
|
||||||
:branch: master
|
include::{asciidoc-dir}/../../shared/versions/stack/{source_branch}.asciidoc[]
|
||||||
include::{asciidoc-dir}/../../shared/attributes.asciidoc[]
|
include::{asciidoc-dir}/../../shared/attributes.asciidoc[]
|
||||||
|
|
||||||
include::introduction.asciidoc[]
|
include::introduction.asciidoc[]
|
||||||
|
|||||||
@ -377,9 +377,9 @@ child.search({
|
|||||||
To improve observability, the client offers an easy way to configure the
|
To improve observability, the client offers an easy way to configure the
|
||||||
`X-Opaque-Id` header. If you set the `X-Opaque-Id` in a specific request, this
|
`X-Opaque-Id` header. If you set the `X-Opaque-Id` in a specific request, this
|
||||||
allows you to discover this identifier in the
|
allows you to discover this identifier in the
|
||||||
https://www.elastic.co/guide/en/elasticsearch/reference/master/logging.html#deprecation-logging[deprecation logs],
|
https://www.elastic.co/guide/en/elasticsearch/reference/8.3/logging.html#deprecation-logging[deprecation logs],
|
||||||
helps you with https://www.elastic.co/guide/en/elasticsearch/reference/master/index-modules-slowlog.html#_identifying_search_slow_log_origin[identifying search slow log origin]
|
helps you with https://www.elastic.co/guide/en/elasticsearch/reference/8.3/index-modules-slowlog.html#_identifying_search_slow_log_origin[identifying search slow log origin]
|
||||||
as well as https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html#_identifying_running_tasks[identifying running tasks].
|
as well as https://www.elastic.co/guide/en/elasticsearch/reference/8.3/tasks.html#_identifying_running_tasks[identifying running tasks].
|
||||||
|
|
||||||
The `X-Opaque-Id` should be configured in each request, for doing that you can
|
The `X-Opaque-Id` should be configured in each request, for doing that you can
|
||||||
use the `opaqueId` option, as you can see in the following example. The
|
use the `opaqueId` option, as you can see in the following example. The
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@elastic/elasticsearch",
|
"name": "@elastic/elasticsearch",
|
||||||
"version": "8.3.0",
|
"version": "8.3.3",
|
||||||
"versionCanary": "8.3.0-canary.1",
|
"versionCanary": "8.3.3-canary.0",
|
||||||
"description": "The official Elasticsearch client for Node.js",
|
"description": "The official Elasticsearch client for Node.js",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"types": "index.d.ts",
|
"types": "index.d.ts",
|
||||||
@ -91,4 +91,4 @@
|
|||||||
"coverage": false,
|
"coverage": false,
|
||||||
"check-coverage": false
|
"check-coverage": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -20,6 +20,7 @@
|
|||||||
import { ConnectionOptions as TlsConnectionOptions } from 'tls'
|
import { ConnectionOptions as TlsConnectionOptions } from 'tls'
|
||||||
import { URL } from 'url'
|
import { URL } from 'url'
|
||||||
import buffer from 'buffer'
|
import buffer from 'buffer'
|
||||||
|
import os from 'os'
|
||||||
import {
|
import {
|
||||||
Transport,
|
Transport,
|
||||||
UndiciConnection,
|
UndiciConnection,
|
||||||
@ -173,7 +174,9 @@ export default class Client extends API {
|
|||||||
tls: null,
|
tls: null,
|
||||||
caFingerprint: null,
|
caFingerprint: null,
|
||||||
agent: null,
|
agent: null,
|
||||||
headers: {},
|
headers: {
|
||||||
|
'user-agent': `elasticsearch-js/${clientVersion} Node.js ${nodeVersion}; Transport ${transportVersion}; (${os.platform()} ${os.release()} ${os.arch()})`
|
||||||
|
},
|
||||||
nodeFilter: null,
|
nodeFilter: null,
|
||||||
generateRequestId: null,
|
generateRequestId: null,
|
||||||
name: 'elasticsearch-js',
|
name: 'elasticsearch-js',
|
||||||
|
|||||||
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
/* eslint-disable @typescript-eslint/promise-function-async */
|
/* eslint-disable @typescript-eslint/promise-function-async */
|
||||||
|
/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */
|
||||||
|
|
||||||
import assert from 'assert'
|
import assert from 'assert'
|
||||||
import { promisify } from 'util'
|
import { promisify } from 'util'
|
||||||
@ -228,7 +229,6 @@ export default class Helpers {
|
|||||||
rest_total_hits_as_int: params.rest_total_hits_as_int,
|
rest_total_hits_as_int: params.rest_total_hits_as_int,
|
||||||
scroll_id
|
scroll_id
|
||||||
}, options as TransportRequestOptionsWithMeta)
|
}, options as TransportRequestOptionsWithMeta)
|
||||||
// @ts-expect-error
|
|
||||||
response = r as TransportResult<T.ScrollResponse<TDocument, TAggregations>, unknown>
|
response = r as TransportResult<T.ScrollResponse<TDocument, TAggregations>, unknown>
|
||||||
assert(response !== undefined, 'The response is undefined, please file a bug report')
|
assert(response !== undefined, 'The response is undefined, please file a bug report')
|
||||||
if (response.statusCode !== 429) break
|
if (response.statusCode !== 429) break
|
||||||
|
|||||||
@ -432,3 +432,12 @@ test('caFingerprint can\'t be configured over http / 2', t => {
|
|||||||
)
|
)
|
||||||
t.end()
|
t.end()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('user agent is in the correct format', t => {
|
||||||
|
const client = new Client({ node: 'http://localhost:9200' })
|
||||||
|
const agentRaw = client.transport[symbols.kHeaders]['user-agent'] || ''
|
||||||
|
const agentSplit = agentRaw.split(/\s+/)
|
||||||
|
t.equal(agentSplit[0].split('/')[0], 'elasticsearch-js')
|
||||||
|
t.ok(/^\d+\.\d+\.\d+/.test(agentSplit[0].split('/')[1]))
|
||||||
|
t.end()
|
||||||
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user