Merge pull request #428 from elastic/proxy-get-client

Pass the Client instance to ClientAction namespaceFactory
This commit is contained in:
Spencer
2016-07-20 19:34:58 -04:00
committed by GitHub
2 changed files with 3 additions and 2 deletions

View File

@ -58,7 +58,7 @@ function Client(config) {
_.each(EsApiClient.prototype, _.bind(function (Fn, prop) {
if (Fn.prototype instanceof clientAction.ApiNamespace) {
this[prop] = new Fn(this.transport);
this[prop] = new Fn(this.transport, this);
}
}, this));

View File

@ -24,8 +24,9 @@ exports._resolveUrl = resolveUrl;
exports.ApiNamespace = function () {};
exports.namespaceFactory = function () {
function ClientNamespace(transport) {
function ClientNamespace(transport, client) {
this.transport = transport;
this.client = client;
}
ClientNamespace.prototype = new exports.ApiNamespace();