Migrated user related sechamas to src/schemas/user/
This commit is contained in:
parent
3eddd0ea5b
commit
3de4bff68d
|
|
@ -17,7 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
||||||
//Local Imports
|
//Local Imports
|
||||||
const channelModel = require('../../schemas/channel/channelSchema');
|
const channelModel = require('../../schemas/channel/channelSchema');
|
||||||
const emoteModel = require('../../schemas/emoteSchema');
|
const emoteModel = require('../../schemas/emoteSchema');
|
||||||
const {userModel} = require('../../schemas/userSchema');
|
const {userModel} = require('../../schemas/user/userSchema');
|
||||||
const loggerUtils = require('../../utils/loggerUtils');
|
const loggerUtils = require('../../utils/loggerUtils');
|
||||||
const activeChannel = require('./activeChannel');
|
const activeChannel = require('./activeChannel');
|
||||||
const chatHandler = require('./chatHandler');
|
const chatHandler = require('./chatHandler');
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ const commandPreprocessor = require('./commandPreprocessor');
|
||||||
const loggerUtils = require('../../utils/loggerUtils');
|
const loggerUtils = require('../../utils/loggerUtils');
|
||||||
const linkUtils = require('../../utils/linkUtils');
|
const linkUtils = require('../../utils/linkUtils');
|
||||||
const emoteValidator = require('../../validators/emoteValidator');
|
const emoteValidator = require('../../validators/emoteValidator');
|
||||||
const {userModel} = require('../../schemas/userSchema');
|
const {userModel} = require('../../schemas/user/userSchema');
|
||||||
|
|
||||||
module.exports = class{
|
module.exports = class{
|
||||||
constructor(server){
|
constructor(server){
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ const channelModel = require('../../schemas/channel/channelSchema');
|
||||||
const permissionModel = require('../../schemas/permissionSchema');
|
const permissionModel = require('../../schemas/permissionSchema');
|
||||||
const flairModel = require('../../schemas/flairSchema');
|
const flairModel = require('../../schemas/flairSchema');
|
||||||
const emoteModel = require('../../schemas/emoteSchema');
|
const emoteModel = require('../../schemas/emoteSchema');
|
||||||
const { userModel } = require('../../schemas/userSchema');
|
const { userModel } = require('../../schemas/user/userSchema');
|
||||||
|
|
||||||
module.exports = class{
|
module.exports = class{
|
||||||
constructor(userDB, chanRank, channel, socket){
|
constructor(userDB, chanRank, channel, socket){
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
||||||
|
|
||||||
//Local Imports
|
//Local Imports
|
||||||
const tokeCommandModel = require('../../schemas/tokebot/tokeCommandSchema');
|
const tokeCommandModel = require('../../schemas/tokebot/tokeCommandSchema');
|
||||||
const {userModel} = require('../../schemas/userSchema');
|
const {userModel} = require('../../schemas/user/userSchema');
|
||||||
const statModel = require('../../schemas/statSchema');
|
const statModel = require('../../schemas/statSchema');
|
||||||
const statSchema = require('../../schemas/statSchema');
|
const statSchema = require('../../schemas/statSchema');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
||||||
|
|
||||||
//Config
|
//Config
|
||||||
const config = require('../../config.json');
|
const config = require('../../config.json');
|
||||||
const {userModel} = require('../schemas/userSchema');
|
const {userModel} = require('../schemas/user/userSchema');
|
||||||
const permissionModel = require('../schemas/permissionSchema');
|
const permissionModel = require('../schemas/permissionSchema');
|
||||||
const channelModel = require('../schemas/channel/channelSchema');
|
const channelModel = require('../schemas/channel/channelSchema');
|
||||||
const {exceptionHandler, errorHandler} = require("../utils/loggerUtils");
|
const {exceptionHandler, errorHandler} = require("../utils/loggerUtils");
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
||||||
const {validationResult, matchedData} = require('express-validator');
|
const {validationResult, matchedData} = require('express-validator');
|
||||||
|
|
||||||
//local imports
|
//local imports
|
||||||
const {userModel} = require('../../../schemas/userSchema');
|
const {userModel} = require('../../../schemas/user/userSchema');
|
||||||
const accountUtils = require('../../../utils/sessionUtils');
|
const accountUtils = require('../../../utils/sessionUtils');
|
||||||
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils');
|
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
||||||
const {validationResult, matchedData} = require('express-validator');
|
const {validationResult, matchedData} = require('express-validator');
|
||||||
|
|
||||||
//local imports
|
//local imports
|
||||||
const passwordResetModel = require('../../../schemas/passwordResetSchema');
|
const passwordResetModel = require('../../../schemas/user/passwordResetSchema');
|
||||||
const sessionUtils = require('../../../utils/sessionUtils');
|
const sessionUtils = require('../../../utils/sessionUtils');
|
||||||
const altchaUtils = require('../../../utils/altchaUtils');
|
const altchaUtils = require('../../../utils/altchaUtils');
|
||||||
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils');
|
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils');
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@ const config = require('../../../../config.json');
|
||||||
const {validationResult, matchedData} = require('express-validator');
|
const {validationResult, matchedData} = require('express-validator');
|
||||||
|
|
||||||
//local imports
|
//local imports
|
||||||
const {userModel} = require('../../../schemas/userSchema');
|
const {userModel} = require('../../../schemas/user/userSchema');
|
||||||
const passwordResetModel = require('../../../schemas/passwordResetSchema');
|
const passwordResetModel = require('../../../schemas/user/passwordResetSchema');
|
||||||
const mailUtils = require('../../../utils/mailUtils');
|
const mailUtils = require('../../../utils/mailUtils');
|
||||||
const altchaUtils = require('../../../utils/altchaUtils');
|
const altchaUtils = require('../../../utils/altchaUtils');
|
||||||
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils');
|
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils');
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@ const config = require('../../../../config.json');
|
||||||
const {validationResult, matchedData} = require('express-validator');
|
const {validationResult, matchedData} = require('express-validator');
|
||||||
|
|
||||||
//local imports
|
//local imports
|
||||||
const {userModel} = require('../../../schemas/userSchema');
|
const {userModel} = require('../../../schemas/user/userSchema');
|
||||||
const userBanModel = require('../../../schemas/userBanSchema');
|
const userBanModel = require('../../../schemas/user/userBanSchema');
|
||||||
const altchaUtils = require('../../../utils/altchaUtils');
|
const altchaUtils = require('../../../utils/altchaUtils');
|
||||||
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils');
|
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
||||||
const {validationResult, matchedData} = require('express-validator');
|
const {validationResult, matchedData} = require('express-validator');
|
||||||
|
|
||||||
//local imports
|
//local imports
|
||||||
const {userModel} = require('../../../schemas/userSchema');
|
const {userModel} = require('../../../schemas/user/userSchema');
|
||||||
const accountUtils = require('../../../utils/sessionUtils');
|
const accountUtils = require('../../../utils/sessionUtils');
|
||||||
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils');
|
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
||||||
const {validationResult, matchedData} = require('express-validator');
|
const {validationResult, matchedData} = require('express-validator');
|
||||||
|
|
||||||
//local imports
|
//local imports
|
||||||
const banModel = require('../../../schemas/userBanSchema');
|
const banModel = require('../../../schemas/user/userBanSchema');
|
||||||
const permissionModel = require('../../../schemas/permissionSchema');
|
const permissionModel = require('../../../schemas/permissionSchema');
|
||||||
const {userModel} = require('../../../schemas/userSchema');
|
const {userModel} = require('../../../schemas/user/userSchema');
|
||||||
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils');
|
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils');
|
||||||
|
|
||||||
module.exports.get = async function(req, res){
|
module.exports.get = async function(req, res){
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ const {validationResult, matchedData} = require('express-validator');
|
||||||
//local imports
|
//local imports
|
||||||
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils');
|
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils');
|
||||||
const permissionModel = require('../../../schemas/permissionSchema');
|
const permissionModel = require('../../../schemas/permissionSchema');
|
||||||
const {userModel} = require('../../../schemas/userSchema');
|
const {userModel} = require('../../../schemas/user/userSchema');
|
||||||
|
|
||||||
//api change rank functions
|
//api change rank functions
|
||||||
module.exports.post = async function(req, res){
|
module.exports.post = async function(req, res){
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
||||||
|
|
||||||
//local imports
|
//local imports
|
||||||
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils');
|
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils');
|
||||||
const {userModel} = require('../../../schemas/userSchema');
|
const {userModel} = require('../../../schemas/user/userSchema');
|
||||||
|
|
||||||
//api list account functions
|
//api list account functions
|
||||||
module.exports.get = async function(req, res){
|
module.exports.get = async function(req, res){
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
||||||
const {validationResult, matchedData} = require('express-validator');
|
const {validationResult, matchedData} = require('express-validator');
|
||||||
|
|
||||||
//local imports
|
//local imports
|
||||||
const {userModel} = require('../../../schemas/userSchema');
|
const {userModel} = require('../../../schemas/user/userSchema');
|
||||||
const passwordResetModel = require("../../../schemas/passwordResetSchema");
|
const passwordResetModel = require("../../../schemas/user/passwordResetSchema");
|
||||||
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils');
|
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils');
|
||||||
|
|
||||||
module.exports.post = async function(req, res){
|
module.exports.post = async function(req, res){
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ const {validationResult, matchedData} = require('express-validator');
|
||||||
|
|
||||||
//local imports
|
//local imports
|
||||||
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils');
|
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils');
|
||||||
const {userModel} = require('../../../schemas/userSchema');
|
const {userModel} = require('../../../schemas/user/userSchema');
|
||||||
const channelModel = require('../../../schemas/channel/channelSchema');
|
const channelModel = require('../../../schemas/channel/channelSchema');
|
||||||
const permissionModel = require('../../../schemas/permissionSchema')
|
const permissionModel = require('../../../schemas/permissionSchema')
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ const {validationResult, matchedData} = require('express-validator');
|
||||||
//local imports
|
//local imports
|
||||||
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils');
|
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils');
|
||||||
const permissionModel = require('../../../schemas/permissionSchema');
|
const permissionModel = require('../../../schemas/permissionSchema');
|
||||||
const {userModel} = require('../../../schemas/userSchema');
|
const {userModel} = require('../../../schemas/user/userSchema');
|
||||||
const channelModel = require('../../../schemas/channel/channelSchema');
|
const channelModel = require('../../../schemas/channel/channelSchema');
|
||||||
|
|
||||||
//api channel rank functions
|
//api channel rank functions
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ const {validationResult, matchedData} = require('express-validator');
|
||||||
|
|
||||||
//local imports
|
//local imports
|
||||||
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils');
|
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils');
|
||||||
const {userModel} = require('../../../schemas/userSchema');
|
const {userModel} = require('../../../schemas/user/userSchema');
|
||||||
const altchaUtils = require('../../../utils/altchaUtils');
|
const altchaUtils = require('../../../utils/altchaUtils');
|
||||||
const channelModel = require('../../../schemas/channel/channelSchema');
|
const channelModel = require('../../../schemas/channel/channelSchema');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
||||||
|
|
||||||
//Local Imports
|
//Local Imports
|
||||||
const {userModel} = require('../schemas/userSchema');
|
const {userModel} = require('../schemas/user/userSchema');
|
||||||
const {exceptionHandler, errorHandler} = require('../utils/loggerUtils');
|
const {exceptionHandler, errorHandler} = require('../utils/loggerUtils');
|
||||||
|
|
||||||
//Config
|
//Config
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
||||||
const {validationResult, matchedData} = require('express-validator');
|
const {validationResult, matchedData} = require('express-validator');
|
||||||
|
|
||||||
//local imports
|
//local imports
|
||||||
const {userModel} = require('../../schemas/userSchema');
|
const {userModel} = require('../../schemas/user/userSchema');
|
||||||
const {exceptionHandler, errorHandler} = require('../../utils/loggerUtils');
|
const {exceptionHandler, errorHandler} = require('../../utils/loggerUtils');
|
||||||
|
|
||||||
//root index functions
|
//root index functions
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ const {validationResult, matchedData} = require('express-validator');
|
||||||
const server = require('../../server');
|
const server = require('../../server');
|
||||||
//DB Models
|
//DB Models
|
||||||
const statModel = require('../statSchema');
|
const statModel = require('../statSchema');
|
||||||
const {userModel} = require('../userSchema');
|
const {userModel} = require('../user/userSchema');
|
||||||
const permissionModel = require('../permissionSchema');
|
const permissionModel = require('../permissionSchema');
|
||||||
const emoteModel = require('../emoteSchema');
|
const emoteModel = require('../emoteSchema');
|
||||||
//DB Schemas
|
//DB Schemas
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
||||||
const {mongoose} = require('mongoose');
|
const {mongoose} = require('mongoose');
|
||||||
|
|
||||||
//Local Imports
|
//Local Imports
|
||||||
const userModel = require('./userSchema');
|
const userModel = require('./user/userSchema');
|
||||||
const channelPermissionSchema = require('./channel/channelPermissionSchema');
|
const channelPermissionSchema = require('./channel/channelPermissionSchema');
|
||||||
const {errorHandler} = require('../utils/loggerUtils');
|
const {errorHandler} = require('../utils/loggerUtils');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
||||||
//However, this is so rarely used the preformance benefits aren't worth the extra clutter
|
//However, this is so rarely used the preformance benefits aren't worth the extra clutter
|
||||||
|
|
||||||
//Config
|
//Config
|
||||||
const config = require('../../config.json');
|
const config = require('../../../config.json');
|
||||||
|
|
||||||
//Node Imports
|
//Node Imports
|
||||||
const crypto = require("node:crypto");
|
const crypto = require("node:crypto");
|
||||||
|
|
@ -27,7 +27,7 @@ const crypto = require("node:crypto");
|
||||||
const {mongoose} = require('mongoose');
|
const {mongoose} = require('mongoose');
|
||||||
|
|
||||||
//Local Imports
|
//Local Imports
|
||||||
const hashUtil = require('../utils/hashUtils');
|
const hashUtil = require('../../utils/hashUtils');
|
||||||
|
|
||||||
const daysToExpire = 7;
|
const daysToExpire = 7;
|
||||||
|
|
||||||
|
|
@ -14,20 +14,22 @@ GNU Affero General Public License for more details.
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
||||||
|
|
||||||
|
//Node Imports
|
||||||
|
const { profile } = require('console');
|
||||||
|
|
||||||
//NPM Imports
|
//NPM Imports
|
||||||
const {mongoose} = require('mongoose');
|
const {mongoose} = require('mongoose');
|
||||||
|
|
||||||
//local imports
|
//local imports
|
||||||
//server
|
//server
|
||||||
const server = require('../server');
|
const server = require('../../server');
|
||||||
//DB Models
|
//DB Models
|
||||||
const statModel = require('./statSchema');
|
const statModel = require('../statSchema');
|
||||||
const flairModel = require('./flairSchema');
|
const flairModel = require('../flairSchema');
|
||||||
const permissionModel = require('./permissionSchema');
|
const permissionModel = require('../permissionSchema');
|
||||||
const emoteModel = require('./emoteSchema');
|
const emoteModel = require('../emoteSchema');
|
||||||
//Utils
|
//Utils
|
||||||
const hashUtil = require('../utils/hashUtils');
|
const hashUtil = require('../../utils/hashUtils');
|
||||||
const { profile } = require('console');
|
|
||||||
|
|
||||||
|
|
||||||
const userSchema = new mongoose.Schema({
|
const userSchema = new mongoose.Schema({
|
||||||
|
|
@ -18,9 +18,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
||||||
const cron = require('node-cron');
|
const cron = require('node-cron');
|
||||||
|
|
||||||
//Local Imports
|
//Local Imports
|
||||||
const {userModel} = require('../schemas/userSchema');
|
const {userModel} = require('../schemas/user/userSchema');
|
||||||
const userBanModel = require('../schemas/userBanSchema');
|
const userBanModel = require('../schemas/user/userBanSchema');
|
||||||
const passwordResetModel = require('../schemas/passwordResetSchema');
|
const passwordResetModel = require('../schemas/user/passwordResetSchema');
|
||||||
const channelModel = require('../schemas/channel/channelSchema');
|
const channelModel = require('../schemas/channel/channelSchema');
|
||||||
const sessionUtils = require('./sessionUtils');
|
const sessionUtils = require('./sessionUtils');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@ You should have received a copy of the GNU Affero General Public License
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
||||||
|
|
||||||
//local imports
|
//local imports
|
||||||
const {userModel} = require('../schemas/userSchema');
|
const {userModel} = require('../schemas/user/userSchema');
|
||||||
const userBanModel = require('../schemas/userBanSchema')
|
const userBanModel = require('../schemas/user/userBanSchema')
|
||||||
const altchaUtils = require('../utils/altchaUtils');
|
const altchaUtils = require('../utils/altchaUtils');
|
||||||
|
|
||||||
//Create failed sign-in cache since it's easier and more preformant to implement it this way than adding extra burdon to the database
|
//Create failed sign-in cache since it's easier and more preformant to implement it this way than adding extra burdon to the database
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue