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

gatsby-source-drupal

Package Overview
Dependencies
Maintainers
1
Versions
815
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-source-drupal - npm Package Compare versions

Comparing version 1.0.0-alpha15-alpha.17ca92e9 to 1.0.0-alpha15-alpha.336b6aa8

2

package.json
{
"name": "gatsby-source-drupal",
"version": "1.0.0-alpha15-alpha.17ca92e9",
"version": "1.0.0-alpha15-alpha.336b6aa8",
"description": "Gatsby source plugin for building websites using the Drupal CMS as a data source",

@@ -5,0 +5,0 @@ "scripts": {

@@ -5,8 +5,6 @@ const axios = require(`axios`)

const makeTypeName = type => {
return `drupal__${type.replace(/-/g, `_`)}`
}
const makeTypeName = type => `drupal__${type.replace(/-/g, `_`)}`
const processEntities = ents => {
return ents.map(ent => {
const processEntities = ents =>
ents.map(ent => {
const newEnt = {

@@ -29,3 +27,2 @@ id: ent.id,

})
}

@@ -121,44 +118,45 @@ exports.sourceNodes = async (

const blue = await Promise.all(
users.map((user, i) => {
return new Promise(resolve => {
const userStr = JSON.stringify(user)
users.map(
(user, i) =>
new Promise(resolve => {
const userStr = JSON.stringify(user)
const gatsbyUser = {
...user,
children: [],
parent: `__SOURCE__`,
internal: {
type: makeTypeName(user.internal.type),
content: userStr,
mediaType: `application/json`,
},
}
const gatsbyUser = {
...user,
children: [],
parent: `__SOURCE__`,
internal: {
type: makeTypeName(user.internal.type),
content: userStr,
mediaType: `application/json`,
},
}
if (gatsbyUser.uid === 1) {
return resolve()
}
if (gatsbyUser.uid === 1) {
return resolve()
}
axios
.get(
userResult.data.data[i].relationships.user_picture.links.related,
{ timeout: 20000 }
)
.catch(() => console.log(`fail fetch`, gatsbyUser))
.then(pictureResult => {
gatsbyUser.picture = `http://dev-gatsbyjs-d8.pantheonsite.io${pictureResult.data.data.attributes.url}`
axios
.get(
userResult.data.data[i].relationships.user_picture.links.related,
{ timeout: 20000 }
)
.catch(() => console.log(`fail fetch`, gatsbyUser))
.then(pictureResult => {
gatsbyUser.picture = `http://dev-gatsbyjs-d8.pantheonsite.io${pictureResult.data.data.attributes.url}`
// Get content digest of node.
const contentDigest = crypto
.createHash(`md5`)
.update(JSON.stringify(gatsbyUser))
.digest(`hex`)
// Get content digest of node.
const contentDigest = crypto
.createHash(`md5`)
.update(JSON.stringify(gatsbyUser))
.digest(`hex`)
gatsbyUser.internal.contentDigest = contentDigest
gatsbyUser.internal.contentDigest = contentDigest
createNode(gatsbyUser)
createNode(gatsbyUser)
resolve()
})
})
})
resolve()
})
})
)
)

@@ -165,0 +163,0 @@

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