aadf44bbf2
Remove auth data from inspect and toJSON in connection class ( #887 )
...
* Remove auth data from inspect and toJSON in connection class
* Updated test
2019-07-04 14:43:38 +02:00
bef1604a8d
Updated type definitions ( #882 )
...
* Updated type definitions
* Updated test
2019-06-19 09:15:43 +02:00
06b3a1ceb7
Support for non-friendly chars in url username and password ( #858 )
...
* Support for non-friendly chars in url username and password
- Added auth option to Connection class
- Updated pool.addConnection
* Updated test
2019-05-20 17:10:31 +02:00
bf482cf269
Added toJSON method to Connection class ( #849 )
...
* Added toJSON method to Connection class
* Updated test
* Updated typings
2019-05-14 12:01:32 -04:00
f9e2d5f708
Fix #803 ( #846 )
2019-05-14 12:01:32 -04:00
ed8adba2ab
Fix 843 ( #845 )
...
* Fix #843
* Updated test
2019-05-10 10:56:20 +02:00
a52cf6be38
Added User-Agent header ( #807 )
...
* Added User-Agent header
* Updated test
* Updated user-agent format
* Updated test
2019-05-06 10:00:16 +02:00
14fc908d4b
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:26:40 +02:00
7d810f8110
Better handling of hostname/ip:port format ( #837 )
...
* Better handling of hostname/ip:port format
* Updated test
2019-05-03 17:26:33 +02:00
ee36f7b43f
Fix resurrect timeout formula ( #833 )
...
* Fixes #827
* Updated test
2019-04-29 09:20:32 +02:00
c67a5dfdc2
Update RequestEvent to use parameterized type T ( #822 )
...
Updated `RequestEvent` to use parameterized type `T`. In reference to:
https://github.com/elastic/elasticsearch-js/pull/819#issuecomment-484594841
2019-04-19 10:07:28 +02:00
3c99839e4a
Updated typings ( #819 )
2019-04-17 11:25:06 +02:00
48c6ad15a6
Improve typings ( #813 )
...
The ApiResponse now accepts a generics that defaults to any, same for every API method that might need a body.
2019-04-10 11:44:47 +02:00
48233503f7
Custom http agent support ( #810 )
2019-04-10 11:44:33 +02:00
e530ed2313
Support for publish_address as hostname/ip:port ( #804 )
2019-04-09 12:06:41 +02:00
dc5102d30b
Inspect Connection ( #784 )
...
Handles `console.log` and `utils.inspect` invocations for a better debugging experience.
`agent` and `ssl` are hidden since they made the logs very hard to read.
The user can still access them with `instance.agent` and `instance.ssl`.
2019-03-19 10:33:50 +01:00
d5256e2fc1
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:55:35 +01:00
ae028b2ae2
Consistency for the win
...
- The result object contains also the metadata about the request
- The events emits the same object of the API response
- The errors, where possible, exposes the APi response object under the
meta key
2019-03-11 17:13:02 +01:00
46df19fd7d
Updated types
2019-03-11 17:12:31 +01:00
cae38e6b2b
License ( #773 )
...
- Added license header
- Added license checker
- Fixed tap
2019-03-08 07:47:24 +01:00
f175f83d34
Workaround for keepAlive false
2019-03-01 09:02:31 +01:00
ed3cca0fe6
Platinum integration test ( #772 )
...
🎉
2019-03-01 08:42:56 +01:00
36163f4822
Use a safe default for keep alive maxSockets ( #770 )
2019-02-28 16:08:14 +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
665ea3999d
Updated types
2019-02-19 09:33:59 +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
e4669e656d
Handle compression for streams
2019-02-12 16:40:10 +01:00
ecb2ba47a8
Small fixes
2019-02-11 17:37:29 +01:00
dbe4557848
Use custom client error class
2019-02-11 17:37:16 +01:00
b19d93fb1e
WIP: initial prototype
...
- Added body compression
- Removed old options
2019-02-11 12:01:52 +01:00
8a14ede19f
Updated typings
2019-02-11 11:54:22 +01:00
23cfe11e44
Unknown parameters handling ( #761 )
2019-01-29 17:31:43 +01:00
55fc8d7388
Handle unescaped characters
2019-01-28 11:27:21 +01:00
88c9fa8546
Consistent roles handling
2019-01-21 16:49:08 +01:00
ea3e54b255
Updated Connection Pool
...
- Merge nodes with same url but different id during update
- Cache auth data if provided when adding a connection
2019-01-14 16:08:20 +01:00
fc6d12ad3e
Updated closing logic
2018-12-19 19:49:29 +01:00
32e674f26c
Added protocol validation
2018-12-18 17:28:25 +01:00
3c667d38e6
Handle headers as request option
2018-12-13 16:54:01 +01:00
f6020e68a4
WIP: initial prototype
...
- Do not serilize keys with undefined values in querystring
- Added promises support in Transport.request
2018-12-12 19:47:33 +01:00
b91b1ad1de
WIP: initial prototype
...
- Added options parameter in API methods
- Updated typings
2018-12-12 16:53:51 +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
b60a716e00
WIP: initial prototype
...
- Added sniff reason
- Improved types
2018-12-04 14:29:40 +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
79b4187f30
WIP: initial prototype
...
- Hide auth data from Node ID
- Added support for sending streams
2018-11-20 18:51:23 +01:00
020165168c
WIP: initial prototype
...
- Expose connection info inside events
- Fixed minor bugs
2018-11-19 11:33:40 +01:00
11b0d50751
WIP: initial prototype
...
- Added asStream option
- Better handling of request object
2018-11-15 17:50:56 +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