@tryghost/admin-api
Advanced tools
+9
-7
@@ -160,3 +160,3 @@ const axios = require('axios'); | ||
| if (typeof data !== FormData && !data.path) { | ||
| if (!(data instanceof FormData) && !data.file) { | ||
| return Promise.reject(new Error('Must be of FormData or include path')); | ||
@@ -166,5 +166,5 @@ } | ||
| let formData; | ||
| if (data.path) { | ||
| if (data.file) { | ||
| formData = new FormData(); | ||
| formData.append('file', fs.createReadStream(data.path)); | ||
| formData.append('file', fs.createReadStream(data.file)); | ||
| formData.append('purpose', data.purpose || 'image'); | ||
@@ -199,3 +199,3 @@ | ||
| if (typeof data !== FormData && !data.path) { | ||
| if (!(data instanceof FormData) && !data.file) { | ||
| return Promise.reject(new Error('Must be of FormData or include path')); | ||
@@ -205,5 +205,5 @@ } | ||
| let formData; | ||
| if (data.path) { | ||
| if (data.file) { | ||
| formData = new FormData(); | ||
| formData.append('file', fs.createReadStream(data.path)); | ||
| formData.append('file', fs.createReadStream(data.file)); | ||
| } | ||
@@ -303,3 +303,5 @@ | ||
| toThrow.response = err.response; | ||
| // @TODO: bring back with a better design idea. if you log the error, the stdout is hard to read | ||
| // if we return the full response object, which includes also the request etc. | ||
| // toThrow.response = err.response; | ||
| throw toThrow; | ||
@@ -306,0 +308,0 @@ } else { |
+2
-2
| { | ||
| "name": "@tryghost/admin-api", | ||
| "version": "0.1.0", | ||
| "version": "0.2.0", | ||
| "repository": "https://github.com/TryGhost/Ghost-SDKs/tree/master/packages/admin-api", | ||
@@ -33,3 +33,3 @@ "author": "Ghost Foundation", | ||
| }, | ||
| "gitHead": "56ca138619265624bb532f5ffb415fc4f3ed0a2f" | ||
| "gitHead": "28a3651a34a304660e32f0890540c618a6c4c98d" | ||
| } |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
12753
1.79%269
0.75%0
-100%