@anvilco/anvil
Advanced tools
Comparing version 2.13.1 to 2.14.0
@@ -10,2 +10,20 @@ # Changelog | ||
## [v2.14.0](https://github.com/anvilco/node-anvil/compare/v2.13.1...v2.14.0) | ||
### Merged | ||
- roll back node-fetch to not warn about form-data [`#238`](https://github.com/anvilco/node-anvil/pull/238) | ||
- [1-min] update extract files [`#236`](https://github.com/anvilco/node-anvil/pull/236) | ||
- Bump node-fetch from 2.6.7 to 3.3.0 [`#212`](https://github.com/anvilco/node-anvil/pull/212) | ||
- Bump eslint-plugin-promise from 6.0.0 to 6.1.1 [`#204`](https://github.com/anvilco/node-anvil/pull/204) | ||
- Bump @types/node from 17.0.35 to 18.11.18 [`#226`](https://github.com/anvilco/node-anvil/pull/226) | ||
- Bump @babel/eslint-parser from 7.18.2 to 7.19.1 [`#188`](https://github.com/anvilco/node-anvil/pull/188) | ||
- Bump eslint-plugin-react from 7.30.0 to 7.32.1 [`#235`](https://github.com/anvilco/node-anvil/pull/235) | ||
- Bump typescript from 4.7.2 to 4.9.4 [`#222`](https://github.com/anvilco/node-anvil/pull/222) | ||
- Bump json5 from 1.0.1 to 1.0.2 [`#228`](https://github.com/anvilco/node-anvil/pull/228) | ||
- Bump eslint-plugin-n from 15.2.0 to 15.6.1 [`#232`](https://github.com/anvilco/node-anvil/pull/232) | ||
- Bump eslint from 8.16.0 to 8.32.0 [`#230`](https://github.com/anvilco/node-anvil/pull/230) | ||
- Bump @babel/core from 7.18.2 to 7.20.12 [`#229`](https://github.com/anvilco/node-anvil/pull/229) | ||
- Update queries and mutations [`#234`](https://github.com/anvilco/node-anvil/pull/234) | ||
## [v2.13.1](https://github.com/anvilco/node-anvil/compare/v2.13.0...v2.13.1) | ||
@@ -12,0 +30,0 @@ |
{ | ||
"name": "@anvilco/anvil", | ||
"version": "2.13.1", | ||
"version": "2.14.0", | ||
"description": "Anvil API Client", | ||
"main": "src/index.js", | ||
"types": "./types/src/index.d.ts", | ||
"scripts": { | ||
"test": "mocha --config ./test/mocha.js", | ||
"lint": "eslint src/**/*.js test/**/*.js", | ||
"test:debug": "yarn test --inspect-brk=0.0.0.0:9223", | ||
"test:watch": "nodemon --signal SIGINT --watch test --watch src -x 'yarn test'", | ||
"version": "auto-changelog -p --template keepachangelog && read -p \"\nAutomated changes made to CHANGELOG.md. Please make any necessary adjustments, then hit any key to continue.\n\" && git add CHANGELOG.md" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/anvilco/node-anvil.git" | ||
}, | ||
"author": "Anvil Foundry Inc.", | ||
"homepage": "https://github.com/anvilco/node-anvil#readme", | ||
"license": "MIT", | ||
"keywords": [ | ||
@@ -23,8 +13,14 @@ "pdf", | ||
], | ||
"author": "Anvil Foundry Inc.", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/anvilco/node-anvil/issues" | ||
}, | ||
"homepage": "https://github.com/anvilco/node-anvil#readme", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/anvilco/node-anvil.git" | ||
}, | ||
"types": "./types/src/index.d.ts", | ||
"main": "src/index.js", | ||
"engines": { | ||
"node": ">=12" | ||
}, | ||
"publishConfig": { | ||
@@ -34,6 +30,34 @@ "registry": "https://registry.npmjs.org", | ||
}, | ||
"files": [ | ||
"package.json", | ||
"README.md", | ||
"LICENSE.md", | ||
"CHANGELOG.md", | ||
"src/", | ||
"types/", | ||
"example/", | ||
"!**/.DS_STORE", | ||
"!**/.DS_Store" | ||
], | ||
"scripts": { | ||
"test": "mocha --config ./test/mocha.js", | ||
"lint": "eslint src/**/*.js test/**/*.js", | ||
"lint:quiet": "yarn run lint --quiet", | ||
"test:debug": "yarn test --inspect-brk=0.0.0.0:9223", | ||
"test:watch": "nodemon --signal SIGINT --watch test --watch src -x 'yarn test'", | ||
"test-e2e:build": "rimraf test/e2e/node-anvil.tgz && node dev/build-e2e.mjs", | ||
"test-e2e:install": "npm --prefix test/e2e run prep && npm --prefix test/e2e install", | ||
"version": "auto-changelog -p --template keepachangelog && read -p \"\nAutomated changes made to CHANGELOG.md. Please make any necessary adjustments, then hit any key to continue.\n\" && git add CHANGELOG.md" | ||
}, | ||
"dependencies": { | ||
"abort-controller": "^3.0.0", | ||
"extract-files": "^11", | ||
"form-data": "^4.0.0", | ||
"limiter": "^2.1.0", | ||
"node-fetch": "3.0.x" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.18.2", | ||
"@babel/eslint-parser": "^7.18.2", | ||
"@types/node": "^17.0.23", | ||
"@types/node": "^18.11.18", | ||
"auto-changelog": "^2.4.0", | ||
@@ -55,2 +79,3 @@ "bdd-lazy-var": "^2.5.4", | ||
"nodemon": "^2.0.15", | ||
"rimraf": "^4.1.1", | ||
"sinon": "^14.0.0", | ||
@@ -60,10 +85,3 @@ "sinon-chai": "^3.5.0", | ||
"yargs": "^17.4.0" | ||
}, | ||
"dependencies": { | ||
"abort-controller": "^3.0.0", | ||
"extract-files": "^6", | ||
"form-data": "^4.0.0", | ||
"limiter": "^2.1.0", | ||
"node-fetch": "^2.6.7" | ||
} | ||
} |
@@ -52,8 +52,11 @@ ![Horizontal Lockupblack](https://user-images.githubusercontent.com/293079/169453889-ae211c6c-7634-4ccd-8ca9-8970c2621b6f.png#gh-light-mode-only) | ||
// A version number can also be passed in. This will retrieve a specific | ||
// version of the PDF to be filled if you don't want the current version | ||
// to be used. | ||
// You can also use the constant `Anvil.VERSION_LATEST` to fill a PDF that has not | ||
// been published yet. Use this if you'd like to fill out a draft version of | ||
// your template/PDF. | ||
// By default, if the PDF has been published then the published version is what will | ||
// be filled. If the PDF has not been published, then the most recent version will | ||
// be filled. | ||
// | ||
// However, a version number can also be passed in that will be used retrieve and | ||
// fill a specific version of the PDF. | ||
// You can also use the constant `Anvil.VERSION_LATEST` (or `-1`) to fill the most | ||
// recent version of your PDF, whether that version has been published or not. | ||
// Use this if you'd like to fill out a draft version of your template/PDF. | ||
const options = { versionNumber: Anvil.VERSION_LATEST } | ||
@@ -60,0 +63,0 @@ const { statusCode, data } = await anvilClient.fillPDF(pdfTemplateID, exampleData, options) |
@@ -5,3 +5,11 @@ | ||
name | ||
status | ||
isTest | ||
numberRemainingSigners | ||
detailsURL | ||
webhookURL | ||
completedAt | ||
archivedAt | ||
createdAt | ||
updatedAt | ||
documentGroup { | ||
@@ -25,4 +33,5 @@ eid | ||
generateMutation: (responseQuery = defaultResponseQuery) => ` | ||
mutation CreateEtchPacket ( | ||
mutation CreateEtchPacket( | ||
$name: String, | ||
$organizationEid: String, | ||
$files: [EtchFile!], | ||
@@ -36,8 +45,14 @@ $isDraft: Boolean, | ||
$signers: [JSON!], | ||
$data: JSON, | ||
$webhookURL: String, | ||
$data: JSON, | ||
$replyToName: String, | ||
$replyToEmail: String, | ||
$enableEmails: JSON, | ||
$createCastTemplatesFromUploads: Boolean, | ||
$duplicateCasts: Boolean, | ||
$mergePDFs: Boolean | ||
) { | ||
createEtchPacket ( | ||
createEtchPacket( | ||
name: $name, | ||
organizationEid: $organizationEid, | ||
files: $files, | ||
@@ -51,4 +66,9 @@ isDraft: $isDraft, | ||
signers: $signers, | ||
data: $data, | ||
webhookURL: $webhookURL, | ||
data: $data, | ||
replyToName: $replyToName, | ||
replyToEmail: $replyToEmail, | ||
enableEmails: $enableEmails, | ||
createCastTemplatesFromUploads: $createCastTemplatesFromUploads, | ||
duplicateCasts: $duplicateCasts, | ||
mergePDFs: $mergePDFs | ||
@@ -55,0 +75,0 @@ ) ${responseQuery} |
const defaultResponseQuery = `{ | ||
id | ||
eid | ||
status | ||
continueURL | ||
payloadValue | ||
@@ -31,2 +33,3 @@ currentStep | ||
$payload: JSON!, | ||
$enforcePayloadValidOnCreate: Boolean, | ||
$currentStep: Int, | ||
@@ -36,7 +39,7 @@ $complete: Boolean, | ||
$timezone: String, | ||
$webhookURL: String, | ||
$groupArrayId: String, | ||
$groupArrayIndex: Int, | ||
$errorType: String, | ||
$groupArrayIndex: Int | ||
) { | ||
forgeSubmit ( | ||
forgeSubmit( | ||
forgeEid: $forgeEid, | ||
@@ -46,2 +49,3 @@ weldDataEid: $weldDataEid, | ||
payload: $payload, | ||
enforcePayloadValidOnCreate: $enforcePayloadValidOnCreate, | ||
currentStep: $currentStep, | ||
@@ -51,7 +55,7 @@ complete: $complete, | ||
timezone: $timezone, | ||
webhookURL: $webhookURL, | ||
groupArrayId: $groupArrayId, | ||
groupArrayIndex: $groupArrayIndex, | ||
errorType: $errorType | ||
groupArrayIndex: $groupArrayIndex | ||
) ${responseQuery} | ||
}`, | ||
} |
@@ -5,3 +5,11 @@ const defaultResponseQuery = `{ | ||
name | ||
status | ||
isTest | ||
numberRemainingSigners | ||
webhookURL | ||
detailsURL | ||
completedAt | ||
archivedAt | ||
createdAt | ||
updatedAt | ||
documentGroup { | ||
@@ -27,3 +35,3 @@ id | ||
generateQuery: (responseQuery = defaultResponseQuery) => ` | ||
query GetEtchPacket ( | ||
query EtchPacket ( | ||
$eid: String!, | ||
@@ -30,0 +38,0 @@ ) { |
const fs = require('fs') | ||
const fetch = require('node-fetch') | ||
const FormData = require('form-data') | ||
@@ -16,2 +14,5 @@ const AbortController = require('abort-controller') | ||
let Fetch | ||
let fetch | ||
/** | ||
@@ -512,2 +513,11 @@ * @typedef AnvilOptions | ||
async _request (...args) { | ||
// Only load Fetch once per module process lifetime | ||
Fetch = Fetch || await import('node-fetch') | ||
fetch = Fetch.default | ||
// Monkey-patch so we only try any of this once per Anvil Client instance | ||
this._request = this.__request | ||
return this._request(...args) | ||
} | ||
/** | ||
@@ -519,3 +529,3 @@ * @param {string} url | ||
*/ | ||
_request (url, options) { | ||
__request (url, options) { | ||
if (!url.startsWith(this.options.baseURL)) { | ||
@@ -522,0 +532,0 @@ url = this._url(url) |
737142
1873
425
24
49
10
+ Addeddata-uri-to-buffer@3.0.1(transitive)
+ Addedextract-files@11.0.0(transitive)
+ Addedfetch-blob@3.2.0(transitive)
+ Addednode-domexception@1.0.0(transitive)
+ Addednode-fetch@3.0.0(transitive)
+ Addedweb-streams-polyfill@3.3.3(transitive)
- Removedextract-files@6.0.0(transitive)
- Removednode-fetch@2.7.0(transitive)
- Removedtr46@0.0.3(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)
Updatedextract-files@^11
Updatednode-fetch@3.0.x