diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..9bd8333d --- /dev/null +++ b/.gitignore @@ -0,0 +1,35 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +*/node_modules +node_modules +*/.pnp +*.pnp.js + +# testing +*/coverage + +# production +*/build + + +gcp-service-account-key.json +# testing prod +# cloudbuild.test.yaml + +# misc +.DS_Store +.env +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +*/.env +.env + +gcp-service-account-key.json diff --git a/G06_Report.pdf b/G06_Report.pdf new file mode 100644 index 00000000..9a635d23 Binary files /dev/null and b/G06_Report.pdf differ diff --git a/README.md b/README.md index 726ba36b..c65a883b 100644 --- a/README.md +++ b/README.md @@ -1 +1,98 @@ -# AssignmentTemplate \ No newline at end of file +[![Review Assignment Due Date](https://classroom.github.com/assets/deadline-readme-button-24ddc0f5d75046c5622901739e7c5dd533143b0c8e959d652212380cedb1ea36.svg)](https://classroom.github.com/a/6BOvYMwN) + +# 👋 Welcome to PeerPrep! 👋 + + Hello and welcome to the GitHub repository for PeerPrep, a collaborative platform dedicated to empowering and connecting learners from around the globe! This is done by Group G06 for CS3219 in AY23/24 Semester 1! + +### What is PeerPrep? +PeerPrep is an innovative platform designed to enhance your learning journey through collaborative preparation. Whether you're gearing up for exams, mastering a new subject, or simply quenching your thirst for knowledge, PeerPrep is here to make the process interactive, effective, and enjoyable. + +Check out our deployment of the code on [GCP](https://fe-a2rwifv3ta-dt.a.run.app/)! + +--- + +> **[ IMPORTANT FOR NUS CONNECTIONS!]**\ +> If you are connected to the NUS Campus Network (either directly or indirectly), you will not be able to connect to MongoDB Atlas and Google Cloud SQL, which is required by our application. You can circumvent this by going through a VPN. + +# Application Installation and Setup + +Click for instructions for the respective modes: + +- [Running Locally](docs/RunningLocally.md) +- [Running on Docker](docs/RunningOnDocker.md) + +# Resources for Developer / Tester + +## Software + +For development, you may also want to install or subscribe to: + +- [Docker Desktop](https://www.docker.com/get-started/) +- [Postman](https://www.postman.com/downloads/) +- [MySQLWorkBench](https://dev.mysql.com/downloads/workbench/) +- [NodeJS](https://nodejs.org/en/download) +- [MySQL](https://dev.mysql.com/downloads/mysql/) +- [OneCompiler on RapidAPI](https://rapidapi.com/onecompiler-onecompiler-default/api/onecompiler-apis/) + +## Documentation + +- [API Endpoints](docs/APIEndpoints.md) + +## Microservices +These are the microservices we defined for our application. Each microservice is a separate folder. You can start individual services separately to test, but there are dependencies among the services, they might not function as expected on it's own. + +- [User Service](user-service) +- [Matching Service](matching-service) +- [Question Service](question-service) +- [Frontend](frontend) + +To run User-Service +1. `cd user-service` +2. `npm install` +3. `nodemon server.js` + +To run Matching-Service +1. `cd matching-service` +2. `npm install` +3. `nodemon server.js` + +To run Question-Service +1. `cd question-service` +2. `npm install` +3. `nodemon server.js` + +To run Frontend +1. `cd frontend` +2. `npm install` +3. `npm start` + +--- + +
+ {errorCode === '401' ? `${error.message} ${countdown} seconds.` : error.message} +
++ has never been easier +
+/g, ''); + return wrappedContent; + } + + // Set default code in space after match according to language + useEffect(() => { + if (language == 'python') { + setCode("# " + code); + } else { + setCode("// " + code); + } + setFileName("index" + fileExtensions[language]); + }, [language]); + + // Set default code in space after match according to language + useEffect(() => { + + }, [ranCodeStatus, ranCodeException, ranCodeOutput, ranCodeError, ranCodeExecutionTime, ranCodeInput, code]); + + + // Inside your component + useEffect(() => { + if (submitFlag && socket) { + // Emit a "submitSession" event to the server with the updated code + socket.emit('submitSession', roomId, questionId, questionDifficulty); + + closeSubmitRequestDialog(); + + saveSessionHistory(questionId, questionDifficulty); + + // alert("You have submitted the session."); + navigate("/matching"); + + // Reset the submitFlag after submission + setSubmitFlag(false); + } + }, [code, roomId, questionId, questionDifficulty, submitFlag]); // This effect will run whenever 'code' changes + + + + useEffect(() => { + // Handle all socket events listened from server + if (socket) { + const matchedSocket = socket; + // Below change then wont work properly + // const matchedSocket = io(MATCHING_SERVICE_CORS, {query: { roomId }}); + + // Handle for initial connection event from server + matchedSocket.on('connect', () => { + // Emit the "userConnected" event when the socket connects + matchedSocket.emit('userConnected', socketId, roomId); + // Emit the "joinRoom" event when the socket connects + matchedSocket.emit('joinRoom', roomId); + }); + + // Listen for 'codeChange' events from the server + matchedSocket.on('codeChange', (newCode: string) => { + setCode(newCode); // Update the value with the new code + }); + + // Listen for 'receive message' events from the server + matchedSocket.on('receiveMessage', (data) => { + setMessageList((list) => [...list, data]); // Update the selected language + }); + + // Listen for 'userTyping' events from the server + matchedSocket.on('userTyping', (isTyping) => { + setIsTyping(isTyping); + }); + + // Listen for 'userConnected' and 'userDisconnected' events from the server + matchedSocket.on('userConnected', (connectedSocket) => { + setIsAccessAllowed(true); + + if (connectedSocket !== socketId) { + // Send a message to the chat when another user connects + const messageData: ChatMessage = { + roomId: roomId !== undefined ? roomId : "0", // Make sure roomId is always defined + author: 'System', + message: `A user has connected`, + time: new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) + }; + setMessageList((list) => [...list, messageData]); + } + }); + + matchedSocket.on('sessionEnded', () => { + alert('The session has ended'); + setHasQuitRoom(true); + navigate("/matching"); + + return () => { + matchedSocket.off("sessionEnded"); + }; + }) + + matchedSocket.on('quitSession', () => { + setOtherUserQuit(true); + openQuitDialog(); // Open the confirmation dialog + }); + + matchedSocket.on('requestSubmitSession', () => { + openSubmitRequestDialog(); + }); + + // Handle submission request rejection + matchedSocket.on('rejectSubmitRequest', () => { + setSubmissionRequestPending(false); // Set submission request as not pending + closeSubmitDialog(); + closeSubmitRequestDialog(); // Close the submission request dialog + setSubmissionRejectedMessage("The submission request has been rejected."); + setIsRejectedDialogOpen(true); + }); + + // Set submit flag to true and submits via onEffect + matchedSocket.on('submitSession', () => { + setSubmitFlag(true); + + return () => { + matchedSocket.off("submitSession"); + }; + }) + + // Handle user run code + matchedSocket.on('codeRun', (ranCodeParams) => { + setRanCodeStatus(ranCodeParams[0]); + setRanCodeException(ranCodeParams[1]); + setRanCodeOutput(ranCodeParams[2]); + setRanCodeError(ranCodeParams[3]); + setRanCodeInput(ranCodeParams[4]); + setRanCodeExecutionTime(ranCodeParams[5]); + }) + + // Handle disconnection event + matchedSocket.on('userDisconnected', (roomId) => { + + // Send a message to the chat when a user disconnects + const messageData: ChatMessage = { + roomId: roomId !== undefined ? roomId : "0", // Make sure roomId is always defined + author: 'System', + message: `A user has disconnected`, + time: new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) + }; + setHasQuitRoom(true); + setMessageList((list) => [...list, messageData]); + + setOtherUserQuit(true); + openQuitDialog(); // Open the confirmation dialog + + return () => { + matchedSocket.off('userDisconnected', (roomId)) + }; + }); + + // Listen for 'accessDenied' events from server indicating an unauthorised (but logged in) user trying to access a room they are not matched/allowed in + matchedSocket.on('accessDenied', (message) => { + setIsAccessAllowed(false); + alert(message); + navigate("/matching"); + }); + + fetchData(); + + return () => { + matchedSocket.disconnect(); + }; + } + }, [roomId]); + + /////////////////// SET UP EVENT HANDLERS /////////////////// + + // On change handlers + const handleNewMessageChange = (e: any) => { + setNewMessage(e.target.value); + // Clear the previous typing timer + clearTimeout(typingTimer); + // Set a new timer to indicate typing after a delay + typingTimer = setTimeout(() => { + // Emit "user typing" event to the server + if (socket) { + socket.emit('userTyping', roomId, false); + } + }, 1000); // Adjust the delay as needed + }; + + const handleStartTyping = () => { + // Emit "user typing" event to the server + if (socket) { + socket.emit('userTyping', roomId, true); + } + }; + + const handleSendMessage = () => { + if (newMessage !== '') { + const messageData = { + roomId: roomId, + author: socketId, + message: newMessage, + time: new Date().toLocaleTimeString([], { + hour: '2-digit', + minute: '2-digit', + }), + }; + + if (socket) { + socket.emit('sendMessage', messageData); + } + // Clear the input field + setNewMessage(''); + } + }; + + // Handle quit session logic + const handleQuitSession = () => { + if (socket) { + // Emit a "quitSession" event to the server + socket.emit('quitSession', roomId); + } + // alert('You have quit the session'); + navigate("/matching"); + }; + + // Handle submit session logic + const handleSubmitSession = () => { + setSubmitFlag(true); + }; + + // Handle request submit session logic + const handleRequestSubmitSession = () => { + if (socket) { + // Emit a "submitSession" event to the server + socket.emit('requestSubmitSession', roomId, questionId, questionDifficulty, otherUserQuit); + } + setSubmissionRequestPending(true); + }; + + const handleRejectSubmitRequest = () => { + if (socket) { + // Emit a "rejectSubmitRequest" event to the server + socket.emit('rejectSubmitRequest', roomId); + } + setSubmissionRequestPending(false); // Set submission request as not pending + closeSubmitRequestDialog(); // Close the submission request dialog + + // Set the rejection message + setSubmissionRequestRejected(true); + }; + + // Handle submit session on timer end logic + const handleSubmitOnTimerEndSession = () => { + if (socket) { + // Emit a "submitSession" event to the server + socket.emit('submitIndividualSession', roomId, questionId, questionDifficulty); + } + saveSessionHistory(questionId, questionDifficulty); + // alert("You have submitted the session."); + navigate("/matching"); + }; + + const handleRunCode = () => { + // Fixed default code + const input = ""; + runCode(code, input, language, fileName); + }; + + // Handle code change events + const onChange = React.useCallback((code: string, viewUpdate: any) => { + setCode(code); + // Emit the 'codeChange' event to the server only if it's a change by this client + if (socket) { + socket.emit('codeChange', code, roomId); // Pass roomId or any identifier + } + }, [socket, roomId]); + + const fetchData = async () => { + // Check if the room is active + try { + const response = await fetch(MATCHING_SERVICE_CORS + `/api/room/${roomId}`); + if (response.ok) { + const data = await response.json(); + setQuestion(data); + setQuestiondId(data._id); + setQuestiondDifficulty(data.difficulty); + } else { + console.error('Error fetching room data:', response.status); + navigate("/404"); // Redirect to the 404 error page + } + } catch (error) { + // Room is not active and the 404 page is shown + console.error('Error fetching room data:', error); + navigate("/404"); // Redirect to the 404 error page + } + }; + + // Call api to run code + const runCode = async (code: string, input: string, language: string, fileName: string) => { + try { + const response = await runcode(code, input, language, fileName); + + const data = response.data.message[0]; + const updatedStatus = data.status; + const updatedException = data.exception; + const updatedOutput = data.stdout; + const updatedError = data.stderr; + const updatedInput = data.stdin; + const updatedExecutionTime = data.executionTime + "ms"; + + setRanCodeStatus(updatedStatus); + setRanCodeException(updatedException); + setRanCodeOutput(updatedOutput); + setRanCodeError(updatedError); + setRanCodeInput(updatedInput); + setRanCodeExecutionTime(updatedExecutionTime); + + if (socket) { + const ranCodeParams = [updatedStatus, updatedException, updatedOutput, updatedError, updatedInput, updatedExecutionTime]; + socket.emit('codeRun', roomId, ranCodeParams); + } + } catch (error) { + setRanCodeStatus("failed"); + setRanCodeError("Error in code execution"); + + if (socket) { + const ranCodeParams = ["failed", null, null, "Error in code execution", null, null]; + socket.emit('codeRun', roomId, ranCodeParams); + } + } + }; + + // Set the code syntax + const getCodeMirrorExtensions = () => { + switch (language) { + case 'python': + return [langs.python()]; + case 'java': + return [langs.java()]; + default: + return [javascript()]; // Default to JavaScript if none selected + } + }; + + + const saveSessionHistory = (questionId: string, questionDifficulty: string) => { + addHistory(questionId, questionDifficulty, code).then( + (response) => { + setMessage(response.data.message); + }, + (error) => { + const resMessage = + (error.response && + error.response.data && + error.response.data.message) || + error.message || + error.toString(); + } + ); + }; + + /////////////////// HANDLE FRONTEND COMPONENTS /////////////////// + return ( ++ + {/* Header */} ++ ); +}; + +export default CodeSpace; diff --git a/frontend/src/pages/Matching/Matching.tsx b/frontend/src/pages/Matching/Matching.tsx new file mode 100644 index 00000000..3fe81008 --- /dev/null +++ b/frontend/src/pages/Matching/Matching.tsx @@ -0,0 +1,300 @@ +import React, { useState, useEffect } from 'react'; +import { socket } from './socket'; +import { Socket } from 'socket.io-client'; +import { useNavigate } from 'react-router-dom'; +import '../../css/Matching.css'; +import { iconCategories } from '../../components/Matching/TopicIcons'; +import { getCurrentUser } from '../../utils/auth.service'; + +// Cast the socket to the CustomSocket type +const customSocket = socket as CustomSocket; + +// Define a custom interface that extends the Socket interface +interface CustomSocket extends Socket { + timerId?: NodeJS.Timer | null; +} + +const Matchmaking: React.FC = () => { + const [matchStatus, setMatchStatus] = useState+ {/* Logo */} ++ {/* End of Header */} + ++ ++ + {/* Timer */} ++ {formattedTime} ++ + {/* Buttons */} ++ + {/* Run Button */} + + + {/* Submit Button */} + + + {/* Quit Button */} + + ++
+ + {/* Container Space (Question, Execution, Code, Chat) */} ++ {/* Left Side (Question and Code Execution) */} ++ {/* End of Peer Prep Space (Question, Execution, Code, Chat) */} + + {/* Quit Session Dialog/Modal */} ++ + {/* Question */} ++ + {/* Right Side (Code Mirror and Chat) */} +++ + {/* Code Execution Output */} ++ {/* Header */} +++ Question ++ + {question !== null ? ( ++ {/* Title */} ++ ) : ( + /* Question Loader */ +++ + {/* Tags */} ++ {question.title} +
+++ + {/* Line */} +{difficulty}+{topic}+
+
+ + {/* Wrap Question Content */} ++++ ++++ )} ++ ++++++ ++ Console +++++ {ranCodeExecutionTime} ++ {ranCodeStatus == "" ? null : ( + !ranCodeError && ranCodeStatus == "success" ? ( + + ) : ( + + ) + )} ++ {/* Show error only if there is an error found */} + {ranCodeStatus == "" ? null : ( + ranCodeError ? ( ++++ ) : ( +Error:
+{ranCodeError}
+++ ) + )} +Output:
+{ranCodeOutput}
++++ {/* Code Mirror and Chat */} ++ + {/* Chat UI */} ++++ Code ({fileName}) +++ +++++ Chat +++++ {messageList.map((messageContent, index) => ( + +++ ))} ++ {socketId === messageContent.author ? ( + + ) : "System" === messageContent.author ? ( + <>> + ) : ( + + )} +++++++ {messageContent.message} +++ {messageContent.time} +++ { + if (event.key === 'Enter') { + handleSendMessage(); + } else { + handleStartTyping(); + } + }} + /> + {isTyping &&+Typing...} +++ + {/* Submit Request Dialog/Modal */} +++++++ {/* Quit Session Message */} +{"Confirm Quit"}
+ ++ {otherUserQuit ? ( ++The other user has left the session. Do you want to leave the session?
+ ) : ( +Are you sure you want to quit this session?
+ )} ++ + ++++ + {/* Submit Session Dialog/Modal */} +++++++Submit Request
+ +++The other user has requested to submit the session. Do you accept?
++ + ++++ + {/* Submit Request Rejected Dialog/Modal */} +++++++Confirm Submission
+ ++ {submissionRequestPending ? ( ++ {!submissionRequestPending ? ( +Submission request is pending. Waiting for the other user's response...
+ ) : ( +Are you sure you want to submit this session?
+ )} ++ + ++ ) : ( + + )} +++ + {/* Timer End Prompt Submit Session Dialog/Modal */} +++++++Submission Request Rejected
+ +++{submissionRejectedMessage}
++ ++++++++++Confirm Submission
+ +++The time has ended. Do you want to submit your code?
+Note: Your choice of no submission will not affect the other user's choice of submission.
++ + ++(''); + const [isMatching, setIsMatching] = useState (false); + const [selectedDifficulty, setSelectedDifficulty] = useState ('Easy'); + const [selectedTopic, setSelectedTopic] = useState ('Array'); + const [selectedLanguage, setSelectedLanguage] = useState ('python'); + const [timerInterval, setTimerInterval] = useState (null); + const [isMatchFound, setIsMatchFound] = useState (false); // Track if a match is found + const navigate = useNavigate(); + + const currentUser = getCurrentUser(); + + useEffect(() => { + // Establish connection if there is none + const checkConnectionStatus = () => { + if (!socket.connected) { + // Connection is lost, refresh the page + window.location.reload(); + } + }; + + // Schedule the connection check after a delay + const connectionCheckTimeout = setTimeout(checkConnectionStatus, 1000); + + function matchFound(roomId: string, msg: string) { + setIsMatchFound(true); // Set match found to true + setMatchStatus(msg); + // Clear the timer stored on the socket object + if (customSocket.timerId) { + clearInterval(customSocket.timerId); + customSocket.timerId = null; + } + + setTimeout(() => { + setIsMatching(false); + navigate(`/match/${roomId}`, { + state: { + socketId: socket.id, + difficulty: selectedDifficulty, + topic: selectedTopic, + language: selectedLanguage + }, + }); + }, 2000); // 2 seconds delay + } + + // Handle match canceled event + function matchCanceled() { + setIsMatching(false); + // Clear the timer stored on the socket object + if (customSocket.timerId) { + clearInterval(customSocket.timerId); + customSocket.timerId = null; + } + } + + socket.on('match found', matchFound); + socket.on('match canceled', matchCanceled); // Listen for match canceled event + + return () => { + clearTimeout(connectionCheckTimeout); + socket.off('match found', matchFound); + socket.off('match canceled', matchCanceled); // Remove the event listener + }; + }, [selectedDifficulty, selectedTopic, selectedLanguage]); + + useEffect(() => { + function onConnect() { + if (isMatching) { + setIsMatching(false); + } + } + + function onDisconnect() { + if (isMatching) { + setIsMatching(false); + } + } + + // Listen for the 'connect' event to check the connection status + socket.on('connect', onConnect); + // Listen for the 'disconnect' event to detect disconnection + socket.on('disconnect', onDisconnect); + + // Unsubscribe from the events when the component unmounts + return () => { + socket.off('connect', onConnect); + socket.off('disconnect', onDisconnect); + }; + }, [isMatching]); + + const startTimer = () => { + let seconds = 0; + const intervalId = setInterval(() => { + seconds++; + const minutes = Math.floor(seconds / 60); + const remainingSeconds = seconds % 60; + const formattedTime = `${minutes.toString().padStart(2, '0')}:${remainingSeconds.toString().padStart(2, '0')}`; + setMatchStatus(`Matching... (${formattedTime})`); + }, 1000); + + // Store the timer ID on the socket object + customSocket.timerId = intervalId; + + setTimerInterval(intervalId); + }; + + const stopTimer = () => { + if (timerInterval !== null) { + clearInterval(timerInterval); + setTimerInterval(null); + setMatchStatus(''); + + // Clear the timer stored on the socket object + if (customSocket.timerId) { + clearInterval(customSocket.timerId); + customSocket.timerId = null; + } + } + }; + + const handleMatchClick = () => { + if (isMatching) { + stopTimer(); + setMatchStatus('Matching canceled.'); + socket.emit('cancel match'); // Emit a cancel signal to the server + } else { + startTimer(); + setMatchStatus('Matching...'); + socket.emit('match me', selectedDifficulty, selectedTopic, selectedLanguage, currentUser.accessToken); + + // Automatically cancel the match after 20 seconds + setTimeout(() => { + stopTimer(); + setMatchStatus('No matches available. Try again later.'); + socket.emit('cancel match'); // Emit a cancel signal to the server + setIsMatching(false); + }, 30000); // 30 seconds + } + setIsMatching(!isMatching); + }; + + const handleDifficultyClick = (difficulty: string) => { + setSelectedDifficulty(difficulty); + }; + + // Topic button click handler + const handleTopicClick = (topic: string) => { + setSelectedTopic(topic); + }; + + const handleLanguageChange = (event: React.ChangeEvent ) => { + const value = event.target.value; + setSelectedLanguage(value); + } + + const difficultyLevels = [ + { label: 'Easy', className: 'difficulty-easy' }, + { label: 'Medium', className: 'difficulty-medium' }, + { label: 'Hard', className: 'difficulty-hard' }, + ]; + + return ( + ++ ); +}; + +export default Matchmaking; diff --git a/frontend/src/pages/Matching/socket.js b/frontend/src/pages/Matching/socket.js new file mode 100644 index 00000000..f6f3a76b --- /dev/null +++ b/frontend/src/pages/Matching/socket.js @@ -0,0 +1,17 @@ +import io from 'socket.io-client'; + +// Check if user is logged in via local storage token +const user = JSON.parse(localStorage.getItem("user")); +let jwtToken = null; + +if (user && user.accessToken) { + jwtToken = user.accessToken; +} else { + console.log("User is not authorized yet"); +} + +const URL = process.env.REACT_APP_MTC_SVC || "http://localhost:3002" + +export const socket = io(URL, { + query: { token: jwtToken }, // Include the token if available +}); diff --git a/frontend/src/pages/Profile.tsx b/frontend/src/pages/Profile.tsx new file mode 100644 index 00000000..18340a5d --- /dev/null +++ b/frontend/src/pages/Profile.tsx @@ -0,0 +1,811 @@ +import { useEffect, useState } from "react"; +import { getCurrentUser, deleteUser, logout } from "../utils/auth.service"; +import Button from "@mui/material/Button"; +import Dialog from "@mui/material/Dialog"; +import DialogActions from "@mui/material/DialogActions"; +import DialogContent from "@mui/material/DialogContent"; +import DialogContentText from "@mui/material/DialogContentText"; +import DialogTitle from "@mui/material/DialogTitle"; +import { styled } from "@mui/material/styles"; +import { NavigateFunction, useNavigate } from "react-router-dom"; +import { TextField } from "@mui/material"; +import { useFormik } from "formik"; +import * as Yup from "yup"; +import { + getUserProfile, + updateUserPassword, + updateUserProfile, +} from "../utils/user.service"; +import profilepic from "../images/default-user.png"; +import CircularProgress from "@mui/material/CircularProgress"; + +interface User { + username: string; + email: string; + roles: string[]; + id: string; +} + +const CustomDialog = styled(Dialog)``; + +const CustomDialogTitle = styled(DialogTitle)` + font-weight: bold; +`; + +const CustomDialogContent = styled(DialogContent)` + padding: 20px; +`; + +const CustomDialogActions = styled(DialogActions)` + justify-content: space-between; +`; + +const Profile: React.FC = () => { + let navigate: NavigateFunction = useNavigate(); + const currentUser = getCurrentUser(); + const [profile, setProfile] = useState+ {/* Left section */} ++ {/* End of right section */} ++ {/* Topic divider */} ++ {/* End of left section */} + + {/* Right section */} ++ + ++++ ++ {/* Create a wrapper div for each row of buttons */} + {iconCategories.map((topic, index) => ( +++ ++ ))} ++ {topic.label} +++ {/* Difficulty buttons divider */} ++++ + {/* Progamming language dropdown field divider */} ++ ++{/* Add justify-content-center */} +++ {difficultyLevels.map((level) => ( +++ ++ ))} +++ + ++++++ + +++ ++ + + ++++ Loading... ++ +{matchStatus}+(null); + const [userErrorMessage, setUserErrorMessage] = useState(""); + const [passwordErrorMessage, setPasswordErrorMessage] = useState(""); + const [openDeleteModel, setOpenDeleteModal] = useState(false); + const [showPasswordTextFields, setShowPasswordTextFields] = useState(false); + const [textFieldsEnabled, setTextFieldsEnabled] = useState(false); + const [showErrorModal, setShowErrorModal] = useState(false); + const [showSuccessModal, setShowSuccessModal] = useState(false); + const [errorType, setErrorType] = useState(""); + const [passwordButtonClicked, setPasswordButtonClicked] = useState(false); + const [buttonWidth, setButtonWidth] = useState("97%"); + const [showBackButton, setShowBackButton] = useState(false); + const [isTextFieldClicked, setIsTextFieldClicked] = useState(false); + const isAdmin = currentUser && currentUser.roles.includes("ROLE_ADMIN"); + const [isLoading, setIsLoading] = useState(true); + + // Fetch user details to display + useEffect(() => { + getUserProfile(currentUser.accessToken) + .then((response) => { + setProfile(response.data); + setIsLoading(false); + }) + .catch((err) => { + console.log(err); + setIsLoading(false); + }); + }, []); + + // Function to enable the password text fields when they are clicked + const enableTextField = () => { + setIsTextFieldClicked(true); + }; + + // Function to handle event when change password button is clicked + const toggleTextFields = () => { + setShowPasswordTextFields(!showPasswordTextFields); + setTextFieldsEnabled(false); + setPasswordButtonClicked(true); + setShowBackButton(!showBackButton); + }; + + // Function to toggle delete modal window + const toggleDeleteModal = () => { + setOpenDeleteModal(!openDeleteModel); + }; + + // Function to delete user account + const deleteUserAccount = async () => { + try { + await deleteUser(); + logout(); + } catch (err) { + console.log(err); + } finally { + navigate("/login"); + window.location.reload(); + } + }; + + const updateProfileSchema = Yup.object().shape({ + username: Yup.string() + .test( + "len", + "The username must be between 3 and 20 characters.", + (val: any) => + val && val.toString().length >= 3 && val.toString().length <= 20 + ) + .required("This field is required!"), + email: Yup.string() + .email("This is not a valid email.") + .required("This field is required!"), + }); + + const updateFormik = useFormik({ + initialValues: { + username: profile?.username, + email: profile?.email, + }, + validationSchema: updateProfileSchema, + onSubmit: (values, { resetForm }) => { + updateUserProfile(values, currentUser.accessToken) + .then((response) => { + setProfile((prevProfile) => { + if (!prevProfile) { + return null; + } + return { + ...prevProfile, + username: values.username || prevProfile.username, + email: values.email || prevProfile.email, + }; + }); + setUserErrorMessage(""); + resetForm(); + setShowSuccessModal(true); + }) + .catch((err) => { + console.log(err); + setUserErrorMessage(err.response.data.message); + setErrorType("user"); + setShowErrorModal(true); + resetForm(); + }); + }, + enableReinitialize: true, + }); + + const updatePasswordSchema = Yup.object().shape({ + currentPassword: Yup.string() + .test( + "len", + "The password is be between 6 and 40 characters.", + (val: any) => + val && val.toString().length >= 6 && val.toString().length <= 40 + ) + .required("This field is required!"), + newPassword: Yup.string() + .test( + "len", + "The password must be between 6 and 40 characters.", + (val: any) => + val && val.toString().length >= 6 && val.toString().length <= 40 + ) + .required("This field is required!"), + confirmPassword: Yup.string() + .oneOf([Yup.ref("newPassword"), ""], "Passwords must match") + .required("This field is required!"), + }); + + const passwordFormik = useFormik({ + initialValues: { + currentPassword: "", + newPassword: "", + confirmPassword: "", + }, + validationSchema: updatePasswordSchema, + onSubmit: (values, { resetForm }) => { + const { currentPassword, newPassword } = values; + updateUserPassword( + { currentPassword, newPassword }, + currentUser.accessToken + ) + .then((response) => { + setUserErrorMessage(""); + resetForm(); + setShowSuccessModal(true); + }) + .catch((err) => { + setPasswordErrorMessage(err.response.data.message); + setErrorType("password"); + setShowErrorModal(true); + }); + }, + enableReinitialize: true, + }); + + if (isLoading) { + return ( + ++ ); + } + + return ( ++ ++ ); +}; + +export default Profile; diff --git a/frontend/src/pages/Question/AddQuestion.tsx b/frontend/src/pages/Question/AddQuestion.tsx new file mode 100644 index 00000000..b2700930 --- /dev/null +++ b/frontend/src/pages/Question/AddQuestion.tsx @@ -0,0 +1,233 @@ +// Import MUI components +import React, { useState } from "react"; +import { useNavigate } from "react-router-dom" +import { useForm } from "react-hook-form"; +import { Button, Paper, Typography, Container } from "@mui/material"; +import Alert from '@mui/material/Alert'; +import AlertTitle from '@mui/material/AlertTitle'; + +// Import customised components +import { FormInputText } from "../../components/Matching/FormInputText"; +import { FormInputDropdown } from "../../components/Matching/FormInputDropdown"; +import { FormMultipleInputDropdown } from "../../components/Matching/FormMultipleInputDropdown"; +import FormInputTextEditor from "../../components/Matching/FormInputTextEditor"; + +// Import current user for authentication +import { getCurrentUser } from "../../utils/auth.service"; + +// To instantiate form components +interface IFormInput { + title: string; + topics: string; + difficulty: string; + content: string; +} + +const defaultValues = { + title: "", + topics: "", + difficulty: "", + content: "", +}; + +const dropdownTopicsOptions = [ + { label: "Array", value: "Array" }, + { label: "Binary Search", value: "Binary Search" }, + { label: "Binary Search Tree", value: "Binary Search Tree" }, + { label: "Bit Manipulation", value: "Bit Manipulation" }, + { label: "Depth-First Search", value: "Depth-First Search" }, + { label: "Design", value: "Design" }, + { label: "Greedy", value: "Greedy" }, + { label: "Hash Table", value: "Hash Table" }, + { label: "Math", value: "Math" }, + { label: "Matrix", value: "Matrix" }, + { label: "Stack", value: "Stack" }, + { label: "Simulation", value: "Simulation" }, + { label: "Sorting", value: "Sorting" }, + { label: "String", value: "String" }, + { label: "Tree", value: "Tree" }, + { label: "Trie", value: "Trie" }, + { label: "Two Pointers", value: "Two Pointers" } +]; + +const dropdownComplexityOptions = [ + { label: "Easy", value: "Easy" }, + { label: "Medium", value: "Medium" }, + { label: "Hard", value: "Hard" }, +]; + +export default function QuestionForm() { + const methods = useForm+ ++ + {/* delete user */} +++ + {/* Error */} ++ ++ {`Confirm to delete account.`} + ++ ++ Note: All history will be deleted. + ++ + + +++ + {/* Success */} +setShowErrorModal(false)} + aria-labelledby="error-dialog-title" + aria-describedby="error-dialog-description" + PaperProps={{ + sx: { bgcolor: "lightgray", borderRadius: "20px", padding: "5px" }, + }} + > + ++ Error + ++ ++ {/* Current password is incorrect. */} + {errorType === "password" && passwordErrorMessage} + {errorType === "user" && userErrorMessage} + ++ + +++setShowSuccessModal(false)} + aria-labelledby="success-dialog-title" + aria-describedby="success-dialog-description" + PaperProps={{ + sx: { bgcolor: "lightgray", borderRadius: "20px", padding: "5px" }, + }} + > + ++ Success + ++ ++ Successfully updated! + ++ + +({ defaultValues: defaultValues }); + const { control } = methods; + const [editorContent, setEditorContent] = useState(""); + const [formSubmitted, setFormSubmitted] = useState(false); + const [errorMessage, setErrorMessage] = useState(""); + const navigate = useNavigate(); + const QUESTION_HOST = process.env.REACT_APP_QNS_SVC || 'http://localhost:3000/api/questions'; + const currentUser = getCurrentUser(); + + const onSubmit = (event: React.FormEvent ) => { + event.preventDefault(); + // Access form data using methods.getValues() if you are using react-hook-form + const formData = methods.getValues(); + + // Include editor content in the form data + const formDataWithEditorContent = { + ...formData, + content: editorContent, + }; + + for (const key in formDataWithEditorContent) { + if (formDataWithEditorContent.hasOwnProperty(key)) { + const value = formDataWithEditorContent[key as keyof IFormInput]; + if ((!value) || ((key === "content") && (value === "\n"))) { + console.error(`${key} is empty`); + setFormSubmitted(true); + setErrorMessage(`Required fields cannot be empty`); + return; + } + } + } + + // Handle form submission logic here + fetch(QUESTION_HOST, { + method: 'POST', + mode: 'cors', + headers: { + "Content-Type": "application/json", // Set the content type to JSON + "x-access-token": currentUser.accessToken, // Send the JWT along with the request in the header + }, + body: JSON.stringify(formDataWithEditorContent), // Send the modified data + }) + .then((response) => { + if (response.status === 400) { + // Title already exists, show an alert + return response.json().then((responseData) => { + setErrorMessage(responseData.error); + throw new Error("Title already exists"); + }); + } + return response.json(); + }) + .then((responseData) => { + const id = responseData._id; + navigate(`/questions/${id}`); + }) + .catch((error) => { + // Handle the error (e.g., show an error message) + console.error("Error posting question", error); + }); + }; + + const handleBack = () => { + navigate("/questions"); + }; + + // Update editor content when it changes + const editorHandleChange = (newContent: string) => { + setEditorContent(newContent); + }; + + return ( + onSubmit(e)}> + + ); +} diff --git a/frontend/src/pages/Question/QuestionAttempt.tsx b/frontend/src/pages/Question/QuestionAttempt.tsx new file mode 100644 index 00000000..66c2044c --- /dev/null +++ b/frontend/src/pages/Question/QuestionAttempt.tsx @@ -0,0 +1,237 @@ +import { useEffect, useState } from "react"; +import { useParams, useNavigate } from "react-router-dom"; +import { styled } from "@mui/material/styles"; +import { Button, Container, Grid, Paper } from "@mui/material"; +import ArrowBackIcon from "@mui/icons-material/ArrowBack"; +import CircularProgress from "@mui/material/CircularProgress"; +import { getCurrentUser } from "../../utils/auth.service"; + +interface QuestionInt { + _id: string; + title: string; + frontendQuestionId: string; + difficulty: string; + content: string; + category: string; + topics: string; +} + +interface AttemptInt { + userId: number; + question_id: string; + difficulty: string; + attemptedAt: string; + attempt: string; +} + +const BackButton = styled(Button)` + background-color: #d8d8d8; + color: white; + font-weight: bold; + &:hover { + background-color: #6c63ff; + } +`; + +export default function UserAttempt() { + const { id } = useParams<{ id: string }>(); + const [question, setQuestion] = useState+++ {/* Show Title of Form */} + ++ Add Question + + + {errorMessage && ( ++ + )} + + {/* Add input components */} +Error! + {errorMessage} ++ + + + + + {/* Placed Container outside of text editor to keep the FormInputTextEditor flexible for other usage */} + + + + + ++(null); + const [attempt, setAttempt] = useState ({ + userId: 0, + question_id: "", + difficulty: "", + attemptedAt: "", + attempt: "", + }); + const [isLoading, setIsLoading] = useState(true); + const navigate = useNavigate(); + + const currentUser = getCurrentUser(); + const isAdmin = currentUser && currentUser.roles.includes("ROLE_ADMIN"); + + const QUESTION_HOST = + process.env.REACT_APP_QNS_SVC || "http://localhost:3000/api/questions"; + const USER_HISTORY = + process.env.REACT_APP_USR_SVC_HIST || "http://localhost:3003/api/user"; + + useEffect(() => { + const fetchDataWithDelay = () => { + fetch(QUESTION_HOST + `/${id}`, { + headers: { + "x-access-token": currentUser.accessToken, + }, + }) + .then((response) => response.json()) + .then((responseData) => { + setQuestion(responseData); + setIsLoading(false); + }) + .catch((error) => { + console.error("Error fetching data:", error); + setQuestion(null); + setIsLoading(false); + }); + }; + + fetchDataWithDelay(); + }, [id, currentUser.accessToken]); + + useEffect(() => { + const fetchUserAttempt = () => { + fetch(USER_HISTORY + "/get", { + headers: { + "x-access-token": currentUser.accessToken, + }, + }) + .then((response) => response.json()) + .then((responseData) => { + const targetData = responseData.find( + (item: any) => item.question_id === `${id}` + ); + setAttempt(targetData); + setIsLoading(false); + }) + .catch((error) => { + console.error("Error fetching attempt:", error); + setIsLoading(false); + }); + }; + + fetchUserAttempt(); + }, [id, currentUser.accessToken]); + + function wrapPreTags(content: string) { + const wrappedContent = content.replace(/ /g, ''); + return wrappedContent; + } + + const handleBack = () => { + navigate("/home"); + }; + + if (isLoading) { + return ( +++ ); + } + + if (question === null) { + return ( ++ ++ ); + } + + return ( ++ ++ + + + + {/* Tags */} ++++ {question.title} +
+++ +{question.difficulty}+ {question.topics.split(", ").map((topic, index) => ( +{topic}+ ))} ++ + + ++ ); +} diff --git a/frontend/src/pages/Question/QuestionsTable.tsx b/frontend/src/pages/Question/QuestionsTable.tsx new file mode 100644 index 00000000..3d1d26fc --- /dev/null +++ b/frontend/src/pages/Question/QuestionsTable.tsx @@ -0,0 +1,220 @@ +import React, { useEffect, useState } from "react"; +import { + Table, + TableBody, + TableCell, + TableContainer, + TableHead, + TableRow, + Paper, + Grid, + Container, + Button, + TablePagination, +} from "@mui/material"; +import { useNavigate } from "react-router-dom"; +import { styled } from "@mui/material/styles"; +import "../../css/Table.css"; +import CircularProgress from "@mui/material/CircularProgress"; +import { getCurrentUser } from "../../utils/auth.service"; + + +const AddButton = styled(Button)` + background-color: #6C63FF; + color: white; + font-weight: bold; +`; + +interface Question { + _id: string; + title: string; + frontendQuestionId: string; + difficulty: string; + content: string; + category: string; + topics: string; +} + +const BasicTable: React.FC = () => { + const [data, setData] = useState+ Attempt: +
+')) , + }} + /> ++ + + + + ++ ++ ++ ([]); + const [page, setPage] = useState(0); + const [rowsPerPage, setRowsPerPage] = useState(10); + const [isLoading, setIsLoading] = useState(true); + const currentUser = getCurrentUser(); + const isAdmin = currentUser && currentUser.roles.includes("ROLE_ADMIN"); + + const QUESTION_HOST = process.env.REACT_APP_QNS_SVC || "http://localhost:3000/api/questions"; + + + const fetchFirstPageData = () => { + const token = getCurrentUser().token; // Assuming you get the token like this + + fetch(QUESTION_HOST + `/pagination/first`, { + headers: { + "Content-Type": "application/json", + "x-access-token": currentUser.accessToken, // Set the x-access-token header + }, + }) + .then((response) => response.json()) + .then((responseData) => { + setData(responseData); + setIsLoading(false); + }) + .catch((error) => { + console.error("Error fetching data:", error); + }); + }; + + + const fetchRemainingData = () => { + fetch(QUESTION_HOST + `/pagination/remaining`, { + headers: { + "Content-Type": "application/json", + "x-access-token": currentUser.accessToken, // Set the x-access-token header + }, + }) + .then((response) => response.json()) + .then((responseData) => { + setData((prevData) => [...prevData, ...responseData]); + }) + .catch((error) => { + console.error("Error fetching data:", error); + }); + }; + + + useEffect(() => { + const fetchData = async () => { + try { + await fetchFirstPageData(); + await fetchRemainingData(); + } catch (error) { + console.error("Error fetching data:", error); + } + }; + + fetchData(); + }, []); + + const navigate = useNavigate(); + + const handleAddButtonClick = () => { + navigate("/questions/add-question"); + }; + + const handleChangePage = ( + event: React.MouseEvent | null, + newPage: number + ) => { + setPage(newPage); + }; + + const handleChangeRowsPerPage = ( + event: React.ChangeEvent + ) => { + setRowsPerPage(parseInt(event.target.value, 10)); + setPage(0); + }; + + if (isLoading) { + return ( + ++ ); + } + + return ( ++ + + ); +}; + +export default BasicTable; diff --git a/frontend/src/pages/Question/UpdateQuestion.tsx b/frontend/src/pages/Question/UpdateQuestion.tsx new file mode 100644 index 00000000..228d57bc --- /dev/null +++ b/frontend/src/pages/Question/UpdateQuestion.tsx @@ -0,0 +1,207 @@ +import React, { useEffect, useState } from "react"; +import { useParams, useNavigate } from "react-router-dom"; +import { useForm } from "react-hook-form"; +import { Button, Paper, Typography } from "@mui/material"; +import Alert from "@mui/material/Alert"; +import AlertTitle from "@mui/material/AlertTitle"; +import CircularProgress from "@mui/material/CircularProgress"; + +import { FormInputText } from "../../components/Matching/FormInputText"; +import { FormInputDropdown } from "../../components/Matching/FormInputDropdown"; +import { FormMultipleInputDropdown } from "../../components/Matching/FormMultipleInputDropdown"; +import FormInputTextEditor from "../../components/Matching/FormInputTextEditor"; + +import { getCurrentUser } from "../../utils/auth.service"; + +interface Question { + _id: string; + title: string; + frontendQuestionId: string; + difficulty: string; + content: string; + category: string; + topics: string; +} + +interface IFormInput { + title: string; + topics: string; + difficulty: string; + content: string; +} + +const defaultValues = { + title: "", + topics: "", + difficulty: "", + content: "", +}; + +const dropdownTopicsOptions = [ + { label: "Array", value: "Array" }, + { label: "Binary Search", value: "Binary Search" }, + { label: "Binary Search Tree", value: "Binary Search Tree" }, + { label: "Bit Manipulation", value: "Bit Manipulation" }, + { label: "Depth-First Search", value: "Depth-First Search" }, + { label: "Design", value: "Design" }, + { label: "Greedy", value: "Greedy" }, + { label: "Hash Table", value: "Hash Table" }, + { label: "Math", value: "Math" }, + { label: "Matrix", value: "Matrix" }, + { label: "Stack", value: "Stack" }, + { label: "Simulation", value: "Simulation" }, + { label: "Sorting", value: "Sorting" }, + { label: "String", value: "String" }, + { label: "Tree", value: "Tree" }, + { label: "Trie", value: "Trie" }, + { label: "Two Pointers", value: "Two Pointers" } +]; + +const dropdownComplexityOptions = [ + { label: "Easy", value: "Easy" }, + { label: "Medium", value: "Medium" }, + { label: "Hard", value: "Hard" }, +]; + +export default function UpdateForm() { + const { id } = useParams<{ id: string }>(); + const methods = useForm+ ++ + {isAdmin && ( ++ ++ ++ Question + ++ + + + Complexity + ++ + + + Topics + + ++ ++
++ {data + .slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage) + .map((row, index) => ( + +navigate(`/questions/${row._id}`)} + > + + ))} ++ {row.title} + +{row.difficulty} +{row.topics} ++ + + )} + ++ + + +({ defaultValues: defaultValues }); + const { control, setValue } = methods; + const [editorContent, setEditorContent] = useState(""); + const [question, setQuestion] = useState (null); + const [formSubmitted, setFormSubmitted] = useState(false); + const [errorMessage, setErrorMessage] = useState(""); + const navigate = useNavigate(); + const currentUser = getCurrentUser(); + const QUESTION_HOST = process.env.REACT_APP_QNS_SVC || "http://localhost:3000/api/questions"; + + useEffect(() => { + const fetchData = () => { + fetch(QUESTION_HOST + `/${id}`, { + headers: { + "x-access-token": currentUser.accessToken, + }, + }) + .then((response) => response.json()) + .then((responseData) => { + setQuestion(responseData); + const { title, topics, difficulty, content } = responseData; + setValue("title", title); + setValue("topics", topics); + + setValue("difficulty", difficulty); + setEditorContent(content); + }) + .catch((error) => { + console.error("Error fetching data:", error); + setQuestion(null); + }); + }; + + fetchData(); + }, [id, setValue]); + + const onUpdate = async (event: React.FormEvent ) => { + event.preventDefault(); + const formData = methods.getValues(); + const formDataWithEditorContent = { + ...formData, + content: editorContent, + }; + + for (const key in formDataWithEditorContent) { + if (formDataWithEditorContent.hasOwnProperty(key)) { + const value = formDataWithEditorContent[key as keyof IFormInput]; + if ((!value) || ((key === "content") && (value === "\n"))) { + console.error(`${key} is empty`); + setFormSubmitted(true); + setErrorMessage(`Required fields cannot be empty`); + // setErrorMessage(`${key} is empty`); + return; + } + } + } + + fetch(QUESTION_HOST + `/${id}`, { + method: "PUT", + mode: "cors", + headers: { + "Content-Type": "application/json", + "x-access-token": currentUser.accessToken, + }, + body: JSON.stringify(formDataWithEditorContent), + }) + .then((response) => { + if (response.status === 400) { + return response.json().then((responseData) => { + setErrorMessage(responseData.error); + throw new Error("Title already exists"); + }); + } + response.json(); + }) + .then(() => { + navigate(`/questions/${id}`); + }) + .catch((error) => { + console.error("Error putting question", error); + }); + }; + + const handleBack = () => { + navigate(`/questions/${id}`); + }; + + const editorHandleChange = (newContent: string) => { + setEditorContent(newContent); + }; + + if (question === null) { + return ( + ++ ); + } + + // Showcases the FE visible components + return ( ++ onUpdate(e)}> + + ); +} + diff --git a/frontend/src/pages/Question/ViewQuestion.tsx b/frontend/src/pages/Question/ViewQuestion.tsx new file mode 100644 index 00000000..6bf7d82d --- /dev/null +++ b/frontend/src/pages/Question/ViewQuestion.tsx @@ -0,0 +1,315 @@ +import { useEffect, useState } from "react"; +import { useParams, useNavigate } from "react-router-dom"; +import "../../css/Question.css"; +import { styled } from "@mui/material/styles"; +import { Button, Container, Grid, Paper } from "@mui/material"; +import DeleteIcon from "@mui/icons-material/Delete"; +import EditIcon from "@mui/icons-material/Edit"; +import ArrowBackIcon from "@mui/icons-material/ArrowBack"; +import CircularProgress from "@mui/material/CircularProgress"; +import { getCurrentUser } from "../../utils/auth.service"; + +import { + Dialog, + DialogActions, + DialogContent, + DialogContentText, + DialogTitle, + Button as DialogButton, +} from "@mui/material"; + +interface QuestionInt { + _id: string; + title: string; + frontendQuestionId: string; + difficulty: string; + content: string; + category: string; + topics: string; + isDeleted: boolean; +} + +const CustomDialog = styled(Dialog)``; + +const CustomDialogTitle = styled(DialogTitle)` + font-weight: bold; +`; + +const CustomDialogContent = styled(DialogContent)` + padding: 20px; +`; + +const CustomDialogActions = styled(DialogActions)` + justify-content: space-between; +`; + +const BackButton = styled(Button)` + background-color: #6c63ff; + color: white; + font-weight: bold; +`; + +export default function Question() { + const { id } = useParams<{ id: string }>(); + const [question, setQuestion] = useState+++ ++ Update Question + + {errorMessage && ( ++ + )} +Error! + {errorMessage} ++ + + + + + ++ +(null); + const [isLoading, setIsLoading] = useState(true); + const navigate = useNavigate(); + + const currentUser = getCurrentUser(); + const isAdmin = currentUser && currentUser.roles.includes("ROLE_ADMIN"); + + const [isDeleteDialogOpen, setIsDeleteDialogOpen] = useState(false); // Confirmation dialog state + const QUESTION_HOST = + process.env.REACT_APP_QNS_SVC || "http://localhost:3000/api/questions"; + + useEffect(() => { + const fetchDataWithDelay = () => { + fetch(QUESTION_HOST + `/${id}`, { + headers: { + "x-access-token": currentUser.accessToken, + }, + }) + .then((response) => { + if (response.status === 200) { + return response.json(); // Continue processing if it's a successful response + } else { + console.error("Error fetching data:", response.statusText); + setIsLoading(false); + navigate("/404"); + } + }) + .then((responseData) => { + if (responseData) { + setQuestion(responseData); + setIsLoading(false); + } + }) + .catch((error) => { + console.error("Error fetching data:", error); + setQuestion(null); + setIsLoading(false); + }); + }; + + fetchDataWithDelay(); + }, [id, currentUser.accessToken]); + + + function wrapPreTags(content: string) { + const wrappedContent = content.replace(/ /g, ''); + return wrappedContent; + } + + const handleBack = () => { + navigate("/questions"); + }; + + const openDeleteDialog = () => { + setIsDeleteDialogOpen(true); + }; + + const closeDeleteDialog = () => { + setIsDeleteDialogOpen(false); + }; + + const handleUpdate = () => { + navigate(`/questions/${id}/update`); + }; + + const handleDelete = () => { + // Close the confirmation dialog + closeDeleteDialog(); + + fetch(QUESTION_HOST + `/${id}`, { + method: "PATCH", + headers: { + "Content-Type": "application/json", + "x-access-token": currentUser.accessToken, + }, + }) + .then((response) => { + if (response.status === 200) { + navigate("/questions"); + } else { + console.error("Error deleting question:", response.statusText); + } + }) + .catch((error) => { + console.error("Error deleting question:", error); + }); + }; + + if (isLoading) { + return ( +++ ); + } + + if (question === null) { + return+ +; + } + + return ( ++ ++ ); +} diff --git a/frontend/src/pages/Register.tsx b/frontend/src/pages/Register.tsx new file mode 100644 index 00000000..9398d068 --- /dev/null +++ b/frontend/src/pages/Register.tsx @@ -0,0 +1,232 @@ +import React, { useState } from "react"; +import { Formik, Field, Form, ErrorMessage } from "formik"; +import * as Yup from "yup"; +import IUser from "../utils/types/user.type"; +import { register } from "../utils/auth.service"; +import mascot from '../images/mascot.png'; +import { Link } from "react-router-dom"; + +const Register: React.FC = () => { + const [successful, setSuccessful] = useState+ + ++ ++ + + {/* Tags */} ++++ {question.title} +
++ {(isAdmin && !question.isDeleted) && ( + <> + + + > + )} ++++ +{question.difficulty}+ {question.topics.split(", ").map((topic, index) => ( +{topic}+ ))} ++ ++ ++ +++ ++ Confirm Deletion + ++ ++ Are you sure you want to delete this question? + ++ ++ Cancel + ++ Delete + ++ ++ ++ (false); + const [message, setMessage] = useState (""); + + const initialValues: IUser = { + username: "", + email: "", + password: "", + }; + + const validationSchema = Yup.object().shape({ + username: Yup.string() + .test( + "len", + "The username must be between 3 and 20 characters.", + (val: any) => + val && + val.toString().length >= 3 && + val.toString().length <= 20 + ) + .required("This field is required!"), + email: Yup.string() + .email("This is not a valid email.") + .required("This field is required!"), + password: Yup.string() + .test( + "len", + "The password must be between 6 and 40 characters.", + (val: any) => + val && + val.toString().length >= 6 && + val.toString().length <= 40 + ) + .required("This field is required!"), + }); + + const handleRegister = (formValue: IUser) => { + const { username, email, password } = formValue; + + register(username, email, password).then( + (response) => { + setMessage(response.data.message); + setSuccessful(true); + }, + (error) => { + const resMessage = + (error.response && + error.response.data && + error.response.data.message) || + error.message || + error.toString(); + + setMessage(resMessage); + setSuccessful(false); + } + ); + }; + + const mascotStyles = { + height: 'auto', + maxWidth: '100%', + width: 'auto', + }; + + return ( + ++ ); +}; + +export default Register; diff --git a/frontend/src/react-app-env.d.ts b/frontend/src/react-app-env.d.ts new file mode 100644 index 00000000..6431bc5f --- /dev/null +++ b/frontend/src/react-app-env.d.ts @@ -0,0 +1 @@ +///++++ ++++ {({ handleSubmit }) => ( + ++ {!successful && ( + + )} +++ )} + + {message && ( +++ ++ + + ++ ++ + + ++ ++ + + +++++ Account exists? + + Login + +++++ ++++ )} ++ {message} +++ ++diff --git a/frontend/src/reportWebVitals.ts b/frontend/src/reportWebVitals.ts new file mode 100644 index 00000000..49a2a16e --- /dev/null +++ b/frontend/src/reportWebVitals.ts @@ -0,0 +1,15 @@ +import { ReportHandler } from 'web-vitals'; + +const reportWebVitals = (onPerfEntry?: ReportHandler) => { + if (onPerfEntry && onPerfEntry instanceof Function) { + import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { + getCLS(onPerfEntry); + getFID(onPerfEntry); + getFCP(onPerfEntry); + getLCP(onPerfEntry); + getTTFB(onPerfEntry); + }); + } +}; + +export default reportWebVitals; diff --git a/frontend/src/setupTests.ts b/frontend/src/setupTests.ts new file mode 100644 index 00000000..8f2609b7 --- /dev/null +++ b/frontend/src/setupTests.ts @@ -0,0 +1,5 @@ +// jest-dom adds custom jest matchers for asserting on DOM nodes. +// allows you to do things like: +// expect(element).toHaveTextContent(/react/i) +// learn more: https://github.com/testing-library/jest-dom +import '@testing-library/jest-dom'; diff --git a/frontend/src/utils/analytics.service.ts b/frontend/src/utils/analytics.service.ts new file mode 100644 index 00000000..c282fe5f --- /dev/null +++ b/frontend/src/utils/analytics.service.ts @@ -0,0 +1,29 @@ +import axios from "axios"; +import authHeader from "../utils/auth-header"; + +const USER_HISTORY = + process.env.REACT_APP_USR_SVC_HIST || "http://localhost:3003/api/hist"; +const QUESTION_HOST = + process.env.REACT_APP_QNS_SVC || "http://localhost:3000/api/questions"; + +export const fetchUserHistory = () => { + return axios.get(USER_HISTORY + "/get", { headers: authHeader() }); +}; + +export const fetchAttemptedQuestions = (questionId: string[]) => { + return axios.post( + QUESTION_HOST + "/questionbyid", + { ids: questionId }, + { + headers: authHeader(), + } + ); +}; + +export const fetchUserAttemptsDates = () => { + return axios.get(USER_HISTORY + "/attempts", { headers: authHeader() }); +}; + +export const fetchQuestionsDetails = () => { + return axios.get(QUESTION_HOST + "/total", { headers: authHeader() }); +}; diff --git a/frontend/src/utils/auth-header.ts b/frontend/src/utils/auth-header.ts new file mode 100644 index 00000000..5161c06f --- /dev/null +++ b/frontend/src/utils/auth-header.ts @@ -0,0 +1,12 @@ +export default function authHeader() { + const userStr = localStorage.getItem("user"); + let user = null; + if (userStr) + user = JSON.parse(userStr); + + if (user && user.accessToken) { + return { 'x-access-token': user.accessToken }; + } else { + return { 'x-access-token':""}; + } + } \ No newline at end of file diff --git a/frontend/src/utils/auth.service.ts b/frontend/src/utils/auth.service.ts new file mode 100644 index 00000000..ceffe462 --- /dev/null +++ b/frontend/src/utils/auth.service.ts @@ -0,0 +1,56 @@ +import axios from "axios"; + +const API_URL = process.env.REACT_APP_USR_SVC_AUTH || "http://localhost:3003/api/auth"; +// const API_URL = "http://localhost:3003/api/auth"; + +export const register = (username: string, email: string, password: string) => { + return axios.post(API_URL + "/signup", { + username, + email, + password, + }); +}; + +export const login = (username: string, password: string) => { + return axios + .post(API_URL + "/signin", { + username, + password, + }) + .then((response) => { + if (response.data.accessToken) { + localStorage.setItem("user", JSON.stringify(response.data)); + } + + return response.data; + }); +}; + +export const logout = () => { + localStorage.removeItem("user"); +}; + +export const getCurrentUser = () => { + const userStr = localStorage.getItem("user"); + if (userStr) return JSON.parse(userStr); + + return null; +}; + +export const deleteUser = () => { + const user = getCurrentUser(); // Get current user details + if (!user || !user.accessToken) { + throw new Error("No access token found"); + } + + // Axios DELETE request with JWT token in the header + return axios + .delete(API_URL + "/removeuser", { + headers: { + "x-access-token": user.accessToken, + }, + }) + .catch((err) => { + console.log(err); + }); +}; diff --git a/frontend/src/utils/code.service.ts b/frontend/src/utils/code.service.ts new file mode 100644 index 00000000..7712a795 --- /dev/null +++ b/frontend/src/utils/code.service.ts @@ -0,0 +1,16 @@ +import axios from "axios"; +import authHeader from "./auth-header"; + +const API_URL = process.env.REACT_APP_MTC_SVC + "/api/code/"; + +export const runcode = (code : string, input : string, language : string, fileName : string) => { + const header = authHeader(); + + return axios.post(API_URL + "run", { + code, + input, + language, + fileName + }, + { headers: header }); +}; diff --git a/frontend/src/utils/types/user.type.ts b/frontend/src/utils/types/user.type.ts new file mode 100644 index 00000000..7328ceea --- /dev/null +++ b/frontend/src/utils/types/user.type.ts @@ -0,0 +1,7 @@ +export default interface IUser { + id?: any | null, + username: string, + email: string, + password: string, + roles?: Array +} \ No newline at end of file diff --git a/frontend/src/utils/user-history.service.ts b/frontend/src/utils/user-history.service.ts new file mode 100644 index 00000000..84727937 --- /dev/null +++ b/frontend/src/utils/user-history.service.ts @@ -0,0 +1,15 @@ +import axios from "axios"; +import authHeader from "./auth-header"; + +const API_URL = process.env.REACT_APP_USR_SVC_HIST + ? process.env.REACT_APP_USR_SVC_HIST + : "http://localhost:3003/api/hist"; + +export const addHistory = (questionId: string, difficulty: string, attempt: string) => { + return axios.post(API_URL + "/save", { + questionId, + difficulty, + attempt, + }, + { headers: authHeader() }); +}; diff --git a/frontend/src/utils/user.service.ts b/frontend/src/utils/user.service.ts new file mode 100644 index 00000000..8a16c17a --- /dev/null +++ b/frontend/src/utils/user.service.ts @@ -0,0 +1,45 @@ +import axios from "axios"; +import authHeader from "./auth-header"; + +const API_URL = process.env.REACT_APP_USR_SVC_AUTH || "http://localhost:3003/api/auth"; +// const API_URL = "http://localhost:3003/api/auth"; + +export const getPublicContent = () => { + return axios.get(API_URL + "/all"); +}; + +export const getUserBoard = () => { + return axios.get(API_URL + "/user", { headers: authHeader() }); +}; + +export const getModeratorBoard = () => { + return axios.get(API_URL + "/mod", { headers: authHeader() }); +}; + +export const getAdminBoard = () => { + return axios.get(API_URL + "/admin", { headers: authHeader() }); +}; + +export const getUserProfile = (token: string) => { + return axios.get(API_URL + "/getuser", { + headers: { + "x-access-token": token, + }, + }); +}; + +export const updateUserProfile = (values: any, token: string) => { + return axios.patch(API_URL + "/updateprofile", values, { + headers: { + "x-access-token": token, + }, + }); +}; + +export const updateUserPassword = (data: any, token: string) => { + return axios.patch(API_URL + "/updatepassword", data, { + headers: { + "x-access-token": token, + }, + }); +}; diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json new file mode 100644 index 00000000..a273b0cf --- /dev/null +++ b/frontend/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "target": "es5", + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], + "allowJs": true, + "skipLibCheck": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "noFallthroughCasesInSwitch": true, + "module": "esnext", + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx" + }, + "include": [ + "src" + ] +} diff --git a/index.html b/index.html deleted file mode 100644 index 187c79af..00000000 --- a/index.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - PeerPrep - - - - -- - - - diff --git a/matching-service/.dockerignore b/matching-service/.dockerignore new file mode 100644 index 00000000..0604d78b --- /dev/null +++ b/matching-service/.dockerignore @@ -0,0 +1,2 @@ +**/node_modules +**/np-debug.log \ No newline at end of file diff --git a/matching-service/Dockerfile b/matching-service/Dockerfile new file mode 100644 index 00000000..47001dfe --- /dev/null +++ b/matching-service/Dockerfile @@ -0,0 +1,9 @@ +FROM node:alpine as build +WORKDIR /src/app +# Install app dependencies +COPY package*.json ./ +RUN npm install + +COPY . . +EXPOSE 3002 +CMD [ "node", "server.js" ] diff --git a/matching-service/Dockerfile.prod b/matching-service/Dockerfile.prod new file mode 100644 index 00000000..c0a1eb82 --- /dev/null +++ b/matching-service/Dockerfile.prod @@ -0,0 +1,11 @@ +FROM node:alpine as build +WORKDIR /src/app + +COPY package*.json ./ +RUN npm install + + +COPY . . +EXPOSE 3002 +CMD [ "node", "server.js" ] + diff --git a/matching-service/controllers/code.controller.js b/matching-service/controllers/code.controller.js new file mode 100644 index 00000000..54805009 --- /dev/null +++ b/matching-service/controllers/code.controller.js @@ -0,0 +1,64 @@ +// For calling OneCompiler for code run +const axios = require('axios'); + +const XApiKey = process.env.CDEX_KEY; +const XApiHost = process.env.CDEX_HOST; + +// Controller function to post a code execution/run attempt to OneCompiler +// USAGE: POST request to http://localhost:3002/api/code/run or +// (For testing third-party only) directly to https://onecompiler-apis.p.rapidapi.com/api/v1/run +exports.runcode = async (req, res) => { + + try { + const code = req.body.code; + const input = req.body.input; + const language = req.body.language; + const fileName = req.body.fileName; + + const upsertPromises = []; + + // Code retrieved from OneCompiler connected via RapidAPI + const options = { + method: 'POST', + url: 'https://onecompiler-apis.p.rapidapi.com/api/v1/run', + headers: { + 'content-type': 'application/json', + 'X-RapidAPI-Key': XApiKey, + 'X-RapidAPI-Host': XApiHost, + }, + data: { + language: language, + stdin: input, + files: [ + { + name: fileName, + content: code + } + ] + } + }; + + try { + const response = await axios.request(options); + upsertPromises.push(Promise.resolve(response.data)); + console.log("result of execution:", response.data); + } catch (error) { + upsertPromises.push(Promise.reject(error)); + console.error("error in controller:", error.response.data.message); + } + + Promise.all(upsertPromises) + .then((saves) => { + // Code successfully ran + res.status(200).send({ message: saves }); + }) + .catch((err) => { + res.status(500).send({ message: err.message }); + }); + + } catch (error) { + // Handle any unexpected errors that occur outside of the Promise chain + console.log("Run Code Controller Error => " + error); + res.status(500).send({ message: `req.body value is ${JSON.stringify(req.body)}` }); + } +}; diff --git a/matching-service/middleware/authJwt.js b/matching-service/middleware/authJwt.js new file mode 100644 index 00000000..2047c025 --- /dev/null +++ b/matching-service/middleware/authJwt.js @@ -0,0 +1,45 @@ +const axios = require('axios'); +const jwt = require("jsonwebtoken"); +const auth_server = process.env.USR_SVC_AUTH; + +verifyToken = async (req, res, next) => { + console.log('verifyToken middleware is running'); + + let token = req.headers["x-access-token"]; + + if (!token) { + return res.status(403).send({ + message: "No token provided!" + }); + } + + try { + // Make a request to user-service to verify the token + let response = await axios.get(`${auth_server}/verifyToken`, { + headers: { 'x-access-token': token } + }); + + // Check for HTTP 200 status code + if (response.status !== 200) { + return res.status(401).send({ + message: "Unauthorized!", + }); + } + // This is okay because we know the token is validated by the user-service + let decoded = jwt.decode(token); + req.userId = decoded.id; + next(); + } catch (error) { + console.error("Error verifying token with matching-service:", error.message); + console.log(error); + return res.status(500).send({ + message: "Internal server error" + }); + } +}; + +const authJwt = { + verifyToken: verifyToken, +}; + +module.exports = authJwt; diff --git a/matching-service/middleware/index.js b/matching-service/middleware/index.js new file mode 100644 index 00000000..08ce762e --- /dev/null +++ b/matching-service/middleware/index.js @@ -0,0 +1,5 @@ +const authJwt = require("./authJwt"); + +module.exports = { + authJwt +}; diff --git a/matching-service/package-lock.json b/matching-service/package-lock.json new file mode 100644 index 00000000..498dc0bc --- /dev/null +++ b/matching-service/package-lock.json @@ -0,0 +1,2713 @@ +{ + "name": "socketio", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "socketio", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "axios": "^1.5.1", + "cors": "^2.8.5", + "dotenv": "^16.3.1", + "express": "^4.18.2", + "mysql2": "^3.6.2", + "nodemon": "^3.0.1", + "sequelize": "^6.33.0", + "socket.io": "^4.7.2", + "socketio-jwt": "^4.6.2", + "sqlite3": "^5.1.6", + "uuid": "^9.0.1" + } + }, + "node_modules/@gar/promisify": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", + "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==", + "optional": true + }, + "node_modules/@mapbox/node-pre-gyp": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", + "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", + "dependencies": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" + } + }, + "node_modules/@npmcli/fs": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz", + "integrity": "sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==", + "optional": true, + "dependencies": { + "@gar/promisify": "^1.0.1", + "semver": "^7.3.5" + } + }, + "node_modules/@npmcli/move-file": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz", + "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==", + "deprecated": "This functionality has been moved to @npmcli/fs", + "optional": true, + "dependencies": { + "mkdirp": "^1.0.4", + "rimraf": "^3.0.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@socket.io/component-emitter": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz", + "integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==" + }, + "node_modules/@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "optional": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@types/cookie": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", + "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==" + }, + "node_modules/@types/cors": { + "version": "2.8.14", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.14.tgz", + "integrity": "sha512-RXHUvNWYICtbP6s18PnOCaqToK8y14DnLd75c6HfyKf228dxy7pHNOQkxPtvXKp/hINFMDjbYzsj63nnpPMSRQ==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/debug": { + "version": "4.1.9", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.9.tgz", + "integrity": "sha512-8Hz50m2eoS56ldRlepxSBa6PWEVCtzUo/92HgLc2qTMnotJNIm7xP+UZhyWoYsyOdd5dxZ+NZLb24rsKyFs2ow==", + "dependencies": { + "@types/ms": "*" + } + }, + "node_modules/@types/ms": { + "version": "0.7.32", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.32.tgz", + "integrity": "sha512-xPSg0jm4mqgEkNhowKgZFBNtwoEwF6gJ4Dhww+GFpm3IgtNseHQZ5IqdNwnquZEoANxyDAKDRAdVo4Z72VvD/g==" + }, + "node_modules/@types/node": { + "version": "20.6.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.6.3.tgz", + "integrity": "sha512-HksnYH4Ljr4VQgEy2lTStbCKv/P590tmPe5HqOnv9Gprffgv5WXAY+Y5Gqniu0GGqeTCUdBnzC3QSrzPkBkAMA==" + }, + "node_modules/@types/validator": { + "version": "13.11.3", + "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.11.3.tgz", + "integrity": "sha512-jxjhh33aTYDHnrV1vZ3AvWQHfrGx2f5UxKjaP13l5q04fG+/hCKKm0MfodIoCqxevhbcfBb6ZjynyHuQ/jueGQ==" + }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/agent-base/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/agent-base/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/agentkeepalive": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz", + "integrity": "sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==", + "optional": true, + "dependencies": { + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "optional": true, + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==" + }, + "node_modules/are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "node_modules/axios": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.1.tgz", + "integrity": "sha512-Q28iYCWzNHjAm+yEAot5QaAMxhMghWLFVf7rRdwhUI+c2jix2DUXjAHXVi+s1ibs3mjPO/cCgbA++3BjD0vP/A==", + "dependencies": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/base64id": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", + "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", + "engines": { + "node": "^4.5.0 || >= 5.9" + } + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "engines": { + "node": ">=8" + } + }, + "node_modules/body-parser": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/cacache": { + "version": "15.3.0", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", + "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", + "optional": true, + "dependencies": { + "@npmcli/fs": "^1.0.0", + "@npmcli/move-file": "^1.0.1", + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "glob": "^7.1.4", + "infer-owner": "^1.0.4", + "lru-cache": "^6.0.0", + "minipass": "^3.1.1", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.2", + "mkdirp": "^1.0.3", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^3.0.2", + "ssri": "^8.0.1", + "tar": "^6.0.2", + "unique-filename": "^1.1.1" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "engines": { + "node": ">=10" + } + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "optional": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "bin": { + "color-support": "bin.js" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==" + }, + "node_modules/denque": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/detect-libc": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", + "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/dotenv": { + "version": "16.3.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", + "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/motdotla/dotenv?sponsor=1" + } + }, + "node_modules/dottie": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/dottie/-/dottie-2.0.6.tgz", + "integrity": "sha512-iGCHkfUc5kFekGiqhe8B/mdaurD+lakO9txNnTvKtA6PISrw86LgqHvRzWYPyoE2Ph5aMIrCw9/uko6XHTKCwA==" + }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "optional": true, + "dependencies": { + "iconv-lite": "^0.6.2" + } + }, + "node_modules/encoding/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/engine.io": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.5.2.tgz", + "integrity": "sha512-IXsMcGpw/xRfjra46sVZVHiSWo/nJ/3g1337q9KNXtS6YRzbW5yIzTCb9DjhrBe7r3GZQR0I4+nq+4ODk5g/cA==", + "dependencies": { + "@types/cookie": "^0.4.1", + "@types/cors": "^2.8.12", + "@types/node": ">=10.0.0", + "accepts": "~1.3.4", + "base64id": "2.0.0", + "cookie": "~0.4.1", + "cors": "~2.8.5", + "debug": "~4.3.1", + "engine.io-parser": "~5.2.1", + "ws": "~8.11.0" + }, + "engines": { + "node": ">=10.2.0" + } + }, + "node_modules/engine.io-parser": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.1.tgz", + "integrity": "sha512-9JktcM3u18nU9N2Lz3bWeBgxVgOKpw7yhRaoxQA3FUDZzzw+9WlA6p4G4u0RixNkg14fH7EfEc/RhpurtiROTQ==", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/engine.io/node_modules/cookie": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", + "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/engine.io/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/engine.io/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "optional": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/err-code": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", + "optional": true + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.1", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.5.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.3", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", + "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "node_modules/gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/generate-function": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", + "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", + "dependencies": { + "is-property": "^1.0.2" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "optional": true + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==" + }, + "node_modules/http-cache-semantics": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", + "optional": true + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "optional": true, + "dependencies": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/http-proxy-agent/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "optional": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/http-proxy-agent/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "optional": true + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/https-proxy-agent/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/https-proxy-agent/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "optional": true, + "dependencies": { + "ms": "^2.0.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==" + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "optional": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "optional": true + }, + "node_modules/inflection": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/inflection/-/inflection-1.13.4.tgz", + "integrity": "sha512-6I/HUDeYFfuNCVS3td055BaXBwKYuzw7K3ExVMStBowKo9oOAMJIXIHvdyR3iboTCp1b+1i5DSkIZTcwIktuDw==", + "engines": [ + "node >= 0.4.0" + ] + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ip": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", + "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==", + "optional": true + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-lambda": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", + "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==", + "optional": true + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "optional": true + }, + "node_modules/jsonwebtoken": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", + "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==", + "dependencies": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^5.6.0" + }, + "engines": { + "node": ">=4", + "npm": ">=1.4.28" + } + }, + "node_modules/jsonwebtoken/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/jsonwebtoken/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "dependencies": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" + }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" + }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" + }, + "node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/make-fetch-happen": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", + "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", + "optional": true, + "dependencies": { + "agentkeepalive": "^4.1.3", + "cacache": "^15.2.0", + "http-cache-semantics": "^4.1.0", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^6.0.0", + "minipass": "^3.1.3", + "minipass-collect": "^1.0.2", + "minipass-fetch": "^1.3.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.2", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^6.0.0", + "ssri": "^8.0.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-collect": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", + "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-fetch": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz", + "integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==", + "optional": true, + "dependencies": { + "minipass": "^3.1.0", + "minipass-sized": "^1.0.3", + "minizlib": "^2.0.0" + }, + "engines": { + "node": ">=8" + }, + "optionalDependencies": { + "encoding": "^0.1.12" + } + }, + "node_modules/minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-sized": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", + "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/moment": { + "version": "2.29.4", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", + "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==", + "engines": { + "node": "*" + } + }, + "node_modules/moment-timezone": { + "version": "0.5.43", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.43.tgz", + "integrity": "sha512-72j3aNyuIsDxdF1i7CEgV2FfxM1r6aaqJyLB2vwb33mXYyoyLly+F1zbWqhA3/bVIoJ4szlUoMbUnVdid32NUQ==", + "dependencies": { + "moment": "^2.29.4" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/mysql2": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.6.2.tgz", + "integrity": "sha512-m5erE6bMoWfPXW1D5UrVwlT8PowAoSX69KcZzPuARQ3wY1RJ52NW9PdvdPo076XiSIkQ5IBTis7hxdlrQTlyug==", + "dependencies": { + "denque": "^2.1.0", + "generate-function": "^2.3.1", + "iconv-lite": "^0.6.3", + "long": "^5.2.1", + "lru-cache": "^8.0.0", + "named-placeholders": "^1.1.3", + "seq-queue": "^0.0.5", + "sqlstring": "^2.3.2" + }, + "engines": { + "node": ">= 8.0" + } + }, + "node_modules/mysql2/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/mysql2/node_modules/lru-cache": { + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-8.0.5.tgz", + "integrity": "sha512-MhWWlVnuab1RG5/zMRRcVGXZLCXrZTgfwMikgzCegsPnG62yDQo5JnqKkrK4jO5iKqDAZGItAqN5CtKBCBWRUA==", + "engines": { + "node": ">=16.14" + } + }, + "node_modules/named-placeholders": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.3.tgz", + "integrity": "sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==", + "dependencies": { + "lru-cache": "^7.14.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/named-placeholders/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "engines": { + "node": ">=12" + } + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/node-addon-api": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz", + "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==" + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-gyp": { + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz", + "integrity": "sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==", + "optional": true, + "dependencies": { + "env-paths": "^2.2.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^9.1.0", + "nopt": "^5.0.0", + "npmlog": "^6.0.0", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.2", + "which": "^2.0.2" + }, + "bin": { + "node-gyp": "bin/node-gyp.js" + }, + "engines": { + "node": ">= 10.12.0" + } + }, + "node_modules/node-gyp/node_modules/are-we-there-yet": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", + "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", + "optional": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/node-gyp/node_modules/gauge": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", + "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", + "optional": true, + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.3", + "console-control-strings": "^1.1.0", + "has-unicode": "^2.0.1", + "signal-exit": "^3.0.7", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.5" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/node-gyp/node_modules/npmlog": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", + "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", + "optional": true, + "dependencies": { + "are-we-there-yet": "^3.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^4.0.3", + "set-blocking": "^2.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/nodemon": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.0.1.tgz", + "integrity": "sha512-g9AZ7HmkhQkqXkRc20w+ZfQ73cHLbE8hnPbtaFbFtCumZsjyMhKk9LajQ07U5Ux28lvFjZ5X7HvWR1xzU8jHVw==", + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^3.2.7", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^7.5.3", + "simple-update-notifier": "^2.0.0", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/nodemon/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/nodemon/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npmlog": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "dependencies": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", + "integrity": "sha512-ncrLw+X55z7bkl5PnUvHwFK9FcGuFYo9gtjws2XtSzL+aZ8tm830P60WJ0dSmFVaSalWieW5MD7kEdnXda9yJw==" + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "optional": true, + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + }, + "node_modules/pg-connection-string": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.2.tgz", + "integrity": "sha512-ch6OwaeaPYcova4kKZ15sbJ2hKb/VP48ZD2gE7i1J+L4MspCtBMAx8nMgz7bksc7IojCIIWuEhHibSMFH8m8oA==" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", + "optional": true + }, + "node_modules/promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "optional": true, + "dependencies": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==" + }, + "node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", + "optional": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/retry-as-promised": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/retry-as-promised/-/retry-as-promised-7.0.4.tgz", + "integrity": "sha512-XgmCoxKWkDofwH8WddD0w85ZfqYz+ZHlr5yo+3YUCfycWawU56T5ckWXsScsj5B8tqUcIG67DxXByo3VUgiAdA==" + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/seq-queue": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz", + "integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==" + }, + "node_modules/sequelize": { + "version": "6.33.0", + "resolved": "https://registry.npmjs.org/sequelize/-/sequelize-6.33.0.tgz", + "integrity": "sha512-GkeCbqgaIcpyZ1EyXrDNIwktbfMldHAGOVXHGM4x8bxGSRAOql5htDWofPvwpfL/FoZ59CaFmfO3Mosv1lDbQw==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/sequelize" + } + ], + "dependencies": { + "@types/debug": "^4.1.8", + "@types/validator": "^13.7.17", + "debug": "^4.3.4", + "dottie": "^2.0.6", + "inflection": "^1.13.4", + "lodash": "^4.17.21", + "moment": "^2.29.4", + "moment-timezone": "^0.5.43", + "pg-connection-string": "^2.6.1", + "retry-as-promised": "^7.0.4", + "semver": "^7.5.4", + "sequelize-pool": "^7.1.0", + "toposort-class": "^1.0.1", + "uuid": "^8.3.2", + "validator": "^13.9.0", + "wkx": "^0.5.0" + }, + "engines": { + "node": ">=10.0.0" + }, + "peerDependenciesMeta": { + "ibm_db": { + "optional": true + }, + "mariadb": { + "optional": true + }, + "mysql2": { + "optional": true + }, + "oracledb": { + "optional": true + }, + "pg": { + "optional": true + }, + "pg-hstore": { + "optional": true + }, + "snowflake-sdk": { + "optional": true + }, + "sqlite3": { + "optional": true + }, + "tedious": { + "optional": true + } + } + }, + "node_modules/sequelize-pool": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/sequelize-pool/-/sequelize-pool-7.1.0.tgz", + "integrity": "sha512-G9c0qlIWQSK29pR/5U2JF5dDQeqqHRragoyahj/Nx4KOOQ3CPPfzxnfqFPCSB7x5UgjOgnZ61nSxz+fjDpRlJg==", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/sequelize/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/sequelize/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/sequelize/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + }, + "node_modules/simple-update-notifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", + "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "optional": true, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socket.io": { + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.7.2.tgz", + "integrity": "sha512-bvKVS29/I5fl2FGLNHuXlQaUH/BlzX1IN6S+NKLNZpBsPZIDH+90eQmCs2Railn4YUiww4SzUedJ6+uzwFnKLw==", + "dependencies": { + "accepts": "~1.3.4", + "base64id": "~2.0.0", + "cors": "~2.8.5", + "debug": "~4.3.2", + "engine.io": "~6.5.2", + "socket.io-adapter": "~2.5.2", + "socket.io-parser": "~4.2.4" + }, + "engines": { + "node": ">=10.2.0" + } + }, + "node_modules/socket.io-adapter": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.2.tgz", + "integrity": "sha512-87C3LO/NOMc+eMcpcxUBebGjkpMDkNBS9tf7KJqcDsmL936EChtVva71Dw2q4tQcuVC+hAUy4an2NO/sYXmwRA==", + "dependencies": { + "ws": "~8.11.0" + } + }, + "node_modules/socket.io-parser": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz", + "integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==", + "dependencies": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.1" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/socket.io-parser/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socket.io-parser/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/socket.io/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socket.io/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/socketio-jwt": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/socketio-jwt/-/socketio-jwt-4.6.2.tgz", + "integrity": "sha512-bcCnit/cCvqtC921Gwuqor+LpLKrpREmPACVgLfdbFBL95w2nPF7lOxsOxyeRrhc5Kot/1jUSW5+kLo23zJIMA==", + "dependencies": { + "jsonwebtoken": "^8.3.0", + "xtend": "~2.1.2" + } + }, + "node_modules/socks": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", + "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", + "optional": true, + "dependencies": { + "ip": "^2.0.0", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.13.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz", + "integrity": "sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==", + "optional": true, + "dependencies": { + "agent-base": "^6.0.2", + "debug": "^4.3.3", + "socks": "^2.6.2" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/socks-proxy-agent/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "optional": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socks-proxy-agent/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "optional": true + }, + "node_modules/sqlite3": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.6.tgz", + "integrity": "sha512-olYkWoKFVNSSSQNvxVUfjiVbz3YtBwTJj+mfV5zpHmqW3sELx2Cf4QCdirMelhM5Zh+KDVaKgQHqCxrqiWHybw==", + "hasInstallScript": true, + "dependencies": { + "@mapbox/node-pre-gyp": "^1.0.0", + "node-addon-api": "^4.2.0", + "tar": "^6.1.11" + }, + "optionalDependencies": { + "node-gyp": "8.x" + }, + "peerDependencies": { + "node-gyp": "8.x" + }, + "peerDependenciesMeta": { + "node-gyp": { + "optional": true + } + } + }, + "node_modules/sqlstring": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", + "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ssri": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", + "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", + "optional": true, + "dependencies": { + "minipass": "^3.1.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/tar": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz", + "integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==", + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tar/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/toposort-class": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toposort-class/-/toposort-class-1.0.1.tgz", + "integrity": "sha512-OsLcGGbYF3rMjPUf8oKktyvCiUxSbqMMS39m33MAjLTC1DVIH6x3WSt63/M77ihI09+Sdfk1AXvfhCEeUmC7mg==" + }, + "node_modules/touch": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", + "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", + "dependencies": { + "nopt": "~1.0.10" + }, + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, + "node_modules/touch/node_modules/nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "*" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==" + }, + "node_modules/unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "optional": true, + "dependencies": { + "unique-slug": "^2.0.0" + } + }, + "node_modules/unique-slug": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "optional": true, + "dependencies": { + "imurmurhash": "^0.1.4" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/validator": { + "version": "13.11.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.11.0.tgz", + "integrity": "sha512-Ii+sehpSfZy+At5nPdnyMhx78fEoPDkR2XW/zimHEL3MyGJQOCQ7WeP20jPYRz7ZCpcKLB21NxuXHF3bxjStBQ==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "optional": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, + "node_modules/wkx": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/wkx/-/wkx-0.5.0.tgz", + "integrity": "sha512-Xng/d4Ichh8uN4l0FToV/258EjMGU9MGcA0HV2d9B/ZpZB3lqQm7nkOdZdm5GhKtLLhAE7PiVQwN4eN+2YJJUg==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "node_modules/ws": { + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", + "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xtend": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", + "integrity": "sha512-vMNKzr2rHP9Dp/e1NQFnLQlwlhp9L/LfvnsVdHxN1f+uggyVI3i08uD14GPvCToPkdsRfyPqIyYGmIk58V98ZQ==", + "dependencies": { + "object-keys": "~0.4.0" + }, + "engines": { + "node": ">=0.4" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + } +} diff --git a/matching-service/package.json b/matching-service/package.json new file mode 100644 index 00000000..8465c0db --- /dev/null +++ b/matching-service/package.json @@ -0,0 +1,25 @@ +{ + "name": "socketio", + "version": "1.0.0", + "description": "", + "main": "server.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "axios": "^1.5.1", + "cors": "^2.8.5", + "dotenv": "^16.3.1", + "express": "^4.18.2", + "mysql2": "^3.6.2", + "nodemon": "^3.0.1", + "sequelize": "^6.33.0", + "socket.io": "^4.7.2", + "socketio-jwt": "^4.6.2", + "sqlite3": "^5.1.6", + "uuid": "^9.0.1" + } +} diff --git a/matching-service/routes/code.routes.js b/matching-service/routes/code.routes.js new file mode 100644 index 00000000..342b927f --- /dev/null +++ b/matching-service/routes/code.routes.js @@ -0,0 +1,16 @@ +const { authJwt } = require("../middleware"); +const controller = require('../controllers/code.controller'); + +module.exports = function (app) { + app.use(function (req, res, next) { + res.header( + 'Access-Control-Allow-Headers', + 'x-access-token, Origin, Content-Type, Accept' + ); + next(); + }); + + + app.post('/api/code/run', [authJwt.verifyToken], controller.runcode); + +}; diff --git a/matching-service/server.js b/matching-service/server.js new file mode 100644 index 00000000..ef97dabd --- /dev/null +++ b/matching-service/server.js @@ -0,0 +1,393 @@ +require("dotenv").config({ path: "../.env" }); +const express = require('express'); +const cors = require('cors'); +const http = require('http'); + +const { v4: uuidv4 } = require('uuid'); +// To keep track of active rooms +const rooms = new Map(); +// To keep track of users connected to socket +const users = new Map(); +// Use env file +require("dotenv").config({ path: "../.env" }); + +const app = express(); +const server = http.createServer(app); + +const socketIo = require('socket.io'); +const socketioJwt = require('socketio-jwt'); + +const QUESTION_HOST = process.env.QNS_SVC + ? process.env.QNS_SVC + : 'http://localhost:3000/api/questions'; + +const MATCHING_PORT = process.env.MTC_SVC_PORT + ? process.env.MTC_SVC_PORT + : 3002; + +const USER_SERVICE = process.env.USR_SVC_AUTH + ? process.env.USR_SVC_AUTH + : "http://localhost:3003/api/auth"; + +const io = socketIo(server, { + cors: { + origin: "*", + }, +}); + +// Verification +const axios = require('axios'); + +async function isTokenValid(accessToken) { + try { + const response = await axios.get(`${USER_SERVICE}/verifyToken`, { + headers: { "x-access-token":accessToken} + }); + return response.status === 200; + } catch (error) { + console.error('Error verifying token:', error); + return false; + } +} + +app.use(cors()); +app.use(express.json()); +app.use(express.urlencoded({ extended: true })); + +// Define after app.use +require('./routes/code.routes')(app); + +console.log("Server is starting...") + +server.listen(MATCHING_PORT, () => { + console.log(`Server is listening on port ${MATCHING_PORT}`); +}); + +app.get('/api/room/:roomId', async (req, res) => { + const roomId = req.params.roomId; + const roomInfo = rooms.get(roomId); + + // Check if roomInfo is defined + if (!roomInfo) { + console.log("Room not found."); + return res.status(404).send('Room not found'); + } + + // Check if accessToken1 or accessToken2 is undefined + if (roomInfo.accessToken1 === undefined || roomInfo.accessToken2 === undefined) { + console.log("One of the user's token is missing."); + return res.status(400).send("One of the user's token is missing"); + } + + // Access the access token from the room's data + const accessToken1 = roomInfo.accessToken1; + const accessToken2 = roomInfo.accessToken2; + + // Do the checks here + const user1Valid = await isTokenValid(accessToken1); + const user2Valid = await isTokenValid(accessToken2); + + // Display status of both users + console.log("User 1 get room validity: ", user1Valid); + console.log("User 2 get room validity: ", user2Valid); + + if (!user1Valid || !user2Valid) { + console.log("User not authorized to join room."); + return res.status(401).send("One of the user's token is invalid."); + } + + // Check if the room is still active + if (rooms.has(roomId)) { + // Check if user belongs in this room + const questionId = roomInfo.questionId; + fetch(QUESTION_HOST + `/${questionId}`, { + headers: { + "x-access-token": accessToken1, + }, + }) + .then((response) => { + if (!response.ok) { + throw new Error(`Failed to fetch data. Status: ${response.status}`); + } + return response.json(); + }) + .then((responseData) => { + res.json(responseData); + }) + .catch((error) => { + console.error('Error fetching data:', error); + res + .status(500) + .json({ error: 'Error fetching data from external API' }); + }); + } else { + // Room not found, throw 404 error to api request + res.status(404).send('Room not found'); + } +}); + +const waitingQueue = []; + +// Middleware to authenticate users using JWT token +// Can check token validity here +io.use(socketioJwt.authorize({ + secret: process.env.JWT_SECRET, + handshake: true, +})); + +io.on('connection', async (socket) => { + console.log('A user connected'); + console.log('User Token:', socket.decoded_token, "connected"); + + socket.on('match me', (selectedDifficulty, selectedTopic, selectedLanguage, accessToken) => { + const userId = socket.decoded_token.id; + console.log("--Waiting Queue--") + console.log(waitingQueue) + if (waitingQueue.find(user => user.userId === userId)) { + console.log('User is already in the queue and cannot self-match.'); + } else { + // Check if a match is found with another user + const matchingUserIndex = waitingQueue.findIndex( + (user) => user.selectedDifficulty === selectedDifficulty && user.selectedTopic === selectedTopic && user.selectedLanguage == selectedLanguage + ); + + if (matchingUserIndex !== -1) { + console.log('User match!'); + const user1 = waitingQueue.splice(matchingUserIndex, 1)[0]; + console.log("--Waiting Queue--") + console.log(waitingQueue) + startMatch(user1, socket, selectedDifficulty, selectedTopic, accessToken); + } else { + console.log('No user found'); + socket.userId = userId; + socket.selectedDifficulty = selectedDifficulty; + socket.selectedTopic = selectedTopic; + socket.selectedLanguage = selectedLanguage; + socket.accessToken = accessToken; + waitingQueue.push(socket); + console.log("--Waiting Queue--") + console.log(waitingQueue) + } + } + }); + + socket.on('cancel match', () => { + const index = waitingQueue.indexOf(socket); + if (index !== -1) { + waitingQueue.splice(index, 1); + console.log('Matching canceled by user'); + socket.emit('match canceled'); + } + console.log("--Waiting Queue--") + console.log(waitingQueue) + }); + + // Listen for the 'joinRoom' event from the client + socket.on('joinRoom', (roomId) => { + // Check if the user is in the specified room + if (rooms.has(roomId)) { + const roomInfo = rooms.get(roomId); + const user = socket.decoded_token; + + if (user === roomInfo.user1 || user === roomInfo.user2) { + socket.join(roomId); + socket.to(roomId).emit('userConnected'); + } else { + socket.emit('accessDenied', 'You are not authorized to join this room.'); + } + } else { + socket.emit('accessDenied', 'Room not found or no user information available.'); + } + }); + + // Listen for the 'codeChange' event from the client + socket.on('codeChange', (newCode, roomId) => { + // Check if the sender belongs to the same room + if (socket.rooms.has(roomId)) { + // Broadcast the code change only to sockets in the same room + socket.broadcast.to(roomId).emit('codeChange', newCode); + } + }); + + // Listen for the 'sendMessage' event from the client + socket.on('sendMessage', (data) => { + // Check if the sender belongs to the same room + if (socket.rooms.has(data.roomId)) { + // Broadcast the code change only to sockets in the same room + io.to(data.roomId).emit('receiveMessage', data); + } + }); + + socket.on('userTyping', (roomId, isTyping) => { + socket.to(roomId).emit('userTyping', isTyping); + }); + + // Listen for the 'disconnect' event from the client + socket.on('disconnect', () => { + console.log('A user disconnected'); + + // Search for the room this socket disconnected from + for (const [roomId, roomInfo] of rooms.entries()) { + // Compare socketid with user1Id and user2Id + if (socket.id === roomInfo.user1Id || socket.id === roomInfo.user2Id) { + socket.to(roomId).emit('userDisconnected', roomId); + socket.leave(roomId); + removeRoomSession(roomId); + break; // Guard clause + } + } + socket.leave(); + }); + + socket.on('timerEnd', (roomId) => { + console.log("The time has ended"); + // Check if the user is in the specified room + removeRoomSession(roomId); + socket.leave(roomId); + }); + + // Disconnect users in the session + socket.on('quitSession', (roomId) => { + console.log("A user clicked on quit session") + // Check if the user is in the specified room + if (socket.rooms.has(roomId)) { + // Emit an event to inform the other user the other party has left the session + socket.to(roomId).emit('quitSession'); + + // Remove the room from the 'rooms' map + removeRoomSession(roomId); + } + }); + + // Request submission from other user + socket.on('requestSubmitSession', (roomId, questionId, questionDifficulty, otherUserQuit) => { + console.log("A user clicked on submit session") + console.log("is user still with a peer? ", !otherUserQuit); + + // Check if the user is in the specified room + if (socket.rooms.has(roomId)) { + // Emit an event to inform the other user that the session is being submitted + + // If user is alone in the room (other user has quit) + if (otherUserQuit) { + socket.to(roomId).emit('submitSession'); + } else { + // Other user is still in the room, to request submission + socket.to(roomId).emit('requestSubmitSession', questionId, questionDifficulty); + } + } + }); + + // Reject submission request from other user + socket.on('rejectSubmitRequest', (roomId, questionId, questionDifficulty) => { + console.log("Other user has rejected the submit request") + + // Check if the user is in the specified room + if (socket.rooms.has(roomId)) { + // Emit an event to inform the other user that the submission request is rejected + socket.to(roomId).emit('rejectSubmitRequest', questionId, questionDifficulty); + } + }); + + // Submit data to sql history + socket.on('submitSession', (roomId, questionId, questionDifficulty) => { + console.log("A user clicked on submit session") + + // Check if the user is in the specified room + if (socket.rooms.has(roomId)) { + // Emit an event to inform the other user that the session is being submitted + socket.to(roomId).emit('submitSession', questionId, questionDifficulty); + // Leave the room + socket.leave(roomId); + } + }); + + // Submit data to sql history + socket.on('submitIndividualSession', (roomId, questionId, questionDifficulty) => { + console.log("A user clicked on submit session on timer end"); + socket.leave(roomId); + }); + + // Other user ran code + socket.on('codeRun',( roomId, ranCodeParams) => { + console.log("A user clicked on run code"); + socket.to(roomId).emit('codeRun', ranCodeParams); + }); +}); + +function removeRoomSession(roomId) { + if (rooms.delete(roomId)) { + console.log("Removed room with ID", roomId, "from rooms map."); + } else { + console.log("Room with ID", roomId, "not found in rooms map."); + } +} + +async function startMatch(user1Socket, user2Socket, selectedDifficulty, selectedTopic, accessToken) { + const roomId = uuidv4(); + + const accessToken1 = user1Socket.accessToken; + const accessToken2 = accessToken; + + const user1Valid = await isTokenValid(accessToken1); + const user2Valid = await isTokenValid(accessToken2); + + // Display status of both users + console.log("User 1 start match validity: ", user1Valid); + console.log("User 2 start match validity: ", user2Valid); + + if (!user1Valid) { + user1Socket.emit('error', 'Authentication failed.'); + console.log("User 1 is not valid") + return; // end the function + } + + if (!user2Valid) { + user2Socket.emit('error', 'Authentication failed.'); + console.log("User 2 is not valid") + return; // end the function + } + + generateQuestion(selectedDifficulty, selectedTopic, accessToken1, accessToken2) + .then((question) => { + if (question) { + console.log("Generate question") + rooms.set(roomId, { questionId: question._id, user1Id: user1Socket.id, user2Id: user2Socket.id, accessToken1: user1Socket.accessToken, accessToken2: accessToken }); + + user1Socket.emit('match found', roomId, 'You are matched with another user!'); + user2Socket.emit('match found', roomId, 'You are matched with another user!'); + + user1Socket.join(roomId); + user2Socket.join(roomId); + + user1Socket.emit('question', question._id); + user2Socket.emit('question', question._id); + } else { + console.error('Failed to fetch question.'); + } + }) + .catch((error) => { + console.error('Error generating question:', error); + }); +} + +async function generateQuestion(difficulty, topic, accessToken1, accessToken2) { + try { + const response = await fetch( + QUESTION_HOST + `/matched?difficulty=${difficulty}&topics=${topic}`, { + headers: { + "x-access-token": accessToken1, + "x-access-token2": accessToken2, + }, + } + ); + if (!response.ok) { + throw new Error(`Failed to fetch question. Status: ${response.status}`); + } + const responseData = await response.json(); + return responseData; + } catch (error) { + console.error('Error fetching data:', error); + return null; + } +} diff --git a/question-service/.dockerignore b/question-service/.dockerignore new file mode 100644 index 00000000..0604d78b --- /dev/null +++ b/question-service/.dockerignore @@ -0,0 +1,2 @@ +**/node_modules +**/np-debug.log \ No newline at end of file diff --git a/question-service/Dockerfile b/question-service/Dockerfile new file mode 100644 index 00000000..b25664b9 --- /dev/null +++ b/question-service/Dockerfile @@ -0,0 +1,9 @@ +FROM node:alpine as build +WORKDIR /src/app +# Install app dependencies +COPY package*.json ./ +RUN npm install + +COPY . . +EXPOSE 3000 +CMD [ "node", "server.js" ] diff --git a/question-service/Dockerfile.prod b/question-service/Dockerfile.prod new file mode 100644 index 00000000..b25664b9 --- /dev/null +++ b/question-service/Dockerfile.prod @@ -0,0 +1,9 @@ +FROM node:alpine as build +WORKDIR /src/app +# Install app dependencies +COPY package*.json ./ +RUN npm install + +COPY . . +EXPOSE 3000 +CMD [ "node", "server.js" ] diff --git a/question-service/controllers/questionController.js b/question-service/controllers/questionController.js new file mode 100644 index 00000000..910becf0 --- /dev/null +++ b/question-service/controllers/questionController.js @@ -0,0 +1,249 @@ +const Question = require('../models/question'); + +module.exports = { + // Controller function to get all questions where isDeleted is false + // Usage: Get request to http://localhost:3000/api/questions/ + getAllQuestions: (req, res) => { + Question.find({ isDeleted: false }) + .then((questions) => { + res.json(questions); + }) + .catch((error) => { + res.status(500).json({ error: 'Error fetching questions' }); + }); + }, + // Controller function to get first page paginated questions where isDeleted is false + // Usage: Get request to http://localhost:3000/api/questions/pagination/first + getFirstPaginatedQuestions: (req, res) => { + const perPage = 20; + + Question.find({ isDeleted: false }) + .limit(perPage) + .then((questions) => { + res.json(questions); + }) + .catch((error) => { + res.status(500).json({ error: 'Error fetching questions' }); + }); + }, + // Controller function to get remaining paginated questions where isDeleted is false + // Usage: Get request to http://localhost:3000/api/questions/pagination/remaining + getRemainingPaginatedQuestions: (req, res) => { + const perPage = 20; + Question.find({ isDeleted: false }) + .skip(perPage) + .then((questions) => { + res.json(questions); + }) + .catch((error) => { + res.status(500).json({ error: 'Error fetching questions' }); + }); + }, + // Controller function to get a question by its _id where isDeleted is false + // Usage: Get request to http://localhost:3000/api/questions/:id + getQuestionById: (req, res) => { + const { id } = req.params; // Get the _id from the request params + Question.findOne({ _id: id }) + .then((question) => { + if (!question) { + return res.status(404).json({ error: 'Question not found' }); + } + res.json(question); + }) + .catch((error) => { + res.status(500).json({ error: 'Error fetching question' }); + }); + }, + // Controller function to create a new question + // Usage: Post request to http://localhost:3000/api/questions + createQuestion: (req, res) => { + const { title, frontendQuestionId, difficulty, content, category, topics } = + req.body; + + // Check if a question with the same title already exists and not soft deleted + Question.findOne({ title, isDeleted: false }) + .then((existingQuestion) => { + if (existingQuestion) { + return res + .status(400) + .json({ error: 'Question with this title already exists' }); + } + + const newQuestion = new Question({ + title, + frontendQuestionId, + difficulty, + content, + category, + topics, + isDeleted: false // isDeleted with a default value of false + }); + + newQuestion + .save() + .then((question) => { + res.json(question); + }) + .catch((error) => { + res.status(500).json({ error: 'Error creating question' }); + }); + }) + .catch((error) => { + res.status(500).json({ error: 'Error checking for existing question' }); + }); + }, + // Controller function to update an existing question by ID + // Usage: Put request to http://localhost:3000/api/questions/{id} + updateQuestion: (req, res) => { + const { id } = req.params; // Get the question ID from the route parameters + + // Put only the fields that you want to change in the body + // Use x-www-form-urlencoded + const { title, frontendQuestionId, difficulty, content, category, topics } = + req.body; + + // Check if a question with the same title and not soft deleted other than itself already exists + Question.findOne({ title, isDeleted: false }) + .then((existingQuestion) => { + if (existingQuestion && existingQuestion.id != id) { + return res + .status(400) + .json({ error: 'Question with this title already exists' }); + } + + // Update the question + Question.findByIdAndUpdate( + id, + { + title, + frontendQuestionId, + difficulty, + content, + category, + topics, + }, + { new: true } // Return the updated document + ).then((question) => { + if (!question) { + return res.status(404).json({ error: 'Question not found' }); + } + res.json(question); + }); + }) + .catch((error) => { + res.status(500).json({ error: 'Error updating question' }); + }); + }, + // Controller function to soft delete a question by ID + // Usage: Patch request to http://localhost:3000/api/questions/{id} + softDeleteQuestion: (req, res) => { + const { id } = req.params; // Get the question ID from the route parameters + + Question.findByIdAndUpdate( + id, + { $set: { isDeleted: true } }, + { new: true } // Set this option to return the updated document + ) + .then((question) => { + if (!question) { + return res.status(404).json({ error: 'Question not found' }); + } + res.json({ message: 'Question soft deleted successfully' }); + }) + .catch((error) => { + res.status(500).json({ error: 'Error soft deleting question' }); + }); + }, + // Extra controller function to delete a question by ID + // Usage: Delete request to http://localhost:3000/api/questions/{id} + deleteQuestion: (req, res) => { + const { id } = req.params; // Get the question ID from the route parameters + + Question.findByIdAndRemove(id) + .then((question) => { + if (!question) { + return res.status(404).json({ error: 'Question not found' }); + } + res.json({ message: 'Question deleted successfully' }); + }) + .catch((error) => { + res.status(500).json({ error: 'Error deleting question' }); + }); + }, + // Controller function to get a random question via given filters + // Usage: GET request to http://localhost:3000/api/questions/matched?difficulty=Welcome to PeerPrep
-&topics= + getRandomQuestionByFilter: (req, res) => { + const { difficulty, topics } = req.query; // Get the difficulty level and topics from the query parameters + + // Define a filter object based on the provided difficulty level and topics + // Ensure that only questions that are not deleted are retrieved + const filter = { isDeleted: false }; + + if (difficulty) { + filter.difficulty = difficulty; + } + + if (topics) { + filter.topics = { $regex: `.*${topics}.*`, $options: 'i' }; // Match topics containing (case-insensitive) + } + + // Use the aggregate function to select a random question based on the filter + Question.aggregate([ + { $match: filter }, // Match questions that meet the filter criteria + { $sample: { size: 1 } }, // Select a random question (adjust 'size' for more questions) + ]) + .then((questions) => { + if (questions.length === 0) { + return res + .status(404) + .json({ error: 'No questions found for the given filter' }); + } + res.json(questions[0]); // Return the random question + }) + .catch((error) => { + res.status(500).json({ error: 'Error fetching random question' }); + }); + }, + // Controller function to get all question information for one user + // Usage: POST request to http://localhost:3000/api/questions/questionbyid + getQuestionsByIds: (req, res) => { + const { ids } = req.body; // Get an array of _ids from the request body + + + Question.find({ _id: { $in: ids } }) + .then((questions) => { + if (!questions || questions.length === 0) { + return res.status(404).json({ error: 'No questions found' }); + } + res.json(questions); + }) + .catch((error) => { + res.status(500).json({ error: 'Error fetching questions' }); + }); + }, + // controller function to separate the total number of questions + // Usage: GET request to http://localhost:3000/api/questions/total + getQuestionTotal: (req, res) => { + Question.aggregate([ + { + $group: { + _id: '$difficulty', + count: { $sum: 1 }, + }, + }, + { + $project: { + _id: 0, + difficulty: '$_id', + count: 1, + }, + }, + ]) + .then((question) => { + res.status(200).json(question); + }) + .catch((err) => { + console.log(err); + }); + }, +}; diff --git a/question-service/middleware/verifyUser2Token.js b/question-service/middleware/verifyUser2Token.js new file mode 100644 index 00000000..c8bac8ef --- /dev/null +++ b/question-service/middleware/verifyUser2Token.js @@ -0,0 +1,33 @@ +const axios = require('axios'); + +const auth_server = process.env.USR_SVC_AUTH; + +const verifyUser2Token = (req, res, next) => { + + const token = req.headers['x-access-token2']; + + if (!token) { + return res.status(403).send({ message: "Token 2 not provided!" }); + } + + axios.get(`${auth_server}/verifyToken`, { + headers: { 'x-access-token': token } + }) + .then(userResponse => { + if (userResponse.status === 200) { + next(); // The user is a valid user, proceed to the next middleware + } else { + // Forward the status code from the adminResponse + res.status(userResponse.status).send({ message: userResponse.data.message }); + } + }) + .catch(error => { + console.log(error); + // Forward the status code from the error response + const status = error.response ? error.response.status : 500; + const message = error.response ? error.response.data.message : "Internal Server Error"; + res.status(status).send({ message: message }); + }); +}; + +module.exports = verifyUser2Token; diff --git a/question-service/middleware/verifyUserAdmin.js b/question-service/middleware/verifyUserAdmin.js new file mode 100644 index 00000000..41423a28 --- /dev/null +++ b/question-service/middleware/verifyUserAdmin.js @@ -0,0 +1,34 @@ +const axios = require('axios'); + +const auth_server = process.env.USR_SVC_AUTH; + +const verifyUserAdmin = (req, res, next) => { + + const token = req.headers['x-access-token']; + + if (!token) { + return res.status(401).send({ message: "No token provided!" }); + } + + // Directly check if user is an admin + axios.get(`${auth_server}/verifyAdmin`, { + headers: { 'x-access-token': token } + }) + .then(adminResponse => { + if (adminResponse.status === 200) { + next(); // The user is a valid admin, proceed to the next middleware + } else { + // Forward the status code from the adminResponse + res.status(adminResponse.status).send({ message: adminResponse.data.message }); + } + }) + .catch(error => { + console.log(error); + // Forward the status code from the error response + const status = error.response ? error.response.status : 500; + const message = error.response ? error.response.data.message : "Internal Server Error"; + res.status(status).send({ message: message }); + }); +}; + +module.exports = verifyUserAdmin; diff --git a/question-service/middleware/verifyUserToken.js b/question-service/middleware/verifyUserToken.js new file mode 100644 index 00000000..8009d53a --- /dev/null +++ b/question-service/middleware/verifyUserToken.js @@ -0,0 +1,33 @@ +const axios = require('axios'); + +const auth_server = process.env.USR_SVC_AUTH; + +const verifyUserToken = (req, res, next) => { + + const token = req.headers['x-access-token']; + + if (!token) { + return res.status(401).send({ message: "Token not provided!" }); + } + + axios.get(`${auth_server}/verifyToken`, { + headers: { 'x-access-token': token } + }) + .then(userResponse => { + if (userResponse.status === 200) { + next(); // The user is a valid user, proceed to the next middleware + } else { + // Forward the status code from the userResponse + res.status(userResponse.status).send({ message: userResponse.data.message }); + } + }) + .catch(error => { + console.log(error); + // Forward the status code from the error response + const status = error.response ? error.response.status : 500; + const message = error.response ? error.response.data.message : "Internal Server Error"; + res.status(status).send({ message: message }); + }); +}; + +module.exports = verifyUserToken; diff --git a/question-service/models/question.js b/question-service/models/question.js new file mode 100644 index 00000000..763b63c0 --- /dev/null +++ b/question-service/models/question.js @@ -0,0 +1,15 @@ +const mongoose = require("mongoose"); + +const questionSchema = new mongoose.Schema({ + title: String, + frontendQuestionId: String, + difficulty: String, + content: String, + category: String, + topics: String, + isDeleted: { type: Boolean, default: false }, +}); + +const Question = mongoose.model("Question", questionSchema); + +module.exports = Question; diff --git a/question-service/package-lock.json b/question-service/package-lock.json new file mode 100644 index 00000000..96069493 --- /dev/null +++ b/question-service/package-lock.json @@ -0,0 +1,1340 @@ +{ + "name": "question-service", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "question-service", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "axios": "^1.5.1", + "body-parser": "^1.20.2", + "cors": "^2.8.5", + "dotenv": "^16.3.1", + "express": "^4.18.2", + "mongoose": "^7.5.1", + "nodemon": "^3.0.1" + } + }, + "node_modules/@mongodb-js/saslprep": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.0.tgz", + "integrity": "sha512-Xfijy7HvfzzqiOAhAepF4SGN5e9leLkMvg/OPOF97XemjfVCYN/oWa75wnkc6mltMSTwY+XlbhWgUOJmkFspSw==", + "optional": true, + "dependencies": { + "sparse-bitfield": "^3.0.3" + } + }, + "node_modules/@types/node": { + "version": "20.6.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.6.0.tgz", + "integrity": "sha512-najjVq5KN2vsH2U/xyh2opaSEz6cZMR2SetLIlxlj08nOcmPOemJmUK2o4kUzfLqfrWE0PIrNeE16XhYDd3nqg==" + }, + "node_modules/@types/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-xTE1E+YF4aWPJJeUzaZI5DRntlkY3+BCVJi0axFptnjGmAoWxkyREIh/XMrfxVLejwQxMCfDXdICo0VLxThrog==" + }, + "node_modules/@types/whatwg-url": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-8.2.2.tgz", + "integrity": "sha512-FtQu10RWgn3D9U4aazdwIE2yzphmTJREDqNdODHrbrZmmMqI0vMheC/6NE/J1Yveaj8H+ela+YwWTjq5PGmuhA==", + "dependencies": { + "@types/node": "*", + "@types/webidl-conversions": "*" + } + }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "node_modules/axios": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.1.tgz", + "integrity": "sha512-Q28iYCWzNHjAm+yEAot5QaAMxhMghWLFVf7rRdwhUI+c2jix2DUXjAHXVi+s1ibs3mjPO/cCgbA++3BjD0vP/A==", + "dependencies": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "engines": { + "node": ">=8" + } + }, + "node_modules/body-parser": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/bson": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/bson/-/bson-5.5.0.tgz", + "integrity": "sha512-B+QB4YmDx9RStKv8LLSl/aVIEV3nYJc3cJNNTK2Cd1TL+7P+cNpw9mAPeCgc5K+j01Dv6sxUzcITXDx7ZU3F0w==", + "engines": { + "node": ">=14.20.1" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/dotenv": { + "version": "16.3.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", + "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/motdotla/dotenv?sponsor=1" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.1", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.5.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/express/node_modules/body-parser": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/express/node_modules/raw-body": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.3", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", + "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "node_modules/get-intrinsic": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==" + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ip": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", + "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/kareem": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.5.1.tgz", + "integrity": "sha512-7jFxRVm+jD+rkq3kY0iZDJfsO2/t4BBPeEb2qKn2lR/9KhuksYk5hxzfRYWMPV8P/x2d0kHD306YyWLzjjH+uA==", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/memory-pager": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", + "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", + "optional": true + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mongodb": { + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-5.8.1.tgz", + "integrity": "sha512-wKyh4kZvm6NrCPH8AxyzXm3JBoEf4Xulo0aUWh3hCgwgYJxyQ1KLST86ZZaSWdj6/kxYUA3+YZuyADCE61CMSg==", + "dependencies": { + "bson": "^5.4.0", + "mongodb-connection-string-url": "^2.6.0", + "socks": "^2.7.1" + }, + "engines": { + "node": ">=14.20.1" + }, + "optionalDependencies": { + "@mongodb-js/saslprep": "^1.1.0" + }, + "peerDependencies": { + "@aws-sdk/credential-providers": "^3.188.0", + "@mongodb-js/zstd": "^1.0.0", + "kerberos": "^1.0.0 || ^2.0.0", + "mongodb-client-encryption": ">=2.3.0 <3", + "snappy": "^7.2.2" + }, + "peerDependenciesMeta": { + "@aws-sdk/credential-providers": { + "optional": true + }, + "@mongodb-js/zstd": { + "optional": true + }, + "kerberos": { + "optional": true + }, + "mongodb-client-encryption": { + "optional": true + }, + "snappy": { + "optional": true + } + } + }, + "node_modules/mongodb-connection-string-url": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-2.6.0.tgz", + "integrity": "sha512-WvTZlI9ab0QYtTYnuMLgobULWhokRjtC7db9LtcVfJ+Hsnyr5eo6ZtNAt3Ly24XZScGMelOcGtm7lSn0332tPQ==", + "dependencies": { + "@types/whatwg-url": "^8.2.1", + "whatwg-url": "^11.0.0" + } + }, + "node_modules/mongoose": { + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-7.5.1.tgz", + "integrity": "sha512-gJCkUtW3KgAu7Uf8HTVv+S3wf9+xldR5LFYM6mABJJQHQB0aWUGyC3bWsl2X/6dVHZSoQq3wh5UV7rWC4FrewA==", + "dependencies": { + "bson": "^5.4.0", + "kareem": "2.5.1", + "mongodb": "5.8.1", + "mpath": "0.9.0", + "mquery": "5.0.0", + "ms": "2.1.3", + "sift": "16.0.1" + }, + "engines": { + "node": ">=14.20.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mongoose" + } + }, + "node_modules/mongoose/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/mpath": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.9.0.tgz", + "integrity": "sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew==", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/mquery": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/mquery/-/mquery-5.0.0.tgz", + "integrity": "sha512-iQMncpmEK8R8ncT8HJGsGc9Dsp8xcgYMVSbs5jgnm1lFHTZqMJTUWTDx1LBO8+mK3tPNZWFLBghQEIOULSTHZg==", + "dependencies": { + "debug": "4.x" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/mquery/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/mquery/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/nodemon": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.0.1.tgz", + "integrity": "sha512-g9AZ7HmkhQkqXkRc20w+ZfQ73cHLbE8hnPbtaFbFtCumZsjyMhKk9LajQ07U5Ux28lvFjZ5X7HvWR1xzU8jHVw==", + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^3.2.7", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^7.5.3", + "simple-update-notifier": "^2.0.0", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/nodemon/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/nodemon/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "*" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==" + }, + "node_modules/punycode": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/sift": { + "version": "16.0.1", + "resolved": "https://registry.npmjs.org/sift/-/sift-16.0.1.tgz", + "integrity": "sha512-Wv6BjQ5zbhW7VFefWusVP33T/EM0vYikCaQ2qR8yULbsilAT8/wQaXvuQ3ptGLpoKx+lihJE3y2UTgKDyyNHZQ==" + }, + "node_modules/simple-update-notifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", + "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", + "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", + "dependencies": { + "ip": "^2.0.0", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.13.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/sparse-bitfield": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", + "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==", + "optional": true, + "dependencies": { + "memory-pager": "^1.0.2" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/touch": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", + "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", + "dependencies": { + "nopt": "~1.0.10" + }, + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, + "node_modules/tr46": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", + "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", + "dependencies": { + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==" + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-url": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", + "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", + "dependencies": { + "tr46": "^3.0.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + } +} diff --git a/question-service/package.json b/question-service/package.json new file mode 100644 index 00000000..ad0be05e --- /dev/null +++ b/question-service/package.json @@ -0,0 +1,21 @@ +{ + "name": "question-service", + "version": "1.0.0", + "description": "", + "main": "server.js", + "scripts": { + "dev": "nodemon server.js", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "axios": "^1.5.1", + "body-parser": "^1.20.2", + "cors": "^2.8.5", + "dotenv": "^16.3.1", + "express": "^4.18.2", + "mongoose": "^7.5.1", + "nodemon": "^3.0.1" + } +} diff --git a/question-service/routes/questionRoutes.js b/question-service/routes/questionRoutes.js new file mode 100644 index 00000000..b3db0647 --- /dev/null +++ b/question-service/routes/questionRoutes.js @@ -0,0 +1,100 @@ +const express = require("express"); +const router = express.Router(); +const questionController = require("../controllers/questionController"); +const verifyUserToken = require("../middleware/verifyUserToken"); +const verifyUserAdmin = require("../middleware/verifyUserAdmin"); +const verifyUser2Token = require("../middleware/verifyUser2Token"); + +// Route for retrieving questions +// Endpoint for retrieving all questions +// Returns: +// 200 OK on success +// 401 Unauthorized if not authenticated or no token provided +// 500 on Unexpected errors +router.get("/", verifyUserToken, questionController.getAllQuestions); + +// Endpoint for retrieving first page paginated questions +// Returns: +// 200 OK on success +// 401 Unauthorized if not authenticated or no token provided +// 500 on Unexpected errors +router.get( + "/pagination/first", + verifyUserToken, + questionController.getFirstPaginatedQuestions +); + +// Endpoint for retrieving remaining paginated questions +// Returns: +// 200 OK on success +// 401 Unauthorized if not authenticated or no token provided +// 500 on Unexpected errors +router.get( + "/pagination/remaining", + verifyUserToken, + questionController.getRemainingPaginatedQuestions +); + +// Endpoint for retrieving a question for matched users +// Returns: +// 200 OK on success +// 401 Unauthorized if not authenticated or no token provided +// 403 Forbidden if second user is not authenticated +// 500 on Unexpected errors +router.get( + "/matched", + [verifyUserToken, verifyUser2Token], + questionController.getRandomQuestionByFilter +); + +// Endpoint for getting total number of questions for each difficulty +// Returns: +// 200 OK on success +router.get("/total", questionController.getQuestionTotal); + +// Endpoint for retrieving all questions given a list of question ids +// Returns: +// 200 OK on success +// 401 Unauthorized if not authenticated or no token provided +// 403 Forbidden if user is not an admin +// 404 Not Found if question not found +// 500 on Unexpected errors +router.post("/questionbyid", questionController.getQuestionsByIds); + +// Endpoint for creating a new question +// Returns: +// 200 OK on success +// 400 Bad Request if it's a repeated question +// 401 Unauthorized if not authenticated or no token provided +// 403 Forbidden if user is not an admin +// 500 on Unexpected errors +router.post("/", verifyUserAdmin, questionController.createQuestion); + +// Endpoint for updating a question +// Returns: +// 200 OK on success +// 400 Bad Request if it's a repeated question +// 401 Unauthorized if not authenticated or no token provided +// 403 Forbidden if user is not an admin +// 404 Not Found if question not found +// 500 on Unexpected errors +router.put("/:id", verifyUserAdmin, questionController.updateQuestion); + +// Endpoint for retrieving a question by id +// Returns: +// 200 OK on success +// 401 Unauthorized if not authenticated or no token provided +// 404 Not Found if question not found +// 500 on Unexpected errors +router.get("/:id", verifyUserToken, questionController.getQuestionById); + +// Endpoint for soft deleting a question +// Returns: +// 200 OK on success +// 401 Unauthorized if not authenticated or no token provided +// 403 Forbidden if user is not an admin +// 404 Not Found if question not found +// 500 on Unexpected errors +router.patch("/:id", verifyUserAdmin, questionController.softDeleteQuestion); + +module.exports = router; diff --git a/question-service/server.js b/question-service/server.js new file mode 100644 index 00000000..1b4fe4d1 --- /dev/null +++ b/question-service/server.js @@ -0,0 +1,55 @@ +// Use env file +require("dotenv").config({ path: "../.env" }); +const cors = require("cors"); +const express = require("express"); +const mongoose = require("mongoose"); +const bodyParser = require("body-parser"); // For parsing JSON request bodies +const questionRoutes = require("./routes/questionRoutes"); + +const app = express(); + +// Enable CORS for all routes +app.use(cors()); + +// Parse JSON request bodies +app.use(bodyParser.json()); + +app.use(bodyParser.urlencoded({ extended: true })); + +const PORT = process.env.QNS_SVC_PORT || 3000; +app.listen(PORT, () => { + console.log(`Server has started! Open http://localhost:${PORT}`); +}); + +// MongoDB Atlas credentials +const dbUsername = encodeURIComponent(process.env.MONGO_USERNAME); +const dbPassword = encodeURIComponent(process.env.MONGO_PASSWORD); +const clusterUrl = process.env.MONGO_HOST; +const dbName = "questions"; + +// Connection URI for MongoDB Atlas +const uri = `mongodb+srv://${dbUsername}:${dbPassword}@${clusterUrl}/${dbName}?retryWrites=true&w=majority`; + +// Establish the MongoDB connection +mongoose.connect(uri, { + useNewUrlParser: true, + useUnifiedTopology: true, +}); + +// Check for MongoDB Atlas connection +const db = mongoose.connection; + +db.on("error", (error) => { + console.error("MongoDB connection error:", error); +}); +db.once("open", () => { + console.log("Connected to MongoDB"); +}); + +// Use the question routes +app.use("/api/questions", questionRoutes); + +// The root route +app.get("/", (req, res) => { + res.json({ message: "Hello Crud Node Express" }); +}); diff --git a/src/index.js b/src/index.js deleted file mode 100644 index f10008df..00000000 --- a/src/index.js +++ /dev/null @@ -1 +0,0 @@ -// index.js diff --git a/user-service/.dockerignore b/user-service/.dockerignore new file mode 100644 index 00000000..0604d78b --- /dev/null +++ b/user-service/.dockerignore @@ -0,0 +1,2 @@ +**/node_modules +**/np-debug.log \ No newline at end of file diff --git a/user-service/Dockerfile b/user-service/Dockerfile new file mode 100644 index 00000000..fe1c45ef --- /dev/null +++ b/user-service/Dockerfile @@ -0,0 +1,11 @@ +FROM node:latest as build +WORKDIR /src/app +# Install app dependencies + +COPY package*.json ./ +RUN npm install + +# Bundle app source +COPY . . +EXPOSE 3003 +CMD [ "node", "server.js" ] diff --git a/user-service/Dockerfile.prod b/user-service/Dockerfile.prod new file mode 100644 index 00000000..7e463f8c --- /dev/null +++ b/user-service/Dockerfile.prod @@ -0,0 +1,10 @@ +FROM node:alpine as build +WORKDIR /src/app + +# Install app dependencies +COPY package*.json ./ +RUN npm install + +COPY . . +EXPOSE 3003 +CMD [ "node", "server.js" ] \ No newline at end of file diff --git a/user-service/config/auth.config.js b/user-service/config/auth.config.js new file mode 100644 index 00000000..33ca1fd0 --- /dev/null +++ b/user-service/config/auth.config.js @@ -0,0 +1,6 @@ +const dotenv = require('dotenv').config({ path: '../.env' }); + +// This takes the JWT_SECRET from the .env file and exports it to be used in other files +module.exports = { + secret: process.env.JWT_SECRET +}; diff --git a/user-service/config/db.config.js b/user-service/config/db.config.js new file mode 100644 index 00000000..7603f9f5 --- /dev/null +++ b/user-service/config/db.config.js @@ -0,0 +1,17 @@ +const dotenv = require('dotenv').config({ path: '../.env' }); + +// This takes the SQL_HOST, SQL_USERNAME, and SQL_PASSWORD from the .env file and exports it to be used in other files +// It also configures the dialect to be used by Sequelize +module.exports = { + HOST: process.env.SQL_HOST, + USER: process.env.SQL_USERNAME, + PASSWORD: process.env.SQL_PASSWORD, + DB: "user", + dialect: 'mysql', + pool: { + max: 5, + min: 0, + acquire: 30000, + idle: 10000, + }, +}; diff --git a/user-service/controllers/auth.controller.js b/user-service/controllers/auth.controller.js new file mode 100644 index 00000000..fe4e3a97 --- /dev/null +++ b/user-service/controllers/auth.controller.js @@ -0,0 +1,231 @@ +const db = require('../models'); +const config = require('../config/auth.config'); +const User = db.user; +const Role = db.role; + +const Op = db.Sequelize.Op; + +var jwt = require('jsonwebtoken'); +var bcrypt = require('bcryptjs'); + +exports.signup = (req, res) => { + // Save User to Database + User.create({ + username: req.body.username, + email: req.body.email, + password: bcrypt.hashSync(req.body.password, 8), + }) + .then((user) => { + // If there are roles to be set, find them and set them. + if (req.body.roles) { + Role.findAll({ + where: { + name: { + [Op.or]: req.body.roles, + }, + }, + }).then((roles) => { + // If there are roles to be set, find them and set them. + user.setRoles(roles).then(() => { + res.send({ message: 'User registered successfully!' }); + }); + }); + } else { + // Else, set as normal user + // 1 = Role_User + // 2 = Role_Admin + user.setRoles([1]).then(() => { + res.send({ message: 'User registered successfully!' }); + }); + } + }) + .catch((err) => { + res.status(500).send({ message: err.message }); + }); +}; + +exports.signin = (req, res) => { + // Find the user with username + User.findOne({ + where: { + username: req.body.username, + }, + }) + .then((user) => { + // If user not found, return 401 + if (!user) { + return res.status(401).send({ message: 'Invalid username or password' }); + } + + var passwordIsValid = bcrypt.compareSync( + req.body.password, + user.password + ); + + // If password is invalid, return 401 + if (!passwordIsValid) { + return res.status(401).send({ + accessToken: null, + message: 'Invalid username or password', + }); + } + + // If user is found and password is valid, create token + const token = jwt.sign({ id: user.id }, config.secret, { + algorithm: 'HS256', + allowInsecureKeySizes: true, + expiresIn: 86400, // 24 hours + }); + + // Get roles and send response with token + var authorities = []; + user.getRoles().then((roles) => { + for (let i = 0; i < roles.length; i++) { + authorities.push('ROLE_' + roles[i].name.toUpperCase()); + } + res.status(200).send({ + id: user.id, + username: user.username, + email: user.email, + roles: authorities, + accessToken: token, + }); + }); + }) + .catch((err) => { + res.status(500).send({ message: err.message }); + }); +}; + +exports.removeUser = (req, res) => { + + // Extract the id from request + const id = req.userId; + + // Find the user with id + User.findOne({ + where: { + id: id, + }, + }) + .then((user) => { + // If user not found, return 404 + if (!user) { + return res.status(404).send({ message: 'User Not found.' }); + } + // Else, delete the user + user.destroy(); + res.status(200).send({ message: 'User deleted successfully!' }); + }) + .catch((err) => { + res.status(500).send({ message: err.message }); + }); +}; + +exports.updateProfile = (req, res) => { + // Extract the id from request + const id = req.userId; + // Extract the username and email from request + const { username, email } = req.body; + + // Find the user with id + User.findOne({ + where: { + id: id, + }, + }) + .then((user) => { + // If user not found, return 404 + if (!user) { + return res.status(404).send({ message: 'User Not found.' }); + } + // Else, update the user + user.update({ + username, + email, + }); + res.status(200).send({ message: 'User updated successfully!' }); + }) + .catch((err) => { + res.status(500).send({ message: err.message }); + }); +}; + +exports.updatePassword = (req, res) => { + + // Extract the id from request + const id = req.userId; + // Extract the current password and new password from request + const { currentPassword, newPassword } = req.body; + + // Find the user with id + User.findOne({ + where: { id: id }, + }).then((user) => { + // If user not found, return 404 + if (!user) { + return res.status(404).send({ message: 'User Not found.' }); + } + var passwordIsValid = bcrypt.compareSync(currentPassword, user.password); + // If password is invalid, return 401 + if (!passwordIsValid) { + return res.status(401).send({ + accessToken: null, + message: 'Invalid Password!', + }); + } + // Else, update the user + user.update({ + password: bcrypt.hashSync(newPassword, 8), + }); + res.status(200).send({ message: 'Password updated successfully!' }); + }); +}; + +exports.getProfile = (req, res) => { + + // Extract the id from request + const id = req.userId; + + // Find the user with id + User.findOne({ + where: { + id: id, + }, + }) + .then((user) => { + // If user not found, return 404 + if (!user) { + return res.status(404).send({ message: 'User Not found.' }); + } + + // Else, send the user + var authorities = []; + user.getRoles().then((roles) => { + for (let i = 0; i < roles.length; i++) { + authorities.push('ROLE_' + roles[i].name.toUpperCase()); + } + res.status(200).send({ + id: user.id, + username: user.username, + email: user.email, + roles: authorities, + }); + }); + }) + .catch((err) => { + res.status(500).send({ message: err.message }); + }); +}; + +exports.verifyToken = (req, res) => { + // If the middleware successfully verified the token, the user is authenticated. + // Return successful response to the client here. + res.status(200).send({ message: "Token is valid." }); +}; + +exports.verifyAdmin = (req, res) => { + // If the middleware successfully verified the token, and is admin. + // Return successful response to the client here. + res.status(200).send({ message: "User is admin." }); +}; diff --git a/user-service/controllers/history.controller.js b/user-service/controllers/history.controller.js new file mode 100644 index 00000000..074b3bce --- /dev/null +++ b/user-service/controllers/history.controller.js @@ -0,0 +1,139 @@ +const db = require("../models"); +const config = require("../config/auth.config"); +const UserQuestions = db.userQuestions; +const User = db.user; +const Op = db.Sequelize.Op; +const sequelize = db.Sequelize; + +// Controller function to create a user history +// Usage: Post request to http://localhost:3003/api/hist/save +exports.addHistory = async (req, res) => { + try { + const userId = req.userId; + const question_id = req.body.questionId; + const difficulty = req.body.difficulty; + const attempt = req.body.attempt; + + if (!question_id || !difficulty || !attempt) { + return res.status(400).send({ + message: + "Invalid request data. Check if there are missing parameters or empty user ids.", + }); + } + + // Create an array to store the promises for creating rows + const upsertPromises = []; + + try { + const [record, created] = await UserQuestions.findOrCreate({ + where: { userId: userId, question_id: question_id }, + defaults: { + difficulty: difficulty, + attemptedAt: db.sequelize.literal("CURRENT_TIMESTAMP"), + attempt: attempt, + }, + }); + + // Insert or update record done by .update + await UserQuestions.update( + { + difficulty: difficulty, + attemptedAt: db.sequelize.literal("CURRENT_TIMESTAMP"), + attempt: attempt, + }, + { + where: { userId: userId, question_id: question_id }, + } + ); + + upsertPromises.push(Promise.resolve("Record executed successfully.")); + } catch (error) { + upsertPromises.push(Promise.reject(error)); + } + + // Execute all promises and respond once they are all completed + Promise.all(upsertPromises) + .then((saves) => { + // All rows have been successfully created + res.status(200).send({ message: saves }); + }) + .catch((err) => { + // Handle any errors that occurred during Promise execution + res.status(500).send({ message: err.message }); + }); + } catch (error) { + // Handle any unexpected errors that occur outside of the Promise chain + res.status(500).send({ + message: `Error outside of promise chain, req.body value is ${JSON.stringify( + req.body + )}`, + }); + } +}; + +// Controller function to create a user history with custom date +// Usage: Post request to http://localhost:3003/api/hist/customsave +exports.addCustomHistory = (req, res) => { + const userId = req.userId; + const { questionId, difficulty, attempt, date } = req.body; + + UserQuestions.create({ + userId: userId, + question_id: questionId, + attemptedAt: new Date(date), + difficulty: difficulty, + attempt: attempt, + }) + .then((userQuestions) => { + res.status(200).send({ message: "User Questions added successfully!" }); + }) + .catch((err) => { + res.status(500).send({ message: err.message }); + }); +}; + +// Controller function to get all questions id for one user +// Usage: Get request to http://localhost:3003/api/hist/get +exports.getAllQuestions = (req, res) => { + const userId = req.userId; + + UserQuestions.findAll({ + where: { userId: userId }, + order: [["attemptedAt", "ASC"]], + attributes: ["question_id", "attemptedAt", "difficulty", "attempt"], + }) + .then((userQuestions) => { + if (userQuestions) { + return res.status(200).send(userQuestions); + } + return res.status(404).send({ message: "User Questions not found!" }); + }) + .catch((err) => { + res.status(500).send({ message: err.message }); + }); +}; + +// Controller function to get all questions attempt date for one user +// Usage: Get request to http://localhost:3003/api/hist/attempts +exports.getAttemptedDates = (req, res) => { + const userId = req.userId; + + UserQuestions.findAll({ + where: { userId: userId }, + order: [["attemptedAt", "ASC"]], + attributes: [ + ["attemptedAt", "date"], + [sequelize.fn("COUNT", sequelize.col("attemptedAt")), "count"], + ], + group: ["attemptedAt"], + }) + .then((userQuestions) => { + if (userQuestions) { + return res.status(200).send(userQuestions); + } + return res.status(404).send({ message: "User Questions not found!" }); + }) + .catch((err) => { + res.status(500).send({ message: err.message }); + }); +}; diff --git a/user-service/middleware/authJwt.js b/user-service/middleware/authJwt.js new file mode 100644 index 00000000..51f0bcac --- /dev/null +++ b/user-service/middleware/authJwt.js @@ -0,0 +1,51 @@ +const jwt = require("jsonwebtoken"); +const config = require("../config/auth.config.js"); +const db = require("../models"); +const User = db.user; + +verifyToken = (req, res, next) => { + + let token = req.headers["x-access-token"]; + + if (!token) { + return res.status(401).send({ + message: "No token provided!" + }); + } + + jwt.verify(token, + config.secret, + (err, decoded) => { + if (err) { + return res.status(401).send({ + message: "Unauthorized!", + }); + } + req.userId = decoded.id; + next(); + }); +}; + +isAdmin = (req, res, next) => { + User.findByPk(req.userId).then(user => { + user.getRoles().then(roles => { + for (let i = 0; i < roles.length; i++) { + if (roles[i].name === "admin") { + next(); + return; + } + } + + res.status(403).send({ + message: "Not Admin!" + }); + return; + }); + }); +}; + +const authJwt = { + verifyToken: verifyToken, + isAdmin: isAdmin, +}; +module.exports = authJwt; diff --git a/user-service/middleware/index.js b/user-service/middleware/index.js new file mode 100644 index 00000000..78a34145 --- /dev/null +++ b/user-service/middleware/index.js @@ -0,0 +1,7 @@ +const authJwt = require("./authJwt"); +const verifySignUp = require("./verifySignUp"); + +module.exports = { + authJwt, + verifySignUp +}; diff --git a/user-service/middleware/verifyExisting.js b/user-service/middleware/verifyExisting.js new file mode 100644 index 00000000..db47f97a --- /dev/null +++ b/user-service/middleware/verifyExisting.js @@ -0,0 +1,58 @@ +const db = require('../models'); +const ROLES = db.ROLES; +const User = db.user; +const { Op } = require("sequelize"); + +checkExistingUsername = (req, res, next) => { + const userId = req.userId; + const { username } = req.body; + // Username + User.count({ + where: { + username: username, + id: { + [Op.not]: userId, + }, + }, + }).then((count) => { + // If this username is already in use, send 400 error + if (count > 0) { + res.status(400).send({ + message: 'Failed! Username is already in use!', + }); + return; + } + next(); + }); +}; + +checkExistingEmail = (req, res, next) => { + const userId = req.userId; + const { email } = req.body; + // Username + User.findOne({ + where: { + email: email, + id: { + [Op.not]: userId, + }, + }, + }).then((count) => { + // If this email is already in use, send 400 error + if (count) { + res.status(400).send({ + message: 'Failed! Email is already in use!', + }); + return; + } + next(); + }); +}; + + + const verifyExisting = { + checkEmail: checkExistingEmail, + checkUsername: checkExistingUsername, + }; + + module.exports = verifyExisting; \ No newline at end of file diff --git a/user-service/middleware/verifySignUp.js b/user-service/middleware/verifySignUp.js new file mode 100644 index 00000000..bf4b6c61 --- /dev/null +++ b/user-service/middleware/verifySignUp.js @@ -0,0 +1,62 @@ +const db = require('../models'); +const ROLES = db.ROLES; +const User = db.user; +const { Op } = require("sequelize"); + + +checkDuplicateUsernameOrEmail = (req, res, next) => { + // Username + User.findOne({ + where: { + username: req.body.username, + }, + }).then((user) => { + // If this username is already in use, send 400 error + if (user) { + res.status(400).send({ + message: 'Failed! Username is already in use!', + }); + return; + } + + // Email + User.findOne({ + where: { + email: req.body.email, + }, + }).then((user) => { + // If this email is already in use, send 400 error + if (user) { + res.status(400).send({ + message: 'Failed! Email is already in use!', + }); + return; + } + + next(); + }); + }); +}; + +checkRolesExisted = (req, res, next) => { + if (req.body.roles) { + for (let i = 0; i < req.body.roles.length; i++) { + // If the role is not in the list of ROLES, send 400 error + if (!ROLES.includes(req.body.roles[i])) { + res.status(400).send({ + message: 'Failed! Role does not exist = ' + req.body.roles[i], + }); + return; + } + } + } + + next(); +}; + +const verifySignUp = { + checkDuplicateUsernameOrEmail: checkDuplicateUsernameOrEmail, + checkRolesExisted: checkRolesExisted, +}; + +module.exports = verifySignUp; diff --git a/user-service/models/index.js b/user-service/models/index.js new file mode 100644 index 00000000..b8290605 --- /dev/null +++ b/user-service/models/index.js @@ -0,0 +1,36 @@ +const config = require('../config/db.config.js'); + +const Sequelize = require('sequelize'); +const sequelize = new Sequelize(config.DB, config.USER, config.PASSWORD, { + host: config.HOST, + dialect: config.dialect, + pool: { + max: config.pool.max, + min: config.pool.min, + acquire: config.pool.acquire, + idle: config.pool.idle, + }, +}); + +const db = {}; + +db.Sequelize = Sequelize; +db.sequelize = sequelize; + +db.user = require('../models/user.model.js')(sequelize, Sequelize); +db.role = require('../models/role.model.js')(sequelize, Sequelize); +db.userQuestions = require('../models/userQuestions.model.js')(sequelize, Sequelize); + +db.role.belongsToMany(db.user, { + through: 'user_roles', +}); +db.user.belongsToMany(db.role, { + through: 'user_roles', +}); + +db.user.hasMany(db.userQuestions); + +db.ROLES = ['user', 'admin']; +db.DIFFICULTY = ['Easy', 'Medium', 'Hard']; + +module.exports = db; diff --git a/user-service/models/role.model.js b/user-service/models/role.model.js new file mode 100644 index 00000000..3952636d --- /dev/null +++ b/user-service/models/role.model.js @@ -0,0 +1,14 @@ +module.exports = (sequelize, Sequelize) => { + const Role = sequelize.define("roles", { + id: { + type: Sequelize.INTEGER, + primaryKey: true, + }, + name: { + type: Sequelize.STRING, + allowNull: false + } + }); + + return Role; +}; diff --git a/user-service/models/user.model.js b/user-service/models/user.model.js new file mode 100644 index 00000000..9dc6d327 --- /dev/null +++ b/user-service/models/user.model.js @@ -0,0 +1,18 @@ +module.exports = (sequelize, Sequelize) => { + const User = sequelize.define("users", { + username: { + type: Sequelize.STRING, + allowNull: false + }, + email: { + type: Sequelize.STRING, + allowNull: false + }, + password: { + type: Sequelize.STRING, + allowNull: false + } + }); + + return User; +}; diff --git a/user-service/models/userQuestions.model.js b/user-service/models/userQuestions.model.js new file mode 100644 index 00000000..720d89ca --- /dev/null +++ b/user-service/models/userQuestions.model.js @@ -0,0 +1,28 @@ +module.exports = (sequelize, Sequelize) => { + const userQuestions = sequelize.define("userQuestions", { + userId: { + type: Sequelize.INTEGER, + primaryKey: true, + allowNull: false, + }, + question_id: { + type: Sequelize.UUID, // Use UUID for MongoDB ObjectIds + primaryKey: true, + allowNull: false, + }, + difficulty: { + type: Sequelize.ENUM("Hard", "Medium", "Easy"), + }, + attemptedAt: { + type: Sequelize.DATE, + primaryKey: true, + allowNull: false + }, + attempt: { + type: Sequelize.TEXT, + allowNull: false + }, + }); + + return userQuestions; +}; diff --git a/user-service/package-lock.json b/user-service/package-lock.json new file mode 100644 index 00000000..97c43ae2 --- /dev/null +++ b/user-service/package-lock.json @@ -0,0 +1,1045 @@ +{ + "name": "backend", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "backend", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "bcryptjs": "^2.4.3", + "cors": "^2.8.5", + "dotenv": "^16.3.1", + "express": "^4.18.2", + "jsonwebtoken": "^9.0.0", + "mysql2": "^2.3.3", + "sequelize": "^6.32.1" + } + }, + "node_modules/@types/debug": { + "version": "4.1.8", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.8.tgz", + "integrity": "sha512-/vPO1EPOs306Cvhwv7KfVfYvOJqA/S/AXjaHQiJboCZzcNDb+TIJFN9/2C9DZ//ijSKWioNyUxD792QmDJ+HKQ==", + "dependencies": { + "@types/ms": "*" + } + }, + "node_modules/@types/ms": { + "version": "0.7.31", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", + "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==" + }, + "node_modules/@types/node": { + "version": "20.6.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.6.2.tgz", + "integrity": "sha512-Y+/1vGBHV/cYk6OI1Na/LHzwnlNCAfU3ZNGrc1LdRe/LAIbdDPTTv/HU3M7yXN448aTVDq3eKRm2cg7iKLb8gw==" + }, + "node_modules/@types/validator": { + "version": "13.11.1", + "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.11.1.tgz", + "integrity": "sha512-d/MUkJYdOeKycmm75Arql4M5+UuXmf4cHdHKsyw1GcvnNgL6s77UkgSgJ8TE/rI5PYsnwYq5jkcWBLuN/MpQ1A==" + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "node_modules/bcryptjs": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz", + "integrity": "sha512-V/Hy/X9Vt7f3BbPJEi8BdVFMByHi+jNXrYkW3huaybV/kQ0KJg0Y6PkEMbn+zeT+i+SiKZ/HMqJGIIt4LZDqNQ==" + }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/denque": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/dotenv": { + "version": "16.3.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", + "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/motdotla/dotenv?sponsor=1" + } + }, + "node_modules/dottie": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/dottie/-/dottie-2.0.6.tgz", + "integrity": "sha512-iGCHkfUc5kFekGiqhe8B/mdaurD+lakO9txNnTvKtA6PISrw86LgqHvRzWYPyoE2Ph5aMIrCw9/uko6XHTKCwA==" + }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.1", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.5.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/express/node_modules/body-parser": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/express/node_modules/raw-body": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "node_modules/generate-function": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", + "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", + "dependencies": { + "is-property": "^1.0.2" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/inflection": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/inflection/-/inflection-1.13.4.tgz", + "integrity": "sha512-6I/HUDeYFfuNCVS3td055BaXBwKYuzw7K3ExVMStBowKo9oOAMJIXIHvdyR3iboTCp1b+1i5DSkIZTcwIktuDw==", + "engines": [ + "node >= 0.4.0" + ] + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==" + }, + "node_modules/jsonwebtoken": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", + "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", + "dependencies": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + } + }, + "node_modules/jsonwebtoken/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "dependencies": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" + }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" + }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" + }, + "node_modules/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/moment": { + "version": "2.29.4", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", + "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==", + "engines": { + "node": "*" + } + }, + "node_modules/moment-timezone": { + "version": "0.5.43", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.43.tgz", + "integrity": "sha512-72j3aNyuIsDxdF1i7CEgV2FfxM1r6aaqJyLB2vwb33mXYyoyLly+F1zbWqhA3/bVIoJ4szlUoMbUnVdid32NUQ==", + "dependencies": { + "moment": "^2.29.4" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/mysql2": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-2.3.3.tgz", + "integrity": "sha512-wxJUev6LgMSgACDkb/InIFxDprRa6T95+VEoR+xPvtngtccNH2dGjEB/fVZ8yg1gWv1510c9CvXuJHi5zUm0ZA==", + "dependencies": { + "denque": "^2.0.1", + "generate-function": "^2.3.1", + "iconv-lite": "^0.6.3", + "long": "^4.0.0", + "lru-cache": "^6.0.0", + "named-placeholders": "^1.1.2", + "seq-queue": "^0.0.5", + "sqlstring": "^2.3.2" + }, + "engines": { + "node": ">= 8.0" + } + }, + "node_modules/mysql2/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/named-placeholders": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.3.tgz", + "integrity": "sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==", + "dependencies": { + "lru-cache": "^7.14.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/named-placeholders/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "engines": { + "node": ">=12" + } + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + }, + "node_modules/pg-connection-string": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.2.tgz", + "integrity": "sha512-ch6OwaeaPYcova4kKZ15sbJ2hKb/VP48ZD2gE7i1J+L4MspCtBMAx8nMgz7bksc7IojCIIWuEhHibSMFH8m8oA==" + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/retry-as-promised": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/retry-as-promised/-/retry-as-promised-7.0.4.tgz", + "integrity": "sha512-XgmCoxKWkDofwH8WddD0w85ZfqYz+ZHlr5yo+3YUCfycWawU56T5ckWXsScsj5B8tqUcIG67DxXByo3VUgiAdA==" + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/seq-queue": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz", + "integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==" + }, + "node_modules/sequelize": { + "version": "6.33.0", + "resolved": "https://registry.npmjs.org/sequelize/-/sequelize-6.33.0.tgz", + "integrity": "sha512-GkeCbqgaIcpyZ1EyXrDNIwktbfMldHAGOVXHGM4x8bxGSRAOql5htDWofPvwpfL/FoZ59CaFmfO3Mosv1lDbQw==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/sequelize" + } + ], + "dependencies": { + "@types/debug": "^4.1.8", + "@types/validator": "^13.7.17", + "debug": "^4.3.4", + "dottie": "^2.0.6", + "inflection": "^1.13.4", + "lodash": "^4.17.21", + "moment": "^2.29.4", + "moment-timezone": "^0.5.43", + "pg-connection-string": "^2.6.1", + "retry-as-promised": "^7.0.4", + "semver": "^7.5.4", + "sequelize-pool": "^7.1.0", + "toposort-class": "^1.0.1", + "uuid": "^8.3.2", + "validator": "^13.9.0", + "wkx": "^0.5.0" + }, + "engines": { + "node": ">=10.0.0" + }, + "peerDependenciesMeta": { + "ibm_db": { + "optional": true + }, + "mariadb": { + "optional": true + }, + "mysql2": { + "optional": true + }, + "oracledb": { + "optional": true + }, + "pg": { + "optional": true + }, + "pg-hstore": { + "optional": true + }, + "snowflake-sdk": { + "optional": true + }, + "sqlite3": { + "optional": true + }, + "tedious": { + "optional": true + } + } + }, + "node_modules/sequelize-pool": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/sequelize-pool/-/sequelize-pool-7.1.0.tgz", + "integrity": "sha512-G9c0qlIWQSK29pR/5U2JF5dDQeqqHRragoyahj/Nx4KOOQ3CPPfzxnfqFPCSB7x5UgjOgnZ61nSxz+fjDpRlJg==", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/sequelize/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/sequelize/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/sqlstring": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", + "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/toposort-class": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toposort-class/-/toposort-class-1.0.1.tgz", + "integrity": "sha512-OsLcGGbYF3rMjPUf8oKktyvCiUxSbqMMS39m33MAjLTC1DVIH6x3WSt63/M77ihI09+Sdfk1AXvfhCEeUmC7mg==" + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/validator": { + "version": "13.11.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.11.0.tgz", + "integrity": "sha512-Ii+sehpSfZy+At5nPdnyMhx78fEoPDkR2XW/zimHEL3MyGJQOCQ7WeP20jPYRz7ZCpcKLB21NxuXHF3bxjStBQ==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/wkx": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/wkx/-/wkx-0.5.0.tgz", + "integrity": "sha512-Xng/d4Ichh8uN4l0FToV/258EjMGU9MGcA0HV2d9B/ZpZB3lqQm7nkOdZdm5GhKtLLhAE7PiVQwN4eN+2YJJUg==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + } +} diff --git a/user-service/package.json b/user-service/package.json new file mode 100644 index 00000000..2c75f475 --- /dev/null +++ b/user-service/package.json @@ -0,0 +1,21 @@ +{ + "name": "backend", + "version": "1.0.0", + "description": "NodeJS with express", + "main": "server.js", + "scripts": { + "dev": "nodemon server.js", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "g06", + "license": "ISC", + "dependencies": { + "bcryptjs": "^2.4.3", + "cors": "^2.8.5", + "dotenv": "^16.3.1", + "express": "^4.18.2", + "jsonwebtoken": "^9.0.0", + "mysql2": "^2.3.3", + "sequelize": "^6.32.1" + } +} diff --git a/user-service/routes/auth.routes.js b/user-service/routes/auth.routes.js new file mode 100644 index 00000000..9232aa02 --- /dev/null +++ b/user-service/routes/auth.routes.js @@ -0,0 +1,67 @@ +const { authJwt } = require("../middleware"); +const { verifySignUp } = require('../middleware'); +const controller = require('../controllers/auth.controller'); +const verifyExisting = require("../middleware/verifyExisting"); + +module.exports = function (app) { + app.use(function (req, res, next) { + res.header( + 'Access-Control-Allow-Headers', + 'x-access-token, Origin, Content-Type, Accept' + ); + next(); + }); + + // Endpoint for user signup + // Returns: + // 200 OK on success + // 400 Bad Request for validation errors + app.post( + '/api/auth/signup', + [verifySignUp.checkDuplicateUsernameOrEmail, verifySignUp.checkRolesExisted], + controller.signup + ); + + // Endpoint for user signin + // Returns: + // 200 OK on success + // 401 Unauthorized for invalid credentials + app.post('/api/auth/signin', controller.signin); + + // Endpoint to remove a user + // Returns: + // 200 OK on success + // 401 Unauthorized if not authenticated or no token provided + app.delete('/api/auth/removeuser', [authJwt.verifyToken], controller.removeUser); + + // Endpoint to update user password, email or username + // Returns: + // 200 OK on success + // 400 Bad Request on validation errors + // 401 Unauthorized if not authenticated or no token provided + app.patch('/api/auth/updateprofile', + [authJwt.verifyToken, verifyExisting.checkEmail, verifyExisting.checkUsername], + controller.updateProfile + ); + + // Endpoint to update user password + // 200 OK on success + // 401 Unauthorized if not authenticated or no token provided + app.patch('/api/auth/updatepassword', [authJwt.verifyToken], controller.updatePassword); + + // Endpoint to get user profile + // 200 OK on success + // 401 Unauthorized if not authenticated or no token provided + app.get('/api/auth/getuser', [authJwt.verifyToken], controller.getProfile); + + // Endpoint to verify JWT token + // 200 OK on success + // 401 Unauthorized if not authenticated or no token provided + app.get('/api/auth/verifytoken', [authJwt.verifyToken], controller.verifyToken); + + // Endpoint to verify if user is an admin + // 200 OK on success + // 401 Unauthorized if not authenticated or no token provided + // 403 Forbidden if not admin + app.get('/api/auth/verifyadmin', [authJwt.verifyToken, authJwt.isAdmin], controller.verifyAdmin); +}; diff --git a/user-service/routes/history.routes.js b/user-service/routes/history.routes.js new file mode 100644 index 00000000..0e326d0c --- /dev/null +++ b/user-service/routes/history.routes.js @@ -0,0 +1,50 @@ +const { authJwt } = require("../middleware"); +const controller = require("../controllers/history.controller"); + +module.exports = function (app) { + app.use(function (req, res, next) { + res.header( + "Access-Control-Allow-Headers", + "x-access-token, Origin, Content-Type, Accept" + ); + next(); + }); + + // Endpoint to save user history + // Returns: + // 200 OK on success + // 400 Bad Request for validation errors + // 500 on Unexpected errors + app.post("/api/hist/save", [authJwt.verifyToken], controller.addHistory); + + // Endpoint to save custom user history + // Returns: + // 200 OK on success + // 401 Unauthorized if not authenticated or no token provided + // 500 on Unexpected errors + app.post( + "/api/hist/customsave", + [authJwt.verifyToken], + controller.addCustomHistory + ); + + // Endpoint to get all unique questions from user history + // Returns: + // 200 OK on success + // 401 Unauthorized if not authenticated or no token provided + // 404 on User questions not found + // 500 on Unexpected errors + app.get("/api/hist/get", [authJwt.verifyToken], controller.getAllQuestions); + + // Endpoint to get all attempted dates from user history + // Returns: + // 200 OK on success + // 401 Unauthorized if not authenticated or no token provided + // 404 on User questions not found + // 500 on Unexpected errors + app.get( + "/api/hist/attempts", + [authJwt.verifyToken], + controller.getAttemptedDates + ); +}; diff --git a/user-service/server.js b/user-service/server.js new file mode 100644 index 00000000..831e14d0 --- /dev/null +++ b/user-service/server.js @@ -0,0 +1,34 @@ +const express = require('express'); +const cors = require('cors'); + +const app = express(); + +app.use(cors()); + +// parse requests of content-type - application/json +app.use(express.json()); + +// parse requests of content-type - application/x-www-form-urlencoded +app.use(express.urlencoded({ extended: true })); + +// database +const db = require('./models'); + +db.sequelize.sync(); + +// Default route to see if server works +app.get('/', (req, res) => { + res.json({ message: 'Hello World' }); +}); + +// routes +require('./routes/auth.routes')(app); +require('./routes/history.routes')(app); + +// set port, listen for requests +const PORT = process.env.USR_SVC_PORT || 3003; +app.listen(PORT, () => { + console.log(`Server is running on port ${PORT}.`); +}); + +