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.0.2
to
0.0.3
+20
-0
cjs/admin-api.js

@@ -26,2 +26,3 @@ 'use strict';

}
if (!version) {

@@ -48,2 +49,3 @@ throw new Error('GhostAdminAPI Config Missing: @tryghost/admin-api requires a "version" like "v2"');

}
const api = ['posts'].reduce((apiObject, resourceType) => {

@@ -167,2 +169,14 @@ function add(data, options = {}) {

api.configuration = {
read() {
return makeResourceRequest('configuration', {}, {});
},
about: {
read() {
return makeResourceRequest('configuration/about', {}, {});
}
}
};
return api;

@@ -221,2 +235,8 @@

// HACK: the configuration/about endpoint doesn't match the typical
// resource url structure and return value so we need to special-case it
if (resourceType === 'configuration/about') {
resourceType = 'configuration';
}
if (!Array.isArray(res.data[resourceType])) {

@@ -223,0 +243,0 @@ return res.data[resourceType];

@@ -12,2 +12,3 @@ import axios from 'axios';

}
if (!version) {

@@ -34,2 +35,3 @@ throw new Error('GhostAdminAPI Config Missing: @tryghost/admin-api requires a "version" like "v2"');

}
const api = ['posts'].reduce((apiObject, resourceType) => {

@@ -153,2 +155,14 @@ function add(data, options = {}) {

api.configuration = {
read() {
return makeResourceRequest('configuration', {}, {});
},
about: {
read() {
return makeResourceRequest('configuration/about', {}, {});
}
}
};
return api;

@@ -207,2 +221,8 @@

// HACK: the configuration/about endpoint doesn't match the typical
// resource url structure and return value so we need to special-case it
if (resourceType === 'configuration/about') {
resourceType = 'configuration';
}
if (!Array.isArray(res.data[resourceType])) {

@@ -209,0 +229,0 @@ return res.data[resourceType];

+2
-2
{
"name": "@tryghost/admin-api",
"version": "0.0.2",
"version": "0.0.3",
"repository": "https://github.com/TryGhost/Ghost-SDKs/tree/master/packages/admin-api",

@@ -47,3 +47,3 @@ "author": "Ghost Foundation",

},
"gitHead": "0350bcd9cb92309f9d56c5c43702c45045b69def"
"gitHead": "16fd601c0167741e554f38dcf49bfa47a81dc8d9"
}

Sorry, the diff of this file is too big to display