Socket
Socket
Sign inDemoInstall

@soundify/web-api

Package Overview
Dependencies
0
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0-rc3 to 1.0.0-rc4

dist/general.types-QcPI9PCD.d.ts

2

dist/mod.js

@@ -1,1 +0,1 @@

var M="https://accounts.spotify.com/",K={UGC_IMAGE_UPLOAD:"ugc-image-upload",USER_READ_PLAYBACK_STATE:"user-read-playback-state",USER_MODIFY_PLAYBACK_STATE:"user-modify-playback-state",USER_READ_CURRENTLY_PLAYING:"user-read-currently-playing",STREAMING:"streaming",PLAYLIST_READ_PRIVATE:"playlist-read-private",PLAYLIST_READ_COLLABORATIVE:"playlist-read-collaborative",PLAYLIST_MODIFY_PRIVATE:"playlist-modify-private",PLAYLIST_MODIFY_PUBLIC:"playlist-modify-public",USER_FOLLOW_MODIFY:"user-follow-modify",USER_FOLLOW_READ:"user-follow-read",USER_READ_PLAYBACK_POSITION:"user-read-playback-position",USER_TOP_READ:"user-top-read",USER_READ_RECENTLY_PLAYED:"user-read-recently-played",USER_LIBRARY_MODIFY:"user-library-modify",USER_LIBRARY_READ:"user-library-read",USER_READ_EMAIL:"user-read-email",USER_READ_PRIVATE:"user-read-private"};var m=class extends Error{name="SpotifyError";response;body;constructor(e,s,r,o){super(e,o),this.response=s,this.body=r}get url(){return this.response.url}get status(){return this.response.status}},l="application/json",T="Content-Type",f=t=>t===null?null:typeof t=="string"?t:t.error.message+(t.error.reason?` (${t.error.reason})`:""),h=async(t,e)=>{let s=t.url.split("?")[0],r=t.statusText?`${t.status} ${t.statusText} (${s})`:`${t.status} (${s})`,o=null;if(t.body&&t.type!=="opaque")try{o=await t.text();let i=t.headers.get(T);i&&(i===l||i.split(";")[0]===l)&&(o=JSON.parse(o))}catch{}let a=f(o);return a&&(r+=" : "+a),new m(r,t,o,e)},b=t=>typeof t=="object"&&t!==null&&Object.prototype.toString.call(t)==="[object Object]",g=class{constructor(e,s={}){this.accessToken=e;this.options=s;this.baseUrl=s.baseUrl?s.baseUrl:"https://api.spotify.com/"}baseUrl;fetch(e,s={}){let r=new URL(e,this.baseUrl);if(s.query)for(let n in s.query){let p=s.query[n];typeof p<"u"&&r.searchParams.set(n,p.toString())}let o=new Headers(s.headers);o.set("Accept",l);let a=!!s.body&&(b(s.body)||Array.isArray(s.body));a&&o.set(T,l);let i=a?JSON.stringify(s.body):s.body,c=!1,y=async()=>{o.set("Authorization","Bearer "+this.accessToken);let n=await(this.options.middlewares||[]).reduceRight((p,u)=>u(p),this.options.fetch||globalThis.fetch)(r,{...s,body:i,headers:o});if(n.ok)return n;if(n.status===401&&this.options.refresher&&!c)return this.accessToken=await this.options.refresher(),c=!0,y();if(n.status===429){let p=Number(n.headers.get("Retry-After"))||void 0;if(p)return(typeof this.options.waitForRateLimit=="function"?this.options.waitForRateLimit(p):this.options.waitForRateLimit)&&await new Promise(d=>setTimeout(d,p*1e3)),y()}throw await h(n)};return y()}};var V=async t=>(await t.fetch("/v1/me")).json(),P=async(t,e,s)=>(await t.fetch("/v1/me/top/"+e,{query:s})).json(),W=async(t,e)=>await P(t,"artists",e),z=async(t,e)=>await P(t,"tracks",e),X=async(t,e)=>(await t.fetch("/v1/users/"+e)).json(),Z=async(t,e,s)=>{await t.fetch(`/v1/playlists/${e}/followers`,{method:"PUT",body:{public:s}})},tt=async(t,e)=>{await t.fetch(`/v1/playlists/${e}/followers`,{method:"DELETE"})},et=async(t,e)=>(await(await t.fetch("/v1/me/following",{query:{...e,type:"artist"}})).json()).artists,w=(t,e)=>t.fetch("/v1/me/following",{method:"PUT",query:{type:"artist",ids:e}}),st=(t,e)=>w(t,[e]),x=(t,e)=>t.fetch("/v1/me/following",{method:"PUT",query:{type:"user",ids:e}}),rt=(t,e)=>x(t,[e]),k=(t,e)=>t.fetch("/v1/me/following",{method:"DELETE",query:{type:"artist",ids:e}}),ot=(t,e)=>k(t,[e]),C=(t,e)=>t.fetch("/v1/me/following",{method:"DELETE",query:{type:"user",ids:e}}),it=(t,e)=>C(t,[e]),v=async(t,e)=>(await t.fetch("/v1/me/following/contains",{query:{type:"artist",ids:e}})).json(),nt=async(t,e)=>(await v(t,[e]))[0],O=async(t,e)=>(await t.fetch("/v1/me/following/contains",{query:{type:"user",ids:e}})).json(),at=async(t,e)=>(await O(t,[e]))[0],S=async(t,e,s)=>(await t.fetch(`/v1/playlists/${s}/followers/contains`,{query:{ids:e}})).json(),pt=async(t,e,s)=>(await S(t,[e],s))[0];var lt=async(t,e,s)=>(await t.fetch("/v1/tracks/"+e,{query:{market:s}})).json(),yt=async(t,e,s)=>(await(await t.fetch("/v1/tracks",{query:{ids:e,market:s}})).json()).tracks,mt=async(t,e)=>(await t.fetch("/v1/me/tracks",{query:e})).json(),A=(t,e)=>t.fetch("/v1/me/tracks",{method:"PUT",query:{ids:e}}),ut=(t,e)=>A(t,[e]),H=(t,e)=>t.fetch("/v1/me/tracks",{method:"DELETE",query:{ids:e}}),gt=(t,e)=>H(t,[e]),j=async(t,e)=>(await t.fetch("/v1/me/tracks/contains",{query:{ids:e}})).json(),Tt=async(t,e)=>(await j(t,[e]))[0],Pt=async(t,e)=>(await(await t.fetch("/v1/audio-features",{query:{ids:e}})).json()).audio_features,dt=async(t,e)=>(await t.fetch("/v1/audio-features/"+e)).json(),ft=async(t,e)=>(await t.fetch("/v1/audio-analysis/"+e)).json(),ht=async(t,e)=>(await t.fetch("/v1/recommendations",{query:e})).json();var wt=async(t,e,s)=>(await t.fetch("/v1/shows/"+e,{query:{market:s}})).json(),xt=async(t,e,s)=>(await(await t.fetch("/v1/shows",{query:{market:s,ids:e}})).json()).shows,kt=async(t,e,s)=>(await t.fetch(`/v1/shows/${e}/episodes`,{query:s})).json(),Ct=async(t,e)=>(await t.fetch("/v1/me/shows",{query:e})).json(),E=(t,e)=>t.fetch("/v1/me/shows",{method:"PUT",query:{ids:e}}),vt=(t,e)=>E(t,[e]),R=(t,e)=>t.fetch("/v1/me/shows",{method:"DELETE",query:{ids:e}}),Ot=(t,e)=>R(t,[e]),I=async(t,e)=>(await t.fetch("/v1/me/shows/contains",{query:{ids:e}})).json(),St=async(t,e)=>(await I(t,[e]))[0];var Ht=async(t,e,s,r)=>{let o=typeof s=="string"?s:Object.entries(s).map(([i,c])=>i==="q"?c:`${i}:${c}`).join(" ");return(await t.fetch("/v1/search",{query:{q:o,type:e,...r}})).json()};var Et=async(t,e,s)=>(await t.fetch("/v1/playlists/"+e,{query:s})).json(),Rt=(t,e,s)=>t.fetch("/v1/playlist/"+e,{method:"PUT",body:s}),It=async(t,e,s)=>(await t.fetch(`/v1/playlists/${e}/tracks`,{query:s})).json(),U=async(t,e,s,r)=>(await t.fetch(`/v1/playlists/${e}/tracks`,{method:"POST",query:{uris:s,position:r}})).json(),Ut=(t,e,s,r)=>U(t,e,[s],r),qt=async(t,e,s)=>(await t.fetch(`/v1/playlists/${e}/tracks`,{method:"PUT",body:s})).json(),_t=async(t,e,s)=>(await t.fetch(`/v1/playlists/${e}/tracks`,{method:"PUT",body:{uris:s}})).json(),q=async(t,e,s,r)=>(await t.fetch(`/v1/playlists/${e}/tracks`,{method:"DELETE",body:{tracks:s.map(a=>({uri:a})),snapshot_id:r}})).json(),Lt=(t,e,s,r)=>q(t,e,[s],r),Ft=async(t,e)=>(await t.fetch("/v1/me/playlists",{query:e})).json(),Gt=async(t,e,s)=>(await t.fetch(`/v1/users/${e}/playlists`,{query:s})).json(),Dt=async(t,e,s)=>(await t.fetch(`/v1/users/${e}/playlists`,{method:"POST",body:s})).json(),$t=async(t,e)=>(await t.fetch("/v1/browse/featured-playlists",{query:e})).json(),Bt=async(t,e,s)=>(await t.fetch(`/v1/browse/categories/${e}/playlists`,{query:s})).json(),Yt=async(t,e)=>(await t.fetch(`/v1/playlists/${e}/images`)).json(),Nt=(t,e,s)=>t.fetch(`/v1/playlists/${e}/images`,{method:"PUT",headers:{"Content-Type":"image/jpeg"},body:s});var Kt=async t=>(await(await t.fetch("/v1/markets")).json()).markets;var Jt=async t=>(await(await t.fetch("/v1/recommendations/available-genre-seeds")).json()).genres;var Wt=async(t,e,s)=>(await t.fetch("/v1/episodes/"+e,{query:{market:s}})).json(),zt=async(t,e,s)=>(await(await t.fetch("/v1/episodes",{query:{market:s,ids:e}})).json()).episodes,Xt=async(t,e)=>(await t.fetch("/v1/me/episodes",{query:e})).json(),_=(t,e)=>t.fetch("/v1/me/episodes",{method:"PUT",query:{ids:e}}),Zt=(t,e)=>_(t,[e]),L=(t,e)=>t.fetch("/v1/me/episodes",{query:{ids:e}}),te=(t,e)=>L(t,[e]),F=async(t,e)=>(await t.fetch("/v1/me/episodes/contains",{query:{ids:e}})).json(),ee=async(t,e)=>(await F(t,[e]))[0];var re=async(t,e,s)=>(await t.fetch("/v1/chapters/"+e,{query:{market:s}})).json(),oe=async(t,e,s)=>(await(await t.fetch("/v1/chapters",{query:{market:s,ids:e}})).json()).chapters;var ne=async(t,e)=>(await(await t.fetch("/v1/browse/categories",{query:e})).json()).categories,ae=async(t,e,s)=>(await t.fetch("/v1/browse/categories/"+e,{query:s})).json();var ce=async(t,e,s)=>(await t.fetch("/v1/audiobooks/"+e,{query:{market:s}})).json(),le=async(t,e,s)=>(await(await t.fetch("/v1/audiobooks",{query:{market:s,ids:e}})).json()).audiobooks,ye=async(t,e,s)=>(await t.fetch(`/v1/audiobooks/${e}/chapters`,{query:s})).json(),me=async(t,e)=>(await t.fetch("/v1/me/audiobooks",{query:e})).json(),G=(t,e)=>t.fetch("/v1/me/audiobooks",{method:"PUT",query:{ids:e}}),ue=(t,e)=>G(t,[e]),D=(t,e)=>t.fetch("/v1/me/audiobooks",{method:"DELETE",query:{ids:e}}),ge=(t,e)=>D(t,[e]),$=async(t,e)=>(await t.fetch("/v1/me/audiobooks/contains",{query:{ids:e}})).json(),Te=async(t,e)=>(await $(t,[e]))[0];var de=async(t,e)=>(await t.fetch("/v1/artists/"+e)).json(),fe=async(t,e)=>(await(await t.fetch("/v1/artists",{query:{ids:e}})).json()).artists,he=async(t,e,s)=>(await t.fetch(`/v1/artists/${e}/albums`,{query:s})).json(),be=async(t,e,s)=>(await(await t.fetch(`/v1/artists/${e}/top-tracks`,{query:{market:s}})).json()).tracks,we=async(t,e)=>(await(await t.fetch(`/v1/artists/${e}/related-artists`)).json()).artists;var ke=async(t,e,s)=>(await t.fetch("/v1/albums/"+e,{query:{market:s}})).json(),Ce=async(t,e,s)=>(await(await t.fetch("/v1/albums",{query:{market:s,ids:e}})).json()).albums,ve=async(t,e,s)=>(await t.fetch(`/v1/albums/${e}/tracks`,{query:s})).json(),Oe=async(t,e)=>(await t.fetch("/v1/me/albums",{query:e})).json(),B=(t,e)=>t.fetch("/v1/me/albums",{method:"PUT",query:{ids:e}}),Se=(t,e)=>B(t,[e]),Y=(t,e)=>t.fetch("/v1/me/albums",{method:"DELETE",query:{ids:e}}),Ae=(t,e)=>Y(t,[e]),N=async(t,e)=>(await t.fetch("/v1/me/albums/contains",{query:{ids:e}})).json(),He=async(t,e)=>(await N(t,[e]))[0],je=async(t,e)=>(await(await t.fetch("/v1/browse/new-releases",{query:e})).json()).albums;export{K as OAUTH_SCOPES,M as SPOTIFY_AUTH_URL,g as SpotifyClient,m as SpotifyError,Ut as addItemToPlaylist,U as addItemsToPlaylist,Rt as changePlaylistDetails,He as checkIfAlbumSaved,N as checkIfAlbumsSaved,Te as checkIfAudiobookSaved,$ as checkIfAudiobooksSaved,ee as checkIfEpisodeSaved,F as checkIfEpisodesSaved,St as checkIfShowSaved,I as checkIfShowsSaved,Tt as checkIfTrackSaved,j as checkIfTracksSaved,nt as checkIfUserFollowsArtist,v as checkIfUserFollowsArtists,pt as checkIfUserFollowsPlaylist,at as checkIfUserFollowsUser,O as checkIfUserFollowsUsers,S as checkIfUsersFollowPlaylist,Dt as createPlaylist,st as followArtist,w as followArtists,Z as followPlaylist,rt as followUser,x as followUsers,ke as getAlbum,ve as getAlbumTracks,Ce as getAlbums,de as getArtist,he as getArtistAlbums,we as getArtistRelatedArtists,be as getArtistTopTracks,ce as getAudiobook,ye as getAudiobookChapters,le as getAudiobooks,Jt as getAvailableGenres,Kt as getAvailableMarkets,ne as getBrowseCategories,ae as getBrowseCategory,Bt as getCategoryPlaylists,re as getChapter,oe as getChapters,V as getCurrentUser,Ft as getCurrentUsersPlaylists,Wt as getEpisode,zt as getEpisodes,$t as getFeaturedPlaylists,et as getFollowedArtists,je as getNewAlbumReleases,Et as getPlaylist,Yt as getPlaylistCoverImage,It as getPlaylistTracks,ht as getRecommendations,Oe as getSavedAlbums,me as getSavedAudiobooks,Xt as getSavedEpisodes,Ct as getSavedShows,mt as getSavedTracks,fe as getSeveralArtists,wt as getShow,kt as getShowEpisodes,xt as getShows,lt as getTrack,dt as getTrackAudioFeatures,yt as getTracks,ft as getTracksAudioAnalysis,Pt as getTracksAudioFeatures,X as getUser,W as getUserTopArtists,P as getUserTopItems,z as getUserTopTracks,Gt as getUsersPlaylists,Lt as removePlaylistItem,q as removePlaylistItems,Ae as removeSavedAlbum,Y as removeSavedAlbums,ge as removeSavedAudiobook,D as removeSavedAudiobooks,te as removeSavedEpisode,L as removeSavedEpisodes,Ot as removeSavedShow,R as removeSavedShows,gt as removeSavedTrack,H as removeSavedTracks,qt as reorderPlaylistItems,_t as replacePlaylistItems,Se as saveAlbum,B as saveAlbums,ue as saveAudiobook,G as saveAudiobooks,Zt as saveEpisode,_ as saveEpisodes,vt as saveShow,E as saveShows,ut as saveTrack,A as saveTracks,Ht as search,ot as unfollowArtist,k as unfollowArtists,tt as unfollowPlaylist,it as unfollowUser,C as unfollowUsers,Nt as uploadPlaylistCoverImage};
var Q="https://accounts.spotify.com/",K={UGC_IMAGE_UPLOAD:"ugc-image-upload",USER_READ_PLAYBACK_STATE:"user-read-playback-state",USER_MODIFY_PLAYBACK_STATE:"user-modify-playback-state",USER_READ_CURRENTLY_PLAYING:"user-read-currently-playing",STREAMING:"streaming",PLAYLIST_READ_PRIVATE:"playlist-read-private",PLAYLIST_READ_COLLABORATIVE:"playlist-read-collaborative",PLAYLIST_MODIFY_PRIVATE:"playlist-modify-private",PLAYLIST_MODIFY_PUBLIC:"playlist-modify-public",USER_FOLLOW_MODIFY:"user-follow-modify",USER_FOLLOW_READ:"user-follow-read",USER_READ_PLAYBACK_POSITION:"user-read-playback-position",USER_TOP_READ:"user-top-read",USER_READ_RECENTLY_PLAYED:"user-read-recently-played",USER_LIBRARY_MODIFY:"user-library-modify",USER_LIBRARY_READ:"user-library-read",USER_READ_EMAIL:"user-read-email",USER_READ_PRIVATE:"user-read-private"};var u=class extends Error{name="SpotifyError";response;body;constructor(e,s,r,i){super(e,i),this.response=s,this.body=r}get url(){return this.response.url}get status(){return this.response.status}},l="application/json",T="Content-Type",f=t=>t===null?null:typeof t=="string"?t:t.error.message+(t.error.reason?` (${t.error.reason})`:""),h=async(t,e)=>{let s=t.url.split("?")[0],r=t.statusText?`${t.status} ${t.statusText} (${s})`:`${t.status} (${s})`,i=null;if(t.body&&t.type!=="opaque")try{i=await t.text();let o=t.headers.get(T);o&&(o===l||o.split(";")[0]===l)&&(i=JSON.parse(i))}catch{}let a=f(i);return a&&(r+=" : "+a),new u(r,t,i,e)},b=t=>typeof t=="object"&&t!==null&&Object.prototype.toString.call(t)==="[object Object]",g=class{constructor(e,s={}){this.accessToken=e;this.options=s;this.baseUrl=s.baseUrl?s.baseUrl:"https://api.spotify.com/"}baseUrl;fetch(e,s={}){let r=new URL(e,this.baseUrl);if(s.query)for(let n in s.query){let p=s.query[n];typeof p<"u"&&r.searchParams.set(n,p.toString())}let i=new Headers(s.headers);i.set("Accept",l);let a=!!s.body&&(b(s.body)||Array.isArray(s.body));a&&i.set(T,l);let o=a?JSON.stringify(s.body):s.body,c=!1,y=async()=>{i.set("Authorization","Bearer "+this.accessToken);let n=await(this.options.middlewares||[]).reduceRight((p,m)=>m(p),this.options.fetch||globalThis.fetch)(r,{...s,body:o,headers:i});if(n.ok)return n;if(n.status===401&&this.options.refresher&&!c)return this.accessToken=await this.options.refresher(),c=!0,y();if(n.status===429){let p=Number(n.headers.get("Retry-After"))||void 0;if(p)return(typeof this.options.waitForRateLimit=="function"?this.options.waitForRateLimit(p):this.options.waitForRateLimit)&&await new Promise(d=>setTimeout(d,p*1e3)),y()}throw await h(n)};return y()}};var W=async t=>(await t.fetch("/v1/me")).json(),P=async(t,e,s)=>(await t.fetch("/v1/me/top/"+e,{query:s})).json(),z=async(t,e)=>await P(t,"artists",e),X=async(t,e)=>await P(t,"tracks",e),Z=async(t,e)=>(await t.fetch("/v1/users/"+e)).json(),tt=async(t,e,s)=>{await t.fetch(`/v1/playlists/${e}/followers`,{method:"PUT",body:{public:s}})},et=async(t,e)=>{await t.fetch(`/v1/playlists/${e}/followers`,{method:"DELETE"})},st=async(t,e)=>(await(await t.fetch("/v1/me/following",{query:{...e,type:"artist"}})).json()).artists,w=(t,e)=>t.fetch("/v1/me/following",{method:"PUT",query:{type:"artist",ids:e}}),rt=(t,e)=>w(t,[e]),k=(t,e)=>t.fetch("/v1/me/following",{method:"PUT",query:{type:"user",ids:e}}),it=(t,e)=>k(t,[e]),v=(t,e)=>t.fetch("/v1/me/following",{method:"DELETE",query:{type:"artist",ids:e}}),ot=(t,e)=>v(t,[e]),C=(t,e)=>t.fetch("/v1/me/following",{method:"DELETE",query:{type:"user",ids:e}}),nt=(t,e)=>C(t,[e]),x=async(t,e)=>(await t.fetch("/v1/me/following/contains",{query:{type:"artist",ids:e}})).json(),at=async(t,e)=>(await x(t,[e]))[0],O=async(t,e)=>(await t.fetch("/v1/me/following/contains",{query:{type:"user",ids:e}})).json(),pt=async(t,e)=>(await O(t,[e]))[0],S=async(t,e,s)=>(await t.fetch(`/v1/playlists/${s}/followers/contains`,{query:{ids:e}})).json(),ct=async(t,e,s)=>(await S(t,[e],s))[0];var yt=async(t,e,s)=>(await t.fetch("/v1/tracks/"+e,{query:{market:s}})).json(),ut=async(t,e,s)=>(await(await t.fetch("/v1/tracks",{query:{ids:e,market:s}})).json()).tracks,mt=async(t,e)=>(await t.fetch("/v1/me/tracks",{query:e})).json(),A=(t,e)=>t.fetch("/v1/me/tracks",{method:"PUT",query:{ids:e}}),gt=(t,e)=>A(t,[e]),H=(t,e)=>t.fetch("/v1/me/tracks",{method:"DELETE",query:{ids:e}}),Tt=(t,e)=>H(t,[e]),j=async(t,e)=>(await t.fetch("/v1/me/tracks/contains",{query:{ids:e}})).json(),Pt=async(t,e)=>(await j(t,[e]))[0],dt=async(t,e)=>(await(await t.fetch("/v1/audio-features",{query:{ids:e}})).json()).audio_features,ft=async(t,e)=>(await t.fetch("/v1/audio-features/"+e)).json(),ht=async(t,e)=>(await t.fetch("/v1/audio-analysis/"+e)).json(),bt=async(t,e)=>(await t.fetch("/v1/recommendations",{query:e})).json();var kt=async(t,e,s)=>(await t.fetch("/v1/shows/"+e,{query:{market:s}})).json(),vt=async(t,e,s)=>(await(await t.fetch("/v1/shows",{query:{market:s,ids:e}})).json()).shows,Ct=async(t,e,s)=>(await t.fetch(`/v1/shows/${e}/episodes`,{query:s})).json(),xt=async(t,e)=>(await t.fetch("/v1/me/shows",{query:e})).json(),R=(t,e)=>t.fetch("/v1/me/shows",{method:"PUT",query:{ids:e}}),Ot=(t,e)=>R(t,[e]),E=(t,e)=>t.fetch("/v1/me/shows",{method:"DELETE",query:{ids:e}}),St=(t,e)=>E(t,[e]),q=async(t,e)=>(await t.fetch("/v1/me/shows/contains",{query:{ids:e}})).json(),At=async(t,e)=>(await q(t,[e]))[0];var jt=async(t,e,s,r)=>{let i=typeof s=="string"?s:Object.entries(s).map(([o,c])=>o==="q"?c:`${o}:${c}`).join(" ");return(await t.fetch("/v1/search",{query:{q:i,type:e,...r}})).json()};var Et=async(t,e,s)=>(await t.fetch("/v1/playlists/"+e,{query:s})).json(),qt=(t,e,s)=>t.fetch("/v1/playlist/"+e,{method:"PUT",body:s}),It=async(t,e,s)=>(await t.fetch(`/v1/playlists/${e}/tracks`,{query:s})).json(),I=async(t,e,s,r)=>(await t.fetch(`/v1/playlists/${e}/tracks`,{method:"POST",query:{uris:s,position:r}})).json(),Ut=(t,e,s,r)=>I(t,e,[s],r),_t=async(t,e,s)=>(await t.fetch(`/v1/playlists/${e}/tracks`,{method:"PUT",body:s})).json(),Lt=async(t,e,s)=>(await t.fetch(`/v1/playlists/${e}/tracks`,{method:"PUT",body:{uris:s}})).json(),U=async(t,e,s,r)=>(await t.fetch(`/v1/playlists/${e}/tracks`,{method:"DELETE",body:{tracks:s.map(a=>({uri:a})),snapshot_id:r}})).json(),Gt=(t,e,s,r)=>U(t,e,[s],r),Ft=async(t,e)=>(await t.fetch("/v1/me/playlists",{query:e})).json(),Dt=async(t,e,s)=>(await t.fetch(`/v1/users/${e}/playlists`,{query:s})).json(),$t=async(t,e,s)=>(await t.fetch(`/v1/users/${e}/playlists`,{method:"POST",body:s})).json(),Bt=async(t,e)=>(await t.fetch("/v1/browse/featured-playlists",{query:e})).json(),Nt=async(t,e,s)=>(await t.fetch(`/v1/browse/categories/${e}/playlists`,{query:s})).json(),Yt=async(t,e)=>(await t.fetch(`/v1/playlists/${e}/images`)).json(),Mt=(t,e,s)=>t.fetch(`/v1/playlists/${e}/images`,{method:"PUT",headers:{"Content-Type":"image/jpeg"},body:s});var Kt=async(t,e={})=>{let s=await t.fetch("/v1/me/player",{query:{market:e.market,additional_types:e.additional_types?.join(",")}});return s.status===204?null:s.json()},Jt=(t,e)=>t.fetch("/v1/me/player",{method:"PUT",body:e}),Vt=async t=>(await(await t.fetch("/v1/me/player/devices")).json()).devices,Wt=async(t,e)=>{let s=await t.fetch("/v1/me/player/currently-playing",{query:e});return s.status===204?null:s.json()},_=(t,e={})=>{let{device_id:s,...r}=e;return t.fetch("/v1/me/player/play",{method:"PUT",body:r,query:{device_id:s}})},zt=_,Xt=(t,e)=>t.fetch("/v1/me/player/pause",{method:"PUT",query:{device_id:e}}),Zt=(t,e)=>t.fetch("/v1/me/player/next",{method:"POST",query:{device_id:e}}),te=(t,e)=>t.fetch("/v1/me/player/previous",{method:"POST",query:{device_id:e}}),ee=(t,e,s)=>t.fetch("/v1/me/player/seek",{method:"PUT",query:{position_ms:e,device_id:s}}),se=(t,e,s)=>t.fetch("/v1/me/player/repeat",{method:"PUT",query:{state:e,device_id:s}}),re=(t,e,s)=>t.fetch("/v1/me/player/shuffle",{method:"PUT",query:{state:e,device_id:s}}),ie=async(t,e)=>(await t.fetch("/v1/me/player/recently-played",{query:e})).json(),oe=async t=>(await t.fetch("/v1/me/player/queue")).json(),ne=(t,e,s)=>t.fetch("/v1/me/player/queue",{method:"POST",query:{uri:e,device_id:s}});var pe=async t=>(await(await t.fetch("/v1/markets")).json()).markets;var le=async t=>(await(await t.fetch("/v1/recommendations/available-genre-seeds")).json()).genres;var ue=async(t,e,s)=>(await t.fetch("/v1/episodes/"+e,{query:{market:s}})).json(),me=async(t,e,s)=>(await(await t.fetch("/v1/episodes",{query:{market:s,ids:e}})).json()).episodes,ge=async(t,e)=>(await t.fetch("/v1/me/episodes",{query:e})).json(),L=(t,e)=>t.fetch("/v1/me/episodes",{method:"PUT",query:{ids:e}}),Te=(t,e)=>L(t,[e]),G=(t,e)=>t.fetch("/v1/me/episodes",{query:{ids:e}}),Pe=(t,e)=>G(t,[e]),F=async(t,e)=>(await t.fetch("/v1/me/episodes/contains",{query:{ids:e}})).json(),de=async(t,e)=>(await F(t,[e]))[0];var he=async(t,e,s)=>(await t.fetch("/v1/chapters/"+e,{query:{market:s}})).json(),be=async(t,e,s)=>(await(await t.fetch("/v1/chapters",{query:{market:s,ids:e}})).json()).chapters;var ke=async(t,e)=>(await(await t.fetch("/v1/browse/categories",{query:e})).json()).categories,ve=async(t,e,s)=>(await t.fetch("/v1/browse/categories/"+e,{query:s})).json();var xe=async(t,e,s)=>(await t.fetch("/v1/audiobooks/"+e,{query:{market:s}})).json(),Oe=async(t,e,s)=>(await(await t.fetch("/v1/audiobooks",{query:{market:s,ids:e}})).json()).audiobooks,Se=async(t,e,s)=>(await t.fetch(`/v1/audiobooks/${e}/chapters`,{query:s})).json(),Ae=async(t,e)=>(await t.fetch("/v1/me/audiobooks",{query:e})).json(),D=(t,e)=>t.fetch("/v1/me/audiobooks",{method:"PUT",query:{ids:e}}),He=(t,e)=>D(t,[e]),$=(t,e)=>t.fetch("/v1/me/audiobooks",{method:"DELETE",query:{ids:e}}),je=(t,e)=>$(t,[e]),B=async(t,e)=>(await t.fetch("/v1/me/audiobooks/contains",{query:{ids:e}})).json(),Re=async(t,e)=>(await B(t,[e]))[0];var qe=async(t,e)=>(await t.fetch("/v1/artists/"+e)).json(),Ie=async(t,e)=>(await(await t.fetch("/v1/artists",{query:{ids:e}})).json()).artists,Ue=async(t,e,s)=>(await t.fetch(`/v1/artists/${e}/albums`,{query:s})).json(),_e=async(t,e,s)=>(await(await t.fetch(`/v1/artists/${e}/top-tracks`,{query:{market:s}})).json()).tracks,Le=async(t,e)=>(await(await t.fetch(`/v1/artists/${e}/related-artists`)).json()).artists;var Fe=async(t,e,s)=>(await t.fetch("/v1/albums/"+e,{query:{market:s}})).json(),De=async(t,e,s)=>(await(await t.fetch("/v1/albums",{query:{market:s,ids:e}})).json()).albums,$e=async(t,e,s)=>(await t.fetch(`/v1/albums/${e}/tracks`,{query:s})).json(),Be=async(t,e)=>(await t.fetch("/v1/me/albums",{query:e})).json(),N=(t,e)=>t.fetch("/v1/me/albums",{method:"PUT",query:{ids:e}}),Ne=(t,e)=>N(t,[e]),Y=(t,e)=>t.fetch("/v1/me/albums",{method:"DELETE",query:{ids:e}}),Ye=(t,e)=>Y(t,[e]),M=async(t,e)=>(await t.fetch("/v1/me/albums/contains",{query:{ids:e}})).json(),Me=async(t,e)=>(await M(t,[e]))[0],Qe=async(t,e)=>(await(await t.fetch("/v1/browse/new-releases",{query:e})).json()).albums;export{K as OAUTH_SCOPES,Q as SPOTIFY_AUTH_URL,g as SpotifyClient,u as SpotifyError,ne as addItemToPlaybackQueue,Ut as addItemToPlaylist,I as addItemsToPlaylist,qt as changePlaylistDetails,Me as checkIfAlbumSaved,M as checkIfAlbumsSaved,Re as checkIfAudiobookSaved,B as checkIfAudiobooksSaved,de as checkIfEpisodeSaved,F as checkIfEpisodesSaved,At as checkIfShowSaved,q as checkIfShowsSaved,Pt as checkIfTrackSaved,j as checkIfTracksSaved,at as checkIfUserFollowsArtist,x as checkIfUserFollowsArtists,ct as checkIfUserFollowsPlaylist,pt as checkIfUserFollowsUser,O as checkIfUserFollowsUsers,S as checkIfUsersFollowPlaylist,$t as createPlaylist,rt as followArtist,w as followArtists,tt as followPlaylist,it as followUser,k as followUsers,Fe as getAlbum,$e as getAlbumTracks,De as getAlbums,qe as getArtist,Ue as getArtistAlbums,Le as getArtistRelatedArtists,_e as getArtistTopTracks,xe as getAudiobook,Se as getAudiobookChapters,Oe as getAudiobooks,Vt as getAvailableDevices,le as getAvailableGenres,pe as getAvailableMarkets,ke as getBrowseCategories,ve as getBrowseCategory,Nt as getCategoryPlaylists,he as getChapter,be as getChapters,Wt as getCurrentPlayingTrack,W as getCurrentUser,Ft as getCurrentUsersPlaylists,ue as getEpisode,me as getEpisodes,Bt as getFeaturedPlaylists,st as getFollowedArtists,Qe as getNewAlbumReleases,Kt as getPlaybackState,Et as getPlaylist,Yt as getPlaylistCoverImage,It as getPlaylistTracks,ie as getRecentPlayedTracks,bt as getRecommendations,Be as getSavedAlbums,Ae as getSavedAudiobooks,ge as getSavedEpisodes,xt as getSavedShows,mt as getSavedTracks,Ie as getSeveralArtists,kt as getShow,Ct as getShowEpisodes,vt as getShows,yt as getTrack,ft as getTrackAudioFeatures,ut as getTracks,ht as getTracksAudioAnalysis,dt as getTracksAudioFeatures,Z as getUser,oe as getUserQueue,z as getUserTopArtists,P as getUserTopItems,X as getUserTopTracks,Dt as getUsersPlaylists,Xt as pausePlayback,Gt as removePlaylistItem,U as removePlaylistItems,Ye as removeSavedAlbum,Y as removeSavedAlbums,je as removeSavedAudiobook,$ as removeSavedAudiobooks,Pe as removeSavedEpisode,G as removeSavedEpisodes,St as removeSavedShow,E as removeSavedShows,Tt as removeSavedTrack,H as removeSavedTracks,_t as reorderPlaylistItems,Lt as replacePlaylistItems,zt as resumePlayback,Ne as saveAlbum,N as saveAlbums,He as saveAudiobook,D as saveAudiobooks,Te as saveEpisode,L as saveEpisodes,Ot as saveShow,R as saveShows,gt as saveTrack,A as saveTracks,jt as search,ee as seekToPosition,se as setRepeatMode,Zt as skipToNext,te as skipToPrevious,_ as startPlayback,re as togglePlaybackShuffle,Jt as transferPlayback,ot as unfollowArtist,v as unfollowArtists,et as unfollowPlaylist,nt as unfollowUser,C as unfollowUsers,Mt as uploadPlaylistCoverImage};

