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

opinionbee-api

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

opinionbee-api - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

61

index.js
const callEndpoint = require('./lib/callEndpoint');
const polls = require('./lib/polls');
const baseUri = 'http://opinionbee.uk/json/v1.0';

@@ -24,35 +25,43 @@

const endpointOptions = {
this.endpointOptions = {
baseUri,
apiKey: options.apiKey
};
}
/**
@description Get companies from the Opinionbee API
@returns {Promise<object[]>} Array of companies
*/
this.companies = callEndpoint.bind(null, endpointOptions, 'companies');
/**
@description Get companies from the Opinionbee API
@returns {Promise<object[]>} Array of companies
*/
companies () {
return callEndpoint(this.endpointOptions, 'companies');
}
/**
@description Get parties from the Opinionbee API
@returns {Promise<object[]>} Array of parties
*/
this.parties = callEndpoint.bind(null, endpointOptions, 'parties');
/**
@description Get parties from the Opinionbee API
@returns {Promise<object[]>} Array of parties
*/
parties () {
return callEndpoint(this.endpointOptions, 'parties');
}
/**
@description Get types from the Opinionbee API
@returns {Promise<object[]>} Array of types
*/
this.types = callEndpoint.bind(null, endpointOptions, 'types');
/**
@description Get types from the Opinionbee API
@returns {Promise<object[]>} Array of types
*/
types () {
return callEndpoint(this.endpointOptions, 'types');
}
/**
@description Get polls from the Opinionbee API
@param {object} [filters] Optional filters to apply to the API call
@param {Date} [filters.startDate] Return only polls from a date (ISO date format without a time)
@param {Date} [filters.endDate] Return only polls older than a date (ISO date format without a time). Can be combined with startDate to get polls between two dates
@param {string} [filters.company] Return only polls published by a specific company
@param {number} [filters.limit] Return a limited number of polls (0 < limit < 500)
@returns {Promise<object[]>} Array of companies
*/
this.polls = require('./lib/polls').bind(null, endpointOptions);
/**
@description Get polls from the Opinionbee API
@param {object} [filters] Optional filters to apply to the API call
@param {Date} [filters.startDate] Return only polls from a date (ISO date format without a time)
@param {Date} [filters.endDate] Return only polls older than a date (ISO date format without a time). Can be combined with startDate to get polls between two dates
@param {string} [filters.company] Return only polls published by a specific company
@param {number} [filters.limit] Return a limited number of polls (0 < limit < 500)
@returns {Promise<object[]>} Array of companies
*/
polls (filters) {
return polls(this.endpointOptions, filters);
}

@@ -59,0 +68,0 @@ }

{
"name": "opinionbee-api",
"version": "1.0.2",
"version": "1.0.3",
"description": "A client library for the opinionbee.uk API",

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

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