Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

elasticsearch

Package Overview
Dependencies
Maintainers
2
Versions
128
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elasticsearch - npm Package Compare versions

Comparing version 4.1.0 to 5.0.0

src/lib/apis/1_6.js

8

CHANGELOG.md
# elasticsearch-js changelog
## 5.0 (Jun...)
- Added apiVersion `"1.6"`, which is now the default
## 4.1 (May 19 2015)
- Plugin configuration option added
- Added support for object based error
## 4.0 (Mar 26 2015)

@@ -8,2 +15,3 @@ - Added apiVersion `"1.5"`, which is now the default

- Updated dependencies
- Make the stream logger actually usable (thanks @falmp!)

@@ -10,0 +18,0 @@ ## 3.1 (Jan 6 2015)

9

package.json

@@ -10,3 +10,3 @@ {

"homepage": "http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html",
"version": "4.1.0",
"version": "5.0.0",
"browser": {

@@ -24,2 +24,3 @@ "./src/lib/connectors/index.js": "./src/lib/connectors/browser_index.js",

"supported_es_branches": [
"1.6",
"1.5",

@@ -37,3 +38,3 @@ "1.4",

],
"default_api_branch": "1.5"
"default_api_branch": "1.6"
},

@@ -59,3 +60,3 @@ "devDependencies": {

"grunt-contrib-watch": "~0.5.3",
"grunt-esvm": "~0.3.2",
"grunt-esvm": "^1.0.0",
"grunt-mocha-cov": "~0.2.0",

@@ -71,3 +72,3 @@ "grunt-open": "~0.2.2",

"load-grunt-tasks": "~0.2.0",
"mocha": "~1.21.4",
"mocha": "^2.2.5",
"mocha-lcov-reporter": "0.0.1",

@@ -74,0 +75,0 @@ "mocha-screencast-reporter": "~0.1.4",

@@ -5,4 +5,4 @@ # elasticsearch.js

[![Build Status](http://img.shields.io/travis/elastic/elasticsearch-js/4.1.svg?style=flat-square)](https://travis-ci.org/elastic/elasticsearch-js?branch=4.1)
[![Coverage Status](http://img.shields.io/coveralls/elastic/elasticsearch-js/4.1.svg?style=flat-square)](https://coveralls.io/r/elastic/elasticsearch-js?branch=4.1)
[![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)
[![Dependencies up to date](http://img.shields.io/david/elastic/elasticsearch-js.svg?style=flat-square)](https://david-dm.org/elastic/elasticsearch-js)

@@ -36,6 +36,6 @@

<td align="center">
<a href="https://download.elastic.co/elasticsearch/elasticsearch-js/elasticsearch-js-4.1.0.zip">zip</a>
<a href="https://download.elastic.co/elasticsearch/elasticsearch-js/elasticsearch-js-5.0.0.zip">zip</a>
</td>
<td align="center">
<a href="https://download.elastic.co/elasticsearch/elasticsearch-js/elasticsearch-js-4.1.0.tar.gz">tar.gz</a>
<a href="https://download.elastic.co/elasticsearch/elasticsearch-js/elasticsearch-js-5.0.0.tar.gz">tar.gz</a>
</td>

@@ -42,0 +42,0 @@ </tr>

module.exports = {
'1.6': require('./1_6'),
'1.5': require('./1_5'),
'1.4': require('./1_4'),
'1.3': require('./1_3')
'1.4': require('./1_4')
};
module.exports = {
'master': require('./master'),
'1.x': require('./1_x'),
'1.6': require('./1_6'),
'1.5': require('./1_5'),

@@ -5,0 +6,0 @@ '1.4': require('./1_4'),

var _ = require('./utils');
/**
* Constructs a client action factory that uses specific defaults
* @type {Function}
*/
exports.makeFactoryWithModifier = makeFactoryWithModifier;
/**
* Constructs a function that can be called to make a request to ES
* @type {Function}
*/
exports.factory = factory;
exports.factory = makeFactoryWithModifier();

@@ -12,3 +20,3 @@ /**

*/
exports.proxyFactory = proxyFactory;
exports.proxyFactory = exports.factory.proxy;

@@ -29,56 +37,62 @@ // export so that we can test this

var _ = require('./utils');
function makeFactoryWithModifier(modifier) {
modifier = modifier || _.identity;
function factory(spec) {
if (!_.isPlainObject(spec.params)) {
spec.params = {};
}
var factory = function (spec) {
spec = modifier(spec);
if (!spec.method) {
spec.method = 'GET';
}
if (!_.isPlainObject(spec.params)) {
spec.params = {};
}
function action(params, cb) {
if (typeof params === 'function') {
cb = params;
params = {};
} else {
params = params || {};
cb = typeof cb === 'function' ? cb : null;
if (!spec.method) {
spec.method = 'GET';
}
try {
return exec(this.transport, spec, _.clone(params), cb);
} catch (e) {
if (typeof cb === 'function') {
_.nextTick(cb, e);
function action(params, cb) {
if (typeof params === 'function') {
cb = params;
params = {};
} else {
var def = this.transport.defer();
def.reject(e);
return def.promise;
params = params || {};
cb = typeof cb === 'function' ? cb : null;
}
try {
return exec(this.transport, spec, _.clone(params), cb);
} catch (e) {
if (typeof cb === 'function') {
_.nextTick(cb, e);
} else {
var def = this.transport.defer();
def.reject(e);
return def.promise;
}
}
}
}
action.spec = spec;
action.spec = spec;
return action;
}
return action;
};
function proxyFactory(fn, spec) {
return function (params, cb) {
if (typeof params === 'function') {
cb = params;
params = {};
} else {
params = params || {};
cb = typeof cb === 'function' ? cb : null;
}
factory.proxy = function (fn, spec) {
return function (params, cb) {
if (typeof params === 'function') {
cb = params;
params = {};
} else {
params = params || {};
cb = typeof cb === 'function' ? cb : null;
}
if (spec.transform) {
spec.transform(params);
}
if (spec.transform) {
spec.transform(params);
}
return fn.call(this, params, cb);
return fn.call(this, params, cb);
};
};
return factory;
}

@@ -293,5 +307,3 @@

var key, paramSpec;
for (key in params) {
for (var key in params) {
if (params.hasOwnProperty(key) && params[key] != null) {

@@ -311,3 +323,3 @@ switch (key) {

default:
paramSpec = spec.params[key];
var paramSpec = spec.params[key];
if (paramSpec) {

@@ -314,0 +326,0 @@ // param keys don't always match the param name, in those cases it's stored in the param def as "name"

@@ -69,3 +69,3 @@ /**

EsApiClient.prototype = _.funcEnum(config, 'apiVersion', Client.apis, '1.5');
EsApiClient.prototype = _.funcEnum(config, 'apiVersion', Client.apis, '1.6');
if (!config.sniffEndpoint && EsApiClient.prototype === Client.apis['0.90']) {

@@ -72,0 +72,0 @@ config.sniffEndpoint = '/_cluster/nodes';

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc