Compare commits

..

10 Commits
v8.2.1 ... 8.2

Author SHA1 Message Date
8f147fc97a [Backport 8.2] Use correct user-agent header by default (#1868)
Co-authored-by: Josh Mock <josh@joshmock.com>
2023-05-05 11:20:03 -05:00
d5defcf089 [8.2] [DOCS] Includes source_branch in docs index 2023-02-22 07:47:13 -06:00
a629bbbc6b Remove unnecessary ts-expect-error
Co-authored-by: Seth Michael Larson <seth.larson@elastic.co>
2022-09-27 07:52:05 -05:00
2d9056cb3d Fix docs URLs to use '8.2' instead of 'master' 2022-09-27 06:40:25 -05:00
978ca8383b Bumps to version 8.2.4 2022-06-27 06:58:52 -05:00
8d32571a6d [8.2] Change 'current' to 'master' in user profile API links
Co-authored-by: David Kilfoyle <41695641+kilfoyle@users.noreply.github.com>
2022-06-24 17:00:54 -05:00
75cfea4d0a Fix typo in changelog
Fixes a typo: `storngly` -> `strongly`
2022-06-21 14:55:31 -05:00
93de643941 Bumps 8.2 to 8.2.3 (#1707)
Co-authored-by: Tomas Della Vedova <delvedor@users.noreply.github.com>
2022-05-31 17:52:42 +02:00
431b4d3898 Bumps 8.2 to 8.2.2 (#1700)
Co-authored-by: Tomas Della Vedova <delvedor@users.noreply.github.com>
2022-05-31 17:45:08 +02:00
9ecc7e1f2f Fix to proxy connection string value (#1706) 2022-05-30 10:54:34 +02:00
10 changed files with 164 additions and 153 deletions

View File

@ -1,6 +1,6 @@
---
STACK_VERSION:
- "8.2.0-SNAPSHOT"
- "8.2.4-SNAPSHOT"
NODE_JS_VERSION:
- 18

View File

@ -18,7 +18,7 @@ https://www.elastic.co/guide/en/elasticsearch/reference/8.2/release-notes-8.2.1.
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 storngly recommend upgrading to this version.
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]

View File

@ -553,7 +553,7 @@ Basic authentication is supported as well:
----
const client = new Client({
node: 'http://localhost:9200',
proxy: 'http:user:pwd@//localhost:8080'
proxy: 'http://user:pwd@localhost:8080'
})
----

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

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

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
{
"name": "@elastic/elasticsearch",
"version": "8.2.1",
"versionCanary": "8.2.1-canary.0",
"version": "8.2.4",
"versionCanary": "8.2.4-canary.0",
"description": "The official Elasticsearch client for Node.js",
"main": "index.js",
"types": "index.d.ts",
@ -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

@ -229,7 +229,6 @@ export default class Helpers {
rest_total_hits_as_int: params.rest_total_hits_as_int,
scroll_id
}, options as TransportRequestOptionsWithMeta)
// @ts-expect-error
response = r as TransportResult<T.ScrollResponse<TDocument, TAggregations>, unknown>
assert(response !== undefined, 'The response is undefined, please file a bug report')
if (response.statusCode !== 429) break

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()
})