@elastic/elasticsearch 7.17.12 → 7.17.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.neoconf.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "lspconfig": {
3
+ "tsserver": {
4
+ "typescript.format.enable": false,
5
+ "javascript.format.enable": false
6
+ }
7
+ }
8
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "test/*": {
3
+ "make": "npm run test:unit"
4
+ },
5
+ "*.ts": {
6
+ "type": "source",
7
+ "template": [
8
+ "/*",
9
+ " * Licensed to Elasticsearch B.V. under one or more contributor",
10
+ " * license agreements. See the NOTICE file distributed with",
11
+ " * this work for additional information regarding copyright",
12
+ " * ownership. Elasticsearch B.V. licenses this file to you under",
13
+ " * the Apache License, Version 2.0 (the \"License\"); you may",
14
+ " * not use this file except in compliance with the License.",
15
+ " * You may obtain a copy of the License at",
16
+ " *",
17
+ " * http://www.apache.org/licenses/LICENSE-2.0",
18
+ " *",
19
+ " * Unless required by applicable law or agreed to in writing,",
20
+ " * software distributed under the License is distributed on an",
21
+ " * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY",
22
+ " * KIND, either express or implied. See the License for the",
23
+ " * specific language governing permissions and limitations",
24
+ " * under the License.",
25
+ " */"
26
+ ]
27
+ },
28
+ "src/client.ts": {
29
+ "alternate": "test/unit/client.test.ts",
30
+ "type": "test"
31
+ },
32
+ "test/unit/client.test.ts": {
33
+ "alternate": "src/client.ts",
34
+ "type": "src"
35
+ },
36
+ "src/helpers.ts": {
37
+ "alternate": "test/unit/helpers/",
38
+ "type": "test"
39
+ },
40
+ "test/unit/helpers/*.test.ts": {
41
+ "alternate": "src/helpers.ts",
42
+ "type": "src"
43
+ }
44
+ }
package/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ nodejs 22.2.0
@@ -49,6 +49,7 @@ interface TransportOptions {
49
49
  serializer: Serializer;
50
50
  maxRetries: number;
51
51
  requestTimeout: number | string;
52
+ retryOnTimeout?: boolean;
52
53
  suggestCompression?: boolean;
53
54
  compression?: 'gzip';
54
55
  sniffInterval?: number;
package/lib/Transport.js CHANGED
@@ -57,6 +57,7 @@ class Transport {
57
57
  this.serializer = opts.serializer
58
58
  this.maxRetries = opts.maxRetries
59
59
  this.requestTimeout = toMs(opts.requestTimeout)
60
+ this.retryOnTimeout = opts.retryOnTimeout != null ? opts.retryOnTimeout : false
60
61
  this.suggestCompression = opts.suggestCompression === true
61
62
  this.compression = opts.compression || false
62
63
  this.context = opts.context || null
@@ -220,6 +221,13 @@ class Transport {
220
221
  })
221
222
  }
222
223
 
224
+ // do not retry timeout errors by default
225
+ if (err.name === 'TimeoutError' && this.retryOnTimeout !== true) {
226
+ err.meta = result
227
+ this.emit('response', err, result)
228
+ return callback(err, result)
229
+ }
230
+
223
231
  // retry logic
224
232
  if (meta.attempts < maxRetries) {
225
233
  meta.attempts++
@@ -206,6 +206,10 @@ class BaseConnectionPool {
206
206
 
207
207
  for (let i = 0, len = ids.length; i < len; i++) {
208
208
  const node = nodes[ids[i]]
209
+
210
+ // newly-added nodes do not have http assigned yet, so skip
211
+ if (node.http === undefined) continue
212
+
209
213
  // If there is no protocol in
210
214
  // the `publish_address` new URL will throw
211
215
  // the publish_address can have two forms:
package/package.json CHANGED
@@ -12,8 +12,8 @@
12
12
  "./*": "./*.js"
13
13
  },
14
14
  "homepage": "http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html",
15
- "version": "7.17.12",
16
- "versionCanary": "7.17.12-canary.1",
15
+ "version": "7.17.14",
16
+ "versionCanary": "7.17.14-canary.0",
17
17
  "keywords": [
18
18
  "elasticsearch",
19
19
  "elastic",