Compare commits
6 Commits
283d7ea4ec
...
1.2.16
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
927aa80398 | ||
|
|
1b31aaf549 | ||
|
|
7e1136acad | ||
|
|
1487f6e1f5 | ||
|
|
8760a3affc | ||
|
|
00dedc1d85 |
9
dist/dataTypes.d.ts
vendored
9
dist/dataTypes.d.ts
vendored
@@ -7,17 +7,20 @@ export declare class Song {
|
||||
title: string;
|
||||
songId: string;
|
||||
image: string;
|
||||
constructor(type: SongType, title: string, songId: string, image: string);
|
||||
inAutoPlay: boolean;
|
||||
constructor(type: SongType, title: string, songId: string, image: string, inAutoPlay: boolean);
|
||||
}
|
||||
export declare class QueuedSong extends Song {
|
||||
listener: string;
|
||||
constructor(type: SongType, title: string, songId: string, image: string, listener: string);
|
||||
inAutoPlay: boolean;
|
||||
constructor(type: SongType, title: string, songId: string, image: string, listener: string, inAutoPlay: boolean);
|
||||
}
|
||||
export declare class PlayingSong extends QueuedSong {
|
||||
length: number;
|
||||
position: number;
|
||||
tags: string[];
|
||||
constructor(type: SongType, title: string, songId: string, image: string, listener: string, length: number, position: number, tags: string[]);
|
||||
inAutoPlay: boolean;
|
||||
constructor(type: SongType, title: string, songId: string, image: string, listener: string, length: number, position: number, tags: string[], inAutoPlay: boolean);
|
||||
}
|
||||
export declare class Playlist {
|
||||
title: string;
|
||||
|
||||
13
dist/dataTypes.js
vendored
13
dist/dataTypes.js
vendored
@@ -22,20 +22,22 @@ var SongType;
|
||||
SongType[SongType["Spotify"] = 1] = "Spotify";
|
||||
})(SongType || (exports.SongType = SongType = {}));
|
||||
var Song = /** @class */ (function () {
|
||||
function Song(type, title, songId, image) {
|
||||
function Song(type, title, songId, image, inAutoPlay) {
|
||||
this.type = type;
|
||||
this.title = title;
|
||||
this.songId = songId;
|
||||
this.image = image;
|
||||
this.inAutoPlay = inAutoPlay;
|
||||
}
|
||||
return Song;
|
||||
}());
|
||||
exports.Song = Song;
|
||||
var QueuedSong = /** @class */ (function (_super) {
|
||||
__extends(QueuedSong, _super);
|
||||
function QueuedSong(type, title, songId, image, listener) {
|
||||
var _this = _super.call(this, type, title, songId, image) || this;
|
||||
function QueuedSong(type, title, songId, image, listener, inAutoPlay) {
|
||||
var _this = _super.call(this, type, title, songId, image, inAutoPlay) || this;
|
||||
_this.listener = listener;
|
||||
_this.inAutoPlay = inAutoPlay;
|
||||
return _this;
|
||||
}
|
||||
return QueuedSong;
|
||||
@@ -43,11 +45,12 @@ var QueuedSong = /** @class */ (function (_super) {
|
||||
exports.QueuedSong = QueuedSong;
|
||||
var PlayingSong = /** @class */ (function (_super) {
|
||||
__extends(PlayingSong, _super);
|
||||
function PlayingSong(type, title, songId, image, listener, length, position, tags) {
|
||||
var _this = _super.call(this, type, title, songId, image, listener) || this;
|
||||
function PlayingSong(type, title, songId, image, listener, length, position, tags, inAutoPlay) {
|
||||
var _this = _super.call(this, type, title, songId, image, listener, inAutoPlay) || this;
|
||||
_this.length = length;
|
||||
_this.position = position;
|
||||
_this.tags = tags;
|
||||
_this.inAutoPlay = inAutoPlay;
|
||||
return _this;
|
||||
}
|
||||
return PlayingSong;
|
||||
|
||||
9
dist/messageTypes.d.ts
vendored
9
dist/messageTypes.d.ts
vendored
@@ -1,5 +1,5 @@
|
||||
import { Song, PlayingSong, QueuedSong, Playlist, PlaylistDescription } from "./dataTypes";
|
||||
export type StuenMessages = ListenerLeft | ListenerList | ListenerJoined | SendChatMessage | SearchSong | SearchSongResult | Join | QueueSong | CurrentQueue | CurrentSong | UnqueueSong | ReorderSong | SkipSong | SongLikes | ToggleSongLike | CreatePlaylist | RemovePlaylist | AddSongToPlaylist | RemoveSongFromPlaylist | Playlists | GetPlaylist | PlaylistSongs | ToggleTag | Shuffle | RemoveFromAutoPlay;
|
||||
export type StuenMessages = ListenerLeft | ListenerList | ListenerJoined | SendChatMessage | SearchSong | SearchSongResult | Join | QueueSong | CurrentQueue | CurrentSong | UnqueueSong | ReorderSong | SkipSong | SongLikes | ToggleSongLike | CreatePlaylist | RemovePlaylist | AddSongToPlaylist | RemoveSongFromPlaylist | Playlists | GetPlaylist | PlaylistSongs | GetOtherPlaylists | ToggleTag | Shuffle | RemoveFromAutoPlay;
|
||||
export declare abstract class StuenMessage {
|
||||
type: string;
|
||||
constructor(type: string);
|
||||
@@ -89,6 +89,13 @@ export declare class PlaylistSongs extends StuenMessage {
|
||||
playlist: Playlist;
|
||||
constructor(playlist: Playlist);
|
||||
}
|
||||
export declare class GetOtherPlaylists extends StuenMessage {
|
||||
constructor();
|
||||
}
|
||||
export declare class OthersPlaylists extends StuenMessage {
|
||||
playlists: PlaylistDescription[];
|
||||
constructor(playlists: PlaylistDescription[]);
|
||||
}
|
||||
export declare class AddSongToPlaylist extends StuenMessage {
|
||||
song: Song;
|
||||
playlist: string;
|
||||
|
||||
20
dist/messageTypes.js
vendored
20
dist/messageTypes.js
vendored
@@ -15,7 +15,7 @@ var __extends = (this && this.__extends) || (function () {
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.RemoveFromAutoPlay = exports.Shuffle = exports.ToggleTag = exports.RemoveSongFromPlaylist = exports.AddSongToPlaylist = exports.PlaylistSongs = exports.GetPlaylist = exports.Playlists = exports.RemovePlaylist = exports.CreatePlaylist = exports.SongLikes = exports.ToggleSongLike = exports.SkipSong = exports.ReorderSong = exports.UnqueueSong = exports.CurrentSong = exports.CurrentQueue = exports.QueueSong = exports.SearchSongResult = exports.SearchSong = exports.ChatMessage = exports.SendChatMessage = exports.ListenerList = exports.ListenerLeft = exports.ListenerJoined = exports.Join = exports.StuenMessage = void 0;
|
||||
exports.RemoveFromAutoPlay = exports.Shuffle = exports.ToggleTag = exports.RemoveSongFromPlaylist = exports.AddSongToPlaylist = exports.OthersPlaylists = exports.GetOtherPlaylists = exports.PlaylistSongs = exports.GetPlaylist = exports.Playlists = exports.RemovePlaylist = exports.CreatePlaylist = exports.SongLikes = exports.ToggleSongLike = exports.SkipSong = exports.ReorderSong = exports.UnqueueSong = exports.CurrentSong = exports.CurrentQueue = exports.QueueSong = exports.SearchSongResult = exports.SearchSong = exports.ChatMessage = exports.SendChatMessage = exports.ListenerList = exports.ListenerLeft = exports.ListenerJoined = exports.Join = exports.StuenMessage = void 0;
|
||||
var StuenMessage = /** @class */ (function () {
|
||||
function StuenMessage(type) {
|
||||
this.type = type;
|
||||
@@ -233,6 +233,24 @@ var PlaylistSongs = /** @class */ (function (_super) {
|
||||
return PlaylistSongs;
|
||||
}(StuenMessage));
|
||||
exports.PlaylistSongs = PlaylistSongs;
|
||||
var GetOtherPlaylists = /** @class */ (function (_super) {
|
||||
__extends(GetOtherPlaylists, _super);
|
||||
function GetOtherPlaylists() {
|
||||
return _super.call(this, 'GetOtherPlaylists') || this;
|
||||
}
|
||||
return GetOtherPlaylists;
|
||||
}(StuenMessage));
|
||||
exports.GetOtherPlaylists = GetOtherPlaylists;
|
||||
var OthersPlaylists = /** @class */ (function (_super) {
|
||||
__extends(OthersPlaylists, _super);
|
||||
function OthersPlaylists(playlists) {
|
||||
var _this = _super.call(this, 'OthersPlaylists') || this;
|
||||
_this.playlists = playlists;
|
||||
return _this;
|
||||
}
|
||||
return OthersPlaylists;
|
||||
}(StuenMessage));
|
||||
exports.OthersPlaylists = OthersPlaylists;
|
||||
var AddSongToPlaylist = /** @class */ (function (_super) {
|
||||
__extends(AddSongToPlaylist, _super);
|
||||
function AddSongToPlaylist(song, playlist) {
|
||||
|
||||
2
dist/parseMessage.js
vendored
2
dist/parseMessage.js
vendored
@@ -51,6 +51,8 @@ function parseMessage(message) {
|
||||
return new messageTypes_1.AddSongToPlaylist(data.song, data.playlist);
|
||||
case 'RemoveSongFromPlaylist':
|
||||
return new messageTypes_1.RemoveSongFromPlaylist(data.song, data.playlist);
|
||||
case 'GetAllPlaylists':
|
||||
return new messageTypes_1.GetOtherPlaylists();
|
||||
case 'ToggleTag':
|
||||
return new messageTypes_1.ToggleTag(data.song, data.tag);
|
||||
case 'Shuffle':
|
||||
|
||||
@@ -23,6 +23,7 @@ export type StuenMessages =
|
||||
| Playlists
|
||||
| GetPlaylist
|
||||
| PlaylistSongs
|
||||
| GetOtherPlaylists
|
||||
| ToggleTag
|
||||
| Shuffle
|
||||
| RemoveFromAutoPlay
|
||||
@@ -153,12 +154,24 @@ export class GetPlaylist extends StuenMessage {
|
||||
super('GetPlaylist');
|
||||
}
|
||||
}
|
||||
|
||||
export class PlaylistSongs extends StuenMessage {
|
||||
constructor(public playlist: Playlist) {
|
||||
super('PlaylistSongs');
|
||||
}
|
||||
}
|
||||
|
||||
export class GetOtherPlaylists extends StuenMessage {
|
||||
constructor() {
|
||||
super('GetOtherPlaylists');
|
||||
}
|
||||
}
|
||||
|
||||
export class OthersPlaylists extends StuenMessage {
|
||||
constructor(public playlists: PlaylistDescription[]) {
|
||||
super('OthersPlaylists');
|
||||
}
|
||||
}
|
||||
export class AddSongToPlaylist extends StuenMessage {
|
||||
constructor(public song: Song, public playlist: string) {
|
||||
super('AddSongToPlaylist');
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "stuen-common",
|
||||
"version": "1.2.11",
|
||||
"version": "1.2.16",
|
||||
"main": "dist/common.js",
|
||||
"type": "commonjs",
|
||||
"types": "dist/common.d.ts",
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
ListenerList,
|
||||
Playlists,
|
||||
PlaylistSongs,
|
||||
GetOtherPlaylists,
|
||||
QueueSong, RemoveFromAutoPlay, RemovePlaylist,
|
||||
RemoveSongFromPlaylist,
|
||||
ReorderSong,
|
||||
@@ -75,6 +76,8 @@ export default function parseMessage(message: string): StuenMessage | null {
|
||||
return new AddSongToPlaylist(data.song, data.playlist);
|
||||
case 'RemoveSongFromPlaylist':
|
||||
return new RemoveSongFromPlaylist(data.song, data.playlist);
|
||||
case 'GetAllPlaylists':
|
||||
return new GetOtherPlaylists();
|
||||
case 'ToggleTag':
|
||||
return new ToggleTag(data.song, data.tag);
|
||||
case 'Shuffle':
|
||||
|
||||
Reference in New Issue
Block a user