Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@tryghost/admin-api

Package Overview
Dependencies
Maintainers
11
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tryghost/admin-api - npm Package Compare versions

Comparing version
0.1.0
to
0.2.0
+9
-7
lib/index.js

@@ -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 {

{
"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"
}