Commit Graph

54 Commits

Author SHA1 Message Date
af97ece807 Export SniffingTransport (#1648) 2022-03-03 16:10:32 +01:00
4492532727 Update unknown parameter handling. (#1568) 2021-10-18 16:01:55 +02:00
070b9d75b9 pre-8.0 improvements (#1567) 2021-10-18 12:21:37 +02:00
1a227459f0 Elasticsearch v8 (#1558) 2021-09-30 09:45:04 +02:00
212c3c4ffe Add support for maxResponseSize and maxCompressedResponseSize (#1551) 2021-09-16 08:19:57 +02:00
a0dcace7cd Fix isHttpConnection check (#1526) 2021-08-20 12:40:25 +02:00
2d1505eb2b Support CA fingerprint validation (#1499)
Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>
Co-authored-by: Ioannis Kakavas <ioannis@elastic.co>
2021-08-02 11:20:31 +02:00
17c744ed80 Verify connection to Elasticsearch (#1487) 2021-07-19 16:42:04 +02:00
4073d60b97 Add api compatibility header support (#1478) 2021-07-13 09:47:45 +02:00
c64152b9b3 Drop node v10 support (#1471) 2021-05-20 16:16:45 +02:00
6a30cd9955 Disable prototype poisoning option (#1414)
* Introduce disablePrototypePoisoningProtection option

* Updated test

* Updated docs

* Fix bundler test
2021-03-15 08:51:45 +01:00
ab5d8997b8 Remove Node.js v8 support (#1402) 2021-02-19 08:27:20 +01:00
618b244473 Prereleases in meta header should be displayed as p (#1381) 2021-01-19 08:10:27 +01:00
61eee69424 Added x-elastic-client-meta header (#1373) 2020-12-16 10:42:26 +01:00
33035901cf Added new observability events (#1365) 2020-12-09 11:43:46 +01:00
a62e26e901 Add warning log about nodejs version support (#1349) 2020-11-10 18:08:16 +01:00
a064f0f357 Improve child performances (#1314) 2020-09-23 11:31:09 +02:00
26238634a7 Added proxy support (#1260) 2020-08-03 11:39:24 +02:00
51ab5b0b00 Updated license header (master) (#1266) 2020-07-23 12:26:56 +02:00
39cf023426 Add support for a global context option (#1256) 2020-07-13 14:36:53 +02:00
8d7859d2e2 Improve child API (#1245) 2020-07-06 11:39:08 +02:00
b4d0dc87d3 Reorganized test and force 100% code coverage (#1226) 2020-06-15 08:37:04 +02:00
22de806b67 Disable client Helpers in Node.js < 10. (#1194) 2020-05-14 16:03:08 +02:00
d7836a16af Client helpers (#1107)
* Added client helpers

* Updated test

* The search helper should return only the documents

* Added code comments

* Fixed bug

* Updated test

* Removed bulkSize and added flushBytes

* Updated test

* Added concurrency

* Updated test

* Added support for 429 handling in the scroll search helper

* Updated test

* Updated stats count

* Updated test

* Fix test

* Use client maxRetries as default

* Updated type definitions

* Refactored bulk helper to be more consistent with the client api

* Updated test

* Improved error handling, added refreshOnCompletion option and forward additinal options to the bulk api

* Updated type definitions

* Updated test

* Fixed test on Node v8

* Updated test

* Added TODO

* Updated docs

* Added Node v8 note

* Updated scripts

* Removed useless files

* Added helpers to integration test

* Fix cli argument position

* Moar fixes

* Test run elasticsearch in github actions

* Use master action version

* Add vm.max_map_count step

* Test new action setup

* Added Configure sysctl limits step

* Updated action to latest version

* Don't run helpers integration test in jenkins

* Run helpers integratino test also with Node v10

* Updated docs

* Updated docs

* Updated helpers type definitions

* Added test for helpers type definitions

* Added license header
2020-03-23 17:43:10 +01:00
0f1746014c X-Opaque-Id support (#997)
* Added X-Opaque-Id support

* Updated type definitions

* Updated test

* Updated docs
2019-12-02 09:21:03 +01:00
a948a98be6 Refactored connection pool (#913)
* Refactored ConnectionPool
- Created BaseConnectionPool class
- Created CloudConnectionPool
- connection pool updates are immutable
- resurrect now happens inside getConnection()

* Rewritten connection pool(s) type definitions

* Updated test

* Fixed test

* Fix if check

* Removed old files

* Improve code coverage

* Updated license header

* Fix if check

* Improve code coverage

* Updated coverage script
2019-07-26 11:43:48 +02:00
36a1666cc8 Updated license header (#915) 2019-07-22 11:46:59 +02:00
0ebbd71e9a Improve authentication handling (#908) 2019-07-18 10:33:11 +02:00
269c0fc96a 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:23:40 +02:00
cae38e6b2b License (#773)
- Added license header
- Added license checker
- Fixed tap
2019-03-08 07:47:24 +01:00
8398ae2f4b Updated Elastic Cloud config 2019-02-28 10:57:42 +01:00
7e318cb334 Enable compression for both request and response when using Elastic Cloud 2019-02-21 15:39:01 +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
974bf0a819 Added global headers option 2019-02-20 12:43:06 +01:00
0915c8c613 Added force option to extend method 2019-02-19 09:33:25 +01:00
98e8bbd63d Added cloud option and disable dead/alive handling if there is only one node and sniffing is disabled 2019-02-19 08:34:06 +01:00
b19d93fb1e WIP: initial prototype
- Added body compression
- Removed old options
2019-02-11 12:01:52 +01:00
5e7ca876e4 Added extend method (#763)
* Added extend method

* Updated test
2019-01-30 19:10:59 +01:00
fc6d12ad3e Updated closing logic 2018-12-19 19:49:29 +01:00
a9e621721e WIP: initial prototype
- Added client.close API
- Added resurrect event
- Improved resurrect ping strategy
- Updated types
2018-12-10 20:15:42 +01:00
aa5977b153 WIP: initial prototype
- Added error parameter to request and response event
- Dropped error event
- Updated typescript indentation
2018-12-05 22:18:32 +01:00
fd738f8425 WIP: initial prototype
- Standardized event emitters
- Refactored transport.request to have a better handling of the state
- Added sniff event
- Improved abort handling
2018-12-03 18:11:43 +01:00
ab1d7ba992 Typings support (#737)
* Updated scripts

* Updated .gitignore

* Removed symbols

* Fixed typo

* Added typings

* Updated test

* Added typings test
2018-11-30 17:01:55 +01:00
020165168c WIP: initial prototype
- Expose connection info inside events
- Fixed minor bugs
2018-11-19 11:33:40 +01:00
0701a795c2 Node v6 fix 2018-11-09 17:32:29 +01:00
3dd4f01370 WIP: initial prototype
- Renamed host configuration, now we use node(s)
- Updated Connection internals
- Added custom headers for Connection
2018-11-09 17:15:29 +01:00
d77d97d301 WIP: initial prototype
- Use plain node http.request
- WIP: connection closing procedure
- Updated ConnectionPool.getConnection
- Removed Selector class and expose a single configuration parameter
- Added compression handling
- Improved code documentation
2018-11-05 19:19:39 +01:00
55c507c423 API generation 2018-10-30 17:26:22 +01:00
c9635c4a71 WIP: initial prototype
- Added support for different format of requestTimemout
- Changed api method result
- Now we are always returning the result in case of error
- Improved body deserialization
- Added cast to boolen for HEAD requests
- Added support for already serialized strings in the ndserializer
- Fixed qserializer in case of null object
- Updated Errors
2018-10-30 16:32:10 +01:00
8ce9f970f0 WIP: initial prototype
- Added randomizeHost option
- Added ignore status code option
- Updated error classes
- Added ndjson support
- Retry on 502/3/4
2018-10-25 17:10:00 +02:00