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 2.27 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 FeaturedPlaylistCategoryFetcher=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.category_id=void 0,d}return _inherits(b,a),_createClass(b,[{key:'fetchAllFeaturedPlaylistCategories',value:function fetchAllFeaturedPlaylistCategories(){return this.http.get(_Endpoint.FEATURED_PLAYLISTS_CATEGORIES,{territory:this.territory})}},{key:'setCategoryID',value:function setCategoryID(a){return this.category_id=a,this}},{key:'fetchMetadata',value:function fetchMetadata(){return this.http.get(_Endpoint.FEATURED_PLAYLISTS_CATEGORIES+this.category_id,{territory:this.territory})}},{key:'fetchPlaylists',value:function fetchPlaylists(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:void 0,b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:void 0;return this.http.get(_Endpoint.FEATURED_PLAYLISTS_CATEGORIES+this.category_id+'/playlists',{territory:this.territory,limit:a,offset:b})}}]),b}(_Fetcher3.default);exports.default=FeaturedPlaylistCategoryFetcher;