Commit Graph

38 Commits

Author SHA1 Message Date
28370acf49 Remove Node.js v8 support (#1402) 2021-02-19 08:29:57 +01:00
cbfb9616a0 Handle connectivity issues while reading the body (#1343) 2020-11-10 18:24:53 +01:00
3db1bed4bd Improve child performances (#1314) 2020-09-23 11:34:36 +02:00
2c39a5413d Merge branch '7.x' of https://github.com/elastic/elasticsearch-js into 7.x 2020-09-10 15:29:27 +02:00
584a8799d8 Avoid the release of Zalgo (#1295) 2020-09-10 15:29:22 +02:00
f02567491f Fix maxRetries request option handling (#1296) 2020-09-10 15:29:22 +02:00
bb05668a44 Updated license header (#1267) 2020-07-23 12:27:18 +02:00
93cf8aa3c0 migrated to FakeTimers (#1221) 2020-06-08 09:44:40 +02:00
15a9479a81 [Backport 7.x] Force lowercase in all headers (#1195) 2020-05-14 16:11:12 +02:00
51169d5efa Support for Elasticsearch 7.7 (#1192) 2020-05-14 09:55:54 +02:00
ca23e0b23a [Backport 7.x] Secure json parsing (#1113)
* Safe json parsing

* Updated test

Co-authored-by: Tomas Della Vedova <delvedor@users.noreply.github.com>
2020-03-13 09:29:40 +01:00
21683e6826 Skip compression in case of empty string body (#1080)
* Fix #1069

* Updated test

* Updated test
2020-02-04 10:30:49 +01:00
8c78f47ac3 Support for Elasticsearch 7.3 (#928) 2019-08-01 10:09:16 +02:00
907f9d085c Added User-Agent header (#807)
* Added User-Agent header

* Updated test

* Updated user-agent format

* Updated test
2019-05-06 09:59:55 +02:00
b1458e3511 Improve observability (#834)
* API generation

* Added correlation id support

* Updated docs

* Updated test

* Updated code generation

* API generation

* Updated code generation

* Added support for client name and custom context object

* Updated docs

* Updated test

* Fix docs

* Updated docs

* Added id support also for sniffing

* Updated test

* Update docs/observability.asciidoc

Co-Authored-By: delvedor <delvedor@users.noreply.github.com>

* Update docs/observability.asciidoc

Co-Authored-By: delvedor <delvedor@users.noreply.github.com>

* Apply suggestions

* Update docs/configuration.asciidoc

Co-Authored-By: delvedor <delvedor@users.noreply.github.com>

* Update docs/configuration.asciidoc

Co-Authored-By: delvedor <delvedor@users.noreply.github.com>

* Update docs/observability.asciidoc

Co-Authored-By: delvedor <delvedor@users.noreply.github.com>

* Update docs/observability.asciidoc

Co-Authored-By: delvedor <delvedor@users.noreply.github.com>

* Update docs/observability.asciidoc

Co-Authored-By: delvedor <delvedor@users.noreply.github.com>

* Apply suggestions

* Updated README.md

* Fixed test

* Addressed suggestions
2019-05-03 17:25:25 +02:00
68c4dd29fb feat: add support for querystring in options object (#779)
In very few cases, some API uses the same key for both url and query params, such as the bulk method.
The client is not designed to handle such cases since accepts both url and query keys in the same object, and the url parameter will always take precedence.
This pr fixes this edge case by adding a `querystring` key in the options object.

Fixes: https://github.com/elastic/elasticsearch-js/pull/778

```js
client.bulk({
  index: 'index',
  type: '_doc',
  body: [...]
}, {
  querystring: {
    type: '_doc'
  }
}, console.log)
```
2019-03-19 09:53:43 +01:00
cae38e6b2b License (#773)
- Added license header
- Added license checker
- Fixed tap
2019-03-08 07:47:24 +01:00
5b856cd4c2 Child client support (#768)
With this pr we introduce the `client.child` API, which returns a new client instance that shares the connection pool with the parent client.
This feature can be handy if you need to have multiple client instances with different configurations, but with a shared connection pool.

Example:

```js
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const child = client.child({
  headers: { 'x-foo': 'bar' },
  requestTimeout: 1000
})

client.info(console.log)
child.info(console.log)
```

**Open questions:**

* Currently, the event emitter is shared between the parent and the child(ren), is it ok?
* Currently, if you extend the parent client, the child client will have the same extensions, while if the child client adds an extension, the parent client will not be extended. Is it ok?

**Caveats:**

* You can override _any_ option except for the connection pool specific options (`ssl`, `agent`, `pingTimeout`, `Connection`, and `resurrectStrategy`).
* You can't specify a new `Connection` class.
* If you call `close` in any of the parent/child clients, every client will be closed.

_Note: the `nodeFilter` and `nodeSelector` options are now `Transport` options and no longer `ConnectionPool` options._
2019-02-21 12:48:49 +01:00
66e8d61476 Updated test 2019-02-20 12:43:15 +01:00
2dbf00e821 Updated test 2019-02-12 16:40:19 +01:00
d9a5f24e24 Code coverage++ 2019-02-11 17:37:44 +01:00
3023e45661 Updated test 2019-02-11 12:03:55 +01:00
23cfe11e44 Unknown parameters handling (#761) 2019-01-29 17:31:43 +01:00
4bf9128cac Updated test 2018-12-12 19:48:27 +01:00
a86a552a85 Updated test 2018-12-12 16:53:51 +01:00
bf4adf0546 Updated test 2018-12-03 18:11:59 +01:00
53329e48bc Updated test 2018-11-20 18:52:22 +01:00
da710e26e1 Updated test 2018-11-19 11:35:02 +01:00
bd5ba19e17 Updated test 2018-11-15 17:53:54 +01:00
ca5e9ca743 Force close the server once the test is finished 2018-11-09 18:09:29 +01:00
9df4fcbbb6 Updated test 2018-11-09 17:17:05 +01:00
869b50fca9 Updated test 2018-11-08 19:41:33 +01:00
40cb37b2e8 Updated test 2018-11-05 19:22:36 +01:00
21a5c29aa8 Updated test 2018-10-30 16:36:03 +01:00
961b8224ef Updated test 2018-10-26 19:06:04 +02:00
8429ad28d9 Updated test 2018-10-25 17:16:29 +02:00
aca2712161 Updated test 2018-10-24 15:52:17 +02:00
b6b04f99d8 WIP: Added some basic unit tests
- Added unit test
- Added test fixtures
- Added test utils
2018-10-22 16:54:14 +02:00