diff --git a/types/apple-music-api/apple-music-api-tests.ts b/types/apple-music-api/apple-music-api-tests.ts index 6b37900a06..e0fc84fc73 100644 --- a/types/apple-music-api/apple-music-api-tests.ts +++ b/types/apple-music-api/apple-music-api-tests.ts @@ -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', + }, + }, + }, + ], +}; diff --git a/types/apple-music-api/index.d.ts b/types/apple-music-api/index.d.ts index 41345d807d..88458bcaa3 100644 --- a/types/apple-music-api/index.d.ts +++ b/types/apple-music-api/index.d.ts @@ -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 // Useff Chase @@ -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 { data: ResourceType[]; @@ -130,7 +135,7 @@ declare namespace AppleMusicApi { // https://developer.apple.com/documentation/applemusicapi/artist/relationships interface ArtistRelationships { albums: Relationship; - genres: Relationship; + genres?: Relationship; } // https://developer.apple.com/documentation/applemusicapi/album