UNPKG

cody-music

Version:

mac osx spotify and itunes music player controller, spotify audio features, itunes and spotify genre, and playlist control

219 lines 6.59 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SpotifyAuthState = exports.CodyConfig = exports.PlaylistItem = exports.PlaylistTrackInfo = exports.SpotifyAudioFeature = exports.PlayerContext = exports.PlayerDevice = exports.PaginationItem = exports.Album = exports.Artist = exports.Track = exports.CodyResponse = exports.CodyResponseType = exports.TrackStatus = exports.PlayerName = exports.PlayerType = void 0; var PlayerType; (function (PlayerType) { PlayerType["MacItunesDesktop"] = "MacItunesDesktop"; PlayerType["MacSpotifyDesktop"] = "MacSpotifyDesktop"; PlayerType["WindowsSpotifyDesktop"] = "WidowsSpotifyDesktop"; PlayerType["WebSpotify"] = "WebSpotify"; PlayerType["NotAssigned"] = "NotAssigned"; })(PlayerType || (exports.PlayerType = PlayerType = {})); var PlayerName; (function (PlayerName) { PlayerName["SpotifyDesktop"] = "spotify"; PlayerName["SpotifyWeb"] = "spotify-web"; PlayerName["ItunesDesktop"] = "itunes"; })(PlayerName || (exports.PlayerName = PlayerName = {})); var TrackStatus; (function (TrackStatus) { TrackStatus["Playing"] = "playing"; TrackStatus["Paused"] = "paused"; TrackStatus["Advertisement"] = "advertisement"; TrackStatus["NotAssigned"] = "notassigned"; TrackStatus["GrantError"] = "granterror"; })(TrackStatus || (exports.TrackStatus = TrackStatus = {})); var CodyResponseType; (function (CodyResponseType) { CodyResponseType["Success"] = "success"; CodyResponseType["Failed"] = "failed"; })(CodyResponseType || (exports.CodyResponseType = CodyResponseType = {})); class CodyResponse { constructor() { this.status = 200; this.state = CodyResponseType.Success; this.statusText = ""; this.message = ""; this.data = {}; this.error = {}; this.retrySeconds = 0; } } exports.CodyResponse = CodyResponse; // {artist, album, genre, disc_number, duration, played_count, track_number, id, name, state} class Track { constructor() { this.artist = ""; this.artist_names = []; this.genre = ""; this.disc_number = 0; this.duration = 0; this.duration_ms = 0; this.played_count = 0; this.track_number = 0; this.popularity = 0; this.id = ""; this.uri = ""; this.name = ""; this.explicit = false; // href:"https://api.spotify.com/v1/playlists/0mwG8hCL4scWi8Nkt7jyoV/tracks" this.href = ""; // "spotify", "itunes" this.type = ""; this.artists = []; this.playerType = PlayerType.NotAssigned; this.loved = false; this.volume = 0; this.state = TrackStatus.NotAssigned; this.error = ""; this.progress_ms = 0; this.features = new SpotifyAudioFeature(); this.httpStatus = 200; this.played_at = ""; this.played_at_utc_seconds = 0; this.context_uri = ""; this.context_type = ""; } } exports.Track = Track; class Artist { constructor() { this.followers = {}; this.genres = []; this.id = ""; this.uri = ""; this.name = ""; this.images = []; this.popularity = 0; } } exports.Artist = Artist; class Album { constructor() { this.album_type = ""; this.artists = []; this.href = ""; this.id = ""; this.name = ""; this.uri = ""; this.images = []; } } exports.Album = Album; class PaginationItem { constructor() { this.items = []; this.limit = 0; // url to the next page this.next = ""; // url to the previous page this.previous = ""; this.total = 0; this.offset = 0; // } } exports.PaginationItem = PaginationItem; class PlayerDevice { constructor() { this.id = ""; this.is_active = ""; this.is_restricted = false; this.name = ""; this.type = ""; this.volume_percent = 0; } } exports.PlayerDevice = PlayerDevice; class PlayerContext { constructor() { this.timestamp = 0; this.device = new PlayerDevice(); this.progress_ms = ""; this.is_playing = false; this.currently_playing_type = ""; this.actions = null; this.item = null; this.shuffle_state = false; this.repeat_state = ""; this.context = null; } } exports.PlayerContext = PlayerContext; class SpotifyAudioFeature { constructor() { this.danceability = 0; this.energy = 0; this.key = 0; this.loudness = 0; this.mode = 0; this.speechiness = 0; this.acousticness = 0; this.instrumentalness = 0; this.liveness = 0; this.valence = 0; this.tempo = 0; this.id = ""; this.uri = ""; this.track_href = ""; this.analysis_url = ""; this.duration_ms = 0; this.time_signature = 0; } } exports.SpotifyAudioFeature = SpotifyAudioFeature; class PlaylistTrackInfo { constructor() { this.href = ""; this.total = 0; } } exports.PlaylistTrackInfo = PlaylistTrackInfo; class PlaylistItem { constructor() { this.name = ""; this.id = ""; this.uri = ""; this.playlistTypeId = 0; this.collaborative = false; this.public = true; this.tracks = new PlaylistTrackInfo(); this.type = ""; this.itemType = ""; this.playerType = PlayerType.NotAssigned; this.tag = ""; this.tooltip = ""; this.state = TrackStatus.NotAssigned; this.artists = ""; this.command = ""; this.position = 0; this.loved = false; this.played_count = 0; this.popularity = 0; this.artist = ""; this.owner = {}; this.duplicateIds = []; } } exports.PlaylistItem = PlaylistItem; class CodyConfig { constructor() { this.spotifyAccessToken = ""; this.spotifyRefreshToken = ""; this.spotifyClientSecret = ""; this.spotifyClientId = ""; this.enableItunesDesktop = true; this.enableItunesDesktopSongTracking = true; this.enableSpotifyDesktop = true; this.enableSpotifyApi = true; } } exports.CodyConfig = CodyConfig; class SpotifyAuthState { constructor() { this.oauthActivated = false; this.loggedIn = false; } } exports.SpotifyAuthState = SpotifyAuthState; //# sourceMappingURL=models.js.map