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.1 to 1.0.2

27

lib/index.js

@@ -28,8 +28,7 @@ const axios = require('axios');

return this.axios({ method, url })
.then(({ data }) => Promise.resolve(data))
.catch(Promise.reject);
.then(({ data }) => data);
}
/**
* Node
* @param {Object} filterOptions
* @param {Object} [filterOptions={}]
* Query string filter options

@@ -39,3 +38,3 @@ * @return {Promise}

*/
node(filterOptions) {
node(filterOptions = {}) {
return this.issueRequest(

@@ -47,3 +46,3 @@ this.methods.GET,

* User
* @param {Object} filterOptions
* @param {Object} [filterOptions={}]
* Query string filter options

@@ -53,3 +52,3 @@ * @return {Promise}

*/
user(filterOptions) {
user(filterOptions = {}) {
return this.issueRequest(

@@ -61,3 +60,3 @@ this.methods.GET,

* Comments
* @param {Object} filterOptions
* @param {Object} [filterOptions={}]
* Query string filter options

@@ -67,3 +66,3 @@ * @return {Promise}

*/
comment(filterOptions) {
comment(filterOptions = {}) {
return this.issueRequest(

@@ -99,3 +98,3 @@ this.methods.GET,

* DrupalCI Jobs
* @param {Object} filterOptions
* @param {Object} [filterOptions={}]
* Query string filter options

@@ -105,3 +104,3 @@ * @return {Promise}

*/
ci(filterOptions) {
ci(filterOptions = {}) {
return this.issueRequest(

@@ -114,12 +113,12 @@ this.methods.GET,

* Taxonomy Term
* @param {String} [tid]
* Taxonomy Term ID
* @param {Object} [filterOptions={}]
* Query string filter options
* @return {Promise}
* Pending issueRequest promise.
*/
taxonomyTerm(tid) {
taxonomyTerm(filterOptions = {}) {
return this.issueRequest(
this.methods.GET,
`${this.base}taxonomy_term.${this.format}${tid ? `?tid=${tid}` : ''}`);
`${this.base}taxonomy_term.${this.format}?${qs.stringify(filterOptions, { indices: false })}`);
}
};
{
"name": "drupal-org-api",
"version": "1.0.1",
"version": "1.0.2",
"description": "JavaScript client for Drupal.org",

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

@@ -64,7 +64,7 @@ # Drupal.org HTTP API

### `exports.taxonomyTerm(tid)`
### `exports.taxonomyTerm(filterOptions)`
**Parameters**
**tid**: `String`, Taxonomy Term ID
**filterOptions**: `Object`, Query string filter options

@@ -71,0 +71,0 @@ **Returns**: `Promise`, Pending `issueRequest` promise.

const DrupalAPI = require('./lib');
const drupalapi = new DrupalAPI();
drupalapi.taxonomyTerm(38080).then(console.log)
drupalapi.node({nid: 2885090})
//.then(res => drupalapi.getRelatedTaxonomyTerms(res))
//.then(d => console.log(d.list[0].comments))
//.then(res => drupalapi.getRelatedComments(res))
.then(console.log)
.catch(console.log);
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