Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gatsby-source-ghost

Package Overview
Dependencies
Maintainers
2
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-source-ghost - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

21

api.js
const axios = require('axios');
const qs = require('qs');
const printError = (...args) => printError(...args); // eslint-disable-line no-console
const printError = (...args) => console.error('\n', ...args); // eslint-disable-line no-console
module.exports.fetchAllPosts = (options) => {
if (!options.clientId || !options.clientSecret || !options.adminUrl) {
if (!options.clientId || !options.clientSecret || !options.apiUrl) {
printError('Plugin Configuration Missing: gatsby-source-ghost requires your adminUrl, clientId and clientSecret');
return;
process.exit(1);
}
const baseApiUrl = `https://${options.adminUrl}/ghost/api/v0.1`;
if (options.apiUrl.substring(0, 4) !== 'http') {
printError('Ghost apiUrl requires a protocol, E.g. https://<yourdomain>.ghost.io');
process.exit(1);
}
if (options.apiUrl.substring(0, 8) !== 'https://') {
printError('Ghost apiUrl should be served over HTTPS, are you sure you want:', options.apiUrl, '?');
}
const baseApiUrl = `${options.apiUrl}/ghost/api/v0.1`;
const postApiOptions = {

@@ -26,6 +35,6 @@ client_id: options.clientId,

.catch((err) => {
printError('\nUnable to fetch data from your Ghost API. Perhaps your credentials or adminUrl are incorrect?');
printError('\nError:', err);
printError('Error:', err);
printError('Unable to fetch data from your Ghost API. Perhaps your credentials or apiUrl are incorrect?');
process.exit(1);
});
};
{
"name": "gatsby-source-ghost",
"version": "2.0.0",
"version": "2.1.0",
"description": "Gatsby source plugin for building websites using the Ghost API as a data source.",

@@ -5,0 +5,0 @@ "repository": "git@github.com:TryGhost/gatsby-plugin-ghost.git",

@@ -17,3 +17,3 @@ # Gatsby Source Ghost

options: {
adminUrl: `<your-subdomain>.ghost.io`,
apiUrl: `https://<your-subdomain>.ghost.io`,
clientId: `ghost-frontend`,

@@ -25,4 +25,4 @@ clientSecret: `<your client secret>`

`adminUrl`
The admin URL of your Ghost site. For Ghost(Pro) customers this is your `.ghost.io` domain. For self hosters it is your main domain unless you have a separate `admin` url configured. Note this URL _must_ work over HTTPS.
`apiUrl`
The admin or API URL for your Ghost site. For Ghost(Pro) customers this is your `.ghost.io` domain. For self hosters it is your main domain unless you have a separate `admin` url configured. Note that this URL should be served over HTTPS.

@@ -29,0 +29,0 @@ `clientId`

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc