UNPKG

@kkbox/kkbox-javascript-developer-sdk

Version:

KKBOX Open API developer SDK for JavaScript. Use it to easily access KKBOX open API to get various metadata about KKBOX's tracks, albums, artists, playlists and stations.

1 lines 1.96 kB
'use strict';var _createClass=function(){function a(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,'value'in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),_Endpoint=require('../Endpoint'),_Fetcher2=require('./Fetcher'),_Fetcher3=_interopRequireDefault(_Fetcher2);Object.defineProperty(exports,'__esModule',{value:!0});function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError('Cannot call a class as a function')}function _possibleConstructorReturn(a,b){if(!a)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return b&&('object'==typeof b||'function'==typeof b)?b:a}function _inherits(a,b){if('function'!=typeof b&&null!==b)throw new TypeError('Super expression must either be null or a function, not '+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}var MoodStationFetcher=function(a){function b(a){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:'TW';_classCallCheck(this,b);var d=_possibleConstructorReturn(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,a,c));return d.mood_station_id=void 0,d}return _inherits(b,a),_createClass(b,[{key:'fetchAllMoodStations',value:function fetchAllMoodStations(){return this.http.get(_Endpoint.MOOD_STATIONS,{territory:this.territory})}},{key:'setMoodStationID',value:function setMoodStationID(a){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:'TW';return this.mood_station_id=a,this.territory=b,this}},{key:'fetchMetadata',value:function fetchMetadata(){return this.http.get(_Endpoint.MOOD_STATIONS+this.mood_station_id,{territory:this.territory})}}]),b}(_Fetcher3.default);exports.default=MoodStationFetcher;