Socket
Socket
Sign inDemoInstall

apple-music-web-api

Package Overview
Dependencies
4
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.3 to 0.3.0

lib/Storefront.d.ts

6

lib/index.d.ts
import { Song, ListResponse } from "./Song";
import { Playlist } from "./Playlist";
import { Storefront } from "./Storefront";
export declare const initializeAppleMusicApi: (developerToken: string) => AppleMusicApiInterface;

@@ -9,4 +10,5 @@ declare type TrackPayload = {

declare type AppleMusicApiInterface = {
fetchSong: (id: string) => Promise<Song>;
fetchSongs: (ids: string[]) => Promise<ListResponse<Song>>;
fetchSong: (storefront: string, id: string) => Promise<Song>;
fetchSongs: (storefront: string, ids: string[]) => Promise<ListResponse<Song>>;
getMyStorefront: (userToken: string) => Promise<ListResponse<Storefront>>;
fetchLibraryPlaylists: (userToken: string) => AsyncIterableIterator<Playlist>;

@@ -13,0 +15,0 @@ createPlaylist: (userToken: string, attributes: {

@@ -128,10 +128,17 @@ "use strict";

};
var storefront = "us";
var appleMusicApi = function (callApi, pageApi) { return ({
fetchSong: function (id) { return callApi("/v1/catalog/" + storefront + "/songs/" + id); },
fetchSongs: function (ids) {
return callApi("/v1/catalog/" + storefront + "/songs?ids=" + ids
fetchSong: function (storefront, id) {
return callApi("/v1/catalog/" + encodeURIComponent(storefront) + "/songs/" + encodeURIComponent(id));
},
fetchSongs: function (storefront, ids) {
return callApi("/v1/catalog/" + encodeURIComponent(storefront) + "/songs?ids=" + ids
.map(encodeURIComponent)
.join(","));
},
getMyStorefront: function (userToken) {
return callApi("/v1/me/storefront", {
method: "GET",
userToken: userToken
});
},
fetchLibraryPlaylists: function (userToken) {

@@ -138,0 +145,0 @@ return pageApi("/v1/me/library/playlists", { method: "GET", userToken: userToken });

{
"name": "apple-music-web-api",
"version": "0.2.3",
"version": "0.3.0",
"description": "Apple Music API SDK for JS",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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