sdk-spotify
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -86,4 +86,12 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
}); | ||
var TOKEN_API = "BQAXQn0OB-5KPVabDdB19fNIkxedWoqMovcEIsDXvaQTg1kiGYV1nVWJNQHao3h7nin3gK-Ld2wUuIFCOVDcZamR-xRd2N9_7vSGIR-s3Sx-fooUTvufZV7E8bM7u-Wiyvf4LUrEEbR5npNQ"; | ||
var API_URL = exports.API_URL = 'https://api.spotify.com/v1'; | ||
var HEADERS = exports.HEADERS = { | ||
headers: { | ||
Authorization: "Bearer " + TOKEN_API | ||
} | ||
}; | ||
/***/ }), | ||
@@ -142,3 +150,3 @@ /* 1 */ | ||
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); | ||
}; | ||
@@ -180,11 +188,11 @@ | ||
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(_utils.toJSON); | ||
}; | ||
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(_utils.toJSON); | ||
}; | ||
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(_utils.toJSON); | ||
}; | ||
@@ -191,0 +199,0 @@ |
@@ -1,2 +0,2 @@ | ||
!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()}("undefined"!=typeof self?self:this,function(){return function(e){function t(s){if(r[s])return r[s].exports;var n=r[s]={i:s,l:!1,exports:{}};return e[s].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var r={};return t.m=e,t.c=r,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=2)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.API_URL="https://api.spotify.com/v1"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.toJSON=function(e){return e.json()}},function(e,t,r){"use strict";var s=r(3),n=r(4);e.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,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),n=r(1),u=t.search=function(e,t){return fetch(s.API_URL+"/search?q="+e+"&type="+t).then(n.toJSON)};t.searchArtists=function(e){return u(e,"artist")},t.searchAlbums=function(e){return u(e,"album")},t.searchTracks=function(e){return u(e,"track")},t.searchPlaylists=function(e){return u(e,"playlist")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAlbumTracks=t.getAlbums=t.getAlbum=void 0;var s=r(0),n=r(1);t.getAlbum=function(e){return fetch(s.API_URL+"/albums/"+e).then(n.toJSON)},t.getAlbums=function(e){return fetch(s.API_URL+"/albums?ids="+e).then(n.toJSON)},t.getAlbumTracks=function(e){return fetch(s.API_URL+"/albums/"+e+"/tracks").then(n.toJSON)}}])}); | ||
!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()}("undefined"!=typeof self?self:this,function(){return function(e){function t(s){if(r[s])return r[s].exports;var n=r[s]={i:s,l:!1,exports:{}};return e[s].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var r={};return t.m=e,t.c=r,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=2)}([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 BQAXQn0OB-5KPVabDdB19fNIkxedWoqMovcEIsDXvaQTg1kiGYV1nVWJNQHao3h7nin3gK-Ld2wUuIFCOVDcZamR-xRd2N9_7vSGIR-s3Sx-fooUTvufZV7E8bM7u-Wiyvf4LUrEEbR5npNQ"}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.toJSON=function(e){return e.json()}},function(e,t,r){"use strict";var s=r(3),n=r(4);e.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,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),n=r(1),u=t.search=function(e,t){return fetch(s.API_URL+"/search?q="+e+"&type="+t,s.HEADERS).then(n.toJSON)};t.searchArtists=function(e){return u(e,"artist")},t.searchAlbums=function(e){return u(e,"album")},t.searchTracks=function(e){return u(e,"track")},t.searchPlaylists=function(e){return u(e,"playlist")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAlbumTracks=t.getAlbums=t.getAlbum=void 0;var s=r(0),n=r(1);t.getAlbum=function(e){return fetch(s.API_URL+"/albums/"+e,s.HEADERS).then(n.toJSON)},t.getAlbums=function(e){return fetch(s.API_URL+"/albums?ids="+e,s.HEADERS).then(n.toJSON)},t.getAlbumTracks=function(e){return fetch(s.API_URL+"/albums/"+e+"/tracks",s.HEADERS).then(n.toJSON)}}])}); | ||
//# sourceMappingURL=spotify-wrapper.umd.min.js.map |
@@ -14,11 +14,11 @@ 'use strict'; | ||
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(_utils.toJSON); | ||
}; | ||
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(_utils.toJSON); | ||
}; | ||
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(_utils.toJSON); | ||
}; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,2 +6,10 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
var API_URL = exports.API_URL = 'https://api.spotify.com/v1'; | ||
var TOKEN_API = "BQAXQn0OB-5KPVabDdB19fNIkxedWoqMovcEIsDXvaQTg1kiGYV1nVWJNQHao3h7nin3gK-Ld2wUuIFCOVDcZamR-xRd2N9_7vSGIR-s3Sx-fooUTvufZV7E8bM7u-Wiyvf4LUrEEbR5npNQ"; | ||
var API_URL = exports.API_URL = 'https://api.spotify.com/v1'; | ||
var HEADERS = exports.HEADERS = { | ||
headers: { | ||
Authorization: "Bearer " + TOKEN_API | ||
} | ||
}; |
@@ -14,3 +14,3 @@ '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); | ||
}; | ||
@@ -17,0 +17,0 @@ |
{ | ||
"name": "sdk-spotify", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "A wrapper to work with the Spotify Web API.", | ||
@@ -75,4 +75,5 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"dotenv": "^5.0.1", | ||
"ramda": "^0.25.0" | ||
} | ||
} |
[![Build Status](https://travis-ci.org/lflimeira/js-tdd-studies.svg?branch=master)](https://travis-ci.org/lflimeira/js-tdd-studies) [![Coverage Status](https://coveralls.io/repos/github/lflimeira/js-tdd-studies/badge.svg?branch=master)](https://coveralls.io/github/lflimeira/js-tdd-studies?branch=master) | ||
# Spotify Wrapper | ||
# Spotify SDK | ||
@@ -22,3 +22,3 @@ A wrapper to work with the [Spotify Web API](https://developer.spotify.com/web-api/). | ||
```sh | ||
$ npm install spotify-wrapper --save | ||
$ npm install sdk-spotify --save | ||
``` | ||
@@ -25,0 +25,0 @@ |
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
41043
237
2
+ Addeddotenv@^5.0.1
+ Addeddotenv@5.0.1(transitive)