Slight refactor to the api module, so it will simply extend the client like it did previously, and

also exposes itself on the module.exports so that is can be referenced externally.

Added "grunt run" task which currently has a single config, generate_js_api.

Removed the api spec submodule, generator just downloads master when it runs.
This commit is contained in:
Spencer Alger
2013-10-23 16:07:03 -07:00
parent c14d37aa42
commit 20462c73fd
10 changed files with 87 additions and 22022 deletions

View File

@ -1082,8 +1082,8 @@ api.get = ca({
* Perform a [](http://elasticsearch.org/guide/reference/api/get/) request
*
* @param {Object} params - An object with parameters used to carry out this action
* @param {String|ArrayOfStrings|Boolean} params._source_exclude
* @param {String|ArrayOfStrings|Boolean} params._source_include
* @param {String|ArrayOfStrings|Boolean} params.exclude
* @param {String|ArrayOfStrings|Boolean} params.include
* @param {String} params.parent
* @param {String} params.preference
* @param {Boolean} params.realtime
@ -1095,10 +1095,10 @@ api.getSource = ca({
'GET'
],
params: {
_source_exclude: {
exclude: {
type: 'list'
},
_source_include: {
include: {
type: 'list'
},
parent: {

View File

@ -106,7 +106,7 @@ HttpConnection.prototype.request = function (params, cb) {
cleanUp(err);
});
// timeout for the entire request, req.setTimeout only set the socket level timeout
// timeout for the entire request.
timeoutId = setTimeout(function () {
request.emit('error', new errors.RequestTimeout('Request timed out at ' + timeout + 'ms'));
}, timeout);