|
@@ -1,5 +1,109 @@
|
|
var Schemas = {};
|
|
var Schemas = {};
|
|
|
|
|
|
|
|
+Schemas.FullSong = new SimpleSchema({
|
|
|
|
+ "id": {
|
|
|
|
+ type: String,
|
|
|
|
+ label: "Song YouTube id"
|
|
|
|
+ },
|
|
|
|
+ "mid": {
|
|
|
|
+ type: String,
|
|
|
|
+ label: "Song mid"
|
|
|
|
+ },
|
|
|
|
+ "likes": {
|
|
|
|
+ type: Number,
|
|
|
|
+ label: "Song likes",
|
|
|
|
+ defaultValue: 0
|
|
|
|
+ },
|
|
|
|
+ "dislikes": {
|
|
|
|
+ type: Number,
|
|
|
|
+ label: "Song dislikes",
|
|
|
|
+ defaultValue: 0
|
|
|
|
+ },
|
|
|
|
+ "title": {
|
|
|
|
+ type: String,
|
|
|
|
+ label: "Song title"
|
|
|
|
+ },
|
|
|
|
+ "artist": {
|
|
|
|
+ type: String,
|
|
|
|
+ label: "Song artist"
|
|
|
|
+ },
|
|
|
|
+ "img": {
|
|
|
|
+ type: String,
|
|
|
|
+ label: "Song img"
|
|
|
|
+ },
|
|
|
|
+ "type": {
|
|
|
|
+ type: String,
|
|
|
|
+ label: "Song type",
|
|
|
|
+ defaultValue: "YouTube"
|
|
|
|
+ },
|
|
|
|
+ "duration": {
|
|
|
|
+ type: Number,
|
|
|
|
+ label: "Song duration",
|
|
|
|
+ min: 0,
|
|
|
|
+ decimal: true
|
|
|
|
+ },
|
|
|
|
+ "skipDuration": {
|
|
|
|
+ type: Number,
|
|
|
|
+ label: "Song skipDuration",
|
|
|
|
+ min: 0,
|
|
|
|
+ decimal: true
|
|
|
|
+ }
|
|
|
|
+});
|
|
|
|
+
|
|
|
|
+Schemas.QueueSong = new SimpleSchema({
|
|
|
|
+ "id": {
|
|
|
|
+ type: String,
|
|
|
|
+ label: "Song YouTube id"
|
|
|
|
+ },
|
|
|
|
+ "mid": {
|
|
|
|
+ type: String,
|
|
|
|
+ label: "Song mid"
|
|
|
|
+ },
|
|
|
|
+ "likes": {
|
|
|
|
+ type: Number,
|
|
|
|
+ label: "Song likes",
|
|
|
|
+ defaultValue: 0
|
|
|
|
+ },
|
|
|
|
+ "dislikes": {
|
|
|
|
+ type: Number,
|
|
|
|
+ label: "Song dislikes",
|
|
|
|
+ defaultValue: 0
|
|
|
|
+ },
|
|
|
|
+ "title": {
|
|
|
|
+ type: String,
|
|
|
|
+ label: "Song title"
|
|
|
|
+ },
|
|
|
|
+ "artist": {
|
|
|
|
+ type: String,
|
|
|
|
+ label: "Song artist"
|
|
|
|
+ },
|
|
|
|
+ "img": {
|
|
|
|
+ type: String,
|
|
|
|
+ label: "Song img"
|
|
|
|
+ },
|
|
|
|
+ "type": {
|
|
|
|
+ type: String,
|
|
|
|
+ label: "Song type",
|
|
|
|
+ defaultValue: "YouTube"
|
|
|
|
+ },
|
|
|
|
+ "duration": {
|
|
|
|
+ type: Number,
|
|
|
|
+ label: "Song duration",
|
|
|
|
+ min: 0,
|
|
|
|
+ decimal: true
|
|
|
|
+ },
|
|
|
|
+ "skipDuration": {
|
|
|
|
+ type: Number,
|
|
|
|
+ label: "Song skipDuration",
|
|
|
|
+ min: 0,
|
|
|
|
+ decimal: true
|
|
|
|
+ },
|
|
|
|
+ "songs.$.requestedBy": {
|
|
|
|
+ type: String,
|
|
|
|
+ label: "User ID of the person who requested the song"
|
|
|
|
+ }
|
|
|
|
+});
|
|
|
|
+
|
|
Schemas.Chat = new SimpleSchema({
|
|
Schemas.Chat = new SimpleSchema({
|
|
type: {
|
|
type: {
|
|
type: String,
|
|
type: String,
|
|
@@ -12,7 +116,8 @@ Schemas.Chat = new SimpleSchema({
|
|
},
|
|
},
|
|
rank: {
|
|
rank: {
|
|
type: String,
|
|
type: String,
|
|
- label: "Display tag of the rank of the user who sent a message"
|
|
|
|
|
|
+ label: "Display tag of the rank of the user who sent a message",
|
|
|
|
+ optional: true
|
|
},
|
|
},
|
|
message: {
|
|
message: {
|
|
type: String,
|
|
type: String,
|
|
@@ -65,6 +170,14 @@ Schemas.Room = new SimpleSchema({
|
|
defaultValue: {},
|
|
defaultValue: {},
|
|
label: "Current Song"
|
|
label: "Current Song"
|
|
},
|
|
},
|
|
|
|
+ "currentSong.song": {
|
|
|
|
+ type: Schemas.FullSong,
|
|
|
|
+ label: "Current Song Object"
|
|
|
|
+ },
|
|
|
|
+ "currentSong.started": {
|
|
|
|
+ type: Number,
|
|
|
|
+ label: "Current Song Start Date"
|
|
|
|
+ },
|
|
timePaused: {
|
|
timePaused: {
|
|
type: Number,
|
|
type: Number,
|
|
defaultValue: 0,
|
|
defaultValue: 0,
|
|
@@ -106,62 +219,9 @@ Schemas.Playlist = new SimpleSchema({
|
|
label: "All songs in that playlist"
|
|
label: "All songs in that playlist"
|
|
},
|
|
},
|
|
"songs.$": {
|
|
"songs.$": {
|
|
- type: Object,
|
|
|
|
|
|
+ type: Schemas.FullSong,
|
|
label: "Song object"
|
|
label: "Song object"
|
|
},
|
|
},
|
|
- "songs.$.id": {
|
|
|
|
- type: String,
|
|
|
|
- label: "Song YouTube id"
|
|
|
|
- },
|
|
|
|
- "songs.$.mid": {
|
|
|
|
- type: String,
|
|
|
|
- label: "Song mid"
|
|
|
|
- },
|
|
|
|
- "songs.$.likes": {
|
|
|
|
- type: Number,
|
|
|
|
- label: "Song likes",
|
|
|
|
- defaultValue: 0
|
|
|
|
- },
|
|
|
|
- "songs.$.dislikes": {
|
|
|
|
- type: Number,
|
|
|
|
- label: "Song dislikes",
|
|
|
|
- defaultValue: 0
|
|
|
|
- },
|
|
|
|
- "songs.$.title": {
|
|
|
|
- type: String,
|
|
|
|
- label: "Song title"
|
|
|
|
- },
|
|
|
|
- "songs.$.artist": {
|
|
|
|
- type: String,
|
|
|
|
- label: "Song artist"
|
|
|
|
- },
|
|
|
|
- "songs.$.img": {
|
|
|
|
- type: String,
|
|
|
|
- label: "Song img"
|
|
|
|
- },
|
|
|
|
- "songs.$.type": {
|
|
|
|
- type: String,
|
|
|
|
- label: "Song type",
|
|
|
|
- defaultValue: "YouTube"
|
|
|
|
- },
|
|
|
|
- "songs.$.duration": {
|
|
|
|
- type: Number,
|
|
|
|
- label: "Song duration",
|
|
|
|
- min: 0
|
|
|
|
- },
|
|
|
|
- "songs.$.skipDuration": {
|
|
|
|
- type: Number,
|
|
|
|
- label: "Song skipDuration",
|
|
|
|
- min: 0
|
|
|
|
- },
|
|
|
|
- "songs.$.requestedBy": {
|
|
|
|
- type: String,
|
|
|
|
- label: "User ID of the person who requested the song"
|
|
|
|
- },
|
|
|
|
- "songs.$.approvedBy": {
|
|
|
|
- type: String,
|
|
|
|
- label: "User ID of the person who approved the song"
|
|
|
|
- },
|
|
|
|
lastSong: {
|
|
lastSong: {
|
|
type: Number,
|
|
type: Number,
|
|
label: "Index of the previous song",
|
|
label: "Index of the previous song",
|
|
@@ -180,69 +240,28 @@ Schemas.Queue = new SimpleSchema({
|
|
label: "All songs in that playlist"
|
|
label: "All songs in that playlist"
|
|
},
|
|
},
|
|
"songs.$": {
|
|
"songs.$": {
|
|
- type: Object,
|
|
|
|
|
|
+ type: Schemas.QueueSong,
|
|
label: "Song object"
|
|
label: "Song object"
|
|
- },
|
|
|
|
- "songs.$.id": {
|
|
|
|
- type: String,
|
|
|
|
- label: "Song YouTube id"
|
|
|
|
- },
|
|
|
|
- "songs.$.mid": {
|
|
|
|
- type: String,
|
|
|
|
- label: "Song mid"
|
|
|
|
- },
|
|
|
|
- "songs.$.likes": {
|
|
|
|
- type: Number,
|
|
|
|
- label: "Song likes",
|
|
|
|
- defaultValue: 0
|
|
|
|
- },
|
|
|
|
- "songs.$.dislikes": {
|
|
|
|
- type: Number,
|
|
|
|
- label: "Song dislikes",
|
|
|
|
- defaultValue: 0
|
|
|
|
- },
|
|
|
|
- "songs.$.title": {
|
|
|
|
- type: String,
|
|
|
|
- label: "Song title"
|
|
|
|
- },
|
|
|
|
- "songs.$.artist": {
|
|
|
|
- type: String,
|
|
|
|
- label: "Song artist"
|
|
|
|
- },
|
|
|
|
- "songs.$.img": {
|
|
|
|
- type: String,
|
|
|
|
- label: "Song img"
|
|
|
|
- },
|
|
|
|
- "songs.$.type": {
|
|
|
|
- type: String,
|
|
|
|
- label: "Song type",
|
|
|
|
- defaultValue: "YouTube"
|
|
|
|
- },
|
|
|
|
- "songs.$.duration": {
|
|
|
|
- type: Number,
|
|
|
|
- label: "Song duration",
|
|
|
|
- min: 0
|
|
|
|
- },
|
|
|
|
- "songs.$.skipDuration": {
|
|
|
|
- type: Number,
|
|
|
|
- label: "Song skipDuration",
|
|
|
|
- min: 0
|
|
|
|
- },
|
|
|
|
- "songs.$.requestedBy": {
|
|
|
|
- type: String,
|
|
|
|
- label: "User ID of the person who requested the song"
|
|
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
Schemas.UserProfile = new SimpleSchema({
|
|
Schemas.UserProfile = new SimpleSchema({
|
|
username: {
|
|
username: {
|
|
type: String,
|
|
type: String,
|
|
- label: "User's Username"
|
|
|
|
|
|
+ label: "User's Username",
|
|
|
|
+ regEx: /^[a-zA-Z0-9_]+$/,
|
|
|
|
+ min: 6,
|
|
|
|
+ max: 26
|
|
},
|
|
},
|
|
usernameL: {
|
|
usernameL: {
|
|
type: String,
|
|
type: String,
|
|
label: "User's Username in lowercase",
|
|
label: "User's Username in lowercase",
|
|
- regEx: /^[a-z0-9_]$/
|
|
|
|
|
|
+ regEx: /^[a-z0-9_]+$/
|
|
|
|
+ },
|
|
|
|
+ realname: {
|
|
|
|
+ type: String,
|
|
|
|
+ label: "User's Real Name",
|
|
|
|
+ regEx: /^[A-Za-z0-9 .'-]+$/
|
|
},
|
|
},
|
|
rank: {
|
|
rank: {
|
|
type: String,
|
|
type: String,
|
|
@@ -288,7 +307,8 @@ Schemas.UserProfile = new SimpleSchema({
|
|
Schemas.UserPunishments = new SimpleSchema({
|
|
Schemas.UserPunishments = new SimpleSchema({
|
|
mute: {
|
|
mute: {
|
|
type: Object,
|
|
type: Object,
|
|
- label: "User's Current Mute Info"
|
|
|
|
|
|
+ label: "User's Current Mute Info",
|
|
|
|
+ optional: true
|
|
},
|
|
},
|
|
"mute.mutedBy": {
|
|
"mute.mutedBy": {
|
|
type: String,
|
|
type: String,
|
|
@@ -304,7 +324,8 @@ Schemas.UserPunishments = new SimpleSchema({
|
|
},
|
|
},
|
|
mutes: {
|
|
mutes: {
|
|
type: Array,
|
|
type: Array,
|
|
- label: "All of the mutes of a user"
|
|
|
|
|
|
+ label: "All of the mutes of a user",
|
|
|
|
+ optional: true
|
|
},
|
|
},
|
|
"mutes.$": {
|
|
"mutes.$": {
|
|
type: Object,
|
|
type: Object,
|
|
@@ -324,7 +345,8 @@ Schemas.UserPunishments = new SimpleSchema({
|
|
},
|
|
},
|
|
ban: {
|
|
ban: {
|
|
type: Object,
|
|
type: Object,
|
|
- label: "User's Current Ban Info"
|
|
|
|
|
|
+ label: "User's Current Ban Info",
|
|
|
|
+ optional: true
|
|
},
|
|
},
|
|
"ban.bannedBy": {
|
|
"ban.bannedBy": {
|
|
type: String,
|
|
type: String,
|
|
@@ -340,7 +362,8 @@ Schemas.UserPunishments = new SimpleSchema({
|
|
},
|
|
},
|
|
bans: {
|
|
bans: {
|
|
type: Array,
|
|
type: Array,
|
|
- label: "All of the bans of a user"
|
|
|
|
|
|
+ label: "All of the bans of a user",
|
|
|
|
+ optional: true
|
|
},
|
|
},
|
|
"bans.$": {
|
|
"bans.$": {
|
|
type: Object,
|
|
type: Object,
|
|
@@ -366,7 +389,10 @@ Schemas.User = new SimpleSchema({
|
|
// For accounts-password, either emails or username is required, but not both. It is OK to make this
|
|
// For accounts-password, either emails or username is required, but not both. It is OK to make this
|
|
// optional here because the accounts-password package does its own validation.
|
|
// optional here because the accounts-password package does its own validation.
|
|
// Third-party login packages may not require either. Adjust this schema as necessary for your usage.
|
|
// Third-party login packages may not require either. Adjust this schema as necessary for your usage.
|
|
- optional: true
|
|
|
|
|
|
+ optional: true,
|
|
|
|
+ regEx: /^[a-zA-Z0-9_]+$/,
|
|
|
|
+ min: 6,
|
|
|
|
+ max: 26
|
|
},
|
|
},
|
|
emails: {
|
|
emails: {
|
|
type: Array,
|
|
type: Array,
|
|
@@ -392,7 +418,8 @@ Schemas.User = new SimpleSchema({
|
|
type: Schemas.UserProfile
|
|
type: Schemas.UserProfile
|
|
},
|
|
},
|
|
punishments: {
|
|
punishments: {
|
|
- type: Schemas.UserPunishments
|
|
|
|
|
|
+ type: Schemas.UserPunishments,
|
|
|
|
+ defaultValue: {mutes: [], bans: []}
|
|
},
|
|
},
|
|
// Make sure this services field is in your schema if you're using any of the accounts packages
|
|
// Make sure this services field is in your schema if you're using any of the accounts packages
|
|
services: {
|
|
services: {
|
|
@@ -456,6 +483,4 @@ Chat.attachSchema(Schemas.Chat);
|
|
Playlists.attachSchema(Schemas.Playlist);
|
|
Playlists.attachSchema(Schemas.Playlist);
|
|
Queues.attachSchema(Schemas.Queue);
|
|
Queues.attachSchema(Schemas.Queue);
|
|
Meteor.users.attachSchema(Schemas.User);
|
|
Meteor.users.attachSchema(Schemas.User);
|
|
-Reports.attachSchema(Schemas.Report);
|
|
|
|
-
|
|
|
|
-//Rooms.insert({display: "Test Room", type: "testest"});
|
|
|
|
|
|
+Reports.attachSchema(Schemas.Report);
|