aws-sdk-wrap
Advanced tools
Comparing version 1.1.11 to 2.0.0
@@ -0,1 +1,3 @@ | ||
const assert = require('assert'); | ||
const get = require('lodash.get'); | ||
@@ -37,23 +39,32 @@ | ||
return { | ||
call: (service, funcName, params, { | ||
call: (action, params, { | ||
expectedErrorCodes = [] | ||
} = {}) => getService(service)[funcName](params).promise().catch(e => { | ||
if (expectedErrorCodes.indexOf(e.code) !== -1) { | ||
return e.code; | ||
} | ||
} = {}) => { | ||
assert(typeof action === 'string'); | ||
assert(params instanceof Object && !Array.isArray(params)); | ||
assert(Array.isArray(expectedErrorCodes) && expectedErrorCodes.every(e => typeof e === 'string')); | ||
const splitIndex = action.indexOf(':'); | ||
assert(splitIndex !== -1, 'Bad Action Provided.'); | ||
const service = action.slice(0, splitIndex); | ||
const funcName = action.slice(splitIndex + 1); | ||
return getService(service)[funcName](params).promise().catch(e => { | ||
if (expectedErrorCodes.indexOf(e.code) !== -1) { | ||
return e.code; | ||
} | ||
if (logger !== null) { | ||
logger.error({ | ||
message: `Request failed for ${service}.${funcName}()`, | ||
errorName: get(e, 'constructor.name'), | ||
errorDetails: e, | ||
requestParams: params | ||
}); | ||
} | ||
if (logger !== null) { | ||
logger.error({ | ||
message: `Request failed for ${service}.${funcName}()`, | ||
errorName: get(e, 'constructor.name'), | ||
errorDetails: e, | ||
requestParams: params | ||
}); | ||
} | ||
throw e; | ||
}), | ||
throw e; | ||
}); | ||
}, | ||
get: getService | ||
}; | ||
}; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJnZXQiLCJyZXF1aXJlIiwiQVdTIiwibG9va3VwQ2FjaGUiLCJNYXAiLCJnZXRBdHRyIiwib2JqIiwia2V5IiwiaGFzIiwic2V0IiwiT2JqZWN0IiwiZW50cmllcyIsInJlZHVjZSIsInByZXYiLCJrIiwidiIsImFzc2lnbiIsInRvTG93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ShwYXJhbXMpLnByb21pc2UoKS5jYXRjaCgoZSkgPT4ge1xuICAgICAgICBpZiAoZXhwZWN0ZWRFcnJvckNvZGVzLmluZGV4T2YoZS5jb2RlKSAhPT0gLTEpIHtcbiAgICAgICAgICByZXR1cm4gZS5jb2RlO1xuICAgICAgICB9XG4gICAgICAgIGlmIChsb2dnZXIgIT09IG51bGwpIHtcbiAgICAgICAgICBsb2dnZXIuZXJyb3Ioe1xuICAgICAgICAgICAgbWVzc2FnZTogYFJlcXVlc3QgZmFpbGVkIGZvciAke3NlcnZpY2V9LiR7ZnVuY05hbWV9KClgLFxuICAgICAgICAgICAgZXJyb3JOYW1lOiBnZXQoZSwgJ2NvbnN0cnVjdG9yLm5hbWUnKSxcbiAgICAgICAgICAgIGVycm9yRGV0YWlsczogZSxcbiAgICAgICAgICAgIHJlcXVlc3RQYXJhbXM6IHBhcmFtc1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHRocm93IGU7XG4gICAgICB9KTtcbiAgICB9LFxuICAgIGdldDogZ2V0U2VydmljZVxuICB9O1xufTtcbiJdfQ== |
{ | ||
"name": "aws-sdk-wrap", | ||
"version": "1.1.11", | ||
"version": "2.0.0", | ||
"description": "Wrapper around aws-sdk", | ||
@@ -34,5 +34,5 @@ "main": "lib/index.js", | ||
"@babel/register": "7.4.4", | ||
"@blackflux/eslint-plugin-rules": "1.0.11", | ||
"@blackflux/robo-config-plugin": "1.8.1", | ||
"aws-sdk": "2.444.0", | ||
"@blackflux/eslint-plugin-rules": "1.0.14", | ||
"@blackflux/robo-config-plugin": "1.9.2", | ||
"aws-sdk": "2.456.0", | ||
"babel-eslint": "10.0.1", | ||
@@ -42,6 +42,6 @@ "chai": "4.2.0", | ||
"eslint": "5.16.0", | ||
"js-gardener": "2.0.22", | ||
"js-gardener": "2.0.30", | ||
"nock": "10.0.6", | ||
"nyc": "14.0.0", | ||
"semantic-release": "15.13.3" | ||
"nyc": "14.1.1", | ||
"semantic-release": "15.13.12" | ||
}, | ||
@@ -48,0 +48,0 @@ "peerDependencies": { |
@@ -38,3 +38,3 @@ # AWS SDK Wrap | ||
aws | ||
.call('s3', 'putObject', { /* ... */ }) | ||
.call('s3:putObject', { /* ... */ }) | ||
.then(/* ... */) | ||
@@ -41,0 +41,0 @@ .catch(/* ... */); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14440
56