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

radioco-api

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

radioco-api - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

34

dist/client.d.ts
import type { StationHistory, StationNextTrack, StationRequestableTracks, StationSchedule, StationStatus } from "./types";
export declare class RadioCo {
/**
* Get the track history of a station
* @param stationId Station ID
* @returns Track history
*/
getStationHistory(stationId: string): Promise<StationHistory>;
/**
* Gets the next track to be played on a station
* @param stationId Station ID
* @returns Next track to be played
*/
getNextTrack(stationId: string): Promise<StationNextTrack>;
requestTrack(stationId: string, trackId: number): Promise<void>;
/**
* Request a track to be played on a station
* @param stationId Station ID
* @param trackId Requested track ID
* @param deviceIdentifier Optional device fingerprint ID to associate with the request
* @returns Nothing
*/
requestTrack(stationId: string, trackId: number, deviceIdentifier?: string): Promise<void>;
/**
* Get the requestable tracks of a station
* @param stationId Station ID
* @returns Available tracks to be requested
*/
getRequestableTracks(stationId: string): Promise<StationRequestableTracks>;
/**
* Get the status of a station
* @param stationId Station ID
* @returns Station status
*/
getStationStatus(stationId: string): Promise<StationStatus>;
/**
* Get the schedule of a station
* @param stationId Station ID
* @returns Station schedule
*/
getStationSchedule(stationId: string): Promise<StationSchedule>;
}

@@ -13,2 +13,6 @@ "use strict";

baseURL: API_BASE_URL,
headers: {
"User-Agent": "Radio.co API Client https://github.com/jamesatjaminit/radioco-api",
...request.headers,
},
});

@@ -22,2 +26,7 @@ const responseJson = await response.data;

class RadioCo {
/**
* Get the track history of a station
* @param stationId Station ID
* @returns Track history
*/
async getStationHistory(stationId) {

@@ -29,2 +38,7 @@ return (await makeRequest({

}
/**
* Gets the next track to be played on a station
* @param stationId Station ID
* @returns Next track to be played
*/
async getNextTrack(stationId) {

@@ -36,3 +50,10 @@ return (await makeRequest({

}
async requestTrack(stationId, trackId) {
/**
* Request a track to be played on a station
* @param stationId Station ID
* @param trackId Requested track ID
* @param deviceIdentifier Optional device fingerprint ID to associate with the request
* @returns Nothing
*/
async requestTrack(stationId, trackId, deviceIdentifier) {
return (await makeRequest({

@@ -43,2 +64,3 @@ method: "POST",

"content-type": "application/json",
"device-identifier": deviceIdentifier ?? "",
},

@@ -50,2 +72,7 @@ data: JSON.stringify({

}
/**
* Get the requestable tracks of a station
* @param stationId Station ID
* @returns Available tracks to be requested
*/
async getRequestableTracks(stationId) {

@@ -57,2 +84,7 @@ return (await makeRequest({

}
/**
* Get the status of a station
* @param stationId Station ID
* @returns Station status
*/
async getStationStatus(stationId) {

@@ -64,2 +96,7 @@ return (await makeRequest({

}
/**
* Get the schedule of a station
* @param stationId Station ID
* @returns Station schedule
*/
async getStationSchedule(stationId) {

@@ -66,0 +103,0 @@ return (await makeRequest({

2

package.json
{
"name": "radioco-api",
"version": "0.1.1",
"version": "0.2.0",
"description": "An API wrapper for radio.co",

@@ -5,0 +5,0 @@ "repository": {

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