npm audit fix
This commit is contained in:
Generated
+1687
-1332
File diff suppressed because it is too large
Load Diff
+4
-4
@@ -8,7 +8,7 @@
|
||||
"clean": "rimraf dist",
|
||||
"build": "npm run clean & tsc",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest",
|
||||
"test:watch": "vitest run --watch",
|
||||
"test:coverage": "vitest run --coverage"
|
||||
},
|
||||
"keywords": [],
|
||||
@@ -25,12 +25,12 @@
|
||||
"bcrypt": "^5.1.1",
|
||||
"cors": "^2.8.5",
|
||||
"dotenv": "^16.4.4",
|
||||
"express": "5.0.0",
|
||||
"express": "^5.1.0",
|
||||
"express-rate-limit": "^8.1.0",
|
||||
"jsonwebtoken": "^9.0.2",
|
||||
"mongoose": "^8.8.2",
|
||||
"openweather-api-node": "^3.1.5",
|
||||
"pm2": "^5.4.3",
|
||||
"pm2": "^6.0.10",
|
||||
"rimraf": "^5.0.5",
|
||||
"typescript": "^5.3.3",
|
||||
"ws": "8.17.1"
|
||||
@@ -41,6 +41,6 @@
|
||||
"cross-env": "^7.0.3",
|
||||
"prettier": "^3.2.5",
|
||||
"supertest": "^7.1.4",
|
||||
"vitest": "^2.1.9"
|
||||
"vitest": "^3.2.4"
|
||||
}
|
||||
}
|
||||
|
||||
+4
-17
@@ -50,7 +50,7 @@ export interface SpotifyConfig {
|
||||
scope: string;
|
||||
}
|
||||
|
||||
const matrixStateSchema = new Schema<MatrixState>({
|
||||
const matrixStateSchema = new Schema({
|
||||
global: {
|
||||
mode: {type: String, enum: ['image', 'text', 'idle', 'music', 'clock'], default: 'idle'},
|
||||
brightness: {type: Number, min: 0, max: 100, default: 50},
|
||||
@@ -89,20 +89,20 @@ const matrixStateSchema = new Schema<MatrixState>({
|
||||
},
|
||||
}, {_id: false});
|
||||
|
||||
const spotifyConfigSchema = new Schema<SpotifyConfig>({
|
||||
const spotifyConfigSchema = new Schema({
|
||||
accessToken: {type: String},
|
||||
refreshToken: {type: String},
|
||||
expirationDate: {type: Date},
|
||||
scope: {type: String},
|
||||
}, {_id: false});
|
||||
|
||||
const userConfigSchema = new Schema<UserConfig>({
|
||||
const userConfigSchema = new Schema({
|
||||
isVisible: {type: Boolean, required: true},
|
||||
canBeModified: {type: Boolean, required: true},
|
||||
isAdmin: {type: Boolean, required: true},
|
||||
}, {_id: false});
|
||||
|
||||
const userSchema = new Schema<IUser>({
|
||||
const userSchema = new Schema({
|
||||
name: {type: String, required: true, index: true},
|
||||
password: {type: String, required: true, select: false},
|
||||
uuid: {type: String, required: true, unique: true, index: true},
|
||||
@@ -114,18 +114,6 @@ const userSchema = new Schema<IUser>({
|
||||
}, {
|
||||
optimisticConcurrency: true,
|
||||
timestamps: true,
|
||||
toJSON: {
|
||||
transform(_doc, ret) {
|
||||
delete ret.password;
|
||||
return ret;
|
||||
},
|
||||
},
|
||||
toObject: {
|
||||
transform(_doc, ret) {
|
||||
delete ret.password;
|
||||
return ret;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
userSchema.virtual("id").get(function (this: any) {
|
||||
@@ -148,7 +136,6 @@ async function hashIfNeeded(next: Function, user: any) {
|
||||
}
|
||||
|
||||
userSchema.pre("save", function (next) {
|
||||
// @ts-ignore
|
||||
return hashIfNeeded(next, this);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user