@anvilco/anvil
Advanced tools
Comparing version 2.6.0 to 2.6.1
@@ -10,2 +10,17 @@ # Changelog | ||
## [v2.6.1](https://github.com/anvilco/node-anvil/compare/v2.6.0...v2.6.1) | ||
### Merged | ||
- fix a bug that can happen when parsing errors in node client [`#38`](https://github.com/anvilco/node-anvil/pull/38) | ||
- Update createEtchPacket example to use IRS W-4 / NDA [`#36`](https://github.com/anvilco/node-anvil/pull/36) | ||
- Bump ini from 1.3.5 to 1.3.8 [`#34`](https://github.com/anvilco/node-anvil/pull/34) | ||
- v2.6.0 [`#33`](https://github.com/anvilco/node-anvil/pull/33) | ||
### Commits | ||
- Update the create-etch-packet example to use the same docs as demo [`43bc77d`](https://github.com/anvilco/node-anvil/commit/43bc77d766e59a9c9d713958dfa460a51b246190) | ||
- Remove ids [`1ed959c`](https://github.com/anvilco/node-anvil/commit/1ed959cdb2f9aab78d21704b20699b3313b0c8ed) | ||
- remove unsed var [`0d046bd`](https://github.com/anvilco/node-anvil/commit/0d046bd0e9ae0251dafec9f506ecf2453c7f8f60) | ||
## [v2.6.0](https://github.com/anvilco/node-anvil/compare/v2.5.0...v2.6.0) | ||
@@ -12,0 +27,0 @@ |
{ | ||
"name": "@anvilco/anvil", | ||
"version": "2.6.0", | ||
"version": "2.6.1", | ||
"description": "Anvil API Client", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -117,2 +117,3 @@ // https://www.npmjs.com/package/node-fetch#fetch-options | ||
const filePath = '/Users/newhouse/projects/anvil/node-anvil/scratch/dummy.pdf' | ||
// const filePath = '/Users/newhouse/projects/anvil/node-anvil/scratch/anvil-finovate-non-qualified.pdf' | ||
const userUploadPath = '/Users/newhouse/projects/anvil/node-anvil/scratch/excellent.png' | ||
@@ -119,0 +120,0 @@ |
const defaultResponseQuery = `{ | ||
id | ||
eid | ||
@@ -8,3 +7,2 @@ name | ||
documentGroup { | ||
id | ||
eid | ||
@@ -14,3 +12,2 @@ status | ||
signers { | ||
id | ||
eid | ||
@@ -17,0 +14,0 @@ aliasId |
@@ -313,4 +313,5 @@ const fs = require('fs') | ||
return this._throttle(async (retry) => { | ||
const { dataType, debug } = clientOptions | ||
const response = await retryableRequestFn() | ||
const statusCode = response.status | ||
const { status: statusCode, statusText } = response | ||
@@ -322,9 +323,17 @@ if (statusCode >= 300) { | ||
const json = await response.json() | ||
const errors = json.errors || (json.message && [json]) | ||
try { | ||
const json = await response.json() | ||
const errors = json.errors || (json.message && [json]) | ||
return errors ? { statusCode, errors } : { statusCode, ...json } | ||
} catch (err) { | ||
if (debug) { | ||
console.warn(`Problem parsing JSON response for status ${statusCode}:`) | ||
console.warn(err) | ||
console.warn('Using statusText instead') | ||
} | ||
} | ||
return errors ? { statusCode, errors } : { statusCode, ...json } | ||
return { statusCode, statusText, errors: [statusText] } | ||
} | ||
const { dataType } = clientOptions | ||
let data | ||
@@ -331,0 +340,0 @@ |
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
522541
24
1055
9