@@ -1,2 +0,2 @@

import { a as PagingOptions, b as PagingObject, P as Prettify } from './general.types-NRI2CuGe.js';
import { a as PagingOptions, b as PagingObject, P as Prettify } from './general.types-QcPI9PCD.js';

@@ -3,0 +3,0 @@ /**

@@ -1,1 +0,1 @@

var c={direction:"next",limit:20,offset:0},o=class{constructor(t,e={}){this.fetcher=t;this.defaults={...c,...e}}defaults;asyncIterator(){return this[Symbol.asyncIterator]()}[Symbol.asyncIterator](){let t=!1,{direction:e,limit:r,offset:i}=this.defaults;return{next:async(s={})=>{if(t)return{done:t,value:[]};r=s.limit??this.defaults.limit,i=s.setOffset?s.setOffset(i):i;let n=await this.fetcher({limit:r,offset:i});return e==="next"&&!n.next||e==="prev"&&!n.previous?(t=!0,{value:n.items,done:!1}):(i=e==="next"?i+r:i-r,{value:n.items,done:t})}}}},a=class{constructor(t,e={}){this.fetcher=t;this.defaults={...c,...e}}defaults;asyncIterator(){return this[Symbol.asyncIterator]()}async*[Symbol.asyncIterator](){let{direction:t,limit:e,offset:r}=this.defaults;for(;;){let i=await this.fetcher({limit:e,offset:r});if(t==="next"&&!i.next||t==="prev"&&!i.previous){let s=i.items.pop();for(let n of i.items)yield n;return s}for(let s of i.items)yield s;r=t==="next"?r+e:r-e}}async collect(){let t=[];for await(let e of this)t.push(e);return t}};export{o as ChunkIterator,a as PageIterator};
var c={direction:"next",limit:20,offset:0},o=class{constructor(t,e={}){this.fetcher=t;this.defaults={...c,...e}}defaults;asyncIterator(){return this[Symbol.asyncIterator]()}[Symbol.asyncIterator](){let t=!1,{direction:e,limit:s,offset:i}=this.defaults;return{next:async(r={})=>{if(t)return{done:t,value:[]};s=r.limit??this.defaults.limit,i=r.setOffset?r.setOffset(i):i;let n=await this.fetcher({limit:s,offset:i});return e==="next"&&!n.next||e==="prev"&&!n.previous?(t=!0,{value:n.items,done:!1}):(i=e==="next"?i+s:i-s,{value:n.items,done:t})}}}},a=class{constructor(t,e={}){this.fetcher=t;this.defaults={...c,...e}}defaults;asyncIterator(){return this[Symbol.asyncIterator]()}async*[Symbol.asyncIterator](){let{direction:t,limit:e,offset:s}=this.defaults;for(;;){let i=await this.fetcher({limit:e,offset:s});if(t==="next"&&!i.next||t==="prev"&&!i.previous){let r=i.items.pop();for(let n of i.items)yield n;return r}for(let r of i.items)yield r;s=t==="next"?s+e:s-e}}async collect(){let t=[];for await(let e of this)t.push(e);return t}};export{o as ChunkIterator,a as PageIterator};
{
"name": "@soundify/web-api",
"version": "1.0.0-rc3",
"version": "1.0.0-rc4",
"description": "🎧 Spotify Web API client for js/ts runtime environments",

@@ -53,4 +53,4 @@ "type": "module",

"scripts": {
"build": "tsup ./src/mod.ts ./src/pagination.ts --format esm,cjs --minify --dts --out-dir dist && rm ./dist/*.d.cts"
"build": "tsup ./mod.ts ./pagination.ts --format esm,cjs --minify --dts --out-dir dist && rm ./dist/*.d.cts"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc