Compare commits

...

6 Commits

Author SHA1 Message Date
58914fc18c Switch 8.6 clients to only get patch updates to transport (#2210)
* Switch 8.6 clients to only get patch updates to transport

* Fix escaping on asciidocs
2024-04-09 12:46:51 -05:00
e919432cf0 [Backport 8.6] Use correct user-agent header by default (#1869)
Co-authored-by: Josh Mock <josh@joshmock.com>
2023-05-05 11:15:25 -05:00
2fd6f82b0f [8.6] [DOCS] Includes source_branch in docs index 2023-02-22 07:49:51 -06:00
2be9e7cf5d Update bulk.asciidoc (#1752) (#1807)
Fix typo

Co-authored-by: Ryan Har <31252286+nkwwk@users.noreply.github.com>
2023-01-12 14:52:58 +01:00
281ac00af7 [8.6] Add release notes for 8.6.0
Co-authored-by: Seth Michael Larson <seth.larson@elastic.co>
2023-01-10 15:28:28 -05:00
0f0c600bb7 [8.6] Bump @elastic/transport to 8.3.1
Co-authored-by: Rudolf Meijering <skaapgif@gmail.com>
2023-01-05 10:28:52 -06:00
6 changed files with 42 additions and 8 deletions

View File

@ -1,6 +1,28 @@
[[changelog-client]]
== Release notes
[discrete]
=== 8.6.1
[discrete]
===== Bump @elastic/transport to `~8.3.1`
Switching from `^8.3.1` to `~8.3.1` ensures 8.6 client users are not required to update to Node.js v18+, which is a new requirement set by `@elastic/transport` v8.5.0. See https://github.com/elastic/elastic-transport-js/issues/91[elastic/elastic-transport-js#91] for details.
[discrete]
=== 8.6.0
[discrete]
===== Bump @elastic/transport to 8.3.1+ https://github.com/elastic/elasticsearch-js/pull/1802[#1802]
The `@elastic/transport` dependency has been bumped to `~8.3.1` to ensure
fixes to the `maxResponseSize` option are available in the client.
[discrete]
===== Support for Elasticsearch `v8.6.0`
You can find all the API changes
https://www.elastic.co/guide/en/elasticsearch/reference/8.6/release-notes-8.6.0.html[here].
[discrete]
=== 8.5.0

View File

@ -77,8 +77,8 @@ async function run () {
// fix the document before to try it again.
status: action[operation].status,
error: action[operation].error,
operation: body[i * 2],
document: body[i * 2 + 1]
operation: operations[i * 2],
document: operations[i * 2 + 1]
})
}
})

View File

@ -1,6 +1,6 @@
= Elasticsearch JavaScript Client
:branch: master
include::{asciidoc-dir}/../../shared/versions/stack/{source_branch}.asciidoc[]
include::{asciidoc-dir}/../../shared/attributes.asciidoc[]
include::introduction.asciidoc[]

View File

@ -1,7 +1,7 @@
{
"name": "@elastic/elasticsearch",
"version": "8.6.0",
"versionCanary": "8.6.0-canary.0",
"version": "8.6.1",
"versionCanary": "8.6.1-canary.0",
"description": "The official Elasticsearch client for Node.js",
"main": "index.js",
"types": "index.d.ts",
@ -81,7 +81,7 @@
"zx": "^6.1.0"
},
"dependencies": {
"@elastic/transport": "^8.2.0",
"@elastic/transport": "~8.3.1",
"tslib": "^2.4.0"
},
"tap": {
@ -91,4 +91,4 @@
"coverage": false,
"check-coverage": false
}
}
}

View File

@ -20,6 +20,7 @@
import { ConnectionOptions as TlsConnectionOptions } from 'tls'
import { URL } from 'url'
import buffer from 'buffer'
import os from 'os'
import {
Transport,
UndiciConnection,
@ -173,7 +174,9 @@ export default class Client extends API {
tls: null,
caFingerprint: null,
agent: null,
headers: {},
headers: {
'user-agent': `elasticsearch-js/${clientVersion} Node.js ${nodeVersion}; Transport ${transportVersion}; (${os.platform()} ${os.release()} ${os.arch()})`
},
nodeFilter: null,
generateRequestId: null,
name: 'elasticsearch-js',

View File

@ -432,3 +432,12 @@ test('caFingerprint can\'t be configured over http / 2', t => {
)
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()
})