[JavaScript] Added plugins variable for the javascript/ES6 client (#1797)

* Added plugins variable for the javascript/ES6 client

* Ran the javascript and javascript-es6 shell script
This commit is contained in:
sredbull
2019-01-07 05:18:03 +01:00
committed by William Cheng
parent f0f214743e
commit 1189362466
4 changed files with 52 additions and 0 deletions

View File

@@ -95,6 +95,11 @@
* Allow user to override superagent agent
*/
this.requestAgent = null;
/*
* Allow user to add superagent plugins
*/
this.plugins = null;
};
{{#emitJSDoc}} /**
@@ -381,6 +386,14 @@
var url = this.buildUrl(path, pathParams);
var request = superagent(httpMethod, url);
if (this.plugins !== null) {
for (var index in this.plugins) {
if (this.plugins.hasOwnProperty(index)) {
request.use(this.plugins[index])
}
}
}
// apply authentications
this.applyAuthToRequest(request, authNames);

View File

@@ -84,6 +84,11 @@ class ApiClient {
*/
this.requestAgent = null;
/*
* Allow user to add superagent plugins
*/
this.plugins = null;
}
{{#emitJSDoc}}/**
@@ -352,6 +357,14 @@ class ApiClient {
var url = this.buildUrl(path, pathParams);
var request = superagent(httpMethod, url);
if (this.plugins !== null) {
for (var index in this.plugins) {
if (this.plugins.hasOwnProperty(index)) {
request.use(this.plugins[index])
}
}
}
// apply authentications
this.applyAuthToRequest(request, authNames);

View File

@@ -89,6 +89,11 @@ class ApiClient {
*/
this.requestAgent = null;
/*
* Allow user to add superagent plugins
*/
this.plugins = null;
}
/**
@@ -354,6 +359,14 @@ class ApiClient {
var url = this.buildUrl(path, pathParams);
var request = superagent(httpMethod, url);
if (this.plugins !== null) {
for (var index in this.plugins) {
if (this.plugins.hasOwnProperty(index)) {
request.use(this.plugins[index])
}
}
}
// apply authentications
this.applyAuthToRequest(request, authNames);

View File

@@ -101,6 +101,11 @@
* Allow user to override superagent agent
*/
this.requestAgent = null;
/*
* Allow user to add superagent plugins
*/
this.plugins = null;
};
/**
@@ -387,6 +392,14 @@
var url = this.buildUrl(path, pathParams);
var request = superagent(httpMethod, url);
if (this.plugins !== null) {
for (var index in this.plugins) {
if (this.plugins.hasOwnProperty(index)) {
request.use(this.plugins[index])
}
}
}
// apply authentications
this.applyAuthToRequest(request, authNames);