fixed non-standard schemas

This commit is contained in:
lukew3 2021-05-26 19:18:17 -04:00
parent 12f3b45529
commit 3f1d111dce
2 changed files with 80 additions and 80 deletions

View file

@ -2,25 +2,25 @@ const mongoose = require("mongoose");
const Schema = mongoose.Schema;
const leaderboardEntrySchema = new Schema({
name: String,
wpm: Number,
raw: Number,
acc: Number,
consistency: Number, //can be null
mode: String, //not sure why mode and mode2 are needed
mode2: Number,
timestamp: Date, //Is this the right type?
hidden: Boolean,
name: { type: String },
wpm: { type: Number },
raw: { type: Number },
acc: { type: Number },
consistency: { type: Number }, //can be null
mode: { type: String }, //not sure why mode and mode2 are needed
mode2: { type: Number },
timestamp: { type: Date },
hidden: { type: Boolean },
});
const leaderboardSchema = new Schema(
{
resetTime: Date, //or Number, only on daily lb
size: Number,
resetTime: { type: Date }, //or Number, only on daily lb
size: { type: Number },
board: [{ type: leaderboardEntrySchema }], //contents of leaderbaord
mode: String, //only time for now
mode2: Number, //only 15 and 60 for now
type: String, //global or local
mode: { type: String }, //only equal to 'time' for now
mode2: { type: Number }, //only equal to 15 and 60 for now
type: { type: String }, //global or local
},
{
timestamps: true,

View file

@ -3,76 +3,76 @@ const Schema = mongoose.Schema;
const configSchema = new Schema({
theme: { type: String },
customTheme: Boolean,
customTheme: { type: Boolean },
customThemeColors: [{ type: String }],
favThemes: [{ type: String }],
showKeyTips: Boolean,
showLiveWpm: Boolean,
showTimerProgress: Boolean,
smoothCaret: Boolean,
quickTab: Boolean,
punctuation: Boolean,
numbers: Boolean,
words: Number,
time: Number,
mode: String,
showKeyTips: { type: Boolean },
showLiveWpm: { type: Boolean },
showTimerProgress: { type: Boolean },
smoothCaret: { type: Boolean },
quickTab: { type: Boolean },
punctuation: { type: Boolean },
numbers: { type: Boolean },
words: { type: Number },
time: { type: Number },
mode: { type: String },
quoteLength: [{ type: Number }], //not sure why this is an array
language: String,
fontSize: Number,
freedomMode: Boolean,
difficulty: String,
blindMode: Boolean,
quickEnd: Boolean,
caretStyle: String,
paceCaretStyle: String,
flipTestColors: Boolean,
capsLockBackspace: Boolean,
layout: String,
confidenceMode: String,
indicateTypos: Boolean,
timerStyle: String,
colorfulMode: Boolean,
randomTheme: String, //feels like this should be a boolean
timerColor: String,
timerOpacity: String, //maybe should be a number
stopOnError: String,
showAllLines: Boolean,
keymapMode: String,
keymapStyle: String,
keymapLegendStyle: String,
keymapLayout: String,
fontFamily: String,
smoothLineScroll: Boolean,
alwaysShowDecimalPlaces: Boolean,
alwaysShowWordsHistory: Boolean,
singleListCommandLine: String,
playSoundOnError: Boolean,
playSoundOnClick: String,
startGraphsAtZero: Boolean,
swapEscAndTab: Boolean,
showOutOfFocusWarning: Boolean,
paceCaret: String,
paceCaretCustomSpeed: Number,
pageWidth: String,
chartAccuracy: Boolean,
chartStyle: String,
minWpm: String,
minWpmCustomSpeed: Number,
highlightMode: String,
alwaysShowCPM: Boolean,
enableAds: String,
hideExtraLetters: Boolean,
strictSpace: Boolean,
minAcc: String,
minAccCustom: Number,
showLiveAcc: Boolean,
monkey: Boolean,
repeatQuotes: String,
oppositeShiftMode: String,
customBackground: String,
customBackgroundSize: String,
language: { type: String },
fontSize: { type: Number },
freedomMode: { type: Boolean },
difficulty: { type: String },
blindMode: { type: Boolean },
quickEnd: { type: Boolean },
caretStyle: { type: String },
paceCaretStyle: { type: String },
flipTestColors: { type: Boolean },
capsLockBackspace: { type: Boolean },
layout: { type: String },
confidenceMode: { type: String },
indicateTypos: { type: Boolean },
timerStyle: { type: String },
colorfulMode: { type: Boolean },
randomTheme: { type: String }, //feels like this should be a boolean
timerColor: { type: String },
timerOpacity: { type: String }, //maybe should be a number
stopOnError: { type: String },
showAllLines: { type: Boolean },
keymapMode: { type: String },
keymapStyle: { type: String },
keymapLegendStyle: { type: String },
keymapLayout: { type: String },
fontFamily: { type: String },
smoothLineScroll: { type: Boolean },
alwaysShowDecimalPlaces: { type: Boolean },
alwaysShowWordsHistory: { type: Boolean },
singleListCommandLine: { type: String },
playSoundOnError: { type: Boolean },
playSoundOnClick: { type: String },
startGraphsAtZero: { type: Boolean },
swapEscAndTab: { type: Boolean },
showOutOfFocusWarning: { type: Boolean },
paceCaret: { type: String },
paceCaretCustomSpeed: { type: Number },
pageWidth: { type: String },
chartAccuracy: { type: Boolean },
chartStyle: { type: String },
minWpm: { type: String },
minWpmCustomSpeed: { type: Number },
highlightMode: { type: String },
alwaysShowCPM: { type: Boolean },
enableAds: { type: String },
hideExtraLetters: { type: Boolean },
strictSpace: { type: Boolean },
minAcc: { type: String },
minAccCustom: { type: Number },
showLiveAcc: { type: Boolean },
monkey: { type: Boolean },
repeatQuotes: { type: String },
oppositeShiftMode: { type: String },
customBackground: { type: String },
customBackgroundSize: { type: String },
customBackgroundFilter: [{ type: Number }],
customLayoutfluid: String,
customLayoutfluid: { type: String },
});
module.exports = { configSchema };