drupal-org-api
Advanced tools
Comparing version 1.0.2 to 1.0.4
@@ -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.'); | ||
} | ||
}; |
{ | ||
"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 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45770
152
91
6