elasticsearch
Advanced tools
Comparing version 10.1.3 to 11.0.0
# elasticsearch-js changelog | ||
## 11.0 (Apr 5 2016) | ||
- apiVersion `"2.3"` is not the default | ||
- updated APIs, to use the new API's exposed by the `v5.0.0-alpha1` of elasticsearch use the `"master"` api version. | ||
- Switch to [promise](https://www.npmjs.com/package/promise) from [promise-js](https://www.npmjs.com/package/promise-js) to prevent polluting global environment | ||
## 10.1 (Jan 8 2016) | ||
@@ -4,0 +9,0 @@ - browser builds now include the "unstable" api's from elasticsearch |
@@ -10,3 +10,3 @@ { | ||
"homepage": "http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html", | ||
"version": "10.1.3", | ||
"version": "11.0.0", | ||
"browser": { | ||
@@ -23,4 +23,5 @@ "./src/lib/connectors/index.js": "./src/lib/connectors/browser_index.js", | ||
}, | ||
"default_api_branch": "2.1", | ||
"default_api_branch": "2.3", | ||
"supported_es_branches": [ | ||
"2.3", | ||
"2.2", | ||
@@ -64,3 +65,3 @@ "2.1", | ||
"grunt-contrib-watch": "~0.5.3", | ||
"grunt-esvm": "^2.0.0", | ||
"grunt-esvm": "^3.1.1", | ||
"grunt-mocha-cov": "^0.4.0", | ||
@@ -96,3 +97,3 @@ "grunt-open": "~0.2.2", | ||
"lodash-compat": "^3.0.0", | ||
"promise-js": "0.0.6" | ||
"promise": "^7.1.1" | ||
}, | ||
@@ -99,0 +100,0 @@ "repository": { |
@@ -1,6 +0,5 @@ | ||
# elasticsearch.js 10.1.3 | ||
# elasticsearch.js 11.0.0 | ||
The official low-level Elasticsearch client for Node.js and the browser. | ||
[![Build Status](http://img.shields.io/travis/elastic/elasticsearch-js/master.svg?style=flat-square)](https://travis-ci.org/elastic/elasticsearch-js?branch=master) | ||
[![Coverage Status](http://img.shields.io/coveralls/elastic/elasticsearch-js/master.svg?style=flat-square)](https://coveralls.io/r/elastic/elasticsearch-js?branch=master) | ||
@@ -40,3 +39,3 @@ [![Dependencies up to date](http://img.shields.io/david/elastic/elasticsearch-js.svg?style=flat-square)](https://david-dm.org/elastic/elasticsearch-js) | ||
## Questions? | ||
You can probably find help in the #elasticsearch-js or #kibana rooms on [freenode](http://webchat.freenode.net/?channels=elasticsearch-js). | ||
You can probably find help in [#kibana](https://kiwiirc.com/client/irc.freenode.net/?#kibana) on freenode. | ||
@@ -46,3 +45,3 @@ | ||
[![Supporting Elasticsearch Version 0.90 to 2.0](http://img.shields.io/badge/elasticsearch-0.90--2.0-green.svg?style=flat-square)](http://build-eu-00.elasticsearch.org/job/es-js_nightly/) | ||
![Supporting Elasticsearch Version 0.90 to 5.0-alpha1](https://img.shields.io/badge/elasticsearch-0.90%20to%205.0--alpha1-green.svg?style=flat-square) | ||
@@ -49,0 +48,0 @@ Elasticsearch.js provides support for, and is regularly tested against, Elasticsearch releases 0.90.12 and greater. We also test against the latest changes in several branches in the Elasticsearch repository. To tell the client which version of Elastisearch you are using, and therefore the API it should provide, set the `apiVersion` config param. [More info](http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/configuration.html#config-options) |
module.exports = { | ||
'_default': require('./2_3'), | ||
'2.3': require('./2_3'), | ||
'2.2': require('./2_2'), | ||
'_default': require('./2_1'), | ||
'2.1': require('./2_1'), | ||
'2.0': require('./2_0'), | ||
'1.7': require('./1_7'), | ||
'1.6': require('./1_6'), | ||
'2.x': require('./2_x'), | ||
'master': require('./master') | ||
}; |
module.exports = { | ||
'_default': require('./2_3'), | ||
'2.3': require('./2_3'), | ||
'2.2': require('./2_2'), | ||
'_default': require('./2_1'), | ||
'2.1': require('./2_1'), | ||
@@ -5,0 +6,0 @@ '2.0': require('./2_0'), |
@@ -146,3 +146,3 @@ | ||
default: | ||
throw new TypeError('Invalid ' + name + ': expected be a comma seperated list, array, number or string.'); | ||
throw new TypeError('Invalid ' + name + ': expected be a comma separated list, array, number or string.'); | ||
} | ||
@@ -359,2 +359,2 @@ }, | ||
}); | ||
} | ||
} |
@@ -99,2 +99,2 @@ module.exports = ConnectionAbstract; | ||
} | ||
}; | ||
}; |
@@ -22,2 +22,3 @@ var _ = require('./utils'); | ||
config = config || {}; | ||
if (!config.log) return; | ||
@@ -27,28 +28,26 @@ var i; | ||
if (config.log) { | ||
if (_.isArrayOfStrings(config.log)) { | ||
outputs = [{ | ||
levels: config.log | ||
}]; | ||
} else { | ||
outputs = _.createArray(config.log, function (val) { | ||
if (_.isPlainObject(val)) { | ||
return val; | ||
} | ||
if (typeof val === 'string') { | ||
return { | ||
level: val | ||
}; | ||
} | ||
}); | ||
} | ||
if (_.isArrayOfStrings(config.log)) { | ||
outputs = [{ | ||
levels: config.log | ||
}]; | ||
} else { | ||
outputs = _.createArray(config.log, function (val) { | ||
if (_.isPlainObject(val)) { | ||
return val; | ||
} | ||
if (typeof val === 'string') { | ||
return { | ||
level: val | ||
}; | ||
} | ||
}); | ||
} | ||
if (!outputs) { | ||
throw new TypeError('Invalid logging output config. Expected either a log level, array of log levels, ' + | ||
'a logger config object, or an array of logger config objects.'); | ||
} | ||
if (!outputs) { | ||
throw new TypeError('Invalid logging output config. Expected either a log level, array of log levels, ' + | ||
'a logger config object, or an array of logger config objects.'); | ||
} | ||
for (i = 0; i < outputs.length; i++) { | ||
this.addOutput(outputs[i]); | ||
} | ||
for (i = 0; i < outputs.length; i++) { | ||
this.addOutput(outputs[i]); | ||
} | ||
@@ -63,3 +62,3 @@ } | ||
if (this.listenerCount()) { | ||
console.error('Something is still listening for log events, but the logger is closing.'); | ||
console.error('Something is still listening for log events, but the logger is closing.'); // eslint-disable-line no-console | ||
this.clearAllListeners(); | ||
@@ -66,0 +65,0 @@ } |
@@ -10,3 +10,3 @@ /** | ||
var Host = require('./host'); | ||
var Promise = require('promise-js'); | ||
var Promise = require('promise/lib/es6-extensions'); | ||
var patchSniffOnConnectionFault = require('./transport/sniff_on_connection_fault'); | ||
@@ -65,11 +65,7 @@ var findCommonProtocol = require('./transport/find_common_protocol'); | ||
var hosts = _.map(hostsConfig, function (conf) { | ||
return (conf instanceof Host) ? conf : new Host(conf, self._config); | ||
}); | ||
if (randomizeHosts) { | ||
hosts = _.shuffle(hosts); | ||
hostsConfig = _.shuffle(hostsConfig); | ||
} | ||
self.connectionPool.setHosts(hosts); | ||
self.setHosts(hostsConfig); | ||
} | ||
@@ -395,6 +391,5 @@ | ||
Transport.prototype.sniff = function (cb) { | ||
var connectionPool = this.connectionPool; | ||
var self = this; | ||
var nodesToHostCallback = this.nodesToHostCallback; | ||
var log = this.log; | ||
var globalConfig = this._config; | ||
var sniffedNodesProtocol = this.sniffedNodesProtocol; | ||
@@ -420,9 +415,7 @@ | ||
connectionPool.setHosts(_.map(hostsConfigs, function (hostConfig) { | ||
if (sniffedNodesProtocol) { | ||
hostConfig.protocol = sniffedNodesProtocol; | ||
} | ||
_.forEach(hostsConfigs, function (hostConfig) { | ||
if (sniffedNodesProtocol) hostConfig.protocol = sniffedNodesProtocol; | ||
}); | ||
return new Host(hostConfig, globalConfig); | ||
})); | ||
self.setHosts(hostsConfigs); | ||
} | ||
@@ -434,2 +427,15 @@ cb(err, resp, status); | ||
/** | ||
* Set the host list that the transport should use. | ||
* | ||
* @param {Array<HostConfig>} hostsConfigs - an array of Hosts, or configuration objects | ||
* that will be used to create Host objects. | ||
*/ | ||
Transport.prototype.setHosts = function (hostsConfigs) { | ||
var globalConfig = this._config; | ||
this.connectionPool.setHosts(_.map(hostsConfigs, function (conf) { | ||
return (conf instanceof Host) ? conf : new Host(conf, globalConfig); | ||
})); | ||
}; | ||
/** | ||
* Close the Transport, which closes the logs and connection pool | ||
@@ -436,0 +442,0 @@ * @return {[type]} [description] |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 5 instances in 1 package
2714951
90721
4
58
125
+ Addedpromise@^7.1.1
+ Addedasap@2.0.6(transitive)
+ Addedpromise@7.3.1(transitive)
- Removedpromise-js@0.0.6
- Removedpromise-js@0.0.6(transitive)