diff --git a/dist/lib/apiGatewayCore/apiGatewayClient.js b/dist/lib/apiGatewayCore/apiGatewayClient.js index e0d61a0..5a6e223 100755 --- a/dist/lib/apiGatewayCore/apiGatewayClient.js +++ b/dist/lib/apiGatewayCore/apiGatewayClient.js @@ -56,6 +56,7 @@ apiGatewayClientFactory.newClient = function (simpleHttpClientConfig, sigV4Clien // merge them into the appropriate request properties request.headers = _utils2.default.mergeInto(request.headers, additionalParams.headers); request.queryParams = _utils2.default.mergeInto(request.queryParams, additionalParams.queryParams); + request.timeout = _utils2.default.mergeInto(request.timeout, additionalParams.timeout); // If an auth type was specified inject the appropriate auth client if (authType === 'AWS_IAM') { diff --git a/dist/lib/apiGatewayCore/sigV4Client.js b/dist/lib/apiGatewayCore/sigV4Client.js index acbabd8..d221e78 100755 --- a/dist/lib/apiGatewayCore/sigV4Client.js +++ b/dist/lib/apiGatewayCore/sigV4Client.js @@ -175,9 +175,15 @@ sigV4ClientFactory.newClient = function (config) { var verb = _utils2.default.assertDefined(request.verb, 'verb'); var path = _utils2.default.assertDefined(request.path, 'path'); var queryParams = _utils2.default.copy(request.queryParams); + var timeout = _utils2.default.copy(request.timeout); + if (queryParams === undefined) { queryParams = {}; } + + if (timeout === undefined) { + timeout = 0; + } var headers = _utils2.default.copy(request.headers); if (headers === undefined) { headers = {}; @@ -240,6 +246,7 @@ sigV4ClientFactory.newClient = function (config) { var signedRequest = { headers: headers, + timeout: timeout, data: body }; if (config.retries !== undefined) { diff --git a/dist/lib/apiGatewayCore/simpleHttpClient.js b/dist/lib/apiGatewayCore/simpleHttpClient.js index a99974c..2dc2e2c 100755 --- a/dist/lib/apiGatewayCore/simpleHttpClient.js +++ b/dist/lib/apiGatewayCore/simpleHttpClient.js @@ -59,9 +59,13 @@ simpleHttpClientFactory.newClient = function (config) { var verb = _utils2.default.assertDefined(request.verb, 'verb'); var path = _utils2.default.assertDefined(request.path, 'path'); var queryParams = _utils2.default.copy(request.queryParams); + var timeout = _utils2.default.copy(request.timeout); if (queryParams === undefined) { queryParams = {}; } + if (timeout === undefined) { + timeout = 0; + } var headers = _extends({}, _utils2.default.copy(request.headers), config.headers); // If the user has not specified an override for Content type the use default @@ -84,6 +88,7 @@ simpleHttpClientFactory.newClient = function (config) { var simpleHttpRequest = { headers: headers, + timeout: timeout, data: body }; if (config.retries !== undefined) { diff --git a/src/apigClient.js b/src/apigClient.js index f16275b..959d77e 100755 --- a/src/apigClient.js +++ b/src/apigClient.js @@ -97,6 +97,7 @@ apigClientFactory.newClient = (config = {}) => { verb: method.toUpperCase(), path: pathComponent + uritemplate.parse(pathTemplate).expand(params), headers: additionalParams.headers || {}, + timeout: additionalParams.timeout || 0, queryParams: additionalParams.queryParams, body: body }; diff --git a/src/lib/apiGatewayCore/apiGatewayClient.js b/src/lib/apiGatewayCore/apiGatewayClient.js index 7ae60b2..4bd0741 100755 --- a/src/lib/apiGatewayCore/apiGatewayClient.js +++ b/src/lib/apiGatewayCore/apiGatewayClient.js @@ -45,6 +45,7 @@ apiGatewayClientFactory.newClient = function(simpleHttpClientConfig, sigV4Client // merge them into the appropriate request properties request.headers = utils.mergeInto(request.headers, additionalParams.headers); request.queryParams = utils.mergeInto(request.queryParams, additionalParams.queryParams); + request.timeout = utils.mergeInto(request.timeout, additionalParams.timeout); // If an auth type was specified inject the appropriate auth client if (authType === 'AWS_IAM') { diff --git a/src/lib/apiGatewayCore/sigV4Client.js b/src/lib/apiGatewayCore/sigV4Client.js index a772802..eb6eb79 100755 --- a/src/lib/apiGatewayCore/sigV4Client.js +++ b/src/lib/apiGatewayCore/sigV4Client.js @@ -161,9 +161,15 @@ sigV4ClientFactory.newClient = function(config) { let verb = utils.assertDefined(request.verb, 'verb'); let path = utils.assertDefined(request.path, 'path'); let queryParams = utils.copy(request.queryParams); + let timeout = utils.copy(request.timeout); + if (queryParams === undefined) { queryParams = {}; } + + if (timeout === undefined) { + timeout = 0; + } let headers = utils.copy(request.headers); if (headers === undefined) { headers = {}; @@ -241,6 +247,7 @@ sigV4ClientFactory.newClient = function(config) { let signedRequest = { headers: headers, + timeout: timeout, data: body }; if (config.retries !== undefined) { diff --git a/src/lib/apiGatewayCore/simpleHttpClient.js b/src/lib/apiGatewayCore/simpleHttpClient.js index 7f41f2b..3e04912 100755 --- a/src/lib/apiGatewayCore/simpleHttpClient.js +++ b/src/lib/apiGatewayCore/simpleHttpClient.js @@ -44,9 +44,13 @@ simpleHttpClientFactory.newClient = (config) => { let verb = utils.assertDefined(request.verb, 'verb'); let path = utils.assertDefined(request.path, 'path'); let queryParams = utils.copy(request.queryParams); + let timeout = utils.copy(request.timeout); if (queryParams === undefined) { queryParams = {}; } + if (timeout === undefined) { + timeout = 0; + } let headers = {...utils.copy(request.headers), ...config.headers}; // If the user has not specified an override for Content type the use default @@ -69,6 +73,7 @@ simpleHttpClientFactory.newClient = (config) => { let simpleHttpRequest = { headers: headers, + timeout: timeout, data: body }; if (config.retries !== undefined) {