From aa7b5a9ad9e669c9d0690a3013d109b54d32b333 Mon Sep 17 00:00:00 2001 From: Matt Lorey Date: Sat, 12 Jul 2014 20:26:02 -0700 Subject: [PATCH 1/8] Fix spelling error --- docs/host.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/host.asciidoc b/docs/host.asciidoc index 80831b1e7..50e3e3796 100644 --- a/docs/host.asciidoc +++ b/docs/host.asciidoc @@ -1,7 +1,7 @@ [[host-reference]] == Host -The host class is used to represent a single node/host/endpoint. These objects are created automatically by the Client constructor, as well as durring sniff operations. +The host class is used to represent a single node/host/endpoint. These objects are created automatically by the Client constructor, as well as during sniff operations. === Constructor(params) From f69263df23c15e6503a45630f0a82901b4e77934 Mon Sep 17 00:00:00 2001 From: Baldur Helgason Date: Thu, 17 Jul 2014 15:54:02 +0000 Subject: [PATCH 2/8] Lower the logging level of `Request complete` --- src/lib/transport.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/transport.js b/src/lib/transport.js index 1e3f98954..607fb27f9 100644 --- a/src/lib/transport.js +++ b/src/lib/transport.js @@ -197,7 +197,7 @@ Transport.prototype.request = function (params, cb) { respond(new errors.ConnectionFault(err)); } } else { - self.log.info('Request complete'); + self.log.debug('Request complete'); respond(void 0, body, status, headers); } } @@ -374,4 +374,4 @@ Transport.prototype.close = function () { this.log.close(); _.each(this._timers, clearTimeout); this.connectionPool.close(); -}; \ No newline at end of file +}; From 83ecd4914cf8cefee684bda79a8743452acd0fc5 Mon Sep 17 00:00:00 2001 From: Spencer Alger Date: Fri, 18 Jul 2014 04:41:09 -0700 Subject: [PATCH 3/8] added version upgrade task --- .jshintrc | 2 +- grunt/tasks.js | 37 ++++++++++++++++++++++++++++++++ grunt/utils.js | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 95 insertions(+), 1 deletion(-) diff --git a/.jshintrc b/.jshintrc index d6a7bd3b3..f81a2de43 100644 --- a/.jshintrc +++ b/.jshintrc @@ -3,7 +3,7 @@ "node": true, "white": true, "bitwise": false, - "curly": true, + "curly": false, "eqnull": true, "eqeqeq": true, "forin": true, diff --git a/grunt/tasks.js b/grunt/tasks.js index c231dd461..10ae320a8 100644 --- a/grunt/tasks.js +++ b/grunt/tasks.js @@ -1,5 +1,9 @@ module.exports = function (grunt) { + var Promise = require('bluebird'); var utils = require('./utils'); + var readFile = Promise.promisify(require('fs').readFile); + var writeFile = Promise.promisify(require('fs').writeFile); + // Default task runs the build process. grunt.registerTask('default', [ @@ -37,4 +41,37 @@ module.exports = function (grunt) { 'mochacov:make_coverage_html', 'open:coverage' ]); + + grunt.registerTask('version', function (type) { + var root = require('path').join.bind(null, __dirname, '..'); + var readmePath = root('README.md'); + var packagePath = root('package.json'); + var browserBuildsPath = root('docs/browser_builds.asciidoc'); + + Promise.all([ + require(packagePath), + readFile(readmePath, 'utf8'), + readFile(browserBuildsPath, 'utf8') + ]) + .spread(function (pkg, readme, browserBuilds) { + var current = pkg.version; + var next = utils.increaseVersion(current, type); + + pkg.version = next; + browserBuilds = utils.replaceAll(browserBuilds, current, next); + readme = utils.replaceAll(readme, current, next); + readme = utils.replaceAll( + readme, + 'branch=' + utils.minorVersion(current), + 'branch=' + utils.minorVersion(next) + ); + + // write all files to disk + return Promise.all([ + writeFile(readmePath, readme), + writeFile(browserBuildsPath, browserBuilds), + writeFile(packagePath, JSON.stringify(pkg, null, ' ')) + ]); + }).nodeify(this.async()); + }); }; \ No newline at end of file diff --git a/grunt/utils.js b/grunt/utils.js index b58133f23..c71b88857 100644 --- a/grunt/utils.js +++ b/grunt/utils.js @@ -16,4 +16,61 @@ var utils = { utils.branches._default = pkg.config.default_api_branch; +/* + * trim down a version id to the minor version number ('1.5.1' => '1.5') + */ +utils.minorVersion = function (version) { + return version.split('.').slice(0, 2).join('.'); +}; + +/* + * increment the version based on the release "type" + */ +utils.increaseVersion = function (version, type) { + var i; + switch (type) { + case 'major': + i = 0; + break; + case 'minor': + i = 1; + break; + case 'bug': + case 'patch': + case 'bugfix': + i = 2; + break; + default: + throw new TypeError('unexpected version bump type'); + } + + // breakout the current version + var next = version.split('.').map(function (n) { + return parseInt(n, 10); + }); + + // increment the version type + next[i] += 1; + // clear out all following numbers + for (i ++; i < next.length; i++) next[i] = 0; + // join back together with '.' + return next.join('.'); +}; + +/* + * replace all instances of `replace` with `replacement` without creating a regexp object + */ +utils.replaceAll = function (str, replace, replacement) { + var out = ''; + var remaining = str; + var i = 0; + + while (~(i = remaining.indexOf(replace))) { + out += remaining.substring(0, i) + replacement; + remaining = remaining.substr(i + replace.length); + } + + return out + remaining; +}; + module.exports = utils; \ No newline at end of file From 5280918ad6c190f87684ecf7d97de15d27f5bd29 Mon Sep 17 00:00:00 2001 From: Spencer Alger Date: Wed, 23 Jul 2014 08:29:53 -0700 Subject: [PATCH 4/8] version 2.3.1 --- README.md | 4 ++-- docs/browser_builds.asciidoc | 2 +- package.json | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 641a8032a..eebf303a3 100644 --- a/README.md +++ b/README.md @@ -34,10 +34,10 @@ Check out the [Browser Builds](http://www.elasticsearch.org/guide/en/elasticsear download: -zip +zip -tar.gz +tar.gz diff --git a/docs/browser_builds.asciidoc b/docs/browser_builds.asciidoc index ace210f13..0645908f6 100644 --- a/docs/browser_builds.asciidoc +++ b/docs/browser_builds.asciidoc @@ -14,7 +14,7 @@ bower install elasticsearch --------- === Download - * v2.3.0: https://download.elasticsearch.org/elasticsearch/elasticsearch-js/elasticsearch-js-2.3.0.zip[zip], https://download.elasticsearch.org/elasticsearch/elasticsearch-js/elasticsearch-js-2.3.0.tar.gz[tar.gz] + * v2.3.1: https://download.elasticsearch.org/elasticsearch/elasticsearch-js/elasticsearch-js-2.3.1.zip[zip], https://download.elasticsearch.org/elasticsearch/elasticsearch-js/elasticsearch-js-2.3.1.tar.gz[tar.gz] === Angular Build diff --git a/package.json b/package.json index f300fb9db..d7fd032d6 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "description": "The official low-level Elasticsearch client for Node.js and the browser.", "main": "src/elasticsearch.js", "homepage": "http://www.elasticsearch.org/guide/en/elasticsearch/client/javascript-api/current/index.html", - "version": "2.3.0", + "version": "2.3.1", "browser": { "./src/lib/connectors/index.js": "./src/lib/connectors/browser_index.js", "./src/lib/loggers/index.js": "./src/lib/loggers/browser_index.js", @@ -86,4 +86,4 @@ "engines": { "node": ">=0.8 <0.11" } -} +} \ No newline at end of file From 9e990d8814b6426c67cbe079b9e4d7f65408783c Mon Sep 17 00:00:00 2001 From: Spencer Date: Wed, 23 Jul 2014 09:06:06 -0700 Subject: [PATCH 5/8] Update CHANGELOG.md --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10016992e..a6343ebad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Added support for Node 0.11 - Updated `bluebird`, which modified the [promise api](https://github.com/petkaantonov/bluebird/blob/v2.2.1/API.md) somewhat - moved the log generator into it's own package [makelogs](https://www.npmjs.org/package/makelogs) + - [Lower the logging level of `Request complete`](https://github.com/elasticsearch/elasticsearch-js/pull/122) ## 2.2 (Mar 27 2014) - The default API version is now `'1.2'` @@ -49,4 +50,4 @@ ## pre 1.0 - Another module, now know as es on npm, used the elasticsearch module name. This module had several pre-1.0 - releases so we started at 1.0 to prevent collisions in exiting projects. The history for that project is available [here](https://github.com/ncb000gt/node-es) \ No newline at end of file + releases so we started at 1.0 to prevent collisions in exiting projects. The history for that project is available [here](https://github.com/ncb000gt/node-es) From 4eb5ab67d76596be4846cc507c2d92db6ee66792 Mon Sep 17 00:00:00 2001 From: Spencer Alger Date: Wed, 30 Jul 2014 11:51:00 -0700 Subject: [PATCH 6/8] run tests against 1.3 on travis --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b8d23e32d..f35fb1707 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,8 @@ language: node_js node_js: "0.10" secure: "UFAGQ6m/VnEahbj9vttY9YoA5h5rEBE6K7AvEEbWnt+VKppV+w3hu3HZxgKr8C9PWhCzqlGvsLh+kCqykZhISU1fBCK/Ttp3nSpMvvF5tI2u51Rj1qZ/7NUGRU0qVI9KFt0rJeXMJwq3fivb1H6aojfPD1gsIte7NHNjUfd0iUg=" env: - - ES_BRANCH=1.2 ES_RELEASE=1.2.2 COVERAGE=1 + - ES_BRANCH=1.3 ES_RELEASE=1.3.1 COVERAGE=1 + - ES_BRANCH=1.2 ES_RELEASE=1.2.3 NODE_UNIT=0 - ES_BRANCH=1.1 ES_RELEASE=1.1.2 NODE_UNIT=0 - ES_BRANCH=1.0 ES_RELEASE=1.0.3 NODE_UNIT=0 - ES_BRANCH=0.90 ES_RELEASE=0.90.13 NODE_UNIT=0 From fadb52e6bfc3f9999638160e6b9612b9fccc34ed Mon Sep 17 00:00:00 2001 From: Spencer Alger Date: Wed, 30 Jul 2014 14:28:40 -0700 Subject: [PATCH 7/8] version 2.4.0 --- CHANGELOG.md | 2 +- README.md | 8 ++++---- docs/browser_builds.asciidoc | 2 +- package.json | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6543b8f8d..fb216cc7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # elasticsearch-js changelog -## 2.4 (Jul ?? 2014) +## 2.4 (Jul 30 2014) - Added apiVersion `"1.3"`, which is now the default ## 2.3 (Jul 11 2014) diff --git a/README.md b/README.md index 9dfd38901..c609f97f1 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ The official low-level Elasticsearch client for Node.js and the browser. -[![Build Status](https://travis-ci.org/elasticsearch/elasticsearch-js.svg?branch=2.3)](https://travis-ci.org/elasticsearch/elasticsearch-js?branch=2.3) -[![Coverage Status](http://img.shields.io/coveralls/elasticsearch/elasticsearch-js.svg?branch=2.3)](https://coveralls.io/r/elasticsearch/elasticsearch-js?branch=2.3) +[![Build Status](https://travis-ci.org/elasticsearch/elasticsearch-js.svg?branch=2.4)](https://travis-ci.org/elasticsearch/elasticsearch-js?branch=2.4) +[![Coverage Status](http://img.shields.io/coveralls/elasticsearch/elasticsearch-js.svg?branch=2.4)](https://coveralls.io/r/elasticsearch/elasticsearch-js?branch=2.4) [![Dependencies up to date](https://david-dm.org/elasticsearch/elasticsearch-js.svg)](https://david-dm.org/elasticsearch/elasticsearch-js) ## Features @@ -34,10 +34,10 @@ Check out the [Browser Builds](http://www.elasticsearch.org/guide/en/elasticsear download: -zip +zip -tar.gz +tar.gz diff --git a/docs/browser_builds.asciidoc b/docs/browser_builds.asciidoc index 0645908f6..47cc5f786 100644 --- a/docs/browser_builds.asciidoc +++ b/docs/browser_builds.asciidoc @@ -14,7 +14,7 @@ bower install elasticsearch --------- === Download - * v2.3.1: https://download.elasticsearch.org/elasticsearch/elasticsearch-js/elasticsearch-js-2.3.1.zip[zip], https://download.elasticsearch.org/elasticsearch/elasticsearch-js/elasticsearch-js-2.3.1.tar.gz[tar.gz] + * v2.4.0: https://download.elasticsearch.org/elasticsearch/elasticsearch-js/elasticsearch-js-2.4.0.zip[zip], https://download.elasticsearch.org/elasticsearch/elasticsearch-js/elasticsearch-js-2.4.0.tar.gz[tar.gz] === Angular Build diff --git a/package.json b/package.json index 758deff7f..855bb8b51 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "description": "The official low-level Elasticsearch client for Node.js and the browser.", "main": "src/elasticsearch.js", "homepage": "http://www.elasticsearch.org/guide/en/elasticsearch/client/javascript-api/current/index.html", - "version": "2.3.1", + "version": "2.4.0", "browser": { "./src/lib/connectors/index.js": "./src/lib/connectors/browser_index.js", "./src/lib/loggers/index.js": "./src/lib/loggers/browser_index.js", @@ -87,4 +87,4 @@ "engines": { "node": ">=0.8 <0.11" } -} +} \ No newline at end of file From 95bc903315c3c23b288005e6cbc47fbe60c955d9 Mon Sep 17 00:00:00 2001 From: DanielRenfro Date: Fri, 22 Aug 2014 14:10:18 -0400 Subject: [PATCH 8/8] Issue133 - jQuery.ajax HTTP method set as "type:", not "method:". --- src/lib/connectors/jquery.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/connectors/jquery.js b/src/lib/connectors/jquery.js index 6062ee27b..892bc07fe 100644 --- a/src/lib/connectors/jquery.js +++ b/src/lib/connectors/jquery.js @@ -20,7 +20,7 @@ JqueryConnector.prototype.request = function (params, cb) { var ajax = { url: this.host.makeUrl(params), data: params.body, - method: params.method, + type: params.method, dataType: 'text', headers: this.host.getHeaders(params.headers), done: cb