migrate to esm
This commit is contained in:
1 parent
c2e00375c1
commit
f057807b56
52 files changed
+296
-302
No files matched your search
@@ -1,4 +1,4 @@
|
||||
const mongoose = require("mongoose");
|
||||
import mongoose from "mongoose";
|
||||
|
||||
const AppSettingsSchema = mongoose.Schema(
|
||||
{
|
||||
@@ -78,4 +78,4 @@ const AppSettingsSchema = mongoose.Schema(
|
||||
}
|
||||
);
|
||||
|
||||
module.exports = mongoose.model("AppSettings", AppSettingsSchema);
|
||||
export default mongoose.model("AppSettings", AppSettingsSchema);
|
||||
@@ -1,6 +1,6 @@
|
||||
const mongoose = require("mongoose");
|
||||
const EmailService = require("../../service/emailService");
|
||||
const Notification = require("./Notification");
|
||||
import mongoose from "mongoose";
|
||||
import EmailService from "../../service/emailService.js";
|
||||
import Notification from "./Notification.js";
|
||||
|
||||
/**
|
||||
* Check Schema for MongoDB collection.
|
||||
@@ -73,5 +73,4 @@ const CheckSchema = mongoose.Schema(
|
||||
);
|
||||
|
||||
CheckSchema.index({ createdAt: 1 });
|
||||
|
||||
module.exports = mongoose.model("Check", CheckSchema);
|
||||
export default mongoose.model("Check", CheckSchema);
|
||||
@@ -1,5 +1,4 @@
|
||||
const mongoose = require("mongoose");
|
||||
|
||||
import mongoose from "mongoose";
|
||||
const InviteTokenSchema = mongoose.Schema(
|
||||
{
|
||||
email: {
|
||||
@@ -32,4 +31,4 @@ const InviteTokenSchema = mongoose.Schema(
|
||||
}
|
||||
);
|
||||
|
||||
module.exports = mongoose.model("InviteToken", InviteTokenSchema);
|
||||
export default mongoose.model("InviteToken", InviteTokenSchema);
|
||||
@@ -1,5 +1,4 @@
|
||||
const mongoose = require("mongoose");
|
||||
|
||||
import mongoose from "mongoose";
|
||||
/**
|
||||
* MaintenanceWindow Schema
|
||||
* @module MaintenanceWindow
|
||||
@@ -66,4 +65,4 @@ const MaintenanceWindow = mongoose.Schema(
|
||||
}
|
||||
);
|
||||
|
||||
module.exports = mongoose.model("MaintenanceWindow", MaintenanceWindow);
|
||||
export default mongoose.model("MaintenanceWindow", MaintenanceWindow);
|
||||
@@ -1,5 +1,5 @@
|
||||
const mongoose = require("mongoose");
|
||||
const Notification = require("./Notification");
|
||||
import mongoose from "mongoose";
|
||||
import Notification from "./Notification.js";
|
||||
|
||||
const MonitorSchema = mongoose.Schema(
|
||||
{
|
||||
@@ -60,4 +60,4 @@ const MonitorSchema = mongoose.Schema(
|
||||
}
|
||||
);
|
||||
|
||||
module.exports = mongoose.model("Monitor", MonitorSchema);
|
||||
export default mongoose.model("Monitor", MonitorSchema);
|
||||
@@ -1,5 +1,4 @@
|
||||
const mongoose = require("mongoose");
|
||||
|
||||
import mongoose from "mongoose";
|
||||
const NotificationSchema = mongoose.Schema(
|
||||
{
|
||||
monitorId: {
|
||||
@@ -22,5 +21,4 @@ const NotificationSchema = mongoose.Schema(
|
||||
timestamps: true,
|
||||
}
|
||||
);
|
||||
|
||||
module.exports = mongoose.model("Notification", NotificationSchema);
|
||||
export default mongoose.model("Notification", NotificationSchema);
|
||||
@@ -1,5 +1,4 @@
|
||||
const mongoose = require("mongoose");
|
||||
|
||||
import mongoose from "mongoose";
|
||||
const AuditSchema = mongoose.Schema({
|
||||
id: { type: String, required: true },
|
||||
title: { type: String, required: true },
|
||||
@@ -109,4 +108,4 @@ PageSpeedCheck.pre("save", async function (next) {
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = mongoose.model("PageSpeedCheck", PageSpeedCheck);
|
||||
export default mongoose.model("PageSpeedCheck", PageSpeedCheck);
|
||||
@@ -1,4 +1,4 @@
|
||||
const mongoose = require("mongoose");
|
||||
import mongoose from "mongoose";
|
||||
|
||||
const RecoveryTokenSchema = mongoose.Schema(
|
||||
{
|
||||
@@ -22,4 +22,4 @@ const RecoveryTokenSchema = mongoose.Schema(
|
||||
}
|
||||
);
|
||||
|
||||
module.exports = mongoose.model("RecoveryToken", RecoveryTokenSchema);
|
||||
export default mongoose.model("RecoveryToken", RecoveryTokenSchema);
|
||||
@@ -1,5 +1,4 @@
|
||||
const mongoose = require("mongoose");
|
||||
|
||||
import mongoose from "mongoose";
|
||||
const TeamSchema = mongoose.Schema(
|
||||
{
|
||||
email: {
|
||||
@@ -12,5 +11,4 @@ const TeamSchema = mongoose.Schema(
|
||||
timestamps: true,
|
||||
}
|
||||
);
|
||||
|
||||
module.exports = mongoose.model("Team", TeamSchema);
|
||||
export default mongoose.model("Team", TeamSchema);
|
||||
@@ -1,5 +1,5 @@
|
||||
const mongoose = require("mongoose");
|
||||
const bcrypt = require("bcrypt");
|
||||
import mongoose from "mongoose";
|
||||
import bcrypt from "bcrypt";
|
||||
|
||||
const UserSchema = mongoose.Schema(
|
||||
{
|
||||
@@ -84,4 +84,4 @@ User.init().then(() => {
|
||||
console.log("User model initialized");
|
||||
});
|
||||
|
||||
module.exports = mongoose.model("User", UserSchema);
|
||||
export default mongoose.model("User", UserSchema);
|
||||
Reference in new issue
Block a user