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

ibl-client

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ibl-client

Rest Client for the iPlayer Business Layer

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

ibl-client

Client library written in Node.js for the iPlayer Business Layer (iBL)

Installation

npm install ibl-client

Usage

const client = require('@ibl/client').createClient({
  stats: require('@ibl/stats'),
  logger: require('@ibl/logger'),
});

client.getEpisodes()
  .then(console.log)
  .catch(console.error);

client.getEpisodes((err, episodes) => {
  if (err) {
    console.error(err);
    return;
  }
  console.log(episodes)
});

API

.createClient

Creates a new client.

Parameters
  • opts - An options object
Options

createClient supports all of the options supported by ibl-rest-client.

.createCustomClient

Creates a new client with a pre-configured http client.

Parameters
  • delegate - pre-configured http client

Programmes

client.getProgrammes(programmePids, opts, cb) -> Promise
Parameters
  • programmePids - An Programme PID or an array of Programme PIDs
  • opts - optional - An object containing request parameters
    • rights
    • availability
    • initial_child_count
  • cb - optional - A function that is called with an error object and an array of programmes
Returns
  • If the Promise fulfills, the fulfillment value is an array of Programmes

Programme Episodes

client.getProgrammeEpisodes(programmePid, opts, cb) -> Promise
Parameters
  • programmePid - A Programme PID
  • opts - optional - An object containing request parameters
  • cb - optional - A function that is called with an error object and programme_episodes object
Returns
  • If the Promise fulfills, the fulfillment value is the programme_episodes object
client.getEpisodeRecommendations(episodePid, opts, cb) -> Promise
Parameters
  • episodePid - A Episode PID
  • opts - optional - An object containing request parameters
Returns
  • If the Promise fulfills, the fulfillment value is the episode_recommendations object
  • cb - optional - A function that is called with an error object and episode_recommendations object

Episodes

client.getEpisodes(episodePids, opts, cb) -> Promise
Parameters
  • episodesPids - An Episode PID or an array of Episode PIDs
  • opts - optional - An object containing request parameters
    • rights
    • availability
  • cb - optional - A function that is called with an error object and an array of episodes
Returns
  • If the Promise fulfills, the fulfillment value is an array of episodes

Category Programmes

client.categoryProgrammes(category, opts, cb) -> Promise
Parameters
  • category - ibl category
  • opts - optional - An object containing request parameters
    • rights
    • availability
    • sort
    • sort_direction
    • initial_child_count
    • page
    • per_page
  • cb - optional - A function that is called with an error object and a category_programmes object
Returns
  • If the Promise fulfills, the fulfillment value is a category_programmes object

Group Episodes

client.getGroupEpisodes(groupPid, opts, cb) -> Promise
Parameters
  • groupPid - A Group PID
  • opts - optional - An object containing request parameters
    • rights
    • page
    • per_page
  • cb - optional - A function that is called with an error object and a group_episodes object
Returns
  • If the Promise fulfills, the fulfillment value is the group_episodes object
client.getPopularEpisodes(groupPid, opts, cb) -> Promise
Parameters
  • opts - optional - An object containing request parameters
    • rights
    • page
    • per_page
  • cb - optional - A function that is called with an error object and a group_episodes object
Returns
  • If the Promise fulfills, the fulfillment value is the group_episodes object

Category Highlights

client.getCategoryHighlights(categoryId, opts, cb) -> Promise
Parameters
  • categoryId - An iBL category
  • opts - optional - An object containing request parameters
    • rights
    • mixin
  • cb - optional - A function that is called with an error object and a category_highlights object
Returns
  • If the Promise fulfills, the fulfillment value is the category_highlights object

Channel Highlights

client.getChannelHighlights(channelId, opts, cb) -> Promise
Parameters
  • channelId - An iBL category
  • opts - optional - An object containing request parameters
    • rights
    • mixin
    • isLive
  • cb - optional - A function that is called with an error object and a channel_highlights object
Returns
  • If the Promise fulfills, the fulfillment value is the channel_highlights object

Home Highlights

client.getHomeHighlights(opts, cb) -> Promise
Parameters
  • opts - optional - An object containing request parameters
    • rights
    • mixin
  • cb - optional - A function that is called with an error object and a home_highlights object
Returns
  • If the Promise fulfills, the fulfillment value is the home_highlights object

Categories

client.getCategories(id, opts, cb) -> Promise
Parameters
  • categoryId - An iBL category id
  • cb - optional - A function that is called with an error object and a list of categories or a category object
Returns
  • If the Promise fulfills, the fulfillment value is the list of channels or a channel object

Channels

client.getChannels(id, opts, cb) -> Promise
Parameters
  • channelId - An iBL channel id
  • cb - optional - A function that is called with an error object and a list of channels or a channel object
Returns
  • If the Promise fulfills, the fulfillment value is the list of channels or a channel object

Channel Broadcasts

client.getChannelBroadcasts(id, opts, cb) -> Promise
Parameters
  • channelId - An iBL channel id
  • opts - optional - An object containing request parameters
    • rights
    • page
    • per_page
  • cb - optional - A function that is called with an error object and a broadcast object
Returns
  • If the Promise fulfills, the fulfillment value is a broadcast object

Test

npm test

To generate a test coverage report:

npm run coverage

Keywords

FAQs

Package last updated on 24 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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