apple-music-web-api
Advanced tools
Comparing version 0.6.1 to 0.6.2
@@ -1,14 +0,14 @@ | ||
import { Song, ListResponse, CatalogSearchResponse } from "./Models"; | ||
import { Playlist } from "./Playlist"; | ||
import { Storefront } from "./Storefront"; | ||
import { AppleMusicSong, AppleMusicListResponse, AppleMusicCatalogSearchResponse } from "./Models"; | ||
import { AppleMusicPlaylist } from "./Playlist"; | ||
import { AppleMusicStorefront } from "./Storefront"; | ||
export declare const initializeAppleMusicApi: (developerToken: string) => { | ||
getMyStorefront: (userToken: string) => Promise<ListResponse<Storefront>>; | ||
getSong: (storefront: string, id: string) => Promise<Song | undefined>; | ||
getSongs: (storefront: string, ids: string[]) => Promise<ListResponse<Song>>; | ||
getSongsByIsrc: (storefront: string, isrc: string) => Promise<ListResponse<Song>>; | ||
getMyStorefront: (userToken: string) => Promise<AppleMusicListResponse<AppleMusicStorefront>>; | ||
getSong: (storefront: string, id: string) => Promise<AppleMusicSong | undefined>; | ||
getSongs: (storefront: string, ids: string[]) => Promise<AppleMusicListResponse<AppleMusicSong>>; | ||
getSongsByIsrc: (storefront: string, isrc: string) => Promise<AppleMusicListResponse<AppleMusicSong>>; | ||
searchSongs: (storefront: string, { query, limit }: { | ||
query: string; | ||
limit: number; | ||
}) => Promise<CatalogSearchResponse>; | ||
getMyPlaylists: (userToken: string) => AsyncIterableIterator<Playlist>; | ||
}) => Promise<AppleMusicCatalogSearchResponse>; | ||
getMyPlaylists: (userToken: string) => AsyncIterableIterator<AppleMusicPlaylist>; | ||
createPlaylist: (userToken: string, attributes: { | ||
@@ -18,3 +18,3 @@ name: string; | ||
}, initialTracks: TrackPayload[]) => Promise<void>; | ||
addTracksToPlaylist: (userToken: string, playlistId: string, tracks: TrackPayload[]) => Promise<ListResponse<any>>; | ||
addTracksToPlaylist: (userToken: string, playlistId: string, tracks: TrackPayload[]) => Promise<AppleMusicListResponse<any>>; | ||
}; | ||
@@ -25,2 +25,4 @@ declare type TrackPayload = { | ||
}; | ||
export {}; | ||
export * from "./Models"; | ||
export * from "./Playlist"; | ||
export * from "./Storefront"; |
@@ -1,5 +0,23 @@ | ||
export declare type Preview = { | ||
export declare type AppleMusicMeta = { | ||
total: number; | ||
}; | ||
export declare type AppleMusicPageResponse<T> = { | ||
next: string; | ||
data: T[]; | ||
meta: AppleMusicMeta; | ||
}; | ||
export declare type AppleMusicListResponse<T> = { | ||
data: T[]; | ||
}; | ||
export declare type AppleMusicCatalogSearchResponse = { | ||
results: { | ||
songs: { | ||
data: AppleMusicSong[]; | ||
}; | ||
}; | ||
}; | ||
export declare type AppleMusicSongPreview = { | ||
url: string; | ||
}; | ||
export declare type Artwork = { | ||
export declare type AppleMusicArtwork = { | ||
width: number; | ||
@@ -14,9 +32,9 @@ height: number; | ||
}; | ||
export declare type PlayParams = { | ||
export declare type AppleMusicPlayParams = { | ||
id: string; | ||
kind: string; | ||
}; | ||
export declare type Attributes = { | ||
previews: Preview[]; | ||
artwork: Artwork; | ||
export declare type AppleMusicSongAttributes = { | ||
previews: AppleMusicSongPreview[]; | ||
artwork: AppleMusicArtwork; | ||
artistName: string; | ||
@@ -32,7 +50,7 @@ url: string; | ||
albumName: string; | ||
playParams: PlayParams; | ||
playParams: AppleMusicPlayParams; | ||
trackNumber: number; | ||
composerName: string; | ||
}; | ||
export declare type Album = { | ||
export declare type AppleMusicAlbum = { | ||
id: string; | ||
@@ -42,7 +60,7 @@ type: string; | ||
}; | ||
export declare type Albums = { | ||
export declare type AppleMusicAlbums = { | ||
href: string; | ||
data: Album[]; | ||
data: AppleMusicAlbum[]; | ||
}; | ||
export declare type Artist = { | ||
export declare type AppleMusicArtist = { | ||
id: string; | ||
@@ -52,26 +70,16 @@ type: string; | ||
}; | ||
export declare type Artists = { | ||
export declare type AppleMusicArtists = { | ||
href: string; | ||
data: Artist[]; | ||
data: AppleMusicArtist[]; | ||
}; | ||
export declare type Relationships = { | ||
albums: Albums; | ||
artists: Artists; | ||
export declare type AppleMusicRelationships = { | ||
albums: AppleMusicAlbums; | ||
artists: AppleMusicArtists; | ||
}; | ||
export declare type Song = { | ||
export declare type AppleMusicSong = { | ||
id: string; | ||
type: string; | ||
href: string; | ||
attributes: Attributes; | ||
relationships: Relationships; | ||
attributes: AppleMusicSongAttributes; | ||
relationships: AppleMusicRelationships; | ||
}; | ||
export declare type ListResponse<T> = { | ||
data: T[]; | ||
}; | ||
export declare type CatalogSearchResponse = { | ||
results: { | ||
songs: { | ||
data: Song[]; | ||
}; | ||
}; | ||
}; |
@@ -1,2 +0,2 @@ | ||
export declare type PlayParams = { | ||
export declare type AppleMusicPlaylistPlayParams = { | ||
id: string; | ||
@@ -6,4 +6,4 @@ kind: string; | ||
}; | ||
export declare type Attributes = { | ||
playParams: PlayParams; | ||
export declare type AppleMusicPlaylistAttributes = { | ||
playParams: AppleMusicPlaylistPlayParams; | ||
canEdit: boolean; | ||
@@ -14,15 +14,7 @@ hasCatalog: boolean; | ||
}; | ||
export declare type Playlist = { | ||
export declare type AppleMusicPlaylist = { | ||
id: string; | ||
type: string; | ||
href: string; | ||
attributes: Attributes; | ||
attributes: AppleMusicPlaylistAttributes; | ||
}; | ||
export declare type Meta = { | ||
total: number; | ||
}; | ||
export declare type PageResponse<T> = { | ||
next: string; | ||
data: T[]; | ||
meta: Meta; | ||
}; |
@@ -1,2 +0,2 @@ | ||
export declare type Attributes = { | ||
export declare type AppleMusicStorefrontAttributes = { | ||
supportedLanguageTags: string[]; | ||
@@ -7,7 +7,7 @@ defaultLanguageTag: string; | ||
}; | ||
export declare type Storefront = { | ||
export declare type AppleMusicStorefront = { | ||
id: string; | ||
type: string; | ||
href: string; | ||
attributes: Attributes; | ||
attributes: AppleMusicStorefrontAttributes; | ||
}; |
{ | ||
"name": "apple-music-web-api", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"description": "Apple Music API SDK for JS", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
51817
412