송용우

Merge commit '7a39581f' into feature/frontend_page

jaksimsamil
.vscode/
*.csv
# Jaksimsamil Crawler Documentation
## Overview
- https://acmicpc.net와 https://solved.ac에서 사용자와 문제정보를 크롤링합니다.
- Python 3.8.3, Pip 20.2.1 환경에서 개발되었습니다.
## Usuage
- Install
```bash
pip install -r requirements.txt
```
- Run
```bash
python main.py
```
import requests
from bs4 import BeautifulSoup
import pandas as pd
from dotenv import load_dotenv
import sys
import pymongo
import os
from datetime import datetime
import json
import numpy as np
SAVE_EVERY=10
SAVE_PATH='problems.csv'
def setup():
try:
load_dotenv(dotenv_path='../jaksimsamil-server/.env')
client=pymongo.MongoClient('/'.join(os.getenv('MONGO_URL').split('/')[:-1]))
print('MongoDB Connected')
return client
except FileNotFoundError:
print('.env is not found',file=sys.stderr)
exit(1)
def save(df,path='problems.csv'):
print('Saving to {}...'.format(path),end='')
df.to_csv(path)
print('Done.')
def load(path='problems.csv'):
problems=pd.read_csv(path,index_col=0)
return problems
def get_khu_problem_list():
pageNum=1
idx=0
problems=pd.DataFrame(columns=['problemNum','problemTitle','solvedacLevel','submitNum','correctNum','category','count'])
while True:
res=requests.get('https://www.acmicpc.net/school/ranklist/211/{}'.format(pageNum))
status_code=res.status_code
if status_code==404:
break
soup=BeautifulSoup(res.text,'html.parser')
userlinks=soup.select('#ranklist > tbody > tr > td:nth-child(2) > a')
for userlink in userlinks:
href=userlink['href']
res=requests.get('https://acmicpc.net'+href)
print('Collecting user data...:',href.split('/')[-1])
user_soup=BeautifulSoup(res.text,'html.parser')
problemNums=user_soup.select('body > div.wrapper > div.container.content > div.row > div:nth-child(2) > div:nth-child(3) > div.col-md-9 > div:nth-child(1) > div.panel-body > span.problem_number')
for problemNum in problemNums:
if not problemNum.text in problems['problemNum'].tolist():
problems=problems.append({'problemNum':problemNum.text,'count':1},ignore_index=True)
else:
problems.loc[problems.problemNum==problemNum.text,'count']=problems.loc[problems.problemNum==problemNum.text,'count']+1
if idx%SAVE_EVERY==0:
save(problems,SAVE_PATH)
idx+=1
pageNum+=1
save(problems,SAVE_PATH)
return problems
def get_problem_info(problems):
for idx,problemNum in enumerate(problems['problemNum'].values):
res=requests.get('https://acmicpc.net/problem/{}'.format(problemNum))
print('Collecting problem data...:',problemNum)
soup=BeautifulSoup(res.text,'html.parser')
problemTitle=soup.select('#problem_title')[0].text
soup=soup.select('#problem-info > tbody > tr > td')
submitNum=soup[2].text
correctNum=soup[4].text
problems.loc[problems.problemNum==problemNum,'problemTitle']=problemTitle
problems.loc[problems.problemNum==problemNum,'submitNum']=submitNum
problems.loc[problems.problemNum==problemNum,'correctNum']=correctNum
if idx%SAVE_EVERY==0:
save(problems,SAVE_PATH)
save(problems,SAVE_PATH)
return problems
def get_solvedac_level(problems):
for idx,problemNum in enumerate(problems['problemNum'].values):
res=requests.get('https://api.solved.ac/v2/search/problems.json?query={}&page=1&sort=id&sort_direction=ascending'.format(problemNum))
print('Collecting solved.ac level data...:',problemNum)
result=json.loads(res.text)
for problem in result['result']['problems']:
if int(problem['id'])==int(problemNum):
problems.loc[problems.problemNum==problemNum,'solvedacLevel']=problem['level']
break
if idx%SAVE_EVERY==0:
save(problems,SAVE_PATH)
save(problems,SAVE_PATH)
return problems
def get_category(problems):
problems.sort_values(['problemNum'],inplace=True,ignore_index=True)
problems['category']=problems['category'].fillna(json.dumps([]))
pageNum=1
res=requests.get('https://api.solved.ac/v2/tags/stats.json?page={}'.format(pageNum))
tagsResult=json.loads(res.text)
totalPages=tagsResult['result']['total_page']
tags=[]
tags.extend(tagsResult['result']['tags'])
for pageNum in range(2,totalPages+1):
res=requests.get('https://api.solved.ac/v2/tags/stats.json?page={}'.format(pageNum))
tagsResult=json.loads(res.text)
tags.extend(tagsResult['result']['tags'])
print('total tags:',len(tags))
for tag in tags:
problemList=[]
pageNum=1
res=requests.get('https://api.solved.ac/v2/search/problems.json?query=solvable:true+tag:{}&page={}&sort=id&sort_direction=ascending'.format(tag['tag_name'],pageNum))
problemResult=json.loads(res.text)
totalPages=problemResult['result']['total_page']
problemList.extend(problemResult['result']['problems'])
for pageNum in range(2,totalPages+1):
res=requests.get('https://api.solved.ac/v2/search/problems.json?query=solvable:true+tag:{}&page={}&sort=id&sort_direction=ascending'.format(tag['tag_name'],pageNum))
problemResult=json.loads(res.text)
problemList.extend(problemResult['result']['problems'])
idx=0
problemListLen=len(problemList)
for problemNum in problems['problemNum'].values:
if idx<problemListLen and int(problemList[idx]['id'])==int(problemNum):
category=json.loads(problems.loc[problems.problemNum==problemNum,'category'].values[0])
category.append(tag['full_name_ko'])
problems.loc[problems.problemNum==problemNum,'category']=json.dumps(category,ensure_ascii=False)
idx+=1
print('Problem {} in category {}'.format(problemNum,tag['full_name_ko']))
save(problems,SAVE_PATH)
return problems
def update_database(problems,client):
database=client['jaksimsamil']
collection=database['problem']
dictedProblems=problems.to_dict('records')
print('len of records:',len(dictedProblems))
for dictedProblem in dictedProblems:
dictedProblem['category']=json.loads(dictedProblem['category'])
collection.update_one({'problemNum':dictedProblem['problemNum']},{'$set':dictedProblem},upsert=True)
if __name__=="__main__":
startTime=datetime.now()
client=setup()
problems=get_khu_problem_list()
problems=get_problem_info(problems)
problems=get_solvedac_level(problems)
problems=get_category(problems)
update_database(problems,client)
print('Time elapsed :',(datetime.now()-startTime)/60,'mins')
beautifulsoup4==4.9.1
bs4==0.0.1
certifi==2020.6.20
chardet==3.0.4
idna==2.10
numpy==1.19.1
pandas==1.1.0
pymongo==3.11.0
python-dateutil==2.8.1
python-dotenv==0.14.0
pytz==2020.1
requests==2.24.0
six==1.15.0
soupsieve==2.0.1
urllib3==1.25.10
......@@ -8,3 +8,4 @@ access.log
# dependencies
/node_modules
......
......@@ -27,7 +27,7 @@ POST http://facerain.dcom.club/profile/getprofile
## API Table
| group | description | method | URL | Detail | Auth |
| ------- | -------------------------------------- | ------ | ----------------------- | -------------------------------------- | --------- |
| --------- | -------------------------------------- | ------ | -------------------------- | -------------------------------------- | --------- |
| profile | 유저가 푼 문제 조회(백준) | GET | api/profile/solvedBJ:id | [바로가기](/src/api/profile/README.md) | None |
| profile | 유저가 푼 문제 동기화(백준) | PATCH | api/profile/syncBJ | [바로가기](/src/api/profile/README.md) | None |
| profile | 유저 정보 수정 | POST | api/profile/setprofile | [바로가기](/src/api/profile/README.md) | JWT TOKEN |
......@@ -40,3 +40,4 @@ POST http://facerain.dcom.club/profile/getprofile
| auth | 로그아웃 | POST | api/auth/logout | [바로가기](/src/api/auth/README.md) | JWT Token |
| auth | 회원가입 | POST | api/auth/register | [바로가기](/src/api/auth/README.md) | None |
| auth | 로그인 확인 | GET | api/auth/check | [바로가기](/src/api/auth/README.md) | None |
| challenge | 특정 챌린지 조회(이름) | POST | api/challenge/getChallenge | [바로가기]() | None |
......
......@@ -402,12 +402,12 @@
}
},
"bcrypt": {
"version": "3.0.8",
"resolved": "https://registry.npmjs.org/bcrypt/-/bcrypt-3.0.8.tgz",
"integrity": "sha512-jKV6RvLhI36TQnPDvUFqBEnGX9c8dRRygKxCZu7E+MgLfKZbmmXL8a7/SFFOyHoPNX9nV81cKRC5tbQfvEQtpw==",
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/bcrypt/-/bcrypt-5.0.0.tgz",
"integrity": "sha512-jB0yCBl4W/kVHM2whjfyqnxTmOHkCX4kHEa5nYKSoGeYe8YrjTYTc87/6bwt1g8cmV0QrbhKriETg9jWtcREhg==",
"requires": {
"nan": "2.14.0",
"node-pre-gyp": "0.14.0"
"node-addon-api": "^3.0.0",
"node-pre-gyp": "0.15.0"
}
},
"bcrypt-pbkdf": {
......@@ -2415,11 +2415,6 @@
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"nan": {
"version": "2.14.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz",
"integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg=="
},
"natural-compare": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
......@@ -2451,14 +2446,19 @@
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz",
"integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw=="
},
"node-addon-api": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.0.0.tgz",
"integrity": "sha512-sSHCgWfJ+Lui/u+0msF3oyCgvdkhxDbkCS6Q8uiJquzOimkJBvX6hl5aSSA7DR1XbMpdM8r7phjcF63sF4rkKg=="
},
"node-pre-gyp": {
"version": "0.14.0",
"resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.14.0.tgz",
"integrity": "sha512-+CvDC7ZttU/sSt9rFjix/P05iS43qHCOOGzcr3Ry99bXG7VX953+vFyEuph/tfqoYu8dttBkE86JSKBO2OzcxA==",
"version": "0.15.0",
"resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.15.0.tgz",
"integrity": "sha512-7QcZa8/fpaU/BKenjcaeFF9hLz2+7S9AqyXFhlH/rilsQ/hPZKK32RtR5EQHJElgu+q5RfbJ34KriI79UWaorA==",
"requires": {
"detect-libc": "^1.0.2",
"mkdirp": "^0.5.1",
"needle": "^2.2.1",
"mkdirp": "^0.5.3",
"needle": "^2.5.0",
"nopt": "^4.0.1",
"npm-packlist": "^1.1.6",
"npmlog": "^4.0.2",
......
......@@ -5,7 +5,7 @@
"license": "MIT",
"dependencies": {
"axios": "^0.19.2",
"bcrypt": "^3.0.0",
"bcrypt": "^5.0.0",
"body-parser": "^1.19.0",
"cheerio": "^1.0.0-rc.3",
"cookie-parser": "^1.4.5",
......
const Joi = require("joi");
const User = require("../../models/user");
const Profile = require("../../models/profile");
/*
POST /api/auth/register
{
......@@ -28,14 +27,10 @@ exports.register = async (ctx) => {
ctx.status = 409;
return;
}
const profile = new Profile({
username,
});
const user = new User({
username,
});
await user.setPassword(password);
await profile.save();
await user.save();
ctx.body = user.serialize();
......
const Challenge = require("../../models/challenge");
const Session = require("../../models/session");
const Participation = require("../../models/participation");
const Group = require("../../models/group");
const User = require('../../models/user');
const Joi = require("joi");
/*POST /api/challenge/getChallenge
{
challengeName: "challengeName"
}
*/
exports.getChallenge = async (ctx) => {
try {
const { challengeName } = ctx.request.body;
const challenge = await Challenge.findByChallengeName(challengeName).select('-_id');
if (!challenge) {
ctx.status = 401;
return;
}
ctx.body = challenge;
} catch (e) {
ctx.throw(500, e);
}
};
/*POST /api/challenge/addChallenge
{
challengeName: "challengeName",
startDate: Date Object,
endDate: Date Object,
durationPerSession: "2w", // '1d' means one day per session, '2w' means 2 weeks per session, '3m' means 3 months per session.
goalPerSession: 3,
}
*/
exports.addChallenge = async (ctx) => {
const schema = Joi.object()
.keys({
challengeName: Joi.string(),
startDate: Joi.date(),
endDate: Joi.date(),
durationPerSession: Joi.string(),
goalPerSession: Joi.number()
})
.unknown();
const result = Joi.validate(ctx.request.body, schema);
if (result.error) {
ctx.status = 400;
ctx.body = result.error;
return;
}
let {
challengeName,
startDate,
endDate,
durationPerSession,
goalPerSession,
} = ctx.request.body;
try {
const isChallengeExist = await Challenge.findByChallengeName(challengeName).select('-_id');
if (isChallengeExist) {
ctx.status = 409;
return;
}
const challenge = new Challenge({
challengeName,
startDate,
endDate,
durationPerSession,
goalPerSession,
});
await challenge.save();
const newChallenge=await Challenge.findByChallengeName(challengeName);
const newChallenge_id=newChallenge._id;
const timeStep=Number(durationPerSession.slice(0,-1))
if(typeof(startDate)=='string'){
startDate=new Date(startDate);
}
if(typeof(endDate)=='string'){
endDate=new Date(endDate);
}
for(let s_date=new Date(startDate);s_date<endDate;){
let e_date=new Date(s_date);
if(durationPerSession[durationPerSession.length-1]==='d'){
console.log('day');
e_date.setDate(s_date.getDate()+timeStep);
}
else if(durationPerSession[durationPerSession.length-1]==='w'){
console.log('week');
e_date.setDate(s_date.getDate()+timeStep*7);
}
else if(durationPerSession[durationPerSession.length-1]==='m'){
console.log('month');
e_date.setMonth(s_date.getMonth()+timeStep);
}
e_date.setMinutes(e_date.getMinutes()-1);
if(e_date>endDate){
break;
}
let status="";
if (s_date>new Date()){
status="enrolled";
}
else if (s_date<=new Date() && new Date() <= e_date){
status="progress";
}
else{
status="end";
}
console.log(`start:${s_date}\nend:${e_date}`);
const session=new Session({
challengeId:newChallenge_id,
sessionStartDate:s_date,
sessionEndDate:e_date,
status:status,
});
await session.save();
s_date=new Date(e_date);
s_date.setMinutes(s_date.getMinutes()+1);
}
ctx.body = challenge;
} catch (e) {
ctx.throw(500, e);
}
};
/* GET /api/challenge/list?status
query string status can be in ['all','enrolled','progress','end']
*/
exports.list = async (ctx) => {
try{
const status = ctx.query.status;
if (status!=='all'){
const challenges = await Challenge.find({status:status}).select('-_id');
ctx.body = challenges;
}
else {
const challenges = await Challenge.find({}).select('-_id');
ctx.body = challenges;
}
}
catch(e){
ctx.throw(500,e);
}
};
/* POST /api/challenge/participate
{
username: 'username',
challengeName: 'challengename'
}
*/
exports.participate=async (ctx)=>{
try{
/*
TODO: access token validation,
recommend:get username from access_token
*/
console.log(ctx.request.body);
const {username,challengeName}=ctx.request.body;
const challenge=await Challenge.findByChallengeName(challengeName);
const challenge_id=challenge._id;
const user=await User.findByUsername(username);
const user_id=user._id;
const newGroup=new Group({
members:[user_id],
});
let newGroup_id=""
await newGroup.save(async (err,product)=>{
if(err){
throw err;
}
newGroup_id=product._id;
const sessions=await Session.findByChallengeId(challenge_id);
sessions.forEach(async (elem) => {
const newParticipation=new Participation({
sessionId:elem._id,
groupId:newGroup_id,
problems:[],
});
await newParticipation.save();
});
});
}
catch(e){
console.error(e);
ctx.throw(500,e);
}
};
\ No newline at end of file
const Router = require('koa-router');
const challenge = new Router();
const challengeCtrl = require('./challege.ctrl');
challenge.post("/getchallenge",challengeCtrl.getChallenge);
challenge.post("/addchallenge",challengeCtrl.addChallenge);
challenge.get("/list",challengeCtrl.list);
challenge.post("/participate",challengeCtrl.participate);
module.exports = challenge;
\ No newline at end of file
......@@ -6,11 +6,13 @@ const friend = require("./friend");
const notify = require("./notify");
const user = require("./user");
const profile = require("./profile");
const challenge = require("./challenge");
api.use("/auth", auth.routes());
api.use("/friend", friend.routes());
api.use("/notify", notify.routes());
api.use("/user", user.routes());
api.use("/profile", profile.routes());
api.use("/challenge",challenge.routes());
module.exports = api;
......
const Profile = require("../../models/profile");
const User = require("../../models/user");
const sendSlack = require("../../util/sendSlack");
const problem_set = require("../../data/problem_set");
const compareBJ = require("../../util/compareBJ");
......@@ -12,7 +12,7 @@ exports.slackGoal = async (ctx) => {
try {
const { username } = ctx.request.body;
const profile = await Profile.findByUsername(username);
const profile = await User.findByUsername(username);
if (!profile) {
ctx.status = 401;
return;
......@@ -62,7 +62,7 @@ exports.slackRecommend = async (ctx) => {
console.log("1");
const { username } = ctx.request.body;
const profile = await Profile.findByUsername(username);
const profile = await User.findByUsername(username);
if (!profile) {
ctx.status = 401;
return;
......
const Profile = require("../../models/profile");
const User = require("../../models/user");
const mongoose = require("mongoose");
const getBJ = require("../../util/getBJ");
const Joi = require("joi");
......@@ -16,6 +16,7 @@ exports.checkObjectId = (ctx, next) => {
}
return next();
};
/*POST /api/profile/getprofile
{
username: "username"
......@@ -24,7 +25,7 @@ exports.checkObjectId = (ctx, next) => {
exports.getProfile = async (ctx) => {
try {
const { username } = ctx.request.body;
const profile = await Profile.findByUsername(username);
const profile = await User.findByUsername(username);
if (!profile) {
ctx.status = 401;
return;
......@@ -50,7 +51,6 @@ exports.setProfile = async (ctx) => {
//freindList: Joi.array().items(Joi.string()),
})
.unknown();
console.log(ctx.request.body);
const result = Joi.validate(ctx.request.body, schema);
if (result.error) {
ctx.status = 400;
......@@ -59,7 +59,7 @@ exports.setProfile = async (ctx) => {
}
try {
const profile = await Profile.findOneAndUpdate(
const profile = await User.findOneAndUpdate(
{ username: ctx.request.body.username },
ctx.request.body,
{
......@@ -91,7 +91,7 @@ exports.syncBJ = async function (ctx) {
}
try {
const profile = await Profile.findByUsername(username);
const profile = await User.findByUsername(username);
if (!profile) {
ctx.status = 401;
return;
......@@ -99,7 +99,7 @@ exports.syncBJ = async function (ctx) {
const BJID = await profile.getBJID();
let BJdata = await getBJ.getBJ(BJID);
let BJdata_date = await analyzeBJ.analyzeBJ(BJdata);
const updateprofile = await Profile.findOneAndUpdate(
const updateprofile = await User.findOneAndUpdate(
{ username: username },
{ solvedBJ: BJdata, solvedBJ_date: BJdata_date },
{ new: true }
......@@ -124,7 +124,7 @@ exports.recommend = async (ctx) => {
return;
}
try {
const profile = await Profile.findByUsername(username);
const profile = await User.findByUsername(username);
if (!profile) {
ctx.status = 401;
return;
......@@ -134,7 +134,7 @@ exports.recommend = async (ctx) => {
problem_set.problem_set
);
ctx.body = compareBJ.randomItem(unsolved_data);
//데이터가 비었을 떄 예외처리 필요
//TODO: 데이터가 비었을 떄 예외처리 필요
} catch (e) {
ctx.throw(500, e);
}
......
......@@ -2,61 +2,48 @@ const mongoose = require("mongoose");
const { Schema } = mongoose;
const GroupSchema = new Schema({
members: { type: [String] },
const ChallengeSchema=new Schema({
challengeName: {type: String, required: true},
startDate: {type: Object, required: true},
endDate: {type: Object, required: true},
durationPerSession: {type: String, required: true}, // '1d' means one day per session, '2w' means 2 weeks per session, '3m' means 3 months per session.
goalPerSession: {type: Number, required:true}, // number of problems for one session
status: { type: String }
},{
collection: 'challenge'
});
const ChallengeSchema = new Schema({
challengeName: { type: String, required: true },
startDate: { type: Object, required: true },
endDate: { type: Object, required: true },
durationPerSession: { type: String, required: true }, // '1d' means one day per session, '2w' means 2 weeks per session, '3m' means 3 months per session.
goalPerSession: { type: Number, required: true }, // number of problems for one session
groups: { type: [GroupSchema], required: true }, // groups attending challenge, group of only one member supposed to be single
});
ChallengeSchema.statics.findByChallengeName = function (challengeName) {
return this.findOne({ challengeName: challengeName });
};
ChallengeSchema.methods.addNewGroup = function (group) {
this.groups.push(group);
return this.save();
};
ChallengeSchema.methods.removeGroup = function (group_id) {
const idx = this.groups.findIndex((item) => item._id === group_id);
this.groups.splice(idx, 1);
return this.save();
};
ChallengeSchema.statics.findByChallengeName=function(challengeName){
return this.findOne({challengeName:challengeName});
}
ChallengeSchema.methods.getChallengeName = function () {
ChallengeSchema.methods.getChallengeName=function(){
return this.challengeName;
};
}
ChallengeSchema.methods.getStartDate = function () {
ChallengeSchema.methods.getStartDate=function(){
return this.startDate;
};
}
ChallengeSchema.methods.getEndDate = function () {
ChallengeSchema.methods.getEndDate=function(){
return this.endDate;
};
}
ChallengeSchema.methods.getDurationPerSession = function () {
ChallengeSchema.method.getDurationPerSession=function(){
return this.durationPerSession;
};
}
ChallengeSchema.methods.getGoalPerSession = function () {
ChallengeSchema.methods.getGoalPerSession=function(){
return this.goalPerSession;
};
}
ChallengeSchema.methods.getGroups = function () {
return this.groups;
};
ChallengeSchema.methods.getStatus=function(){
return this.status;
}
ChallengeSchema.methods.serialize = function () {
ChallengeSchema.methods.serialize=function(){
return this.toJSON();
};
}
const Challenge = mongoose.model("Challenge", ChallengeSchema);
const Challenge = mongoose.model('Challenge', ChallengeSchema);
module.exports = Challenge;
\ No newline at end of file
......
const mongoose = require("mongoose");
const { Schema } = mongoose;
const GroupSchema = new Schema({
members: [{ type: Schema.Types.ObjectId, ref: 'User' }]
},{
collection: 'group'
});
GroupSchema.methods.addGroupMemeber=function(user){
this.members.push(user._id);
return this.save();
}
GroupSchema.methods.getMembers=function(){
return this.members;
}
GroupSchema.methods.serialize=function(){
return this.toJSON();
}
const Group = mongoose.model('Group',GroupSchema);
module.exports = Group;
\ No newline at end of file
const mongoose = require("mongoose");
const { Schema } = mongoose;
const SelectedProblemSchema=new Schema({
problemNum: {type: Number, required: true},
isSolved: {type:Boolean, default: false},
},{
_id: false
});
const ParticipationSchema = new Schema({
sessionId: { type: Schema.Types.ObjectId, ref: 'Session' },
groupId: { type: Schema.Types.ObjectId, ref: 'Group' },
problems: [{type:SelectedProblemSchema}]
},{
collection: 'particiaption'
});
ParticipationSchema.statics.findBySessionId=function(session){
return this.find({sessionId:session._id});
}
ParticipationSchema.statics.findByGroupId=function(group){
return this.find({groupId:group._id});
}
ParticipationSchema.methods.addProblem=function(problem){
this.problems.push({problemNum:problem.problemNum,isSolved:problem.isSolved});
}
const Participation = mongoose.model('Participation', ParticipationSchema);
module.exports = Participation;
\ No newline at end of file
......@@ -8,7 +8,10 @@ const ProblemSchema=new Schema({
solvedacLevel: {type: Number},
sumbitNum: {type: Number, required: true},
correctNum: {type: Number, required: true},
category: {type:[String]}
count: { type: Number },
category: [{ type:String }],
},{
collection: 'problem'
});
ProblemSchema.statics.findByProblemNum=function(problemNum){
......@@ -46,6 +49,10 @@ ProblemSchema.methods.getCorrectNum=function(){
return this.correctNum;
}
ProblemSchema.methods.getCount=function(){
return this.count;
}
ProblemSchema.methods.getCategory=function(){
return this.category;
}
......@@ -54,5 +61,5 @@ ProblemSchema.methods.serialize=function(){
return this.toJSON();
}
const Problem=mongoose.model('Problem',ProblemSchema);
module.exports=Problem;
\ No newline at end of file
const Problem = mongoose.model('Problem',ProblemSchema);
module.exports = Problem;
\ No newline at end of file
......
const mongoose = require("mongoose");
const { Schema } = mongoose;
const ProfileSchema = new Schema({
username: { type: String, required: true, unique: true },
userBJID: String,
solvedBJ: Object,
solvedBJ_date: Object,
friendList: [String],
slackWebHookURL: String,
goalNum: Number,
});
ProfileSchema.statics.findByUsername = function (username) {
return this.findOne({ username });
};
ProfileSchema.methods.getBJID = function () {
return this.userBJID;
};
ProfileSchema.methods.getBJdata = function () {
return this.solvedBJ;
};
ProfileSchema.methods.getslackURL = function () {
return this.slackWebHookURL;
};
ProfileSchema.methods.getgoalNum = function () {
return this.goalNum;
};
ProfileSchema.methods.getTodaySovled = function () {
if (this.solvedBJ_date) {
return this.solvedBJ_date.presentNum;
}
};
ProfileSchema.methods.serialize = function () {
const data = this.toJSON();
return data;
};
const Profile = mongoose.model("Profile", ProfileSchema);
module.exports = Profile;
const mongoose = require("mongoose");
const { Schema } = mongoose;
const SessionSchema = new Schema({
challengeId: { type: Schema.Types.ObjectId, ref: 'Challenge' },
sessionStartDate: { type: Object },
sessionEndDate: { type: Object },
status: { type: String }
},{
collection: 'session'
});
SessionSchema.statics.findByChallengeId=function(challenge){
return this.find({challengeId:challenge._id});
}
SessionSchema.methods.getSessionStartDate=function(){
return this.sessionStartDate;
}
SessionSchema.methods.getSessionEndDate=function(){
return this.sessionEndDate;
}
SessionSchema.methods.getStatus=function(){
return this.status;
}
SessionSchema.methods.serialize=function(){
return this.toJSON();
}
const Session = mongoose.model('Session', SessionSchema);
module.exports = Session;
\ No newline at end of file
......@@ -7,8 +7,25 @@ const Schema = mongoose.Schema;
const UserSchema = new Schema({
username: String,
hashedPassword: String,
userBJID: String,
sovledBJ: Object,
solvedBJ_date: Object,
friendList: [{ type: Schema.Types.ObjectId, ref: 'User' }],
slackWebHookURL: String,
goalNum: Number,
},{
collection: 'user'
});
UserSchema.statics.findByUsername = function (username) {
return this.findOne({ username });
};
UserSchema.methods.addFriend=function(friend){
this.friendList.push(friend._id);
return this.save();
}
UserSchema.methods.setPassword = async function (password) {
const hash = await bcrypt.hash(password, 10);
this.hashedPassword = hash;
......@@ -17,14 +34,13 @@ UserSchema.methods.checkPassword = async function (password) {
const result = await bcrypt.compare(password, this.hashedPassword);
return result;
};
UserSchema.statics.findByUsername = function (username) {
return this.findOne({ username });
};
UserSchema.methods.serialize = function () {
const data = this.toJSON();
delete data.hashedPassword;
return data;
};
UserSchema.methods.generateToken = function () {
const token = jwt.sign(
{
......@@ -38,5 +54,32 @@ UserSchema.methods.generateToken = function () {
);
return token;
};
UserSchema.statics.findByUsername = function (username) {
return this.findOne({ username });
};
UserSchema.methods.getBJID = function () {
return this.userBJID;
};
UserSchema.methods.getBJdata = function () {
return this.solvedBJ;
};
UserSchema.methods.getslackURL = function () {
return this.slackWebHookURL;
};
UserSchema.methods.getgoalNum = function () {
return this.goalNum;
};
UserSchema.methods.getTodaySovled = function () {
if (this.solvedBJ_date) {
return this.solvedBJ_date.presentNum;
}
};
const User = mongoose.model("User", UserSchema);
module.exports = User;
......
......@@ -134,10 +134,10 @@ acorn-jsx@^5.2.0:
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.2.0.tgz#4c66069173d6fdd68ed85239fc256226182b2ebe"
integrity sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==
acorn@^7.1.1:
version "7.2.0"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.2.0.tgz#17ea7e40d7c8640ff54a694c889c26f31704effe"
integrity sha512-apwXVmYVpQ34m/i71vrApRrRKCWQnZZF1+npOD0WV5xZFfwWOmKGQ2RWlfdy9vWITsenisM8M0Qeq8agcFHNiQ==
acorn@^7.3.1:
version "7.4.0"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.0.tgz#e1ad486e6c54501634c6c397c5c121daa383607c"
integrity sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w==
agent-base@2:
version "2.1.1"
......@@ -164,12 +164,10 @@ ansi-align@^3.0.0:
dependencies:
string-width "^3.0.0"
ansi-escapes@^4.2.1:
version "4.3.1"
resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.1.tgz#a5c47cc43181f1f38ffd7076837700d395522a61"
integrity sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==
dependencies:
type-fest "^0.11.0"
ansi-colors@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348"
integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==
ansi-regex@^2.0.0:
version "2.1.1"
......@@ -471,11 +469,6 @@ chalk@^4.0.0:
ansi-styles "^4.1.0"
supports-color "^7.1.0"
chardet@^0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e"
integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==
cheerio@^1.0.0-rc.3:
version "1.0.0-rc.3"
resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-1.0.0-rc.3.tgz#094636d425b2e9c0f4eb91a46c05630c9a1a8bf6"
......@@ -518,18 +511,6 @@ cli-boxes@^2.2.0:
resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.0.tgz#538ecae8f9c6ca508e3c3c95b453fe93cb4c168d"
integrity sha512-gpaBrMAizVEANOpfZp/EEUixTXDyGt7DFzdK5hU+UbWt/J0lB0w20ncZj59Z9a93xHb9u12zF5BS6i9RKbtg4w==
cli-cursor@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307"
integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==
dependencies:
restore-cursor "^3.1.0"
cli-width@^2.0.0:
version "2.2.1"
resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48"
integrity sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==
clone-response@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b"
......@@ -924,6 +905,13 @@ end-of-stream@^1.1.0:
dependencies:
once "^1.4.0"
enquirer@^2.3.5:
version "2.3.6"
resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d"
integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==
dependencies:
ansi-colors "^4.1.1"
entities@^1.1.1, entities@~1.1.1:
version "1.1.2"
resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56"
......@@ -956,18 +944,18 @@ eslint-config-prettier@^6.11.0:
dependencies:
get-stdin "^6.0.0"
eslint-scope@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.0.0.tgz#e87c8887c73e8d1ec84f1ca591645c358bfc8fb9"
integrity sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==
eslint-scope@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.0.tgz#d0f971dfe59c69e0cada684b23d49dbf82600ce5"
integrity sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w==
dependencies:
esrecurse "^4.1.0"
estraverse "^4.1.1"
eslint-utils@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.0.0.tgz#7be1cc70f27a72a76cd14aa698bcabed6890e1cd"
integrity sha512-0HCPuJv+7Wv1bACm8y5/ECVfYdfsAm9xmVb7saeFlxjPYALefjhbYoCkBjPdPzGH8wWyTpAez82Fh3VKYEZ8OA==
eslint-utils@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27"
integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==
dependencies:
eslint-visitor-keys "^1.1.0"
......@@ -976,10 +964,15 @@ eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0:
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2"
integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==
eslint@^7.1.0:
version "7.1.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.1.0.tgz#d9a1df25e5b7859b0a3d86bb05f0940ab676a851"
integrity sha512-DfS3b8iHMK5z/YLSme8K5cge168I8j8o1uiVmFCgnnjxZQbCGyraF8bMl7Ju4yfBmCuxD7shOF7eqGkcuIHfsA==
eslint-visitor-keys@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e"
integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==
eslint@^7.3.1:
version "7.7.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.7.0.tgz#18beba51411927c4b64da0a8ceadefe4030d6073"
integrity sha512-1KUxLzos0ZVsyL81PnRN335nDtQ8/vZUD6uMtWbF+5zDtjKcsklIi78XoE0MVL93QvWTu+E5y44VyyCsOMBrIg==
dependencies:
"@babel/code-frame" "^7.0.0"
ajv "^6.10.0"
......@@ -987,10 +980,11 @@ eslint@^7.1.0:
cross-spawn "^7.0.2"
debug "^4.0.1"
doctrine "^3.0.0"
eslint-scope "^5.0.0"
eslint-utils "^2.0.0"
eslint-visitor-keys "^1.1.0"
espree "^7.0.0"
enquirer "^2.3.5"
eslint-scope "^5.1.0"
eslint-utils "^2.1.0"
eslint-visitor-keys "^1.3.0"
espree "^7.2.0"
esquery "^1.2.0"
esutils "^2.0.2"
file-entry-cache "^5.0.1"
......@@ -1000,12 +994,11 @@ eslint@^7.1.0:
ignore "^4.0.6"
import-fresh "^3.0.0"
imurmurhash "^0.1.4"
inquirer "^7.0.0"
is-glob "^4.0.0"
js-yaml "^3.13.1"
json-stable-stringify-without-jsonify "^1.0.1"
levn "^0.4.1"
lodash "^4.17.14"
lodash "^4.17.19"
minimatch "^3.0.4"
natural-compare "^1.4.0"
optionator "^0.9.1"
......@@ -1018,14 +1011,14 @@ eslint@^7.1.0:
text-table "^0.2.0"
v8-compile-cache "^2.0.3"
espree@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/espree/-/espree-7.0.0.tgz#8a7a60f218e69f120a842dc24c5a88aa7748a74e"
integrity sha512-/r2XEx5Mw4pgKdyb7GNLQNsu++asx/dltf/CI8RFi9oGHxmQFgvLbc5Op4U6i8Oaj+kdslhJtVlEZeAqH5qOTw==
espree@^7.2.0:
version "7.2.0"
resolved "https://registry.yarnpkg.com/espree/-/espree-7.2.0.tgz#1c263d5b513dbad0ac30c4991b93ac354e948d69"
integrity sha512-H+cQ3+3JYRMEIOl87e7QdHX70ocly5iW4+dttuR8iYSPr/hXKFb+7dBsZ7+u1adC4VrnPlTkv0+OwuPnDop19g==
dependencies:
acorn "^7.1.1"
acorn "^7.3.1"
acorn-jsx "^5.2.0"
eslint-visitor-keys "^1.1.0"
eslint-visitor-keys "^1.3.0"
esprima@^4.0.0:
version "4.0.1"
......@@ -1071,15 +1064,6 @@ extend@3, extend@^3.0.0, extend@~3.0.0, extend@~3.0.2:
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa"
integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==
external-editor@^3.0.3:
version "3.1.0"
resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495"
integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==
dependencies:
chardet "^0.7.0"
iconv-lite "^0.4.24"
tmp "^0.0.33"
extsprintf@1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05"
......@@ -1110,13 +1094,6 @@ fast-levenshtein@^2.0.6:
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=
figures@^3.0.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af"
integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==
dependencies:
escape-string-regexp "^1.0.5"
file-entry-cache@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c"
......@@ -1401,7 +1378,7 @@ https-proxy-agent@^1.0.0:
debug "2"
extend "3"
iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4:
iconv-lite@0.4.24, iconv-lite@^0.4.4:
version "0.4.24"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==
......@@ -1476,25 +1453,6 @@ ini@^1.3.5, ini@~1.3.0:
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"
integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==
inquirer@^7.0.0:
version "7.1.0"
resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.1.0.tgz#1298a01859883e17c7264b82870ae1034f92dd29"
integrity sha512-5fJMWEmikSYu0nv/flMc475MhGbB7TSPd/2IpFV4I4rMklboCH2rQjYY5kKiYGHqUF9gvaambupcJFFG9dvReg==
dependencies:
ansi-escapes "^4.2.1"
chalk "^3.0.0"
cli-cursor "^3.1.0"
cli-width "^2.0.0"
external-editor "^3.0.3"
figures "^3.0.0"
lodash "^4.17.15"
mute-stream "0.0.8"
run-async "^2.4.0"
rxjs "^6.5.3"
string-width "^4.1.0"
strip-ansi "^6.0.0"
through "^2.3.6"
is-binary-path@~2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09"
......@@ -1775,10 +1733,10 @@ koa-router@^9.0.1:
methods "^1.1.2"
path-to-regexp "^6.1.0"
koa@^2.12.0:
version "2.12.0"
resolved "https://registry.yarnpkg.com/koa/-/koa-2.12.0.tgz#c92bfb42defd86f365c31bf63fe918db11fc5c74"
integrity sha512-WlUBj6PXoVhjI5ljMmlyK+eqkbVFW5XQu8twz6bd4WM2E67IwKgPMu5wIFXGxAsZT7sW5xAB54KhY8WAEkLPug==
koa@^2.13.0:
version "2.13.0"
resolved "https://registry.yarnpkg.com/koa/-/koa-2.13.0.tgz#25217e05efd3358a7e5ddec00f0a380c9b71b501"
integrity sha512-i/XJVOfPw7npbMv67+bOeXr3gPqOAw6uh5wFyNs3QvJ47tUx3M3V9rIE0//WytY42MKz4l/MXKyGkQ2LQTfLUQ==
dependencies:
accepts "^1.3.5"
cache-content-type "^1.0.0"
......@@ -1859,11 +1817,16 @@ lodash@^3.10.1:
resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6"
integrity sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=
lodash@^4.15.0, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15:
lodash@^4.15.0, lodash@^4.17.13, lodash@^4.17.14:
version "4.17.15"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
lodash@^4.17.19:
version "4.17.20"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==
long-timeout@0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/long-timeout/-/long-timeout-0.1.1.tgz#9721d788b47e0bcb5a24c2e2bee1a0da55dab514"
......@@ -1913,11 +1876,6 @@ mime-types@^2.1.12, mime-types@^2.1.18, mime-types@~2.1.19, mime-types@~2.1.24:
dependencies:
mime-db "1.44.0"
mimic-fn@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b"
integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==
mimic-response@^1.0.0, mimic-response@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b"
......@@ -1969,10 +1927,10 @@ moment-timezone@^0.5.31:
resolved "https://registry.yarnpkg.com/moment/-/moment-2.27.0.tgz#8bff4e3e26a236220dfe3e36de756b6ebaa0105d"
integrity sha512-al0MUK7cpIcglMv3YF13qSgdAIqxHTO7brRtaz3DlSULbqfazqkc5kEjNrLDOM7fsjshoFIihnU8snrP7zUvhQ==
mongodb@3.5.8:
version "3.5.8"
resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-3.5.8.tgz#34550856449b745d145873734bf922c12d6b9caa"
integrity sha512-jz7mR58z66JKL8Px4ZY+FXbgB7d0a0hEGCT7kw8iye46/gsqPrOEpZOswwJ2BQlfzsrCLKdsF9UcaUfGVN2HrQ==
mongodb@3.6.0:
version "3.6.0"
resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-3.6.0.tgz#babd7172ec717e2ed3f85e079b3f1aa29dce4724"
integrity sha512-/XWWub1mHZVoqEsUppE0GV7u9kanLvHxho6EvBxQbShXTKYF9trhZC2NzbulRGeG7xMJHD8IOWRcdKx5LPjAjQ==
dependencies:
bl "^2.2.0"
bson "^1.1.4"
......@@ -1987,20 +1945,20 @@ mongoose-legacy-pluralize@1.0.2:
resolved "https://registry.yarnpkg.com/mongoose-legacy-pluralize/-/mongoose-legacy-pluralize-1.0.2.tgz#3ba9f91fa507b5186d399fb40854bff18fb563e4"
integrity sha512-Yo/7qQU4/EyIS8YDFSeenIvXxZN+ld7YdV9LqFVQJzTLye8unujAWPZ4NWKfFA+RNjh+wvTWKY9Z3E5XM6ZZiQ==
mongoose@^5.9.17:
version "5.9.17"
resolved "https://registry.yarnpkg.com/mongoose/-/mongoose-5.9.17.tgz#9b74659481807cd9ff5b9c120cdb5087cbbd92bd"
integrity sha512-9EDmTiKrOu/41twlPWUA1aOsdxSN6PRIdFwTpLu4MjyNcJ/vuBE+VewKrN1jsD4oXO5rB8bMYtYxVmJQ02SrPg==
mongoose@^5.9.20:
version "5.10.0"
resolved "https://registry.yarnpkg.com/mongoose/-/mongoose-5.10.0.tgz#05a35f5a3d8485613c9988aeb9548285a97083f7"
integrity sha512-5itAvBMVDG4+zTDtuLg/IyoTxEMgvpOSHnigQ9Cyh8LR4BEgMAChJj7JSaGkg+tr1AjCSY9DgSdU8bHqCOoxXg==
dependencies:
bson "^1.1.4"
kareem "2.3.1"
mongodb "3.5.8"
mongodb "3.6.0"
mongoose-legacy-pluralize "1.0.2"
mpath "0.7.0"
mquery "3.2.2"
ms "2.1.2"
regexp-clone "1.0.0"
safe-buffer "5.1.2"
safe-buffer "5.2.1"
sift "7.0.1"
sliced "1.0.1"
......@@ -2041,11 +1999,6 @@ ms@2.1.2, ms@^2.1.1:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
mute-stream@0.0.8:
version "0.0.8"
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d"
integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==
natural-compare@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
......@@ -2213,13 +2166,6 @@ once@^1.3.0, once@^1.3.1, once@^1.4.0:
dependencies:
wrappy "1"
onetime@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.0.tgz#fff0f3c91617fe62bb50189636e99ac8a6df7be5"
integrity sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==
dependencies:
mimic-fn "^2.1.0"
only@~0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/only/-/only-0.0.2.tgz#2afde84d03e50b9a8edc444e30610a70295edfb4"
......@@ -2247,7 +2193,7 @@ os-homedir@^1.0.0:
resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M=
os-tmpdir@^1.0.0, os-tmpdir@~1.0.2:
os-tmpdir@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=
......@@ -2553,14 +2499,6 @@ responselike@^1.0.2:
dependencies:
lowercase-keys "^1.0.0"
restore-cursor@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e"
integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==
dependencies:
onetime "^5.1.0"
signal-exit "^3.0.2"
retry@^0.8.0:
version "0.8.0"
resolved "https://registry.yarnpkg.com/retry/-/retry-0.8.0.tgz#2367628dc0edb247b1eab649dc53ac8628ac2d5f"
......@@ -2580,24 +2518,12 @@ rimraf@^2.6.1:
dependencies:
glob "^7.1.3"
run-async@^2.4.0:
version "2.4.1"
resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455"
integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==
rxjs@^6.5.3:
version "6.5.5"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.5.tgz#c5c884e3094c8cfee31bf27eb87e54ccfc87f9ec"
integrity sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ==
dependencies:
tslib "^1.9.0"
safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
version "5.1.2"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.2.0:
safe-buffer@5.2.1, safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.2.0:
version "5.2.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
......@@ -2896,18 +2822,6 @@ text-table@^0.2.0:
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=
through@^2.3.6:
version "2.3.8"
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=
tmp@^0.0.33:
version "0.0.33"
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"
integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==
dependencies:
os-tmpdir "~1.0.2"
to-fast-properties@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e"
......@@ -2952,11 +2866,6 @@ tough-cookie@~2.5.0:
psl "^1.1.28"
punycode "^2.1.1"
tslib@^1.9.0:
version "1.13.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.13.0.tgz#c881e13cc7015894ed914862d276436fa9a47043"
integrity sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==
tsscmp@1.0.6:
version "1.0.6"
resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.6.tgz#85b99583ac3589ec4bfef825b5000aa911d605eb"
......@@ -2981,11 +2890,6 @@ type-check@^0.4.0, type-check@~0.4.0:
dependencies:
prelude-ls "^1.2.1"
type-fest@^0.11.0:
version "0.11.0"
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.11.0.tgz#97abf0872310fed88a5c466b25681576145e33f1"
integrity sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==
type-fest@^0.8.1:
version "0.8.1"
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d"
......