import { getAxiosSpotifyInstance } from './driver' ; import { Show , ShowSimplified , Page , EpisodeSimplified } from './models' ; export const getSeveralShows = async ( ids , params ? ) : Promise < ShowSimplified [ ] > => { const response = await getAxiosSpotifyInstance ( ) . get ( '/shows' , { params : { ids : ids . join ( ',' ) , ... params } , } ) ; return response . data . shows . map ( ( showJson ) => new ShowSimplified ( showJson ) ) ; } ; export const getShow = async ( id , params ? ) : Promise < Show > => { const response = await getAxiosSpotifyInstance ( ) . get ( `/shows/${ id }` , { params , } ) ; return new Show ( response . data ) ; } ; export const getShowEpisodes = async ( id , params ? ) : Promise < Page < EpisodeSimplified > > => { const response = await getAxiosSpotifyInstance ( ) . get ( `/shows/${ id }/episodes` , { params } ) ; return new Page < EpisodeSimplified > ( response . data , EpisodeSimplified ) ; } ;