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

drupal-org-api

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

drupal-org-api - npm Package Compare versions

Comparing version 1.0.2 to 1.0.4

30

lib/index.js

@@ -88,3 +88,3 @@ const axios = require('axios');

this.methods.GET,
`${this.base}project/${projectID}/matainers.json`);
`${this.base}project/${projectID}/maintainers.json`);
}

@@ -116,2 +116,30 @@ /**

}
/**
* getRelatedComments
* Related Comments Request wrapper.
* @param {Array} commentIds
* Comment IDs from a node query.
* @return {Promise}
* The response from the Drupal.org HTTP api.
*/
getRelatedComments(commentIds) {
return Array.isArray(commentIds) && commentIds.length
? Promise.all(commentIds.map(cid => this.comment({ cid })))
.then(commentEntities => commentEntities.map(commentEntity => commentEntity.list[0])) :
Promise.reject('No Comments available.');
}
/**
* getRelatedTaxonomyTerms
* Related Taxonomy Term Request wrapper.
* @param {Array} taxonomyTermIds
* Taxonomy IDs from a node query.
* @return {Promise}
* The response from the Drupal.org HTTP api.
*/
getRelatedTaxonomyTerms(taxonomyTermIds) {
return Array.isArray(taxonomyTermIds) && taxonomyTermIds.length ?
Promise.all(taxonomyTermIds.map(tid => this.taxonomyTerm({ tid })))
.then(taxonomyEntities => taxonomyEntities.map(taxonomyEntity => taxonomyEntity.list[0])) :
Promise.reject('No Taxonomy Terms available.');
}
};

2

package.json
{
"name": "drupal-org-api",
"version": "1.0.2",
"version": "1.0.4",
"description": "JavaScript client for Drupal.org",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -72,4 +72,20 @@ # Drupal.org HTTP API

### `exports.getRelatedTaxonomyTerms(taxonomyTermIds)`
**Parameters**
**taxonomyTermIds**: `Array`, Array of Taxonomy Terms Ids
**Returns**: `Promise`, Pending `issueRequest` promise.
### `exports.getRelatedComments(commentIds)`
**Parameters**
**commentIds**: `Array`, Array of Comment Ids
**Returns**: `Promise`, Pending `issueRequest` promise.
## License
MIT
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