mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
🤖 Merge PR #45468 add apple-music-api ArtistResponse interface by @nchase
* add apple-music-api ArtistResponse interface * add artist response test - make ArtistRelationship genre optional (API doesn't seem to return this, for small sample set of artists) * bump apple-music-api to 0.4
This commit is contained in:
parent
a99e083fa3
commit
0e24e5408e
@ -563,3 +563,34 @@ const PlaylistResponse: AppleMusicApi.PlaylistResponse = {
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const ArtistResponse: AppleMusicApi.ArtistResponse = {
|
||||
data: [
|
||||
{
|
||||
id: '367955316',
|
||||
type: 'artists',
|
||||
href: '/v1/catalog/us/artists/367955316',
|
||||
attributes: {
|
||||
editorialNotes: {
|
||||
short: 'short note',
|
||||
standard: 'elaborated, standard-length note',
|
||||
},
|
||||
genreNames: ['Jazz', 'Rock'],
|
||||
name: 'artist name',
|
||||
url: 'artist/url',
|
||||
},
|
||||
relationships: {
|
||||
albums: {
|
||||
data: [
|
||||
{
|
||||
id: '897072740',
|
||||
type: 'albums',
|
||||
href: '/v1/catalog/us/albums/897072740',
|
||||
},
|
||||
],
|
||||
href: '/v1/catalog/us/songs/897072750/albums',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
9
types/apple-music-api/index.d.ts
vendored
9
types/apple-music-api/index.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
// Type definitions for non-npm package Apple Music API 0.3
|
||||
// Type definitions for non-npm package Apple Music API 0.4
|
||||
// Project: https://developer.apple.com/documentation/applemusicapi/
|
||||
// Definitions by: Noah Chase <https://github.com/nchase>
|
||||
// Useff Chase <https://github.com/useffc>
|
||||
@ -20,6 +20,11 @@ declare namespace AppleMusicApi {
|
||||
data: Playlist[];
|
||||
}
|
||||
|
||||
// https://developer.apple.com/documentation/applemusicapi/artistresponse
|
||||
interface ArtistResponse {
|
||||
data: Artist[];
|
||||
}
|
||||
|
||||
// https://developer.apple.com/documentation/applemusicapi/relationship
|
||||
interface Relationship<ResourceType> {
|
||||
data: ResourceType[];
|
||||
@ -130,7 +135,7 @@ declare namespace AppleMusicApi {
|
||||
// https://developer.apple.com/documentation/applemusicapi/artist/relationships
|
||||
interface ArtistRelationships {
|
||||
albums: Relationship<Album>;
|
||||
genres: Relationship<Genre>;
|
||||
genres?: Relationship<Genre>;
|
||||
}
|
||||
|
||||
// https://developer.apple.com/documentation/applemusicapi/album
|
||||
|
||||
Loading…
Reference in New Issue
Block a user