spotify-wrapper-wj
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -87,7 +87,14 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
var API_URL = 'https://api.spotify.com/v1'; | ||
exports.default = API_URL; | ||
var TOKEN_API = 'BQDU6cKTjsGyi54v5mr84CndPs7TMl_eghiJvo0qiH96bJiXGTYzCTQHDLAf5uWoIW4gs3sys54PpY7-gy97yU4NHeKZN0OOfsQ087Okbbfh5bmei1uSfzzlLQ3A9WAHKL9DscyDYgdJnOCqtt8C5Ln1AFqkO7DSzg'; | ||
var API_URL = exports.API_URL = 'https://api.spotify.com/v1'; | ||
var HEADERS = exports.HEADERS = { | ||
headers: { | ||
'Authorization': '\'Bearer ' + TOKEN_API + '\'' | ||
} | ||
}; | ||
/***/ }), | ||
@@ -124,13 +131,17 @@ /* 1 */ | ||
var _utils2 = _interopRequireDefault(_utils); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/* global fetch */ | ||
var getAlbum = exports.getAlbum = function getAlbum(id) { | ||
return fetch(_config.API_URL + '/albums/' + id).then(_utils.toJSON); | ||
return fetch(_config.API_URL + '/albums/' + id, _config.HEADERS).then(_utils2.default); | ||
}; | ||
var getAlbums = exports.getAlbums = function getAlbums(ids) { | ||
return fetch(_config.API_URL + '/albums/?ids=' + ids).then(_utils.toJSON); | ||
return fetch(_config.API_URL + '/albums/?ids=' + ids, _config.HEADERS).then(_utils2.default); | ||
}; | ||
var getAlbumTracks = exports.getAlbumTracks = function getAlbumTracks(id) { | ||
return fetch(_config.API_URL + '/albums/' + id + '/tracks').then(_utils.toJSON); | ||
return fetch(_config.API_URL + '/albums/' + id + '/tracks', _config.HEADERS).then(_utils2.default); | ||
}; | ||
@@ -156,19 +167,19 @@ | ||
var search = exports.search = function search(query, type) { | ||
return fetch(_config.API_URL + '/search?q=' + query + '&type=' + type).then(_utils.toJSON); | ||
return fetch(_config.API_URL + '/search?q=' + query + '&type=' + type, _config.HEADERS).then(_utils.toJSON); | ||
}; | ||
var searchArtists = exports.searchArtists = function searchArtists(query) { | ||
return search(query, 'artist'); | ||
return search(query, 'artist', _config.HEADERS); | ||
}; | ||
var searchAlbums = exports.searchAlbums = function searchAlbums(query) { | ||
return search(query, 'album'); | ||
return search(query, 'album', _config.HEADERS); | ||
}; | ||
var searchTracks = exports.searchTracks = function searchTracks(query) { | ||
return search(query, 'track'); | ||
return search(query, 'track', _config.HEADERS); | ||
}; | ||
var searchPlaylists = exports.searchPlaylists = function searchPlaylists(query) { | ||
return search(query, 'playlist'); | ||
return search(query, 'playlist', _config.HEADERS); | ||
}; | ||
@@ -175,0 +186,0 @@ |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.spotifyWrapper=e():t.spotifyWrapper=e()}(this,function(){return function(t){function e(s){if(r[s])return r[s].exports;var n=r[s]={i:s,l:!1,exports:{}};return t[s].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,s){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:s})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=4)}([function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default="https://api.spotify.com/v1"},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=function(t){return t.json()};e.default=s},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getAlbumTracks=e.getAlbums=e.getAlbum=void 0;var s=r(0),n=r(1);e.getAlbum=function(t){return fetch(s.API_URL+"/albums/"+t).then(n.toJSON)},e.getAlbums=function(t){return fetch(s.API_URL+"/albums/?ids="+t).then(n.toJSON)},e.getAlbumTracks=function(t){return fetch(s.API_URL+"/albums/"+t+"/tracks").then(n.toJSON)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.searchPlaylists=e.searchTracks=e.searchAlbums=e.searchArtists=e.search=void 0;var s=r(0),n=r(1),u=e.search=function(t,e){return fetch(s.API_URL+"/search?q="+t+"&type="+e).then(n.toJSON)};e.searchArtists=function(t){return u(t,"artist")},e.searchAlbums=function(t){return u(t,"album")},e.searchTracks=function(t){return u(t,"track")},e.searchPlaylists=function(t){return u(t,"playlist")}},function(t,e,r){"use strict";var s=r(3),n=r(2);t.exports={search:s.search,searchArtists:s.searchArtists,searchAlbums:s.searchAlbums,searchPlaylists:s.searchPlaylists,getAlbum:n.getAlbum,getAlbums:n.getAlbums,getAlbumTracks:n.getAlbumTracks}}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.spotifyWrapper=t():e.spotifyWrapper=t()}(this,function(){return function(e){function t(s){if(r[s])return r[s].exports;var u=r[s]={i:s,l:!1,exports:{}};return e[s].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,s){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:s})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.API_URL="https://api.spotify.com/v1",t.HEADERS={headers:{Authorization:"'Bearer BQDU6cKTjsGyi54v5mr84CndPs7TMl_eghiJvo0qiH96bJiXGTYzCTQHDLAf5uWoIW4gs3sys54PpY7-gy97yU4NHeKZN0OOfsQ087Okbbfh5bmei1uSfzzlLQ3A9WAHKL9DscyDYgdJnOCqtt8C5Ln1AFqkO7DSzg'"}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){return e.json()};t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAlbumTracks=t.getAlbums=t.getAlbum=void 0;var s=r(0),u=r(1),n=function(e){return e&&e.__esModule?e:{default:e}}(u);t.getAlbum=function(e){return fetch(s.API_URL+"/albums/"+e,s.HEADERS).then(n.default)},t.getAlbums=function(e){return fetch(s.API_URL+"/albums/?ids="+e,s.HEADERS).then(n.default)},t.getAlbumTracks=function(e){return fetch(s.API_URL+"/albums/"+e+"/tracks",s.HEADERS).then(n.default)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.searchPlaylists=t.searchTracks=t.searchAlbums=t.searchArtists=t.search=void 0;var s=r(0),u=r(1),n=t.search=function(e,t){return fetch(s.API_URL+"/search?q="+e+"&type="+t,s.HEADERS).then(u.toJSON)};t.searchArtists=function(e){return n(e,"artist",s.HEADERS)},t.searchAlbums=function(e){return n(e,"album",s.HEADERS)},t.searchTracks=function(e){return n(e,"track",s.HEADERS)},t.searchPlaylists=function(e){return n(e,"playlist",s.HEADERS)}},function(e,t,r){"use strict";var s=r(3),u=r(2);e.exports={search:s.search,searchArtists:s.searchArtists,searchAlbums:s.searchAlbums,searchPlaylists:s.searchPlaylists,getAlbum:u.getAlbum,getAlbums:u.getAlbums,getAlbumTracks:u.getAlbumTracks}}])}); | ||
//# sourceMappingURL=spotify-wrapper.umd.min.js.map |
@@ -12,13 +12,17 @@ 'use strict'; | ||
var _utils2 = _interopRequireDefault(_utils); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/* global fetch */ | ||
var getAlbum = exports.getAlbum = function getAlbum(id) { | ||
return fetch(_config.API_URL + '/albums/' + id).then(_utils.toJSON); | ||
return fetch(_config.API_URL + '/albums/' + id, _config.HEADERS).then(_utils2.default); | ||
}; | ||
var getAlbums = exports.getAlbums = function getAlbums(ids) { | ||
return fetch(_config.API_URL + '/albums/?ids=' + ids).then(_utils.toJSON); | ||
return fetch(_config.API_URL + '/albums/?ids=' + ids, _config.HEADERS).then(_utils2.default); | ||
}; | ||
var getAlbumTracks = exports.getAlbumTracks = function getAlbumTracks(id) { | ||
return fetch(_config.API_URL + '/albums/' + id + '/tracks').then(_utils.toJSON); | ||
return fetch(_config.API_URL + '/albums/' + id + '/tracks', _config.HEADERS).then(_utils2.default); | ||
}; |
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
var API_URL = 'https://api.spotify.com/v1'; | ||
exports.default = API_URL; | ||
var TOKEN_API = 'BQDU6cKTjsGyi54v5mr84CndPs7TMl_eghiJvo0qiH96bJiXGTYzCTQHDLAf5uWoIW4gs3sys54PpY7-gy97yU4NHeKZN0OOfsQ087Okbbfh5bmei1uSfzzlLQ3A9WAHKL9DscyDYgdJnOCqtt8C5Ln1AFqkO7DSzg'; | ||
var API_URL = exports.API_URL = 'https://api.spotify.com/v1'; | ||
var HEADERS = exports.HEADERS = { | ||
headers: { | ||
'Authorization': '\'Bearer ' + TOKEN_API + '\'' | ||
} | ||
}; |
@@ -14,19 +14,19 @@ 'use strict'; | ||
var search = exports.search = function search(query, type) { | ||
return fetch(_config.API_URL + '/search?q=' + query + '&type=' + type).then(_utils.toJSON); | ||
return fetch(_config.API_URL + '/search?q=' + query + '&type=' + type, _config.HEADERS).then(_utils.toJSON); | ||
}; | ||
var searchArtists = exports.searchArtists = function searchArtists(query) { | ||
return search(query, 'artist'); | ||
return search(query, 'artist', _config.HEADERS); | ||
}; | ||
var searchAlbums = exports.searchAlbums = function searchAlbums(query) { | ||
return search(query, 'album'); | ||
return search(query, 'album', _config.HEADERS); | ||
}; | ||
var searchTracks = exports.searchTracks = function searchTracks(query) { | ||
return search(query, 'track'); | ||
return search(query, 'track', _config.HEADERS); | ||
}; | ||
var searchPlaylists = exports.searchPlaylists = function searchPlaylists(query) { | ||
return search(query, 'playlist'); | ||
return search(query, 'playlist', _config.HEADERS); | ||
}; |
{ | ||
"name": "spotify-wrapper-wj", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A wrapper to work with the Spotify Web API", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57783
255