Skip to content

Commit

Permalink
Merge c38c4eb into 0b71ed8
Browse files Browse the repository at this point in the history
  • Loading branch information
circa10a committed Oct 10, 2019
2 parents 0b71ed8 + c38c4eb commit 82809ce
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 16 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# 3.1.0(2019-10-09)

## Added

- Added `maxContentLength` parameter default of `Infinity`. See [axios docs](https://github.com/axios/axios#request-config)
- Added `extraOpts` parameter that can be used to pass more config options for axios so a library update frequency is lower

## Fixed

- [#27](https://github.com/circa10a/easy-soap-request/issues/27)

# 3.0.1(2019-10-02)

## Changed

- Fix typo in docs

# 3.0.0(2019-10-01)

## Changed
Expand Down
10 changes: 9 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const axios = require('axios-https-proxy-fix');
* @param {string} opts.xml SOAP envelope, can be read from file or passed as string
* @param {int} opts.timeout Milliseconds before timing out request
* @param {object} opts.proxy Object with proxy configuration
* @param {int} opts.maxContentLength Limit content/body size being sent(bytes)
* @param {object} opts.extraOpts Object of additional axios parameters
* @promise response
* @reject {error}
* @fulfill {body,statusCode}
Expand All @@ -18,14 +20,18 @@ module.exports = function soapRequest(opts = {
headers: {},
xml: '',
timeout: 10000,
proxy: false,
proxy: {},
maxContentLength: Infinity,
extraOpts: {},
}) {
const {
url,
headers,
xml,
timeout,
proxy,
maxContentLength,
extraOpts,
} = opts;
return new Promise((resolve, reject) => {
axios({
Expand All @@ -35,6 +41,8 @@ module.exports = function soapRequest(opts = {
data: xml,
timeout,
proxy,
maxContentLength,
...extraOpts,
}).then((response) => {
resolve({
response: {
Expand Down
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "easy-soap-request",
"version": "3.0.1",
"version": "3.1.0",
"description": "A small library to make SOAP requests easier",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 82809ce

Please sign in to comment.